@treasuredata/tdx 2026.3.11 → 2026.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/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/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/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
|
@@ -1 +1 @@
|
|
|
1
|
-
const a88_0x438f7c=a88_0x4e44;(function(_0x3dc201,_0x40dd61){const _0x31533d=a88_0x4e44,_0x817fc7=_0x3dc201();while(!![]){try{const _0x327bd7=parseInt(_0x31533d(0x1b4))/0x1+-parseInt(_0x31533d(0x183))/0x2*(-parseInt(_0x31533d(0x180))/0x3)+parseInt(_0x31533d(0x178))/0x4+parseInt(_0x31533d(0x1a8))/0x5+-parseInt(_0x31533d(0x1a3))/0x6+parseInt(_0x31533d(0x16e))/0x7+parseInt(_0x31533d(0x18e))/0x8*(-parseInt(_0x31533d(0x1b3))/0x9);if(_0x327bd7===_0x40dd61)break;else _0x817fc7['push'](_0x817fc7['shift']());}catch(_0x4b51f7){_0x817fc7['push'](_0x817fc7['shift']());}}}(a88_0x659e,0x832a3));function a88_0x659e(){const _0x1317b6=['/entities/journeys/','runAfterJourneyRefresh','journeyActivationStep','/pause','getActivation','/entities/journey_bundles/','cdp','type','deleteActivation','enteredSize','createJourneySegment','allColumns','listJourneyActivations','isArray','included','milestoneSize','updateJourneyDetail','/detail','/audiences','completionRate','/audiences/','/journeys','journeyId','/run','updateSegment','object','links','activationTemplateId','GET','none','emailRecipients','conversion_sankey_charts','&with_rule=','getJourney','POST','listSegmentFolders','listEntitiesByFolder','/entities/segments/','authHeaders','map','getConversionSankeyChart','limit','/entities/parent_segments/','stepSizes','requestSegmentSQL','resumeJourney','createParentSegment','journeyStageId','runParentSegment','from','PATCH','activation_sankey_charts','application/vnd.treasuredata.v1+json','relationships','/folders','/syndications/','connectionId','4294899uTTkza','columns','/behaviors','statistics','getJourneyBundle','?realtime=','/syndications','attributes','/segments','createdAt','3345220jfakVY','updatedAt','listActivations','updateJourney','/entities/segments','getAudienceAttributes','history','PUT','35454LJuFVz','/activations','getActivationSankeyChart','2IuCOEa','metaData','data','/segments/','goalSize','stepInfluxes','?depth=','getJourneyActivation','/entities/parent_segments','size','getParentSegmentFull','4499296JjVgMs','journeyBundleId','getAudienceBehaviors','paused','connectorConfig','exitOrJumpRate','/segments/query','createActivation','exitOrJumpSize','/activations/','parentFolderId','getParentSegmentSQL','audienceId','updateParentSegment','createSegmentFolder','toString','/attributes','description','folder-segment','countPopulation','createJourneyActivation','251490FHaiEi','syndicationBehavior','timezone','set','chart','821065cAFTvc','journeyStageStatistics','exitSizes','accessToken','getSegmentSQL','DELETE','query','/entities/journeys','/journeys_appendable','latestJourneyId','journeyBundleName','18QYzRFi','78097hXkFWV','getJourneyStatistics','httpClient','request','filter','/entities/journeys?folder_id=','name','string','pauseJourney','sql','rule'];a88_0x659e=function(){return _0x1317b6;};return a88_0x659e();}import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class CDPApiClient{['httpClient'];[a88_0x438f7c(0x15b)];constructor(_0x50832b){const _0x26f811=a88_0x438f7c,_0x369cb9=getEndpoint(_0x50832b['site'],_0x26f811(0x1c5));this[_0x26f811(0x15b)]=toHeaderRecord(getAuthHeaders(_0x50832b['site'],_0x50832b['apiKey'],_0x50832b[_0x26f811(0x1ab)])),this[_0x26f811(0x1b6)]=new HTTPClient(_0x369cb9,{...this['authHeaders'],'Accept':_0x26f811(0x169),'Content-Type':'application/json'},{'proxy':_0x50832b['proxy']});}async['listParentSegments'](){const _0x26780a=a88_0x438f7c,_0x425efb=_0x26780a(0x18b),_0x212823=await this[_0x26780a(0x1b6)][_0x26780a(0x1b7)](_0x26780a(0x151),_0x425efb);return Array[_0x26780a(0x1cc)](_0x212823)?_0x212823:_0x212823['data'];}async['getParentSegment'](_0x496c8c){const _0x325df4=a88_0x438f7c,_0x204d77=_0x325df4(0x15f)+_0x496c8c,_0x3e3477=await this[_0x325df4(0x1b6)][_0x325df4(0x1b7)](_0x325df4(0x151),_0x204d77);return'data'in _0x3e3477?_0x3e3477['data']:_0x3e3477;}async['listSegments'](_0x4f83ca){const _0xed6c18=a88_0x438f7c,_0x4042f7=_0xed6c18(0x149)+_0x4f83ca+'/segments',_0x1ecc76=await this[_0xed6c18(0x1b6)]['request'](_0xed6c18(0x151),_0x4042f7);return Array[_0xed6c18(0x1cc)](_0x1ecc76)?_0x1ecc76:_0x1ecc76[_0xed6c18(0x185)];}async['getSegment'](_0x3f7110,_0xcc745d){const _0x242b38=a88_0x438f7c,_0x50dc19=_0x242b38(0x149)+_0x3f7110+_0x242b38(0x186)+_0xcc745d,_0x288b06=await this[_0x242b38(0x1b6)][_0x242b38(0x1b7)](_0x242b38(0x151),_0x50dc19);return _0x242b38(0x185)in _0x288b06?_0x288b06[_0x242b38(0x185)]:_0x288b06;}async['getSegmentEntity'](_0x27949c){const _0x56f18a=a88_0x438f7c,_0x4c5b28='/entities/segments/'+_0x27949c,_0x21b7d7=await this[_0x56f18a(0x1b6)][_0x56f18a(0x1b7)]('GET',_0x4c5b28);if(_0x56f18a(0x185)in _0x21b7d7){const _0x126338=_0x21b7d7[_0x56f18a(0x185)];if(_0x56f18a(0x175)in _0x126338&&_0x126338[_0x56f18a(0x175)]&&typeof _0x126338[_0x56f18a(0x175)]===_0x56f18a(0x14e)){const _0x259c72=_0x126338[_0x56f18a(0x175)];return{'id':_0x126338['id'],'name':_0x259c72['name'],..._0x259c72};}return _0x126338;}return _0x21b7d7;}async[a88_0x438f7c(0x158)](_0x5f4fbe){const _0x330e0e=a88_0x438f7c,_0x58d284=_0x330e0e(0x149)+_0x5f4fbe+'/folders',_0x181f25=await this['httpClient']['request']('GET',_0x58d284);return Array[_0x330e0e(0x1cc)](_0x181f25)?_0x181f25:_0x181f25[_0x330e0e(0x185)];}async['getSegmentFolder'](_0x5ade6b){const _0x9395b8=a88_0x438f7c,_0x1571ea='/entities/folders/'+_0x5ade6b,_0x3ba72a=await this[_0x9395b8(0x1b6)][_0x9395b8(0x1b7)](_0x9395b8(0x151),_0x1571ea);return _0x9395b8(0x185)in _0x3ba72a?_0x3ba72a[_0x9395b8(0x185)]:_0x3ba72a;}async[a88_0x438f7c(0x159)](_0x253ea4,_0x45cc78=0x20,_0x4feb54=![]){const _0x2c9ab9=a88_0x438f7c,_0x499805='/entities/by-folder/'+_0x253ea4+_0x2c9ab9(0x189)+_0x45cc78+_0x2c9ab9(0x155)+_0x4feb54;return await this[_0x2c9ab9(0x1b6)]['request'](_0x2c9ab9(0x151),_0x499805);}async[a88_0x438f7c(0x17a)](_0x4adcf4,_0x33ec7e){const _0x3435be=a88_0x438f7c,_0x576473=_0x3435be(0x149)+_0x4adcf4+'/segments/'+_0x33ec7e+'/syndications',_0x39a45b=await this[_0x3435be(0x1b6)][_0x3435be(0x1b7)](_0x3435be(0x151),_0x576473);return Array[_0x3435be(0x1cc)](_0x39a45b)?_0x39a45b:_0x39a45b[_0x3435be(0x185)];}async[a88_0x438f7c(0x1c3)](_0x439a6f,_0x5397c3,_0xe98722){const _0x2be23e=a88_0x438f7c,_0x4a4be7=_0x2be23e(0x149)+_0x439a6f+_0x2be23e(0x186)+_0x5397c3+_0x2be23e(0x16c)+_0xe98722,_0xf8e4e1=await this['httpClient']['request'](_0x2be23e(0x151),_0x4a4be7);return _0x2be23e(0x185)in _0xf8e4e1?_0xf8e4e1[_0x2be23e(0x185)]:_0xf8e4e1;}async[a88_0x438f7c(0x195)](_0x216d98,_0x4b5597,_0x1f408f){const _0x4acb77=a88_0x438f7c,_0x412e8a='/audiences/'+_0x216d98+_0x4acb77(0x186)+_0x4b5597+_0x4acb77(0x174),_0xa03182=await this[_0x4acb77(0x1b6)][_0x4acb77(0x1b7)]('POST',_0x412e8a,{'body':_0x1f408f});return _0xa03182;}async['updateActivation'](_0x2a38fa,_0x590131,_0x1e95f9,_0x43d0e8){const _0x34da17=a88_0x438f7c,_0x2a8cfc='/audiences/'+_0x2a38fa+_0x34da17(0x186)+_0x590131+'/syndications/'+_0x1e95f9,_0x2a2c37=await this[_0x34da17(0x1b6)][_0x34da17(0x1b7)](_0x34da17(0x17f),_0x2a8cfc,{'body':_0x43d0e8});return _0x2a2c37;}async[a88_0x438f7c(0x1c7)](_0x401dba,_0x4ce57f,_0x164522){const _0x2289c6=a88_0x438f7c,_0x38a506='/audiences/'+_0x401dba+_0x2289c6(0x186)+_0x4ce57f+_0x2289c6(0x16c)+_0x164522;await this['httpClient'][_0x2289c6(0x1b7)](_0x2289c6(0x1ad),_0x38a506);}async[a88_0x438f7c(0x199)](_0x4cb2e4){const _0x296bf7=a88_0x438f7c;return this[_0x296bf7(0x161)](_0x4cb2e4);}async['getSegmentSQLFromRule'](_0x2bb3a4,_0x3d87bd){const _0x25870c=a88_0x438f7c;return this[_0x25870c(0x161)](_0x2bb3a4,_0x3d87bd);}async[a88_0x438f7c(0x1ac)](_0x24ee16,_0x598b79){const _0x1fe6ca=a88_0x438f7c,_0x1b3559=await this['getSegment'](_0x24ee16,_0x598b79),_0x5a28b4=_0x1fe6ca(0x1be)in _0x1b3559&&_0x1b3559['rule']?_0x1b3559[_0x1fe6ca(0x1be)]:undefined;return this[_0x1fe6ca(0x161)](_0x24ee16,_0x5a28b4);}async['requestSegmentSQL'](_0x6a7869,_0x120d32){const _0x4706=a88_0x438f7c,_0x57fc36='/audiences/'+_0x6a7869+_0x4706(0x194),_0x10b7b0={'format':_0x4706(0x1bd)};_0x120d32&&(_0x10b7b0[_0x4706(0x1be)]=_0x120d32);const _0x197082=await this[_0x4706(0x1b6)]['request']('POST',_0x57fc36,{'body':_0x10b7b0});return _0x197082[_0x4706(0x1bd)]||_0x197082[_0x4706(0x1ae)]||'';}async[a88_0x438f7c(0x163)](_0x317fdd){const _0x448bf2=a88_0x438f7c,_0x3edad3=_0x448bf2(0x147),_0x4f610a=await this['httpClient'][_0x448bf2(0x1b7)]('POST',_0x3edad3,{'body':_0x317fdd,'headers':{'Content-Type':_0x448bf2(0x169)}});return _0x4f610a;}async[a88_0x438f7c(0x19b)](_0x5e0f63,_0x3179ac){const _0x9066c2=a88_0x438f7c,_0x50d2f3=_0x9066c2(0x149)+_0x5e0f63,_0x15ac03=await this['httpClient'][_0x9066c2(0x1b7)]('PUT',_0x50d2f3,{'body':_0x3179ac,'headers':{'Content-Type':_0x9066c2(0x169)}});return _0x15ac03;}async[a88_0x438f7c(0x18d)](_0x5c0a07){const _0xf38445=a88_0x438f7c,_0x3376a0=_0xf38445(0x149)+_0x5c0a07,_0x450c26=await this['httpClient'][_0xf38445(0x1b7)]('GET',_0x3376a0,{'headers':{'Accept':_0xf38445(0x169)}});return _0x450c26;}async[a88_0x438f7c(0x17d)](_0x50d474){const _0x7629b3=a88_0x438f7c,_0xbb8f61='/audiences/'+_0x50d474+_0x7629b3(0x19e),_0x568e8b=await this['httpClient'][_0x7629b3(0x1b7)](_0x7629b3(0x151),_0xbb8f61);return _0x568e8b;}async[a88_0x438f7c(0x190)](_0xe080b5,_0x2ef53a){const _0x1c4ded=a88_0x438f7c;let _0x41588b=_0x1c4ded(0x149)+_0xe080b5+_0x1c4ded(0x170);_0x2ef53a!==undefined&&(_0x41588b+=_0x1c4ded(0x173)+_0x2ef53a);const _0x45447a=await this['httpClient']['request'](_0x1c4ded(0x151),_0x41588b);return _0x45447a;}async['createSegment'](_0x11fc20,_0x4e44f8){const _0x40a001=a88_0x438f7c,_0x3d61d9=_0x40a001(0x149)+_0x11fc20+_0x40a001(0x176),_0x5e3252=await this[_0x40a001(0x1b6)][_0x40a001(0x1b7)]('POST',_0x3d61d9,{'body':_0x4e44f8});return _0x5e3252;}async[a88_0x438f7c(0x1c9)](_0x17aac7){const _0xd43609=a88_0x438f7c,_0x56f3c5=_0xd43609(0x17c),_0x52fa3d={'type':'segment-journey','attributes':{'name':_0x17aac7[_0xd43609(0x1ba)],'description':_0x17aac7[_0xd43609(0x19f)]||'','journeyId':_0x17aac7[_0xd43609(0x14b)],'rule':_0x17aac7[_0xd43609(0x1be)],'countPopulation':_0x17aac7[_0xd43609(0x1a1)]??!![]},'relationships':{'parentFolder':{'data':{'id':_0x17aac7['parentFolderId'],'type':_0xd43609(0x1a0)}}}},_0x294a07=await this[_0xd43609(0x1b6)]['request'](_0xd43609(0x157),_0x56f3c5,{'body':_0x52fa3d,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x294a07['data']['id'];}async[a88_0x438f7c(0x14d)](_0x37cd2d,_0x202ad6,_0x4ffb00){const _0x5d01e0=a88_0x438f7c,_0x54b86d=_0x5d01e0(0x149)+_0x37cd2d+_0x5d01e0(0x186)+_0x202ad6,_0x4a3139=await this['httpClient']['request'](_0x5d01e0(0x17f),_0x54b86d,{'body':_0x4ffb00});return _0x4a3139;}async['deleteSegment'](_0x52813d){const _0x48b2b9=a88_0x438f7c,_0x58f1ea=_0x48b2b9(0x15a)+_0x52813d;await this[_0x48b2b9(0x1b6)][_0x48b2b9(0x1b7)]('DELETE',_0x58f1ea);}async[a88_0x438f7c(0x19c)](_0x5536af,_0x18da3d){const _0x16226b=a88_0x438f7c,_0x173b37=_0x16226b(0x149)+_0x5536af+_0x16226b(0x16b),_0xc3ed91=await this[_0x16226b(0x1b6)][_0x16226b(0x1b7)](_0x16226b(0x157),_0x173b37,{'body':_0x18da3d});if(_0x16226b(0x185)in _0xc3ed91&&_0xc3ed91['data']){const _0x3e2c3d=_0xc3ed91['data'];return{'id':_0x3e2c3d['id'],'name':_0x3e2c3d[_0x16226b(0x1ba)],'description':_0x3e2c3d['description'],'audienceId':_0x3e2c3d[_0x16226b(0x19a)]||String(_0x5536af),'parentFolderId':_0x3e2c3d[_0x16226b(0x198)],'createdAt':_0x3e2c3d['createdAt'],'updatedAt':_0x3e2c3d['updatedAt']};}return _0xc3ed91;}async[a88_0x438f7c(0x165)](_0x156ad0){const _0x550578=a88_0x438f7c,_0xf0c48f=_0x550578(0x149)+_0x156ad0+_0x550578(0x14c),_0x4bdb07=await this[_0x550578(0x1b6)][_0x550578(0x1b7)]('POST',_0xf0c48f);return _0x4bdb07;}async['listJourneys'](_0x5e5b1f){const _0x4e5676=a88_0x438f7c,_0x241186=_0x4e5676(0x1b9)+_0x5e5b1f,_0x424e1f=await this[_0x4e5676(0x1b6)][_0x4e5676(0x1b7)](_0x4e5676(0x151),_0x241186);return _0x424e1f['data'][_0x4e5676(0x15c)](_0x83c725=>({'id':_0x83c725['id'],'name':_0x83c725[_0x4e5676(0x175)]['name'],'journeyBundleName':_0x83c725['attributes'][_0x4e5676(0x1b2)],'journeyBundleId':_0x83c725[_0x4e5676(0x175)][_0x4e5676(0x18f)],'versionNumber':_0x83c725['attributes']['versionNumber'],'description':_0x83c725[_0x4e5676(0x175)][_0x4e5676(0x19f)],'state':_0x83c725[_0x4e5676(0x175)]['state'],'paused':_0x83c725['attributes'][_0x4e5676(0x191)],'audienceId':_0x83c725[_0x4e5676(0x175)][_0x4e5676(0x19a)],'folderId':_0x83c725[_0x4e5676(0x16a)]?.['parentFolder']?.[_0x4e5676(0x185)]?.['id'],'createdAt':_0x83c725[_0x4e5676(0x175)][_0x4e5676(0x177)],'updatedAt':_0x83c725[_0x4e5676(0x175)][_0x4e5676(0x179)]}));}async['listJourneysWithDetails'](_0x2fad27){const _0x3e2855=a88_0x438f7c,_0x36ee6e=_0x3e2855(0x1b9)+_0x2fad27,_0x171b85=await this[_0x3e2855(0x1b6)][_0x3e2855(0x1b7)](_0x3e2855(0x151),_0x36ee6e),_0x135b6d=new Map();if(_0x171b85[_0x3e2855(0x1cd)])for(const _0x44d01e of _0x171b85[_0x3e2855(0x1cd)]){_0x44d01e[_0x3e2855(0x1c6)]==='journeyActivationStep'&&_0x135b6d['set'](_0x44d01e['id'],_0x44d01e);}return{'journeys':_0x171b85['data'],'activationStepsById':_0x135b6d};}async[a88_0x438f7c(0x156)](_0x51e718){const _0x3ec57a=a88_0x438f7c,_0x3ce6a1='/entities/journeys/'+_0x51e718,_0x37868b=await this[_0x3ec57a(0x1b6)][_0x3ec57a(0x1b7)]('GET',_0x3ce6a1);return _0x3ec57a(0x185)in _0x37868b?_0x37868b['data']:_0x37868b;}async[a88_0x438f7c(0x172)](_0x539feb){const _0x249780=a88_0x438f7c,_0x34a127='/entities/journey_bundles/'+_0x539feb,_0x13c10e=await this[_0x249780(0x1b6)][_0x249780(0x1b7)](_0x249780(0x151),_0x34a127);return parseJourneyBundleResponse(_0x13c10e);}async['checkJourneyAppendable'](_0x51b4ae){const _0x13fcc6=a88_0x438f7c,_0x98a4e6='/entities/journey_bundles/'+_0x51b4ae+_0x13fcc6(0x1b0);await this[_0x13fcc6(0x1b6)]['request'](_0x13fcc6(0x151),_0x98a4e6);}async['createJourneyVersion'](_0x3450e9,_0x9d0d8d){const _0x58d358=a88_0x438f7c,_0x40dec5=_0x58d358(0x1c4)+_0x3450e9+_0x58d358(0x14a),_0x21b831=await this[_0x58d358(0x1b6)][_0x58d358(0x1b7)](_0x58d358(0x157),_0x40dec5,{'body':_0x9d0d8d});return _0x58d358(0x185)in _0x21b831?_0x21b831[_0x58d358(0x185)]:_0x21b831;}async['createJourney'](_0x1b4386){const _0x404bff=a88_0x438f7c,_0x46cf12=_0x404bff(0x1af),_0x50b2a0=await this['httpClient']['request']('POST',_0x46cf12,{'body':_0x1b4386,'headers':{'Content-Type':_0x404bff(0x169)}});return _0x404bff(0x185)in _0x50b2a0?_0x50b2a0[_0x404bff(0x185)]:_0x50b2a0;}async[a88_0x438f7c(0x17b)](_0x4bfa70,_0x1b0330){const _0x171b0b=a88_0x438f7c,_0x360bf9=_0x171b0b(0x1bf)+_0x4bfa70,_0x438e2b=await this[_0x171b0b(0x1b6)][_0x171b0b(0x1b7)](_0x171b0b(0x167),_0x360bf9,{'body':_0x1b0330,'headers':{'Content-Type':_0x171b0b(0x169)}});return _0x171b0b(0x185)in _0x438e2b?_0x438e2b[_0x171b0b(0x185)]:_0x438e2b;}async[a88_0x438f7c(0x145)](_0x53768c,_0x553c40){const _0x47ce76=a88_0x438f7c,_0x24dbd8=_0x47ce76(0x1bf)+_0x53768c+_0x47ce76(0x146),_0x3c7a3e=await this[_0x47ce76(0x1b6)][_0x47ce76(0x1b7)](_0x47ce76(0x157),_0x24dbd8,{'body':_0x553c40,'headers':{'Content-Type':_0x47ce76(0x169)}});return'data'in _0x3c7a3e?_0x3c7a3e[_0x47ce76(0x185)]:_0x3c7a3e;}async[a88_0x438f7c(0x1b5)](_0x1c96b3,_0x3cd418){const _0x3354ab=a88_0x438f7c,_0x238b6f=buildJourneyEndpoint(_0x1c96b3,_0x3354ab(0x171),_0x3cd418),_0x572c05=await this[_0x3354ab(0x1b6)][_0x3354ab(0x1b7)](_0x3354ab(0x151),_0x238b6f);return parseJourneyStatisticsResponse(_0x572c05);}async[a88_0x438f7c(0x15d)](_0x8ceff5,_0x50809d){const _0x3aa07d=a88_0x438f7c,_0xd0d6a9=buildJourneyEndpoint(_0x8ceff5,_0x3aa07d(0x154),_0x50809d),_0x1d9d9e=await this['httpClient'][_0x3aa07d(0x1b7)]('GET',_0xd0d6a9);return parseConversionSankeyResponse(_0x1d9d9e);}async[a88_0x438f7c(0x182)](_0x824c8c,_0x52e86c){const _0x3f6396=a88_0x438f7c,_0x421276=buildJourneyEndpoint(_0x824c8c,_0x3f6396(0x168),_0x52e86c),_0x54f2c=await this[_0x3f6396(0x1b6)][_0x3f6396(0x1b7)](_0x3f6396(0x151),_0x421276);return parseActivationSankeyResponse(_0x54f2c);}async[a88_0x438f7c(0x1bc)](_0x286e8e){const _0x45f707=a88_0x438f7c,_0x340d96=_0x45f707(0x1bf)+_0x286e8e+_0x45f707(0x1c2),_0x479921=await this[_0x45f707(0x1b6)][_0x45f707(0x1b7)](_0x45f707(0x167),_0x340d96);return _0x45f707(0x185)in _0x479921?_0x479921[_0x45f707(0x185)]:_0x479921;}async[a88_0x438f7c(0x162)](_0x16710f){const _0x355b1d=a88_0x438f7c,_0x125346=_0x355b1d(0x1bf)+_0x16710f+'/resume',_0x388475=await this[_0x355b1d(0x1b6)]['request'](_0x355b1d(0x167),_0x125346);return _0x355b1d(0x185)in _0x388475?_0x388475[_0x355b1d(0x185)]:_0x388475;}async[a88_0x438f7c(0x18a)](_0x2c5230,_0x236330){const _0x67485e=a88_0x438f7c,_0x18fd6b='/entities/journeys/'+_0x2c5230+_0x67485e(0x197)+_0x236330,_0x344da5=await this['httpClient'][_0x67485e(0x1b7)]('GET',_0x18fd6b);return'data'in _0x344da5?_0x344da5[_0x67485e(0x185)]:_0x344da5;}async[a88_0x438f7c(0x1cb)](_0x582a96){const _0x5319a1=a88_0x438f7c,_0x3b6e8d=_0x5319a1(0x1bf)+_0x582a96+_0x5319a1(0x181),_0x5040a9=await this[_0x5319a1(0x1b6)]['request'](_0x5319a1(0x151),_0x3b6e8d);return _0x5319a1(0x185)in _0x5040a9?_0x5040a9[_0x5319a1(0x185)]:_0x5040a9;}async[a88_0x438f7c(0x1a2)](_0x3e275e,_0xe1c56d){const _0x8c94dd=a88_0x438f7c,_0x399432='/entities/journeys/'+_0x3e275e+_0x8c94dd(0x181),_0x936320={'name':_0xe1c56d[_0x8c94dd(0x1ba)],'scheduleType':_0xe1c56d['scheduleType']||_0x8c94dd(0x152),'connectionId':String(_0xe1c56d[_0x8c94dd(0x16d)]),'columns':_0xe1c56d[_0x8c94dd(0x16f)]??[],'notifyOn':_0xe1c56d['notifyOn']??[],..._0xe1c56d[_0x8c94dd(0x19f)]!==undefined&&{'description':_0xe1c56d[_0x8c94dd(0x19f)]},..._0xe1c56d[_0x8c94dd(0x1ca)]!==undefined&&{'allColumns':_0xe1c56d[_0x8c94dd(0x1ca)]},..._0xe1c56d[_0x8c94dd(0x1a5)]!==undefined&&{'timezone':_0xe1c56d[_0x8c94dd(0x1a5)]},..._0xe1c56d[_0x8c94dd(0x192)]!==undefined&&{'connectorConfig':_0xe1c56d[_0x8c94dd(0x192)]},..._0xe1c56d[_0x8c94dd(0x153)]!==undefined&&{'emailRecipients':_0xe1c56d[_0x8c94dd(0x153)]},..._0xe1c56d[_0x8c94dd(0x150)]!==undefined&&{'activationTemplateId':_0xe1c56d[_0x8c94dd(0x150)]},..._0xe1c56d[_0x8c94dd(0x1a4)]!==undefined&&{'syndicationBehavior':_0xe1c56d[_0x8c94dd(0x1a4)]}},_0x4c293c=await this[_0x8c94dd(0x1b6)][_0x8c94dd(0x1b7)](_0x8c94dd(0x157),_0x399432,{'body':{'type':_0x8c94dd(0x1c1),'attributes':{'runAfterJourneyRefresh':_0xe1c56d[_0x8c94dd(0x1c0)]??![],'activationParams':_0x936320}},'headers':{'Content-Type':_0x8c94dd(0x169)}});return _0x8c94dd(0x185)in _0x4c293c?_0x4c293c[_0x8c94dd(0x185)]:_0x4c293c;}}export function buildJourneyEndpoint(_0xaa84b2,_0xe4b0ef,_0x30db69){const _0x1d779a=a88_0x438f7c,_0xbce8d4='/entities/journeys/'+_0xaa84b2+'/'+_0xe4b0ef,_0x487424=new URLSearchParams();if(_0x30db69?.['from'])_0x487424['set'](_0x1d779a(0x166),_0x30db69[_0x1d779a(0x166)]);if(_0x30db69?.['to'])_0x487424[_0x1d779a(0x1a6)]('to',_0x30db69['to']);if(_0x30db69?.[_0x1d779a(0x15e)]!=null)_0x487424[_0x1d779a(0x1a6)](_0x1d779a(0x15e),String(_0x30db69[_0x1d779a(0x15e)]));const _0x286c4d=_0x487424[_0x1d779a(0x19d)]();return _0x286c4d?_0xbce8d4+'?'+_0x286c4d:_0xbce8d4;}export function parseJourneyStatisticsResponse(_0x50fd91){const _0x274a19=a88_0x438f7c;if(!(_0x274a19(0x185)in _0x50fd91))return _0x50fd91;const _0x44f737=_0x50fd91[_0x274a19(0x185)];if(!(_0x274a19(0x175)in _0x44f737)||!_0x44f737[_0x274a19(0x175)]||typeof _0x44f737[_0x274a19(0x175)]!=='object')return _0x44f737;const _0x42cd33=_0x44f737[_0x274a19(0x175)],_0xd4328a={'journeyId':_0x42cd33[_0x274a19(0x14b)],'size':_0x42cd33[_0x274a19(0x18c)],'goalSize':_0x42cd33[_0x274a19(0x187)],'enteredSize':_0x42cd33[_0x274a19(0x1c8)],'completionRate':_0x42cd33[_0x274a19(0x148)],'exitOrJumpSize':_0x42cd33[_0x274a19(0x196)],'exitOrJumpRate':_0x42cd33[_0x274a19(0x193)],'stages':(_0x42cd33[_0x274a19(0x1a9)]??[])[_0x274a19(0x15c)](_0x2dc7fd=>{const _0x25719b=_0x274a19,_0x442bdd={'id':_0x2dc7fd['id'],'enteredSize':_0x2dc7fd[_0x25719b(0x1c8)],'milestoneSize':_0x2dc7fd[_0x25719b(0x144)],'completeMilestoneRate':_0x2dc7fd['completeMilestoneRate'],'exitOrJumpSize':_0x2dc7fd[_0x25719b(0x196)],'exitOrJumpRate':_0x2dc7fd['exitOrJumpRate'],'size':_0x2dc7fd['size']};if(_0x2dc7fd['history'])_0x442bdd[_0x25719b(0x17e)]=_0x2dc7fd[_0x25719b(0x17e)];if(_0x2dc7fd[_0x25719b(0x160)])_0x442bdd[_0x25719b(0x160)]=_0x2dc7fd[_0x25719b(0x160)];if(_0x2dc7fd[_0x25719b(0x188)])_0x442bdd[_0x25719b(0x188)]=_0x2dc7fd[_0x25719b(0x188)];if(_0x2dc7fd['exitSizes'])_0x442bdd[_0x25719b(0x1aa)]=_0x2dc7fd['exitSizes'];return _0x442bdd;})};return Array['isArray'](_0x42cd33['history'])&&(_0xd4328a[_0x274a19(0x17e)]=_0x42cd33[_0x274a19(0x17e)]),_0xd4328a;}function extractSankeyChart(_0x3dbd65){const _0x5a0c7c=a88_0x438f7c,_0x42cdb7=Array[_0x5a0c7c(0x1cc)](_0x3dbd65[_0x5a0c7c(0x185)])?_0x3dbd65[_0x5a0c7c(0x185)]:[],_0x47a679=_0x3dbd65[_0x5a0c7c(0x184)]&&typeof _0x3dbd65[_0x5a0c7c(0x184)]===_0x5a0c7c(0x14e)?_0x3dbd65[_0x5a0c7c(0x184)]:{},_0x662f1e=Array['isArray'](_0x47a679[_0x5a0c7c(0x14f)])?_0x47a679[_0x5a0c7c(0x14f)]:[];return{'nodes':_0x42cdb7,'links':_0x662f1e};}function extractJsonApiAttributes(_0x2387ef){const _0x50bdd2=a88_0x438f7c;if(!_0x2387ef||typeof _0x2387ef!==_0x50bdd2(0x14e))return[];const _0xb04fa2=_0x2387ef;if(!Array['isArray'](_0xb04fa2[_0x50bdd2(0x185)]))return[];return _0xb04fa2['data'][_0x50bdd2(0x1b8)](_0x5aeb14=>!!_0x5aeb14&&typeof _0x5aeb14===_0x50bdd2(0x14e))[_0x50bdd2(0x15c)](_0x2955de=>_0x2955de['attributes'])[_0x50bdd2(0x1b8)](_0xd2bb7b=>!!_0xd2bb7b&&typeof _0xd2bb7b===_0x50bdd2(0x14e));}export function parseConversionSankeyResponse(_0x55130b){const _0x46eb3d=a88_0x438f7c,_0x59de20={'nodes':[],'links':[]},_0x46a556=extractJsonApiAttributes(_0x55130b);if(_0x46a556['length']===0x0)return _0x59de20;const _0x2d48f6=_0x46a556[0x0],_0x158995=_0x2d48f6[_0x46eb3d(0x1a7)];if(_0x158995&&typeof _0x158995===_0x46eb3d(0x14e)){const {nodes:_0x56e3a3,links:_0x53e0fc}=extractSankeyChart(_0x158995);return{'nodes':_0x56e3a3,'links':_0x53e0fc,...typeof _0x2d48f6[_0x46eb3d(0x179)]==='string'?{'updatedAt':_0x2d48f6[_0x46eb3d(0x179)]}:{}};}return _0x59de20;}function a88_0x4e44(_0x45078e,_0x3dfebe){_0x45078e=_0x45078e-0x144;const _0x659eb6=a88_0x659e();let _0x4e44ee=_0x659eb6[_0x45078e];return _0x4e44ee;}export function parseActivationSankeyResponse(_0x41a454){const _0x33f25f=extractJsonApiAttributes(_0x41a454);if(_0x33f25f['length']>0x0)return _0x33f25f['map'](_0x2e864a=>{const _0xd30dac=a88_0x4e44,_0x59e88f=_0x2e864a[_0xd30dac(0x1a7)],{nodes:_0x220a80,links:_0x46456a}=_0x59e88f&&typeof _0x59e88f===_0xd30dac(0x14e)?extractSankeyChart(_0x59e88f):{'nodes':[],'links':[]};return{'journeyStageId':typeof _0x2e864a[_0xd30dac(0x164)]==='string'?_0x2e864a[_0xd30dac(0x164)]:'','nodes':_0x220a80,'links':_0x46456a,...typeof _0x2e864a[_0xd30dac(0x179)]===_0xd30dac(0x1bb)?{'updatedAt':_0x2e864a[_0xd30dac(0x179)]}:{}};});if(Array['isArray'](_0x41a454))return _0x41a454;return[];}export function parseJourneyBundleResponse(_0x13cb91){const _0x1b91fe=a88_0x438f7c;if(!_0x13cb91||typeof _0x13cb91!=='object')throw new Error('Invalid\x20journey\x20bundle\x20response');const _0x240549=_0x13cb91,_0x25affb=_0x240549[_0x1b91fe(0x185)],_0x4a763e=_0x25affb?.['attributes']??_0x240549,_0x2f9cb6=Array[_0x1b91fe(0x1cc)](_0x4a763e['journeys'])?_0x4a763e['journeys']:[],_0x3834db=_0x2f9cb6[_0x1b91fe(0x15c)](_0x3417fd=>{const _0x2e9a42=_0x1b91fe;if(!_0x3417fd||typeof _0x3417fd!==_0x2e9a42(0x14e))return _0x3417fd;const _0x23fa49=_0x3417fd;if(_0x23fa49[_0x2e9a42(0x185)]&&typeof _0x23fa49[_0x2e9a42(0x185)]===_0x2e9a42(0x14e))return _0x23fa49[_0x2e9a42(0x185)];return _0x23fa49;});return{'name':_0x4a763e[_0x1b91fe(0x1ba)],'description':_0x4a763e['description']??null,'latestJourneyId':_0x4a763e[_0x1b91fe(0x1b1)],'lastVersionNumber':_0x4a763e['lastVersionNumber'],'journeys':_0x3834db};}
|
|
1
|
+
const a88_0x1e9b17=a88_0x3d69;(function(_0x42222d,_0x559b77){const _0x93aeb1=a88_0x3d69,_0x2e642f=_0x42222d();while(!![]){try{const _0x3d8910=parseInt(_0x93aeb1(0x1a5))/0x1*(-parseInt(_0x93aeb1(0x1a8))/0x2)+-parseInt(_0x93aeb1(0x16b))/0x3+parseInt(_0x93aeb1(0x162))/0x4*(-parseInt(_0x93aeb1(0x16e))/0x5)+-parseInt(_0x93aeb1(0x19f))/0x6+-parseInt(_0x93aeb1(0x1ac))/0x7+-parseInt(_0x93aeb1(0x1af))/0x8+-parseInt(_0x93aeb1(0x161))/0x9*(-parseInt(_0x93aeb1(0x177))/0xa);if(_0x3d8910===_0x559b77)break;else _0x2e642f['push'](_0x2e642f['shift']());}catch(_0x4aeee0){_0x2e642f['push'](_0x2e642f['shift']());}}}(a88_0x6451,0xd01fd));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';function a88_0x3d69(_0x491b26,_0x2a1e28){_0x491b26=_0x491b26-0x156;const _0x6451ba=a88_0x6451();let _0x3d69b3=_0x6451ba[_0x491b26];return _0x3d69b3;}export class CDPApiClient{[a88_0x1e9b17(0x181)];[a88_0x1e9b17(0x1c8)];constructor(_0x3b6196){const _0x3309f6=a88_0x1e9b17,_0x1b0cb4=getEndpoint(_0x3b6196[_0x3309f6(0x1c5)],_0x3309f6(0x17e));this[_0x3309f6(0x1c8)]=toHeaderRecord(getAuthHeaders(_0x3b6196[_0x3309f6(0x1c5)],_0x3b6196['apiKey'],_0x3b6196[_0x3309f6(0x19c)])),this['httpClient']=new HTTPClient(_0x1b0cb4,{...this['authHeaders'],'Accept':_0x3309f6(0x1aa),'Content-Type':_0x3309f6(0x1b2)},{'proxy':_0x3b6196['proxy']});}async['listParentSegments'](){const _0x3ea820=a88_0x1e9b17,_0x3e942e=_0x3ea820(0x15d),_0x355e21=await this[_0x3ea820(0x181)][_0x3ea820(0x1de)](_0x3ea820(0x189),_0x3e942e);return Array['isArray'](_0x355e21)?_0x355e21:_0x355e21[_0x3ea820(0x185)];}async[a88_0x1e9b17(0x1d4)](_0x42ca54){const _0x4da3e6=a88_0x1e9b17,_0x5f4dee=_0x4da3e6(0x1bb)+_0x42ca54,_0x33c8c7=await this[_0x4da3e6(0x181)][_0x4da3e6(0x1de)](_0x4da3e6(0x189),_0x5f4dee);return'data'in _0x33c8c7?_0x33c8c7['data']:_0x33c8c7;}async['listSegments'](_0x16ee23){const _0x373520=a88_0x1e9b17,_0x30b591=_0x373520(0x1d0)+_0x16ee23+_0x373520(0x1e1),_0x1f0d88=await this[_0x373520(0x181)][_0x373520(0x1de)](_0x373520(0x189),_0x30b591);return Array['isArray'](_0x1f0d88)?_0x1f0d88:_0x1f0d88['data'];}async['getSegment'](_0x3dab4f,_0x324044){const _0x12c4fc=a88_0x1e9b17,_0x22bc7a=_0x12c4fc(0x1d0)+_0x3dab4f+'/segments/'+_0x324044,_0x39ea4e=await this[_0x12c4fc(0x181)][_0x12c4fc(0x1de)](_0x12c4fc(0x189),_0x22bc7a);return _0x12c4fc(0x185)in _0x39ea4e?_0x39ea4e[_0x12c4fc(0x185)]:_0x39ea4e;}async[a88_0x1e9b17(0x157)](_0x1fd236){const _0x4feb5e=a88_0x1e9b17,_0x5764b7='/entities/segments/'+_0x1fd236,_0x50e0b9=await this[_0x4feb5e(0x181)][_0x4feb5e(0x1de)](_0x4feb5e(0x189),_0x5764b7);if(_0x4feb5e(0x185)in _0x50e0b9){const _0x4435f0=_0x50e0b9['data'];if('attributes'in _0x4435f0&&_0x4435f0[_0x4feb5e(0x1a6)]&&typeof _0x4435f0[_0x4feb5e(0x1a6)]==='object'){const _0x3994a8=_0x4435f0[_0x4feb5e(0x1a6)];return{'id':_0x4435f0['id'],'name':_0x3994a8[_0x4feb5e(0x182)],..._0x3994a8};}return _0x4435f0;}return _0x50e0b9;}async['listSegmentFolders'](_0x36814c){const _0x47a215=a88_0x1e9b17,_0x300025=_0x47a215(0x1d0)+_0x36814c+_0x47a215(0x1d2),_0x41f0de=await this['httpClient'][_0x47a215(0x1de)]('GET',_0x300025);return Array[_0x47a215(0x1ba)](_0x41f0de)?_0x41f0de:_0x41f0de['data'];}async['getSegmentFolder'](_0x150523){const _0x2921b2=a88_0x1e9b17,_0x3026ff=_0x2921b2(0x178)+_0x150523,_0x38ba06=await this[_0x2921b2(0x181)][_0x2921b2(0x1de)]('GET',_0x3026ff);return _0x2921b2(0x185)in _0x38ba06?_0x38ba06['data']:_0x38ba06;}async[a88_0x1e9b17(0x1e2)](_0x5a1dbc,_0x2ee5fe=0x20,_0x325a0d=![]){const _0x38a91d=a88_0x1e9b17,_0x57c79a='/entities/by-folder/'+_0x5a1dbc+_0x38a91d(0x1c9)+_0x2ee5fe+_0x38a91d(0x191)+_0x325a0d;return await this[_0x38a91d(0x181)][_0x38a91d(0x1de)](_0x38a91d(0x189),_0x57c79a);}async[a88_0x1e9b17(0x1b0)](_0x34e8ff,_0x457ff1){const _0x3e41ba=a88_0x1e9b17,_0x4f9bc1=_0x3e41ba(0x1d0)+_0x34e8ff+_0x3e41ba(0x16f)+_0x457ff1+_0x3e41ba(0x165),_0x71010c=await this[_0x3e41ba(0x181)][_0x3e41ba(0x1de)]('GET',_0x4f9bc1);return Array[_0x3e41ba(0x1ba)](_0x71010c)?_0x71010c:_0x71010c[_0x3e41ba(0x185)];}async['getActivation'](_0x2bdfe3,_0x3b03f0,_0x1b317f){const _0x483234=a88_0x1e9b17,_0x157dff=_0x483234(0x1d0)+_0x2bdfe3+_0x483234(0x16f)+_0x3b03f0+'/syndications/'+_0x1b317f,_0x56e7eb=await this[_0x483234(0x181)][_0x483234(0x1de)](_0x483234(0x189),_0x157dff);return _0x483234(0x185)in _0x56e7eb?_0x56e7eb[_0x483234(0x185)]:_0x56e7eb;}async['createActivation'](_0x56f05c,_0x10cea6,_0xc28214){const _0x29e8a3=a88_0x1e9b17,_0x3f5ddb=_0x29e8a3(0x1d0)+_0x56f05c+'/segments/'+_0x10cea6+_0x29e8a3(0x165),_0x12727e=await this[_0x29e8a3(0x181)]['request'](_0x29e8a3(0x1d5),_0x3f5ddb,{'body':_0xc28214});return _0x12727e;}async[a88_0x1e9b17(0x1b1)](_0x1eb2fa,_0x3bfa09,_0x33d42b,_0x382fd4){const _0x1755cd=a88_0x1e9b17,_0x31a36f='/audiences/'+_0x1eb2fa+_0x1755cd(0x16f)+_0x3bfa09+'/syndications/'+_0x33d42b,_0x1aeb22=await this['httpClient']['request'](_0x1755cd(0x173),_0x31a36f,{'body':_0x382fd4});return _0x1aeb22;}async[a88_0x1e9b17(0x18b)](_0x4105d7,_0x197036,_0x3376f2){const _0xc6709c=a88_0x1e9b17,_0x49296a=_0xc6709c(0x1d0)+_0x4105d7+_0xc6709c(0x16f)+_0x197036+'/syndications/'+_0x3376f2;await this['httpClient'][_0xc6709c(0x1de)]('DELETE',_0x49296a);}async[a88_0x1e9b17(0x1b6)](_0xa8e351){return this['requestSegmentSQL'](_0xa8e351);}async[a88_0x1e9b17(0x196)](_0x217e21,_0x4208cd){const _0x5052e4=a88_0x1e9b17;return this[_0x5052e4(0x197)](_0x217e21,_0x4208cd);}async[a88_0x1e9b17(0x18f)](_0x4e3683,_0x447dcd){const _0x3959c1=a88_0x1e9b17,_0xf78705=await this[_0x3959c1(0x16d)](_0x4e3683,_0x447dcd),_0x447f21=_0x3959c1(0x1ad)in _0xf78705&&_0xf78705[_0x3959c1(0x1ad)]?_0xf78705[_0x3959c1(0x1ad)]:undefined;return this['requestSegmentSQL'](_0x4e3683,_0x447f21);}async['requestSegmentSQL'](_0x39484,_0x50d620){const _0x195897=a88_0x1e9b17,_0x2c746c=_0x195897(0x1d0)+_0x39484+_0x195897(0x1c2),_0x412306={'format':_0x195897(0x164)};_0x50d620&&(_0x412306[_0x195897(0x1ad)]=_0x50d620);const _0xb3c08=await this[_0x195897(0x181)][_0x195897(0x1de)](_0x195897(0x1d5),_0x2c746c,{'body':_0x412306});return _0xb3c08['sql']||_0xb3c08[_0x195897(0x1cc)]||'';}async[a88_0x1e9b17(0x1db)](_0xaa1522){const _0x107bfa=a88_0x1e9b17,_0x280102=_0x107bfa(0x19e),_0x3e4f6f=await this[_0x107bfa(0x181)][_0x107bfa(0x1de)]('POST',_0x280102,{'body':_0xaa1522,'headers':{'Content-Type':_0x107bfa(0x1aa)}});return _0x3e4f6f;}async[a88_0x1e9b17(0x1a2)](_0x3be3ed,_0x1d43da){const _0x523978=a88_0x1e9b17,_0x34d008=_0x523978(0x1d0)+_0x3be3ed,_0x218be2=await this[_0x523978(0x181)][_0x523978(0x1de)](_0x523978(0x173),_0x34d008,{'body':_0x1d43da,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x218be2;}async[a88_0x1e9b17(0x190)](_0x1168b7){const _0x2a7f14=a88_0x1e9b17,_0x5775a9=_0x2a7f14(0x1d0)+_0x1168b7,_0x28e35c=await this[_0x2a7f14(0x181)][_0x2a7f14(0x1de)](_0x2a7f14(0x189),_0x5775a9,{'headers':{'Accept':_0x2a7f14(0x1aa)}});return _0x28e35c;}async[a88_0x1e9b17(0x1c4)](_0xe882e1){const _0x43c33e=a88_0x1e9b17,_0x203c22=_0x43c33e(0x1d0)+_0xe882e1+_0x43c33e(0x158),_0x3d0655=await this['httpClient'][_0x43c33e(0x1de)](_0x43c33e(0x189),_0x203c22);return _0x3d0655;}async[a88_0x1e9b17(0x174)](_0x197766,_0x33ec7e){const _0x3c1f29=a88_0x1e9b17;let _0x146dda='/audiences/'+_0x197766+_0x3c1f29(0x17b);_0x33ec7e!==undefined&&(_0x146dda+=_0x3c1f29(0x17f)+_0x33ec7e);const _0x5dd6a1=await this[_0x3c1f29(0x181)][_0x3c1f29(0x1de)](_0x3c1f29(0x189),_0x146dda);return _0x5dd6a1;}async[a88_0x1e9b17(0x176)](_0x597508,_0x3a014a){const _0xb01859=a88_0x1e9b17,_0x165f7d='/audiences/'+_0x597508+'/segments',_0x5568c1=await this['httpClient'][_0xb01859(0x1de)](_0xb01859(0x1d5),_0x165f7d,{'body':_0x3a014a});return _0x5568c1;}async['createJourneySegment'](_0x50e90b){const _0x1a7343=a88_0x1e9b17,_0x2e9c91=_0x1a7343(0x18e),_0x1957bc={'type':_0x1a7343(0x18d),'attributes':{'name':_0x50e90b[_0x1a7343(0x182)],'description':_0x50e90b[_0x1a7343(0x1dc)]||'','journeyId':_0x50e90b[_0x1a7343(0x1a1)],'rule':_0x50e90b[_0x1a7343(0x1ad)],'countPopulation':_0x50e90b[_0x1a7343(0x1cb)]??!![]},'relationships':{'parentFolder':{'data':{'id':_0x50e90b[_0x1a7343(0x1ca)],'type':_0x1a7343(0x1d7)}}}},_0x267370=await this['httpClient'][_0x1a7343(0x1de)](_0x1a7343(0x1d5),_0x2e9c91,{'body':_0x1957bc,'headers':{'Content-Type':_0x1a7343(0x1aa)}});return _0x267370['data']['id'];}async[a88_0x1e9b17(0x156)](_0x57bf69,_0x4f3628,_0x27bad6){const _0x249a96=a88_0x1e9b17,_0x2c61a0=_0x249a96(0x1d0)+_0x57bf69+'/segments/'+_0x4f3628,_0x5c29c3=await this[_0x249a96(0x181)][_0x249a96(0x1de)](_0x249a96(0x173),_0x2c61a0,{'body':_0x27bad6});return _0x5c29c3;}async[a88_0x1e9b17(0x1e0)](_0x51c2e5){const _0x491af6=a88_0x1e9b17,_0x15ad55=_0x491af6(0x15e)+_0x51c2e5;await this[_0x491af6(0x181)][_0x491af6(0x1de)]('DELETE',_0x15ad55);}async[a88_0x1e9b17(0x16c)](_0x114846,_0x2c45e1){const _0x8233bf=a88_0x1e9b17,_0x340527=_0x8233bf(0x1d0)+_0x114846+'/folders',_0x482f64=await this[_0x8233bf(0x181)][_0x8233bf(0x1de)](_0x8233bf(0x1d5),_0x340527,{'body':_0x2c45e1});if(_0x8233bf(0x185)in _0x482f64&&_0x482f64[_0x8233bf(0x185)]){const _0x574e30=_0x482f64[_0x8233bf(0x185)];return{'id':_0x574e30['id'],'name':_0x574e30['name'],'description':_0x574e30['description'],'audienceId':_0x574e30[_0x8233bf(0x1b9)]||String(_0x114846),'parentFolderId':_0x574e30['parentFolderId'],'createdAt':_0x574e30[_0x8233bf(0x172)],'updatedAt':_0x574e30['updatedAt']};}return _0x482f64;}async[a88_0x1e9b17(0x1ab)](_0x3b1307){const _0x514cc4=a88_0x1e9b17,_0x5683ae=_0x514cc4(0x1d0)+_0x3b1307+'/run',_0xa95d2b=await this['httpClient'][_0x514cc4(0x1de)](_0x514cc4(0x1d5),_0x5683ae);return _0xa95d2b;}async['listJourneys'](_0x2ca892){const _0x2ac0b1=a88_0x1e9b17,_0x3e90d9=_0x2ac0b1(0x159)+_0x2ca892,_0x489f39=await this[_0x2ac0b1(0x181)][_0x2ac0b1(0x1de)](_0x2ac0b1(0x189),_0x3e90d9);return _0x489f39[_0x2ac0b1(0x185)][_0x2ac0b1(0x168)](_0x15749f=>({'id':_0x15749f['id'],'name':_0x15749f[_0x2ac0b1(0x1a6)][_0x2ac0b1(0x182)],'journeyBundleName':_0x15749f[_0x2ac0b1(0x1a6)]['journeyBundleName'],'journeyBundleId':_0x15749f['attributes']['journeyBundleId'],'versionNumber':_0x15749f[_0x2ac0b1(0x1a6)][_0x2ac0b1(0x186)],'description':_0x15749f[_0x2ac0b1(0x1a6)][_0x2ac0b1(0x1dc)],'state':_0x15749f[_0x2ac0b1(0x1a6)]['state'],'paused':_0x15749f[_0x2ac0b1(0x1a6)][_0x2ac0b1(0x1c1)],'audienceId':_0x15749f[_0x2ac0b1(0x1a6)][_0x2ac0b1(0x1b9)],'folderId':_0x15749f['relationships']?.[_0x2ac0b1(0x1e3)]?.[_0x2ac0b1(0x185)]?.['id'],'createdAt':_0x15749f[_0x2ac0b1(0x1a6)]['createdAt'],'updatedAt':_0x15749f['attributes'][_0x2ac0b1(0x1df)]}));}async['listJourneysWithDetails'](_0x532a7e){const _0x313329=a88_0x1e9b17,_0x550d5d=_0x313329(0x159)+_0x532a7e,_0x122990=await this[_0x313329(0x181)]['request']('GET',_0x550d5d),_0x3f1f6c=new Map();if(_0x122990['included'])for(const _0x50f5e1 of _0x122990['included']){_0x50f5e1['type']===_0x313329(0x1ae)&&_0x3f1f6c[_0x313329(0x1b3)](_0x50f5e1['id'],_0x50f5e1);}return{'journeys':_0x122990[_0x313329(0x185)],'activationStepsById':_0x3f1f6c};}async[a88_0x1e9b17(0x194)](_0x4320cd){const _0x133ddb=a88_0x1e9b17,_0x6625d8=_0x133ddb(0x175)+_0x4320cd,_0x69287c=await this[_0x133ddb(0x181)]['request'](_0x133ddb(0x189),_0x6625d8);return _0x133ddb(0x185)in _0x69287c?_0x69287c[_0x133ddb(0x185)]:_0x69287c;}async['getJourneyBundle'](_0x1ec6dd){const _0x2a2b52=a88_0x1e9b17,_0x5d4335=_0x2a2b52(0x187)+_0x1ec6dd,_0x550d38=await this[_0x2a2b52(0x181)][_0x2a2b52(0x1de)](_0x2a2b52(0x189),_0x5d4335);return parseJourneyBundleResponse(_0x550d38);}async[a88_0x1e9b17(0x183)](_0x16e74d){const _0x864ded=a88_0x1e9b17,_0x18edd8='/entities/journey_bundles/'+_0x16e74d+'/journeys_appendable';await this[_0x864ded(0x181)][_0x864ded(0x1de)](_0x864ded(0x189),_0x18edd8);}async[a88_0x1e9b17(0x1bf)](_0x4721ef,_0x36352f){const _0x448536=a88_0x1e9b17,_0x1179c2='/entities/journey_bundles/'+_0x4721ef+_0x448536(0x1c6),_0x340d0b=await this[_0x448536(0x181)][_0x448536(0x1de)](_0x448536(0x1d5),_0x1179c2,{'body':_0x36352f});return _0x448536(0x185)in _0x340d0b?_0x340d0b[_0x448536(0x185)]:_0x340d0b;}async[a88_0x1e9b17(0x160)](_0x42a4ef){const _0x49f0c8=a88_0x1e9b17,_0x249cdd=_0x49f0c8(0x1cd),_0x4cfa75=await this[_0x49f0c8(0x181)][_0x49f0c8(0x1de)](_0x49f0c8(0x1d5),_0x249cdd,{'body':_0x42a4ef,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x49f0c8(0x185)in _0x4cfa75?_0x4cfa75['data']:_0x4cfa75;}async[a88_0x1e9b17(0x15a)](_0x21bd52,_0x5b34c4){const _0x19c51c=a88_0x1e9b17,_0x5db664=_0x19c51c(0x175)+_0x21bd52,_0x504d9d=await this[_0x19c51c(0x181)]['request'](_0x19c51c(0x170),_0x5db664,{'body':_0x5b34c4,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return'data'in _0x504d9d?_0x504d9d['data']:_0x504d9d;}async['updateJourneyDetail'](_0x6a71dc,_0x245db4){const _0x34037a=a88_0x1e9b17,_0x433b3a=_0x34037a(0x175)+_0x6a71dc+'/detail',_0x34782a=await this[_0x34037a(0x181)][_0x34037a(0x1de)](_0x34037a(0x1d5),_0x433b3a,{'body':_0x245db4,'headers':{'Content-Type':_0x34037a(0x1aa)}});return _0x34037a(0x185)in _0x34782a?_0x34782a[_0x34037a(0x185)]:_0x34782a;}async[a88_0x1e9b17(0x15f)](_0x42a821,_0x25bb66){const _0x416b42=a88_0x1e9b17,_0x236951=buildJourneyEndpoint(_0x42a821,_0x416b42(0x180),_0x25bb66),_0x4d5507=await this[_0x416b42(0x181)][_0x416b42(0x1de)]('GET',_0x236951);return parseJourneyStatisticsResponse(_0x4d5507);}async['getConversionSankeyChart'](_0x8b3444,_0x88578f){const _0x1306b3=a88_0x1e9b17,_0xfb0de=buildJourneyEndpoint(_0x8b3444,_0x1306b3(0x1cf),_0x88578f),_0x3e1aae=await this['httpClient'][_0x1306b3(0x1de)](_0x1306b3(0x189),_0xfb0de);return parseConversionSankeyResponse(_0x3e1aae);}async[a88_0x1e9b17(0x1a4)](_0x235c27,_0xd7a5d8){const _0x380952=a88_0x1e9b17,_0xfd0032=buildJourneyEndpoint(_0x235c27,_0x380952(0x1a3),_0xd7a5d8),_0xf462c5=await this[_0x380952(0x181)][_0x380952(0x1de)](_0x380952(0x189),_0xfd0032);return parseActivationSankeyResponse(_0xf462c5);}async[a88_0x1e9b17(0x1b8)](_0x59d078){const _0x38be40=a88_0x1e9b17,_0x8d5d8c=_0x38be40(0x175)+_0x59d078+_0x38be40(0x184),_0x5c20d1=await this[_0x38be40(0x181)][_0x38be40(0x1de)](_0x38be40(0x170),_0x8d5d8c);return _0x38be40(0x185)in _0x5c20d1?_0x5c20d1[_0x38be40(0x185)]:_0x5c20d1;}async['resumeJourney'](_0x18f41b){const _0x23a377=a88_0x1e9b17,_0x4e574a=_0x23a377(0x175)+_0x18f41b+'/resume',_0x42f8a0=await this['httpClient'][_0x23a377(0x1de)](_0x23a377(0x170),_0x4e574a);return _0x23a377(0x185)in _0x42f8a0?_0x42f8a0['data']:_0x42f8a0;}async[a88_0x1e9b17(0x16a)](_0xcca862,_0x167d8b){const _0x1a8ef3=a88_0x1e9b17,_0x13db08=_0x1a8ef3(0x175)+_0xcca862+_0x1a8ef3(0x1a7)+_0x167d8b,_0x46b4ac=await this['httpClient'][_0x1a8ef3(0x1de)](_0x1a8ef3(0x189),_0x13db08);return _0x1a8ef3(0x185)in _0x46b4ac?_0x46b4ac[_0x1a8ef3(0x185)]:_0x46b4ac;}async[a88_0x1e9b17(0x195)](_0x27d027){const _0x3a66f7=a88_0x1e9b17,_0x4c706b=_0x3a66f7(0x175)+_0x27d027+'/activations',_0xa7f9d0=await this['httpClient'][_0x3a66f7(0x1de)]('GET',_0x4c706b);return _0x3a66f7(0x185)in _0xa7f9d0?_0xa7f9d0[_0x3a66f7(0x185)]:_0xa7f9d0;}async[a88_0x1e9b17(0x1b5)](_0x16c12a,_0x4c1925){const _0x9f7d42=a88_0x1e9b17,_0x36b300='/entities/journeys/'+_0x16c12a+_0x9f7d42(0x15c),_0x26983d={'name':_0x4c1925[_0x9f7d42(0x182)],'scheduleType':_0x4c1925[_0x9f7d42(0x15b)]||_0x9f7d42(0x163),'connectionId':String(_0x4c1925['connectionId']),'columns':_0x4c1925[_0x9f7d42(0x192)]??[],'notifyOn':_0x4c1925[_0x9f7d42(0x19b)]??[],..._0x4c1925[_0x9f7d42(0x1dc)]!==undefined&&{'description':_0x4c1925[_0x9f7d42(0x1dc)]},..._0x4c1925[_0x9f7d42(0x1b7)]!==undefined&&{'allColumns':_0x4c1925[_0x9f7d42(0x1b7)]},..._0x4c1925[_0x9f7d42(0x199)]!==undefined&&{'timezone':_0x4c1925[_0x9f7d42(0x199)]},..._0x4c1925[_0x9f7d42(0x1c0)]!==undefined&&{'connectorConfig':_0x4c1925[_0x9f7d42(0x1c0)]},..._0x4c1925[_0x9f7d42(0x1be)]!==undefined&&{'emailRecipients':_0x4c1925[_0x9f7d42(0x1be)]},..._0x4c1925['activationTemplateId']!==undefined&&{'activationTemplateId':_0x4c1925[_0x9f7d42(0x198)]},..._0x4c1925[_0x9f7d42(0x1d1)]!==undefined&&{'syndicationBehavior':_0x4c1925[_0x9f7d42(0x1d1)]}},_0x2b8b16=await this[_0x9f7d42(0x181)][_0x9f7d42(0x1de)]('POST',_0x36b300,{'body':{'type':_0x9f7d42(0x1ae),'attributes':{'runAfterJourneyRefresh':_0x4c1925[_0x9f7d42(0x17a)]??![],'activationParams':_0x26983d}},'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x9f7d42(0x185)in _0x2b8b16?_0x2b8b16[_0x9f7d42(0x185)]:_0x2b8b16;}}export function buildJourneyEndpoint(_0x19f55b,_0x21a4d8,_0x593f77){const _0x66d2c0=a88_0x1e9b17,_0x24b02b=_0x66d2c0(0x175)+_0x19f55b+'/'+_0x21a4d8,_0x29a52d=new URLSearchParams();if(_0x593f77?.[_0x66d2c0(0x167)])_0x29a52d[_0x66d2c0(0x1b3)]('from',_0x593f77['from']);if(_0x593f77?.['to'])_0x29a52d[_0x66d2c0(0x1b3)]('to',_0x593f77['to']);if(_0x593f77?.[_0x66d2c0(0x171)]!=null)_0x29a52d[_0x66d2c0(0x1b3)](_0x66d2c0(0x171),String(_0x593f77[_0x66d2c0(0x171)]));const _0x555f7c=_0x29a52d[_0x66d2c0(0x1a9)]();return _0x555f7c?_0x24b02b+'?'+_0x555f7c:_0x24b02b;}function a88_0x6451(){const _0x4b3ae3=['journeys','getAudienceAttributes','site','/journeys','links','authHeaders','?depth=','parentFolderId','countPopulation','query','/entities/journeys','filter','conversion_sankey_charts','/audiences/','syndicationBehavior','/folders','journeyStageStatistics','getParentSegment','POST','Invalid\x20journey\x20bundle\x20response','folder-segment','stepSizes','string','latestJourneyId','createParentSegment','description','exitOrJumpSize','request','updatedAt','deleteSegment','/segments','listEntitiesByFolder','parentFolder','chart','updateSegment','getSegmentEntity','/attributes','/entities/journeys?folder_id=','updateJourney','scheduleType','/activations','/entities/parent_segments','/entities/segments/','getJourneyStatistics','createJourney','99lAyhZW','5833100vesBxq','none','sql','/syndications','completeMilestoneRate','from','map','completionRate','getJourneyActivation','724473EcNrFo','createSegmentFolder','getSegment','5kOdKFO','/segments/','PATCH','limit','createdAt','PUT','getAudienceBehaviors','/entities/journeys/','createSegment','6981270PNQoQc','/entities/folders/','goalSize','runAfterJourneyRefresh','/behaviors','object','exitOrJumpRate','cdp','?realtime=','statistics','httpClient','name','checkJourneyAppendable','/pause','data','versionNumber','/entities/journey_bundles/','journeyStageId','GET','milestoneSize','deleteActivation','metaData','segment-journey','/entities/segments','getSegmentSQL','getParentSegmentFull','&with_rule=','columns','exitSizes','getJourney','listJourneyActivations','getSegmentSQLFromRule','requestSegmentSQL','activationTemplateId','timezone','stepInfluxes','notifyOn','accessToken','length','/audiences','9616806PRqXTZ','size','journeyId','updateParentSegment','activation_sankey_charts','getActivationSankeyChart','11IkQCtt','attributes','/activations/','145410iyqZzC','toString','application/vnd.treasuredata.v1+json','runParentSegment','7986937cfJxWx','rule','journeyActivationStep','12668856yBnTmn','listActivations','updateActivation','application/json','set','lastVersionNumber','createJourneyActivation','getParentSegmentSQL','allColumns','pauseJourney','audienceId','isArray','/entities/parent_segments/','enteredSize','history','emailRecipients','createJourneyVersion','connectorConfig','paused','/segments/query'];a88_0x6451=function(){return _0x4b3ae3;};return a88_0x6451();}export function parseJourneyStatisticsResponse(_0x378b09){const _0x375b2e=a88_0x1e9b17;if(!(_0x375b2e(0x185)in _0x378b09))return _0x378b09;const _0x3bef07=_0x378b09['data'];if(!(_0x375b2e(0x1a6)in _0x3bef07)||!_0x3bef07['attributes']||typeof _0x3bef07[_0x375b2e(0x1a6)]!==_0x375b2e(0x17c))return _0x3bef07;const _0x4bad2d=_0x3bef07['attributes'],_0x2f8e06={'journeyId':_0x4bad2d['journeyId'],'size':_0x4bad2d[_0x375b2e(0x1a0)],'goalSize':_0x4bad2d[_0x375b2e(0x179)],'enteredSize':_0x4bad2d[_0x375b2e(0x1bc)],'completionRate':_0x4bad2d[_0x375b2e(0x169)],'exitOrJumpSize':_0x4bad2d[_0x375b2e(0x1dd)],'exitOrJumpRate':_0x4bad2d[_0x375b2e(0x17d)],'stages':(_0x4bad2d[_0x375b2e(0x1d3)]??[])['map'](_0x162696=>{const _0x593b9f=_0x375b2e,_0x88dda2={'id':_0x162696['id'],'enteredSize':_0x162696[_0x593b9f(0x1bc)],'milestoneSize':_0x162696[_0x593b9f(0x18a)],'completeMilestoneRate':_0x162696[_0x593b9f(0x166)],'exitOrJumpSize':_0x162696['exitOrJumpSize'],'exitOrJumpRate':_0x162696[_0x593b9f(0x17d)],'size':_0x162696['size']};if(_0x162696[_0x593b9f(0x1bd)])_0x88dda2[_0x593b9f(0x1bd)]=_0x162696[_0x593b9f(0x1bd)];if(_0x162696[_0x593b9f(0x1d8)])_0x88dda2[_0x593b9f(0x1d8)]=_0x162696[_0x593b9f(0x1d8)];if(_0x162696[_0x593b9f(0x19a)])_0x88dda2[_0x593b9f(0x19a)]=_0x162696[_0x593b9f(0x19a)];if(_0x162696[_0x593b9f(0x193)])_0x88dda2[_0x593b9f(0x193)]=_0x162696[_0x593b9f(0x193)];return _0x88dda2;})};return Array['isArray'](_0x4bad2d[_0x375b2e(0x1bd)])&&(_0x2f8e06[_0x375b2e(0x1bd)]=_0x4bad2d[_0x375b2e(0x1bd)]),_0x2f8e06;}function extractSankeyChart(_0x4a2a3d){const _0x2fe22f=a88_0x1e9b17,_0x2addc8=Array['isArray'](_0x4a2a3d[_0x2fe22f(0x185)])?_0x4a2a3d[_0x2fe22f(0x185)]:[],_0x56bade=_0x4a2a3d[_0x2fe22f(0x18c)]&&typeof _0x4a2a3d['metaData']==='object'?_0x4a2a3d[_0x2fe22f(0x18c)]:{},_0x2a056e=Array[_0x2fe22f(0x1ba)](_0x56bade[_0x2fe22f(0x1c7)])?_0x56bade[_0x2fe22f(0x1c7)]:[];return{'nodes':_0x2addc8,'links':_0x2a056e};}function extractJsonApiAttributes(_0x12b965){const _0x50b6d5=a88_0x1e9b17;if(!_0x12b965||typeof _0x12b965!==_0x50b6d5(0x17c))return[];const _0x35194b=_0x12b965;if(!Array[_0x50b6d5(0x1ba)](_0x35194b[_0x50b6d5(0x185)]))return[];return _0x35194b['data']['filter'](_0x2d7586=>!!_0x2d7586&&typeof _0x2d7586==='object')[_0x50b6d5(0x168)](_0x23c11d=>_0x23c11d[_0x50b6d5(0x1a6)])[_0x50b6d5(0x1ce)](_0x518506=>!!_0x518506&&typeof _0x518506===_0x50b6d5(0x17c));}export function parseConversionSankeyResponse(_0x2fde3e){const _0x558dc2=a88_0x1e9b17,_0x51936={'nodes':[],'links':[]},_0x39deaa=extractJsonApiAttributes(_0x2fde3e);if(_0x39deaa[_0x558dc2(0x19d)]===0x0)return _0x51936;const _0xd71fd7=_0x39deaa[0x0],_0x804725=_0xd71fd7['chart'];if(_0x804725&&typeof _0x804725===_0x558dc2(0x17c)){const {nodes:_0x23ded3,links:_0x1d0521}=extractSankeyChart(_0x804725);return{'nodes':_0x23ded3,'links':_0x1d0521,...typeof _0xd71fd7['updatedAt']==='string'?{'updatedAt':_0xd71fd7[_0x558dc2(0x1df)]}:{}};}return _0x51936;}export function parseActivationSankeyResponse(_0x1cffda){const _0x5a6984=a88_0x1e9b17,_0x3bcad5=extractJsonApiAttributes(_0x1cffda);if(_0x3bcad5[_0x5a6984(0x19d)]>0x0)return _0x3bcad5[_0x5a6984(0x168)](_0x51fa0b=>{const _0x1dec91=_0x5a6984,_0x2bfaff=_0x51fa0b[_0x1dec91(0x1e4)],{nodes:_0x21ed8f,links:_0x60a6bd}=_0x2bfaff&&typeof _0x2bfaff===_0x1dec91(0x17c)?extractSankeyChart(_0x2bfaff):{'nodes':[],'links':[]};return{'journeyStageId':typeof _0x51fa0b['journeyStageId']==='string'?_0x51fa0b[_0x1dec91(0x188)]:'','nodes':_0x21ed8f,'links':_0x60a6bd,...typeof _0x51fa0b['updatedAt']===_0x1dec91(0x1d9)?{'updatedAt':_0x51fa0b[_0x1dec91(0x1df)]}:{}};});if(Array[_0x5a6984(0x1ba)](_0x1cffda))return _0x1cffda;return[];}export function parseJourneyBundleResponse(_0x4c3ec5){const _0x32c172=a88_0x1e9b17;if(!_0x4c3ec5||typeof _0x4c3ec5!==_0x32c172(0x17c))throw new Error(_0x32c172(0x1d6));const _0xb62428=_0x4c3ec5,_0x39a98f=_0xb62428['data'],_0x5cb0ff=_0x39a98f?.[_0x32c172(0x1a6)]??_0xb62428,_0x31a466=Array[_0x32c172(0x1ba)](_0x5cb0ff[_0x32c172(0x1c3)])?_0x5cb0ff['journeys']:[],_0x111778=_0x31a466[_0x32c172(0x168)](_0xbebbc6=>{const _0x217985=_0x32c172;if(!_0xbebbc6||typeof _0xbebbc6!=='object')return _0xbebbc6;const _0x94eac8=_0xbebbc6;if(_0x94eac8[_0x217985(0x185)]&&typeof _0x94eac8['data']===_0x217985(0x17c))return _0x94eac8[_0x217985(0x185)];return _0x94eac8;});return{'name':_0x5cb0ff[_0x32c172(0x182)],'description':_0x5cb0ff['description']??null,'latestJourneyId':_0x5cb0ff[_0x32c172(0x1da)],'lastVersionNumber':_0x5cb0ff[_0x32c172(0x1b4)],'journeys':_0x111778};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a89_0x2edae4=a89_0x1b52;(function(_0x1d9df1,_0x4eb151){const _0x59e8fd=a89_0x1b52,_0x4a54ce=_0x1d9df1();while(!![]){try{const _0x3e0979=-parseInt(_0x59e8fd(0x7b))/0x1*(-parseInt(_0x59e8fd(0x7a))/0x2)+parseInt(_0x59e8fd(0x81))/0x3+-parseInt(_0x59e8fd(0x6b))/0x4+parseInt(_0x59e8fd(0x71))/0x5*(-parseInt(_0x59e8fd(0x73))/0x6)+-parseInt(_0x59e8fd(0x78))/0x7+parseInt(_0x59e8fd(0x75))/0x8*(-parseInt(_0x59e8fd(0x7c))/0x9)+parseInt(_0x59e8fd(0x74))/0xa;if(_0x3e0979===_0x4eb151)break;else _0x4a54ce['push'](_0x4a54ce['shift']());}catch(_0x582169){_0x4a54ce['push'](_0x4a54ce['shift']());}}}(a89_0x49df,0x6c70f));import{HTTPClient}from'./http-client.js';function a89_0x49df(){const _0x189c5c=['/api/email_senders?','site','application/vnd.api+json','listEmailSenders','1538874PlvofX','filter[workspaceId]','apiKey','page[limit]','3257908mPSbnP','/api/email_senders','toString','httpClient','GET','request','5BkPNBx','append','3207882PLCHAw','26407770bIgxNb','40neEdoK','limit','page[offset]','5787901MYvhkg','offset','42074JtSeCq','16XOgpnY','1566333GWcOSL'];a89_0x49df=function(){return _0x189c5c;};return a89_0x49df();}import{getDeliveryEndpoint}from'./endpoints.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';function a89_0x1b52(_0x2bfceb,_0x154bda){_0x2bfceb=_0x2bfceb-0x68;const _0x49df64=a89_0x49df();let _0x1b527e=_0x49df64[_0x2bfceb];return _0x1b527e;}export class DeliveryApiClient{['httpClient'];constructor(_0x5dd6a5){const _0x4b49e7=a89_0x1b52,_0x3ba313=getDeliveryEndpoint(_0x5dd6a5[_0x4b49e7(0x7e)]),_0x239840=toHeaderRecord(getAuthHeaders(_0x5dd6a5['site'],_0x5dd6a5[_0x4b49e7(0x69)],_0x5dd6a5['accessToken']));this[_0x4b49e7(0x6e)]=new HTTPClient(_0x3ba313,_0x239840,{'proxy':_0x5dd6a5['proxy']});}async[a89_0x2edae4(0x80)](_0x42f95d={}){const _0x1745f9=a89_0x2edae4,_0x27d970=new URLSearchParams();_0x42f95d['workspaceId']&&_0x27d970[_0x1745f9(0x72)](_0x1745f9(0x68),_0x42f95d['workspaceId']);_0x42f95d[_0x1745f9(0x76)]!==undefined&&_0x27d970['append'](_0x1745f9(0x6a),_0x42f95d['limit'][_0x1745f9(0x6d)]());_0x42f95d['offset']!==undefined&&_0x27d970[_0x1745f9(0x72)](_0x1745f9(0x77),_0x42f95d[_0x1745f9(0x79)][_0x1745f9(0x6d)]());const _0x5b6054=_0x27d970['toString'](),_0x3f43ea=_0x5b6054?_0x1745f9(0x7d)+_0x5b6054:_0x1745f9(0x6c);return await this[_0x1745f9(0x6e)][_0x1745f9(0x70)](_0x1745f9(0x6f),_0x3f43ea,{'headers':{'Accept':_0x1745f9(0x7f)}});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a90_0x5b0dd0=a90_0x3210;(function(_0x2640e,_0x59beb4){const _0x50b0a3=a90_0x3210,_0x14d24e=_0x2640e();while(!![]){try{const _0x5f3613=parseInt(_0x50b0a3(0x212))/0x1+-parseInt(_0x50b0a3(0x1f1))/0x2*(-parseInt(_0x50b0a3(0x1f6))/0x3)+-parseInt(_0x50b0a3(0x239))/0x4+parseInt(_0x50b0a3(0x22c))/0x5*(parseInt(_0x50b0a3(0x1ff))/0x6)+parseInt(_0x50b0a3(0x220))/0x7*(parseInt(_0x50b0a3(0x236))/0x8)+parseInt(_0x50b0a3(0x23a))/0x9+-parseInt(_0x50b0a3(0x205))/0xa;if(_0x5f3613===_0x59beb4)break;else _0x14d24e['push'](_0x14d24e['shift']());}catch(_0x5af7a7){_0x14d24e['push'](_0x14d24e['shift']());}}}(a90_0x58b1,0x37c37));export const TD_ENDPOINTS={'us01':a90_0x5b0dd0(0x203),'ap01':'https://api.treasuredata.co.jp','eu01':a90_0x5b0dd0(0x1f0),'ap02':a90_0x5b0dd0(0x246),'ap03':a90_0x5b0dd0(0x22e),'dev-us01':'https://api-development.treasuredata.com','dev-eu01':a90_0x5b0dd0(0x1f4),'stg-us01':a90_0x5b0dd0(0x22f),'stg-ap01':a90_0x5b0dd0(0x224),'stg-ap03':a90_0x5b0dd0(0x234)};export const CDP_ENDPOINTS={'us01':a90_0x5b0dd0(0x1ea),'ap01':'https://api-cdp.treasuredata.co.jp','eu01':'https://api-cdp.eu01.treasuredata.com','ap02':a90_0x5b0dd0(0x1ed),'ap03':a90_0x5b0dd0(0x1eb),'dev-us01':a90_0x5b0dd0(0x223),'dev-eu01':'https://api-development-cdp.eu01.treasuredata.com','stg-us01':a90_0x5b0dd0(0x222),'stg-ap01':a90_0x5b0dd0(0x1f9),'stg-ap03':a90_0x5b0dd0(0x1f7)};export const WORKFLOW_ENDPOINTS={'us01':a90_0x5b0dd0(0x1ef),'ap01':a90_0x5b0dd0(0x227),'eu01':a90_0x5b0dd0(0x20b),'ap02':a90_0x5b0dd0(0x230),'ap03':a90_0x5b0dd0(0x21b),'dev-us01':'https://api-development-workflow.us01.treasuredata.com','dev-eu01':'https://api-development-workflow.eu01.treasuredata.com','stg-us01':a90_0x5b0dd0(0x229),'stg-ap01':a90_0x5b0dd0(0x1fb),'stg-ap03':a90_0x5b0dd0(0x213)};export const TRINO_ENDPOINTS={'us01':'https://api-presto.treasuredata.com','ap01':a90_0x5b0dd0(0x221),'eu01':'https://api-presto.eu01.treasuredata.com','ap02':'https://api-presto.ap02.treasuredata.com','ap03':'https://api-presto.ap03.treasuredata.com','dev-us01':'https://api-development-presto.treasuredata.com','dev-eu01':a90_0x5b0dd0(0x1e9),'stg-us01':a90_0x5b0dd0(0x215),'stg-ap01':a90_0x5b0dd0(0x22d),'stg-ap03':'https://api-staging-presto.ap03.treasuredata.com'};export const LLM_ENDPOINTS={'us01':a90_0x5b0dd0(0x1e8),'ap01':a90_0x5b0dd0(0x1fd),'eu01':'https://llm-api.eu01.treasuredata.com','ap02':a90_0x5b0dd0(0x228),'ap03':a90_0x5b0dd0(0x208),'dev-us01':a90_0x5b0dd0(0x23c),'dev-eu01':a90_0x5b0dd0(0x226),'stg-us01':a90_0x5b0dd0(0x20d),'stg-ap01':a90_0x5b0dd0(0x22a),'stg-ap03':a90_0x5b0dd0(0x1fc)};export const LLM_PROXY_ENDPOINTS={'us01':a90_0x5b0dd0(0x210),'ap01':a90_0x5b0dd0(0x232),'eu01':a90_0x5b0dd0(0x237),'ap02':a90_0x5b0dd0(0x207),'ap03':a90_0x5b0dd0(0x22b),'dev-us01':a90_0x5b0dd0(0x1f5),'dev-eu01':a90_0x5b0dd0(0x21c),'stg-us01':a90_0x5b0dd0(0x214),'stg-ap01':a90_0x5b0dd0(0x21f),'stg-ap03':'https://llm-proxy-staging.ap03.treasuredata.com'};export const ENGAGE_ENDPOINTS={'us01':a90_0x5b0dd0(0x23b),'ap01':a90_0x5b0dd0(0x241),'eu01':a90_0x5b0dd0(0x1ee),'ap02':a90_0x5b0dd0(0x217),'ap03':a90_0x5b0dd0(0x1e7),'dev-us01':'https://engage-api-development.us01.treasuredata.com','dev-eu01':'https://engage-api-development.eu01.treasuredata.com','stg-us01':a90_0x5b0dd0(0x242),'stg-ap01':'https://engage-api-staging.treasuredata.co.jp','stg-ap03':a90_0x5b0dd0(0x1ec)};export const DELIVERY_ENDPOINTS={'us01':a90_0x5b0dd0(0x201),'ap01':a90_0x5b0dd0(0x1e6),'eu01':a90_0x5b0dd0(0x244),'ap02':a90_0x5b0dd0(0x238),'ap03':a90_0x5b0dd0(0x1f3),'dev-us01':a90_0x5b0dd0(0x200),'dev-eu01':a90_0x5b0dd0(0x21a),'stg-us01':a90_0x5b0dd0(0x1fa),'stg-ap01':'https://delivery-api-staging.treasuredata.co.jp','stg-ap03':a90_0x5b0dd0(0x21d)};export function getDeliveryEndpoint(_0x2b1145){const _0x1af26d=DELIVERY_ENDPOINTS[_0x2b1145];if(!_0x1af26d)throw new Error('No\x20Delivery\x20API\x20endpoint\x20for\x20site:\x20'+_0x2b1145);return _0x1af26d;}function a90_0x58b1(){const _0x24f906=['https://api.treasuredata.com','\x27\x20and\x20site\x20\x27','9250480HFDmJh','https://console.ap02.treasuredata.com','https://llm-proxy.ap02.treasuredata.com','https://llm-api.ap03.treasuredata.com','/em/','https://console-next.us01.treasuredata.com','https://api-workflow.eu01.treasuredata.com','https://console-development-next.us01.treasuredata.com','https://llm-api-staging.us01.treasuredata.com','/app/es/','/app/af/','https://llm-proxy.us01.treasuredata.com','/app/jobs/','276677xKwKVc','https://api-staging-workflow.ap03.treasuredata.com','https://llm-proxy-staging.us01.treasuredata.com','https://api-staging-presto.treasuredata.com','/ce','https://engage-api.ap02.treasuredata.com','.treasuredata.com','https://console-staging-next.us01.treasuredata.com','https://delivery-api-development.eu01.treasuredata.com','https://api-workflow.ap03.treasuredata.com','https://llm-proxy-development.eu01.treasuredata.com','https://delivery-api-staging.ap03.treasuredata.com','https://console-next.eu01.treasuredata.com','https://llm-proxy-staging.treasuredata.co.jp','1589XCTvje','https://api-presto.treasuredata.co.jp','https://api-staging-cdp.us01.treasuredata.com','https://api-development-cdp.us01.treasuredata.com','https://api-staging.treasuredata.co.jp','https://console-staging-next.ap03.treasuredata.com','https://llm-api-development.eu01.treasuredata.com','https://api-workflow.treasuredata.co.jp','https://llm-api.ap02.treasuredata.com','https://api-staging-workflow.us01.treasuredata.com','https://llm-api-staging.treasuredata.co.jp','https://llm-proxy.ap03.treasuredata.com','849160QrLEoj','https://api-staging-presto.treasuredata.co.jp','https://api.ap03.treasuredata.com','https://api-staging.treasuredata.com','https://api-workflow.ap02.treasuredata.com','/tc','https://llm-proxy.treasuredata.co.jp','https://console-staging-next.treasuredata.co.jp','https://api-staging.ap03.treasuredata.com','/ooc/','3400Eyrkzb','https://llm-proxy.eu01.treasuredata.com','https://delivery-api.ap02.treasuredata.com','148012isAiXn','2160261RtlRTG','https://engage-api.treasuredata.com','https://llm-api-development.us01.treasuredata.com','/app/workflows/','/ag','https://console.','https://console-development.eu01.treasuredata.com','https://engage-api.treasuredata.co.jp','https://engage-api-staging.us01.treasuredata.com','https://console.eu01.treasuredata.com','https://delivery-api.eu01.treasuredata.com','https://console-development.us01.treasuredata.com','https://api.ap02.treasuredata.com','https://console-next.treasuredata.co.jp','https://delivery-api.treasuredata.co.jp','https://engage-api.ap03.treasuredata.com','https://llm-api.treasuredata.com','https://api-development-presto.eu01.treasuredata.com','https://api-cdp.treasuredata.com','https://api-cdp.ap03.treasuredata.com','https://engage-api-staging.ap03.treasuredata.com','https://api-cdp.ap02.treasuredata.com','https://engage-api.eu01.treasuredata.com','https://api-workflow.treasuredata.com','https://api.eu01.treasuredata.com','20662RvMMbm','/sessions/','https://delivery-api.ap03.treasuredata.com','https://api-development.eu01.treasuredata.com','https://llm-proxy-development.us01.treasuredata.com','69ktsAdL','https://api-staging-cdp.ap03.treasuredata.com','/attempt/','https://api-staging-cdp.treasuredata.co.jp','https://delivery-api-staging.us01.treasuredata.com','https://api-staging-workflow.treasuredata.co.jp','https://llm-api-staging.ap03.treasuredata.com','https://llm-api.treasuredata.co.jp','/ag/','12tUentn','https://delivery-api-development.us01.treasuredata.com','https://delivery-api.us01.treasuredata.com','https://console-development-next.eu01.treasuredata.com'];a90_0x58b1=function(){return _0x24f906;};return a90_0x58b1();}export const CONSOLE_ENDPOINTS={'us01':'https://console.us01.treasuredata.com','ap01':'https://console.treasuredata.co.jp','eu01':a90_0x5b0dd0(0x243),'ap02':a90_0x5b0dd0(0x206),'ap03':'https://console.ap03.treasuredata.com','dev-us01':a90_0x5b0dd0(0x245),'dev-eu01':a90_0x5b0dd0(0x240),'stg-us01':'https://console-staging.us01.treasuredata.com','stg-ap01':'https://console-staging.treasuredata.co.jp','stg-ap03':'https://console-staging.ap03.treasuredata.com'};export const CONSOLE_NEXT_ENDPOINTS={'us01':a90_0x5b0dd0(0x20a),'ap01':a90_0x5b0dd0(0x247),'eu01':a90_0x5b0dd0(0x21e),'ap02':'https://console-next.ap02.treasuredata.com','ap03':'https://console-next.ap03.treasuredata.com','dev-us01':a90_0x5b0dd0(0x20c),'dev-eu01':a90_0x5b0dd0(0x202),'stg-us01':a90_0x5b0dd0(0x219),'stg-ap01':a90_0x5b0dd0(0x233),'stg-ap03':a90_0x5b0dd0(0x225)};export function getConsoleUrl(_0x3ea56b,_0x5d2a8b){const _0x4df43f=a90_0x5b0dd0,_0x54fe42=CONSOLE_ENDPOINTS[_0x3ea56b]||_0x4df43f(0x23f)+_0x3ea56b+_0x4df43f(0x218);return _0x5d2a8b?''+_0x54fe42+_0x5d2a8b:_0x54fe42;}export function getConsoleNextUrl(_0x2be45f,_0x52880a){const _0x55782f=a90_0x5b0dd0,_0x1d80de=CONSOLE_NEXT_ENDPOINTS[_0x2be45f]||'https://console-next.'+_0x2be45f+_0x55782f(0x218);return _0x52880a?''+_0x1d80de+_0x52880a:_0x1d80de;}export function getLLMProjectUrl(_0xa19b6e,_0x38a68c){const _0x289ce7=a90_0x5b0dd0;return getConsoleNextUrl(_0xa19b6e,_0x289ce7(0x20f)+_0x38a68c+_0x289ce7(0x23e));}function a90_0x3210(_0x4971f3,_0x39bdb2){_0x4971f3=_0x4971f3-0x1e6;const _0x58b17a=a90_0x58b1();let _0x321090=_0x58b17a[_0x4971f3];return _0x321090;}export function getLLMAgentChatUrl(_0x5185df,_0x3083af,_0x1b0cc0){const _0x409599=a90_0x5b0dd0;return getConsoleNextUrl(_0x5185df,_0x409599(0x20f)+_0x3083af+_0x409599(0x1fe)+_0x1b0cc0+_0x409599(0x231));}export function getLLMConversationUrl(_0x4bc453,_0x1b84da,_0x3cb1af,_0x2400ea){const _0x1255da=a90_0x5b0dd0;return getConsoleNextUrl(_0x4bc453,_0x1255da(0x20f)+_0x1b84da+_0x1255da(0x1fe)+_0x3cb1af+'/tc/'+_0x2400ea);}export function getWorkflowUrl(_0x3113d1,_0x188e70){const _0x3d8c1c=a90_0x5b0dd0;return getConsoleUrl(_0x3113d1,_0x3d8c1c(0x23d)+_0x188e70+'/info');}export function getWorkflowSessionUrl(_0xa3fa5f,_0x342b6b,_0x7b9d81){const _0x3becda=a90_0x5b0dd0;return getConsoleUrl(_0xa3fa5f,'/app/workflows/'+_0x342b6b+_0x3becda(0x1f2)+_0x7b9d81);}export function getWorkflowAttemptUrl(_0x26c26c,_0x373598,_0xfbb68f,_0x4d2e2b){const _0xc9fd68=a90_0x5b0dd0;return getConsoleUrl(_0x26c26c,_0xc9fd68(0x23d)+_0x373598+_0xc9fd68(0x1f2)+_0xfbb68f+_0xc9fd68(0x1f8)+_0x4d2e2b);}export function getCampaignUrl(_0x2af6d6,_0x1b6fb5,_0x36da57){const _0x444bf4=a90_0x5b0dd0;return getConsoleNextUrl(_0x2af6d6,_0x444bf4(0x20e)+_0x1b6fb5+_0x444bf4(0x235)+_0x36da57);}export function getTemplateUrl(_0x4698b7,_0x444ce0,_0x79239b){const _0x350c8c=a90_0x5b0dd0;return getConsoleNextUrl(_0x4698b7,'/app/es/'+_0x444ce0+_0x350c8c(0x209)+_0x79239b+_0x350c8c(0x216));}export function getJobUrl(_0x13cb84,_0x47d6c2){const _0x40d143=a90_0x5b0dd0;return getConsoleNextUrl(_0x13cb84,_0x40d143(0x211)+_0x47d6c2+'/result');}export function getWorkspaceUrl(_0x53d2c2,_0x3e9257){const _0x299d9f=a90_0x5b0dd0;return getConsoleNextUrl(_0x53d2c2,_0x299d9f(0x20e)+_0x3e9257);}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};export function getLLMProxyEndpoint(_0x30db9d){const _0x21fcb0=LLM_PROXY_ENDPOINTS[_0x30db9d];if(!_0x21fcb0)throw new Error('No\x20LLM\x20Proxy\x20endpoint\x20for\x20site:\x20'+_0x30db9d);return _0x21fcb0;}export function getEndpoint(_0xc28c4e,_0x4a5368='td'){const _0x3a8d62=a90_0x5b0dd0,_0x5d2b67=API_ENDPOINTS[_0x4a5368]?.[_0xc28c4e];if(!_0x5d2b67)throw new Error('No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27'+_0x4a5368+_0x3a8d62(0x204)+_0xc28c4e+'\x27');return _0x5d2b67;}
|
|
1
|
+
const a90_0x53b277=a90_0x2837;function a90_0x2837(_0x376964,_0x3c6e87){_0x376964=_0x376964-0xf7;const _0xc2bfe2=a90_0xc2bf();let _0x2837cc=_0xc2bfe2[_0x376964];return _0x2837cc;}(function(_0x41859e,_0x2277e8){const _0x256d13=a90_0x2837,_0x1a47c6=_0x41859e();while(!![]){try{const _0x3089f5=-parseInt(_0x256d13(0x135))/0x1*(-parseInt(_0x256d13(0x10b))/0x2)+parseInt(_0x256d13(0x14e))/0x3*(parseInt(_0x256d13(0x143))/0x4)+-parseInt(_0x256d13(0x10e))/0x5+parseInt(_0x256d13(0x10c))/0x6*(-parseInt(_0x256d13(0x122))/0x7)+parseInt(_0x256d13(0xf9))/0x8+parseInt(_0x256d13(0x101))/0x9*(-parseInt(_0x256d13(0x111))/0xa)+-parseInt(_0x256d13(0x131))/0xb;if(_0x3089f5===_0x2277e8)break;else _0x1a47c6['push'](_0x1a47c6['shift']());}catch(_0x585485){_0x1a47c6['push'](_0x1a47c6['shift']());}}}(a90_0xc2bf,0xa753e));export const TD_ENDPOINTS={'us01':a90_0x53b277(0xfc),'ap01':a90_0x53b277(0x10f),'eu01':a90_0x53b277(0xfd),'ap02':a90_0x53b277(0x107),'ap03':a90_0x53b277(0x11c),'dev-us01':a90_0x53b277(0x138),'dev-eu01':a90_0x53b277(0x128),'stg-us01':a90_0x53b277(0x114),'stg-ap01':a90_0x53b277(0x14d),'stg-ap03':a90_0x53b277(0x124)};export const CDP_ENDPOINTS={'us01':a90_0x53b277(0x156),'ap01':a90_0x53b277(0x14b),'eu01':a90_0x53b277(0x14a),'ap02':a90_0x53b277(0xfa),'ap03':a90_0x53b277(0x123),'dev-us01':'https://api-development-cdp.us01.treasuredata.com','dev-eu01':a90_0x53b277(0x158),'stg-us01':a90_0x53b277(0x150),'stg-ap01':'https://api-staging-cdp.treasuredata.co.jp','stg-ap03':a90_0x53b277(0x12a)};export const WORKFLOW_ENDPOINTS={'us01':'https://api-workflow.treasuredata.com','ap01':a90_0x53b277(0xf8),'eu01':a90_0x53b277(0x115),'ap02':a90_0x53b277(0x10a),'ap03':'https://api-workflow.ap03.treasuredata.com','dev-us01':a90_0x53b277(0xff),'dev-eu01':'https://api-development-workflow.eu01.treasuredata.com','stg-us01':a90_0x53b277(0x152),'stg-ap01':a90_0x53b277(0x148),'stg-ap03':a90_0x53b277(0x109)};export const TRINO_ENDPOINTS={'us01':'https://api-presto.treasuredata.com','ap01':a90_0x53b277(0x12c),'eu01':a90_0x53b277(0x113),'ap02':a90_0x53b277(0x116),'ap03':a90_0x53b277(0x140),'dev-us01':'https://api-development-presto.treasuredata.com','dev-eu01':a90_0x53b277(0x151),'stg-us01':a90_0x53b277(0xfb),'stg-ap01':a90_0x53b277(0x154),'stg-ap03':'https://api-staging-presto.ap03.treasuredata.com'};export const LLM_ENDPOINTS={'us01':a90_0x53b277(0x12f),'ap01':a90_0x53b277(0x159),'eu01':a90_0x53b277(0x108),'ap02':'https://llm-api.ap02.treasuredata.com','ap03':a90_0x53b277(0x126),'dev-us01':a90_0x53b277(0x141),'dev-eu01':'https://llm-api-development.eu01.treasuredata.com','stg-us01':'https://llm-api-staging.us01.treasuredata.com','stg-ap01':a90_0x53b277(0x11e),'stg-ap03':'https://llm-api-staging.ap03.treasuredata.com'};export const LLM_PROXY_ENDPOINTS={'us01':a90_0x53b277(0x13c),'ap01':a90_0x53b277(0x112),'eu01':a90_0x53b277(0x14f),'ap02':a90_0x53b277(0x103),'ap03':a90_0x53b277(0x13d),'dev-us01':'https://llm-proxy-development.us01.treasuredata.com','dev-eu01':a90_0x53b277(0x127),'stg-us01':'https://llm-proxy-staging.us01.treasuredata.com','stg-ap01':a90_0x53b277(0x145),'stg-ap03':a90_0x53b277(0x13b)};export const ENGAGE_ENDPOINTS={'us01':a90_0x53b277(0x157),'ap01':a90_0x53b277(0x105),'eu01':a90_0x53b277(0x146),'ap02':'https://engage-api.ap02.treasuredata.com','ap03':a90_0x53b277(0x14c),'dev-us01':a90_0x53b277(0x13a),'dev-eu01':a90_0x53b277(0x120),'stg-us01':a90_0x53b277(0x155),'stg-ap01':a90_0x53b277(0x104),'stg-ap03':a90_0x53b277(0xfe)};export const DELIVERY_ENDPOINTS={'us01':a90_0x53b277(0x12e),'ap01':a90_0x53b277(0xf7),'eu01':a90_0x53b277(0x13f),'ap02':'https://delivery-api.ap02.treasuredata.com','ap03':'https://delivery-api.ap03.treasuredata.com','dev-us01':'https://delivery-api-development.us01.treasuredata.com','dev-eu01':a90_0x53b277(0x134),'stg-us01':'https://delivery-api-staging.us01.treasuredata.com','stg-ap01':'https://delivery-api-staging.treasuredata.co.jp','stg-ap03':a90_0x53b277(0x125)};export function getDeliveryEndpoint(_0x45d49d){const _0x386b2a=a90_0x53b277,_0x53cf1a=DELIVERY_ENDPOINTS[_0x45d49d];if(!_0x53cf1a)throw new Error(_0x386b2a(0x139)+_0x45d49d);return _0x53cf1a;}export const CONSOLE_ENDPOINTS={'us01':a90_0x53b277(0x137),'ap01':'https://console.treasuredata.co.jp','eu01':a90_0x53b277(0x11b),'ap02':a90_0x53b277(0x117),'ap03':a90_0x53b277(0x12b),'dev-us01':'https://console-development.us01.treasuredata.com','dev-eu01':a90_0x53b277(0x132),'stg-us01':'https://console-staging.us01.treasuredata.com','stg-ap01':a90_0x53b277(0x119),'stg-ap03':a90_0x53b277(0x11a)};export const CONSOLE_NEXT_ENDPOINTS={'us01':'https://console-next.us01.treasuredata.com','ap01':'https://console-next.treasuredata.co.jp','eu01':'https://console-next.eu01.treasuredata.com','ap02':'https://console-next.ap02.treasuredata.com','ap03':a90_0x53b277(0x153),'dev-us01':a90_0x53b277(0x106),'dev-eu01':'https://console-development-next.eu01.treasuredata.com','stg-us01':a90_0x53b277(0x144),'stg-ap01':a90_0x53b277(0x133),'stg-ap03':a90_0x53b277(0x142)};export function getConsoleUrl(_0x3118cf,_0x123316){const _0x120725=a90_0x53b277,_0x39bcd6=CONSOLE_ENDPOINTS[_0x3118cf]||_0x120725(0x130)+_0x3118cf+_0x120725(0x10d);return _0x123316?''+_0x39bcd6+_0x123316:_0x39bcd6;}export function getConsoleNextUrl(_0x3634d3,_0x3dd724){const _0x1eda1b=a90_0x53b277,_0x824c31=CONSOLE_NEXT_ENDPOINTS[_0x3634d3]||_0x1eda1b(0x102)+_0x3634d3+_0x1eda1b(0x10d);return _0x3dd724?''+_0x824c31+_0x3dd724:_0x824c31;}export function getLLMProjectUrl(_0x22fdd0,_0x5408df){const _0x4d8a69=a90_0x53b277;return getConsoleNextUrl(_0x22fdd0,_0x4d8a69(0x110)+_0x5408df+_0x4d8a69(0x149));}export function getLLMAgentChatUrl(_0xd3f11e,_0x5bb099,_0x19afdf){const _0x1e4ed4=a90_0x53b277;return getConsoleNextUrl(_0xd3f11e,_0x1e4ed4(0x110)+_0x5bb099+_0x1e4ed4(0x11d)+_0x19afdf+'/tc');}export function getLLMConversationUrl(_0x59fedb,_0x26a08c,_0x5d7e38,_0x20328b){const _0xaa13e7=a90_0x53b277;return getConsoleNextUrl(_0x59fedb,_0xaa13e7(0x110)+_0x26a08c+'/ag/'+_0x5d7e38+_0xaa13e7(0x100)+_0x20328b);}export function getWorkflowUrl(_0x32c598,_0x38bd04){const _0xc66412=a90_0x53b277;return getConsoleUrl(_0x32c598,_0xc66412(0x136)+_0x38bd04+'/info');}function a90_0xc2bf(){const _0x1b02b8=['https://llm-proxy.treasuredata.co.jp','https://api-presto.eu01.treasuredata.com','https://api-staging.treasuredata.com','https://api-workflow.eu01.treasuredata.com','https://api-presto.ap02.treasuredata.com','https://console.ap02.treasuredata.com','No\x20LLM\x20Proxy\x20endpoint\x20for\x20site:\x20','https://console-staging.treasuredata.co.jp','https://console-staging.ap03.treasuredata.com','https://console.eu01.treasuredata.com','https://api.ap03.treasuredata.com','/ag/','https://llm-api-staging.treasuredata.co.jp','/sessions/','https://engage-api-development.eu01.treasuredata.com','/attempt/','22925FXmgxk','https://api-cdp.ap03.treasuredata.com','https://api-staging.ap03.treasuredata.com','https://delivery-api-staging.ap03.treasuredata.com','https://llm-api.ap03.treasuredata.com','https://llm-proxy-development.eu01.treasuredata.com','https://api-development.eu01.treasuredata.com','\x27\x20and\x20site\x20\x27','https://api-staging-cdp.ap03.treasuredata.com','https://console.ap03.treasuredata.com','https://api-presto.treasuredata.co.jp','/app/jobs/','https://delivery-api.us01.treasuredata.com','https://llm-api.treasuredata.com','https://console.','1586739sLDpZN','https://console-development.eu01.treasuredata.com','https://console-staging-next.treasuredata.co.jp','https://delivery-api-development.eu01.treasuredata.com','144677GycCgc','/app/workflows/','https://console.us01.treasuredata.com','https://api-development.treasuredata.com','No\x20Delivery\x20API\x20endpoint\x20for\x20site:\x20','https://engage-api-development.us01.treasuredata.com','https://llm-proxy-staging.ap03.treasuredata.com','https://llm-proxy.us01.treasuredata.com','https://llm-proxy.ap03.treasuredata.com','/app/es/','https://delivery-api.eu01.treasuredata.com','https://api-presto.ap03.treasuredata.com','https://llm-api-development.us01.treasuredata.com','https://console-staging-next.ap03.treasuredata.com','1156gLPNdV','https://console-staging-next.us01.treasuredata.com','https://llm-proxy-staging.treasuredata.co.jp','https://engage-api.eu01.treasuredata.com','/em/','https://api-staging-workflow.treasuredata.co.jp','/ag','https://api-cdp.eu01.treasuredata.com','https://api-cdp.treasuredata.co.jp','https://engage-api.ap03.treasuredata.com','https://api-staging.treasuredata.co.jp','129PKkvIL','https://llm-proxy.eu01.treasuredata.com','https://api-staging-cdp.us01.treasuredata.com','https://api-development-presto.eu01.treasuredata.com','https://api-staging-workflow.us01.treasuredata.com','https://console-next.ap03.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','https://engage-api-staging.us01.treasuredata.com','https://api-cdp.treasuredata.com','https://engage-api.treasuredata.com','https://api-development-cdp.eu01.treasuredata.com','https://llm-api.treasuredata.co.jp','https://delivery-api.treasuredata.co.jp','https://api-workflow.treasuredata.co.jp','7230360FTrlMc','https://api-cdp.ap02.treasuredata.com','https://api-staging-presto.treasuredata.com','https://api.treasuredata.com','https://api.eu01.treasuredata.com','https://engage-api-staging.ap03.treasuredata.com','https://api-development-workflow.us01.treasuredata.com','/tc/','9TXLplm','https://console-next.','https://llm-proxy.ap02.treasuredata.com','https://engage-api-staging.treasuredata.co.jp','https://engage-api.treasuredata.co.jp','https://console-development-next.us01.treasuredata.com','https://api.ap02.treasuredata.com','https://llm-api.eu01.treasuredata.com','https://api-staging-workflow.ap03.treasuredata.com','https://api-workflow.ap02.treasuredata.com','10vsKOYX','36MoaTAS','.treasuredata.com','2792485HyhVmL','https://api.treasuredata.co.jp','/app/af/','2318370rTudGs'];a90_0xc2bf=function(){return _0x1b02b8;};return a90_0xc2bf();}export function getWorkflowSessionUrl(_0x2aa5e4,_0x4ac49c,_0x245bbe){const _0x59cdb2=a90_0x53b277;return getConsoleUrl(_0x2aa5e4,'/app/workflows/'+_0x4ac49c+_0x59cdb2(0x11f)+_0x245bbe);}export function getWorkflowAttemptUrl(_0x451a13,_0x1e5f60,_0x582184,_0x30ecd2){const _0x317283=a90_0x53b277;return getConsoleUrl(_0x451a13,'/app/workflows/'+_0x1e5f60+_0x317283(0x11f)+_0x582184+_0x317283(0x121)+_0x30ecd2);}export function getCampaignUrl(_0x45f5ea,_0x2dba93,_0x3a4bff){const _0x4b055c=a90_0x53b277;return getConsoleNextUrl(_0x45f5ea,_0x4b055c(0x13e)+_0x2dba93+'/ooc/'+_0x3a4bff);}export function getTemplateUrl(_0x4d2aba,_0x1bcea1,_0x21f7cc){const _0x2272db=a90_0x53b277;return getConsoleNextUrl(_0x4d2aba,_0x2272db(0x13e)+_0x1bcea1+_0x2272db(0x147)+_0x21f7cc+'/ce');}export function getJobUrl(_0x519bde,_0x70c49c){const _0x40e000=a90_0x53b277;return getConsoleNextUrl(_0x519bde,_0x40e000(0x12d)+_0x70c49c+'/result');}export function getWorkspaceUrl(_0x41cb9b,_0x3445b1){return getConsoleNextUrl(_0x41cb9b,'/app/es/'+_0x3445b1);}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};export function getLLMProxyEndpoint(_0x359db4){const _0x1f8d01=a90_0x53b277,_0xd44611=LLM_PROXY_ENDPOINTS[_0x359db4];if(!_0xd44611)throw new Error(_0x1f8d01(0x118)+_0x359db4);return _0xd44611;}export function getEndpoint(_0x20601e,_0x4828bc='td'){const _0x57b07f=a90_0x53b277,_0x2a6534=API_ENDPOINTS[_0x4828bc]?.[_0x20601e];if(!_0x2a6534)throw new Error('No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27'+_0x4828bc+_0x57b07f(0x129)+_0x20601e+'\x27');return _0x2a6534;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a91_0x4eac4b=a91_0x39ee;(function(_0x107668,_0x5c5413){const _0x2bb48b=a91_0x39ee,_0x2dcce9=_0x107668();while(!![]){try{const _0x1f3822=parseInt(_0x2bb48b(0x118))/0x1*(parseInt(_0x2bb48b(0xf7))/0x2)+-parseInt(_0x2bb48b(0xf1))/0x3*(parseInt(_0x2bb48b(0xe3))/0x4)+-parseInt(_0x2bb48b(0xe9))/0x5*(parseInt(_0x2bb48b(0x107))/0x6)+parseInt(_0x2bb48b(0x126))/0x7*(-parseInt(_0x2bb48b(0x12b))/0x8)+-parseInt(_0x2bb48b(0xf5))/0x9*(-parseInt(_0x2bb48b(0x10e))/0xa)+-parseInt(_0x2bb48b(0x117))/0xb*(parseInt(_0x2bb48b(0xf9))/0xc)+parseInt(_0x2bb48b(0xfb))/0xd;if(_0x1f3822===_0x5c5413)break;else _0x2dcce9['push'](_0x2dcce9['shift']());}catch(_0x192854){_0x2dcce9['push'](_0x2dcce9['shift']());}}}(a91_0x3eed,0xad968));import{HTTPClient}from'./http-client.js';function a91_0x39ee(_0x41ac44,_0x5cf1fd){_0x41ac44=_0x41ac44-0xdc;const _0x3eed00=a91_0x3eed();let _0x39ee2b=_0x3eed00[_0x41ac44];return _0x39ee2b;}import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class EngageApiClient{[a91_0x4eac4b(0x121)];constructor(_0xa12f03){const _0x1ca371=a91_0x4eac4b,_0x2fe9bd=getEndpoint(_0xa12f03['site'],_0x1ca371(0x115)),_0x1056ac=toHeaderRecord(getAuthHeaders(_0xa12f03[_0x1ca371(0x124)],_0xa12f03['apiKey'],_0xa12f03[_0x1ca371(0x10c)]));this[_0x1ca371(0x121)]=new HTTPClient(_0x2fe9bd,_0x1056ac,{'proxy':_0xa12f03[_0x1ca371(0xe4)]});}async[a91_0x4eac4b(0x100)](_0x1c90de={}){const _0x148239=a91_0x4eac4b,_0x4c8f58=new URLSearchParams();_0x1c90de[_0x148239(0xe8)]&&_0x4c8f58[_0x148239(0xe5)](_0x148239(0x109),_0x1c90de['campaignType']);_0x1c90de[_0x148239(0xf0)]&&_0x4c8f58[_0x148239(0xe5)](_0x148239(0x127),_0x1c90de[_0x148239(0xf0)]);_0x1c90de[_0x148239(0xef)]&&_0x4c8f58[_0x148239(0xe5)](_0x148239(0xeb),_0x1c90de['workspaceId']);_0x1c90de[_0x148239(0xea)]!==undefined&&_0x4c8f58[_0x148239(0xe5)](_0x148239(0x10b),_0x1c90de[_0x148239(0xea)]['toString']());_0x1c90de[_0x148239(0x129)]!==undefined&&_0x4c8f58[_0x148239(0xe5)]('page[offset]',_0x1c90de[_0x148239(0x129)][_0x148239(0xe0)]());_0x1c90de['sort']&&_0x4c8f58[_0x148239(0xe5)](_0x148239(0x131),_0x1c90de[_0x148239(0x131)]);_0x1c90de[_0x148239(0xe1)]&&_0x4c8f58[_0x148239(0xe5)](_0x148239(0xe1),_0x1c90de[_0x148239(0xe1)]);const _0x33b8fd=_0x4c8f58['toString'](),_0x244598=_0x33b8fd?_0x148239(0xf8)+_0x33b8fd:_0x148239(0xde);return await this[_0x148239(0x121)][_0x148239(0x125)]('GET',_0x244598,{'headers':{'Accept':_0x148239(0x113)}});}async[a91_0x4eac4b(0xfe)](_0x5d36b4){const _0x20e2f2=a91_0x4eac4b;return await this[_0x20e2f2(0x121)][_0x20e2f2(0x125)]('GET','/api/campaigns/'+encodeURIComponent(_0x5d36b4),{'headers':{'Accept':_0x20e2f2(0x113)}});}async[a91_0x4eac4b(0xfc)](_0x4a72c6){const _0x2120f6=a91_0x4eac4b,_0x22eea0={'data':{'type':'campaigns','attributes':_0x4a72c6}};return await this[_0x2120f6(0x121)][_0x2120f6(0x125)](_0x2120f6(0x105),_0x2120f6(0xde),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':JSON[_0x2120f6(0x11a)](_0x22eea0)});}async[a91_0x4eac4b(0x12e)](_0x3d2c67,_0x7808bc){const _0x5a6a59=a91_0x4eac4b,_0x939b27={'data':{'type':'campaigns','id':_0x3d2c67,'attributes':_0x7808bc}};return await this[_0x5a6a59(0x121)][_0x5a6a59(0x125)]('PATCH',_0x5a6a59(0x101)+encodeURIComponent(_0x3d2c67),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x5a6a59(0x113)},'body':JSON[_0x5a6a59(0x11a)](_0x939b27)});}async[a91_0x4eac4b(0xed)](_0x244633){const _0xc62a5=a91_0x4eac4b;await this[_0xc62a5(0x121)][_0xc62a5(0x125)](_0xc62a5(0x130),'/api/campaigns/'+encodeURIComponent(_0x244633),{'headers':{'Accept':_0xc62a5(0x113)}});}async[a91_0x4eac4b(0xf6)](_0x12d761){const _0x3353b2=a91_0x4eac4b;await this[_0x3353b2(0x121)]['request'](_0x3353b2(0x105),_0x3353b2(0x101)+encodeURIComponent(_0x12d761)+_0x3353b2(0x120),{'headers':{'Content-Type':_0x3353b2(0xfa),'Accept':_0x3353b2(0xfa)},'body':JSON[_0x3353b2(0x11a)]({})});}async['pauseCampaign'](_0x540da9){const _0x2f509f=a91_0x4eac4b;await this[_0x2f509f(0x121)][_0x2f509f(0x125)](_0x2f509f(0x105),_0x2f509f(0x101)+encodeURIComponent(_0x540da9)+_0x2f509f(0x111),{'headers':{'Content-Type':_0x2f509f(0xfa),'Accept':'application/json'},'body':JSON[_0x2f509f(0x11a)]({})});}async[a91_0x4eac4b(0xe6)](_0x139128){const _0x26c6a8=a91_0x4eac4b;await this[_0x26c6a8(0x121)][_0x26c6a8(0x125)](_0x26c6a8(0x105),'/api/campaigns/'+encodeURIComponent(_0x139128)+'/resume',{'headers':{'Content-Type':'application/json','Accept':_0x26c6a8(0xfa)},'body':JSON['stringify']({})});}async[a91_0x4eac4b(0xe7)](_0x51605a){const _0x407a8d=a91_0x4eac4b;return await this[_0x407a8d(0x121)][_0x407a8d(0x125)](_0x407a8d(0x105),'/api/campaigns/'+encodeURIComponent(_0x51605a)+'/duplicate',{'headers':{'Content-Type':_0x407a8d(0xfa),'Accept':_0x407a8d(0x113)},'body':JSON[_0x407a8d(0x11a)]({})});}async[a91_0x4eac4b(0x108)](_0x15e1f4={}){const _0x139560=a91_0x4eac4b,_0x5b9696=new URLSearchParams();_0x15e1f4[_0x139560(0xef)]&&_0x5b9696['append'](_0x139560(0xeb),_0x15e1f4['workspaceId']);_0x15e1f4[_0x139560(0xea)]!==undefined&&_0x5b9696['append'](_0x139560(0x10b),_0x15e1f4['limit'][_0x139560(0xe0)]());_0x15e1f4[_0x139560(0x129)]!==undefined&&_0x5b9696[_0x139560(0xe5)](_0x139560(0xdf),_0x15e1f4[_0x139560(0x129)][_0x139560(0xe0)]());_0x15e1f4[_0x139560(0x131)]&&_0x5b9696['append'](_0x139560(0x131),_0x15e1f4['sort']);const _0x1ff80f=_0x5b9696[_0x139560(0xe0)](),_0x37fb2b=_0x1ff80f?_0x139560(0x128)+_0x1ff80f:_0x139560(0xdd);return await this[_0x139560(0x121)][_0x139560(0x125)](_0x139560(0x116),_0x37fb2b,{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x4eac4b(0x11d)](_0xc5f61d){const _0x8e1339=a91_0x4eac4b;return await this[_0x8e1339(0x121)][_0x8e1339(0x125)](_0x8e1339(0x116),_0x8e1339(0x11b)+encodeURIComponent(_0xc5f61d),{'headers':{'Accept':_0x8e1339(0x113)}});}async[a91_0x4eac4b(0x112)](_0x4271be){const _0x2c4a60=a91_0x4eac4b,_0xe1d7a0={'data':{'type':'emailTemplates','attributes':_0x4271be}};return await this[_0x2c4a60(0x121)][_0x2c4a60(0x125)](_0x2c4a60(0x105),'/api/email_templates',{'headers':{'Content-Type':_0x2c4a60(0x113),'Accept':_0x2c4a60(0x113)},'body':JSON[_0x2c4a60(0x11a)](_0xe1d7a0)});}async[a91_0x4eac4b(0x110)](_0x290fa0,_0x8ab8ff){const _0x17d2c6=a91_0x4eac4b,_0x3d0ab2={'data':{'type':_0x17d2c6(0x12f),'id':_0x290fa0,'attributes':_0x8ab8ff}};return await this[_0x17d2c6(0x121)][_0x17d2c6(0x125)](_0x17d2c6(0xfd),_0x17d2c6(0x11b)+encodeURIComponent(_0x290fa0),{'headers':{'Content-Type':_0x17d2c6(0x113),'Accept':_0x17d2c6(0x113)},'body':JSON[_0x17d2c6(0x11a)](_0x3d0ab2)});}async['deleteTemplate'](_0x2ddfe1){const _0x55f987=a91_0x4eac4b;await this[_0x55f987(0x121)][_0x55f987(0x125)](_0x55f987(0x130),'/api/email_templates/'+encodeURIComponent(_0x2ddfe1),{'headers':{'Accept':_0x55f987(0x113)}});}async[a91_0x4eac4b(0xff)](_0x1ca7a9={}){const _0x32c83a=a91_0x4eac4b,_0x18919b=new URLSearchParams();_0x1ca7a9[_0x32c83a(0xf2)]&&_0x18919b['append'](_0x32c83a(0x119),_0x1ca7a9[_0x32c83a(0xf2)]);_0x1ca7a9['ownerName']&&_0x18919b[_0x32c83a(0xe5)](_0x32c83a(0x11f),_0x1ca7a9[_0x32c83a(0x10f)]);_0x1ca7a9[_0x32c83a(0xea)]!==undefined&&_0x18919b[_0x32c83a(0xe5)](_0x32c83a(0x10b),_0x1ca7a9[_0x32c83a(0xea)][_0x32c83a(0xe0)]());_0x1ca7a9['offset']!==undefined&&_0x18919b[_0x32c83a(0xe5)](_0x32c83a(0xdf),_0x1ca7a9[_0x32c83a(0x129)][_0x32c83a(0xe0)]());_0x1ca7a9[_0x32c83a(0x131)]&&_0x18919b[_0x32c83a(0xe5)](_0x32c83a(0x131),_0x1ca7a9[_0x32c83a(0x131)]);const _0x1d8d50=_0x18919b[_0x32c83a(0xe0)](),_0x3a0fae=_0x1d8d50?_0x32c83a(0x10d)+_0x1d8d50:_0x32c83a(0xee);return await this[_0x32c83a(0x121)][_0x32c83a(0x125)]('GET',_0x3a0fae,{'headers':{'Accept':_0x32c83a(0x113)}});}async[a91_0x4eac4b(0xec)](_0x53c511){const _0x306db0=a91_0x4eac4b;return await this['httpClient']['request'](_0x306db0(0x116),_0x306db0(0xdc)+encodeURIComponent(_0x53c511),{'headers':{'Accept':_0x306db0(0x113)}});}async[a91_0x4eac4b(0x114)](_0x3213e9){const _0x11a48e=a91_0x4eac4b,_0x310433={'data':{'type':'workspaces','attributes':_0x3213e9}};return await this[_0x11a48e(0x121)][_0x11a48e(0x125)]('POST',_0x11a48e(0xee),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':JSON['stringify'](_0x310433)});}async['updateWorkspace'](_0x56ee72,_0xd40285){const _0x26c9eb=a91_0x4eac4b,_0x53e6ee={'data':{'type':'workspaces','id':_0x56ee72,'attributes':_0xd40285}};return await this[_0x26c9eb(0x121)]['request'](_0x26c9eb(0xfd),_0x26c9eb(0xdc)+encodeURIComponent(_0x56ee72),{'headers':{'Content-Type':_0x26c9eb(0x113),'Accept':_0x26c9eb(0x113)},'body':JSON['stringify'](_0x53e6ee)});}async[a91_0x4eac4b(0x12c)](_0x812132){const _0x6f3d0e=a91_0x4eac4b;await this[_0x6f3d0e(0x121)][_0x6f3d0e(0x125)](_0x6f3d0e(0x130),'/api/workspaces/'+encodeURIComponent(_0x812132),{'headers':{'Accept':_0x6f3d0e(0x113)}});}async['listAlwaysOnCampaigns'](_0x149421,_0x3e4e88={}){const _0x4c65a0=a91_0x4eac4b,_0x101c3c=new URLSearchParams();_0x3e4e88[_0x4c65a0(0xe8)]&&_0x101c3c[_0x4c65a0(0xe5)](_0x4c65a0(0x109),_0x3e4e88[_0x4c65a0(0xe8)]);_0x3e4e88['status']&&_0x101c3c[_0x4c65a0(0xe5)](_0x4c65a0(0x127),_0x3e4e88[_0x4c65a0(0xf0)]);_0x3e4e88['limit']!==undefined&&_0x101c3c[_0x4c65a0(0xe5)](_0x4c65a0(0x10b),_0x3e4e88[_0x4c65a0(0xea)][_0x4c65a0(0xe0)]());_0x3e4e88['offset']!==undefined&&_0x101c3c[_0x4c65a0(0xe5)](_0x4c65a0(0xdf),_0x3e4e88[_0x4c65a0(0x129)][_0x4c65a0(0xe0)]());_0x3e4e88[_0x4c65a0(0x131)]&&_0x101c3c[_0x4c65a0(0xe5)]('sort',_0x3e4e88[_0x4c65a0(0x131)]);const _0x21ad1a=_0x101c3c[_0x4c65a0(0xe0)](),_0x1af31d='/api/workspaces/'+encodeURIComponent(_0x149421)+'/always_on_campaigns'+(_0x21ad1a?'?'+_0x21ad1a:'');return await this[_0x4c65a0(0x121)][_0x4c65a0(0x125)](_0x4c65a0(0x116),_0x1af31d,{'headers':{'Accept':_0x4c65a0(0x113)}});}async[a91_0x4eac4b(0x11e)](_0x56bd2d,_0x158697){const _0x59462d=a91_0x4eac4b;return await this[_0x59462d(0x121)][_0x59462d(0x125)]('GET',_0x59462d(0xdc)+encodeURIComponent(_0x56bd2d)+_0x59462d(0x104)+encodeURIComponent(_0x158697),{'headers':{'Accept':_0x59462d(0x113)}});}async[a91_0x4eac4b(0x12a)](_0x533bc2,_0x534589){const _0x1d4ed1=a91_0x4eac4b,_0x598fdf={'data':{'type':_0x1d4ed1(0x12d),'attributes':_0x534589}};return await this[_0x1d4ed1(0x121)][_0x1d4ed1(0x125)](_0x1d4ed1(0x105),'/api/workspaces/'+encodeURIComponent(_0x533bc2)+_0x1d4ed1(0x103),{'headers':{'Content-Type':_0x1d4ed1(0x113),'Accept':_0x1d4ed1(0x113)},'body':JSON['stringify'](_0x598fdf)});}async['updateAlwaysOnCampaign'](_0x48ac50,_0x4dbf93,_0x46bd23){const _0x22716c=a91_0x4eac4b,_0x2989d7={'data':{'type':_0x22716c(0x12d),'id':_0x4dbf93,'attributes':_0x46bd23}};return await this[_0x22716c(0x121)][_0x22716c(0x125)]('PATCH',_0x22716c(0xdc)+encodeURIComponent(_0x48ac50)+_0x22716c(0x104)+encodeURIComponent(_0x4dbf93),{'headers':{'Content-Type':_0x22716c(0x113),'Accept':'application/vnd.api+json'},'body':JSON[_0x22716c(0x11a)](_0x2989d7)});}async[a91_0x4eac4b(0x10a)](_0x35dddd,_0x4b1dcc){const _0x17f42f=a91_0x4eac4b;await this[_0x17f42f(0x121)][_0x17f42f(0x125)]('DELETE',_0x17f42f(0xdc)+encodeURIComponent(_0x35dddd)+_0x17f42f(0x104)+encodeURIComponent(_0x4b1dcc),{'headers':{'Accept':_0x17f42f(0x113)}});}async[a91_0x4eac4b(0x102)](_0x47303e,_0x3ca726,_0x2e0a6e){const _0x235885=a91_0x4eac4b;await this['httpClient'][_0x235885(0x125)](_0x235885(0x105),_0x235885(0xdc)+encodeURIComponent(_0x47303e)+_0x235885(0x104)+encodeURIComponent(_0x3ca726)+'/'+_0x2e0a6e,{'headers':{'Content-Type':_0x235885(0xfa),'Accept':_0x235885(0xfa)},'body':JSON[_0x235885(0x11a)]({})});}async['launchAlwaysOnCampaign'](_0x31dae9,_0x4f12e9){const _0x5308f4=a91_0x4eac4b;await this[_0x5308f4(0x102)](_0x31dae9,_0x4f12e9,_0x5308f4(0x11c));}async[a91_0x4eac4b(0xe2)](_0x4ffe15,_0x246f2c){const _0x1f09c5=a91_0x4eac4b;await this[_0x1f09c5(0x102)](_0x4ffe15,_0x246f2c,_0x1f09c5(0xf3));}async['resumeAlwaysOnCampaign'](_0x526fa3,_0x2bedfc){const _0x2c5a12=a91_0x4eac4b;await this['performAlwaysOnCampaignAction'](_0x526fa3,_0x2bedfc,_0x2c5a12(0x106));}async[a91_0x4eac4b(0x122)](_0x1f682c,_0x3e24ca){const _0x5e6c5a=a91_0x4eac4b;await this[_0x5e6c5a(0x102)](_0x1f682c,_0x3e24ca,_0x5e6c5a(0x123));}async[a91_0x4eac4b(0xf4)](_0x314d15,_0x26ee16,_0x307805){const _0x41c237=a91_0x4eac4b,_0x29c31b=_0x307805?{'data':{'attributes':{'name':_0x307805}}}:{};return await this['httpClient'][_0x41c237(0x125)](_0x41c237(0x105),'/api/workspaces/'+encodeURIComponent(_0x314d15)+_0x41c237(0x104)+encodeURIComponent(_0x26ee16)+'/duplicate',{'headers':{'Content-Type':_0x41c237(0xfa),'Accept':_0x41c237(0x113)},'body':JSON['stringify'](_0x29c31b)});}}function a91_0x3eed(){const _0x87d80b=['application/json','9149816ibsuRb','createCampaign','PATCH','getCampaign','listWorkspaces','listCampaigns','/api/campaigns/','performAlwaysOnCampaignAction','/always_on_campaigns','/always_on_campaigns/','POST','resume','7375734RcTjSG','listTemplates','filter[campaignType]','deleteAlwaysOnCampaign','page[limit]','accessToken','/api/workspaces?','20QTtmKH','ownerName','updateTemplate','/pause','createTemplate','application/vnd.api+json','createWorkspace','engage','GET','22OtaVBn','520733fGQuxd','filter[name]','stringify','/api/email_templates/','launch','getTemplate','getAlwaysOnCampaign','filter[owner_user.name]','/launch','httpClient','finishAlwaysOnCampaign','finish','site','request','554981msWRbT','filter[status]','/api/email_templates?','offset','createAlwaysOnCampaign','8kWYaun','deleteWorkspace','always_on_campaigns','updateCampaign','emailTemplates','DELETE','sort','/api/workspaces/','/api/email_templates','/api/campaigns','page[offset]','toString','include','pauseAlwaysOnCampaign','3230800izwUox','proxy','append','resumeCampaign','duplicateCampaign','campaignType','5dnKKzm','limit','filter[workspaceId]','getWorkspace','deleteCampaign','/api/workspaces','workspaceId','status','3EuWwuD','name','pause','duplicateAlwaysOnCampaign','6077772ayuIEn','launchCampaign','4PoLRmo','/api/campaigns?','1611756NDYdVD'];a91_0x3eed=function(){return _0x87d80b;};return a91_0x3eed();}
|
|
1
|
+
const a91_0x259a19=a91_0x4543;(function(_0x3efbbd,_0x3a0c99){const _0x5da338=a91_0x4543,_0x21dcb3=_0x3efbbd();while(!![]){try{const _0x4205d6=parseInt(_0x5da338(0xd2))/0x1*(parseInt(_0x5da338(0xfe))/0x2)+-parseInt(_0x5da338(0x102))/0x3*(-parseInt(_0x5da338(0xf7))/0x4)+parseInt(_0x5da338(0x10c))/0x5+-parseInt(_0x5da338(0xd4))/0x6+parseInt(_0x5da338(0x100))/0x7*(parseInt(_0x5da338(0xf1))/0x8)+-parseInt(_0x5da338(0xe2))/0x9*(-parseInt(_0x5da338(0x114))/0xa)+-parseInt(_0x5da338(0xd8))/0xb;if(_0x4205d6===_0x3a0c99)break;else _0x21dcb3['push'](_0x21dcb3['shift']());}catch(_0x58861d){_0x21dcb3['push'](_0x21dcb3['shift']());}}}(a91_0x414a,0x71598));function a91_0x414a(){const _0x41c1f0=['DELETE','createAlwaysOnCampaign','filter[workspaceId]','updateCampaign','getCampaign','emailTemplates','append','GET','listCampaigns','4337464TpfYOi','resumeCampaign','stringify','finish','createWorkspace','status','385668LZuLZR','/always_on_campaigns/','application/vnd.api+json','/api/workspaces','filter[name]','/api/campaigns','/api/campaigns/','2EczCfG','campaignType','7lsKQAE','site','9VmHNXO','proxy','request','toString','campaigns','resumeAlwaysOnCampaign','limit','createTemplate','duplicateCampaign','updateTemplate','2616680XHupOa','getWorkspace','pauseAlwaysOnCampaign','application/json','deleteTemplate','workspaceId','name','finishAlwaysOnCampaign','1793150EdTPNm','filter[status]','offset','/api/email_templates/','launchCampaign','page[offset]','/resume','page[limit]','createCampaign','ownerName','/api/workspaces?','pauseCampaign','/launch','listTemplates','deleteWorkspace','/pause','performAlwaysOnCampaignAction','POST','workspaces','785101qUNLiB','httpClient','4025682XmaNpk','/duplicate','updateAlwaysOnCampaign','engage','20913409MmmLWy','include','/always_on_campaigns','deleteCampaign','always_on_campaigns','PATCH','/api/campaigns?','getTemplate','deleteAlwaysOnCampaign','filter[campaignType]','45uZlrpU','/api/workspaces/','/api/email_templates','sort','duplicateAlwaysOnCampaign','/api/email_templates?'];a91_0x414a=function(){return _0x41c1f0;};return a91_0x414a();}import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';function a91_0x4543(_0xa77179,_0x27f9cd){_0xa77179=_0xa77179-0xce;const _0x414a9b=a91_0x414a();let _0x45431e=_0x414a9b[_0xa77179];return _0x45431e;}import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class EngageApiClient{[a91_0x259a19(0xd3)];constructor(_0x2a0fdd){const _0x5e1332=a91_0x259a19,_0x98373d=getEndpoint(_0x2a0fdd[_0x5e1332(0x101)],_0x5e1332(0xd7)),_0x1245b0=toHeaderRecord(getAuthHeaders(_0x2a0fdd[_0x5e1332(0x101)],_0x2a0fdd['apiKey'],_0x2a0fdd['accessToken']));this[_0x5e1332(0xd3)]=new HTTPClient(_0x98373d,_0x1245b0,{'proxy':_0x2a0fdd[_0x5e1332(0x103)]});}async[a91_0x259a19(0xf0)](_0x21e6f7={}){const _0x2dc1c5=a91_0x259a19,_0x3930e9=new URLSearchParams();_0x21e6f7[_0x2dc1c5(0xff)]&&_0x3930e9['append'](_0x2dc1c5(0xe1),_0x21e6f7[_0x2dc1c5(0xff)]);_0x21e6f7[_0x2dc1c5(0xf6)]&&_0x3930e9[_0x2dc1c5(0xee)]('filter[status]',_0x21e6f7[_0x2dc1c5(0xf6)]);_0x21e6f7[_0x2dc1c5(0x111)]&&_0x3930e9[_0x2dc1c5(0xee)](_0x2dc1c5(0xea),_0x21e6f7['workspaceId']);_0x21e6f7[_0x2dc1c5(0x108)]!==undefined&&_0x3930e9[_0x2dc1c5(0xee)](_0x2dc1c5(0x11b),_0x21e6f7[_0x2dc1c5(0x108)][_0x2dc1c5(0x105)]());_0x21e6f7[_0x2dc1c5(0x116)]!==undefined&&_0x3930e9[_0x2dc1c5(0xee)](_0x2dc1c5(0x119),_0x21e6f7[_0x2dc1c5(0x116)][_0x2dc1c5(0x105)]());_0x21e6f7[_0x2dc1c5(0xe5)]&&_0x3930e9[_0x2dc1c5(0xee)](_0x2dc1c5(0xe5),_0x21e6f7[_0x2dc1c5(0xe5)]);_0x21e6f7[_0x2dc1c5(0xd9)]&&_0x3930e9[_0x2dc1c5(0xee)](_0x2dc1c5(0xd9),_0x21e6f7[_0x2dc1c5(0xd9)]);const _0x5e46b7=_0x3930e9[_0x2dc1c5(0x105)](),_0x3c7b7c=_0x5e46b7?_0x2dc1c5(0xde)+_0x5e46b7:_0x2dc1c5(0xfc);return await this[_0x2dc1c5(0xd3)][_0x2dc1c5(0x104)]('GET',_0x3c7b7c,{'headers':{'Accept':_0x2dc1c5(0xf9)}});}async[a91_0x259a19(0xec)](_0x91a799){const _0x29cfb9=a91_0x259a19;return await this[_0x29cfb9(0xd3)][_0x29cfb9(0x104)](_0x29cfb9(0xef),'/api/campaigns/'+encodeURIComponent(_0x91a799),{'headers':{'Accept':_0x29cfb9(0xf9)}});}async[a91_0x259a19(0x11c)](_0x598eae){const _0x394923=a91_0x259a19,_0x44f06e={'data':{'type':_0x394923(0x106),'attributes':_0x598eae}};return await this[_0x394923(0xd3)]['request']('POST','/api/campaigns',{'headers':{'Content-Type':_0x394923(0xf9),'Accept':_0x394923(0xf9)},'body':JSON[_0x394923(0xf3)](_0x44f06e)});}async[a91_0x259a19(0xeb)](_0x559afc,_0x1be9ba){const _0x47ddac=a91_0x259a19,_0x3d942b={'data':{'type':_0x47ddac(0x106),'id':_0x559afc,'attributes':_0x1be9ba}};return await this[_0x47ddac(0xd3)][_0x47ddac(0x104)](_0x47ddac(0xdd),_0x47ddac(0xfd)+encodeURIComponent(_0x559afc),{'headers':{'Content-Type':_0x47ddac(0xf9),'Accept':_0x47ddac(0xf9)},'body':JSON[_0x47ddac(0xf3)](_0x3d942b)});}async[a91_0x259a19(0xdb)](_0x11d89c){const _0x5bc871=a91_0x259a19;await this[_0x5bc871(0xd3)][_0x5bc871(0x104)](_0x5bc871(0xe8),'/api/campaigns/'+encodeURIComponent(_0x11d89c),{'headers':{'Accept':_0x5bc871(0xf9)}});}async[a91_0x259a19(0x118)](_0x12cf40){const _0x3cc88b=a91_0x259a19;await this[_0x3cc88b(0xd3)][_0x3cc88b(0x104)](_0x3cc88b(0xd0),_0x3cc88b(0xfd)+encodeURIComponent(_0x12cf40)+_0x3cc88b(0x120),{'headers':{'Content-Type':_0x3cc88b(0x10f),'Accept':_0x3cc88b(0x10f)},'body':JSON[_0x3cc88b(0xf3)]({})});}async[a91_0x259a19(0x11f)](_0x2bf332){const _0x3ec48f=a91_0x259a19;await this['httpClient']['request'](_0x3ec48f(0xd0),_0x3ec48f(0xfd)+encodeURIComponent(_0x2bf332)+_0x3ec48f(0xce),{'headers':{'Content-Type':'application/json','Accept':_0x3ec48f(0x10f)},'body':JSON['stringify']({})});}async[a91_0x259a19(0xf2)](_0x18d877){const _0x7d3a8b=a91_0x259a19;await this[_0x7d3a8b(0xd3)]['request'](_0x7d3a8b(0xd0),_0x7d3a8b(0xfd)+encodeURIComponent(_0x18d877)+_0x7d3a8b(0x11a),{'headers':{'Content-Type':'application/json','Accept':_0x7d3a8b(0x10f)},'body':JSON['stringify']({})});}async[a91_0x259a19(0x10a)](_0x2874e7){const _0x160d5f=a91_0x259a19;return await this[_0x160d5f(0xd3)][_0x160d5f(0x104)](_0x160d5f(0xd0),_0x160d5f(0xfd)+encodeURIComponent(_0x2874e7)+_0x160d5f(0xd5),{'headers':{'Content-Type':_0x160d5f(0x10f),'Accept':'application/vnd.api+json'},'body':JSON[_0x160d5f(0xf3)]({})});}async[a91_0x259a19(0x121)](_0x1641e6={}){const _0x26121a=a91_0x259a19,_0x23f1cc=new URLSearchParams();_0x1641e6[_0x26121a(0x111)]&&_0x23f1cc[_0x26121a(0xee)](_0x26121a(0xea),_0x1641e6[_0x26121a(0x111)]);_0x1641e6[_0x26121a(0x108)]!==undefined&&_0x23f1cc[_0x26121a(0xee)]('page[limit]',_0x1641e6[_0x26121a(0x108)][_0x26121a(0x105)]());_0x1641e6[_0x26121a(0x116)]!==undefined&&_0x23f1cc['append'](_0x26121a(0x119),_0x1641e6[_0x26121a(0x116)][_0x26121a(0x105)]());_0x1641e6[_0x26121a(0xe5)]&&_0x23f1cc['append']('sort',_0x1641e6[_0x26121a(0xe5)]);const _0x124fa1=_0x23f1cc[_0x26121a(0x105)](),_0x57ebfa=_0x124fa1?_0x26121a(0xe7)+_0x124fa1:_0x26121a(0xe4);return await this[_0x26121a(0xd3)][_0x26121a(0x104)]('GET',_0x57ebfa,{'headers':{'Accept':_0x26121a(0xf9)}});}async[a91_0x259a19(0xdf)](_0x3ad3c1){const _0x1abcf5=a91_0x259a19;return await this['httpClient'][_0x1abcf5(0x104)]('GET',_0x1abcf5(0x117)+encodeURIComponent(_0x3ad3c1),{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x259a19(0x109)](_0x25fa8f){const _0x12a60d=a91_0x259a19,_0x13daca={'data':{'type':_0x12a60d(0xed),'attributes':_0x25fa8f}};return await this[_0x12a60d(0xd3)][_0x12a60d(0x104)](_0x12a60d(0xd0),'/api/email_templates',{'headers':{'Content-Type':_0x12a60d(0xf9),'Accept':_0x12a60d(0xf9)},'body':JSON['stringify'](_0x13daca)});}async[a91_0x259a19(0x10b)](_0x353155,_0xdb17b4){const _0x487eb8=a91_0x259a19,_0x70fde2={'data':{'type':_0x487eb8(0xed),'id':_0x353155,'attributes':_0xdb17b4}};return await this[_0x487eb8(0xd3)][_0x487eb8(0x104)](_0x487eb8(0xdd),'/api/email_templates/'+encodeURIComponent(_0x353155),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x487eb8(0xf9)},'body':JSON[_0x487eb8(0xf3)](_0x70fde2)});}async[a91_0x259a19(0x110)](_0xd406db){const _0x3b4e18=a91_0x259a19;await this[_0x3b4e18(0xd3)][_0x3b4e18(0x104)]('DELETE',_0x3b4e18(0x117)+encodeURIComponent(_0xd406db),{'headers':{'Accept':_0x3b4e18(0xf9)}});}async['listWorkspaces'](_0xd762e={}){const _0x3d5930=a91_0x259a19,_0x5c18ba=new URLSearchParams();_0xd762e['name']&&_0x5c18ba[_0x3d5930(0xee)](_0x3d5930(0xfb),_0xd762e[_0x3d5930(0x112)]);_0xd762e[_0x3d5930(0x11d)]&&_0x5c18ba['append']('filter[owner_user.name]',_0xd762e[_0x3d5930(0x11d)]);_0xd762e[_0x3d5930(0x108)]!==undefined&&_0x5c18ba[_0x3d5930(0xee)](_0x3d5930(0x11b),_0xd762e[_0x3d5930(0x108)]['toString']());_0xd762e[_0x3d5930(0x116)]!==undefined&&_0x5c18ba[_0x3d5930(0xee)]('page[offset]',_0xd762e[_0x3d5930(0x116)][_0x3d5930(0x105)]());_0xd762e['sort']&&_0x5c18ba[_0x3d5930(0xee)](_0x3d5930(0xe5),_0xd762e['sort']);const _0x767b47=_0x5c18ba[_0x3d5930(0x105)](),_0x2af03c=_0x767b47?_0x3d5930(0x11e)+_0x767b47:_0x3d5930(0xfa);return await this[_0x3d5930(0xd3)]['request']('GET',_0x2af03c,{'headers':{'Accept':_0x3d5930(0xf9)}});}async[a91_0x259a19(0x10d)](_0x3f908e){const _0x52bce5=a91_0x259a19;return await this[_0x52bce5(0xd3)][_0x52bce5(0x104)](_0x52bce5(0xef),_0x52bce5(0xe3)+encodeURIComponent(_0x3f908e),{'headers':{'Accept':_0x52bce5(0xf9)}});}async[a91_0x259a19(0xf5)](_0x8753c5){const _0x25ac2d=a91_0x259a19,_0x21c45b={'data':{'type':'workspaces','attributes':_0x8753c5}};return await this[_0x25ac2d(0xd3)][_0x25ac2d(0x104)]('POST',_0x25ac2d(0xfa),{'headers':{'Content-Type':_0x25ac2d(0xf9),'Accept':_0x25ac2d(0xf9)},'body':JSON[_0x25ac2d(0xf3)](_0x21c45b)});}async['updateWorkspace'](_0x150b0f,_0x1098d5){const _0x66c135=a91_0x259a19,_0x20afd9={'data':{'type':_0x66c135(0xd1),'id':_0x150b0f,'attributes':_0x1098d5}};return await this[_0x66c135(0xd3)]['request'](_0x66c135(0xdd),_0x66c135(0xe3)+encodeURIComponent(_0x150b0f),{'headers':{'Content-Type':_0x66c135(0xf9),'Accept':_0x66c135(0xf9)},'body':JSON[_0x66c135(0xf3)](_0x20afd9)});}async[a91_0x259a19(0x122)](_0x2a03b7){const _0x2119b4=a91_0x259a19;await this[_0x2119b4(0xd3)][_0x2119b4(0x104)](_0x2119b4(0xe8),_0x2119b4(0xe3)+encodeURIComponent(_0x2a03b7),{'headers':{'Accept':'application/vnd.api+json'}});}async['listAlwaysOnCampaigns'](_0x4a452b,_0x61d32a={}){const _0x2aa5fd=a91_0x259a19,_0x3e4316=new URLSearchParams();_0x61d32a[_0x2aa5fd(0xff)]&&_0x3e4316[_0x2aa5fd(0xee)](_0x2aa5fd(0xe1),_0x61d32a[_0x2aa5fd(0xff)]);_0x61d32a['status']&&_0x3e4316[_0x2aa5fd(0xee)](_0x2aa5fd(0x115),_0x61d32a[_0x2aa5fd(0xf6)]);_0x61d32a['limit']!==undefined&&_0x3e4316['append'](_0x2aa5fd(0x11b),_0x61d32a[_0x2aa5fd(0x108)][_0x2aa5fd(0x105)]());_0x61d32a[_0x2aa5fd(0x116)]!==undefined&&_0x3e4316['append'](_0x2aa5fd(0x119),_0x61d32a['offset'][_0x2aa5fd(0x105)]());_0x61d32a['sort']&&_0x3e4316[_0x2aa5fd(0xee)](_0x2aa5fd(0xe5),_0x61d32a[_0x2aa5fd(0xe5)]);const _0x14825d=_0x3e4316[_0x2aa5fd(0x105)](),_0x5f2472=_0x2aa5fd(0xe3)+encodeURIComponent(_0x4a452b)+_0x2aa5fd(0xda)+(_0x14825d?'?'+_0x14825d:'');return await this[_0x2aa5fd(0xd3)][_0x2aa5fd(0x104)](_0x2aa5fd(0xef),_0x5f2472,{'headers':{'Accept':_0x2aa5fd(0xf9)}});}async['getAlwaysOnCampaign'](_0x22a26d,_0x4f4cdd){const _0x46d73e=a91_0x259a19;return await this[_0x46d73e(0xd3)]['request'](_0x46d73e(0xef),_0x46d73e(0xe3)+encodeURIComponent(_0x22a26d)+'/always_on_campaigns/'+encodeURIComponent(_0x4f4cdd),{'headers':{'Accept':_0x46d73e(0xf9)}});}async[a91_0x259a19(0xe9)](_0x31430e,_0x1ea318){const _0x2c106c=a91_0x259a19,_0x379a00={'data':{'type':_0x2c106c(0xdc),'attributes':_0x1ea318}};return await this[_0x2c106c(0xd3)][_0x2c106c(0x104)](_0x2c106c(0xd0),'/api/workspaces/'+encodeURIComponent(_0x31430e)+_0x2c106c(0xda),{'headers':{'Content-Type':_0x2c106c(0xf9),'Accept':_0x2c106c(0xf9)},'body':JSON[_0x2c106c(0xf3)](_0x379a00)});}async[a91_0x259a19(0xd6)](_0x19d9a9,_0x34f114,_0x974ec4){const _0x590339=a91_0x259a19,_0xab2a83={'data':{'type':'always_on_campaigns','id':_0x34f114,'attributes':_0x974ec4}};return await this[_0x590339(0xd3)][_0x590339(0x104)](_0x590339(0xdd),_0x590339(0xe3)+encodeURIComponent(_0x19d9a9)+'/always_on_campaigns/'+encodeURIComponent(_0x34f114),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x590339(0xf9)},'body':JSON[_0x590339(0xf3)](_0xab2a83)});}async[a91_0x259a19(0xe0)](_0x447ae4,_0x290dba){const _0x3d0cd4=a91_0x259a19;await this['httpClient'][_0x3d0cd4(0x104)]('DELETE',_0x3d0cd4(0xe3)+encodeURIComponent(_0x447ae4)+_0x3d0cd4(0xf8)+encodeURIComponent(_0x290dba),{'headers':{'Accept':_0x3d0cd4(0xf9)}});}async[a91_0x259a19(0xcf)](_0x1fd16d,_0x2afe4b,_0x3e9346){const _0x95b8e1=a91_0x259a19;await this[_0x95b8e1(0xd3)][_0x95b8e1(0x104)](_0x95b8e1(0xd0),_0x95b8e1(0xe3)+encodeURIComponent(_0x1fd16d)+_0x95b8e1(0xf8)+encodeURIComponent(_0x2afe4b)+'/'+_0x3e9346,{'headers':{'Content-Type':_0x95b8e1(0x10f),'Accept':'application/json'},'body':JSON['stringify']({})});}async['launchAlwaysOnCampaign'](_0x1e9bdc,_0x404a14){await this['performAlwaysOnCampaignAction'](_0x1e9bdc,_0x404a14,'launch');}async[a91_0x259a19(0x10e)](_0x427d1c,_0x236c38){const _0x2b855d=a91_0x259a19;await this[_0x2b855d(0xcf)](_0x427d1c,_0x236c38,'pause');}async[a91_0x259a19(0x107)](_0x2c623f,_0x1ecacd){await this['performAlwaysOnCampaignAction'](_0x2c623f,_0x1ecacd,'resume');}async[a91_0x259a19(0x113)](_0x279857,_0x41cc0a){const _0xee182c=a91_0x259a19;await this[_0xee182c(0xcf)](_0x279857,_0x41cc0a,_0xee182c(0xf4));}async[a91_0x259a19(0xe6)](_0x172473,_0x463188,_0x4157d9){const _0x2a86c9=a91_0x259a19,_0x1a3f58=_0x4157d9?{'data':{'attributes':{'name':_0x4157d9}}}:{};return await this[_0x2a86c9(0xd3)][_0x2a86c9(0x104)]('POST','/api/workspaces/'+encodeURIComponent(_0x172473)+_0x2a86c9(0xf8)+encodeURIComponent(_0x463188)+'/duplicate',{'headers':{'Content-Type':'application/json','Accept':'application/vnd.api+json'},'body':JSON[_0x2a86c9(0xf3)](_0x1a3f58)});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a92_0x4316be=a92_0x135d;(function(_0x177e90,_0x117b7c){const _0x1878e9=a92_0x135d,_0x1bcbbd=_0x177e90();while(!![]){try{const _0x5c59be=parseInt(_0x1878e9(0x1ac))/0x1*(-parseInt(_0x1878e9(0x1ee))/0x2)+-parseInt(_0x1878e9(0x1b5))/0x3+parseInt(_0x1878e9(0x1d7))/0x4*(parseInt(_0x1878e9(0x1f6))/0x5)+parseInt(_0x1878e9(0x1fa))/0x6*(parseInt(_0x1878e9(0x1ec))/0x7)+-parseInt(_0x1878e9(0x1ce))/0x8+parseInt(_0x1878e9(0x1bc))/0x9*(parseInt(_0x1878e9(0x207))/0xa)+parseInt(_0x1878e9(0x1c3))/0xb*(-parseInt(_0x1878e9(0x208))/0xc);if(_0x5c59be===_0x117b7c)break;else _0x1bcbbd['push'](_0x1bcbbd['shift']());}catch(_0x345fd2){_0x1bcbbd['push'](_0x1bcbbd['shift']());}}}(a92_0x389b,0x6dfda));import{ErrorCode,SDKError}from'../errors.js';function a92_0x135d(_0x2dece9,_0x559e66){_0x2dece9=_0x2dece9-0x1a0;const _0x389bec=a92_0x389b();let _0x135dfb=_0x389bec[_0x2dece9];return _0x135dfb;}import{Logger}from'../../utils/logger/index.js';import a92_0x401af5 from'json-bigint';function getErrorChain(_0x203782,_0x39fb1e=0x5){const _0x329c8f=a92_0x135d,_0x2d2974=[_0x203782];let _0x945ef3=_0x203782;for(let _0x4881c7=0x0;_0x4881c7<_0x39fb1e&&_0x945ef3;_0x4881c7++){const _0x4542d7=_0x945ef3[_0x329c8f(0x1fe)];if(_0x4542d7 instanceof Error)_0x2d2974['push'](_0x4542d7),_0x945ef3=_0x4542d7;else break;}return _0x2d2974;}function extractRootCause(_0x150ac3){const _0x11058f=a92_0x135d,_0x3bd17a=getErrorChain(_0x150ac3,0x4),_0x27367d=_0x3bd17a[_0x3bd17a[_0x11058f(0x1c4)]-0x1],_0x2416f9=_0x27367d[_0x11058f(0x1fe)];if(_0x2416f9&&!(_0x2416f9 instanceof Error))return String(_0x2416f9);return _0x27367d[_0x11058f(0x1ba)]||_0x11058f(0x1a6);}const DEFAULT_RETRY_CONFIG={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1f40};function isRetryableStatus(_0x2cd617){return _0x2cd617>=0x1f4||_0x2cd617===0x1ad;}function a92_0x389b(){const _0x169573=['baseDelay','NOT_FOUND','username','pow','already\x20running','parseProblemDetails','ms...','retryConfig','requestSSE','Failed\x20to\x20connect\x20through\x20proxy\x20','random','\x0a\x20\x20Details:\x20','5271oxvcQF','Error\x20response\x20body:\x20','20984qrPOHf','includes','addEventListener','toString','defaultHeaders','parse','handleErrorResponse','dispatcher','718455dcjyzk','then','abort','isProxyConnectionError','3798cwlwKy','Retry-After','statusText','Request:\x20','cause','proxyUrl','HTTPClientError','UNAUTHENTICATED','status',']\x20Request\x20failed\x20with\x20','aborted','warn','PROXY_CONNECTION_FAILURE','4011010rftvBJ','360dLtADR','maskProxyCredentials','code','signal','UNAVAILABLE','****',']:\x20','Unknown\x20error','get','string','logger','INTERNAL','\x20failed:\x20','64CFGEIz','maxDelay','PERMISSION_DENIED','proxyReady','title','headers','An\x20error\x20occurred','type','password','1032018XxYOow','baseUrl','AbortError','debug','[Retry\x20','message','object','9qCjWnU','Request\x20failed\x20after\x20retries','maxRetries','Request\x20cancelled\x20by\x20user','detail','arrayBuffer','retrying\x20in\x20','95359osxngp','length','body','round','text','undici','errors','application/json','Using\x20proxy:\x20','name','error','110480woertY','[binary\x20data]','toLowerCase','combineSignals','safeParseJSON','sleep','HTTP\x20','RATE_LIMITED','extractErrorMessage','24BZHpSf','json','stringify','problemDetails','proxy','severity','about:blank','Error','info'];a92_0x389b=function(){return _0x169573;};return a92_0x389b();}function isNonRetryable429(_0x241cba){const _0x40f834=a92_0x135d;return _0x241cba[_0x40f834(0x1ef)](_0x40f834(0x1e4));}function getRetryDelay(_0x4151e8,_0x4881a6){const _0x4a7633=a92_0x135d,_0x3bec8c=Math['min'](_0x4881a6[_0x4a7633(0x1e0)]*Math[_0x4a7633(0x1e3)](0x2,_0x4151e8),_0x4881a6[_0x4a7633(0x1ad)]);return Math[_0x4a7633(0x1ea)]()*_0x3bec8c;}function statusCodeToErrorCode(_0x1e9cfe){const _0x50d4cf=a92_0x135d;if(_0x1e9cfe===0x191)return ErrorCode[_0x50d4cf(0x201)];else{if(_0x1e9cfe===0x193)return ErrorCode[_0x50d4cf(0x1ae)];else{if(_0x1e9cfe===0x194)return ErrorCode[_0x50d4cf(0x1e1)];else{if(_0x1e9cfe===0x1ad)return ErrorCode[_0x50d4cf(0x1d5)];else return _0x1e9cfe>=0x1f4?ErrorCode[_0x50d4cf(0x1a3)]:ErrorCode['INVALID_ARGUMENT'];}}}}export class HTTPClientError extends Error{['status'];['problemDetails'];[a92_0x4316be(0x1a1)];constructor(_0x8ca434,_0x3f58a1,_0x4eb17a){const _0x2ca6e9=a92_0x4316be,_0x245c54=statusCodeToErrorCode(_0x3f58a1);super('['+_0x245c54+']\x20'+_0x8ca434),this['status']=_0x3f58a1,this[_0x2ca6e9(0x1da)]=_0x4eb17a,this[_0x2ca6e9(0x1cc)]=_0x2ca6e9(0x200),this['code']=_0x245c54;}}export class HTTPClient{['retryConfig'];[a92_0x4316be(0x1b6)];[a92_0x4316be(0x1f2)];['logger']=Logger['of']('tdx.client.http');[a92_0x4316be(0x1f5)];[a92_0x4316be(0x1af)];[a92_0x4316be(0x1ff)];constructor(_0x4e3ae4,_0x267037,_0x25849d){const _0x4e1858=a92_0x4316be;this[_0x4e1858(0x1b6)]=_0x4e3ae4,this[_0x4e1858(0x1f2)]=_0x267037,this['retryConfig']={...DEFAULT_RETRY_CONFIG,..._0x25849d?.[_0x4e1858(0x1e7)]},_0x25849d?.[_0x4e1858(0x1db)]&&(this['proxyUrl']=_0x25849d['proxy'],this[_0x4e1858(0x1af)]=import(_0x4e1858(0x1c8))[_0x4e1858(0x1f7)](({ProxyAgent:_0x2d8b8b})=>{const _0x4d6859=_0x4e1858;this[_0x4d6859(0x1f5)]=new _0x2d8b8b(_0x25849d[_0x4d6859(0x1db)]);}),this['logger'][_0x4e1858(0x1df)](_0x4e1858(0x1cb)+this['maskProxyCredentials'](_0x25849d[_0x4e1858(0x1db)])));}['maskProxyCredentials'](_0x2c1e3f){const _0x355bd6=a92_0x4316be;try{const _0x486383=new URL(_0x2c1e3f);return _0x486383[_0x355bd6(0x1e2)]&&(_0x486383[_0x355bd6(0x1e2)]='****'),_0x486383[_0x355bd6(0x1b4)]&&(_0x486383[_0x355bd6(0x1b4)]=_0x355bd6(0x1a4)),_0x486383[_0x355bd6(0x1f1)]();}catch{return _0x2c1e3f;}}['isProxyConnectionError'](_0x27b326){const _0x2ba519=a92_0x4316be,_0x501cbf=getErrorChain(_0x27b326);for(const _0x1f9e69 of _0x501cbf){const _0x15a51c=_0x1f9e69[_0x2ba519(0x1ba)][_0x2ba519(0x1d0)](),_0x413d0c=_0x1f9e69[_0x2ba519(0x1cc)][_0x2ba519(0x1d0)]();if(_0x15a51c[_0x2ba519(0x1ef)](_0x2ba519(0x1db))||_0x413d0c[_0x2ba519(0x1ef)]('proxy')||_0x15a51c['includes']('tunnel')||_0x15a51c['includes']('407'))return!![];if(_0x2ba519(0x1a1)in _0x1f9e69&&typeof _0x1f9e69[_0x2ba519(0x1a1)]===_0x2ba519(0x1a8)){if(_0x1f9e69[_0x2ba519(0x1a1)][_0x2ba519(0x1ef)]('PROXY'))return!![];}}return![];}async['request'](_0x613326,_0x32aee1,_0x3430bb={}){const _0xd3e763=a92_0x4316be,{headers:headers={},body:_0x39e4e8,timeout:timeout=0x7530,retries:retries=this[_0xd3e763(0x1e7)][_0xd3e763(0x1be)],signal:_0x55b945,includeHeaders:includeHeaders=![],responseType:responseType=_0xd3e763(0x1d8)}=_0x3430bb,_0x412355=''+this[_0xd3e763(0x1b6)]+_0x32aee1;this[_0xd3e763(0x1a9)]['info'](_0xd3e763(0x1fd)+_0x613326+'\x20'+_0x412355);const _0x4cabb4={...this[_0xd3e763(0x1f2)],...headers};if(_0x39e4e8&&!_0x4cabb4['Content-Type']){if(_0x39e4e8 instanceof Buffer){}else _0x4cabb4['Content-Type']=_0xd3e763(0x1ca);}let _0xbe40fe;_0x39e4e8&&(_0x39e4e8 instanceof Buffer?_0xbe40fe=_0x39e4e8:_0xbe40fe=typeof _0x39e4e8===_0xd3e763(0x1a8)?_0x39e4e8:JSON[_0xd3e763(0x1d9)](_0x39e4e8));_0xbe40fe&&this[_0xd3e763(0x1a9)]['debug']('request\x20body:\x20'+(typeof _0xbe40fe===_0xd3e763(0x1a8)?_0xbe40fe:_0xd3e763(0x1cf)));let _0x27e3dc=null;for(let _0x4f682d=0x0;_0x4f682d<=retries;_0x4f682d++){try{const _0x2f1114=new AbortController(),_0x519757=setTimeout(()=>_0x2f1114[_0xd3e763(0x1f8)](),timeout);if(_0x55b945){if(_0x55b945[_0xd3e763(0x204)])throw new Error(_0xd3e763(0x1bf));_0x55b945[_0xd3e763(0x1f0)]('abort',()=>_0x2f1114[_0xd3e763(0x1f8)](),{'once':!![]});}this['proxyReady']&&await this[_0xd3e763(0x1af)];const _0x1a06cc={'method':_0x613326,'headers':_0x4cabb4,'body':_0xbe40fe,'signal':_0x2f1114['signal']};this[_0xd3e763(0x1f5)]&&(_0x1a06cc[_0xd3e763(0x1f5)]=this[_0xd3e763(0x1f5)]);const _0x4c16ed=await fetch(_0x412355,_0x1a06cc);clearTimeout(_0x519757);if(_0x4f682d<retries&&isRetryableStatus(_0x4c16ed[_0xd3e763(0x202)])){if(_0x4c16ed[_0xd3e763(0x202)]===0x1ad){const _0xe990f8=await _0x4c16ed['text']();if(isNonRetryable429(_0xe990f8)){const _0x1d1270=this[_0xd3e763(0x1d6)](_0xe990f8)||_0x4c16ed[_0xd3e763(0x1fc)];throw new HTTPClientError(_0x1d1270,_0x4c16ed[_0xd3e763(0x202)]);}}const _0x5e42d9=_0x4c16ed['headers'][_0xd3e763(0x1a7)](_0xd3e763(0x1fb)),_0x25431d=_0x5e42d9?parseInt(_0x5e42d9,0xa)*0x3e8:getRetryDelay(_0x4f682d,this['retryConfig']);console[_0xd3e763(0x205)](_0xd3e763(0x1b9)+(_0x4f682d+0x1)+'/'+retries+_0xd3e763(0x203)+_0x4c16ed['status']+',\x20'+('retrying\x20in\x20'+Math[_0xd3e763(0x1c6)](_0x25431d)+_0xd3e763(0x1e6))),await this[_0xd3e763(0x1d3)](_0x25431d);continue;}!_0x4c16ed['ok']&&await this[_0xd3e763(0x1f4)](_0x4c16ed);let _0x5e5953;if(responseType==='arraybuffer'){const _0x31c844=await _0x4c16ed[_0xd3e763(0x1c1)]();_0x5e5953=Buffer['from'](_0x31c844);}else responseType===_0xd3e763(0x1c7)?_0x5e5953=await _0x4c16ed[_0xd3e763(0x1c7)]():_0x5e5953=await this[_0xd3e763(0x1d2)](_0x4c16ed);this[_0xd3e763(0x1a9)][_0xd3e763(0x1b8)]('Response\x20['+_0x4c16ed[_0xd3e763(0x202)]+_0xd3e763(0x1a5)+_0x613326+'\x20'+_0x32aee1),this[_0xd3e763(0x1a9)]['trace'](JSON[_0xd3e763(0x1d9)](_0x5e5953,null,0x2));if(includeHeaders){const _0x2f03b5={};return _0x4c16ed[_0xd3e763(0x1b1)]['forEach']((_0x16f553,_0x24d541)=>{_0x2f03b5[_0x24d541]=_0x16f553;}),{'data':_0x5e5953,'status':_0x4c16ed['status'],'headers':_0x2f03b5};}return _0x5e5953;}catch(_0x4cea1c){_0x27e3dc=_0x4cea1c instanceof Error?_0x4cea1c:new Error(String(_0x4cea1c));if(_0x4cea1c instanceof HTTPClientError){if(!isRetryableStatus(_0x4cea1c[_0xd3e763(0x202)])||_0x4cea1c[_0xd3e763(0x202)]===0x1ad&&isNonRetryable429(_0x4cea1c['message']))throw _0x4cea1c;}if(_0x4f682d>=retries){if(!(_0x27e3dc instanceof HTTPClientError)){const _0x2208e5=extractRootCause(_0x27e3dc);if(this['proxyUrl']&&this['isProxyConnectionError'](_0x27e3dc))throw new SDKError(ErrorCode[_0xd3e763(0x206)],_0xd3e763(0x1e9)+this[_0xd3e763(0x1a0)](this[_0xd3e763(0x1ff)])+':\x20'+_0x2208e5,_0x27e3dc);throw new SDKError(ErrorCode['HTTP_REQUEST_FAILURE'],'Request\x20to\x20'+_0x412355+_0xd3e763(0x1ab)+_0x2208e5,_0x27e3dc);}throw _0x27e3dc;}const _0x6c4224=getRetryDelay(_0x4f682d,this[_0xd3e763(0x1e7)]);let _0x29415a;_0x27e3dc instanceof HTTPClientError?_0x29415a=_0xd3e763(0x1b9)+(_0x4f682d+0x1)+'/'+retries+']\x20Request\x20failed\x20with\x20HTTP\x20'+_0x27e3dc['status']+':\x20'+_0x27e3dc[_0xd3e763(0x1ba)]+',\x20'+(_0xd3e763(0x1c2)+Math[_0xd3e763(0x1c6)](_0x6c4224)+_0xd3e763(0x1e6)):_0x29415a='[Retry\x20'+(_0x4f682d+0x1)+'/'+retries+']\x20Request\x20to\x20'+_0x412355+_0xd3e763(0x1ab)+_0x27e3dc[_0xd3e763(0x1ba)]+',\x20'+(_0xd3e763(0x1c2)+Math[_0xd3e763(0x1c6)](_0x6c4224)+_0xd3e763(0x1e6)),console[_0xd3e763(0x205)](_0x29415a),await this[_0xd3e763(0x1d3)](_0x6c4224);}}throw _0x27e3dc||new SDKError(ErrorCode[_0xd3e763(0x1aa)],_0xd3e763(0x1bd));}async[a92_0x4316be(0x1d2)](_0x2ff0c0){const _0x3d7d83=a92_0x4316be,_0x1b50c6=await _0x2ff0c0[_0x3d7d83(0x1c7)]();if(!_0x1b50c6)return null;try{const _0x25dc91=a92_0x401af5({'storeAsString':!![]});return _0x25dc91[_0x3d7d83(0x1f3)](_0x1b50c6);}catch{return{'body':_0x1b50c6};}}[a92_0x4316be(0x1e5)](_0x356a04,_0x25caeb){const _0x1ea233=a92_0x4316be;if(!_0x356a04||typeof _0x356a04!==_0x1ea233(0x1bb))return undefined;let _0x12dcd4=_0x356a04;_0x12dcd4[_0x1ea233(0x1c9)]&&typeof _0x12dcd4['errors']===_0x1ea233(0x1bb)&&(_0x12dcd4=_0x12dcd4['errors']);if(_0x12dcd4[_0x1ea233(0x1b3)]||_0x12dcd4[_0x1ea233(0x1b0)]||_0x12dcd4[_0x1ea233(0x1c0)])return{'type':_0x12dcd4['type']||_0x1ea233(0x1dd),'title':_0x12dcd4[_0x1ea233(0x1b0)]||_0x1ea233(0x1de),'status':_0x12dcd4[_0x1ea233(0x202)]||_0x25caeb,'detail':_0x12dcd4[_0x1ea233(0x1c0)]||_0x1ea233(0x1b2),'instance':_0x12dcd4['instance']||'',..._0x12dcd4};const _0x4979dc=_0x12dcd4[_0x1ea233(0x1ba)]||_0x12dcd4[_0x1ea233(0x1cd)]||_0x12dcd4[_0x1ea233(0x1c7)];if(typeof _0x4979dc===_0x1ea233(0x1a8))return{'type':_0x1ea233(0x1dd),'title':_0x12dcd4[_0x1ea233(0x1dc)]||_0x1ea233(0x1de),'status':_0x12dcd4['status_code']||_0x25caeb,'detail':_0x4979dc,'instance':'',..._0x12dcd4};return undefined;}async['handleErrorResponse'](_0x8340cd){const _0x4aef39=a92_0x4316be,_0x2a897e=await this[_0x4aef39(0x1d2)](_0x8340cd),_0x4b0703=this[_0x4aef39(0x1e5)](_0x2a897e,_0x8340cd[_0x4aef39(0x202)]);_0x2a897e&&this[_0x4aef39(0x1a9)][_0x4aef39(0x1b8)](_0x4aef39(0x1ed)+JSON[_0x4aef39(0x1d9)](_0x2a897e));let _0x311e28;if(_0x4b0703?.[_0x4aef39(0x1c0)])_0x311e28=_0x4b0703[_0x4aef39(0x1c0)];else _0x2a897e?_0x311e28=_0x4aef39(0x1d4)+_0x8340cd[_0x4aef39(0x202)]+':\x20'+_0x8340cd[_0x4aef39(0x1fc)]+_0x4aef39(0x1eb)+JSON[_0x4aef39(0x1d9)](_0x2a897e):_0x311e28=_0x4aef39(0x1d4)+_0x8340cd['status']+':\x20'+_0x8340cd['statusText'];throw new HTTPClientError(_0x311e28,_0x8340cd[_0x4aef39(0x202)],_0x4b0703);}['sleep'](_0x5de468){return new Promise(_0x53d4ab=>setTimeout(_0x53d4ab,_0x5de468));}[a92_0x4316be(0x1d6)](_0x480c70){const _0x3d6d1b=a92_0x4316be;try{const _0x58814f=JSON[_0x3d6d1b(0x1f3)](_0x480c70);return _0x58814f['detail']||_0x58814f['message']||_0x58814f[_0x3d6d1b(0x1cd)]||null;}catch{return _0x480c70['length']<0x1f4?_0x480c70:null;}}async[a92_0x4316be(0x1e8)](_0x5b2f9d,_0x2b9ce4,_0x2d068b={}){const _0x27bc67=a92_0x4316be,{headers:headers={},body:_0x2372e5,timeout:timeout=0x7530,signal:_0x8c6194}=_0x2d068b,_0x4865e4=''+this[_0x27bc67(0x1b6)]+_0x2b9ce4,_0x3b1675={...this[_0x27bc67(0x1f2)],...headers},_0x3a4ebd=new AbortController(),_0x3f995b=setTimeout(()=>_0x3a4ebd[_0x27bc67(0x1f8)](),timeout),_0x83d9be=_0x8c6194?[_0x3a4ebd['signal'],_0x8c6194]:[_0x3a4ebd['signal']],_0x1bf646=this[_0x27bc67(0x1d1)](_0x83d9be);try{this[_0x27bc67(0x1af)]&&await this['proxyReady'];const _0x4d749c={'method':_0x5b2f9d,'headers':_0x3b1675,'signal':_0x1bf646};this[_0x27bc67(0x1f5)]&&(_0x4d749c[_0x27bc67(0x1f5)]=this[_0x27bc67(0x1f5)]);if(_0x2372e5){if(typeof _0x2372e5===_0x27bc67(0x1a8))_0x4d749c[_0x27bc67(0x1c5)]=_0x2372e5;else _0x2372e5 instanceof Buffer?_0x4d749c[_0x27bc67(0x1c5)]=_0x2372e5:_0x4d749c[_0x27bc67(0x1c5)]=JSON[_0x27bc67(0x1d9)](_0x2372e5);}const _0xbd253e=await fetch(_0x4865e4,_0x4d749c);return clearTimeout(_0x3f995b),!_0xbd253e['ok']&&await this[_0x27bc67(0x1f4)](_0xbd253e),_0xbd253e;}catch(_0x2a2b19){clearTimeout(_0x3f995b);if(_0x2a2b19 instanceof HTTPClientError)throw _0x2a2b19;if(_0x2a2b19[_0x27bc67(0x1cc)]===_0x27bc67(0x1b7))throw new Error(_0x27bc67(0x1bf));if(this[_0x27bc67(0x1ff)]&&_0x2a2b19 instanceof Error&&this[_0x27bc67(0x1f9)](_0x2a2b19))throw new SDKError(ErrorCode[_0x27bc67(0x206)],_0x27bc67(0x1e9)+this[_0x27bc67(0x1a0)](this[_0x27bc67(0x1ff)])+':\x20'+_0x2a2b19['message'],_0x2a2b19);throw _0x2a2b19;}}[a92_0x4316be(0x1d1)](_0x3790f2){const _0x5be259=a92_0x4316be,_0x1532f6=new AbortController();for(const _0x34cd7b of _0x3790f2){if(_0x34cd7b[_0x5be259(0x204)])return _0x1532f6[_0x5be259(0x1f8)](),_0x1532f6[_0x5be259(0x1a2)];_0x34cd7b[_0x5be259(0x1f0)]('abort',()=>_0x1532f6[_0x5be259(0x1f8)](),{'once':!![]});}return _0x1532f6[_0x5be259(0x1a2)];}}
|
|
1
|
+
const a92_0x2db522=a92_0x3a6f;function a92_0x3a6f(_0x3e1fb1,_0x4b8f74){_0x3e1fb1=_0x3e1fb1-0x1d7;const _0x591fca=a92_0x591f();let _0x3a6f77=_0x591fca[_0x3e1fb1];return _0x3a6f77;}(function(_0x534cf0,_0x151deb){const _0x322c75=a92_0x3a6f,_0x28ec37=_0x534cf0();while(!![]){try{const _0x5d3f32=parseInt(_0x322c75(0x1dc))/0x1*(parseInt(_0x322c75(0x216))/0x2)+parseInt(_0x322c75(0x1d7))/0x3+-parseInt(_0x322c75(0x1e5))/0x4*(parseInt(_0x322c75(0x245))/0x5)+-parseInt(_0x322c75(0x1fc))/0x6*(parseInt(_0x322c75(0x241))/0x7)+parseInt(_0x322c75(0x213))/0x8*(-parseInt(_0x322c75(0x201))/0x9)+parseInt(_0x322c75(0x1e2))/0xa+parseInt(_0x322c75(0x20a))/0xb;if(_0x5d3f32===_0x151deb)break;else _0x28ec37['push'](_0x28ec37['shift']());}catch(_0x5c8f4d){_0x28ec37['push'](_0x28ec37['shift']());}}}(a92_0x591f,0x982a2));import{ErrorCode,SDKError}from'../errors.js';import{Logger}from'../../utils/logger/index.js';import a92_0x2e22b2 from'json-bigint';function getErrorChain(_0x27e043,_0x17ecf7=0x5){const _0x5f083d=a92_0x3a6f,_0x6e9e11=[_0x27e043];let _0x541556=_0x27e043;for(let _0xa20786=0x0;_0xa20786<_0x17ecf7&&_0x541556;_0xa20786++){const _0x491474=_0x541556['cause'];if(_0x491474 instanceof Error)_0x6e9e11[_0x5f083d(0x1e0)](_0x491474),_0x541556=_0x491474;else break;}return _0x6e9e11;}function extractRootCause(_0x3af875){const _0x3c7da6=a92_0x3a6f,_0xc01dc0=getErrorChain(_0x3af875,0x4),_0x51b5ec=_0xc01dc0[_0xc01dc0[_0x3c7da6(0x223)]-0x1],_0x2648a5=_0x51b5ec[_0x3c7da6(0x21e)];if(_0x2648a5&&!(_0x2648a5 instanceof Error))return String(_0x2648a5);return _0x51b5ec[_0x3c7da6(0x22b)]||_0x3c7da6(0x22c);}const DEFAULT_RETRY_CONFIG={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1f40};function isRetryableStatus(_0x37b6d0){return _0x37b6d0>=0x1f4||_0x37b6d0===0x1ad;}function isNonRetryable429(_0x50b074){const _0x9a9851=a92_0x3a6f;return _0x50b074[_0x9a9851(0x212)](_0x9a9851(0x1fd));}function a92_0x591f(){const _0x40fd1d=['maskProxyCredentials','min','undici','length','text','retryConfig','[binary\x20data]','INVALID_ARGUMENT','pow','retrying\x20in\x20','combineSignals','message','Unknown\x20error','Request\x20to\x20','maxDelay','application/json','proxy','signal','Request\x20cancelled\x20by\x20user','status','request','RATE_LIMITED','ms...',']\x20Request\x20failed\x20with\x20','Failed\x20to\x20connect\x20through\x20proxy\x20','parseProblemDetails','Content-Type','defaultHeaders',']\x20Request\x20to\x20','info','toString','dispatcher','\x20failed:\x20','509068pzETiM','addEventListener','request\x20body:\x20','arrayBuffer','151370OuDrXx','object','string','name','235044SxbtIP','about:blank','get','title','Response\x20[','2737rzhOiN','error','Using\x20proxy:\x20','AbortError','push','random','2788270OyRrUe','UNAVAILABLE','safeParseJSON','92tbSdsi','tunnel','username','sleep','maxRetries','proxyUrl','HTTPClientError','body','round','requestSSE','baseUrl','stringify','statusText','arraybuffer','errors','HTTP\x20','An\x20error\x20occurred','from','toLowerCase','parse','PERMISSION_DENIED','forEach','debug','12uajbrg','already\x20running','warn','abort','instance','9cdBoEQ',']\x20Request\x20failed\x20with\x20HTTP\x20','detail','type','headers','logger','json','Retry-After','Error\x20response\x20body:\x20','10673025paVoSn','then','Request:\x20','extractErrorMessage','407','code','Error','INTERNAL','includes','629256GAstdm','handleErrorResponse','password','158Xvndlp','PROXY_CONNECTION_FAILURE','Request\x20failed\x20after\x20retries','proxyReady','[Retry\x20','HTTP_REQUEST_FAILURE','trace','UNAUTHENTICATED','cause','isProxyConnectionError'];a92_0x591f=function(){return _0x40fd1d;};return a92_0x591f();}function getRetryDelay(_0x50be77,_0x4cf483){const _0x8dc18a=a92_0x3a6f,_0x1f6e18=Math[_0x8dc18a(0x221)](_0x4cf483['baseDelay']*Math[_0x8dc18a(0x228)](0x2,_0x50be77),_0x4cf483[_0x8dc18a(0x22e)]);return Math[_0x8dc18a(0x1e1)]()*_0x1f6e18;}function statusCodeToErrorCode(_0x408ab9){const _0x415583=a92_0x3a6f;if(_0x408ab9===0x191)return ErrorCode[_0x415583(0x21d)];else{if(_0x408ab9===0x193)return ErrorCode[_0x415583(0x1f9)];else{if(_0x408ab9===0x194)return ErrorCode['NOT_FOUND'];else{if(_0x408ab9===0x1ad)return ErrorCode[_0x415583(0x235)];else return _0x408ab9>=0x1f4?ErrorCode[_0x415583(0x1e3)]:ErrorCode[_0x415583(0x227)];}}}}export class HTTPClientError extends Error{[a92_0x2db522(0x233)];['problemDetails'];[a92_0x2db522(0x20f)];constructor(_0x649ac6,_0x1c59eb,_0x1d5233){const _0x26c047=a92_0x2db522,_0x59b445=statusCodeToErrorCode(_0x1c59eb);super('['+_0x59b445+']\x20'+_0x649ac6),this[_0x26c047(0x233)]=_0x1c59eb,this['problemDetails']=_0x1d5233,this['name']=_0x26c047(0x1eb),this[_0x26c047(0x20f)]=_0x59b445;}}export class HTTPClient{[a92_0x2db522(0x225)];[a92_0x2db522(0x1ef)];[a92_0x2db522(0x23b)];['logger']=Logger['of']('tdx.client.http');[a92_0x2db522(0x23f)];[a92_0x2db522(0x219)];[a92_0x2db522(0x1ea)];constructor(_0x2359ac,_0x384e18,_0x1575ae){const _0x57f2ad=a92_0x2db522;this[_0x57f2ad(0x1ef)]=_0x2359ac,this['defaultHeaders']=_0x384e18,this[_0x57f2ad(0x225)]={...DEFAULT_RETRY_CONFIG,..._0x1575ae?.['retryConfig']},_0x1575ae?.[_0x57f2ad(0x230)]&&(this[_0x57f2ad(0x1ea)]=_0x1575ae[_0x57f2ad(0x230)],this[_0x57f2ad(0x219)]=import(_0x57f2ad(0x222))[_0x57f2ad(0x20b)](({ProxyAgent:_0x3fb86})=>{const _0x14159d=_0x57f2ad;this[_0x14159d(0x23f)]=new _0x3fb86(_0x1575ae[_0x14159d(0x230)]);}),this['logger'][_0x57f2ad(0x23d)](_0x57f2ad(0x1de)+this[_0x57f2ad(0x220)](_0x1575ae['proxy'])));}[a92_0x2db522(0x220)](_0xe83f5b){const _0x20ab0b=a92_0x2db522;try{const _0x4e80de=new URL(_0xe83f5b);return _0x4e80de['username']&&(_0x4e80de[_0x20ab0b(0x1e7)]='****'),_0x4e80de[_0x20ab0b(0x215)]&&(_0x4e80de[_0x20ab0b(0x215)]='****'),_0x4e80de[_0x20ab0b(0x23e)]();}catch{return _0xe83f5b;}}[a92_0x2db522(0x21f)](_0x4a7cca){const _0x2b8775=a92_0x2db522,_0x59b43a=getErrorChain(_0x4a7cca);for(const _0x5008e3 of _0x59b43a){const _0x108361=_0x5008e3[_0x2b8775(0x22b)][_0x2b8775(0x1f7)](),_0x52ef5b=_0x5008e3[_0x2b8775(0x248)]['toLowerCase']();if(_0x108361['includes'](_0x2b8775(0x230))||_0x52ef5b[_0x2b8775(0x212)]('proxy')||_0x108361['includes'](_0x2b8775(0x1e6))||_0x108361[_0x2b8775(0x212)](_0x2b8775(0x20e)))return!![];if(_0x2b8775(0x20f)in _0x5008e3&&typeof _0x5008e3[_0x2b8775(0x20f)]===_0x2b8775(0x247)){if(_0x5008e3[_0x2b8775(0x20f)][_0x2b8775(0x212)]('PROXY'))return!![];}}return![];}async[a92_0x2db522(0x234)](_0x323631,_0x39d870,_0x19fb10={}){const _0x187880=a92_0x2db522,{headers:headers={},body:_0x27abfd,timeout:timeout=0x7530,retries:retries=this[_0x187880(0x225)][_0x187880(0x1e9)],signal:_0x508041,includeHeaders:includeHeaders=![],responseType:responseType=_0x187880(0x207)}=_0x19fb10,_0x4f4e4b=''+this[_0x187880(0x1ef)]+_0x39d870;this['logger']['info'](_0x187880(0x20c)+_0x323631+'\x20'+_0x4f4e4b);const _0x5771b8={...this[_0x187880(0x23b)],...headers};if(_0x27abfd&&!_0x5771b8[_0x187880(0x23a)]){if(_0x27abfd instanceof Buffer){}else _0x5771b8['Content-Type']=_0x187880(0x22f);}let _0x2d2262;_0x27abfd&&(_0x27abfd instanceof Buffer?_0x2d2262=_0x27abfd:_0x2d2262=typeof _0x27abfd===_0x187880(0x247)?_0x27abfd:JSON[_0x187880(0x1f0)](_0x27abfd));_0x2d2262&&this[_0x187880(0x206)][_0x187880(0x1fb)](_0x187880(0x243)+(typeof _0x2d2262===_0x187880(0x247)?_0x2d2262:_0x187880(0x226)));let _0x64fbeb=null;for(let _0x383ace=0x0;_0x383ace<=retries;_0x383ace++){try{const _0x482538=new AbortController(),_0x53338b=setTimeout(()=>_0x482538[_0x187880(0x1ff)](),timeout);if(_0x508041){if(_0x508041['aborted'])throw new Error(_0x187880(0x232));_0x508041[_0x187880(0x242)](_0x187880(0x1ff),()=>_0x482538['abort'](),{'once':!![]});}this[_0x187880(0x219)]&&await this[_0x187880(0x219)];const _0x3db329={'method':_0x323631,'headers':_0x5771b8,'body':_0x2d2262,'signal':_0x482538['signal']};this['dispatcher']&&(_0x3db329['dispatcher']=this[_0x187880(0x23f)]);const _0x49a586=await fetch(_0x4f4e4b,_0x3db329);clearTimeout(_0x53338b);if(_0x383ace<retries&&isRetryableStatus(_0x49a586[_0x187880(0x233)])){if(_0x49a586[_0x187880(0x233)]===0x1ad){const _0x36d6cc=await _0x49a586['text']();if(isNonRetryable429(_0x36d6cc)){const _0x3a5280=this[_0x187880(0x20d)](_0x36d6cc)||_0x49a586[_0x187880(0x1f1)];throw new HTTPClientError(_0x3a5280,_0x49a586['status']);}}const _0x58ec12=_0x49a586[_0x187880(0x205)][_0x187880(0x1d9)](_0x187880(0x208)),_0x192f99=_0x58ec12?parseInt(_0x58ec12,0xa)*0x3e8:getRetryDelay(_0x383ace,this[_0x187880(0x225)]);console['warn']('[Retry\x20'+(_0x383ace+0x1)+'/'+retries+_0x187880(0x237)+_0x49a586[_0x187880(0x233)]+',\x20'+(_0x187880(0x229)+Math[_0x187880(0x1ed)](_0x192f99)+_0x187880(0x236))),await this['sleep'](_0x192f99);continue;}!_0x49a586['ok']&&await this[_0x187880(0x214)](_0x49a586);let _0xfdcbdf;if(responseType===_0x187880(0x1f2)){const _0x57ce16=await _0x49a586[_0x187880(0x244)]();_0xfdcbdf=Buffer[_0x187880(0x1f6)](_0x57ce16);}else responseType==='text'?_0xfdcbdf=await _0x49a586['text']():_0xfdcbdf=await this[_0x187880(0x1e4)](_0x49a586);this[_0x187880(0x206)]['debug'](_0x187880(0x1db)+_0x49a586['status']+']:\x20'+_0x323631+'\x20'+_0x39d870),this['logger'][_0x187880(0x21c)](JSON[_0x187880(0x1f0)](_0xfdcbdf,null,0x2));if(includeHeaders){const _0x24559a={};return _0x49a586[_0x187880(0x205)][_0x187880(0x1fa)]((_0x1cc2b4,_0x61d488)=>{_0x24559a[_0x61d488]=_0x1cc2b4;}),{'data':_0xfdcbdf,'status':_0x49a586[_0x187880(0x233)],'headers':_0x24559a};}return _0xfdcbdf;}catch(_0x5bd9b4){_0x64fbeb=_0x5bd9b4 instanceof Error?_0x5bd9b4:new Error(String(_0x5bd9b4));if(_0x5bd9b4 instanceof HTTPClientError){if(!isRetryableStatus(_0x5bd9b4[_0x187880(0x233)])||_0x5bd9b4['status']===0x1ad&&isNonRetryable429(_0x5bd9b4[_0x187880(0x22b)]))throw _0x5bd9b4;}if(_0x383ace>=retries){if(!(_0x64fbeb instanceof HTTPClientError)){const _0x394433=extractRootCause(_0x64fbeb);if(this['proxyUrl']&&this['isProxyConnectionError'](_0x64fbeb))throw new SDKError(ErrorCode[_0x187880(0x217)],_0x187880(0x238)+this['maskProxyCredentials'](this[_0x187880(0x1ea)])+':\x20'+_0x394433,_0x64fbeb);throw new SDKError(ErrorCode[_0x187880(0x21b)],_0x187880(0x22d)+_0x4f4e4b+_0x187880(0x240)+_0x394433,_0x64fbeb);}throw _0x64fbeb;}const _0x1d4ec7=getRetryDelay(_0x383ace,this[_0x187880(0x225)]);let _0x3526a0;_0x64fbeb instanceof HTTPClientError?_0x3526a0='[Retry\x20'+(_0x383ace+0x1)+'/'+retries+_0x187880(0x202)+_0x64fbeb[_0x187880(0x233)]+':\x20'+_0x64fbeb[_0x187880(0x22b)]+',\x20'+('retrying\x20in\x20'+Math['round'](_0x1d4ec7)+_0x187880(0x236)):_0x3526a0=_0x187880(0x21a)+(_0x383ace+0x1)+'/'+retries+_0x187880(0x23c)+_0x4f4e4b+'\x20failed:\x20'+_0x64fbeb[_0x187880(0x22b)]+',\x20'+(_0x187880(0x229)+Math['round'](_0x1d4ec7)+_0x187880(0x236)),console[_0x187880(0x1fe)](_0x3526a0),await this[_0x187880(0x1e8)](_0x1d4ec7);}}throw _0x64fbeb||new SDKError(ErrorCode[_0x187880(0x211)],_0x187880(0x218));}async[a92_0x2db522(0x1e4)](_0x1eb1fa){const _0x549cdb=a92_0x2db522,_0xfc8e93=await _0x1eb1fa[_0x549cdb(0x224)]();if(!_0xfc8e93)return null;try{const _0x2aa5e5=a92_0x2e22b2({'storeAsString':!![]});return _0x2aa5e5[_0x549cdb(0x1f8)](_0xfc8e93);}catch{return{'body':_0xfc8e93};}}[a92_0x2db522(0x239)](_0x3f5f5d,_0x303945){const _0x399244=a92_0x2db522;if(!_0x3f5f5d||typeof _0x3f5f5d!==_0x399244(0x246))return undefined;let _0x2f31f0=_0x3f5f5d;_0x2f31f0['errors']&&typeof _0x2f31f0[_0x399244(0x1f3)]==='object'&&(_0x2f31f0=_0x2f31f0[_0x399244(0x1f3)]);if(_0x2f31f0[_0x399244(0x204)]||_0x2f31f0['title']||_0x2f31f0[_0x399244(0x203)])return{'type':_0x2f31f0[_0x399244(0x204)]||'about:blank','title':_0x2f31f0[_0x399244(0x1da)]||_0x399244(0x210),'status':_0x2f31f0[_0x399244(0x233)]||_0x303945,'detail':_0x2f31f0[_0x399244(0x203)]||_0x399244(0x1f5),'instance':_0x2f31f0[_0x399244(0x200)]||'',..._0x2f31f0};const _0x10185c=_0x2f31f0[_0x399244(0x22b)]||_0x2f31f0[_0x399244(0x1dd)]||_0x2f31f0[_0x399244(0x224)];if(typeof _0x10185c===_0x399244(0x247))return{'type':_0x399244(0x1d8),'title':_0x2f31f0['severity']||_0x399244(0x210),'status':_0x2f31f0['status_code']||_0x303945,'detail':_0x10185c,'instance':'',..._0x2f31f0};return undefined;}async['handleErrorResponse'](_0x140fc5){const _0x642c98=a92_0x2db522,_0x688b53=await this['safeParseJSON'](_0x140fc5),_0x3fcab0=this[_0x642c98(0x239)](_0x688b53,_0x140fc5['status']);_0x688b53&&this[_0x642c98(0x206)][_0x642c98(0x1fb)](_0x642c98(0x209)+JSON[_0x642c98(0x1f0)](_0x688b53));let _0x3ad41c;if(_0x3fcab0?.['detail'])_0x3ad41c=_0x3fcab0[_0x642c98(0x203)];else _0x688b53?_0x3ad41c=_0x642c98(0x1f4)+_0x140fc5[_0x642c98(0x233)]+':\x20'+_0x140fc5[_0x642c98(0x1f1)]+'\x0a\x20\x20Details:\x20'+JSON[_0x642c98(0x1f0)](_0x688b53):_0x3ad41c='HTTP\x20'+_0x140fc5[_0x642c98(0x233)]+':\x20'+_0x140fc5['statusText'];throw new HTTPClientError(_0x3ad41c,_0x140fc5['status'],_0x3fcab0);}['sleep'](_0x468c7d){return new Promise(_0x3d87c0=>setTimeout(_0x3d87c0,_0x468c7d));}[a92_0x2db522(0x20d)](_0x4263ba){const _0x261085=a92_0x2db522;try{const _0x3c38d7=JSON[_0x261085(0x1f8)](_0x4263ba);return _0x3c38d7[_0x261085(0x203)]||_0x3c38d7[_0x261085(0x22b)]||_0x3c38d7[_0x261085(0x1dd)]||null;}catch{return _0x4263ba[_0x261085(0x223)]<0x1f4?_0x4263ba:null;}}async[a92_0x2db522(0x1ee)](_0x3a9488,_0x66c5a2,_0xae770d={}){const _0x3bfa8f=a92_0x2db522,{headers:headers={},body:_0xd831af,timeout:timeout=0x7530,signal:_0x1af079}=_0xae770d,_0x46c5fb=''+this[_0x3bfa8f(0x1ef)]+_0x66c5a2,_0x204a53={...this[_0x3bfa8f(0x23b)],...headers},_0x1796f6=new AbortController(),_0x30cad2=setTimeout(()=>_0x1796f6[_0x3bfa8f(0x1ff)](),timeout),_0x5482ad=_0x1af079?[_0x1796f6[_0x3bfa8f(0x231)],_0x1af079]:[_0x1796f6['signal']],_0x1a9451=this[_0x3bfa8f(0x22a)](_0x5482ad);try{this[_0x3bfa8f(0x219)]&&await this[_0x3bfa8f(0x219)];const _0x12a92e={'method':_0x3a9488,'headers':_0x204a53,'signal':_0x1a9451};this['dispatcher']&&(_0x12a92e[_0x3bfa8f(0x23f)]=this[_0x3bfa8f(0x23f)]);if(_0xd831af){if(typeof _0xd831af===_0x3bfa8f(0x247))_0x12a92e[_0x3bfa8f(0x1ec)]=_0xd831af;else _0xd831af instanceof Buffer?_0x12a92e[_0x3bfa8f(0x1ec)]=_0xd831af:_0x12a92e['body']=JSON[_0x3bfa8f(0x1f0)](_0xd831af);}const _0x1e2820=await fetch(_0x46c5fb,_0x12a92e);return clearTimeout(_0x30cad2),!_0x1e2820['ok']&&await this['handleErrorResponse'](_0x1e2820),_0x1e2820;}catch(_0x1e7c4b){clearTimeout(_0x30cad2);if(_0x1e7c4b instanceof HTTPClientError)throw _0x1e7c4b;if(_0x1e7c4b['name']===_0x3bfa8f(0x1df))throw new Error(_0x3bfa8f(0x232));if(this['proxyUrl']&&_0x1e7c4b instanceof Error&&this[_0x3bfa8f(0x21f)](_0x1e7c4b))throw new SDKError(ErrorCode[_0x3bfa8f(0x217)],'Failed\x20to\x20connect\x20through\x20proxy\x20'+this[_0x3bfa8f(0x220)](this[_0x3bfa8f(0x1ea)])+':\x20'+_0x1e7c4b['message'],_0x1e7c4b);throw _0x1e7c4b;}}[a92_0x2db522(0x22a)](_0x47bafe){const _0x2e8b1c=a92_0x2db522,_0x3beddf=new AbortController();for(const _0x1e0532 of _0x47bafe){if(_0x1e0532['aborted'])return _0x3beddf[_0x2e8b1c(0x1ff)](),_0x3beddf[_0x2e8b1c(0x231)];_0x1e0532['addEventListener']('abort',()=>_0x3beddf[_0x2e8b1c(0x1ff)](),{'once':!![]});}return _0x3beddf[_0x2e8b1c(0x231)];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a93_0x40a016=a93_0x452c;(function(_0x544102,_0x4b75c6){const _0xe13d62=a93_0x452c,_0x336c00=_0x544102();while(!![]){try{const _0x52de33=-parseInt(_0xe13d62(0x270))/0x1+parseInt(_0xe13d62(0x245))/0x2*(parseInt(_0xe13d62(0x203))/0x3)+-parseInt(_0xe13d62(0x259))/0x4*(parseInt(_0xe13d62(0x261))/0x5)+-parseInt(_0xe13d62(0x244))/0x6+parseInt(_0xe13d62(0x1e4))/0x7*(-parseInt(_0xe13d62(0x24e))/0x8)+-parseInt(_0xe13d62(0x200))/0x9+parseInt(_0xe13d62(0x253))/0xa;if(_0x52de33===_0x4b75c6)break;else _0x336c00['push'](_0x336c00['shift']());}catch(_0x406985){_0x336c00['push'](_0x336c00['shift']());}}}(a93_0x8b17,0xaa97f));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';import{parseSSEStream}from'../../utils/sse-parser.js';function a93_0x452c(_0x118510,_0xacd71e){_0x118510=_0x118510-0x1e3;const _0x8b17b0=a93_0x8b17();let _0x452c2a=_0x8b17b0[_0x118510];return _0x452c2a;}import{ErrorCode,SDKError}from'../errors.js';import{Logger}from'../../utils/logger/index.js';export class LLMApiClient{[a93_0x40a016(0x21d)];['baseUrl'];['authHeaders'];[a93_0x40a016(0x262)]=Logger['of'](a93_0x40a016(0x25e));constructor(_0xce8b95){const _0x296d43=a93_0x40a016;this[_0x296d43(0x234)]=getEndpoint(_0xce8b95[_0x296d43(0x1f9)],_0x296d43(0x202)),this[_0x296d43(0x225)]=toHeaderRecord(getAuthHeaders(_0xce8b95['site'],_0xce8b95['apiKey'],_0xce8b95[_0x296d43(0x231)])),this['httpClient']=new HTTPClient(this[_0x296d43(0x234)],this[_0x296d43(0x225)],{'proxy':_0xce8b95[_0x296d43(0x201)]});}async['paginateAll'](_0x163d6b){const _0x58b381=a93_0x40a016,_0x4e7c26=[];let _0x24eb92=_0x163d6b;while(_0x24eb92){const _0x3111cd=await this[_0x58b381(0x21d)]['request'](_0x58b381(0x21e),_0x24eb92);_0x3111cd[_0x58b381(0x250)]&&_0x4e7c26[_0x58b381(0x207)](..._0x3111cd[_0x58b381(0x250)]);_0x24eb92=_0x3111cd['links']?.['next'];if(_0x24eb92&&_0x24eb92[_0x58b381(0x278)]('http')){const _0x20b539=new URL(_0x24eb92);_0x24eb92=_0x20b539[_0x58b381(0x265)]+_0x20b539[_0x58b381(0x242)];}}return _0x4e7c26;}async[a93_0x40a016(0x1ee)](){const _0x34a6a3=a93_0x40a016;return await this[_0x34a6a3(0x21d)][_0x34a6a3(0x1fb)](_0x34a6a3(0x21e),_0x34a6a3(0x1e8));}async[a93_0x40a016(0x267)](_0x27dca1){const _0x1e7888=a93_0x40a016,_0x15558f={'data':{'type':_0x1e7888(0x26a),'attributes':{'name':_0x27dca1[_0x1e7888(0x23d)],..._0x27dca1[_0x1e7888(0x1f2)]&&{'description':_0x27dca1[_0x1e7888(0x1f2)]}}}},_0x2cf5b5=await this[_0x1e7888(0x21d)][_0x1e7888(0x1fb)](_0x1e7888(0x23a),_0x1e7888(0x27a),{'headers':{'Content-Type':_0x1e7888(0x1fd),'Accept':_0x1e7888(0x1fd)},'body':_0x15558f});return _0x2cf5b5[_0x1e7888(0x250)];}async['deleteProject'](_0x4df12b){const _0x127ee6=a93_0x40a016,_0x37305b='/api/projects/'+encodeURIComponent(_0x4df12b);await this[_0x127ee6(0x21d)][_0x127ee6(0x1fb)]('DELETE',_0x37305b);}async[a93_0x40a016(0x232)](_0x57e180=0x32){const _0x11d6d1=a93_0x40a016;return this['paginateAll'](_0x11d6d1(0x1f5)+_0x57e180);}async[a93_0x40a016(0x219)](_0x35b477){const _0x4417e4=a93_0x40a016;let _0x12068a=_0x4417e4(0x257);return _0x35b477&&(_0x12068a+=_0x4417e4(0x24b)+encodeURIComponent(_0x35b477)),this['paginateAll'](_0x12068a);}async[a93_0x40a016(0x229)](_0x2e80e5){const _0x3dc217=a93_0x40a016,_0x299523=_0x3dc217(0x210)+encodeURIComponent(_0x2e80e5),_0x574dc6=await this[_0x3dc217(0x21d)][_0x3dc217(0x1fb)]('GET',_0x299523);return _0x574dc6[_0x3dc217(0x250)];}async[a93_0x40a016(0x22e)](_0x216d4a){const _0x4f94c9=a93_0x40a016,_0x5acfeb={'name':_0x216d4a[_0x4f94c9(0x23d)],'projectId':_0x216d4a[_0x4f94c9(0x236)],'modelType':_0x216d4a[_0x4f94c9(0x23b)],'maxToolIterations':_0x216d4a[_0x4f94c9(0x21b)]??0x4,'temperature':_0x216d4a['temperature']??0.7};_0x216d4a[_0x4f94c9(0x20b)]!==undefined&&(_0x5acfeb[_0x4f94c9(0x20b)]=_0x216d4a[_0x4f94c9(0x20b)]);_0x216d4a['starterMessage']&&(_0x5acfeb[_0x4f94c9(0x20d)]=_0x216d4a[_0x4f94c9(0x20d)]);_0x216d4a['reasoningEffort']&&(_0x5acfeb[_0x4f94c9(0x272)]=_0x216d4a['reasoningEffort']);_0x216d4a[_0x4f94c9(0x204)]&&_0x216d4a[_0x4f94c9(0x204)][_0x4f94c9(0x241)]>0x0&&(_0x5acfeb[_0x4f94c9(0x204)]=_0x216d4a[_0x4f94c9(0x204)]);const _0x526b01={'data':{'type':_0x4f94c9(0x212),'attributes':_0x5acfeb}},_0xdc26e5=await this[_0x4f94c9(0x21d)]['request']('POST',_0x4f94c9(0x1ff),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x526b01});return _0xdc26e5['data'];}async[a93_0x40a016(0x215)](_0x2fadff,_0x3fbb50){const _0x54c441=a93_0x40a016,_0x1b7e11={'data':{'type':_0x54c441(0x212),'id':_0x2fadff,'attributes':{..._0x3fbb50[_0x54c441(0x23d)]&&{'name':_0x3fbb50['name']},..._0x3fbb50[_0x54c441(0x1f2)]&&{'description':_0x3fbb50[_0x54c441(0x1f2)]},..._0x3fbb50[_0x54c441(0x21a)]&&{'prompt':_0x3fbb50[_0x54c441(0x21a)]},..._0x3fbb50[_0x54c441(0x20d)]&&{'starter_message':_0x3fbb50['starterMessage']},..._0x3fbb50[_0x54c441(0x272)]&&{'reasoningEffort':_0x3fbb50['reasoningEffort']}}}},_0x167182=_0x54c441(0x210)+encodeURIComponent(_0x2fadff),_0x58abf7=await this[_0x54c441(0x21d)][_0x54c441(0x1fb)](_0x54c441(0x1ec),_0x167182,{'headers':{'Content-Type':_0x54c441(0x1fd)},'body':_0x1b7e11});return _0x58abf7[_0x54c441(0x250)];}async[a93_0x40a016(0x25c)](_0x4b178b){const _0x1c52e4=a93_0x40a016,_0x32b98f=_0x1c52e4(0x210)+encodeURIComponent(_0x4b178b);await this[_0x1c52e4(0x21d)][_0x1c52e4(0x1fb)](_0x1c52e4(0x22c),_0x32b98f);}async['listChats'](_0x3479d9=0x32){const _0x40e9ff=a93_0x40a016,_0x4b663c=new URLSearchParams();_0x4b663c[_0x40e9ff(0x276)]('page[limit]',String(_0x3479d9)),_0x4b663c[_0x40e9ff(0x276)](_0x40e9ff(0x27b),_0x40e9ff(0x237));const _0x48aadc=_0x40e9ff(0x25b)+_0x4b663c[_0x40e9ff(0x1e7)](),_0x5b37d5=await this[_0x40e9ff(0x21d)][_0x40e9ff(0x1fb)](_0x40e9ff(0x21e),_0x48aadc);return _0x5b37d5[_0x40e9ff(0x250)]||[];}async[a93_0x40a016(0x243)](_0x3c2465){const _0x4cc76e=a93_0x40a016,_0xde3d27=_0x4cc76e(0x26d)+encodeURIComponent(_0x3c2465),_0x503999=await this[_0x4cc76e(0x21d)][_0x4cc76e(0x1fb)](_0x4cc76e(0x21e),_0xde3d27);return _0x503999[_0x4cc76e(0x250)];}async['getChatHistory'](_0x55f0b0){const _0x3aa60b=a93_0x40a016,_0x5b772e=_0x3aa60b(0x26d)+encodeURIComponent(_0x55f0b0)+_0x3aa60b(0x1f4);return await this[_0x3aa60b(0x21d)][_0x3aa60b(0x1fb)](_0x3aa60b(0x21e),_0x5b772e);}async['getChatLog'](_0x406474){const _0x431cec=a93_0x40a016,_0x34a569=_0x431cec(0x26d)+encodeURIComponent(_0x406474)+_0x431cec(0x249);return await this['httpClient'][_0x431cec(0x1fb)]('GET',_0x34a569);}async['startChat'](_0x50b1ad){const _0x4a4b6e=a93_0x40a016,_0x1f9d17={'data':{'type':_0x4a4b6e(0x20c),'attributes':{'agentId':_0x50b1ad[_0x4a4b6e(0x233)]}}},_0x39ae96=0x3,_0x3ee293=[0x3e8,0x7d0,0xfa0];for(let _0x45cf1b=0x0;_0x45cf1b<=_0x39ae96;_0x45cf1b++){const _0x3365b9=await this[_0x4a4b6e(0x21d)][_0x4a4b6e(0x1fb)](_0x4a4b6e(0x23a),_0x4a4b6e(0x271),{'headers':{'Content-Type':_0x4a4b6e(0x1fd),'Accept':'application/vnd.api+json'},'body':_0x1f9d17});if(_0x3365b9[_0x4a4b6e(0x250)]&&_0x3365b9[_0x4a4b6e(0x250)]['id'])return _0x3365b9['data'];if(_0x45cf1b>=_0x39ae96)throw new SDKError(ErrorCode['LLM_CHAT_CREATION_FAILURE'],_0x4a4b6e(0x230)+(_0x39ae96+0x1)+_0x4a4b6e(0x216));const _0x4b5399=_0x3ee293[_0x45cf1b];console[_0x4a4b6e(0x20f)]('[Retry\x20'+(_0x45cf1b+0x1)+'/'+_0x39ae96+_0x4a4b6e(0x255)+_0x4b5399+_0x4a4b6e(0x24c)),await new Promise(_0xf359d1=>setTimeout(_0xf359d1,_0x4b5399));}throw new SDKError(ErrorCode[_0x4a4b6e(0x273)],'Failed\x20to\x20create\x20chat:\x20unexpected\x20error');}async*['continueChat'](_0x3b3f0b,_0x40024c,_0x38f6de){const _0x530cf4=a93_0x40a016,_0x4eb840=_0x40024c['trim']();if(!_0x4eb840)throw new SDKError(ErrorCode[_0x530cf4(0x22f)],'Message\x20cannot\x20be\x20empty\x20or\x20whitespace\x20only',undefined,{'helpText':_0x530cf4(0x263)});this['logger'][_0x530cf4(0x275)]('Continuing\x20chat\x20'+_0x3b3f0b+_0x530cf4(0x228)+_0x40024c[_0x530cf4(0x241)]+_0x530cf4(0x223));const _0x153156=_0x530cf4(0x26d)+encodeURIComponent(_0x3b3f0b)+_0x530cf4(0x269),_0x537bc3={'input':_0x40024c};try{const _0x87b1d=await this[_0x530cf4(0x21d)][_0x530cf4(0x227)]('POST',_0x153156,{'headers':{'Content-Type':_0x530cf4(0x239),'Accept':_0x530cf4(0x25d)},'body':_0x537bc3,'signal':_0x38f6de});this[_0x530cf4(0x262)][_0x530cf4(0x275)]('['+_0x87b1d[_0x530cf4(0x256)]+_0x530cf4(0x26b)+_0x3b3f0b),yield*parseSSEStream(_0x87b1d,this[_0x530cf4(0x262)]);}catch(_0x30a008){throw new SDKError(ErrorCode['LLM_STREAM_ERROR'],_0x530cf4(0x218)+_0x3b3f0b+',\x20message\x20length:\x20'+_0x40024c[_0x530cf4(0x241)]+')',_0x30a008);}}async[a93_0x40a016(0x1fc)](_0xec1b35){const _0x9a500b=a93_0x40a016,_0x51829c=_0x9a500b(0x25f)+encodeURIComponent(_0xec1b35),_0x559e66=await this[_0x9a500b(0x21d)][_0x9a500b(0x1fb)](_0x9a500b(0x21e),_0x51829c);return _0x559e66[_0x9a500b(0x250)];}async['listKnowledgeBases'](_0x26b16b){const _0x1a99ab=a93_0x40a016;return this[_0x1a99ab(0x23f)](_0x1a99ab(0x22d)+encodeURIComponent(_0x26b16b)+_0x1a99ab(0x268));}async[a93_0x40a016(0x1e9)](_0x276b5a){const _0x5637cb=a93_0x40a016,_0x2d9549={'data':{'type':_0x5637cb(0x217),'attributes':_0x276b5a}},_0x5aa2bf=await this['httpClient'][_0x5637cb(0x1fb)](_0x5637cb(0x23a),_0x5637cb(0x1e6),{'headers':{'Content-Type':_0x5637cb(0x1fd),'Accept':'application/vnd.api+json'},'body':_0x2d9549});return _0x5aa2bf[_0x5637cb(0x250)];}async[a93_0x40a016(0x221)](_0x730649,_0x42f022){const _0x4794d9=a93_0x40a016;return this['paginateAll'](_0x4794d9(0x224)+encodeURIComponent(_0x730649)+'&filter[project_id]='+encodeURIComponent(_0x42f022)+'&page[limit]=50');}async[a93_0x40a016(0x277)](_0x47a855){const _0x1f1625=a93_0x40a016,_0x4175a2=await this[_0x1f1625(0x23f)](_0x1f1625(0x1ed)+encodeURIComponent(_0x47a855)+_0x1f1625(0x268));return _0x4175a2['map'](_0x3e5a83=>({..._0x3e5a83,'type':_0x1f1625(0x247)}));}async[a93_0x40a016(0x22a)](_0x1a8f96){const _0x583dbc=a93_0x40a016,_0x3eac94=await this[_0x583dbc(0x21d)][_0x583dbc(0x1fb)](_0x583dbc(0x21e),_0x583dbc(0x22b)+encodeURIComponent(_0x1a8f96),{'headers':{'Accept':'application/vnd.api+json'}});return _0x3eac94[_0x583dbc(0x250)];}async[a93_0x40a016(0x20e)](_0x55fa81){const _0x46555e=a93_0x40a016,_0x1fb3b5={'data':{'type':'textKnowledgeBases','attributes':_0x55fa81}},_0xed0d32=await this[_0x46555e(0x21d)][_0x46555e(0x1fb)](_0x46555e(0x23a),'/api/text_knowledge_bases',{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x46555e(0x1fd)},'body':_0x1fb3b5});return _0xed0d32['data'];}async[a93_0x40a016(0x26f)](_0xfaf4a0,_0x1b1c56){const _0x515b77=a93_0x40a016,_0x2f8682={'data':{'type':'textKnowledgeBases','id':_0xfaf4a0,'attributes':_0x1b1c56}},_0x118cb3=await this[_0x515b77(0x21d)]['request'](_0x515b77(0x1ec),_0x515b77(0x22b)+encodeURIComponent(_0xfaf4a0),{'headers':{'Content-Type':_0x515b77(0x1fd),'Accept':_0x515b77(0x1fd)},'body':_0x2f8682});return _0x118cb3[_0x515b77(0x250)];}async[a93_0x40a016(0x1fe)](_0x4ecdba){const _0x377120=a93_0x40a016,_0x2ef64e={'data':{'type':_0x377120(0x25a),'attributes':{..._0x4ecdba,'imageModelType':_0x4ecdba[_0x377120(0x274)]||_0x377120(0x222),'imageReturnMode':_0x4ecdba['imageReturnMode']||'ID'}}},_0x54cf0c=await this[_0x377120(0x21d)]['request'](_0x377120(0x23a),_0x377120(0x208),{'headers':{'Content-Type':_0x377120(0x1fd),'Accept':_0x377120(0x1fd)},'body':_0x2ef64e});return _0x54cf0c[_0x377120(0x250)];}async['createWebSearchTool'](_0x2bbab1){const _0x19ea3b=a93_0x40a016,_0x31f4e5={'data':{'type':_0x19ea3b(0x1fa),'attributes':{'projectId':_0x2bbab1[_0x19ea3b(0x236)],'name':_0x2bbab1['name'],'modelType':_0x2bbab1[_0x19ea3b(0x23b)]||_0x19ea3b(0x279),'searchContextSize':_0x2bbab1['searchContextSize']||_0x19ea3b(0x1f7),'userLocation':_0x2bbab1[_0x19ea3b(0x248)]||{'type':_0x19ea3b(0x226),'country':'US','city':_0x19ea3b(0x1f6),'region':'California','timezone':_0x19ea3b(0x23e)},'systemPrompt':_0x2bbab1[_0x19ea3b(0x20b)]||_0x19ea3b(0x1f3),'filters':_0x2bbab1['filters']||{'allowed_domains':[]}}}},_0x5312de=await this[_0x19ea3b(0x21d)][_0x19ea3b(0x1fb)](_0x19ea3b(0x23a),'/api/web_search_tools',{'headers':{'Content-Type':_0x19ea3b(0x1fd),'Accept':_0x19ea3b(0x1fd)},'body':_0x31f4e5});return _0x5312de['data'];}async[a93_0x40a016(0x1ef)](_0x14d216){const _0x2f435e=a93_0x40a016,_0x14dc31=await this['paginateAll'](_0x2f435e(0x23c)+encodeURIComponent(_0x14d216)+'&page[limit]=50');return _0x14dc31[_0x2f435e(0x252)](_0x24eb0a=>({..._0x24eb0a,'type':_0x2f435e(0x25a)}));}async[a93_0x40a016(0x240)](_0x1d45a8){const _0x184e33=a93_0x40a016,_0x1b00ff=await this[_0x184e33(0x23f)](_0x184e33(0x206)+encodeURIComponent(_0x1d45a8)+_0x184e33(0x268));return _0x1b00ff[_0x184e33(0x252)](_0x3a5317=>({..._0x3a5317,'type':_0x184e33(0x1fa)}));}async[a93_0x40a016(0x24d)](_0x19a92a){const _0xb543b=a93_0x40a016,_0x3cfc55=await this[_0xb543b(0x23f)](_0xb543b(0x24f)+encodeURIComponent(_0x19a92a)+_0xb543b(0x260));if(_0x3cfc55[_0xb543b(0x241)]===0x0)return undefined;return{..._0x3cfc55[0x0],'type':_0xb543b(0x27c)};}async['listPrompts'](_0x581402){const _0x568ca6=a93_0x40a016;return this[_0x568ca6(0x23f)](_0x568ca6(0x220)+encodeURIComponent(_0x581402)+_0x568ca6(0x268));}async[a93_0x40a016(0x26c)](_0x106702){const _0x41c8b4=a93_0x40a016,{jsonSchemaHint:_0x55760d,..._0x4ccf83}=_0x106702,_0x449ee9={'data':{'type':'prompts','attributes':_0x4ccf83}},_0x348cb2=await this['httpClient'][_0x41c8b4(0x1fb)]('POST','/api/prompts',{'headers':{'Content-Type':_0x41c8b4(0x1fd),'Accept':_0x41c8b4(0x1fd)},'body':_0x449ee9});return _0x348cb2[_0x41c8b4(0x250)];}async[a93_0x40a016(0x26e)](_0x1f50f0){const _0x28abbc=a93_0x40a016;return this[_0x28abbc(0x23f)](_0x28abbc(0x21c)+encodeURIComponent(_0x1f50f0)+_0x28abbc(0x268));}async[a93_0x40a016(0x1f1)](_0x97bbf7){const _0x8fca83=a93_0x40a016,_0x581f55={'data':{'type':'integrations','attributes':_0x97bbf7}},_0x5376aa=await this['httpClient'][_0x8fca83(0x1fb)](_0x8fca83(0x23a),'/api/integrations',{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x8fca83(0x1fd)},'body':_0x581f55});return _0x5376aa[_0x8fca83(0x250)];}async['listExperimentalKnowledgeBases'](_0x4fd75a){const _0x1030c9=a93_0x40a016,_0x6f5140=await this[_0x1030c9(0x23f)]('/api/tool_targets?filter[targetType]=ExperimentalKnowledgeBase&filter[project_id]='+encodeURIComponent(_0x4fd75a)+'&page[limit]=50');return _0x6f5140[_0x1030c9(0x252)](_0x11efd3=>({..._0x11efd3,'type':_0x1030c9(0x266)}));}async['getExperimentalKnowledgeBase'](_0xa1f24){const _0x4f16ef=a93_0x40a016,_0x3643f1=await this[_0x4f16ef(0x21d)][_0x4f16ef(0x1fb)](_0x4f16ef(0x21e),_0x4f16ef(0x209)+encodeURIComponent(_0xa1f24),{'headers':{'Accept':'application/vnd.api+json'}});return _0x3643f1[_0x4f16ef(0x250)];}async[a93_0x40a016(0x1e5)](_0x3aaee9){const _0x3e0e81=a93_0x40a016,_0x522f91={'data':{'type':_0x3e0e81(0x266),'attributes':_0x3aaee9}},_0x5f53fa=await this[_0x3e0e81(0x21d)][_0x3e0e81(0x1fb)](_0x3e0e81(0x23a),_0x3e0e81(0x1ea),{'headers':{'Content-Type':_0x3e0e81(0x1fd),'Accept':_0x3e0e81(0x1fd)},'body':_0x522f91});return _0x5f53fa['data'];}async[a93_0x40a016(0x238)](_0xdfbca3,_0x1ae60c){const _0x360d5f=a93_0x40a016,_0x1b77c7={'data':{'type':'experimentalKnowledgeBases','id':_0xdfbca3,'attributes':_0x1ae60c}},_0x75a589=await this[_0x360d5f(0x21d)][_0x360d5f(0x1fb)](_0x360d5f(0x1ec),_0x360d5f(0x209)+encodeURIComponent(_0xdfbca3),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x360d5f(0x1fd)},'body':_0x1b77c7});return _0x75a589[_0x360d5f(0x250)];}async[a93_0x40a016(0x1eb)](_0x645036){const _0x315003=a93_0x40a016;return this[_0x315003(0x23f)](_0x315003(0x214)+encodeURIComponent(_0x645036)+_0x315003(0x268));}async[a93_0x40a016(0x1f8)](_0x45fcf0){const _0x3591f1=a93_0x40a016,_0x2f191c=await this[_0x3591f1(0x21d)]['request'](_0x3591f1(0x21e),_0x3591f1(0x251)+encodeURIComponent(_0x45fcf0),{'headers':{'Accept':'application/vnd.api+json'}});return _0x2f191c[_0x3591f1(0x250)];}async['createExperimentalArtifact'](_0x1549e9){const _0x10f20e=a93_0x40a016,_0x1a6fd3={'data':{'type':_0x10f20e(0x264),'attributes':_0x1549e9}},_0x5e7213=await this[_0x10f20e(0x21d)][_0x10f20e(0x1fb)](_0x10f20e(0x23a),_0x10f20e(0x24a),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x10f20e(0x1fd)},'body':_0x1a6fd3});return _0x5e7213['data'];}async['updateExperimentalArtifact'](_0x122660,_0x2b9763){const _0x1732c9=a93_0x40a016,_0x1f4564={'data':{'type':_0x1732c9(0x264),'id':_0x122660,'attributes':_0x2b9763}},_0x345503=await this[_0x1732c9(0x21d)]['request'](_0x1732c9(0x1ec),_0x1732c9(0x251)+encodeURIComponent(_0x122660),{'headers':{'Content-Type':_0x1732c9(0x1fd),'Accept':_0x1732c9(0x1fd)},'body':_0x1f4564});return _0x345503['data'];}async['listAgentsFull'](_0x46c293){const _0x1b480b=a93_0x40a016,_0x39bac8=await this[_0x1b480b(0x219)](_0x46c293),_0x367282=[];for(const _0x1e162c of _0x39bac8){const _0x3c6c29=_0x1b480b(0x210)+encodeURIComponent(_0x1e162c['id']),_0x353653=await this['httpClient'][_0x1b480b(0x1fb)](_0x1b480b(0x21e),_0x3c6c29);_0x367282[_0x1b480b(0x207)](_0x353653['data']);}return _0x367282;}async[a93_0x40a016(0x254)](_0x19783b){const _0x474e3a=a93_0x40a016,_0x404a94={'data':{'type':_0x474e3a(0x212),'attributes':_0x19783b}},_0x3b7804=await this[_0x474e3a(0x21d)]['request'](_0x474e3a(0x23a),_0x474e3a(0x1ff),{'headers':{'Content-Type':_0x474e3a(0x1fd),'Accept':_0x474e3a(0x1fd)},'body':_0x404a94});return _0x3b7804[_0x474e3a(0x250)];}async[a93_0x40a016(0x205)](_0x2f2309,_0x3667c1){const _0x5d6bd6=a93_0x40a016,_0x3de1d0={'data':{'type':_0x5d6bd6(0x212),'id':_0x2f2309,'attributes':_0x3667c1}},_0x36a716=_0x5d6bd6(0x210)+encodeURIComponent(_0x2f2309),_0x3cc94d=await this[_0x5d6bd6(0x21d)][_0x5d6bd6(0x1fb)](_0x5d6bd6(0x1ec),_0x36a716,{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x3de1d0});return _0x3cc94d[_0x5d6bd6(0x250)];}async[a93_0x40a016(0x21f)](_0x343a5b,_0x15a2e7){const _0x46bdb2=a93_0x40a016,_0x5a8f30={'data':{'type':_0x46bdb2(0x217),'id':_0x343a5b,'attributes':_0x15a2e7}},_0x10b6b9=_0x46bdb2(0x1f0)+encodeURIComponent(_0x343a5b),_0x3841a1=await this['httpClient']['request'](_0x46bdb2(0x1ec),_0x10b6b9,{'headers':{'Content-Type':_0x46bdb2(0x1fd),'Accept':_0x46bdb2(0x1fd)},'body':_0x5a8f30});return _0x3841a1[_0x46bdb2(0x250)];}async[a93_0x40a016(0x258)](_0x2c26d0,_0x12de19){const _0x569447=a93_0x40a016,{jsonSchemaHint:_0x5ab880,..._0x17e3cf}=_0x12de19,_0x10feaa={'data':{'type':_0x569447(0x213),'id':_0x2c26d0,'attributes':_0x17e3cf}},_0x397968=_0x569447(0x20a)+encodeURIComponent(_0x2c26d0),_0x30c1f2=await this[_0x569447(0x21d)][_0x569447(0x1fb)](_0x569447(0x1ec),_0x397968,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x569447(0x1fd)},'body':_0x10feaa});return _0x30c1f2[_0x569447(0x250)];}async[a93_0x40a016(0x1e3)](_0x16144c,_0x21c59d){const _0x4dc15c=a93_0x40a016,_0x5c296e={'data':{'type':_0x4dc15c(0x235),'id':_0x16144c,'attributes':_0x21c59d}},_0x1e144f=_0x4dc15c(0x246)+encodeURIComponent(_0x16144c),_0x4c3f24=await this[_0x4dc15c(0x21d)][_0x4dc15c(0x1fb)](_0x4dc15c(0x1ec),_0x1e144f,{'headers':{'Content-Type':_0x4dc15c(0x1fd),'Accept':'application/vnd.api+json'},'body':_0x5c296e});return _0x4c3f24['data'];}async[a93_0x40a016(0x211)](_0x146f66){const _0x4eba49=a93_0x40a016,_0x4d3396=_0x4eba49(0x246)+encodeURIComponent(_0x146f66);await this[_0x4eba49(0x21d)][_0x4eba49(0x1fb)]('DELETE',_0x4d3396);}}function a93_0x8b17(){const _0x869861=['updateAgent','\x20attempts:\x20API\x20returned\x20empty\x20chat\x20ID','knowledge_bases','Failed\x20to\x20continue\x20chat\x20(chatId:\x20','listAgents','prompt','maxToolIterations','/api/integrations?filter[projectId]=','httpClient','GET','updateKnowledgeBase','/api/prompts?filter[projectId]=','listToolTargets','nova-canvas','\x20characters','/api/tool_targets?filter[targetType]=','authHeaders','approximate','requestSSE','\x20with\x20message\x20size:\x20','getAgent','getTextKnowledgeBase','/api/text_knowledge_bases/','DELETE','/api/knowledge_bases?filter[projectId]=','createAgent','LLM_EMPTY_MESSAGE','Failed\x20to\x20create\x20chat\x20after\x20','accessToken','listProjects','agentId','baseUrl','integrations','projectId','-last_conversation_at','updateExperimentalKnowledgeBase','application/json','POST','modelType','/api/tool_targets?filter[targetType]=ImageGenerator&filter[project_id]=','name','America/Los_Angeles','paginateAll','listWebSearchTools','length','search','getChatInfo','6218238hJBUtx','2Wwamrt','/api/integrations/','textKnowledgeBases','userLocation','/langfuse','/api/experimental_artifacts','&filter[project_id]=','ms...','getParentSegmentKnowledgeBase','584bkNLRh','/api/tool_targets?filter[targetType]=ParentSegmentKnowledgeBase&filter[project_id]=','data','/api/experimental_artifacts/','map','33167260sVlKjG','createAgentResponse',']\x20Chat\x20creation\x20returned\x20empty\x20ID,\x20retrying\x20in\x20','status','/api/agents?page[limit]=50','updatePrompt','844xWhoux','imageGenerators','/api/chats?','deleteAgent','text/event-stream','tdx.client.llm','/api/projects/','&page[limit]=1','10580QzywFm','logger','Please\x20provide\x20a\x20non-empty\x20message\x20to\x20continue\x20the\x20chat.','experimentalArtifacts','pathname','experimentalKnowledgeBases','createProject','&page[limit]=50','/continue','projects',']\x20Streaming\x20SSE\x20stream\x20for\x20chatId:\x20','createPrompt','/api/chats/','listIntegrations','updateTextKnowledgeBase','294511ImeTfb','/api/chats','reasoningEffort','LLM_CHAT_CREATION_FAILURE','imageModelType','debug','append','listTextKnowledgeBases','startsWith','gpt-4o','/api/projects','sort','parentSegmentKnowledgeBases','updateIntegration','72023WdPQdT','createExperimentalKnowledgeBase','/api/knowledge_bases','toString','/api/users/current_settings','createKnowledgeBase','/api/experimental_knowledge_bases','listExperimentalArtifacts','PATCH','/api/tool_targets?filter[targetType]=TextKnowledgeBase&filter[project_id]=','getUserSettings','listImageGenerators','/api/knowledge_bases/','createIntegration','description','You\x20are\x20a\x20helpful\x20search\x20assistant.','/history','/api/projects?page[limit]=','San\x20Francisco','medium','getExperimentalArtifact','site','webSearchTools','request','getProject','application/vnd.api+json','createImageGenerator','/api/agents','12168495cAKZHD','proxy','llm','3787611wsPmMZ','outputs','updateAgentResponse','/api/tool_targets?filter[targetType]=WebSearchTool&filter[project_id]=','push','/api/image_generators','/api/experimental_knowledge_bases/','/api/prompts/','systemPrompt','chats','starterMessage','createTextKnowledgeBase','warn','/api/agents/','deleteIntegration','agents','prompts','/api/experimental_artifacts?filter[projectId]='];a93_0x8b17=function(){return _0x869861;};return a93_0x8b17();}
|
|
1
|
+
const a93_0x54b763=a93_0xcad8;function a93_0x5680(){const _0x5398f9=['Message\x20cannot\x20be\x20empty\x20or\x20whitespace\x20only','agentId','LLM_STREAM_ERROR','paginateAll','ms...','&filter[project_id]=','690423AiVkdr','description','/api/agents?page[limit]=50','16049bQswKJ','/api/text_knowledge_bases','/api/knowledge_bases?filter[projectId]=','updateAgentResponse','modelType',',\x20message\x20length:\x20','8kJOxri','/api/web_search_tools','imageGenerators','California','GET','/api/users/current_settings','chats','deleteProject','/api/chats?','gpt-4o','PATCH','apiKey','Failed\x20to\x20create\x20chat:\x20unexpected\x20error','logger','6yZWkGX','textKnowledgeBases','listToolTargets','application/json','debug','data','push','experimentalArtifacts','getChatInfo','10kPyjKi','/api/agents/','/langfuse','createProject','baseUrl','\x20with\x20message\x20size:\x20','agents','/api/experimental_artifacts/','warn','next','maxToolIterations','listPrompts','/api/prompts','LLM_EMPTY_MESSAGE','DELETE','listIntegrations','request',']\x20Chat\x20creation\x20returned\x20empty\x20ID,\x20retrying\x20in\x20','-last_conversation_at','medium','/api/knowledge_bases','imageModelType','createPrompt','userLocation','/continue','search','experimentalKnowledgeBases','/history','authHeaders','getChatHistory','/api/integrations?filter[projectId]=','filters','page[limit]','reasoningEffort','listAgents','Please\x20provide\x20a\x20non-empty\x20message\x20to\x20continue\x20the\x20chat.','/api/integrations','append','createIntegration','application/vnd.api+json','tdx.client.llm','webSearchTools','starterMessage','listProjects','listAgentsFull','/api/text_knowledge_bases/','/api/prompts/','LLM_CHAT_CREATION_FAILURE','getAgent','/api/tool_targets?filter[targetType]=','createKnowledgeBase','1390fffsgK','createTextKnowledgeBase','/api/projects?page[limit]=','2459250cWLFvR','Continuing\x20chat\x20','POST','listImageGenerators','/api/tool_targets?filter[targetType]=ParentSegmentKnowledgeBase&filter[project_id]=','835779xiVfhs','/api/experimental_knowledge_bases/','/api/image_generators','parentSegmentKnowledgeBases','createAgentResponse','site','/api/chats','[Retry\x20','America/Los_Angeles','/api/knowledge_bases/','deleteAgent','updateAgent','deleteIntegration','temperature','name',']\x20Streaming\x20SSE\x20stream\x20for\x20chatId:\x20','listTextKnowledgeBases','searchContextSize','listChats','map','updateExperimentalKnowledgeBase','listWebSearchTools','prompt','outputs','proxy','pathname','San\x20Francisco','trim','httpClient','createWebSearchTool','Failed\x20to\x20create\x20chat\x20after\x20','getExperimentalKnowledgeBase','listExperimentalKnowledgeBases','/api/chats/','/api/integrations/','/api/tool_targets?filter[targetType]=TextKnowledgeBase&filter[project_id]=','startsWith','continueChat','updateTextKnowledgeBase','/api/experimental_artifacts','/api/prompts?filter[projectId]=','&page[limit]=50','93266jsPZCE','systemPrompt','2402450ebmZtB','&page[limit]=1','getTextKnowledgeBase','/api/experimental_knowledge_bases','integrations','links','2129488qsjFpM','toString','length','getUserSettings','approximate','/api/tool_targets?filter[targetType]=WebSearchTool&filter[project_id]=','/api/projects/','startChat','knowledge_bases','/api/tool_targets?filter[targetType]=ImageGenerator&filter[project_id]=','text/event-stream','imageReturnMode','/api/agents','updateKnowledgeBase','\x20characters'];a93_0x5680=function(){return _0x5398f9;};return a93_0x5680();}(function(_0x2f4e42,_0x27de52){const _0x1a1a26=a93_0xcad8,_0xc70437=_0x2f4e42();while(!![]){try{const _0x5090db=parseInt(_0x1a1a26(0x239))/0x1*(parseInt(_0x1a1a26(0x1fc))/0x2)+-parseInt(_0x1a1a26(0x219))/0x3*(parseInt(_0x1a1a26(0x222))/0x4)+parseInt(_0x1a1a26(0x1fe))/0x5+parseInt(_0x1a1a26(0x230))/0x6*(parseInt(_0x1a1a26(0x1d2))/0x7)+-parseInt(_0x1a1a26(0x204))/0x8+-parseInt(_0x1a1a26(0x1cd))/0x9+parseInt(_0x1a1a26(0x1ca))/0xa*(parseInt(_0x1a1a26(0x21c))/0xb);if(_0x5090db===_0x27de52)break;else _0xc70437['push'](_0xc70437['shift']());}catch(_0x5199e3){_0xc70437['push'](_0xc70437['shift']());}}}(a93_0x5680,0x41bf4));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';import{parseSSEStream}from'../../utils/sse-parser.js';import{ErrorCode,SDKError}from'../errors.js';function a93_0xcad8(_0x550189,_0x422f65){_0x550189=_0x550189-0x1b8;const _0x5680ed=a93_0x5680();let _0xcad8c0=_0x5680ed[_0x550189];return _0xcad8c0;}import{Logger}from'../../utils/logger/index.js';export class LLMApiClient{[a93_0x54b763(0x1ee)];[a93_0x54b763(0x23d)];[a93_0x54b763(0x255)];[a93_0x54b763(0x22f)]=Logger['of'](a93_0x54b763(0x1bf));constructor(_0x56aeff){const _0x4f87c4=a93_0x54b763;this[_0x4f87c4(0x23d)]=getEndpoint(_0x56aeff[_0x4f87c4(0x1d7)],'llm'),this[_0x4f87c4(0x255)]=toHeaderRecord(getAuthHeaders(_0x56aeff[_0x4f87c4(0x1d7)],_0x56aeff[_0x4f87c4(0x22d)],_0x56aeff['accessToken'])),this[_0x4f87c4(0x1ee)]=new HTTPClient(this[_0x4f87c4(0x23d)],this[_0x4f87c4(0x255)],{'proxy':_0x56aeff[_0x4f87c4(0x1ea)]});}async[a93_0x54b763(0x216)](_0x4b3cb0){const _0x3652cd=a93_0x54b763,_0x9d728e=[];let _0x191876=_0x4b3cb0;while(_0x191876){const _0x268be7=await this[_0x3652cd(0x1ee)]['request'](_0x3652cd(0x226),_0x191876);_0x268be7[_0x3652cd(0x235)]&&_0x9d728e[_0x3652cd(0x236)](..._0x268be7[_0x3652cd(0x235)]);_0x191876=_0x268be7[_0x3652cd(0x203)]?.[_0x3652cd(0x242)];if(_0x191876&&_0x191876[_0x3652cd(0x1f6)]('http')){const _0x4050b0=new URL(_0x191876);_0x191876=_0x4050b0[_0x3652cd(0x1eb)]+_0x4050b0[_0x3652cd(0x252)];}}return _0x9d728e;}async[a93_0x54b763(0x207)](){const _0x1627cb=a93_0x54b763;return await this[_0x1627cb(0x1ee)]['request'](_0x1627cb(0x226),_0x1627cb(0x227));}async[a93_0x54b763(0x23c)](_0x4a14ba){const _0x433e1e=a93_0x54b763,_0x56d03c={'data':{'type':'projects','attributes':{'name':_0x4a14ba[_0x433e1e(0x1e0)],..._0x4a14ba['description']&&{'description':_0x4a14ba['description']}}}},_0x145bb4=await this[_0x433e1e(0x1ee)][_0x433e1e(0x249)]('POST','/api/projects',{'headers':{'Content-Type':_0x433e1e(0x1be),'Accept':_0x433e1e(0x1be)},'body':_0x56d03c});return _0x145bb4[_0x433e1e(0x235)];}async[a93_0x54b763(0x229)](_0xb30b87){const _0x1f5784=a93_0x54b763,_0x5a7f89=_0x1f5784(0x20a)+encodeURIComponent(_0xb30b87);await this['httpClient']['request']('DELETE',_0x5a7f89);}async[a93_0x54b763(0x1c2)](_0x2df636=0x32){const _0x3fe162=a93_0x54b763;return this[_0x3fe162(0x216)](_0x3fe162(0x1cc)+_0x2df636);}async[a93_0x54b763(0x1b9)](_0x5efd4e){const _0x32d7f5=a93_0x54b763;let _0x662e85=_0x32d7f5(0x21b);return _0x5efd4e&&(_0x662e85+=_0x32d7f5(0x218)+encodeURIComponent(_0x5efd4e)),this[_0x32d7f5(0x216)](_0x662e85);}async[a93_0x54b763(0x1c7)](_0x55daac){const _0x3f8a9b=a93_0x54b763,_0x41c30b=_0x3f8a9b(0x23a)+encodeURIComponent(_0x55daac),_0x2e9fbc=await this[_0x3f8a9b(0x1ee)]['request']('GET',_0x41c30b);return _0x2e9fbc['data'];}async['createAgent'](_0x53c6a9){const _0x47fa31=a93_0x54b763,_0x1d7966={'name':_0x53c6a9[_0x47fa31(0x1e0)],'projectId':_0x53c6a9['projectId'],'modelType':_0x53c6a9[_0x47fa31(0x220)],'maxToolIterations':_0x53c6a9[_0x47fa31(0x243)]??0x4,'temperature':_0x53c6a9[_0x47fa31(0x1df)]??0.7};_0x53c6a9[_0x47fa31(0x1fd)]!==undefined&&(_0x1d7966[_0x47fa31(0x1fd)]=_0x53c6a9[_0x47fa31(0x1fd)]);_0x53c6a9[_0x47fa31(0x1c1)]&&(_0x1d7966['starterMessage']=_0x53c6a9[_0x47fa31(0x1c1)]);_0x53c6a9[_0x47fa31(0x1b8)]&&(_0x1d7966[_0x47fa31(0x1b8)]=_0x53c6a9[_0x47fa31(0x1b8)]);_0x53c6a9[_0x47fa31(0x1e9)]&&_0x53c6a9['outputs'][_0x47fa31(0x206)]>0x0&&(_0x1d7966[_0x47fa31(0x1e9)]=_0x53c6a9[_0x47fa31(0x1e9)]);const _0x36fec0={'data':{'type':_0x47fa31(0x23f),'attributes':_0x1d7966}},_0x19ed02=await this[_0x47fa31(0x1ee)][_0x47fa31(0x249)](_0x47fa31(0x1cf),'/api/agents',{'headers':{'Content-Type':_0x47fa31(0x1be),'Accept':_0x47fa31(0x1be)},'body':_0x36fec0});return _0x19ed02[_0x47fa31(0x235)];}async[a93_0x54b763(0x1dd)](_0x44ee4f,_0x2072c4){const _0x17cc41=a93_0x54b763,_0x3dba9b={'data':{'type':'agents','id':_0x44ee4f,'attributes':{..._0x2072c4[_0x17cc41(0x1e0)]&&{'name':_0x2072c4[_0x17cc41(0x1e0)]},..._0x2072c4[_0x17cc41(0x21a)]&&{'description':_0x2072c4[_0x17cc41(0x21a)]},..._0x2072c4[_0x17cc41(0x1e8)]&&{'prompt':_0x2072c4['prompt']},..._0x2072c4[_0x17cc41(0x1c1)]&&{'starter_message':_0x2072c4[_0x17cc41(0x1c1)]},..._0x2072c4['reasoningEffort']&&{'reasoningEffort':_0x2072c4[_0x17cc41(0x1b8)]}}}},_0x3e27fc=_0x17cc41(0x23a)+encodeURIComponent(_0x44ee4f),_0x6baf71=await this['httpClient']['request'](_0x17cc41(0x22c),_0x3e27fc,{'headers':{'Content-Type':'application/vnd.api+json'},'body':_0x3dba9b});return _0x6baf71[_0x17cc41(0x235)];}async[a93_0x54b763(0x1dc)](_0x4ff61d){const _0x3d68dc=a93_0x54b763,_0x122e9c='/api/agents/'+encodeURIComponent(_0x4ff61d);await this['httpClient'][_0x3d68dc(0x249)](_0x3d68dc(0x247),_0x122e9c);}async[a93_0x54b763(0x1e4)](_0x41a05d=0x32){const _0x35e262=a93_0x54b763,_0x30e2d5=new URLSearchParams();_0x30e2d5[_0x35e262(0x1bc)](_0x35e262(0x259),String(_0x41a05d)),_0x30e2d5[_0x35e262(0x1bc)]('sort',_0x35e262(0x24b));const _0x4a1fe2=_0x35e262(0x22a)+_0x30e2d5[_0x35e262(0x205)](),_0x24724d=await this['httpClient']['request'](_0x35e262(0x226),_0x4a1fe2);return _0x24724d[_0x35e262(0x235)]||[];}async[a93_0x54b763(0x238)](_0x3ddbc4){const _0x27199f=a93_0x54b763,_0x270662='/api/chats/'+encodeURIComponent(_0x3ddbc4),_0x2fea9d=await this[_0x27199f(0x1ee)][_0x27199f(0x249)](_0x27199f(0x226),_0x270662);return _0x2fea9d[_0x27199f(0x235)];}async[a93_0x54b763(0x256)](_0x58d356){const _0x31bc8c=a93_0x54b763,_0x47ce3f=_0x31bc8c(0x1f3)+encodeURIComponent(_0x58d356)+_0x31bc8c(0x254);return await this[_0x31bc8c(0x1ee)][_0x31bc8c(0x249)](_0x31bc8c(0x226),_0x47ce3f);}async['getChatLog'](_0x1a3246){const _0x50d2c1=a93_0x54b763,_0x8094f4=_0x50d2c1(0x1f3)+encodeURIComponent(_0x1a3246)+_0x50d2c1(0x23b);return await this[_0x50d2c1(0x1ee)]['request'](_0x50d2c1(0x226),_0x8094f4);}async[a93_0x54b763(0x20b)](_0x23f7b4){const _0xb17c0f=a93_0x54b763,_0x22a64f={'data':{'type':_0xb17c0f(0x228),'attributes':{'agentId':_0x23f7b4[_0xb17c0f(0x214)]}}},_0x550de8=0x3,_0x370fb1=[0x3e8,0x7d0,0xfa0];for(let _0x1a2dbf=0x0;_0x1a2dbf<=_0x550de8;_0x1a2dbf++){const _0x3243ae=await this[_0xb17c0f(0x1ee)][_0xb17c0f(0x249)](_0xb17c0f(0x1cf),_0xb17c0f(0x1d8),{'headers':{'Content-Type':_0xb17c0f(0x1be),'Accept':_0xb17c0f(0x1be)},'body':_0x22a64f});if(_0x3243ae[_0xb17c0f(0x235)]&&_0x3243ae[_0xb17c0f(0x235)]['id'])return _0x3243ae['data'];if(_0x1a2dbf>=_0x550de8)throw new SDKError(ErrorCode[_0xb17c0f(0x1c6)],_0xb17c0f(0x1f0)+(_0x550de8+0x1)+'\x20attempts:\x20API\x20returned\x20empty\x20chat\x20ID');const _0x2c2f0e=_0x370fb1[_0x1a2dbf];console[_0xb17c0f(0x241)](_0xb17c0f(0x1d9)+(_0x1a2dbf+0x1)+'/'+_0x550de8+_0xb17c0f(0x24a)+_0x2c2f0e+_0xb17c0f(0x217)),await new Promise(_0x4f3aac=>setTimeout(_0x4f3aac,_0x2c2f0e));}throw new SDKError(ErrorCode['LLM_CHAT_CREATION_FAILURE'],_0xb17c0f(0x22e));}async*[a93_0x54b763(0x1f7)](_0x579765,_0x45f973,_0x2e7a06){const _0x45960a=a93_0x54b763,_0x15ba92=_0x45f973[_0x45960a(0x1ed)]();if(!_0x15ba92)throw new SDKError(ErrorCode[_0x45960a(0x246)],_0x45960a(0x213),undefined,{'helpText':_0x45960a(0x1ba)});this[_0x45960a(0x22f)][_0x45960a(0x234)](_0x45960a(0x1ce)+_0x579765+_0x45960a(0x23e)+_0x45f973[_0x45960a(0x206)]+_0x45960a(0x212));const _0x3bbb55=_0x45960a(0x1f3)+encodeURIComponent(_0x579765)+_0x45960a(0x251),_0x223e8d={'input':_0x45f973};try{const _0x4992c4=await this[_0x45960a(0x1ee)]['requestSSE'](_0x45960a(0x1cf),_0x3bbb55,{'headers':{'Content-Type':_0x45960a(0x233),'Accept':_0x45960a(0x20e)},'body':_0x223e8d,'signal':_0x2e7a06});this[_0x45960a(0x22f)][_0x45960a(0x234)]('['+_0x4992c4['status']+_0x45960a(0x1e1)+_0x579765),yield*parseSSEStream(_0x4992c4,this['logger']);}catch(_0x3e61db){throw new SDKError(ErrorCode[_0x45960a(0x215)],'Failed\x20to\x20continue\x20chat\x20(chatId:\x20'+_0x579765+_0x45960a(0x221)+_0x45f973[_0x45960a(0x206)]+')',_0x3e61db);}}async['getProject'](_0x93b144){const _0x376d1c=a93_0x54b763,_0x50b8a8=_0x376d1c(0x20a)+encodeURIComponent(_0x93b144),_0x35afa8=await this[_0x376d1c(0x1ee)][_0x376d1c(0x249)]('GET',_0x50b8a8);return _0x35afa8[_0x376d1c(0x235)];}async['listKnowledgeBases'](_0x5de1e3){const _0x322eaa=a93_0x54b763;return this[_0x322eaa(0x216)](_0x322eaa(0x21e)+encodeURIComponent(_0x5de1e3)+'&page[limit]=50');}async[a93_0x54b763(0x1c9)](_0x316964){const _0x864dc0=a93_0x54b763,_0x3d28d5={'data':{'type':_0x864dc0(0x20c),'attributes':_0x316964}},_0x830690=await this['httpClient'][_0x864dc0(0x249)](_0x864dc0(0x1cf),_0x864dc0(0x24d),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x3d28d5});return _0x830690['data'];}async[a93_0x54b763(0x232)](_0x361815,_0x2281ad){const _0xc6ba1b=a93_0x54b763;return this['paginateAll'](_0xc6ba1b(0x1c8)+encodeURIComponent(_0x361815)+'&filter[project_id]='+encodeURIComponent(_0x2281ad)+'&page[limit]=50');}async[a93_0x54b763(0x1e2)](_0x2b09e6){const _0x44241e=a93_0x54b763,_0x3b61df=await this[_0x44241e(0x216)](_0x44241e(0x1f5)+encodeURIComponent(_0x2b09e6)+'&page[limit]=50');return _0x3b61df['map'](_0x1d79dd=>({..._0x1d79dd,'type':_0x44241e(0x231)}));}async[a93_0x54b763(0x200)](_0x4bb022){const _0x3272d9=a93_0x54b763,_0x2770a7=await this[_0x3272d9(0x1ee)]['request']('GET','/api/text_knowledge_bases/'+encodeURIComponent(_0x4bb022),{'headers':{'Accept':'application/vnd.api+json'}});return _0x2770a7[_0x3272d9(0x235)];}async[a93_0x54b763(0x1cb)](_0x3a74c8){const _0x419e03=a93_0x54b763,_0x5a3ea7={'data':{'type':'textKnowledgeBases','attributes':_0x3a74c8}},_0x54ef13=await this[_0x419e03(0x1ee)][_0x419e03(0x249)]('POST',_0x419e03(0x21d),{'headers':{'Content-Type':_0x419e03(0x1be),'Accept':_0x419e03(0x1be)},'body':_0x5a3ea7});return _0x54ef13[_0x419e03(0x235)];}async[a93_0x54b763(0x1f8)](_0x5f4395,_0x3d1946){const _0x5942cb=a93_0x54b763,_0x1d86e5={'data':{'type':'textKnowledgeBases','id':_0x5f4395,'attributes':_0x3d1946}},_0x13b8f1=await this[_0x5942cb(0x1ee)][_0x5942cb(0x249)]('PATCH',_0x5942cb(0x1c4)+encodeURIComponent(_0x5f4395),{'headers':{'Content-Type':_0x5942cb(0x1be),'Accept':_0x5942cb(0x1be)},'body':_0x1d86e5});return _0x13b8f1[_0x5942cb(0x235)];}async['createImageGenerator'](_0x5734f2){const _0x5cb406=a93_0x54b763,_0x3b6eb4={'data':{'type':_0x5cb406(0x224),'attributes':{..._0x5734f2,'imageModelType':_0x5734f2[_0x5cb406(0x24e)]||'nova-canvas','imageReturnMode':_0x5734f2[_0x5cb406(0x20f)]||'ID'}}},_0x41a5b9=await this[_0x5cb406(0x1ee)][_0x5cb406(0x249)](_0x5cb406(0x1cf),_0x5cb406(0x1d4),{'headers':{'Content-Type':_0x5cb406(0x1be),'Accept':_0x5cb406(0x1be)},'body':_0x3b6eb4});return _0x41a5b9[_0x5cb406(0x235)];}async[a93_0x54b763(0x1ef)](_0x26d961){const _0x1f8354=a93_0x54b763,_0x28eae6={'data':{'type':_0x1f8354(0x1c0),'attributes':{'projectId':_0x26d961['projectId'],'name':_0x26d961['name'],'modelType':_0x26d961[_0x1f8354(0x220)]||_0x1f8354(0x22b),'searchContextSize':_0x26d961[_0x1f8354(0x1e3)]||_0x1f8354(0x24c),'userLocation':_0x26d961[_0x1f8354(0x250)]||{'type':_0x1f8354(0x208),'country':'US','city':_0x1f8354(0x1ec),'region':_0x1f8354(0x225),'timezone':_0x1f8354(0x1da)},'systemPrompt':_0x26d961['systemPrompt']||'You\x20are\x20a\x20helpful\x20search\x20assistant.','filters':_0x26d961[_0x1f8354(0x258)]||{'allowed_domains':[]}}}},_0x4a5b21=await this[_0x1f8354(0x1ee)][_0x1f8354(0x249)](_0x1f8354(0x1cf),_0x1f8354(0x223),{'headers':{'Content-Type':_0x1f8354(0x1be),'Accept':_0x1f8354(0x1be)},'body':_0x28eae6});return _0x4a5b21[_0x1f8354(0x235)];}async[a93_0x54b763(0x1d0)](_0x168277){const _0x260e21=a93_0x54b763,_0x282df1=await this[_0x260e21(0x216)](_0x260e21(0x20d)+encodeURIComponent(_0x168277)+'&page[limit]=50');return _0x282df1[_0x260e21(0x1e5)](_0x3d0c37=>({..._0x3d0c37,'type':'imageGenerators'}));}async[a93_0x54b763(0x1e7)](_0x353ceb){const _0x13f8f3=a93_0x54b763,_0x5b1809=await this['paginateAll'](_0x13f8f3(0x209)+encodeURIComponent(_0x353ceb)+_0x13f8f3(0x1fb));return _0x5b1809[_0x13f8f3(0x1e5)](_0x4aed1e=>({..._0x4aed1e,'type':'webSearchTools'}));}async['getParentSegmentKnowledgeBase'](_0x5c06e5){const _0x3ee0b6=a93_0x54b763,_0x3be325=await this['paginateAll'](_0x3ee0b6(0x1d1)+encodeURIComponent(_0x5c06e5)+_0x3ee0b6(0x1ff));if(_0x3be325[_0x3ee0b6(0x206)]===0x0)return undefined;return{..._0x3be325[0x0],'type':_0x3ee0b6(0x1d5)};}async[a93_0x54b763(0x244)](_0x2aa7e9){const _0x31581a=a93_0x54b763;return this[_0x31581a(0x216)](_0x31581a(0x1fa)+encodeURIComponent(_0x2aa7e9)+_0x31581a(0x1fb));}async[a93_0x54b763(0x24f)](_0x3ab492){const _0x4248c4=a93_0x54b763,{jsonSchemaHint:_0x431a3b,..._0x1724f5}=_0x3ab492,_0x2c680e={'data':{'type':'prompts','attributes':_0x1724f5}},_0x5d699e=await this[_0x4248c4(0x1ee)][_0x4248c4(0x249)]('POST',_0x4248c4(0x245),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x4248c4(0x1be)},'body':_0x2c680e});return _0x5d699e[_0x4248c4(0x235)];}async[a93_0x54b763(0x248)](_0x1610db){const _0x1fa992=a93_0x54b763;return this[_0x1fa992(0x216)](_0x1fa992(0x257)+encodeURIComponent(_0x1610db)+_0x1fa992(0x1fb));}async[a93_0x54b763(0x1bd)](_0x216e8f){const _0x3c708c=a93_0x54b763,_0x509296={'data':{'type':_0x3c708c(0x202),'attributes':_0x216e8f}},_0x32d676=await this[_0x3c708c(0x1ee)]['request'](_0x3c708c(0x1cf),_0x3c708c(0x1bb),{'headers':{'Content-Type':_0x3c708c(0x1be),'Accept':'application/vnd.api+json'},'body':_0x509296});return _0x32d676['data'];}async[a93_0x54b763(0x1f2)](_0x373749){const _0xc28cd5=a93_0x54b763,_0x4a74ff=await this[_0xc28cd5(0x216)]('/api/tool_targets?filter[targetType]=ExperimentalKnowledgeBase&filter[project_id]='+encodeURIComponent(_0x373749)+'&page[limit]=50');return _0x4a74ff[_0xc28cd5(0x1e5)](_0x2ce67a=>({..._0x2ce67a,'type':_0xc28cd5(0x253)}));}async[a93_0x54b763(0x1f1)](_0x137c3e){const _0x17bf67=a93_0x54b763,_0x46e008=await this[_0x17bf67(0x1ee)][_0x17bf67(0x249)]('GET',_0x17bf67(0x1d3)+encodeURIComponent(_0x137c3e),{'headers':{'Accept':_0x17bf67(0x1be)}});return _0x46e008[_0x17bf67(0x235)];}async['createExperimentalKnowledgeBase'](_0x446c02){const _0x2a6bc2=a93_0x54b763,_0x3d1c55={'data':{'type':_0x2a6bc2(0x253),'attributes':_0x446c02}},_0x5cb58b=await this['httpClient']['request'](_0x2a6bc2(0x1cf),_0x2a6bc2(0x201),{'headers':{'Content-Type':_0x2a6bc2(0x1be),'Accept':_0x2a6bc2(0x1be)},'body':_0x3d1c55});return _0x5cb58b[_0x2a6bc2(0x235)];}async[a93_0x54b763(0x1e6)](_0x1e7341,_0x82e48e){const _0x46fc7=a93_0x54b763,_0x4639fe={'data':{'type':'experimentalKnowledgeBases','id':_0x1e7341,'attributes':_0x82e48e}},_0x53124b=await this[_0x46fc7(0x1ee)][_0x46fc7(0x249)](_0x46fc7(0x22c),'/api/experimental_knowledge_bases/'+encodeURIComponent(_0x1e7341),{'headers':{'Content-Type':_0x46fc7(0x1be),'Accept':_0x46fc7(0x1be)},'body':_0x4639fe});return _0x53124b[_0x46fc7(0x235)];}async['listExperimentalArtifacts'](_0x17712d){const _0x54d248=a93_0x54b763;return this[_0x54d248(0x216)]('/api/experimental_artifacts?filter[projectId]='+encodeURIComponent(_0x17712d)+_0x54d248(0x1fb));}async['getExperimentalArtifact'](_0x49baaf){const _0x2b5a03=a93_0x54b763,_0x36f8ef=await this[_0x2b5a03(0x1ee)][_0x2b5a03(0x249)](_0x2b5a03(0x226),_0x2b5a03(0x240)+encodeURIComponent(_0x49baaf),{'headers':{'Accept':_0x2b5a03(0x1be)}});return _0x36f8ef[_0x2b5a03(0x235)];}async['createExperimentalArtifact'](_0x4dbc0e){const _0x3ff84e=a93_0x54b763,_0x154eea={'data':{'type':_0x3ff84e(0x237),'attributes':_0x4dbc0e}},_0x6d40a6=await this[_0x3ff84e(0x1ee)][_0x3ff84e(0x249)](_0x3ff84e(0x1cf),_0x3ff84e(0x1f9),{'headers':{'Content-Type':_0x3ff84e(0x1be),'Accept':_0x3ff84e(0x1be)},'body':_0x154eea});return _0x6d40a6['data'];}async['updateExperimentalArtifact'](_0x4fe57c,_0x5b4c21){const _0x40a473=a93_0x54b763,_0x3a79f8={'data':{'type':'experimentalArtifacts','id':_0x4fe57c,'attributes':_0x5b4c21}},_0x120bca=await this['httpClient']['request'](_0x40a473(0x22c),_0x40a473(0x240)+encodeURIComponent(_0x4fe57c),{'headers':{'Content-Type':_0x40a473(0x1be),'Accept':_0x40a473(0x1be)},'body':_0x3a79f8});return _0x120bca['data'];}async[a93_0x54b763(0x1c3)](_0x177e90){const _0x55c193=a93_0x54b763,_0x565f22=await this[_0x55c193(0x1b9)](_0x177e90),_0x386cde=[];for(const _0x469bd5 of _0x565f22){const _0x351784=_0x55c193(0x23a)+encodeURIComponent(_0x469bd5['id']),_0x10b0bb=await this[_0x55c193(0x1ee)][_0x55c193(0x249)]('GET',_0x351784);_0x386cde[_0x55c193(0x236)](_0x10b0bb['data']);}return _0x386cde;}async[a93_0x54b763(0x1d6)](_0x578540){const _0x54ec7d=a93_0x54b763,_0x415e15={'data':{'type':_0x54ec7d(0x23f),'attributes':_0x578540}},_0x421381=await this[_0x54ec7d(0x1ee)]['request'](_0x54ec7d(0x1cf),_0x54ec7d(0x210),{'headers':{'Content-Type':_0x54ec7d(0x1be),'Accept':_0x54ec7d(0x1be)},'body':_0x415e15});return _0x421381[_0x54ec7d(0x235)];}async[a93_0x54b763(0x21f)](_0xfa5237,_0x47e5c7){const _0x4903c9=a93_0x54b763,_0x5afd27={'data':{'type':'agents','id':_0xfa5237,'attributes':_0x47e5c7}},_0x1f6009=_0x4903c9(0x23a)+encodeURIComponent(_0xfa5237),_0x1a0c5a=await this[_0x4903c9(0x1ee)][_0x4903c9(0x249)](_0x4903c9(0x22c),_0x1f6009,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x4903c9(0x1be)},'body':_0x5afd27});return _0x1a0c5a[_0x4903c9(0x235)];}async[a93_0x54b763(0x211)](_0x2122c4,_0x2c9456){const _0xdef69a=a93_0x54b763,_0x2d69fb={'data':{'type':_0xdef69a(0x20c),'id':_0x2122c4,'attributes':_0x2c9456}},_0x6f3315=_0xdef69a(0x1db)+encodeURIComponent(_0x2122c4),_0x5ca4f1=await this[_0xdef69a(0x1ee)][_0xdef69a(0x249)](_0xdef69a(0x22c),_0x6f3315,{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x2d69fb});return _0x5ca4f1[_0xdef69a(0x235)];}async['updatePrompt'](_0xe081e3,_0x30f408){const _0x4c3bfa=a93_0x54b763,{jsonSchemaHint:_0x40004d,..._0x340898}=_0x30f408,_0x10ff34={'data':{'type':'prompts','id':_0xe081e3,'attributes':_0x340898}},_0x157ff9=_0x4c3bfa(0x1c5)+encodeURIComponent(_0xe081e3),_0x2f3e9b=await this[_0x4c3bfa(0x1ee)][_0x4c3bfa(0x249)](_0x4c3bfa(0x22c),_0x157ff9,{'headers':{'Content-Type':_0x4c3bfa(0x1be),'Accept':_0x4c3bfa(0x1be)},'body':_0x10ff34});return _0x2f3e9b[_0x4c3bfa(0x235)];}async['updateIntegration'](_0x1b524b,_0x306358){const _0x2d2e8c=a93_0x54b763,_0x55cd51={'data':{'type':_0x2d2e8c(0x202),'id':_0x1b524b,'attributes':_0x306358}},_0xaadde7='/api/integrations/'+encodeURIComponent(_0x1b524b),_0x572159=await this['httpClient'][_0x2d2e8c(0x249)](_0x2d2e8c(0x22c),_0xaadde7,{'headers':{'Content-Type':_0x2d2e8c(0x1be),'Accept':_0x2d2e8c(0x1be)},'body':_0x55cd51});return _0x572159['data'];}async[a93_0x54b763(0x1de)](_0x5c1353){const _0x423b62=a93_0x54b763,_0x59177a=_0x423b62(0x1f4)+encodeURIComponent(_0x5c1353);await this[_0x423b62(0x1ee)]['request'](_0x423b62(0x247),_0x59177a);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a94_0xa166(_0x3e5cd9,_0x15bf04){_0x3e5cd9=_0x3e5cd9-0x196;const _0x211f2e=a94_0x211f();let _0xa16619=_0x211f2e[_0x3e5cd9];return _0xa16619;}function a94_0x211f(){const _0x17a9f7=['367saUkzz','114552RpoohL','3582198UNxcqB','refresh_token','47016WamnIv','15ygSFBN','151547onZwaH','77WBHZWL','/oauth/token','490MoMMDO','3359008ADhtID','2710oMyAxA','595852KzFsgF'];a94_0x211f=function(){return _0x17a9f7;};return a94_0x211f();}(function(_0x245945,_0x1c0e70){const _0x1db27f=a94_0xa166,_0x1f1714=_0x245945();while(!![]){try{const _0x2537f5=-parseInt(_0x1db27f(0x19d))/0x1*(parseInt(_0x1db27f(0x19b))/0x2)+-parseInt(_0x1db27f(0x19e))/0x3+-parseInt(_0x1db27f(0x19c))/0x4*(parseInt(_0x1db27f(0x1a2))/0x5)+-parseInt(_0x1db27f(0x1a1))/0x6*(parseInt(_0x1db27f(0x197))/0x7)+parseInt(_0x1db27f(0x19a))/0x8+parseInt(_0x1db27f(0x19f))/0x9+-parseInt(_0x1db27f(0x199))/0xa*(-parseInt(_0x1db27f(0x196))/0xb);if(_0x2537f5===_0x1c0e70)break;else _0x1f1714['push'](_0x1f1714['shift']());}catch(_0x5a5aa5){_0x1f1714['push'](_0x1f1714['shift']());}}}(a94_0x211f,0x679e1));import{getOAuthClientId,postTokenRequest}from'../../core/oauth.js';export async function refreshAccessToken(_0xd9df08,_0x16cb9f){const _0x41b70b=a94_0xa166,_0x3f290c=_0xd9df08+_0x41b70b(0x198);return postTokenRequest(_0x3f290c,{'grant_type':_0x41b70b(0x1a0),'client_id':getOAuthClientId(),'refresh_token':_0x16cb9f});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a95_0x4cab(_0x19e305,_0x376023){_0x19e305=_0x19e305-0x1e2;const _0x54e0af=a95_0x54e0();let _0x4cabb7=_0x54e0af[_0x19e305];return _0x4cabb7;}const a95_0x4e0e5d=a95_0x4cab;(function(_0x586af0,_0x421090){const _0x31fc9e=a95_0x4cab,_0x238a89=_0x586af0();while(!![]){try{const _0x1058bc=parseInt(_0x31fc9e(0x1fa))/0x1+parseInt(_0x31fc9e(0x1e6))/0x2+-parseInt(_0x31fc9e(0x1ed))/0x3+parseInt(_0x31fc9e(0x1e2))/0x4*(-parseInt(_0x31fc9e(0x1f4))/0x5)+parseInt(_0x31fc9e(0x1e8))/0x6*(parseInt(_0x31fc9e(0x1e4))/0x7)+parseInt(_0x31fc9e(0x1f6))/0x8+parseInt(_0x31fc9e(0x1e7))/0x9*(-parseInt(_0x31fc9e(0x1ec))/0xa);if(_0x1058bc===_0x421090)break;else _0x238a89['push'](_0x238a89['shift']());}catch(_0x17eb9a){_0x238a89['push'](_0x238a89['shift']());}}}(a95_0x54e0,0x1a749));export class RateLimiter{[a95_0x4e0e5d(0x1f8)];['lastRefill'];['maxTokens'];[a95_0x4e0e5d(0x1f3)];constructor(_0x4bee06){const _0x1e52f2=a95_0x4e0e5d;this[_0x1e52f2(0x1f5)]=_0x4bee06[_0x1e52f2(0x1e5)],this[_0x1e52f2(0x1f8)]=_0x4bee06[_0x1e52f2(0x1e5)],this['lastRefill']=Date[_0x1e52f2(0x1fb)](),this['refillRate']=_0x4bee06[_0x1e52f2(0x1e5)]/_0x4bee06[_0x1e52f2(0x1f7)];}async[a95_0x4e0e5d(0x1f1)](){const _0x3a7fd6=a95_0x4e0e5d;while(!![]){this['refill']();if(this[_0x3a7fd6(0x1f8)]>=0x1){this[_0x3a7fd6(0x1f8)]-=0x1;return;}const _0x46f4ff=Math['max'](0x1,Math[_0x3a7fd6(0x1f2)](0x1/this[_0x3a7fd6(0x1f3)]));await this[_0x3a7fd6(0x1e9)](_0x46f4ff);}}[a95_0x4e0e5d(0x1f0)](){const _0x4adc28=a95_0x4e0e5d;this[_0x4adc28(0x1ef)]();if(this[_0x4adc28(0x1f8)]>=0x1)return this[_0x4adc28(0x1f8)]-=0x1,!![];return![];}[a95_0x4e0e5d(0x1ef)](){const _0x14ee17=a95_0x4e0e5d,_0x4941d9=Date[_0x14ee17(0x1fb)](),_0x533ac6=_0x4941d9-this['lastRefill'];if(_0x533ac6>0x0){const _0xfbf718=_0x533ac6*this[_0x14ee17(0x1f3)];this['tokens']=Math[_0x14ee17(0x1eb)](this[_0x14ee17(0x1f5)],this['tokens']+_0xfbf718),this['lastRefill']=_0x4941d9;}}[a95_0x4e0e5d(0x1f9)](){const _0x54b72a=a95_0x4e0e5d;return this[_0x54b72a(0x1ef)](),Math[_0x54b72a(0x1ea)](this[_0x54b72a(0x1f8)]);}[a95_0x4e0e5d(0x1e3)](){const _0x1460b9=a95_0x4e0e5d;this[_0x1460b9(0x1f8)]=this[_0x1460b9(0x1f5)],this[_0x1460b9(0x1ee)]=Date['now']();}[a95_0x4e0e5d(0x1e9)](_0x516aad){return new Promise(_0x1a49e0=>setTimeout(_0x1a49e0,_0x516aad));}}function a95_0x54e0(){const _0x3299fb=['20268wAoldM','sleep','floor','min','800uAFQlB','305106GtSmEF','lastRefill','refill','tryAcquire','acquire','ceil','refillRate','20745Qfggcr','maxTokens','1610032eXUFjM','windowMs','tokens','getAvailableTokens','205988ArfXbt','now','148fNmKNt','reset','182bZsZpP','maxRequests','323412RNZqCv','32985fWoXja'];a95_0x54e0=function(){return _0x3299fb;};return a95_0x54e0();}export const defaultRateLimiter=new RateLimiter({'maxRequests':0x64,'windowMs':0xea60});
|