@treasuredata/tdx 2026.3.22 → 2026.3.23
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/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/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/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/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 a89_0x1df169=a89_0x4422;(function(_0x192c9f,_0x44b147){const _0x40481b=a89_0x4422,_0x5b1609=_0x192c9f();while(!![]){try{const _0x47bc4d=parseInt(_0x40481b(0xd0))/0x1*(-parseInt(_0x40481b(0xfe))/0x2)+-parseInt(_0x40481b(0xe8))/0x3+parseInt(_0x40481b(0xc9))/0x4+parseInt(_0x40481b(0xb0))/0x5*(-parseInt(_0x40481b(0xc7))/0x6)+parseInt(_0x40481b(0x9a))/0x7+parseInt(_0x40481b(0x6f))/0x8+parseInt(_0x40481b(0xb8))/0x9;if(_0x47bc4d===_0x44b147)break;else _0x5b1609['push'](_0x5b1609['shift']());}catch(_0x4a2205){_0x5b1609['push'](_0x5b1609['shift']());}}}(a89_0x316b,0x7e3ba));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class CDPApiClient{['httpClient'];[a89_0x1df169(0xc4)];constructor(_0x59594){const _0x294844=a89_0x1df169,_0x20da10=getEndpoint(_0x59594[_0x294844(0xbd)],_0x294844(0xbe));this[_0x294844(0xc4)]=toHeaderRecord(getAuthHeaders(_0x59594[_0x294844(0xbd)],_0x59594[_0x294844(0xa0)],_0x59594[_0x294844(0x6e)])),this[_0x294844(0x99)]=new HTTPClient(_0x20da10,{...this[_0x294844(0xc4)],'Accept':'application/vnd.treasuredata.v1+json','Content-Type':'application/json'},{'proxy':_0x59594['proxy']});}async[a89_0x1df169(0x83)](){const _0x344718=a89_0x1df169,_0x3d2177=_0x344718(0xf4),_0x10447e=await this['httpClient'][_0x344718(0x75)](_0x344718(0xf9),_0x3d2177);return Array[_0x344718(0xe4)](_0x10447e)?_0x10447e:_0x10447e[_0x344718(0xb5)];}async[a89_0x1df169(0x70)](_0x2d2940){const _0xd7e2a3=a89_0x1df169,_0x55d4e0=_0xd7e2a3(0x9f)+_0x2d2940,_0x4b2f85=await this[_0xd7e2a3(0x99)]['request'](_0xd7e2a3(0xf9),_0x55d4e0);return _0xd7e2a3(0xb5)in _0x4b2f85?_0x4b2f85[_0xd7e2a3(0xb5)]:_0x4b2f85;}async[a89_0x1df169(0xe2)](_0x309d54){const _0x44b8ca=a89_0x1df169,_0x2649c1=_0x44b8ca(0xc3)+_0x309d54+_0x44b8ca(0x86),_0x2ef212=await this['httpClient']['request'](_0x44b8ca(0xf9),_0x2649c1);return Array[_0x44b8ca(0xe4)](_0x2ef212)?_0x2ef212:_0x2ef212['data'];}async[a89_0x1df169(0xbf)](_0x2ac53d,_0x5a6d21){const _0x1fb005=a89_0x1df169,_0x22d805=_0x1fb005(0xc3)+_0x2ac53d+'/segments/'+_0x5a6d21,_0x1e2cc4=await this[_0x1fb005(0x99)][_0x1fb005(0x75)]('GET',_0x22d805);return _0x1fb005(0xb5)in _0x1e2cc4?_0x1e2cc4[_0x1fb005(0xb5)]:_0x1e2cc4;}async[a89_0x1df169(0xa6)](_0x24aa19){const _0x2ea980=a89_0x1df169,_0x4e80de=_0x2ea980(0xbb)+_0x24aa19,_0x893261=await this[_0x2ea980(0x99)][_0x2ea980(0x75)]('GET',_0x4e80de);if(_0x2ea980(0xb5)in _0x893261){const _0x46697b=_0x893261[_0x2ea980(0xb5)];if(_0x2ea980(0xa7)in _0x46697b&&_0x46697b[_0x2ea980(0xa7)]&&typeof _0x46697b[_0x2ea980(0xa7)]===_0x2ea980(0x76)){const _0x492723=_0x46697b[_0x2ea980(0xa7)];return{'id':_0x46697b['id'],'name':_0x492723[_0x2ea980(0xa8)],..._0x492723};}return _0x46697b;}return _0x893261;}async['listSegmentFolders'](_0x3744c3){const _0x393f63=a89_0x1df169,_0x35a256=_0x393f63(0xc3)+_0x3744c3+'/folders',_0x2a26aa=await this[_0x393f63(0x99)]['request'](_0x393f63(0xf9),_0x35a256);return Array[_0x393f63(0xe4)](_0x2a26aa)?_0x2a26aa:_0x2a26aa[_0x393f63(0xb5)];}async[a89_0x1df169(0xb9)](_0x5017d4){const _0x18759e=a89_0x1df169,_0xd38141=_0x18759e(0xea)+_0x5017d4,_0x286098=await this[_0x18759e(0x99)][_0x18759e(0x75)](_0x18759e(0xf9),_0xd38141);return _0x18759e(0xb5)in _0x286098?_0x286098['data']:_0x286098;}async['listEntitiesByFolder'](_0x5b80ad,_0x4e6695=0x20,_0x33044e=![]){const _0xe96472=a89_0x1df169,_0x102568=_0xe96472(0x8d)+_0x5b80ad+_0xe96472(0xda)+_0x4e6695+_0xe96472(0x90)+_0x33044e;return await this[_0xe96472(0x99)][_0xe96472(0x75)](_0xe96472(0xf9),_0x102568);}async[a89_0x1df169(0xe9)](_0x1ff555,_0xdd76a6){const _0xa906c3=a89_0x1df169,_0x6be981=_0xa906c3(0xc3)+_0x1ff555+_0xa906c3(0xd3)+_0xdd76a6+_0xa906c3(0x9b),_0x362375=await this[_0xa906c3(0x99)][_0xa906c3(0x75)](_0xa906c3(0xf9),_0x6be981);return Array[_0xa906c3(0xe4)](_0x362375)?_0x362375:_0x362375[_0xa906c3(0xb5)];}async[a89_0x1df169(0x91)](_0x19032f,_0x51ece4,_0x343127){const _0x5d510d=a89_0x1df169,_0x4f6115=_0x5d510d(0xc3)+_0x19032f+_0x5d510d(0xd3)+_0x51ece4+_0x5d510d(0xcf)+_0x343127,_0xef7d9d=await this[_0x5d510d(0x99)][_0x5d510d(0x75)](_0x5d510d(0xf9),_0x4f6115);return _0x5d510d(0xb5)in _0xef7d9d?_0xef7d9d[_0x5d510d(0xb5)]:_0xef7d9d;}async[a89_0x1df169(0xf7)](_0x20674d,_0x421418,_0x261787){const _0x31137a=a89_0x1df169,_0x17e645='/audiences/'+_0x20674d+_0x31137a(0xd3)+_0x421418+'/syndications',_0x422ea9=await this[_0x31137a(0x99)][_0x31137a(0x75)](_0x31137a(0xc1),_0x17e645,{'body':_0x261787});return _0x422ea9;}async['updateActivation'](_0x2238c1,_0x5af795,_0x58cb70,_0xae8180){const _0x1360ab=a89_0x1df169,_0x405689=_0x1360ab(0xc3)+_0x2238c1+_0x1360ab(0xd3)+_0x5af795+_0x1360ab(0xcf)+_0x58cb70,_0x496119=await this[_0x1360ab(0x99)][_0x1360ab(0x75)]('PUT',_0x405689,{'body':_0xae8180});return _0x496119;}async[a89_0x1df169(0xdf)](_0x513039,_0xa20430,_0x3af1c2){const _0x13fe18=a89_0x1df169,_0x2469ae='/audiences/'+_0x513039+_0x13fe18(0xd3)+_0xa20430+_0x13fe18(0xcf)+_0x3af1c2;await this[_0x13fe18(0x99)][_0x13fe18(0x75)](_0x13fe18(0xeb),_0x2469ae);}async[a89_0x1df169(0xf3)](_0x55f0ac){const _0x24f7e8=a89_0x1df169;return this[_0x24f7e8(0xcb)](_0x55f0ac);}async[a89_0x1df169(0xe7)](_0x29a880,_0x36b46c){const _0x1b68c5=a89_0x1df169;return this[_0x1b68c5(0xcb)](_0x29a880,_0x36b46c);}async['getSegmentSQL'](_0x264c45,_0x373284){const _0x5641af=a89_0x1df169,_0x2ce617=await this['getSegment'](_0x264c45,_0x373284),_0x53e91d=_0x5641af(0xc8)in _0x2ce617&&_0x2ce617[_0x5641af(0xc8)]?_0x2ce617[_0x5641af(0xc8)]:undefined;return this[_0x5641af(0xcb)](_0x264c45,_0x53e91d);}async[a89_0x1df169(0xcb)](_0x168431,_0x856c37){const _0x557687=a89_0x1df169,_0x3ec2cd=_0x557687(0xc3)+_0x168431+_0x557687(0xab),_0x55e74b={'format':'sql'};_0x856c37&&(_0x55e74b[_0x557687(0xc8)]=_0x856c37);const _0x20ea91=await this['httpClient'][_0x557687(0x75)](_0x557687(0xc1),_0x3ec2cd,{'body':_0x55e74b});return _0x20ea91['sql']||_0x20ea91['query']||'';}async[a89_0x1df169(0xe3)](_0x20d0f7){const _0x609ba4=a89_0x1df169,_0x4d762d=_0x609ba4(0x7f),_0x588c4f=await this['httpClient']['request']('POST',_0x4d762d,{'body':_0x20d0f7,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x588c4f;}async[a89_0x1df169(0xc5)](_0x1f4a9b,_0x5f559e){const _0x53e1cd=a89_0x1df169,_0x959826='/audiences/'+_0x1f4a9b,_0x5b8a6e=await this[_0x53e1cd(0x99)]['request'](_0x53e1cd(0x8e),_0x959826,{'body':_0x5f559e,'headers':{'Content-Type':_0x53e1cd(0xad)}});return _0x5b8a6e;}async[a89_0x1df169(0xb1)](_0x5bb4e5){const _0x3fad6b=a89_0x1df169,_0x5b262f='/audiences/'+_0x5bb4e5,_0x537c0b=await this['httpClient']['request'](_0x3fad6b(0xf9),_0x5b262f,{'headers':{'Accept':_0x3fad6b(0xad)}});return _0x537c0b;}async[a89_0x1df169(0xbc)](_0x2ec9b1){const _0xee176f=a89_0x1df169,_0x5afe4b=_0xee176f(0xc3)+_0x2ec9b1+'/attributes',_0x48e286=await this[_0xee176f(0x99)][_0xee176f(0x75)]('GET',_0x5afe4b);return _0x48e286;}async[a89_0x1df169(0xc6)](_0x4d5ff5,_0x487d4a){const _0x396c40=a89_0x1df169;let _0x5673ee=_0x396c40(0xc3)+_0x4d5ff5+_0x396c40(0xf8);_0x487d4a!==undefined&&(_0x5673ee+=_0x396c40(0x8c)+_0x487d4a);const _0x289710=await this[_0x396c40(0x99)]['request'](_0x396c40(0xf9),_0x5673ee);return _0x289710;}async['createSegment'](_0x2285a8,_0x53765c){const _0x5636a3=a89_0x1df169,_0x30b530='/audiences/'+_0x2285a8+_0x5636a3(0x86),_0x411166=await this['httpClient'][_0x5636a3(0x75)]('POST',_0x30b530,{'body':_0x53765c});return _0x411166;}async[a89_0x1df169(0x93)](_0x14dab6){const _0x1234c3=a89_0x1df169,_0x245d03=_0x1234c3(0xfa),_0x45511f={'type':_0x1234c3(0xf1),'attributes':{'name':_0x14dab6[_0x1234c3(0xa8)],'description':_0x14dab6[_0x1234c3(0xc0)]||'','journeyId':_0x14dab6[_0x1234c3(0xce)],'rule':_0x14dab6[_0x1234c3(0xc8)],'countPopulation':_0x14dab6[_0x1234c3(0x82)]??!![]},'relationships':{'parentFolder':{'data':{'id':_0x14dab6[_0x1234c3(0xd9)],'type':_0x1234c3(0x72)}}}},_0xebe37b=await this[_0x1234c3(0x99)][_0x1234c3(0x75)](_0x1234c3(0xc1),_0x245d03,{'body':_0x45511f,'headers':{'Content-Type':_0x1234c3(0xad)}});return _0xebe37b[_0x1234c3(0xb5)]['id'];}async['updateSegment'](_0x1c7860,_0x5eccde,_0x43624c){const _0x3a9643=a89_0x1df169,_0x343187=_0x3a9643(0xc3)+_0x1c7860+'/segments/'+_0x5eccde,_0x24efae=await this[_0x3a9643(0x99)][_0x3a9643(0x75)](_0x3a9643(0x8e),_0x343187,{'body':_0x43624c});return _0x24efae;}async[a89_0x1df169(0xdc)](_0x35e612){const _0x20429d=a89_0x1df169,_0x459d4e=_0x20429d(0xbb)+_0x35e612;await this[_0x20429d(0x99)][_0x20429d(0x75)](_0x20429d(0xeb),_0x459d4e);}async['createSegmentFolder'](_0x2a27bd,_0x467fad){const _0x51c0c5=a89_0x1df169,_0x29a3dd=_0x51c0c5(0xc3)+_0x2a27bd+'/folders',_0x46d124=await this[_0x51c0c5(0x99)][_0x51c0c5(0x75)](_0x51c0c5(0xc1),_0x29a3dd,{'body':_0x467fad});if(_0x51c0c5(0xb5)in _0x46d124&&_0x46d124[_0x51c0c5(0xb5)]){const _0x53b88a=_0x46d124[_0x51c0c5(0xb5)];return{'id':_0x53b88a['id'],'name':_0x53b88a[_0x51c0c5(0xa8)],'description':_0x53b88a['description'],'audienceId':_0x53b88a[_0x51c0c5(0xe6)]||String(_0x2a27bd),'parentFolderId':_0x53b88a[_0x51c0c5(0xd9)],'createdAt':_0x53b88a[_0x51c0c5(0xd6)],'updatedAt':_0x53b88a[_0x51c0c5(0x8b)]};}return _0x46d124;}async[a89_0x1df169(0xe1)](_0x3564cb){const _0x317969=a89_0x1df169,_0x341d39=_0x317969(0xc3)+_0x3564cb+_0x317969(0xde),_0x2d10c8=await this[_0x317969(0x99)]['request'](_0x317969(0xc1),_0x341d39);return _0x2d10c8;}async[a89_0x1df169(0xcd)](_0x27c120){const _0x4e1da9=a89_0x1df169,_0x2d80ed=_0x4e1da9(0x96)+_0x27c120,_0x53b610=await this[_0x4e1da9(0x99)][_0x4e1da9(0x75)](_0x4e1da9(0xf9),_0x2d80ed);return _0x53b610['data'][_0x4e1da9(0xe5)](_0x5d38fb=>({'id':_0x5d38fb['id'],'name':_0x5d38fb[_0x4e1da9(0xa7)][_0x4e1da9(0xa8)],'journeyBundleName':_0x5d38fb[_0x4e1da9(0xa7)]['journeyBundleName'],'journeyBundleId':_0x5d38fb[_0x4e1da9(0xa7)][_0x4e1da9(0xee)],'versionNumber':_0x5d38fb[_0x4e1da9(0xa7)][_0x4e1da9(0x84)],'description':_0x5d38fb[_0x4e1da9(0xa7)][_0x4e1da9(0xc0)],'state':_0x5d38fb[_0x4e1da9(0xa7)]['state'],'paused':_0x5d38fb['attributes'][_0x4e1da9(0x81)],'audienceId':_0x5d38fb[_0x4e1da9(0xa7)][_0x4e1da9(0xe6)],'folderId':_0x5d38fb[_0x4e1da9(0xec)]?.[_0x4e1da9(0xb6)]?.[_0x4e1da9(0xb5)]?.['id'],'createdAt':_0x5d38fb[_0x4e1da9(0xa7)][_0x4e1da9(0xd6)],'updatedAt':_0x5d38fb[_0x4e1da9(0xa7)][_0x4e1da9(0x8b)]}));}async[a89_0x1df169(0xa2)](_0x7b882b){const _0x36c8bf=a89_0x1df169,_0x24a1c1='/entities/journeys?folder_id='+_0x7b882b,_0x130d47=await this[_0x36c8bf(0x99)][_0x36c8bf(0x75)]('GET',_0x24a1c1),_0x2cc47f=new Map();if(_0x130d47['included'])for(const _0x27aa00 of _0x130d47[_0x36c8bf(0xb7)]){_0x27aa00[_0x36c8bf(0xa5)]===_0x36c8bf(0xae)&&_0x2cc47f[_0x36c8bf(0x74)](_0x27aa00['id'],_0x27aa00);}return{'journeys':_0x130d47['data'],'activationStepsById':_0x2cc47f};}async[a89_0x1df169(0xd5)](_0x56c1c9){const _0x3a267c=a89_0x1df169,_0xa5c00b=_0x3a267c(0x7c)+_0x56c1c9,_0x1708db=await this[_0x3a267c(0x99)]['request'](_0x3a267c(0xf9),_0xa5c00b);return _0x3a267c(0xb5)in _0x1708db?_0x1708db[_0x3a267c(0xb5)]:_0x1708db;}async[a89_0x1df169(0xac)](_0x174eed){const _0x2dfb02=a89_0x1df169,_0x2f6eb6=_0x2dfb02(0x100)+_0x174eed,_0x211fda=await this[_0x2dfb02(0x99)][_0x2dfb02(0x75)](_0x2dfb02(0xf9),_0x2f6eb6);return parseJourneyBundleResponse(_0x211fda);}async[a89_0x1df169(0xf0)](_0x27d008){const _0x526d40=a89_0x1df169,_0x506490='/entities/journey_bundles/'+_0x27d008+_0x526d40(0x8f);await this['httpClient'][_0x526d40(0x75)]('GET',_0x506490);}async[a89_0x1df169(0xed)](_0x240642,_0x2e615e){const _0x3f4f32=a89_0x1df169,_0x3fed5f='/entities/journey_bundles/'+_0x240642+'/journeys',_0x47e56c=await this[_0x3f4f32(0x99)][_0x3f4f32(0x75)]('POST',_0x3fed5f,{'body':_0x2e615e});return _0x3f4f32(0xb5)in _0x47e56c?_0x47e56c[_0x3f4f32(0xb5)]:_0x47e56c;}async[a89_0x1df169(0xd8)](_0x457e21){const _0x4e0b9c=a89_0x1df169,_0x201f6c=_0x4e0b9c(0xd1),_0x19fea8=await this['httpClient'][_0x4e0b9c(0x75)]('POST',_0x201f6c,{'body':_0x457e21,'headers':{'Content-Type':_0x4e0b9c(0xad)}});return _0x4e0b9c(0xb5)in _0x19fea8?_0x19fea8[_0x4e0b9c(0xb5)]:_0x19fea8;}async[a89_0x1df169(0xba)](_0x1dbe9b,_0x5dae83){const _0x387913=a89_0x1df169,_0x1b6bfc='/entities/journeys/'+_0x1dbe9b,_0x54acbe=await this[_0x387913(0x99)][_0x387913(0x75)](_0x387913(0xd4),_0x1b6bfc,{'body':_0x5dae83,'headers':{'Content-Type':_0x387913(0xad)}});return _0x387913(0xb5)in _0x54acbe?_0x54acbe[_0x387913(0xb5)]:_0x54acbe;}async[a89_0x1df169(0xfd)](_0x68f68c,_0x5e0525){const _0x33181a=a89_0x1df169,_0x29e7e6=_0x33181a(0x7c)+_0x68f68c+_0x33181a(0x71),_0x518c68=await this[_0x33181a(0x99)][_0x33181a(0x75)]('POST',_0x29e7e6,{'body':_0x5e0525,'headers':{'Content-Type':_0x33181a(0xad)}});return _0x33181a(0xb5)in _0x518c68?_0x518c68[_0x33181a(0xb5)]:_0x518c68;}async['getJourneyStatistics'](_0x3149a8,_0x4445f3){const _0x3a29ff=a89_0x1df169,_0x4dddb4=buildJourneyEndpoint(_0x3149a8,_0x3a29ff(0x77),_0x4445f3),_0xc961ef=await this[_0x3a29ff(0x99)]['request'](_0x3a29ff(0xf9),_0x4dddb4);return parseJourneyStatisticsResponse(_0xc961ef);}async[a89_0x1df169(0xa4)](_0x288677,_0x3ca67f){const _0x2e35f9=a89_0x1df169,_0x5d8e75=buildJourneyEndpoint(_0x288677,_0x2e35f9(0x88),_0x3ca67f),_0x4511a7=await this[_0x2e35f9(0x99)][_0x2e35f9(0x75)](_0x2e35f9(0xf9),_0x5d8e75);return parseConversionSankeyResponse(_0x4511a7);}async[a89_0x1df169(0xa3)](_0x324beb,_0x173db0){const _0x5246e3=a89_0x1df169,_0x942c=buildJourneyEndpoint(_0x324beb,_0x5246e3(0xfc),_0x173db0),_0x4392ed=await this['httpClient'][_0x5246e3(0x75)]('GET',_0x942c);return parseActivationSankeyResponse(_0x4392ed);}async[a89_0x1df169(0xf6)](_0x17de59){const _0x5ab79e=a89_0x1df169,_0x28cf72=_0x5ab79e(0x7c)+_0x17de59+'/pause',_0x3b3aa9=await this[_0x5ab79e(0x99)]['request'](_0x5ab79e(0xd4),_0x28cf72);return _0x5ab79e(0xb5)in _0x3b3aa9?_0x3b3aa9[_0x5ab79e(0xb5)]:_0x3b3aa9;}async[a89_0x1df169(0xdb)](_0x11f054){const _0xd641b5=a89_0x1df169,_0x4c9ac7=_0xd641b5(0x7c)+_0x11f054+_0xd641b5(0x85),_0x3b1370=await this[_0xd641b5(0x99)][_0xd641b5(0x75)](_0xd641b5(0xd4),_0x4c9ac7);return'data'in _0x3b1370?_0x3b1370[_0xd641b5(0xb5)]:_0x3b1370;}async['getJourneyActivation'](_0xdbe5d4,_0x3ad7f0){const _0x55abf6=a89_0x1df169,_0x4f4a0d='/entities/journeys/'+_0xdbe5d4+'/activations/'+_0x3ad7f0,_0x2a6efc=await this[_0x55abf6(0x99)][_0x55abf6(0x75)](_0x55abf6(0xf9),_0x4f4a0d);return _0x55abf6(0xb5)in _0x2a6efc?_0x2a6efc['data']:_0x2a6efc;}async[a89_0x1df169(0x92)](_0x102f9b){const _0x23fd25=a89_0x1df169,_0x142ef8=_0x23fd25(0x7c)+_0x102f9b+_0x23fd25(0xe0),_0x3333e9=await this['httpClient'][_0x23fd25(0x75)](_0x23fd25(0xf9),_0x142ef8);return _0x23fd25(0xb5)in _0x3333e9?_0x3333e9[_0x23fd25(0xb5)]:_0x3333e9;}async['createJourneyActivation'](_0x1ebe26,_0x378eb0){const _0x12baad=a89_0x1df169,_0xa33371='/entities/journeys/'+_0x1ebe26+_0x12baad(0xe0),_0x3bfc65={'name':_0x378eb0[_0x12baad(0xa8)],'scheduleType':_0x378eb0['scheduleType']||_0x12baad(0x97),'connectionId':String(_0x378eb0[_0x12baad(0x94)]),'columns':_0x378eb0[_0x12baad(0xcc)]??[],'notifyOn':_0x378eb0[_0x12baad(0xf5)]??[],..._0x378eb0['description']!==undefined&&{'description':_0x378eb0[_0x12baad(0xc0)]},..._0x378eb0[_0x12baad(0x7b)]!==undefined&&{'allColumns':_0x378eb0[_0x12baad(0x7b)]},..._0x378eb0[_0x12baad(0xc2)]!==undefined&&{'timezone':_0x378eb0[_0x12baad(0xc2)]},..._0x378eb0[_0x12baad(0x7e)]!==undefined&&{'connectorConfig':_0x378eb0[_0x12baad(0x7e)]},..._0x378eb0[_0x12baad(0xdd)]!==undefined&&{'emailRecipients':_0x378eb0[_0x12baad(0xdd)]},..._0x378eb0[_0x12baad(0x7d)]!==undefined&&{'activationTemplateId':_0x378eb0[_0x12baad(0x7d)]},..._0x378eb0[_0x12baad(0xfb)]!==undefined&&{'syndicationBehavior':_0x378eb0['syndicationBehavior']}},_0x2ab0ab=await this['httpClient']['request'](_0x12baad(0xc1),_0xa33371,{'body':{'type':_0x12baad(0xae),'attributes':{'runAfterJourneyRefresh':_0x378eb0[_0x12baad(0xb2)]??![],'activationParams':_0x3bfc65}},'headers':{'Content-Type':_0x12baad(0xad)}});return _0x12baad(0xb5)in _0x2ab0ab?_0x2ab0ab[_0x12baad(0xb5)]:_0x2ab0ab;}}export function buildJourneyEndpoint(_0x4d91ff,_0x4d0bde,_0x26fd41){const _0x1c162e=a89_0x1df169,_0x257cb4='/entities/journeys/'+_0x4d91ff+'/'+_0x4d0bde,_0x44d7f0=new URLSearchParams();if(_0x26fd41?.['from'])_0x44d7f0[_0x1c162e(0x74)](_0x1c162e(0x87),_0x26fd41[_0x1c162e(0x87)]);if(_0x26fd41?.['to'])_0x44d7f0[_0x1c162e(0x74)]('to',_0x26fd41['to']);if(_0x26fd41?.[_0x1c162e(0x9c)]!=null)_0x44d7f0[_0x1c162e(0x74)]('limit',String(_0x26fd41['limit']));const _0x246ffc=_0x44d7f0[_0x1c162e(0xf2)]();return _0x246ffc?_0x257cb4+'?'+_0x246ffc:_0x257cb4;}export function parseJourneyStatisticsResponse(_0x5259ee){const _0x5f2b3d=a89_0x1df169;if(!(_0x5f2b3d(0xb5)in _0x5259ee))return _0x5259ee;const _0x12dcdb=_0x5259ee[_0x5f2b3d(0xb5)];if(!(_0x5f2b3d(0xa7)in _0x12dcdb)||!_0x12dcdb[_0x5f2b3d(0xa7)]||typeof _0x12dcdb[_0x5f2b3d(0xa7)]!==_0x5f2b3d(0x76))return _0x12dcdb;const _0x2fdb2c=_0x12dcdb[_0x5f2b3d(0xa7)],_0xd19a8c={'journeyId':_0x2fdb2c[_0x5f2b3d(0xce)],'size':_0x2fdb2c[_0x5f2b3d(0xb4)],'goalSize':_0x2fdb2c[_0x5f2b3d(0xb3)],'enteredSize':_0x2fdb2c['enteredSize'],'completionRate':_0x2fdb2c[_0x5f2b3d(0x95)],'exitOrJumpSize':_0x2fdb2c[_0x5f2b3d(0xef)],'exitOrJumpRate':_0x2fdb2c[_0x5f2b3d(0x101)],'stages':(_0x2fdb2c[_0x5f2b3d(0xa9)]??[])[_0x5f2b3d(0xe5)](_0x2d46cd=>{const _0xe3596e=_0x5f2b3d,_0x5d4472={'id':_0x2d46cd['id'],'enteredSize':_0x2d46cd[_0xe3596e(0x7a)],'milestoneSize':_0x2d46cd[_0xe3596e(0xca)],'completeMilestoneRate':_0x2d46cd[_0xe3596e(0x73)],'exitOrJumpSize':_0x2d46cd[_0xe3596e(0xef)],'exitOrJumpRate':_0x2d46cd['exitOrJumpRate'],'size':_0x2d46cd['size']};if(_0x2d46cd[_0xe3596e(0xaa)])_0x5d4472['history']=_0x2d46cd[_0xe3596e(0xaa)];if(_0x2d46cd['stepSizes'])_0x5d4472['stepSizes']=_0x2d46cd[_0xe3596e(0xff)];if(_0x2d46cd[_0xe3596e(0x78)])_0x5d4472[_0xe3596e(0x78)]=_0x2d46cd[_0xe3596e(0x78)];if(_0x2d46cd[_0xe3596e(0x79)])_0x5d4472[_0xe3596e(0x79)]=_0x2d46cd[_0xe3596e(0x79)];return _0x5d4472;})};return Array[_0x5f2b3d(0xe4)](_0x2fdb2c[_0x5f2b3d(0xaa)])&&(_0xd19a8c[_0x5f2b3d(0xaa)]=_0x2fdb2c[_0x5f2b3d(0xaa)]),_0xd19a8c;}function extractSankeyChart(_0x3287ae){const _0x57780e=a89_0x1df169,_0x1c4607=Array[_0x57780e(0xe4)](_0x3287ae[_0x57780e(0xb5)])?_0x3287ae[_0x57780e(0xb5)]:[],_0x2fac3c=_0x3287ae['metaData']&&typeof _0x3287ae['metaData']===_0x57780e(0x76)?_0x3287ae[_0x57780e(0xaf)]:{},_0x2e65b9=Array[_0x57780e(0xe4)](_0x2fac3c[_0x57780e(0xa1)])?_0x2fac3c['links']:[];return{'nodes':_0x1c4607,'links':_0x2e65b9};}function a89_0x316b(){const _0x11ec14=['listParentSegments','versionNumber','/resume','/segments','from','conversion_sankey_charts','chart','filter','updatedAt','?realtime=','/entities/by-folder/','PUT','/journeys_appendable','&with_rule=','getActivation','listJourneyActivations','createJourneySegment','connectionId','completionRate','/entities/journeys?folder_id=','none','length','httpClient','3440521YFIMpL','/syndications','limit','latestJourneyId','journeyStageId','/entities/parent_segments/','apiKey','links','listJourneysWithDetails','getActivationSankeyChart','getConversionSankeyChart','type','getSegmentEntity','attributes','name','journeyStageStatistics','history','/segments/query','getJourneyBundle','application/vnd.treasuredata.v1+json','journeyActivationStep','metaData','4465RuppgG','getParentSegmentFull','runAfterJourneyRefresh','goalSize','size','data','parentFolder','included','1809594vMucGg','getSegmentFolder','updateJourney','/entities/segments/','getAudienceAttributes','site','cdp','getSegment','description','POST','timezone','/audiences/','authHeaders','updateParentSegment','getAudienceBehaviors','1806XACCcn','rule','3370408mDQztQ','milestoneSize','requestSegmentSQL','columns','listJourneys','journeyId','/syndications/','10429ooQXJP','/entities/journeys','Invalid\x20journey\x20bundle\x20response','/segments/','PATCH','getJourney','createdAt','journeys','createJourney','parentFolderId','?depth=','resumeJourney','deleteSegment','emailRecipients','/run','deleteActivation','/activations','runParentSegment','listSegments','createParentSegment','isArray','map','audienceId','getSegmentSQLFromRule','1542153JuwkXc','listActivations','/entities/folders/','DELETE','relationships','createJourneyVersion','journeyBundleId','exitOrJumpSize','checkJourneyAppendable','segment-journey','toString','getParentSegmentSQL','/entities/parent_segments','notifyOn','pauseJourney','createActivation','/behaviors','GET','/entities/segments','syndicationBehavior','activation_sankey_charts','updateJourneyDetail','122NxAmGT','stepSizes','/entities/journey_bundles/','exitOrJumpRate','accessToken','3207136xziYci','getParentSegment','/detail','folder-segment','completeMilestoneRate','set','request','object','statistics','stepInfluxes','exitSizes','enteredSize','allColumns','/entities/journeys/','activationTemplateId','connectorConfig','/audiences','string','paused','countPopulation'];a89_0x316b=function(){return _0x11ec14;};return a89_0x316b();}function a89_0x4422(_0x432793,_0xf7c7de){_0x432793=_0x432793-0x6e;const _0x316b83=a89_0x316b();let _0x4422cc=_0x316b83[_0x432793];return _0x4422cc;}function extractJsonApiAttributes(_0x2d7d63){const _0x28c1a2=a89_0x1df169;if(!_0x2d7d63||typeof _0x2d7d63!==_0x28c1a2(0x76))return[];const _0x274fbe=_0x2d7d63;if(!Array[_0x28c1a2(0xe4)](_0x274fbe[_0x28c1a2(0xb5)]))return[];return _0x274fbe['data'][_0x28c1a2(0x8a)](_0x377d5e=>!!_0x377d5e&&typeof _0x377d5e===_0x28c1a2(0x76))[_0x28c1a2(0xe5)](_0x361a7b=>_0x361a7b[_0x28c1a2(0xa7)])['filter'](_0x5b6082=>!!_0x5b6082&&typeof _0x5b6082===_0x28c1a2(0x76));}export function parseConversionSankeyResponse(_0x4f2310){const _0x1556f1=a89_0x1df169,_0x684a6f={'nodes':[],'links':[]},_0xa665be=extractJsonApiAttributes(_0x4f2310);if(_0xa665be['length']===0x0)return _0x684a6f;const _0x1affed=_0xa665be[0x0],_0x266478=_0x1affed[_0x1556f1(0x89)];if(_0x266478&&typeof _0x266478===_0x1556f1(0x76)){const {nodes:_0x569023,links:_0x34570b}=extractSankeyChart(_0x266478);return{'nodes':_0x569023,'links':_0x34570b,...typeof _0x1affed[_0x1556f1(0x8b)]===_0x1556f1(0x80)?{'updatedAt':_0x1affed['updatedAt']}:{}};}return _0x684a6f;}export function parseActivationSankeyResponse(_0x43d2ab){const _0x57453a=a89_0x1df169,_0x18b9ea=extractJsonApiAttributes(_0x43d2ab);if(_0x18b9ea[_0x57453a(0x98)]>0x0)return _0x18b9ea[_0x57453a(0xe5)](_0x4c042a=>{const _0x17c499=_0x57453a,_0x42cf26=_0x4c042a[_0x17c499(0x89)],{nodes:_0x820a6,links:_0x3c8fa6}=_0x42cf26&&typeof _0x42cf26===_0x17c499(0x76)?extractSankeyChart(_0x42cf26):{'nodes':[],'links':[]};return{'journeyStageId':typeof _0x4c042a[_0x17c499(0x9e)]===_0x17c499(0x80)?_0x4c042a['journeyStageId']:'','nodes':_0x820a6,'links':_0x3c8fa6,...typeof _0x4c042a['updatedAt']===_0x17c499(0x80)?{'updatedAt':_0x4c042a['updatedAt']}:{}};});if(Array['isArray'](_0x43d2ab))return _0x43d2ab;return[];}export function parseJourneyBundleResponse(_0x14be18){const _0x24828a=a89_0x1df169;if(!_0x14be18||typeof _0x14be18!=='object')throw new Error(_0x24828a(0xd2));const _0x3476ef=_0x14be18,_0x3a16e3=_0x3476ef[_0x24828a(0xb5)],_0x56c7d9=_0x3a16e3?.['attributes']??_0x3476ef,_0x7079a3=Array[_0x24828a(0xe4)](_0x56c7d9['journeys'])?_0x56c7d9[_0x24828a(0xd7)]:[],_0x1b41f5=_0x7079a3['map'](_0x2803f8=>{const _0xcfaf4d=_0x24828a;if(!_0x2803f8||typeof _0x2803f8!==_0xcfaf4d(0x76))return _0x2803f8;const _0x5aff9b=_0x2803f8;if(_0x5aff9b[_0xcfaf4d(0xb5)]&&typeof _0x5aff9b[_0xcfaf4d(0xb5)]===_0xcfaf4d(0x76))return _0x5aff9b[_0xcfaf4d(0xb5)];return _0x5aff9b;});return{'name':_0x56c7d9[_0x24828a(0xa8)],'description':_0x56c7d9[_0x24828a(0xc0)]??null,'latestJourneyId':_0x56c7d9[_0x24828a(0x9d)],'lastVersionNumber':_0x56c7d9['lastVersionNumber'],'journeys':_0x1b41f5};}
|
|
1
|
+
const a89_0x38f30b=a89_0x39a3;function a89_0x4eba(){const _0x5cf626=['latestJourneyId','completionRate','journeys','exitOrJumpSize','/segments','state','string','activation_sankey_charts','createdAt','createJourneyActivation','application/json','192xNlunu','relationships','/entities/parent_segments','checkJourneyAppendable','runAfterJourneyRefresh','listJourneyActivations','641632gzzNkm','/attributes','/entities/folders/','DELETE','GET','getActivation','pauseJourney','PUT','length','journeyBundleId','Invalid\x20journey\x20bundle\x20response','/segments/query','getSegment','authHeaders','request','deleteActivation','getJourneyBundle','isArray','/journeys_appendable','milestoneSize','updateJourney','createJourney','toString','notifyOn','journeyActivationStep','484584WnsUdj','object','map','listParentSegments','from','/resume','resumeJourney','/syndications','parentFolderId','listJourneys','cdp','segment-journey','/entities/journeys/','PATCH','226527kRHQQd','countPopulation','?realtime=','getParentSegmentFull','stepInfluxes','/run','/entities/journey_bundles/','sql','site','/activations/','exitOrJumpRate','listSegments','metaData','history','/entities/segments','653750ZFDjsu','none','goalSize','/journeys','application/vnd.treasuredata.v1+json','activationTemplateId','allColumns','accessToken','journeyId','getActivationSankeyChart','deleteSegment','/entities/parent_segments/','requestSegmentSQL','createSegment','description','enteredSize','folder-segment','/detail','/audiences/','2365038izKnGo','getConversionSankeyChart','proxy','exitSizes','updateActivation','createParentSegment','query','journeyBundleName','getParentSegmentSQL','getAudienceAttributes','connectorConfig','/syndications/','included','data','createSegmentFolder','timezone','lastVersionNumber','emailRecipients','listActivations','/segments/','limit','stepSizes','connectionId','/pause','/activations','getSegmentSQL','1QKsZDJ','rule','POST','links','attributes','versionNumber','statistics','767016CpVSGr','set','name','/entities/segments/','1726236DUBPhX','type','completeMilestoneRate','updatedAt','filter','/folders','parentFolder','getSegmentFolder','syndicationBehavior','journeyStageId','getJourney','scheduleType','getParentSegment','listJourneysWithDetails','createActivation','size','httpClient'];a89_0x4eba=function(){return _0x5cf626;};return a89_0x4eba();}(function(_0x2209cb,_0x4ce5ad){const _0x296b29=a89_0x39a3,_0x52498f=_0x2209cb();while(!![]){try{const _0x1d7a93=-parseInt(_0x296b29(0x233))/0x1*(-parseInt(_0x296b29(0x1e9))/0x2)+-parseInt(_0x296b29(0x219))/0x3+-parseInt(_0x296b29(0x260))/0x4+parseInt(_0x296b29(0x206))/0x5+parseInt(_0x296b29(0x23e))/0x6+-parseInt(_0x296b29(0x1f7))/0x7*(-parseInt(_0x296b29(0x25a))/0x8)+-parseInt(_0x296b29(0x23a))/0x9;if(_0x1d7a93===_0x4ce5ad)break;else _0x52498f['push'](_0x52498f['shift']());}catch(_0x227e98){_0x52498f['push'](_0x52498f['shift']());}}}(a89_0x4eba,0x627ea));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class CDPApiClient{[a89_0x38f30b(0x24e)];['authHeaders'];constructor(_0x2d084c){const _0x655dcb=a89_0x38f30b,_0x5c187c=getEndpoint(_0x2d084c[_0x655dcb(0x1ff)],_0x655dcb(0x1f3));this[_0x655dcb(0x1dd)]=toHeaderRecord(getAuthHeaders(_0x2d084c[_0x655dcb(0x1ff)],_0x2d084c['apiKey'],_0x2d084c[_0x655dcb(0x20d)])),this[_0x655dcb(0x24e)]=new HTTPClient(_0x5c187c,{...this[_0x655dcb(0x1dd)],'Accept':'application/vnd.treasuredata.v1+json','Content-Type':_0x655dcb(0x259)},{'proxy':_0x2d084c[_0x655dcb(0x21b)]});}async[a89_0x38f30b(0x1ec)](){const _0x3f1d0b=a89_0x38f30b,_0x545264=_0x3f1d0b(0x25c),_0x1f6eaa=await this[_0x3f1d0b(0x24e)][_0x3f1d0b(0x1de)]('GET',_0x545264);return Array[_0x3f1d0b(0x1e1)](_0x1f6eaa)?_0x1f6eaa:_0x1f6eaa[_0x3f1d0b(0x226)];}async[a89_0x38f30b(0x24a)](_0x30ec27){const _0x1d157b=a89_0x38f30b,_0x203e3c=_0x1d157b(0x211)+_0x30ec27,_0x69aa18=await this[_0x1d157b(0x24e)][_0x1d157b(0x1de)](_0x1d157b(0x1d4),_0x203e3c);return _0x1d157b(0x226)in _0x69aa18?_0x69aa18['data']:_0x69aa18;}async[a89_0x38f30b(0x202)](_0x10ca6d){const _0x372dbd=a89_0x38f30b,_0x18b772=_0x372dbd(0x218)+_0x10ca6d+_0x372dbd(0x253),_0xd8553c=await this[_0x372dbd(0x24e)][_0x372dbd(0x1de)](_0x372dbd(0x1d4),_0x18b772);return Array[_0x372dbd(0x1e1)](_0xd8553c)?_0xd8553c:_0xd8553c['data'];}async['getSegment'](_0x2282f2,_0x387ff9){const _0x136f98=a89_0x38f30b,_0x246f7a='/audiences/'+_0x2282f2+_0x136f98(0x22c)+_0x387ff9,_0x31491e=await this[_0x136f98(0x24e)][_0x136f98(0x1de)](_0x136f98(0x1d4),_0x246f7a);return _0x136f98(0x226)in _0x31491e?_0x31491e['data']:_0x31491e;}async['getSegmentEntity'](_0x3217f1){const _0x56af12=a89_0x38f30b,_0x4c905d=_0x56af12(0x23d)+_0x3217f1,_0xa4461=await this[_0x56af12(0x24e)][_0x56af12(0x1de)]('GET',_0x4c905d);if(_0x56af12(0x226)in _0xa4461){const _0x1034e5=_0xa4461['data'];if('attributes'in _0x1034e5&&_0x1034e5[_0x56af12(0x237)]&&typeof _0x1034e5[_0x56af12(0x237)]===_0x56af12(0x1ea)){const _0x1b3cd1=_0x1034e5[_0x56af12(0x237)];return{'id':_0x1034e5['id'],'name':_0x1b3cd1[_0x56af12(0x23c)],..._0x1b3cd1};}return _0x1034e5;}return _0xa4461;}async['listSegmentFolders'](_0x12fa58){const _0x2d6f6e=a89_0x38f30b,_0x657a81=_0x2d6f6e(0x218)+_0x12fa58+_0x2d6f6e(0x243),_0x34d1ae=await this['httpClient'][_0x2d6f6e(0x1de)]('GET',_0x657a81);return Array[_0x2d6f6e(0x1e1)](_0x34d1ae)?_0x34d1ae:_0x34d1ae[_0x2d6f6e(0x226)];}async[a89_0x38f30b(0x245)](_0x3bb382){const _0x4b4312=a89_0x38f30b,_0x4f3f76=_0x4b4312(0x262)+_0x3bb382,_0x8c5631=await this['httpClient']['request'](_0x4b4312(0x1d4),_0x4f3f76);return _0x4b4312(0x226)in _0x8c5631?_0x8c5631[_0x4b4312(0x226)]:_0x8c5631;}async['listEntitiesByFolder'](_0x5529d6,_0x745fc7=0x20,_0x17cf19=![]){const _0x1e581=a89_0x38f30b,_0xf29e02='/entities/by-folder/'+_0x5529d6+'?depth='+_0x745fc7+'&with_rule='+_0x17cf19;return await this[_0x1e581(0x24e)][_0x1e581(0x1de)](_0x1e581(0x1d4),_0xf29e02);}async[a89_0x38f30b(0x22b)](_0x5d8355,_0x49b0a9){const _0xcb007f=a89_0x38f30b,_0x100681=_0xcb007f(0x218)+_0x5d8355+_0xcb007f(0x22c)+_0x49b0a9+_0xcb007f(0x1f0),_0x5060f1=await this[_0xcb007f(0x24e)]['request'](_0xcb007f(0x1d4),_0x100681);return Array['isArray'](_0x5060f1)?_0x5060f1:_0x5060f1['data'];}async[a89_0x38f30b(0x1d5)](_0x46106b,_0x339e52,_0x34bcca){const _0x12e342=a89_0x38f30b,_0x106a3c=_0x12e342(0x218)+_0x46106b+_0x12e342(0x22c)+_0x339e52+_0x12e342(0x224)+_0x34bcca,_0x4ac076=await this[_0x12e342(0x24e)][_0x12e342(0x1de)](_0x12e342(0x1d4),_0x106a3c);return'data'in _0x4ac076?_0x4ac076[_0x12e342(0x226)]:_0x4ac076;}async[a89_0x38f30b(0x24c)](_0x21e6d8,_0x28a63d,_0xdda34e){const _0x331394=a89_0x38f30b,_0x4ed33f=_0x331394(0x218)+_0x21e6d8+'/segments/'+_0x28a63d+'/syndications',_0x2f94ed=await this['httpClient'][_0x331394(0x1de)]('POST',_0x4ed33f,{'body':_0xdda34e});return _0x2f94ed;}async[a89_0x38f30b(0x21d)](_0x2b8059,_0x29e547,_0x29ebf6,_0x54825e){const _0x1714e1=a89_0x38f30b,_0x30011a='/audiences/'+_0x2b8059+'/segments/'+_0x29e547+_0x1714e1(0x224)+_0x29ebf6,_0x3bf93a=await this[_0x1714e1(0x24e)]['request'](_0x1714e1(0x1d7),_0x30011a,{'body':_0x54825e});return _0x3bf93a;}async[a89_0x38f30b(0x1df)](_0x4f5c1c,_0x38aedf,_0x5682c9){const _0x2ae2e5=a89_0x38f30b,_0x5bef62='/audiences/'+_0x4f5c1c+_0x2ae2e5(0x22c)+_0x38aedf+_0x2ae2e5(0x224)+_0x5682c9;await this[_0x2ae2e5(0x24e)][_0x2ae2e5(0x1de)](_0x2ae2e5(0x1d3),_0x5bef62);}async[a89_0x38f30b(0x221)](_0x235fee){const _0x3bc241=a89_0x38f30b;return this[_0x3bc241(0x212)](_0x235fee);}async['getSegmentSQLFromRule'](_0x380e7b,_0x3c9771){const _0x463483=a89_0x38f30b;return this[_0x463483(0x212)](_0x380e7b,_0x3c9771);}async[a89_0x38f30b(0x232)](_0xc7fe0a,_0x33fa8f){const _0x7824cc=a89_0x38f30b,_0x463282=await this[_0x7824cc(0x1dc)](_0xc7fe0a,_0x33fa8f),_0x4c7aa0=_0x7824cc(0x234)in _0x463282&&_0x463282[_0x7824cc(0x234)]?_0x463282[_0x7824cc(0x234)]:undefined;return this[_0x7824cc(0x212)](_0xc7fe0a,_0x4c7aa0);}async[a89_0x38f30b(0x212)](_0x3eb7c9,_0x4aefdf){const _0x5cfb3d=a89_0x38f30b,_0x3297fb='/audiences/'+_0x3eb7c9+_0x5cfb3d(0x1db),_0x72f0a1={'format':_0x5cfb3d(0x1fe)};_0x4aefdf&&(_0x72f0a1[_0x5cfb3d(0x234)]=_0x4aefdf);const _0x4ab477=await this[_0x5cfb3d(0x24e)][_0x5cfb3d(0x1de)](_0x5cfb3d(0x235),_0x3297fb,{'body':_0x72f0a1});return _0x4ab477[_0x5cfb3d(0x1fe)]||_0x4ab477[_0x5cfb3d(0x21f)]||'';}async[a89_0x38f30b(0x21e)](_0x3eb45c){const _0x2a89c7=a89_0x38f30b,_0x32e22a='/audiences',_0x20a9dc=await this[_0x2a89c7(0x24e)]['request'](_0x2a89c7(0x235),_0x32e22a,{'body':_0x3eb45c,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x20a9dc;}async['updateParentSegment'](_0x8d2ad2,_0x483837){const _0x14b6ef=a89_0x38f30b,_0x4babb7=_0x14b6ef(0x218)+_0x8d2ad2,_0x17b5c1=await this[_0x14b6ef(0x24e)][_0x14b6ef(0x1de)](_0x14b6ef(0x1d7),_0x4babb7,{'body':_0x483837,'headers':{'Content-Type':_0x14b6ef(0x20a)}});return _0x17b5c1;}async[a89_0x38f30b(0x1fa)](_0x503be7){const _0x34b5e2=a89_0x38f30b,_0x318b4f=_0x34b5e2(0x218)+_0x503be7,_0x3d6983=await this[_0x34b5e2(0x24e)]['request'](_0x34b5e2(0x1d4),_0x318b4f,{'headers':{'Accept':_0x34b5e2(0x20a)}});return _0x3d6983;}async[a89_0x38f30b(0x222)](_0x299783){const _0x778373=a89_0x38f30b,_0x509088=_0x778373(0x218)+_0x299783+_0x778373(0x261),_0x5353b1=await this['httpClient'][_0x778373(0x1de)]('GET',_0x509088);return _0x5353b1;}async['getAudienceBehaviors'](_0x26794c,_0x3e8f43){const _0x5c0a4b=a89_0x38f30b;let _0x5d8faa='/audiences/'+_0x26794c+'/behaviors';_0x3e8f43!==undefined&&(_0x5d8faa+=_0x5c0a4b(0x1f9)+_0x3e8f43);const _0xfca8df=await this['httpClient'][_0x5c0a4b(0x1de)](_0x5c0a4b(0x1d4),_0x5d8faa);return _0xfca8df;}async[a89_0x38f30b(0x213)](_0x2a9ea4,_0x3a327b){const _0x14ebeb=a89_0x38f30b,_0x3adcc9='/audiences/'+_0x2a9ea4+_0x14ebeb(0x253),_0x3a7139=await this['httpClient'][_0x14ebeb(0x1de)](_0x14ebeb(0x235),_0x3adcc9,{'body':_0x3a327b});return _0x3a7139;}async['createJourneySegment'](_0x143d7c){const _0x19b3c1=a89_0x38f30b,_0x568696=_0x19b3c1(0x205),_0x28a1ea={'type':_0x19b3c1(0x1f4),'attributes':{'name':_0x143d7c['name'],'description':_0x143d7c[_0x19b3c1(0x214)]||'','journeyId':_0x143d7c[_0x19b3c1(0x20e)],'rule':_0x143d7c[_0x19b3c1(0x234)],'countPopulation':_0x143d7c[_0x19b3c1(0x1f8)]??!![]},'relationships':{'parentFolder':{'data':{'id':_0x143d7c[_0x19b3c1(0x1f1)],'type':_0x19b3c1(0x216)}}}},_0x4c451f=await this[_0x19b3c1(0x24e)][_0x19b3c1(0x1de)](_0x19b3c1(0x235),_0x568696,{'body':_0x28a1ea,'headers':{'Content-Type':_0x19b3c1(0x20a)}});return _0x4c451f[_0x19b3c1(0x226)]['id'];}async['updateSegment'](_0x21b78,_0x41afcc,_0x1d6111){const _0x55993c=a89_0x38f30b,_0x507598='/audiences/'+_0x21b78+_0x55993c(0x22c)+_0x41afcc,_0x4acf2c=await this[_0x55993c(0x24e)][_0x55993c(0x1de)](_0x55993c(0x1d7),_0x507598,{'body':_0x1d6111});return _0x4acf2c;}async[a89_0x38f30b(0x210)](_0x469386){const _0x6da928=a89_0x38f30b,_0x18f892=_0x6da928(0x23d)+_0x469386;await this[_0x6da928(0x24e)]['request'](_0x6da928(0x1d3),_0x18f892);}async[a89_0x38f30b(0x227)](_0x562d3c,_0x2e506d){const _0x15f8a7=a89_0x38f30b,_0x4af665='/audiences/'+_0x562d3c+_0x15f8a7(0x243),_0x1bf4fe=await this[_0x15f8a7(0x24e)]['request'](_0x15f8a7(0x235),_0x4af665,{'body':_0x2e506d});if(_0x15f8a7(0x226)in _0x1bf4fe&&_0x1bf4fe[_0x15f8a7(0x226)]){const _0x209497=_0x1bf4fe[_0x15f8a7(0x226)];return{'id':_0x209497['id'],'name':_0x209497[_0x15f8a7(0x23c)],'description':_0x209497['description'],'audienceId':_0x209497['audienceId']||String(_0x562d3c),'parentFolderId':_0x209497[_0x15f8a7(0x1f1)],'createdAt':_0x209497[_0x15f8a7(0x257)],'updatedAt':_0x209497[_0x15f8a7(0x241)]};}return _0x1bf4fe;}async['runParentSegment'](_0x38d59b){const _0x417630=a89_0x38f30b,_0x1f4496=_0x417630(0x218)+_0x38d59b+_0x417630(0x1fc),_0x3b0b1e=await this[_0x417630(0x24e)][_0x417630(0x1de)](_0x417630(0x235),_0x1f4496);return _0x3b0b1e;}async[a89_0x38f30b(0x1f2)](_0x5a08c8){const _0x2c63e0=a89_0x38f30b,_0x39a904='/entities/journeys?folder_id='+_0x5a08c8,_0x22abda=await this[_0x2c63e0(0x24e)][_0x2c63e0(0x1de)](_0x2c63e0(0x1d4),_0x39a904);return _0x22abda[_0x2c63e0(0x226)][_0x2c63e0(0x1eb)](_0x37d82f=>({'id':_0x37d82f['id'],'name':_0x37d82f[_0x2c63e0(0x237)][_0x2c63e0(0x23c)],'journeyBundleName':_0x37d82f['attributes'][_0x2c63e0(0x220)],'journeyBundleId':_0x37d82f[_0x2c63e0(0x237)][_0x2c63e0(0x1d9)],'versionNumber':_0x37d82f[_0x2c63e0(0x237)][_0x2c63e0(0x238)],'description':_0x37d82f[_0x2c63e0(0x237)][_0x2c63e0(0x214)],'state':_0x37d82f[_0x2c63e0(0x237)][_0x2c63e0(0x254)],'paused':_0x37d82f[_0x2c63e0(0x237)]['paused'],'audienceId':_0x37d82f['attributes']['audienceId'],'folderId':_0x37d82f[_0x2c63e0(0x25b)]?.[_0x2c63e0(0x244)]?.[_0x2c63e0(0x226)]?.['id'],'createdAt':_0x37d82f['attributes']['createdAt'],'updatedAt':_0x37d82f[_0x2c63e0(0x237)][_0x2c63e0(0x241)]}));}async[a89_0x38f30b(0x24b)](_0xcadf1a){const _0xaeb943=a89_0x38f30b,_0x20b448='/entities/journeys?folder_id='+_0xcadf1a,_0x4bb66d=await this[_0xaeb943(0x24e)][_0xaeb943(0x1de)](_0xaeb943(0x1d4),_0x20b448),_0x106843=new Map();if(_0x4bb66d[_0xaeb943(0x225)])for(const _0x58f219 of _0x4bb66d[_0xaeb943(0x225)]){_0x58f219[_0xaeb943(0x23f)]===_0xaeb943(0x1e8)&&_0x106843[_0xaeb943(0x23b)](_0x58f219['id'],_0x58f219);}return{'journeys':_0x4bb66d['data'],'activationStepsById':_0x106843};}async[a89_0x38f30b(0x248)](_0x17b0ad){const _0x4dff73=a89_0x38f30b,_0x5bd54b=_0x4dff73(0x1f5)+_0x17b0ad,_0x2d2951=await this[_0x4dff73(0x24e)]['request'](_0x4dff73(0x1d4),_0x5bd54b);return'data'in _0x2d2951?_0x2d2951[_0x4dff73(0x226)]:_0x2d2951;}async[a89_0x38f30b(0x1e0)](_0xef03bc){const _0x129a7a=a89_0x38f30b,_0x3b2d3d=_0x129a7a(0x1fd)+_0xef03bc,_0x30fd4a=await this[_0x129a7a(0x24e)][_0x129a7a(0x1de)](_0x129a7a(0x1d4),_0x3b2d3d);return parseJourneyBundleResponse(_0x30fd4a);}async[a89_0x38f30b(0x25d)](_0x5b4344){const _0x390091=a89_0x38f30b,_0x5c31b7=_0x390091(0x1fd)+_0x5b4344+_0x390091(0x1e2);await this[_0x390091(0x24e)][_0x390091(0x1de)](_0x390091(0x1d4),_0x5c31b7);}async['createJourneyVersion'](_0x2070a6,_0x382b45){const _0x4ed656=a89_0x38f30b,_0x5d5f62=_0x4ed656(0x1fd)+_0x2070a6+_0x4ed656(0x209),_0x7c2b9c=await this[_0x4ed656(0x24e)][_0x4ed656(0x1de)](_0x4ed656(0x235),_0x5d5f62,{'body':_0x382b45});return'data'in _0x7c2b9c?_0x7c2b9c[_0x4ed656(0x226)]:_0x7c2b9c;}async[a89_0x38f30b(0x1e5)](_0x4551b5){const _0x57b0c6=a89_0x38f30b,_0x45a132='/entities/journeys',_0x67c332=await this['httpClient'][_0x57b0c6(0x1de)]('POST',_0x45a132,{'body':_0x4551b5,'headers':{'Content-Type':_0x57b0c6(0x20a)}});return _0x57b0c6(0x226)in _0x67c332?_0x67c332['data']:_0x67c332;}async[a89_0x38f30b(0x1e4)](_0x308b47,_0x3aa135){const _0x568c5b=a89_0x38f30b,_0x1e3675=_0x568c5b(0x1f5)+_0x308b47,_0xe8cb11=await this[_0x568c5b(0x24e)][_0x568c5b(0x1de)](_0x568c5b(0x1f6),_0x1e3675,{'body':_0x3aa135,'headers':{'Content-Type':_0x568c5b(0x20a)}});return _0x568c5b(0x226)in _0xe8cb11?_0xe8cb11[_0x568c5b(0x226)]:_0xe8cb11;}async['updateJourneyDetail'](_0xb36166,_0x1018bf){const _0x1001c6=a89_0x38f30b,_0x43d1d6=_0x1001c6(0x1f5)+_0xb36166+_0x1001c6(0x217),_0x46a29a=await this[_0x1001c6(0x24e)][_0x1001c6(0x1de)](_0x1001c6(0x235),_0x43d1d6,{'body':_0x1018bf,'headers':{'Content-Type':_0x1001c6(0x20a)}});return'data'in _0x46a29a?_0x46a29a[_0x1001c6(0x226)]:_0x46a29a;}async['getJourneyStatistics'](_0x68717d,_0x85a146){const _0x42bb83=a89_0x38f30b,_0x4a4add=buildJourneyEndpoint(_0x68717d,_0x42bb83(0x239),_0x85a146),_0x29a264=await this['httpClient'][_0x42bb83(0x1de)](_0x42bb83(0x1d4),_0x4a4add);return parseJourneyStatisticsResponse(_0x29a264);}async[a89_0x38f30b(0x21a)](_0x2b045d,_0x4aaa69){const _0x40b823=a89_0x38f30b,_0x19b7ad=buildJourneyEndpoint(_0x2b045d,'conversion_sankey_charts',_0x4aaa69),_0x37aa58=await this[_0x40b823(0x24e)][_0x40b823(0x1de)]('GET',_0x19b7ad);return parseConversionSankeyResponse(_0x37aa58);}async[a89_0x38f30b(0x20f)](_0x23d0ec,_0x598606){const _0x5c5b75=a89_0x38f30b,_0x277c37=buildJourneyEndpoint(_0x23d0ec,_0x5c5b75(0x256),_0x598606),_0x4b884e=await this[_0x5c5b75(0x24e)][_0x5c5b75(0x1de)]('GET',_0x277c37);return parseActivationSankeyResponse(_0x4b884e);}async[a89_0x38f30b(0x1d6)](_0x420bd0){const _0x20e24b=a89_0x38f30b,_0x550bca=_0x20e24b(0x1f5)+_0x420bd0+_0x20e24b(0x230),_0x183f05=await this[_0x20e24b(0x24e)][_0x20e24b(0x1de)](_0x20e24b(0x1f6),_0x550bca);return _0x20e24b(0x226)in _0x183f05?_0x183f05[_0x20e24b(0x226)]:_0x183f05;}async[a89_0x38f30b(0x1ef)](_0xd781b){const _0x5989ab=a89_0x38f30b,_0x10a2a3=_0x5989ab(0x1f5)+_0xd781b+_0x5989ab(0x1ee),_0x2cfa0b=await this['httpClient'][_0x5989ab(0x1de)]('PATCH',_0x10a2a3);return _0x5989ab(0x226)in _0x2cfa0b?_0x2cfa0b[_0x5989ab(0x226)]:_0x2cfa0b;}async['getJourneyActivation'](_0x2aeff8,_0xa45c7b){const _0x161202=a89_0x38f30b,_0x3c85cb=_0x161202(0x1f5)+_0x2aeff8+_0x161202(0x200)+_0xa45c7b,_0x9b778c=await this['httpClient'][_0x161202(0x1de)](_0x161202(0x1d4),_0x3c85cb);return _0x161202(0x226)in _0x9b778c?_0x9b778c[_0x161202(0x226)]:_0x9b778c;}async[a89_0x38f30b(0x25f)](_0xfcaadc){const _0x179c6f=a89_0x38f30b,_0x157553='/entities/journeys/'+_0xfcaadc+_0x179c6f(0x231),_0x521164=await this['httpClient']['request'](_0x179c6f(0x1d4),_0x157553);return _0x179c6f(0x226)in _0x521164?_0x521164[_0x179c6f(0x226)]:_0x521164;}async[a89_0x38f30b(0x258)](_0x528612,_0x543407){const _0x4d0691=a89_0x38f30b,_0x56850e=_0x4d0691(0x1f5)+_0x528612+_0x4d0691(0x231),_0x526489={'name':_0x543407[_0x4d0691(0x23c)],'scheduleType':_0x543407[_0x4d0691(0x249)]||_0x4d0691(0x207),'connectionId':String(_0x543407[_0x4d0691(0x22f)]),'columns':_0x543407['columns']??[],'notifyOn':_0x543407[_0x4d0691(0x1e7)]??[],..._0x543407[_0x4d0691(0x214)]!==undefined&&{'description':_0x543407['description']},..._0x543407[_0x4d0691(0x20c)]!==undefined&&{'allColumns':_0x543407[_0x4d0691(0x20c)]},..._0x543407['timezone']!==undefined&&{'timezone':_0x543407[_0x4d0691(0x228)]},..._0x543407[_0x4d0691(0x223)]!==undefined&&{'connectorConfig':_0x543407['connectorConfig']},..._0x543407[_0x4d0691(0x22a)]!==undefined&&{'emailRecipients':_0x543407[_0x4d0691(0x22a)]},..._0x543407[_0x4d0691(0x20b)]!==undefined&&{'activationTemplateId':_0x543407[_0x4d0691(0x20b)]},..._0x543407[_0x4d0691(0x246)]!==undefined&&{'syndicationBehavior':_0x543407[_0x4d0691(0x246)]}},_0x3e54e6=await this[_0x4d0691(0x24e)][_0x4d0691(0x1de)]('POST',_0x56850e,{'body':{'type':_0x4d0691(0x1e8),'attributes':{'runAfterJourneyRefresh':_0x543407[_0x4d0691(0x25e)]??![],'activationParams':_0x526489}},'headers':{'Content-Type':_0x4d0691(0x20a)}});return _0x4d0691(0x226)in _0x3e54e6?_0x3e54e6['data']:_0x3e54e6;}}export function buildJourneyEndpoint(_0x325838,_0x3d6b46,_0x114eb8){const _0x17ae07=a89_0x38f30b,_0x15d34c='/entities/journeys/'+_0x325838+'/'+_0x3d6b46,_0x4e219c=new URLSearchParams();if(_0x114eb8?.[_0x17ae07(0x1ed)])_0x4e219c[_0x17ae07(0x23b)](_0x17ae07(0x1ed),_0x114eb8['from']);if(_0x114eb8?.['to'])_0x4e219c[_0x17ae07(0x23b)]('to',_0x114eb8['to']);if(_0x114eb8?.['limit']!=null)_0x4e219c['set'](_0x17ae07(0x22d),String(_0x114eb8['limit']));const _0x8d811e=_0x4e219c[_0x17ae07(0x1e6)]();return _0x8d811e?_0x15d34c+'?'+_0x8d811e:_0x15d34c;}export function parseJourneyStatisticsResponse(_0x1363aa){const _0x51aadd=a89_0x38f30b;if(!(_0x51aadd(0x226)in _0x1363aa))return _0x1363aa;const _0xfa146c=_0x1363aa[_0x51aadd(0x226)];if(!('attributes'in _0xfa146c)||!_0xfa146c[_0x51aadd(0x237)]||typeof _0xfa146c[_0x51aadd(0x237)]!==_0x51aadd(0x1ea))return _0xfa146c;const _0x174634=_0xfa146c['attributes'],_0x4bc485={'journeyId':_0x174634[_0x51aadd(0x20e)],'size':_0x174634[_0x51aadd(0x24d)],'goalSize':_0x174634[_0x51aadd(0x208)],'enteredSize':_0x174634['enteredSize'],'completionRate':_0x174634[_0x51aadd(0x250)],'exitOrJumpSize':_0x174634[_0x51aadd(0x252)],'exitOrJumpRate':_0x174634['exitOrJumpRate'],'stages':(_0x174634['journeyStageStatistics']??[])[_0x51aadd(0x1eb)](_0x1a3f79=>{const _0x34e904=_0x51aadd,_0x1a6f42={'id':_0x1a3f79['id'],'enteredSize':_0x1a3f79[_0x34e904(0x215)],'milestoneSize':_0x1a3f79[_0x34e904(0x1e3)],'completeMilestoneRate':_0x1a3f79[_0x34e904(0x240)],'exitOrJumpSize':_0x1a3f79[_0x34e904(0x252)],'exitOrJumpRate':_0x1a3f79[_0x34e904(0x201)],'size':_0x1a3f79[_0x34e904(0x24d)]};if(_0x1a3f79[_0x34e904(0x204)])_0x1a6f42[_0x34e904(0x204)]=_0x1a3f79[_0x34e904(0x204)];if(_0x1a3f79[_0x34e904(0x22e)])_0x1a6f42[_0x34e904(0x22e)]=_0x1a3f79['stepSizes'];if(_0x1a3f79[_0x34e904(0x1fb)])_0x1a6f42[_0x34e904(0x1fb)]=_0x1a3f79[_0x34e904(0x1fb)];if(_0x1a3f79[_0x34e904(0x21c)])_0x1a6f42[_0x34e904(0x21c)]=_0x1a3f79[_0x34e904(0x21c)];return _0x1a6f42;})};return Array[_0x51aadd(0x1e1)](_0x174634[_0x51aadd(0x204)])&&(_0x4bc485[_0x51aadd(0x204)]=_0x174634[_0x51aadd(0x204)]),_0x4bc485;}function extractSankeyChart(_0x3c95d4){const _0x274f73=a89_0x38f30b,_0x36f5ad=Array['isArray'](_0x3c95d4['data'])?_0x3c95d4['data']:[],_0x18871b=_0x3c95d4[_0x274f73(0x203)]&&typeof _0x3c95d4['metaData']===_0x274f73(0x1ea)?_0x3c95d4[_0x274f73(0x203)]:{},_0x4578d4=Array['isArray'](_0x18871b[_0x274f73(0x236)])?_0x18871b[_0x274f73(0x236)]:[];return{'nodes':_0x36f5ad,'links':_0x4578d4};}function extractJsonApiAttributes(_0x5986a7){const _0x492a0f=a89_0x38f30b;if(!_0x5986a7||typeof _0x5986a7!==_0x492a0f(0x1ea))return[];const _0x350db7=_0x5986a7;if(!Array[_0x492a0f(0x1e1)](_0x350db7[_0x492a0f(0x226)]))return[];return _0x350db7[_0x492a0f(0x226)][_0x492a0f(0x242)](_0xf24104=>!!_0xf24104&&typeof _0xf24104===_0x492a0f(0x1ea))[_0x492a0f(0x1eb)](_0x13d011=>_0x13d011[_0x492a0f(0x237)])[_0x492a0f(0x242)](_0x16550e=>!!_0x16550e&&typeof _0x16550e==='object');}export function parseConversionSankeyResponse(_0x146833){const _0x1160e2=a89_0x38f30b,_0x11f8e4={'nodes':[],'links':[]},_0x50310=extractJsonApiAttributes(_0x146833);if(_0x50310[_0x1160e2(0x1d8)]===0x0)return _0x11f8e4;const _0x2fe9bf=_0x50310[0x0],_0xb8bd21=_0x2fe9bf['chart'];if(_0xb8bd21&&typeof _0xb8bd21==='object'){const {nodes:_0x526f4f,links:_0x576691}=extractSankeyChart(_0xb8bd21);return{'nodes':_0x526f4f,'links':_0x576691,...typeof _0x2fe9bf[_0x1160e2(0x241)]===_0x1160e2(0x255)?{'updatedAt':_0x2fe9bf[_0x1160e2(0x241)]}:{}};}return _0x11f8e4;}function a89_0x39a3(_0x31a5de,_0x1a638f){_0x31a5de=_0x31a5de-0x1d3;const _0x4eba94=a89_0x4eba();let _0x39a3b2=_0x4eba94[_0x31a5de];return _0x39a3b2;}export function parseActivationSankeyResponse(_0x58d25e){const _0x92fa52=a89_0x38f30b,_0x104fa3=extractJsonApiAttributes(_0x58d25e);if(_0x104fa3['length']>0x0)return _0x104fa3[_0x92fa52(0x1eb)](_0x17e92d=>{const _0x1a67ac=_0x92fa52,_0x7fcf6a=_0x17e92d['chart'],{nodes:_0x33715a,links:_0x3babd3}=_0x7fcf6a&&typeof _0x7fcf6a==='object'?extractSankeyChart(_0x7fcf6a):{'nodes':[],'links':[]};return{'journeyStageId':typeof _0x17e92d[_0x1a67ac(0x247)]==='string'?_0x17e92d[_0x1a67ac(0x247)]:'','nodes':_0x33715a,'links':_0x3babd3,...typeof _0x17e92d[_0x1a67ac(0x241)]===_0x1a67ac(0x255)?{'updatedAt':_0x17e92d[_0x1a67ac(0x241)]}:{}};});if(Array[_0x92fa52(0x1e1)](_0x58d25e))return _0x58d25e;return[];}export function parseJourneyBundleResponse(_0x36d62b){const _0x43c573=a89_0x38f30b;if(!_0x36d62b||typeof _0x36d62b!==_0x43c573(0x1ea))throw new Error(_0x43c573(0x1da));const _0x4ee098=_0x36d62b,_0x21f87b=_0x4ee098[_0x43c573(0x226)],_0x1541d2=_0x21f87b?.[_0x43c573(0x237)]??_0x4ee098,_0x1e656a=Array[_0x43c573(0x1e1)](_0x1541d2['journeys'])?_0x1541d2[_0x43c573(0x251)]:[],_0x3d1e06=_0x1e656a[_0x43c573(0x1eb)](_0x304c53=>{const _0xf26e80=_0x43c573;if(!_0x304c53||typeof _0x304c53!==_0xf26e80(0x1ea))return _0x304c53;const _0x1233c2=_0x304c53;if(_0x1233c2[_0xf26e80(0x226)]&&typeof _0x1233c2['data']===_0xf26e80(0x1ea))return _0x1233c2['data'];return _0x1233c2;});return{'name':_0x1541d2['name'],'description':_0x1541d2[_0x43c573(0x214)]??null,'latestJourneyId':_0x1541d2[_0x43c573(0x24f)],'lastVersionNumber':_0x1541d2[_0x43c573(0x229)],'journeys':_0x3d1e06};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a90_0x431f2e=a90_0x50fd;(function(_0x12be15,_0x5896e3){const _0x489011=a90_0x50fd,_0x188deb=_0x12be15();while(!![]){try{const _0xeffdea=parseInt(_0x489011(0x86))/0x1*(-parseInt(_0x489011(0x89))/0x2)+parseInt(_0x489011(0x81))/0x3*(parseInt(_0x489011(0x90))/0x4)+-parseInt(_0x489011(0x8e))/0x5+-parseInt(_0x489011(0x87))/0x6*(-parseInt(_0x489011(0x85))/0x7)+parseInt(_0x489011(0x94))/0x8*(-parseInt(_0x489011(0x7e))/0x9)+-parseInt(_0x489011(0x8a))/0xa*(-parseInt(_0x489011(0x82))/0xb)+-parseInt(_0x489011(0x8b))/0xc*(-parseInt(_0x489011(0x7d))/0xd);if(_0xeffdea===_0x5896e3)break;else _0x188deb['push'](_0x188deb['shift']());}catch(_0x5cdb94){_0x188deb['push'](_0x188deb['shift']());}}}(a90_0x4246,0x91709));import{HTTPClient}from'./http-client.js';import{getDeliveryEndpoint}from'./endpoints.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';function a90_0x50fd(_0x54e9e1,_0x234ab1){_0x54e9e1=_0x54e9e1-0x7a;const _0x4246fb=a90_0x4246();let _0x50fdc5=_0x4246fb[_0x54e9e1];return _0x50fdc5;}function a90_0x4246(){const _0x441ecf=['804630aDyfYP','GET','3108260tklRBk','page[offset]','limit','workspaceId','8XVSFtk','offset','accessToken','httpClient','request','/api/email_senders','909389BIgvnO','10306044wUKiBr','page[limit]','/api/email_senders?','3fPrAmJ','3051257MdGJbb','toString','append','1798727wjtPPn','1OjOrbo','6xSXRBQ','proxy','68754uJRxqy','30UtuXeN','12vkioIv','filter[workspaceId]','site'];a90_0x4246=function(){return _0x441ecf;};return a90_0x4246();}export class DeliveryApiClient{[a90_0x431f2e(0x7a)];constructor(_0x7db6a5){const _0x425cdb=a90_0x431f2e,_0x2be7bf=getDeliveryEndpoint(_0x7db6a5['site']),_0x49f5cd=toHeaderRecord(getAuthHeaders(_0x7db6a5[_0x425cdb(0x8d)],_0x7db6a5['apiKey'],_0x7db6a5[_0x425cdb(0x96)]));this['httpClient']=new HTTPClient(_0x2be7bf,_0x49f5cd,{'proxy':_0x7db6a5[_0x425cdb(0x88)]});}async['listEmailSenders'](_0x14acd9={}){const _0x4b0c42=a90_0x431f2e,_0x1ff453=new URLSearchParams();_0x14acd9[_0x4b0c42(0x93)]&&_0x1ff453[_0x4b0c42(0x84)](_0x4b0c42(0x8c),_0x14acd9['workspaceId']);_0x14acd9['limit']!==undefined&&_0x1ff453[_0x4b0c42(0x84)](_0x4b0c42(0x7f),_0x14acd9[_0x4b0c42(0x92)]['toString']());_0x14acd9[_0x4b0c42(0x95)]!==undefined&&_0x1ff453[_0x4b0c42(0x84)](_0x4b0c42(0x91),_0x14acd9[_0x4b0c42(0x95)][_0x4b0c42(0x83)]());const _0x2102d3=_0x1ff453['toString'](),_0x21941d=_0x2102d3?_0x4b0c42(0x80)+_0x2102d3:_0x4b0c42(0x7c);return await this[_0x4b0c42(0x7a)][_0x4b0c42(0x7b)](_0x4b0c42(0x8f),_0x21941d,{'headers':{'Accept':'application/vnd.api+json'}});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a91_0x4ba27c=a91_0x4b75;function a91_0x508d(){const _0x48fac6=['https://console.us01.treasuredata.com','https://api.eu01.treasuredata.com','https://console.treasuredata.co.jp','/app/af/','13306942Usfhch','/app/es/','https://llm-api-staging.ap03.treasuredata.com','https://console.ap02.treasuredata.com','No\x20LLM\x20Proxy\x20endpoint\x20for\x20site:\x20','https://engage-api-staging.us01.treasuredata.com','https://api-staging.treasuredata.co.jp','https://api-development-presto.treasuredata.com','https://llm-proxy-staging.ap03.treasuredata.com','https://api-staging.ap03.treasuredata.com','https://api-staging-cdp.ap03.treasuredata.com','https://api.treasuredata.co.jp','https://api-workflow.treasuredata.com','https://delivery-api.eu01.treasuredata.com','https://api-development-presto.eu01.treasuredata.com','https://api-workflow.ap02.treasuredata.com','https://api-presto.treasuredata.com','/attempt/','https://engage-api-development.us01.treasuredata.com','https://engage-api-development.eu01.treasuredata.com','https://llm-api-development.us01.treasuredata.com','https://llm-api.treasuredata.co.jp','/ag','247804sEepWp','https://engage-api.eu01.treasuredata.com','https://engage-api.treasuredata.com','/ce','https://delivery-api-development.us01.treasuredata.com','https://api-cdp.treasuredata.co.jp','https://llm-proxy.eu01.treasuredata.com','207blFpeS','https://engage-api.ap03.treasuredata.com','2PJCzKR','https://llm-proxy-development.us01.treasuredata.com','https://llm-proxy.ap03.treasuredata.com','https://api.treasuredata.com','https://api-development-cdp.eu01.treasuredata.com','https://api-presto.treasuredata.co.jp','https://api-presto.ap03.treasuredata.com','https://api.ap02.treasuredata.com','https://llm-api-staging.treasuredata.co.jp','https://delivery-api-staging.us01.treasuredata.com','https://api-workflow.ap03.treasuredata.com','\x27\x20and\x20site\x20\x27','https://api-development-workflow.us01.treasuredata.com','12rCRrSi','https://api-staging-presto.treasuredata.com','https://api-presto.eu01.treasuredata.com','https://delivery-api-staging.treasuredata.co.jp','https://api-staging-cdp.treasuredata.co.jp','1110ZHwdYq','https://llm-proxy-development.eu01.treasuredata.com','https://api-staging-workflow.us01.treasuredata.com','5548200yDeESd','https://engage-api.treasuredata.co.jp','https://api-development-workflow.eu01.treasuredata.com','https://console.ap03.treasuredata.com','https://engage-api.ap02.treasuredata.com','https://delivery-api-development.eu01.treasuredata.com','https://api-staging-presto.ap03.treasuredata.com','https://delivery-api.us01.treasuredata.com','https://llm-api.ap02.treasuredata.com','https://llm-proxy.ap02.treasuredata.com','https://delivery-api.ap03.treasuredata.com','https://delivery-api.ap02.treasuredata.com','https://console-next.ap03.treasuredata.com','https://engage-api-staging.treasuredata.co.jp','https://api-cdp.eu01.treasuredata.com','/tc','https://api-staging-workflow.ap03.treasuredata.com','775971TMaDkQ','https://console-staging-next.treasuredata.co.jp','https://console-development.us01.treasuredata.com','/ag/','https://llm-proxy-staging.us01.treasuredata.com','https://api-cdp.ap02.treasuredata.com','1997737dpeOtz','https://api-staging-cdp.us01.treasuredata.com','/result','https://console-development-next.eu01.treasuredata.com','24HopsrY','https://console-staging-next.us01.treasuredata.com','/sessions/','No\x20Delivery\x20API\x20endpoint\x20for\x20site:\x20','https://console.','/tc/','12885cWMCaE','https://console-staging.treasuredata.co.jp','https://console-next.us01.treasuredata.com','.treasuredata.com','41992phWEUI','https://console.eu01.treasuredata.com','https://console-staging.ap03.treasuredata.com','https://llm-api-development.eu01.treasuredata.com','/app/workflows/','https://api-workflow.treasuredata.co.jp','https://api-development-cdp.us01.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','https://llm-proxy-staging.treasuredata.co.jp','https://llm-proxy.us01.treasuredata.com','https://api-cdp.ap03.treasuredata.com','https://console-next.eu01.treasuredata.com','/ooc/','https://api.ap03.treasuredata.com','https://api-presto.ap02.treasuredata.com','https://console-next.','https://console-next.ap02.treasuredata.com','/app/jobs/'];a91_0x508d=function(){return _0x48fac6;};return a91_0x508d();}(function(_0x1ce84a,_0x5dd484){const _0x298226=a91_0x4b75,_0x4b3512=_0x1ce84a();while(!![]){try{const _0x58037d=parseInt(_0x298226(0x16b))/0x1*(parseInt(_0x298226(0x162))/0x2)+-parseInt(_0x298226(0x169))/0x3*(-parseInt(_0x298226(0x1a5))/0x4)+-parseInt(_0x298226(0x1a1))/0x5*(parseInt(_0x298226(0x17d))/0x6)+parseInt(_0x298226(0x197))/0x7+-parseInt(_0x298226(0x19b))/0x8*(-parseInt(_0x298226(0x191))/0x9)+parseInt(_0x298226(0x180))/0xa+-parseInt(_0x298226(0x14b))/0xb*(parseInt(_0x298226(0x178))/0xc);if(_0x58037d===_0x5dd484)break;else _0x4b3512['push'](_0x4b3512['shift']());}catch(_0x167e39){_0x4b3512['push'](_0x4b3512['shift']());}}}(a91_0x508d,0x5de37));export const TD_ENDPOINTS={'us01':a91_0x4ba27c(0x16e),'ap01':a91_0x4ba27c(0x156),'eu01':a91_0x4ba27c(0x148),'ap02':a91_0x4ba27c(0x172),'ap03':a91_0x4ba27c(0x142),'dev-us01':'https://api-development.treasuredata.com','dev-eu01':'https://api-development.eu01.treasuredata.com','stg-us01':'https://api-staging.treasuredata.com','stg-ap01':a91_0x4ba27c(0x151),'stg-ap03':a91_0x4ba27c(0x154)};export const CDP_ENDPOINTS={'us01':'https://api-cdp.treasuredata.com','ap01':a91_0x4ba27c(0x167),'eu01':a91_0x4ba27c(0x18e),'ap02':a91_0x4ba27c(0x196),'ap03':a91_0x4ba27c(0x13f),'dev-us01':a91_0x4ba27c(0x1ab),'dev-eu01':a91_0x4ba27c(0x16f),'stg-us01':a91_0x4ba27c(0x198),'stg-ap01':a91_0x4ba27c(0x17c),'stg-ap03':a91_0x4ba27c(0x155)};export const WORKFLOW_ENDPOINTS={'us01':a91_0x4ba27c(0x157),'ap01':a91_0x4ba27c(0x1aa),'eu01':'https://api-workflow.eu01.treasuredata.com','ap02':a91_0x4ba27c(0x15a),'ap03':a91_0x4ba27c(0x175),'dev-us01':a91_0x4ba27c(0x177),'dev-eu01':a91_0x4ba27c(0x182),'stg-us01':a91_0x4ba27c(0x17f),'stg-ap01':'https://api-staging-workflow.treasuredata.co.jp','stg-ap03':a91_0x4ba27c(0x190)};export const TRINO_ENDPOINTS={'us01':a91_0x4ba27c(0x15b),'ap01':a91_0x4ba27c(0x170),'eu01':a91_0x4ba27c(0x17a),'ap02':a91_0x4ba27c(0x143),'ap03':a91_0x4ba27c(0x171),'dev-us01':a91_0x4ba27c(0x152),'dev-eu01':a91_0x4ba27c(0x159),'stg-us01':a91_0x4ba27c(0x179),'stg-ap01':a91_0x4ba27c(0x1ac),'stg-ap03':a91_0x4ba27c(0x186)};export const LLM_ENDPOINTS={'us01':'https://llm-api.treasuredata.com','ap01':a91_0x4ba27c(0x160),'eu01':'https://llm-api.eu01.treasuredata.com','ap02':a91_0x4ba27c(0x188),'ap03':'https://llm-api.ap03.treasuredata.com','dev-us01':a91_0x4ba27c(0x15f),'dev-eu01':a91_0x4ba27c(0x1a8),'stg-us01':'https://llm-api-staging.us01.treasuredata.com','stg-ap01':a91_0x4ba27c(0x173),'stg-ap03':a91_0x4ba27c(0x14d)};export const LLM_PROXY_ENDPOINTS={'us01':a91_0x4ba27c(0x13e),'ap01':'https://llm-proxy.treasuredata.co.jp','eu01':a91_0x4ba27c(0x168),'ap02':a91_0x4ba27c(0x189),'ap03':a91_0x4ba27c(0x16d),'dev-us01':a91_0x4ba27c(0x16c),'dev-eu01':a91_0x4ba27c(0x17e),'stg-us01':a91_0x4ba27c(0x195),'stg-ap01':a91_0x4ba27c(0x13d),'stg-ap03':a91_0x4ba27c(0x153)};export const ENGAGE_ENDPOINTS={'us01':a91_0x4ba27c(0x164),'ap01':a91_0x4ba27c(0x181),'eu01':a91_0x4ba27c(0x163),'ap02':a91_0x4ba27c(0x184),'ap03':a91_0x4ba27c(0x16a),'dev-us01':a91_0x4ba27c(0x15d),'dev-eu01':a91_0x4ba27c(0x15e),'stg-us01':a91_0x4ba27c(0x150),'stg-ap01':a91_0x4ba27c(0x18d),'stg-ap03':'https://engage-api-staging.ap03.treasuredata.com'};export const DELIVERY_ENDPOINTS={'us01':a91_0x4ba27c(0x187),'ap01':'https://delivery-api.treasuredata.co.jp','eu01':a91_0x4ba27c(0x158),'ap02':a91_0x4ba27c(0x18b),'ap03':a91_0x4ba27c(0x18a),'dev-us01':a91_0x4ba27c(0x166),'dev-eu01':a91_0x4ba27c(0x185),'stg-us01':a91_0x4ba27c(0x174),'stg-ap01':a91_0x4ba27c(0x17b),'stg-ap03':'https://delivery-api-staging.ap03.treasuredata.com'};export function getDeliveryEndpoint(_0x545d47){const _0x4112f4=a91_0x4ba27c,_0x48b21d=DELIVERY_ENDPOINTS[_0x545d47];if(!_0x48b21d)throw new Error(_0x4112f4(0x19e)+_0x545d47);return _0x48b21d;}export const CONSOLE_ENDPOINTS={'us01':a91_0x4ba27c(0x147),'ap01':a91_0x4ba27c(0x149),'eu01':a91_0x4ba27c(0x1a6),'ap02':a91_0x4ba27c(0x14e),'ap03':a91_0x4ba27c(0x183),'dev-us01':a91_0x4ba27c(0x193),'dev-eu01':'https://console-development.eu01.treasuredata.com','stg-us01':'https://console-staging.us01.treasuredata.com','stg-ap01':a91_0x4ba27c(0x1a2),'stg-ap03':a91_0x4ba27c(0x1a7)};export const CONSOLE_NEXT_ENDPOINTS={'us01':a91_0x4ba27c(0x1a3),'ap01':'https://console-next.treasuredata.co.jp','eu01':a91_0x4ba27c(0x140),'ap02':a91_0x4ba27c(0x145),'ap03':a91_0x4ba27c(0x18c),'dev-us01':'https://console-development-next.us01.treasuredata.com','dev-eu01':a91_0x4ba27c(0x19a),'stg-us01':a91_0x4ba27c(0x19c),'stg-ap01':a91_0x4ba27c(0x192),'stg-ap03':'https://console-staging-next.ap03.treasuredata.com'};export function getConsoleUrl(_0x5599dd,_0x3bde5e){const _0x562451=a91_0x4ba27c,_0x4c0d2f=CONSOLE_ENDPOINTS[_0x5599dd]||_0x562451(0x19f)+_0x5599dd+_0x562451(0x1a4);return _0x3bde5e?''+_0x4c0d2f+_0x3bde5e:_0x4c0d2f;}export function getConsoleNextUrl(_0xbafa7e,_0x27bf97){const _0x5a78d7=a91_0x4ba27c,_0x252118=CONSOLE_NEXT_ENDPOINTS[_0xbafa7e]||_0x5a78d7(0x144)+_0xbafa7e+_0x5a78d7(0x1a4);return _0x27bf97?''+_0x252118+_0x27bf97:_0x252118;}export function getLLMProjectUrl(_0x5b4357,_0x48f0d1){const _0x34f783=a91_0x4ba27c;return getConsoleNextUrl(_0x5b4357,'/app/af/'+_0x48f0d1+_0x34f783(0x161));}export function getLLMAgentChatUrl(_0x2a5224,_0x5b3951,_0x919c59){const _0x3fa2d7=a91_0x4ba27c;return getConsoleNextUrl(_0x2a5224,_0x3fa2d7(0x14a)+_0x5b3951+_0x3fa2d7(0x194)+_0x919c59+_0x3fa2d7(0x18f));}export function getLLMConversationUrl(_0xcd950c,_0x30b2ab,_0x5771b,_0x1a8a9f){const _0x2b9db8=a91_0x4ba27c;return getConsoleNextUrl(_0xcd950c,_0x2b9db8(0x14a)+_0x30b2ab+_0x2b9db8(0x194)+_0x5771b+_0x2b9db8(0x1a0)+_0x1a8a9f);}export function getWorkflowUrl(_0x225fab,_0x5c1b70){const _0x38aa78=a91_0x4ba27c;return getConsoleUrl(_0x225fab,_0x38aa78(0x1a9)+_0x5c1b70+'/info');}export function getWorkflowSessionUrl(_0x48e17e,_0x2de123,_0x108254){const _0x1f287c=a91_0x4ba27c;return getConsoleUrl(_0x48e17e,_0x1f287c(0x1a9)+_0x2de123+_0x1f287c(0x19d)+_0x108254);}export function getWorkflowAttemptUrl(_0x39327d,_0x312601,_0x2c43ca,_0x3cc8dd){const _0x4bf642=a91_0x4ba27c;return getConsoleUrl(_0x39327d,_0x4bf642(0x1a9)+_0x312601+_0x4bf642(0x19d)+_0x2c43ca+_0x4bf642(0x15c)+_0x3cc8dd);}export function getCampaignUrl(_0xde8cf2,_0x8d9d0f,_0x5b15bf){const _0x5f53e7=a91_0x4ba27c;return getConsoleNextUrl(_0xde8cf2,_0x5f53e7(0x14c)+_0x8d9d0f+_0x5f53e7(0x141)+_0x5b15bf);}export function getTemplateUrl(_0x4dae90,_0x1037d6,_0x358b36){const _0x17a45e=a91_0x4ba27c;return getConsoleNextUrl(_0x4dae90,_0x17a45e(0x14c)+_0x1037d6+'/em/'+_0x358b36+_0x17a45e(0x165));}export function getJobUrl(_0x43ed6f,_0x3c2d58){const _0x509abb=a91_0x4ba27c;return getConsoleNextUrl(_0x43ed6f,_0x509abb(0x146)+_0x3c2d58+_0x509abb(0x199));}export function getWorkspaceUrl(_0x3574a0,_0x2e5d4b){return getConsoleNextUrl(_0x3574a0,'/app/es/'+_0x2e5d4b);}function a91_0x4b75(_0x484db2,_0x4e7d28){_0x484db2=_0x484db2-0x13d;const _0x508d6f=a91_0x508d();let _0x4b75cb=_0x508d6f[_0x484db2];return _0x4b75cb;}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(_0x19831b){const _0x1c8dd8=a91_0x4ba27c,_0xb820e7=LLM_PROXY_ENDPOINTS[_0x19831b];if(!_0xb820e7)throw new Error(_0x1c8dd8(0x14f)+_0x19831b);return _0xb820e7;}export function getEndpoint(_0x1435e6,_0x46282c='td'){const _0x30ec9c=a91_0x4ba27c,_0x1ea882=API_ENDPOINTS[_0x46282c]?.[_0x1435e6];if(!_0x1ea882)throw new Error('No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27'+_0x46282c+_0x30ec9c(0x176)+_0x1435e6+'\x27');return _0x1ea882;}
|
|
1
|
+
const a91_0xc19328=a91_0xf203;(function(_0x4f0c48,_0x55b95d){const _0x30e2dc=a91_0xf203,_0xcd1a11=_0x4f0c48();while(!![]){try{const _0x2388e2=parseInt(_0x30e2dc(0x125))/0x1*(parseInt(_0x30e2dc(0x155))/0x2)+parseInt(_0x30e2dc(0x156))/0x3*(-parseInt(_0x30e2dc(0x131))/0x4)+-parseInt(_0x30e2dc(0x139))/0x5+-parseInt(_0x30e2dc(0x110))/0x6+parseInt(_0x30e2dc(0x14c))/0x7*(-parseInt(_0x30e2dc(0xf1))/0x8)+-parseInt(_0x30e2dc(0x11c))/0x9*(-parseInt(_0x30e2dc(0x11b))/0xa)+parseInt(_0x30e2dc(0x149))/0xb;if(_0x2388e2===_0x55b95d)break;else _0xcd1a11['push'](_0xcd1a11['shift']());}catch(_0x2abe35){_0xcd1a11['push'](_0xcd1a11['shift']());}}}(a91_0x49fb,0x88232));export const TD_ENDPOINTS={'us01':a91_0xc19328(0x118),'ap01':a91_0xc19328(0x152),'eu01':a91_0xc19328(0xff),'ap02':a91_0xc19328(0xfe),'ap03':a91_0xc19328(0x10d),'dev-us01':a91_0xc19328(0x112),'dev-eu01':a91_0xc19328(0x132),'stg-us01':a91_0xc19328(0x11e),'stg-ap01':a91_0xc19328(0x11d),'stg-ap03':a91_0xc19328(0x129)};export const CDP_ENDPOINTS={'us01':a91_0xc19328(0x120),'ap01':a91_0xc19328(0x103),'eu01':'https://api-cdp.eu01.treasuredata.com','ap02':a91_0xc19328(0xfd),'ap03':a91_0xc19328(0xf3),'dev-us01':a91_0xc19328(0xf6),'dev-eu01':'https://api-development-cdp.eu01.treasuredata.com','stg-us01':'https://api-staging-cdp.us01.treasuredata.com','stg-ap01':'https://api-staging-cdp.treasuredata.co.jp','stg-ap03':'https://api-staging-cdp.ap03.treasuredata.com'};export const WORKFLOW_ENDPOINTS={'us01':a91_0xc19328(0x109),'ap01':a91_0xc19328(0x111),'eu01':a91_0xc19328(0x104),'ap02':a91_0xc19328(0x14b),'ap03':a91_0xc19328(0x146),'dev-us01':a91_0xc19328(0x141),'dev-eu01':a91_0xc19328(0x116),'stg-us01':'https://api-staging-workflow.us01.treasuredata.com','stg-ap01':'https://api-staging-workflow.treasuredata.co.jp','stg-ap03':a91_0xc19328(0x13d)};function a91_0x49fb(){const _0x23c59b=['1260120cQBCel','https://api-workflow.treasuredata.co.jp','https://api-development.treasuredata.com','https://console.ap03.treasuredata.com','https://api-presto.eu01.treasuredata.com','No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27','https://api-development-workflow.eu01.treasuredata.com','https://console-staging-next.ap03.treasuredata.com','https://api.treasuredata.com','/sessions/','https://console-development.us01.treasuredata.com','90bXgeDs','971892AAFtzz','https://api-staging.treasuredata.co.jp','https://api-staging.treasuredata.com','https://console-next.us01.treasuredata.com','https://api-cdp.treasuredata.com','https://console-next.','https://llm-proxy-staging.ap03.treasuredata.com','https://engage-api-staging.us01.treasuredata.com','https://llm-api.ap02.treasuredata.com','14862UGJuGg','https://console.us01.treasuredata.com','https://llm-api.eu01.treasuredata.com','https://api-presto.ap03.treasuredata.com','https://api-staging.ap03.treasuredata.com','https://engage-api.treasuredata.co.jp','https://console-staging.treasuredata.co.jp','https://console.treasuredata.co.jp','https://delivery-api-staging.us01.treasuredata.com','https://api-staging-presto.ap03.treasuredata.com','https://console-next.ap03.treasuredata.com','https://api-presto.treasuredata.co.jp','11516SYKWGS','https://api-development.eu01.treasuredata.com','https://llm-proxy.eu01.treasuredata.com','https://llm-api-development.eu01.treasuredata.com','https://llm-api-staging.ap03.treasuredata.com','https://llm-proxy-staging.treasuredata.co.jp','https://console-next.treasuredata.co.jp','/attempt/','4263445ZcxzSo','/tc/','https://delivery-api-development.us01.treasuredata.com','https://delivery-api.us01.treasuredata.com','https://api-staging-workflow.ap03.treasuredata.com','https://console-development-next.eu01.treasuredata.com','.treasuredata.com','https://console.ap02.treasuredata.com','https://api-development-workflow.us01.treasuredata.com','https://console-next.eu01.treasuredata.com','https://console-development-next.us01.treasuredata.com','https://llm-proxy.ap02.treasuredata.com','https://llm-proxy-development.eu01.treasuredata.com','https://api-workflow.ap03.treasuredata.com','https://console.eu01.treasuredata.com','https://llm-api-staging.us01.treasuredata.com','7288622HuZIHY','https://delivery-api-staging.treasuredata.co.jp','https://api-workflow.ap02.treasuredata.com','7dgyXzS','/ce','/result','/app/es/','https://console-staging-next.treasuredata.co.jp','https://delivery-api.eu01.treasuredata.com','https://api.treasuredata.co.jp','/tc','https://llm-proxy.treasuredata.co.jp','16PpwSZA','3ilSJBt','https://api-staging-presto.treasuredata.com','/ooc/','1041472zXYZfn','https://console-staging.us01.treasuredata.com','https://api-cdp.ap03.treasuredata.com','https://console.','https://llm-api.treasuredata.com','https://api-development-cdp.us01.treasuredata.com','https://llm-api.ap03.treasuredata.com','https://llm-proxy.ap03.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','https://llm-proxy.us01.treasuredata.com','/ag/','https://delivery-api.ap02.treasuredata.com','https://api-cdp.ap02.treasuredata.com','https://api.ap02.treasuredata.com','https://api.eu01.treasuredata.com','https://api-presto.ap02.treasuredata.com','https://llm-api-staging.treasuredata.co.jp','No\x20LLM\x20Proxy\x20endpoint\x20for\x20site:\x20','https://api-cdp.treasuredata.co.jp','https://api-workflow.eu01.treasuredata.com','\x27\x20and\x20site\x20\x27','https://delivery-api.ap03.treasuredata.com','https://console-staging.ap03.treasuredata.com','https://api-development-presto.treasuredata.com','https://api-workflow.treasuredata.com','/app/af/','https://llm-proxy-staging.us01.treasuredata.com','/app/workflows/','https://api.ap03.treasuredata.com','https://engage-api-development.us01.treasuredata.com','https://engage-api.ap02.treasuredata.com'];a91_0x49fb=function(){return _0x23c59b;};return a91_0x49fb();}export const TRINO_ENDPOINTS={'us01':'https://api-presto.treasuredata.com','ap01':a91_0xc19328(0x130),'eu01':a91_0xc19328(0x114),'ap02':a91_0xc19328(0x100),'ap03':a91_0xc19328(0x128),'dev-us01':a91_0xc19328(0x108),'dev-eu01':'https://api-development-presto.eu01.treasuredata.com','stg-us01':a91_0xc19328(0x157),'stg-ap01':a91_0xc19328(0xf9),'stg-ap03':a91_0xc19328(0x12e)};export const LLM_ENDPOINTS={'us01':a91_0xc19328(0xf5),'ap01':'https://llm-api.treasuredata.co.jp','eu01':a91_0xc19328(0x127),'ap02':a91_0xc19328(0x124),'ap03':a91_0xc19328(0xf7),'dev-us01':'https://llm-api-development.us01.treasuredata.com','dev-eu01':a91_0xc19328(0x134),'stg-us01':a91_0xc19328(0x148),'stg-ap01':a91_0xc19328(0x101),'stg-ap03':a91_0xc19328(0x135)};export const LLM_PROXY_ENDPOINTS={'us01':a91_0xc19328(0xfa),'ap01':a91_0xc19328(0x154),'eu01':a91_0xc19328(0x133),'ap02':a91_0xc19328(0x144),'ap03':a91_0xc19328(0xf8),'dev-us01':'https://llm-proxy-development.us01.treasuredata.com','dev-eu01':a91_0xc19328(0x145),'stg-us01':a91_0xc19328(0x10b),'stg-ap01':a91_0xc19328(0x136),'stg-ap03':a91_0xc19328(0x122)};export const ENGAGE_ENDPOINTS={'us01':'https://engage-api.treasuredata.com','ap01':a91_0xc19328(0x12a),'eu01':'https://engage-api.eu01.treasuredata.com','ap02':a91_0xc19328(0x10f),'ap03':'https://engage-api.ap03.treasuredata.com','dev-us01':a91_0xc19328(0x10e),'dev-eu01':'https://engage-api-development.eu01.treasuredata.com','stg-us01':a91_0xc19328(0x123),'stg-ap01':'https://engage-api-staging.treasuredata.co.jp','stg-ap03':'https://engage-api-staging.ap03.treasuredata.com'};export const DELIVERY_ENDPOINTS={'us01':a91_0xc19328(0x13c),'ap01':'https://delivery-api.treasuredata.co.jp','eu01':a91_0xc19328(0x151),'ap02':a91_0xc19328(0xfc),'ap03':a91_0xc19328(0x106),'dev-us01':a91_0xc19328(0x13b),'dev-eu01':'https://delivery-api-development.eu01.treasuredata.com','stg-us01':a91_0xc19328(0x12d),'stg-ap01':a91_0xc19328(0x14a),'stg-ap03':'https://delivery-api-staging.ap03.treasuredata.com'};export function getDeliveryEndpoint(_0x54c3a0){const _0x21978e=DELIVERY_ENDPOINTS[_0x54c3a0];if(!_0x21978e)throw new Error('No\x20Delivery\x20API\x20endpoint\x20for\x20site:\x20'+_0x54c3a0);return _0x21978e;}export const CONSOLE_ENDPOINTS={'us01':a91_0xc19328(0x126),'ap01':a91_0xc19328(0x12c),'eu01':a91_0xc19328(0x147),'ap02':a91_0xc19328(0x140),'ap03':a91_0xc19328(0x113),'dev-us01':a91_0xc19328(0x11a),'dev-eu01':'https://console-development.eu01.treasuredata.com','stg-us01':a91_0xc19328(0xf2),'stg-ap01':a91_0xc19328(0x12b),'stg-ap03':a91_0xc19328(0x107)};export const CONSOLE_NEXT_ENDPOINTS={'us01':a91_0xc19328(0x11f),'ap01':a91_0xc19328(0x137),'eu01':a91_0xc19328(0x142),'ap02':'https://console-next.ap02.treasuredata.com','ap03':a91_0xc19328(0x12f),'dev-us01':a91_0xc19328(0x143),'dev-eu01':a91_0xc19328(0x13e),'stg-us01':'https://console-staging-next.us01.treasuredata.com','stg-ap01':a91_0xc19328(0x150),'stg-ap03':a91_0xc19328(0x117)};export function getConsoleUrl(_0x400954,_0x4a1576){const _0x4f2292=a91_0xc19328,_0x2d997c=CONSOLE_ENDPOINTS[_0x400954]||_0x4f2292(0xf4)+_0x400954+_0x4f2292(0x13f);return _0x4a1576?''+_0x2d997c+_0x4a1576:_0x2d997c;}export function getConsoleNextUrl(_0x3fc2d,_0x1961d0){const _0x290e97=a91_0xc19328,_0x3e8ee5=CONSOLE_NEXT_ENDPOINTS[_0x3fc2d]||_0x290e97(0x121)+_0x3fc2d+_0x290e97(0x13f);return _0x1961d0?''+_0x3e8ee5+_0x1961d0:_0x3e8ee5;}export function getLLMProjectUrl(_0x30121d,_0x4e1763){return getConsoleNextUrl(_0x30121d,'/app/af/'+_0x4e1763+'/ag');}export function getLLMAgentChatUrl(_0x49717f,_0x382b66,_0x345507){const _0x9c1f67=a91_0xc19328;return getConsoleNextUrl(_0x49717f,_0x9c1f67(0x10a)+_0x382b66+_0x9c1f67(0xfb)+_0x345507+_0x9c1f67(0x153));}function a91_0xf203(_0x2e8c31,_0x2ae484){_0x2e8c31=_0x2e8c31-0xf1;const _0x49fba1=a91_0x49fb();let _0xf203b2=_0x49fba1[_0x2e8c31];return _0xf203b2;}export function getLLMConversationUrl(_0x116693,_0x447c6a,_0x1cdaf1,_0x561b77){const _0x303fc6=a91_0xc19328;return getConsoleNextUrl(_0x116693,_0x303fc6(0x10a)+_0x447c6a+_0x303fc6(0xfb)+_0x1cdaf1+_0x303fc6(0x13a)+_0x561b77);}export function getWorkflowUrl(_0x400a05,_0x4674fa){return getConsoleUrl(_0x400a05,'/app/workflows/'+_0x4674fa+'/info');}export function getWorkflowSessionUrl(_0x112774,_0x3b15a9,_0x4aabdf){const _0x4bc271=a91_0xc19328;return getConsoleUrl(_0x112774,_0x4bc271(0x10c)+_0x3b15a9+_0x4bc271(0x119)+_0x4aabdf);}export function getWorkflowAttemptUrl(_0x473419,_0x45f76e,_0xf28dc4,_0x980041){const _0x3e9d84=a91_0xc19328;return getConsoleUrl(_0x473419,'/app/workflows/'+_0x45f76e+_0x3e9d84(0x119)+_0xf28dc4+_0x3e9d84(0x138)+_0x980041);}export function getCampaignUrl(_0x1d37ae,_0xde0988,_0x4e398b){const _0x56a6e2=a91_0xc19328;return getConsoleNextUrl(_0x1d37ae,_0x56a6e2(0x14f)+_0xde0988+_0x56a6e2(0x158)+_0x4e398b);}export function getTemplateUrl(_0x19726a,_0x34210c,_0x420427){const _0x39c717=a91_0xc19328;return getConsoleNextUrl(_0x19726a,_0x39c717(0x14f)+_0x34210c+'/em/'+_0x420427+_0x39c717(0x14d));}export function getJobUrl(_0x107113,_0x49276c){const _0x5dc679=a91_0xc19328;return getConsoleNextUrl(_0x107113,'/app/jobs/'+_0x49276c+_0x5dc679(0x14e));}export function getWorkspaceUrl(_0x40b8a4,_0x3e02df){const _0x73b9=a91_0xc19328;return getConsoleNextUrl(_0x40b8a4,_0x73b9(0x14f)+_0x3e02df);}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(_0x4c90ad){const _0xbda2cf=a91_0xc19328,_0x4e030b=LLM_PROXY_ENDPOINTS[_0x4c90ad];if(!_0x4e030b)throw new Error(_0xbda2cf(0x102)+_0x4c90ad);return _0x4e030b;}export function getEndpoint(_0x4968bb,_0x1f8bfb='td'){const _0x4db722=a91_0xc19328,_0x362894=API_ENDPOINTS[_0x1f8bfb]?.[_0x4968bb];if(!_0x362894)throw new Error(_0x4db722(0x115)+_0x1f8bfb+_0x4db722(0x105)+_0x4968bb+'\x27');return _0x362894;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a92_0x569926=a92_0x8107;(function(_0x2cbdcf,_0x408ac4){const _0x452b3c=a92_0x8107,_0x23f828=_0x2cbdcf();while(!![]){try{const _0x2eb613=-parseInt(_0x452b3c(0xc0))/0x1*(parseInt(_0x452b3c(0x82))/0x2)+-parseInt(_0x452b3c(0x99))/0x3+parseInt(_0x452b3c(0x8f))/0x4*(-parseInt(_0x452b3c(0x86))/0x5)+parseInt(_0x452b3c(0x92))/0x6+parseInt(_0x452b3c(0x85))/0x7*(-parseInt(_0x452b3c(0x6a))/0x8)+-parseInt(_0x452b3c(0xa8))/0x9*(-parseInt(_0x452b3c(0xaf))/0xa)+-parseInt(_0x452b3c(0xb5))/0xb*(-parseInt(_0x452b3c(0x95))/0xc);if(_0x2eb613===_0x408ac4)break;else _0x23f828['push'](_0x23f828['shift']());}catch(_0x4e698e){_0x23f828['push'](_0x23f828['shift']());}}}(a92_0x435e,0xc1cb3));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';function a92_0x8107(_0x49718d,_0x4b1d7e){_0x49718d=_0x49718d-0x6a;const _0x435e78=a92_0x435e();let _0x8107ab=_0x435e78[_0x49718d];return _0x8107ab;}function a92_0x435e(){const _0x4ccbdc=['createTemplate','page[limit]','getTemplate','POST','duplicateCampaign','33aCAepj','workspaceId','filter[status]','/api/email_templates?','application/json','filter[workspaceId]','getWorkspace','GET','/api/campaigns/','always_on_campaigns','pause','254075YnKaUg','updateWorkspace','3208jXMkfK','/duplicate','/api/workspaces/','workspaces','listCampaigns','campaigns','include','/launch','createCampaign','listAlwaysOnCampaigns','/api/email_templates/','PATCH','DELETE','/always_on_campaigns','launch','createAlwaysOnCampaign','getCampaign','filter[owner_user.name]','stringify','/always_on_campaigns/','request','campaignType','finishAlwaysOnCampaign','status','2UShnVe','httpClient','/api/workspaces','27286OtKseO','1380iINCMj','createWorkspace','ownerName','deleteCampaign','apiKey','resume','performAlwaysOnCampaignAction','site','append','13732kKulqp','filter[name]','updateAlwaysOnCampaign','1249812xgqXxn','/api/email_templates','updateCampaign','15533052TZWKzj','/api/campaigns','offset','accessToken','1685097gqMwba','deleteAlwaysOnCampaign','/pause','launchAlwaysOnCampaign','limit','name','/resume','pauseCampaign','sort','toString','resumeAlwaysOnCampaign','/api/workspaces?','page[offset]','resumeCampaign','pauseAlwaysOnCampaign','18oxksxm','getAlwaysOnCampaign','updateTemplate','emailTemplates','/api/campaigns?','filter[campaignType]','application/vnd.api+json','142970EUdTVj'];a92_0x435e=function(){return _0x4ccbdc;};return a92_0x435e();}export class EngageApiClient{[a92_0x569926(0x83)];constructor(_0x11626a){const _0x5a015d=a92_0x569926,_0x1b5be6=getEndpoint(_0x11626a[_0x5a015d(0x8d)],'engage'),_0x165080=toHeaderRecord(getAuthHeaders(_0x11626a[_0x5a015d(0x8d)],_0x11626a[_0x5a015d(0x8a)],_0x11626a[_0x5a015d(0x98)]));this[_0x5a015d(0x83)]=new HTTPClient(_0x1b5be6,_0x165080,{'proxy':_0x11626a['proxy']});}async[a92_0x569926(0x6e)](_0x416393={}){const _0x241fe5=a92_0x569926,_0x474dd5=new URLSearchParams();_0x416393['campaignType']&&_0x474dd5['append'](_0x241fe5(0xad),_0x416393[_0x241fe5(0x7f)]);_0x416393[_0x241fe5(0x81)]&&_0x474dd5['append']('filter[status]',_0x416393[_0x241fe5(0x81)]);_0x416393[_0x241fe5(0xb6)]&&_0x474dd5[_0x241fe5(0x8e)](_0x241fe5(0xba),_0x416393[_0x241fe5(0xb6)]);_0x416393[_0x241fe5(0x9d)]!==undefined&&_0x474dd5[_0x241fe5(0x8e)](_0x241fe5(0xb1),_0x416393[_0x241fe5(0x9d)]['toString']());_0x416393[_0x241fe5(0x97)]!==undefined&&_0x474dd5[_0x241fe5(0x8e)](_0x241fe5(0xa5),_0x416393[_0x241fe5(0x97)][_0x241fe5(0xa2)]());_0x416393[_0x241fe5(0xa1)]&&_0x474dd5[_0x241fe5(0x8e)](_0x241fe5(0xa1),_0x416393[_0x241fe5(0xa1)]);_0x416393['include']&&_0x474dd5['append'](_0x241fe5(0x70),_0x416393[_0x241fe5(0x70)]);const _0x30f513=_0x474dd5[_0x241fe5(0xa2)](),_0x54b5b6=_0x30f513?_0x241fe5(0xac)+_0x30f513:_0x241fe5(0x96);return await this['httpClient'][_0x241fe5(0x7e)](_0x241fe5(0xbc),_0x54b5b6,{'headers':{'Accept':_0x241fe5(0xae)}});}async[a92_0x569926(0x7a)](_0x2dbb8c){const _0x4026e7=a92_0x569926;return await this[_0x4026e7(0x83)][_0x4026e7(0x7e)]('GET','/api/campaigns/'+encodeURIComponent(_0x2dbb8c),{'headers':{'Accept':_0x4026e7(0xae)}});}async[a92_0x569926(0x72)](_0x19eeca){const _0x489b13=a92_0x569926,_0x34f8a3={'data':{'type':_0x489b13(0x6f),'attributes':_0x19eeca}};return await this[_0x489b13(0x83)][_0x489b13(0x7e)](_0x489b13(0xb3),_0x489b13(0x96),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':JSON['stringify'](_0x34f8a3)});}async[a92_0x569926(0x94)](_0x5af817,_0x16653b){const _0x3eb7a5=a92_0x569926,_0x4e0cac={'data':{'type':_0x3eb7a5(0x6f),'id':_0x5af817,'attributes':_0x16653b}};return await this['httpClient']['request']('PATCH',_0x3eb7a5(0xbd)+encodeURIComponent(_0x5af817),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':JSON[_0x3eb7a5(0x7c)](_0x4e0cac)});}async[a92_0x569926(0x89)](_0x37eaf8){const _0x2f7cf5=a92_0x569926;await this[_0x2f7cf5(0x83)][_0x2f7cf5(0x7e)](_0x2f7cf5(0x76),_0x2f7cf5(0xbd)+encodeURIComponent(_0x37eaf8),{'headers':{'Accept':_0x2f7cf5(0xae)}});}async['launchCampaign'](_0x47e492){const _0x4c9bdd=a92_0x569926;await this['httpClient']['request'](_0x4c9bdd(0xb3),_0x4c9bdd(0xbd)+encodeURIComponent(_0x47e492)+_0x4c9bdd(0x71),{'headers':{'Content-Type':'application/json','Accept':_0x4c9bdd(0xb9)},'body':JSON[_0x4c9bdd(0x7c)]({})});}async[a92_0x569926(0xa0)](_0x2bd3e1){const _0x14036c=a92_0x569926;await this[_0x14036c(0x83)][_0x14036c(0x7e)](_0x14036c(0xb3),_0x14036c(0xbd)+encodeURIComponent(_0x2bd3e1)+_0x14036c(0x9b),{'headers':{'Content-Type':_0x14036c(0xb9),'Accept':'application/json'},'body':JSON[_0x14036c(0x7c)]({})});}async[a92_0x569926(0xa6)](_0x359060){const _0x372a7c=a92_0x569926;await this[_0x372a7c(0x83)][_0x372a7c(0x7e)](_0x372a7c(0xb3),_0x372a7c(0xbd)+encodeURIComponent(_0x359060)+_0x372a7c(0x9f),{'headers':{'Content-Type':_0x372a7c(0xb9),'Accept':_0x372a7c(0xb9)},'body':JSON['stringify']({})});}async[a92_0x569926(0xb4)](_0x47489a){const _0x411db9=a92_0x569926;return await this[_0x411db9(0x83)][_0x411db9(0x7e)]('POST','/api/campaigns/'+encodeURIComponent(_0x47489a)+_0x411db9(0x6b),{'headers':{'Content-Type':_0x411db9(0xb9),'Accept':'application/vnd.api+json'},'body':JSON[_0x411db9(0x7c)]({})});}async['listTemplates'](_0x692ae4={}){const _0x4ea332=a92_0x569926,_0x359b7b=new URLSearchParams();_0x692ae4[_0x4ea332(0xb6)]&&_0x359b7b[_0x4ea332(0x8e)](_0x4ea332(0xba),_0x692ae4[_0x4ea332(0xb6)]);_0x692ae4[_0x4ea332(0x9d)]!==undefined&&_0x359b7b['append'](_0x4ea332(0xb1),_0x692ae4[_0x4ea332(0x9d)][_0x4ea332(0xa2)]());_0x692ae4[_0x4ea332(0x97)]!==undefined&&_0x359b7b[_0x4ea332(0x8e)](_0x4ea332(0xa5),_0x692ae4[_0x4ea332(0x97)][_0x4ea332(0xa2)]());_0x692ae4[_0x4ea332(0xa1)]&&_0x359b7b[_0x4ea332(0x8e)](_0x4ea332(0xa1),_0x692ae4[_0x4ea332(0xa1)]);const _0x15ec03=_0x359b7b[_0x4ea332(0xa2)](),_0x2f5381=_0x15ec03?_0x4ea332(0xb8)+_0x15ec03:'/api/email_templates';return await this['httpClient'][_0x4ea332(0x7e)](_0x4ea332(0xbc),_0x2f5381,{'headers':{'Accept':_0x4ea332(0xae)}});}async[a92_0x569926(0xb2)](_0x3df1d4){const _0x31bd0f=a92_0x569926;return await this[_0x31bd0f(0x83)][_0x31bd0f(0x7e)]('GET',_0x31bd0f(0x74)+encodeURIComponent(_0x3df1d4),{'headers':{'Accept':_0x31bd0f(0xae)}});}async[a92_0x569926(0xb0)](_0x577754){const _0x370501=a92_0x569926,_0x1e7720={'data':{'type':_0x370501(0xab),'attributes':_0x577754}};return await this[_0x370501(0x83)]['request'](_0x370501(0xb3),_0x370501(0x93),{'headers':{'Content-Type':_0x370501(0xae),'Accept':_0x370501(0xae)},'body':JSON['stringify'](_0x1e7720)});}async[a92_0x569926(0xaa)](_0x4f52c5,_0x4927bd){const _0x48d21f=a92_0x569926,_0x21addc={'data':{'type':_0x48d21f(0xab),'id':_0x4f52c5,'attributes':_0x4927bd}};return await this[_0x48d21f(0x83)][_0x48d21f(0x7e)](_0x48d21f(0x75),_0x48d21f(0x74)+encodeURIComponent(_0x4f52c5),{'headers':{'Content-Type':_0x48d21f(0xae),'Accept':_0x48d21f(0xae)},'body':JSON[_0x48d21f(0x7c)](_0x21addc)});}async['deleteTemplate'](_0x3d944a){const _0x140d4c=a92_0x569926;await this[_0x140d4c(0x83)][_0x140d4c(0x7e)]('DELETE',_0x140d4c(0x74)+encodeURIComponent(_0x3d944a),{'headers':{'Accept':'application/vnd.api+json'}});}async['listWorkspaces'](_0x2fb566={}){const _0x11b81e=a92_0x569926,_0x843093=new URLSearchParams();_0x2fb566[_0x11b81e(0x9e)]&&_0x843093[_0x11b81e(0x8e)](_0x11b81e(0x90),_0x2fb566[_0x11b81e(0x9e)]);_0x2fb566['ownerName']&&_0x843093[_0x11b81e(0x8e)](_0x11b81e(0x7b),_0x2fb566[_0x11b81e(0x88)]);_0x2fb566[_0x11b81e(0x9d)]!==undefined&&_0x843093[_0x11b81e(0x8e)](_0x11b81e(0xb1),_0x2fb566[_0x11b81e(0x9d)][_0x11b81e(0xa2)]());_0x2fb566[_0x11b81e(0x97)]!==undefined&&_0x843093[_0x11b81e(0x8e)](_0x11b81e(0xa5),_0x2fb566[_0x11b81e(0x97)][_0x11b81e(0xa2)]());_0x2fb566[_0x11b81e(0xa1)]&&_0x843093[_0x11b81e(0x8e)]('sort',_0x2fb566[_0x11b81e(0xa1)]);const _0x53c2d5=_0x843093[_0x11b81e(0xa2)](),_0x153ec9=_0x53c2d5?_0x11b81e(0xa4)+_0x53c2d5:_0x11b81e(0x84);return await this[_0x11b81e(0x83)][_0x11b81e(0x7e)](_0x11b81e(0xbc),_0x153ec9,{'headers':{'Accept':_0x11b81e(0xae)}});}async[a92_0x569926(0xbb)](_0x5cd5ad){const _0x5788f2=a92_0x569926;return await this[_0x5788f2(0x83)][_0x5788f2(0x7e)](_0x5788f2(0xbc),_0x5788f2(0x6c)+encodeURIComponent(_0x5cd5ad),{'headers':{'Accept':_0x5788f2(0xae)}});}async[a92_0x569926(0x87)](_0x24dafc){const _0x1df25d=a92_0x569926,_0xe68539={'data':{'type':'workspaces','attributes':_0x24dafc}};return await this[_0x1df25d(0x83)]['request'](_0x1df25d(0xb3),_0x1df25d(0x84),{'headers':{'Content-Type':_0x1df25d(0xae),'Accept':_0x1df25d(0xae)},'body':JSON[_0x1df25d(0x7c)](_0xe68539)});}async[a92_0x569926(0xc1)](_0x151d81,_0x3b85dc){const _0xbfc2fb=a92_0x569926,_0x583c15={'data':{'type':_0xbfc2fb(0x6d),'id':_0x151d81,'attributes':_0x3b85dc}};return await this[_0xbfc2fb(0x83)][_0xbfc2fb(0x7e)]('PATCH','/api/workspaces/'+encodeURIComponent(_0x151d81),{'headers':{'Content-Type':_0xbfc2fb(0xae),'Accept':_0xbfc2fb(0xae)},'body':JSON['stringify'](_0x583c15)});}async['deleteWorkspace'](_0x528faf){const _0x126e7f=a92_0x569926;await this[_0x126e7f(0x83)][_0x126e7f(0x7e)]('DELETE',_0x126e7f(0x6c)+encodeURIComponent(_0x528faf),{'headers':{'Accept':_0x126e7f(0xae)}});}async[a92_0x569926(0x73)](_0x57adea,_0x2d1df6={}){const _0x4fde0b=a92_0x569926,_0x17717e=new URLSearchParams();_0x2d1df6['campaignType']&&_0x17717e[_0x4fde0b(0x8e)]('filter[campaignType]',_0x2d1df6[_0x4fde0b(0x7f)]);_0x2d1df6[_0x4fde0b(0x81)]&&_0x17717e[_0x4fde0b(0x8e)](_0x4fde0b(0xb7),_0x2d1df6[_0x4fde0b(0x81)]);_0x2d1df6[_0x4fde0b(0x9d)]!==undefined&&_0x17717e[_0x4fde0b(0x8e)](_0x4fde0b(0xb1),_0x2d1df6['limit'][_0x4fde0b(0xa2)]());_0x2d1df6['offset']!==undefined&&_0x17717e['append']('page[offset]',_0x2d1df6[_0x4fde0b(0x97)]['toString']());_0x2d1df6[_0x4fde0b(0xa1)]&&_0x17717e[_0x4fde0b(0x8e)](_0x4fde0b(0xa1),_0x2d1df6[_0x4fde0b(0xa1)]);const _0x4cbbad=_0x17717e[_0x4fde0b(0xa2)](),_0x13c4c6=_0x4fde0b(0x6c)+encodeURIComponent(_0x57adea)+_0x4fde0b(0x77)+(_0x4cbbad?'?'+_0x4cbbad:'');return await this[_0x4fde0b(0x83)][_0x4fde0b(0x7e)]('GET',_0x13c4c6,{'headers':{'Accept':_0x4fde0b(0xae)}});}async[a92_0x569926(0xa9)](_0x5ca3dc,_0x51708f){const _0x15f3f5=a92_0x569926;return await this['httpClient']['request'](_0x15f3f5(0xbc),_0x15f3f5(0x6c)+encodeURIComponent(_0x5ca3dc)+'/always_on_campaigns/'+encodeURIComponent(_0x51708f),{'headers':{'Accept':'application/vnd.api+json'}});}async[a92_0x569926(0x79)](_0x494837,_0x2fa60b){const _0x584d32=a92_0x569926,_0x514b94={'data':{'type':'always_on_campaigns','attributes':_0x2fa60b}};return await this['httpClient']['request'](_0x584d32(0xb3),_0x584d32(0x6c)+encodeURIComponent(_0x494837)+_0x584d32(0x77),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x584d32(0xae)},'body':JSON[_0x584d32(0x7c)](_0x514b94)});}async[a92_0x569926(0x91)](_0x4d7da9,_0x14bb35,_0x1e586d){const _0x3bc418=a92_0x569926,_0x300ae7={'data':{'type':_0x3bc418(0xbe),'id':_0x14bb35,'attributes':_0x1e586d}};return await this[_0x3bc418(0x83)][_0x3bc418(0x7e)](_0x3bc418(0x75),_0x3bc418(0x6c)+encodeURIComponent(_0x4d7da9)+_0x3bc418(0x7d)+encodeURIComponent(_0x14bb35),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x3bc418(0xae)},'body':JSON[_0x3bc418(0x7c)](_0x300ae7)});}async[a92_0x569926(0x9a)](_0x291229,_0x1c615a){const _0x15bfd8=a92_0x569926;await this[_0x15bfd8(0x83)]['request']('DELETE','/api/workspaces/'+encodeURIComponent(_0x291229)+_0x15bfd8(0x7d)+encodeURIComponent(_0x1c615a),{'headers':{'Accept':_0x15bfd8(0xae)}});}async[a92_0x569926(0x8c)](_0x106260,_0x510583,_0x1bceec){const _0x47bd15=a92_0x569926;await this[_0x47bd15(0x83)][_0x47bd15(0x7e)](_0x47bd15(0xb3),_0x47bd15(0x6c)+encodeURIComponent(_0x106260)+_0x47bd15(0x7d)+encodeURIComponent(_0x510583)+'/'+_0x1bceec,{'headers':{'Content-Type':_0x47bd15(0xb9),'Accept':'application/json'},'body':JSON[_0x47bd15(0x7c)]({})});}async[a92_0x569926(0x9c)](_0x3df875,_0xd357f4){const _0x4182f9=a92_0x569926;await this[_0x4182f9(0x8c)](_0x3df875,_0xd357f4,_0x4182f9(0x78));}async[a92_0x569926(0xa7)](_0xdba73e,_0x272f05){const _0xc3af1=a92_0x569926;await this[_0xc3af1(0x8c)](_0xdba73e,_0x272f05,_0xc3af1(0xbf));}async[a92_0x569926(0xa3)](_0x1c1d25,_0x1e7283){const _0x4ce8a1=a92_0x569926;await this['performAlwaysOnCampaignAction'](_0x1c1d25,_0x1e7283,_0x4ce8a1(0x8b));}async[a92_0x569926(0x80)](_0x2a9f7d,_0x394363){const _0xa50ed9=a92_0x569926;await this[_0xa50ed9(0x8c)](_0x2a9f7d,_0x394363,'finish');}async['duplicateAlwaysOnCampaign'](_0x344d47,_0x56b202,_0x21ab3b){const _0x5bfdfa=a92_0x569926,_0x1d3222=_0x21ab3b?{'data':{'attributes':{'name':_0x21ab3b}}}:{};return await this[_0x5bfdfa(0x83)][_0x5bfdfa(0x7e)](_0x5bfdfa(0xb3),_0x5bfdfa(0x6c)+encodeURIComponent(_0x344d47)+'/always_on_campaigns/'+encodeURIComponent(_0x56b202)+_0x5bfdfa(0x6b),{'headers':{'Content-Type':'application/json','Accept':_0x5bfdfa(0xae)},'body':JSON[_0x5bfdfa(0x7c)](_0x1d3222)});}}
|
|
1
|
+
const a92_0x316289=a92_0x2b19;(function(_0x40ee70,_0x35f4d5){const _0x502630=a92_0x2b19,_0x3063a5=_0x40ee70();while(!![]){try{const _0x479f3b=-parseInt(_0x502630(0x1f1))/0x1*(parseInt(_0x502630(0x1e3))/0x2)+parseInt(_0x502630(0x1f2))/0x3+-parseInt(_0x502630(0x217))/0x4*(parseInt(_0x502630(0x1f9))/0x5)+parseInt(_0x502630(0x219))/0x6*(-parseInt(_0x502630(0x218))/0x7)+-parseInt(_0x502630(0x1da))/0x8*(-parseInt(_0x502630(0x1e4))/0x9)+parseInt(_0x502630(0x209))/0xa*(-parseInt(_0x502630(0x1ee))/0xb)+parseInt(_0x502630(0x1ed))/0xc;if(_0x479f3b===_0x35f4d5)break;else _0x3063a5['push'](_0x3063a5['shift']());}catch(_0x5e2b88){_0x3063a5['push'](_0x3063a5['shift']());}}}(a92_0x2950,0xc36f0));function a92_0x2950(){const _0x15a3b0=['5845540TYwljZ','37954rUzOWx','180kIRGkK','/api/campaigns?','listTemplates','performAlwaysOnCampaignAction','pauseAlwaysOnCampaign','application/json','deleteAlwaysOnCampaign','page[limit]','/duplicate','/always_on_campaigns/','createTemplate','engage','pauseCampaign','sort','/api/email_templates/','filter[owner_user.name]','append','/api/campaigns/','368048XtSZZX','GET','/api/campaigns','always_on_campaigns','createCampaign','workspaceId','campaigns','POST','filter[workspaceId]','200972IujwFC','54mPonMY','getTemplate','duplicateCampaign','/api/workspaces/','getCampaign','listCampaigns','site','httpClient','PATCH','37707720EuQwoz','11733227GhKcys','toString','launchAlwaysOnCampaign','3LEbMKe','1122930gnEwol','pause','getWorkspace','limit','/api/workspaces?','ownerName','apiKey','5pLyqZp','/resume','listAlwaysOnCampaigns','/api/email_templates?','request','page[offset]','updateCampaign','/pause','deleteWorkspace','deleteTemplate','proxy','stringify','/launch','launchCampaign','offset','filter[status]','10uvAocQ','resumeCampaign','include','updateWorkspace','/api/email_templates','application/vnd.api+json','filter[campaignType]','DELETE','workspaces','resumeAlwaysOnCampaign','campaignType','name','status','/always_on_campaigns'];a92_0x2950=function(){return _0x15a3b0;};return a92_0x2950();}import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';function a92_0x2b19(_0x4a17ac,_0x199d61){_0x4a17ac=_0x4a17ac-0x1cf;const _0x2950c6=a92_0x2950();let _0x2b1905=_0x2950c6[_0x4a17ac];return _0x2b1905;}import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class EngageApiClient{[a92_0x316289(0x1eb)];constructor(_0x423fbe){const _0x2152a7=a92_0x316289,_0x16a9a4=getEndpoint(_0x423fbe[_0x2152a7(0x1ea)],_0x2152a7(0x1d3)),_0x24428b=toHeaderRecord(getAuthHeaders(_0x423fbe['site'],_0x423fbe[_0x2152a7(0x1f8)],_0x423fbe['accessToken']));this[_0x2152a7(0x1eb)]=new HTTPClient(_0x16a9a4,_0x24428b,{'proxy':_0x423fbe[_0x2152a7(0x203)]});}async[a92_0x316289(0x1e9)](_0x5bf6ad={}){const _0x3b8162=a92_0x316289,_0x41eca0=new URLSearchParams();_0x5bf6ad['campaignType']&&_0x41eca0['append'](_0x3b8162(0x20f),_0x5bf6ad[_0x3b8162(0x213)]);_0x5bf6ad[_0x3b8162(0x215)]&&_0x41eca0[_0x3b8162(0x1d8)]('filter[status]',_0x5bf6ad['status']);_0x5bf6ad[_0x3b8162(0x1df)]&&_0x41eca0[_0x3b8162(0x1d8)]('filter[workspaceId]',_0x5bf6ad['workspaceId']);_0x5bf6ad[_0x3b8162(0x1f5)]!==undefined&&_0x41eca0[_0x3b8162(0x1d8)](_0x3b8162(0x1cf),_0x5bf6ad[_0x3b8162(0x1f5)][_0x3b8162(0x1ef)]());_0x5bf6ad['offset']!==undefined&&_0x41eca0[_0x3b8162(0x1d8)](_0x3b8162(0x1fe),_0x5bf6ad['offset'][_0x3b8162(0x1ef)]());_0x5bf6ad[_0x3b8162(0x1d5)]&&_0x41eca0[_0x3b8162(0x1d8)]('sort',_0x5bf6ad[_0x3b8162(0x1d5)]);_0x5bf6ad[_0x3b8162(0x20b)]&&_0x41eca0[_0x3b8162(0x1d8)](_0x3b8162(0x20b),_0x5bf6ad[_0x3b8162(0x20b)]);const _0x3049d7=_0x41eca0[_0x3b8162(0x1ef)](),_0x222da3=_0x3049d7?_0x3b8162(0x21a)+_0x3049d7:'/api/campaigns';return await this[_0x3b8162(0x1eb)]['request']('GET',_0x222da3,{'headers':{'Accept':'application/vnd.api+json'}});}async[a92_0x316289(0x1e8)](_0x14b582){const _0x183821=a92_0x316289;return await this[_0x183821(0x1eb)][_0x183821(0x1fd)](_0x183821(0x1db),'/api/campaigns/'+encodeURIComponent(_0x14b582),{'headers':{'Accept':'application/vnd.api+json'}});}async[a92_0x316289(0x1de)](_0x344822){const _0x58edbc=a92_0x316289,_0x3f72ef={'data':{'type':_0x58edbc(0x1e0),'attributes':_0x344822}};return await this['httpClient'][_0x58edbc(0x1fd)](_0x58edbc(0x1e1),_0x58edbc(0x1dc),{'headers':{'Content-Type':_0x58edbc(0x20e),'Accept':_0x58edbc(0x20e)},'body':JSON[_0x58edbc(0x204)](_0x3f72ef)});}async[a92_0x316289(0x1ff)](_0x15d4d1,_0x53a3f2){const _0x1a5943=a92_0x316289,_0x3a6d5e={'data':{'type':_0x1a5943(0x1e0),'id':_0x15d4d1,'attributes':_0x53a3f2}};return await this[_0x1a5943(0x1eb)]['request'](_0x1a5943(0x1ec),'/api/campaigns/'+encodeURIComponent(_0x15d4d1),{'headers':{'Content-Type':_0x1a5943(0x20e),'Accept':_0x1a5943(0x20e)},'body':JSON[_0x1a5943(0x204)](_0x3a6d5e)});}async['deleteCampaign'](_0x35820f){const _0x1b8228=a92_0x316289;await this['httpClient'][_0x1b8228(0x1fd)](_0x1b8228(0x210),_0x1b8228(0x1d9)+encodeURIComponent(_0x35820f),{'headers':{'Accept':_0x1b8228(0x20e)}});}async[a92_0x316289(0x206)](_0x24ca1c){const _0x457b6d=a92_0x316289;await this['httpClient'][_0x457b6d(0x1fd)](_0x457b6d(0x1e1),_0x457b6d(0x1d9)+encodeURIComponent(_0x24ca1c)+_0x457b6d(0x205),{'headers':{'Content-Type':'application/json','Accept':_0x457b6d(0x21e)},'body':JSON[_0x457b6d(0x204)]({})});}async[a92_0x316289(0x1d4)](_0x58ea04){const _0x15b20b=a92_0x316289;await this['httpClient'][_0x15b20b(0x1fd)]('POST',_0x15b20b(0x1d9)+encodeURIComponent(_0x58ea04)+_0x15b20b(0x200),{'headers':{'Content-Type':_0x15b20b(0x21e),'Accept':_0x15b20b(0x21e)},'body':JSON['stringify']({})});}async[a92_0x316289(0x20a)](_0x48668a){const _0x373ab9=a92_0x316289;await this[_0x373ab9(0x1eb)]['request']('POST','/api/campaigns/'+encodeURIComponent(_0x48668a)+_0x373ab9(0x1fa),{'headers':{'Content-Type':_0x373ab9(0x21e),'Accept':_0x373ab9(0x21e)},'body':JSON[_0x373ab9(0x204)]({})});}async[a92_0x316289(0x1e6)](_0x3ce37b){const _0x3d902d=a92_0x316289;return await this['httpClient'][_0x3d902d(0x1fd)](_0x3d902d(0x1e1),_0x3d902d(0x1d9)+encodeURIComponent(_0x3ce37b)+_0x3d902d(0x1d0),{'headers':{'Content-Type':_0x3d902d(0x21e),'Accept':'application/vnd.api+json'},'body':JSON[_0x3d902d(0x204)]({})});}async[a92_0x316289(0x21b)](_0x50b55f={}){const _0x560c3a=a92_0x316289,_0x230099=new URLSearchParams();_0x50b55f[_0x560c3a(0x1df)]&&_0x230099[_0x560c3a(0x1d8)](_0x560c3a(0x1e2),_0x50b55f['workspaceId']);_0x50b55f[_0x560c3a(0x1f5)]!==undefined&&_0x230099[_0x560c3a(0x1d8)](_0x560c3a(0x1cf),_0x50b55f[_0x560c3a(0x1f5)][_0x560c3a(0x1ef)]());_0x50b55f[_0x560c3a(0x207)]!==undefined&&_0x230099[_0x560c3a(0x1d8)](_0x560c3a(0x1fe),_0x50b55f[_0x560c3a(0x207)][_0x560c3a(0x1ef)]());_0x50b55f[_0x560c3a(0x1d5)]&&_0x230099[_0x560c3a(0x1d8)](_0x560c3a(0x1d5),_0x50b55f[_0x560c3a(0x1d5)]);const _0xa35295=_0x230099[_0x560c3a(0x1ef)](),_0x114496=_0xa35295?_0x560c3a(0x1fc)+_0xa35295:_0x560c3a(0x20d);return await this[_0x560c3a(0x1eb)][_0x560c3a(0x1fd)](_0x560c3a(0x1db),_0x114496,{'headers':{'Accept':'application/vnd.api+json'}});}async[a92_0x316289(0x1e5)](_0xef7e05){const _0xb127c1=a92_0x316289;return await this[_0xb127c1(0x1eb)][_0xb127c1(0x1fd)]('GET',_0xb127c1(0x1d6)+encodeURIComponent(_0xef7e05),{'headers':{'Accept':'application/vnd.api+json'}});}async[a92_0x316289(0x1d2)](_0x31648c){const _0x3e3f76=a92_0x316289,_0x1eef33={'data':{'type':'emailTemplates','attributes':_0x31648c}};return await this[_0x3e3f76(0x1eb)][_0x3e3f76(0x1fd)](_0x3e3f76(0x1e1),'/api/email_templates',{'headers':{'Content-Type':_0x3e3f76(0x20e),'Accept':_0x3e3f76(0x20e)},'body':JSON[_0x3e3f76(0x204)](_0x1eef33)});}async['updateTemplate'](_0x458a1e,_0x18e3fd){const _0x2cb121=a92_0x316289,_0x18d762={'data':{'type':'emailTemplates','id':_0x458a1e,'attributes':_0x18e3fd}};return await this[_0x2cb121(0x1eb)][_0x2cb121(0x1fd)](_0x2cb121(0x1ec),_0x2cb121(0x1d6)+encodeURIComponent(_0x458a1e),{'headers':{'Content-Type':_0x2cb121(0x20e),'Accept':_0x2cb121(0x20e)},'body':JSON[_0x2cb121(0x204)](_0x18d762)});}async[a92_0x316289(0x202)](_0x525bd4){const _0x56db20=a92_0x316289;await this[_0x56db20(0x1eb)]['request'](_0x56db20(0x210),_0x56db20(0x1d6)+encodeURIComponent(_0x525bd4),{'headers':{'Accept':_0x56db20(0x20e)}});}async['listWorkspaces'](_0x45a597={}){const _0x3157c2=a92_0x316289,_0x284664=new URLSearchParams();_0x45a597['name']&&_0x284664['append']('filter[name]',_0x45a597[_0x3157c2(0x214)]);_0x45a597[_0x3157c2(0x1f7)]&&_0x284664[_0x3157c2(0x1d8)](_0x3157c2(0x1d7),_0x45a597[_0x3157c2(0x1f7)]);_0x45a597[_0x3157c2(0x1f5)]!==undefined&&_0x284664[_0x3157c2(0x1d8)](_0x3157c2(0x1cf),_0x45a597[_0x3157c2(0x1f5)][_0x3157c2(0x1ef)]());_0x45a597[_0x3157c2(0x207)]!==undefined&&_0x284664[_0x3157c2(0x1d8)]('page[offset]',_0x45a597[_0x3157c2(0x207)][_0x3157c2(0x1ef)]());_0x45a597[_0x3157c2(0x1d5)]&&_0x284664['append']('sort',_0x45a597[_0x3157c2(0x1d5)]);const _0x49b055=_0x284664[_0x3157c2(0x1ef)](),_0x1c2ebe=_0x49b055?_0x3157c2(0x1f6)+_0x49b055:'/api/workspaces';return await this['httpClient'][_0x3157c2(0x1fd)](_0x3157c2(0x1db),_0x1c2ebe,{'headers':{'Accept':_0x3157c2(0x20e)}});}async[a92_0x316289(0x1f4)](_0x3b59d1){const _0x50b245=a92_0x316289;return await this[_0x50b245(0x1eb)]['request'](_0x50b245(0x1db),_0x50b245(0x1e7)+encodeURIComponent(_0x3b59d1),{'headers':{'Accept':_0x50b245(0x20e)}});}async['createWorkspace'](_0x5c793b){const _0x8c82b2=a92_0x316289,_0x3469ec={'data':{'type':'workspaces','attributes':_0x5c793b}};return await this[_0x8c82b2(0x1eb)][_0x8c82b2(0x1fd)](_0x8c82b2(0x1e1),'/api/workspaces',{'headers':{'Content-Type':_0x8c82b2(0x20e),'Accept':_0x8c82b2(0x20e)},'body':JSON[_0x8c82b2(0x204)](_0x3469ec)});}async[a92_0x316289(0x20c)](_0x262d71,_0x1348d8){const _0x26bf87=a92_0x316289,_0x47b015={'data':{'type':_0x26bf87(0x211),'id':_0x262d71,'attributes':_0x1348d8}};return await this['httpClient']['request'](_0x26bf87(0x1ec),'/api/workspaces/'+encodeURIComponent(_0x262d71),{'headers':{'Content-Type':_0x26bf87(0x20e),'Accept':_0x26bf87(0x20e)},'body':JSON['stringify'](_0x47b015)});}async[a92_0x316289(0x201)](_0x298deb){const _0x1049f3=a92_0x316289;await this[_0x1049f3(0x1eb)]['request']('DELETE',_0x1049f3(0x1e7)+encodeURIComponent(_0x298deb),{'headers':{'Accept':_0x1049f3(0x20e)}});}async[a92_0x316289(0x1fb)](_0x231b62,_0x233394={}){const _0x3abbf9=a92_0x316289,_0x1e5cd1=new URLSearchParams();_0x233394[_0x3abbf9(0x213)]&&_0x1e5cd1['append'](_0x3abbf9(0x20f),_0x233394[_0x3abbf9(0x213)]);_0x233394[_0x3abbf9(0x215)]&&_0x1e5cd1['append'](_0x3abbf9(0x208),_0x233394[_0x3abbf9(0x215)]);_0x233394['limit']!==undefined&&_0x1e5cd1[_0x3abbf9(0x1d8)]('page[limit]',_0x233394['limit'][_0x3abbf9(0x1ef)]());_0x233394[_0x3abbf9(0x207)]!==undefined&&_0x1e5cd1[_0x3abbf9(0x1d8)](_0x3abbf9(0x1fe),_0x233394[_0x3abbf9(0x207)][_0x3abbf9(0x1ef)]());_0x233394[_0x3abbf9(0x1d5)]&&_0x1e5cd1[_0x3abbf9(0x1d8)]('sort',_0x233394['sort']);const _0x27bb07=_0x1e5cd1[_0x3abbf9(0x1ef)](),_0x3f13ca=_0x3abbf9(0x1e7)+encodeURIComponent(_0x231b62)+'/always_on_campaigns'+(_0x27bb07?'?'+_0x27bb07:'');return await this[_0x3abbf9(0x1eb)][_0x3abbf9(0x1fd)](_0x3abbf9(0x1db),_0x3f13ca,{'headers':{'Accept':'application/vnd.api+json'}});}async['getAlwaysOnCampaign'](_0x693aa5,_0x2ea324){const _0x3c7256=a92_0x316289;return await this[_0x3c7256(0x1eb)][_0x3c7256(0x1fd)](_0x3c7256(0x1db),_0x3c7256(0x1e7)+encodeURIComponent(_0x693aa5)+_0x3c7256(0x1d1)+encodeURIComponent(_0x2ea324),{'headers':{'Accept':'application/vnd.api+json'}});}async['createAlwaysOnCampaign'](_0x381d81,_0x34cacd){const _0x11b1bf=a92_0x316289,_0x246e1b={'data':{'type':_0x11b1bf(0x1dd),'attributes':_0x34cacd}};return await this[_0x11b1bf(0x1eb)][_0x11b1bf(0x1fd)]('POST',_0x11b1bf(0x1e7)+encodeURIComponent(_0x381d81)+_0x11b1bf(0x216),{'headers':{'Content-Type':_0x11b1bf(0x20e),'Accept':_0x11b1bf(0x20e)},'body':JSON[_0x11b1bf(0x204)](_0x246e1b)});}async['updateAlwaysOnCampaign'](_0xca8300,_0x1ae535,_0x326b36){const _0x49288b=a92_0x316289,_0x825055={'data':{'type':_0x49288b(0x1dd),'id':_0x1ae535,'attributes':_0x326b36}};return await this['httpClient'][_0x49288b(0x1fd)](_0x49288b(0x1ec),_0x49288b(0x1e7)+encodeURIComponent(_0xca8300)+_0x49288b(0x1d1)+encodeURIComponent(_0x1ae535),{'headers':{'Content-Type':_0x49288b(0x20e),'Accept':_0x49288b(0x20e)},'body':JSON[_0x49288b(0x204)](_0x825055)});}async[a92_0x316289(0x21f)](_0x3cc5e7,_0x49881e){const _0x5ed61b=a92_0x316289;await this[_0x5ed61b(0x1eb)][_0x5ed61b(0x1fd)](_0x5ed61b(0x210),_0x5ed61b(0x1e7)+encodeURIComponent(_0x3cc5e7)+'/always_on_campaigns/'+encodeURIComponent(_0x49881e),{'headers':{'Accept':_0x5ed61b(0x20e)}});}async[a92_0x316289(0x21c)](_0x381256,_0x5db8c8,_0x3eb537){const _0x5743b3=a92_0x316289;await this[_0x5743b3(0x1eb)][_0x5743b3(0x1fd)]('POST',_0x5743b3(0x1e7)+encodeURIComponent(_0x381256)+_0x5743b3(0x1d1)+encodeURIComponent(_0x5db8c8)+'/'+_0x3eb537,{'headers':{'Content-Type':_0x5743b3(0x21e),'Accept':_0x5743b3(0x21e)},'body':JSON[_0x5743b3(0x204)]({})});}async[a92_0x316289(0x1f0)](_0x1c102a,_0x5453b8){const _0x1bea80=a92_0x316289;await this[_0x1bea80(0x21c)](_0x1c102a,_0x5453b8,'launch');}async[a92_0x316289(0x21d)](_0x4f63ce,_0x543fe9){const _0x4777bf=a92_0x316289;await this['performAlwaysOnCampaignAction'](_0x4f63ce,_0x543fe9,_0x4777bf(0x1f3));}async[a92_0x316289(0x212)](_0x24d302,_0x2477d5){const _0x128def=a92_0x316289;await this[_0x128def(0x21c)](_0x24d302,_0x2477d5,'resume');}async['finishAlwaysOnCampaign'](_0x4cce00,_0x19f84a){const _0xd6ad85=a92_0x316289;await this[_0xd6ad85(0x21c)](_0x4cce00,_0x19f84a,'finish');}async['duplicateAlwaysOnCampaign'](_0x3b7fae,_0x1bb949,_0x3870ce){const _0x7cd190=a92_0x316289,_0x2b57e5=_0x3870ce?{'data':{'attributes':{'name':_0x3870ce}}}:{};return await this['httpClient']['request'](_0x7cd190(0x1e1),_0x7cd190(0x1e7)+encodeURIComponent(_0x3b7fae)+_0x7cd190(0x1d1)+encodeURIComponent(_0x1bb949)+_0x7cd190(0x1d0),{'headers':{'Content-Type':'application/json','Accept':_0x7cd190(0x20e)},'body':JSON['stringify'](_0x2b57e5)});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a93_0x1c965c=a93_0x1671;(function(_0x2abe85,_0x20231c){const _0x2e3aa4=a93_0x1671,_0x4ff511=_0x2abe85();while(!![]){try{const _0x2c7305=parseInt(_0x2e3aa4(0xaf))/0x1*(parseInt(_0x2e3aa4(0xec))/0x2)+parseInt(_0x2e3aa4(0xc9))/0x3*(parseInt(_0x2e3aa4(0xf6))/0x4)+parseInt(_0x2e3aa4(0x101))/0x5*(-parseInt(_0x2e3aa4(0xd8))/0x6)+parseInt(_0x2e3aa4(0xea))/0x7+-parseInt(_0x2e3aa4(0xd9))/0x8*(-parseInt(_0x2e3aa4(0xe5))/0x9)+parseInt(_0x2e3aa4(0xbb))/0xa+-parseInt(_0x2e3aa4(0xb4))/0xb;if(_0x2c7305===_0x20231c)break;else _0x4ff511['push'](_0x4ff511['shift']());}catch(_0x3a3338){_0x4ff511['push'](_0x4ff511['shift']());}}}(a93_0x3da4,0x76c9c));function a93_0x3da4(){const _0x21100d=['proxyUrl','debug','isProxyConnectionError','status','logger','from','detail','type','toString','round','string','3207LdujMc','cause',']\x20Request\x20to\x20','then','info','status_code','Request\x20to\x20','Failed\x20to\x20connect\x20through\x20proxy\x20','ms...','INVALID_ARGUMENT','includes','forEach','PERMISSION_DENIED','HTTP_REQUEST_FAILURE','Content-Type','63636ovqVqR','88usFTYa','\x20failed:\x20','get','maskProxyCredentials','[Retry\x20','title','parseProblemDetails','****','addEventListener','safeParseJSON','retryConfig','Retry-After','263799gSXtlI','Request\x20failed\x20after\x20retries','An\x20error\x20occurred','aborted','stringify','6649237ZSocGM','dispatcher','2636qqlvdD','application/json','headers','message','statusText','\x0a\x20\x20Details:\x20','Request:\x20','combineSignals','sleep','retrying\x20in\x20','788IfcbCf','trace','baseUrl','object','tunnel','Response\x20[','Error','password','error','proxy','Request\x20cancelled\x20by\x20user','85hSXGEH','defaultHeaders','about:blank','AbortError','text','tdx.client.http','arraybuffer','407','abort','handleErrorResponse','PROXY','undici','baseDelay','Unknown\x20error',']\x20Request\x20failed\x20with\x20','PROXY_CONNECTION_FAILURE','code','HTTP\x20',']:\x20','random','length','proxyReady','maxRetries','problemDetails','username','parse','signal','warn','191bGrbvs','name','json','arrayBuffer','UNAUTHENTICATED','20906215eJzbBN','UNAVAILABLE','extractErrorMessage','request','errors','pow','NOT_FOUND','8327800CiZNoX','toLowerCase','request\x20body:\x20'];a93_0x3da4=function(){return _0x21100d;};return a93_0x3da4();}function a93_0x1671(_0x32c123,_0x2dffdb){_0x32c123=_0x32c123-0x9a;const _0x3da488=a93_0x3da4();let _0x1671fa=_0x3da488[_0x32c123];return _0x1671fa;}import{ErrorCode,SDKError}from'../errors.js';import{Logger}from'../../utils/logger/index.js';import a93_0x1a9d9c from'json-bigint';function getErrorChain(_0x131704,_0x24c3b5=0x5){const _0x2e0e15=a93_0x1671,_0xdd5db3=[_0x131704];let _0x298e0e=_0x131704;for(let _0xf8efa4=0x0;_0xf8efa4<_0x24c3b5&&_0x298e0e;_0xf8efa4++){const _0x54221b=_0x298e0e[_0x2e0e15(0xca)];if(_0x54221b instanceof Error)_0xdd5db3['push'](_0x54221b),_0x298e0e=_0x54221b;else break;}return _0xdd5db3;}function extractRootCause(_0x56a566){const _0x27a345=a93_0x1671,_0xb66d7c=getErrorChain(_0x56a566,0x4),_0x2db2e1=_0xb66d7c[_0xb66d7c[_0x27a345(0xa7)]-0x1],_0x4bf2c7=_0x2db2e1[_0x27a345(0xca)];if(_0x4bf2c7&&!(_0x4bf2c7 instanceof Error))return String(_0x4bf2c7);return _0x2db2e1[_0x27a345(0xef)]||_0x27a345(0xa0);}const DEFAULT_RETRY_CONFIG={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1f40};function isRetryableStatus(_0xd91463){return _0xd91463>=0x1f4||_0xd91463===0x1ad;}function isNonRetryable429(_0x55cc46){const _0x4f7e3f=a93_0x1671;return _0x55cc46[_0x4f7e3f(0xd3)]('already\x20running');}function getRetryDelay(_0x2738e,_0xcbb277){const _0x5b17fe=a93_0x1671,_0x4264ff=Math['min'](_0xcbb277[_0x5b17fe(0x9f)]*Math[_0x5b17fe(0xb9)](0x2,_0x2738e),_0xcbb277['maxDelay']);return Math[_0x5b17fe(0xa6)]()*_0x4264ff;}function statusCodeToErrorCode(_0x108f08){const _0x2c2898=a93_0x1671;if(_0x108f08===0x191)return ErrorCode[_0x2c2898(0xb3)];else{if(_0x108f08===0x193)return ErrorCode[_0x2c2898(0xd5)];else{if(_0x108f08===0x194)return ErrorCode[_0x2c2898(0xba)];else{if(_0x108f08===0x1ad)return ErrorCode['RATE_LIMITED'];else return _0x108f08>=0x1f4?ErrorCode[_0x2c2898(0xb5)]:ErrorCode[_0x2c2898(0xd2)];}}}}export class HTTPClientError extends Error{['status'];[a93_0x1c965c(0xaa)];[a93_0x1c965c(0xa3)];constructor(_0x2effe8,_0x1496c8,_0x2fcb9c){const _0x338813=a93_0x1c965c,_0x4ff39e=statusCodeToErrorCode(_0x1496c8);super('['+_0x4ff39e+']\x20'+_0x2effe8),this[_0x338813(0xc1)]=_0x1496c8,this[_0x338813(0xaa)]=_0x2fcb9c,this['name']='HTTPClientError',this['code']=_0x4ff39e;}}export class HTTPClient{[a93_0x1c965c(0xe3)];[a93_0x1c965c(0xf8)];[a93_0x1c965c(0x102)];[a93_0x1c965c(0xc2)]=Logger['of'](a93_0x1c965c(0x106));[a93_0x1c965c(0xeb)];['proxyReady'];[a93_0x1c965c(0xbe)];constructor(_0x453bb6,_0x4c841b,_0x13d302){const _0x53bdca=a93_0x1c965c;this['baseUrl']=_0x453bb6,this['defaultHeaders']=_0x4c841b,this[_0x53bdca(0xe3)]={...DEFAULT_RETRY_CONFIG,..._0x13d302?.['retryConfig']},_0x13d302?.[_0x53bdca(0xff)]&&(this['proxyUrl']=_0x13d302[_0x53bdca(0xff)],this[_0x53bdca(0xa8)]=import(_0x53bdca(0x9e))[_0x53bdca(0xcc)](({ProxyAgent:_0xd49f66})=>{const _0x5e79f6=_0x53bdca;this[_0x5e79f6(0xeb)]=new _0xd49f66(_0x13d302['proxy']);}),this[_0x53bdca(0xc2)]['info']('Using\x20proxy:\x20'+this[_0x53bdca(0xdc)](_0x13d302['proxy'])));}[a93_0x1c965c(0xdc)](_0x122feb){const _0x46d424=a93_0x1c965c;try{const _0x2ff2c3=new URL(_0x122feb);return _0x2ff2c3[_0x46d424(0xab)]&&(_0x2ff2c3['username']=_0x46d424(0xe0)),_0x2ff2c3[_0x46d424(0xfd)]&&(_0x2ff2c3[_0x46d424(0xfd)]=_0x46d424(0xe0)),_0x2ff2c3[_0x46d424(0xc6)]();}catch{return _0x122feb;}}[a93_0x1c965c(0xc0)](_0x84718e){const _0x46fed4=a93_0x1c965c,_0x4dcb50=getErrorChain(_0x84718e);for(const _0x20588b of _0x4dcb50){const _0x5201aa=_0x20588b[_0x46fed4(0xef)]['toLowerCase'](),_0x4af0ae=_0x20588b[_0x46fed4(0xb0)][_0x46fed4(0xbc)]();if(_0x5201aa[_0x46fed4(0xd3)]('proxy')||_0x4af0ae['includes'](_0x46fed4(0xff))||_0x5201aa['includes'](_0x46fed4(0xfa))||_0x5201aa[_0x46fed4(0xd3)](_0x46fed4(0x9a)))return!![];if('code'in _0x20588b&&typeof _0x20588b['code']===_0x46fed4(0xc8)){if(_0x20588b[_0x46fed4(0xa3)][_0x46fed4(0xd3)](_0x46fed4(0x9d)))return!![];}}return![];}async[a93_0x1c965c(0xb7)](_0x15a01a,_0x293847,_0x3e9e3c={}){const _0x36192d=a93_0x1c965c,{headers:headers={},body:_0xfa1c9f,timeout:timeout=0x7530,retries:retries=this[_0x36192d(0xe3)][_0x36192d(0xa9)],signal:_0x23d55c,includeHeaders:includeHeaders=![],responseType:responseType=_0x36192d(0xb1)}=_0x3e9e3c,_0x470798=''+this['baseUrl']+_0x293847;this[_0x36192d(0xc2)][_0x36192d(0xcd)](_0x36192d(0xf2)+_0x15a01a+'\x20'+_0x470798);const _0xcdc542={...this[_0x36192d(0x102)],...headers};if(_0xfa1c9f&&!_0xcdc542['Content-Type']){if(_0xfa1c9f instanceof Buffer){}else _0xcdc542[_0x36192d(0xd7)]=_0x36192d(0xed);}let _0x1a0713;_0xfa1c9f&&(_0xfa1c9f instanceof Buffer?_0x1a0713=_0xfa1c9f:_0x1a0713=typeof _0xfa1c9f===_0x36192d(0xc8)?_0xfa1c9f:JSON[_0x36192d(0xe9)](_0xfa1c9f));_0x1a0713&&this[_0x36192d(0xc2)][_0x36192d(0xbf)](_0x36192d(0xbd)+(typeof _0x1a0713===_0x36192d(0xc8)?_0x1a0713:'[binary\x20data]'));let _0x1dc8f6=null;for(let _0xeb5243=0x0;_0xeb5243<=retries;_0xeb5243++){try{const _0x5f3de3=new AbortController(),_0x1aab84=setTimeout(()=>_0x5f3de3[_0x36192d(0x9b)](),timeout);if(_0x23d55c){if(_0x23d55c[_0x36192d(0xe8)])throw new Error(_0x36192d(0x100));_0x23d55c[_0x36192d(0xe1)](_0x36192d(0x9b),()=>_0x5f3de3[_0x36192d(0x9b)](),{'once':!![]});}this[_0x36192d(0xa8)]&&await this[_0x36192d(0xa8)];const _0x4672c4={'method':_0x15a01a,'headers':_0xcdc542,'body':_0x1a0713,'signal':_0x5f3de3[_0x36192d(0xad)]};this[_0x36192d(0xeb)]&&(_0x4672c4[_0x36192d(0xeb)]=this['dispatcher']);const _0x3b9d9c=await fetch(_0x470798,_0x4672c4);clearTimeout(_0x1aab84);if(_0xeb5243<retries&&isRetryableStatus(_0x3b9d9c[_0x36192d(0xc1)])){if(_0x3b9d9c[_0x36192d(0xc1)]===0x1ad){const _0x2b31c2=await _0x3b9d9c['text']();if(isNonRetryable429(_0x2b31c2)){const _0x4f7635=this[_0x36192d(0xb6)](_0x2b31c2)||_0x3b9d9c[_0x36192d(0xf0)];throw new HTTPClientError(_0x4f7635,_0x3b9d9c[_0x36192d(0xc1)]);}}const _0x583199=_0x3b9d9c[_0x36192d(0xee)][_0x36192d(0xdb)](_0x36192d(0xe4)),_0x40487f=_0x583199?parseInt(_0x583199,0xa)*0x3e8:getRetryDelay(_0xeb5243,this[_0x36192d(0xe3)]);console['warn'](_0x36192d(0xdd)+(_0xeb5243+0x1)+'/'+retries+_0x36192d(0xa1)+_0x3b9d9c[_0x36192d(0xc1)]+',\x20'+('retrying\x20in\x20'+Math[_0x36192d(0xc7)](_0x40487f)+_0x36192d(0xd1))),await this[_0x36192d(0xf4)](_0x40487f);continue;}!_0x3b9d9c['ok']&&await this[_0x36192d(0x9c)](_0x3b9d9c);let _0x515994;if(responseType===_0x36192d(0x107)){const _0x129d4d=await _0x3b9d9c[_0x36192d(0xb2)]();_0x515994=Buffer[_0x36192d(0xc3)](_0x129d4d);}else responseType===_0x36192d(0x105)?_0x515994=await _0x3b9d9c[_0x36192d(0x105)]():_0x515994=await this[_0x36192d(0xe2)](_0x3b9d9c);this['logger'][_0x36192d(0xbf)](_0x36192d(0xfb)+_0x3b9d9c[_0x36192d(0xc1)]+_0x36192d(0xa5)+_0x15a01a+'\x20'+_0x293847),this[_0x36192d(0xc2)][_0x36192d(0xf7)](JSON[_0x36192d(0xe9)](_0x515994,null,0x2));if(includeHeaders){const _0x3b6383={};return _0x3b9d9c['headers'][_0x36192d(0xd4)]((_0x7b9e1b,_0x36c625)=>{_0x3b6383[_0x36c625]=_0x7b9e1b;}),{'data':_0x515994,'status':_0x3b9d9c[_0x36192d(0xc1)],'headers':_0x3b6383};}return _0x515994;}catch(_0x1b8d8f){_0x1dc8f6=_0x1b8d8f instanceof Error?_0x1b8d8f:new Error(String(_0x1b8d8f));if(_0x1b8d8f instanceof HTTPClientError){if(!isRetryableStatus(_0x1b8d8f['status'])||_0x1b8d8f[_0x36192d(0xc1)]===0x1ad&&isNonRetryable429(_0x1b8d8f[_0x36192d(0xef)]))throw _0x1b8d8f;}if(_0xeb5243>=retries){if(!(_0x1dc8f6 instanceof HTTPClientError)){const _0x18409d=extractRootCause(_0x1dc8f6);if(this[_0x36192d(0xbe)]&&this[_0x36192d(0xc0)](_0x1dc8f6))throw new SDKError(ErrorCode[_0x36192d(0xa2)],_0x36192d(0xd0)+this[_0x36192d(0xdc)](this[_0x36192d(0xbe)])+':\x20'+_0x18409d,_0x1dc8f6);throw new SDKError(ErrorCode[_0x36192d(0xd6)],_0x36192d(0xcf)+_0x470798+_0x36192d(0xda)+_0x18409d,_0x1dc8f6);}throw _0x1dc8f6;}const _0x247c44=getRetryDelay(_0xeb5243,this[_0x36192d(0xe3)]);let _0x3491a4;_0x1dc8f6 instanceof HTTPClientError?_0x3491a4=_0x36192d(0xdd)+(_0xeb5243+0x1)+'/'+retries+']\x20Request\x20failed\x20with\x20HTTP\x20'+_0x1dc8f6[_0x36192d(0xc1)]+':\x20'+_0x1dc8f6['message']+',\x20'+('retrying\x20in\x20'+Math[_0x36192d(0xc7)](_0x247c44)+'ms...'):_0x3491a4=_0x36192d(0xdd)+(_0xeb5243+0x1)+'/'+retries+_0x36192d(0xcb)+_0x470798+'\x20failed:\x20'+_0x1dc8f6[_0x36192d(0xef)]+',\x20'+(_0x36192d(0xf5)+Math[_0x36192d(0xc7)](_0x247c44)+_0x36192d(0xd1)),console[_0x36192d(0xae)](_0x3491a4),await this['sleep'](_0x247c44);}}throw _0x1dc8f6||new SDKError(ErrorCode['INTERNAL'],_0x36192d(0xe6));}async[a93_0x1c965c(0xe2)](_0x287a0c){const _0x39dce8=a93_0x1c965c,_0x3d3b03=await _0x287a0c[_0x39dce8(0x105)]();if(!_0x3d3b03)return null;try{const _0x10324a=a93_0x1a9d9c({'storeAsString':!![]});return _0x10324a[_0x39dce8(0xac)](_0x3d3b03);}catch{return{'body':_0x3d3b03};}}[a93_0x1c965c(0xdf)](_0x1504a4,_0x2d31ab){const _0x49aea8=a93_0x1c965c;if(!_0x1504a4||typeof _0x1504a4!==_0x49aea8(0xf9))return undefined;let _0x5e1859=_0x1504a4;_0x5e1859[_0x49aea8(0xb8)]&&typeof _0x5e1859[_0x49aea8(0xb8)]===_0x49aea8(0xf9)&&(_0x5e1859=_0x5e1859['errors']);if(_0x5e1859[_0x49aea8(0xc5)]||_0x5e1859[_0x49aea8(0xde)]||_0x5e1859['detail'])return{'type':_0x5e1859[_0x49aea8(0xc5)]||_0x49aea8(0x103),'title':_0x5e1859[_0x49aea8(0xde)]||_0x49aea8(0xfc),'status':_0x5e1859[_0x49aea8(0xc1)]||_0x2d31ab,'detail':_0x5e1859[_0x49aea8(0xc4)]||_0x49aea8(0xe7),'instance':_0x5e1859['instance']||'',..._0x5e1859};const _0xadb1bd=_0x5e1859[_0x49aea8(0xef)]||_0x5e1859['error']||_0x5e1859['text'];if(typeof _0xadb1bd===_0x49aea8(0xc8))return{'type':_0x49aea8(0x103),'title':_0x5e1859['severity']||_0x49aea8(0xfc),'status':_0x5e1859[_0x49aea8(0xce)]||_0x2d31ab,'detail':_0xadb1bd,'instance':'',..._0x5e1859};return undefined;}async['handleErrorResponse'](_0x1fdbf3){const _0x176df2=a93_0x1c965c,_0x309865=await this[_0x176df2(0xe2)](_0x1fdbf3),_0xef14d6=this[_0x176df2(0xdf)](_0x309865,_0x1fdbf3[_0x176df2(0xc1)]);_0x309865&&this[_0x176df2(0xc2)][_0x176df2(0xbf)]('Error\x20response\x20body:\x20'+JSON[_0x176df2(0xe9)](_0x309865));let _0xa75267;if(_0xef14d6?.['detail'])_0xa75267=_0xef14d6[_0x176df2(0xc4)];else _0x309865?_0xa75267=_0x176df2(0xa4)+_0x1fdbf3[_0x176df2(0xc1)]+':\x20'+_0x1fdbf3[_0x176df2(0xf0)]+_0x176df2(0xf1)+JSON[_0x176df2(0xe9)](_0x309865):_0xa75267=_0x176df2(0xa4)+_0x1fdbf3[_0x176df2(0xc1)]+':\x20'+_0x1fdbf3[_0x176df2(0xf0)];throw new HTTPClientError(_0xa75267,_0x1fdbf3[_0x176df2(0xc1)],_0xef14d6);}[a93_0x1c965c(0xf4)](_0x5184b5){return new Promise(_0x11b36b=>setTimeout(_0x11b36b,_0x5184b5));}[a93_0x1c965c(0xb6)](_0x42ca7e){const _0x4ce01a=a93_0x1c965c;try{const _0x2b987d=JSON[_0x4ce01a(0xac)](_0x42ca7e);return _0x2b987d[_0x4ce01a(0xc4)]||_0x2b987d['message']||_0x2b987d[_0x4ce01a(0xfe)]||null;}catch{return _0x42ca7e['length']<0x1f4?_0x42ca7e:null;}}async['requestSSE'](_0x392d77,_0x1cbb35,_0x57e94c={}){const _0x14c87c=a93_0x1c965c,{headers:headers={},body:_0x375051,timeout:timeout=0x7530,signal:_0x3662ed}=_0x57e94c,_0xc54dc3=''+this[_0x14c87c(0xf8)]+_0x1cbb35,_0x1c3491={...this['defaultHeaders'],...headers},_0x59c6fd=new AbortController(),_0x4436ce=setTimeout(()=>_0x59c6fd[_0x14c87c(0x9b)](),timeout),_0x5eaae7=_0x3662ed?[_0x59c6fd['signal'],_0x3662ed]:[_0x59c6fd['signal']],_0x552789=this[_0x14c87c(0xf3)](_0x5eaae7);try{this[_0x14c87c(0xa8)]&&await this[_0x14c87c(0xa8)];const _0x3c041e={'method':_0x392d77,'headers':_0x1c3491,'signal':_0x552789};this['dispatcher']&&(_0x3c041e[_0x14c87c(0xeb)]=this[_0x14c87c(0xeb)]);if(_0x375051){if(typeof _0x375051===_0x14c87c(0xc8))_0x3c041e['body']=_0x375051;else _0x375051 instanceof Buffer?_0x3c041e['body']=_0x375051:_0x3c041e['body']=JSON[_0x14c87c(0xe9)](_0x375051);}const _0x4121f0=await fetch(_0xc54dc3,_0x3c041e);return clearTimeout(_0x4436ce),!_0x4121f0['ok']&&await this['handleErrorResponse'](_0x4121f0),_0x4121f0;}catch(_0x5d501e){clearTimeout(_0x4436ce);if(_0x5d501e instanceof HTTPClientError)throw _0x5d501e;if(_0x5d501e[_0x14c87c(0xb0)]===_0x14c87c(0x104))throw new Error('Request\x20cancelled\x20by\x20user');if(this[_0x14c87c(0xbe)]&&_0x5d501e instanceof Error&&this[_0x14c87c(0xc0)](_0x5d501e))throw new SDKError(ErrorCode['PROXY_CONNECTION_FAILURE'],_0x14c87c(0xd0)+this['maskProxyCredentials'](this[_0x14c87c(0xbe)])+':\x20'+_0x5d501e[_0x14c87c(0xef)],_0x5d501e);throw _0x5d501e;}}[a93_0x1c965c(0xf3)](_0x117149){const _0x1429df=a93_0x1c965c,_0x4769e3=new AbortController();for(const _0x2d2053 of _0x117149){if(_0x2d2053[_0x1429df(0xe8)])return _0x4769e3[_0x1429df(0x9b)](),_0x4769e3['signal'];_0x2d2053[_0x1429df(0xe1)](_0x1429df(0x9b),()=>_0x4769e3[_0x1429df(0x9b)](),{'once':!![]});}return _0x4769e3[_0x1429df(0xad)];}}
|
|
1
|
+
const a93_0x408024=a93_0x2f48;(function(_0x535c2e,_0x292c36){const _0x40e39f=a93_0x2f48,_0x5a0571=_0x535c2e();while(!![]){try{const _0x549e08=parseInt(_0x40e39f(0x86))/0x1+parseInt(_0x40e39f(0x6f))/0x2+parseInt(_0x40e39f(0xd8))/0x3+-parseInt(_0x40e39f(0xbf))/0x4+parseInt(_0x40e39f(0xc1))/0x5*(-parseInt(_0x40e39f(0xa5))/0x6)+parseInt(_0x40e39f(0xa0))/0x7*(parseInt(_0x40e39f(0xcd))/0x8)+parseInt(_0x40e39f(0xda))/0x9*(-parseInt(_0x40e39f(0x8a))/0xa);if(_0x549e08===_0x292c36)break;else _0x5a0571['push'](_0x5a0571['shift']());}catch(_0xe5b3a6){_0x5a0571['push'](_0x5a0571['shift']());}}}(a93_0x469c,0x51fc9));import{ErrorCode,SDKError}from'../errors.js';import{Logger}from'../../utils/logger/index.js';import a93_0x24cf46 from'json-bigint';function getErrorChain(_0x3e94d1,_0x447e99=0x5){const _0x5e9fd6=a93_0x2f48,_0xd0aa4a=[_0x3e94d1];let _0x1c559b=_0x3e94d1;for(let _0x5cbea0=0x0;_0x5cbea0<_0x447e99&&_0x1c559b;_0x5cbea0++){const _0x198e9e=_0x1c559b[_0x5e9fd6(0x7f)];if(_0x198e9e instanceof Error)_0xd0aa4a[_0x5e9fd6(0x7d)](_0x198e9e),_0x1c559b=_0x198e9e;else break;}return _0xd0aa4a;}function extractRootCause(_0x1cb088){const _0x2c48cc=a93_0x2f48,_0x3c6bc7=getErrorChain(_0x1cb088,0x4),_0x2182ce=_0x3c6bc7[_0x3c6bc7[_0x2c48cc(0xb7)]-0x1],_0x4644db=_0x2182ce[_0x2c48cc(0x7f)];if(_0x4644db&&!(_0x4644db instanceof Error))return String(_0x4644db);return _0x2182ce['message']||_0x2c48cc(0x91);}const DEFAULT_RETRY_CONFIG={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1f40};function isRetryableStatus(_0x23c0ab){return _0x23c0ab>=0x1f4||_0x23c0ab===0x1ad;}function isNonRetryable429(_0x2c5b95){const _0x394fb4=a93_0x2f48;return _0x2c5b95['includes'](_0x394fb4(0x85));}function a93_0x469c(){const _0x5a98c6=['proxyUrl',']\x20Request\x20failed\x20with\x20','RATE_LIMITED','170639IgeuJJ','[Retry\x20','retrying\x20in\x20','title','\x0a\x20\x20Details:\x20','3445638IvRhza','UNAUTHENTICATED','errors','text','Using\x20proxy:\x20','name','logger','Content-Type','abort','\x20failed:\x20','get','HTTP_REQUEST_FAILURE','maskProxyCredentials','round','status','trace','severity',']\x20Request\x20to\x20','length','safeParseJSON','debug','request\x20body:\x20','tdx.client.http','headers','HTTPClientError','Request\x20cancelled\x20by\x20user','2626732CvxVqF','addEventListener','5jGitkq','baseDelay','body','info','random','statusText','password','Retry-After','detail','isProxyConnectionError','requestSSE','proxy','152vLYaTD','instance','retryConfig','includes','string','HTTP\x20','Failed\x20to\x20connect\x20through\x20proxy\x20','message','proxyReady','maxDelay',']\x20Request\x20failed\x20with\x20HTTP\x20','1965330sTRqhc','json','9XCLGTJ','parse','arrayBuffer','782140fGACYU','****','object','Request:\x20','warn','type','arraybuffer','baseUrl','maxRetries','407','UNAVAILABLE','parseProblemDetails','request','problemDetails','push','from','cause','status_code','forEach','dispatcher','Request\x20to\x20','error','already\x20running','156063vWeZrr','toLowerCase','PROXY','toString','986330ekYDFg','handleErrorResponse','PERMISSION_DENIED','combineSignals','then','defaultHeaders','sleep','Unknown\x20error','undici','tunnel','An\x20error\x20occurred','signal','stringify','min','ms...','about:blank','AbortError','application/json','code'];a93_0x469c=function(){return _0x5a98c6;};return a93_0x469c();}function getRetryDelay(_0x49bbb8,_0x258d39){const _0x575521=a93_0x2f48,_0x42c905=Math[_0x575521(0x97)](_0x258d39[_0x575521(0xc2)]*Math['pow'](0x2,_0x49bbb8),_0x258d39[_0x575521(0xd6)]);return Math[_0x575521(0xc5)]()*_0x42c905;}function statusCodeToErrorCode(_0xcbacd4){const _0x547984=a93_0x2f48;if(_0xcbacd4===0x191)return ErrorCode[_0x547984(0xa6)];else{if(_0xcbacd4===0x193)return ErrorCode[_0x547984(0x8c)];else{if(_0xcbacd4===0x194)return ErrorCode['NOT_FOUND'];else{if(_0xcbacd4===0x1ad)return ErrorCode[_0x547984(0x9f)];else return _0xcbacd4>=0x1f4?ErrorCode[_0x547984(0x79)]:ErrorCode['INVALID_ARGUMENT'];}}}}function a93_0x2f48(_0x422ffd,_0x8e0537){_0x422ffd=_0x422ffd-0x6f;const _0x469c28=a93_0x469c();let _0x2f48d3=_0x469c28[_0x422ffd];return _0x2f48d3;}export class HTTPClientError extends Error{['status'];[a93_0x408024(0x7c)];[a93_0x408024(0x9c)];constructor(_0x3ca500,_0x142e02,_0xfc35f2){const _0xbf3f4a=a93_0x408024,_0x56bc7a=statusCodeToErrorCode(_0x142e02);super('['+_0x56bc7a+']\x20'+_0x3ca500),this[_0xbf3f4a(0xb3)]=_0x142e02,this[_0xbf3f4a(0x7c)]=_0xfc35f2,this[_0xbf3f4a(0xaa)]=_0xbf3f4a(0xbd),this[_0xbf3f4a(0x9c)]=_0x56bc7a;}}export class HTTPClient{[a93_0x408024(0xcf)];['baseUrl'];[a93_0x408024(0x8f)];[a93_0x408024(0xab)]=Logger['of'](a93_0x408024(0xbb));[a93_0x408024(0x82)];[a93_0x408024(0xd5)];[a93_0x408024(0x9d)];constructor(_0x127717,_0x36525e,_0xb9a9f8){const _0x285396=a93_0x408024;this[_0x285396(0x76)]=_0x127717,this[_0x285396(0x8f)]=_0x36525e,this[_0x285396(0xcf)]={...DEFAULT_RETRY_CONFIG,..._0xb9a9f8?.[_0x285396(0xcf)]},_0xb9a9f8?.[_0x285396(0xcc)]&&(this[_0x285396(0x9d)]=_0xb9a9f8[_0x285396(0xcc)],this[_0x285396(0xd5)]=import(_0x285396(0x92))[_0x285396(0x8e)](({ProxyAgent:_0x5bb910})=>{const _0x20ae7c=_0x285396;this[_0x20ae7c(0x82)]=new _0x5bb910(_0xb9a9f8[_0x20ae7c(0xcc)]);}),this[_0x285396(0xab)][_0x285396(0xc4)](_0x285396(0xa9)+this[_0x285396(0xb1)](_0xb9a9f8[_0x285396(0xcc)])));}[a93_0x408024(0xb1)](_0x3cc6a3){const _0x8c7af3=a93_0x408024;try{const _0x500b75=new URL(_0x3cc6a3);return _0x500b75['username']&&(_0x500b75['username']='****'),_0x500b75[_0x8c7af3(0xc7)]&&(_0x500b75[_0x8c7af3(0xc7)]=_0x8c7af3(0x70)),_0x500b75[_0x8c7af3(0x89)]();}catch{return _0x3cc6a3;}}[a93_0x408024(0xca)](_0x157ffc){const _0x577d6b=a93_0x408024,_0x39e833=getErrorChain(_0x157ffc);for(const _0x41541e of _0x39e833){const _0x3db238=_0x41541e[_0x577d6b(0xd4)][_0x577d6b(0x87)](),_0x2fecff=_0x41541e[_0x577d6b(0xaa)]['toLowerCase']();if(_0x3db238[_0x577d6b(0xd0)]('proxy')||_0x2fecff[_0x577d6b(0xd0)](_0x577d6b(0xcc))||_0x3db238['includes'](_0x577d6b(0x93))||_0x3db238[_0x577d6b(0xd0)](_0x577d6b(0x78)))return!![];if(_0x577d6b(0x9c)in _0x41541e&&typeof _0x41541e[_0x577d6b(0x9c)]===_0x577d6b(0xd1)){if(_0x41541e[_0x577d6b(0x9c)][_0x577d6b(0xd0)](_0x577d6b(0x88)))return!![];}}return![];}async[a93_0x408024(0x7b)](_0x4f3836,_0x340cab,_0x5da3b5={}){const _0x4c74ab=a93_0x408024,{headers:headers={},body:_0x1be8fc,timeout:timeout=0x7530,retries:retries=this[_0x4c74ab(0xcf)][_0x4c74ab(0x77)],signal:_0x154b96,includeHeaders:includeHeaders=![],responseType:responseType=_0x4c74ab(0xd9)}=_0x5da3b5,_0x225ad8=''+this[_0x4c74ab(0x76)]+_0x340cab;this['logger']['info'](_0x4c74ab(0x72)+_0x4f3836+'\x20'+_0x225ad8);const _0x2a6cea={...this[_0x4c74ab(0x8f)],...headers};if(_0x1be8fc&&!_0x2a6cea[_0x4c74ab(0xac)]){if(_0x1be8fc instanceof Buffer){}else _0x2a6cea[_0x4c74ab(0xac)]=_0x4c74ab(0x9b);}let _0x40d353;_0x1be8fc&&(_0x1be8fc instanceof Buffer?_0x40d353=_0x1be8fc:_0x40d353=typeof _0x1be8fc==='string'?_0x1be8fc:JSON[_0x4c74ab(0x96)](_0x1be8fc));_0x40d353&&this['logger'][_0x4c74ab(0xb9)](_0x4c74ab(0xba)+(typeof _0x40d353===_0x4c74ab(0xd1)?_0x40d353:'[binary\x20data]'));let _0x5e62f3=null;for(let _0x244d48=0x0;_0x244d48<=retries;_0x244d48++){try{const _0xc6763=new AbortController(),_0x8f2c5c=setTimeout(()=>_0xc6763[_0x4c74ab(0xad)](),timeout);if(_0x154b96){if(_0x154b96['aborted'])throw new Error(_0x4c74ab(0xbe));_0x154b96[_0x4c74ab(0xc0)](_0x4c74ab(0xad),()=>_0xc6763[_0x4c74ab(0xad)](),{'once':!![]});}this[_0x4c74ab(0xd5)]&&await this[_0x4c74ab(0xd5)];const _0x1c4523={'method':_0x4f3836,'headers':_0x2a6cea,'body':_0x40d353,'signal':_0xc6763['signal']};this[_0x4c74ab(0x82)]&&(_0x1c4523['dispatcher']=this[_0x4c74ab(0x82)]);const _0x2dc2f2=await fetch(_0x225ad8,_0x1c4523);clearTimeout(_0x8f2c5c);if(_0x244d48<retries&&isRetryableStatus(_0x2dc2f2['status'])){if(_0x2dc2f2['status']===0x1ad){const _0x4fcd01=await _0x2dc2f2[_0x4c74ab(0xa8)]();if(isNonRetryable429(_0x4fcd01)){const _0x4f253f=this['extractErrorMessage'](_0x4fcd01)||_0x2dc2f2['statusText'];throw new HTTPClientError(_0x4f253f,_0x2dc2f2[_0x4c74ab(0xb3)]);}}const _0x2c3068=_0x2dc2f2[_0x4c74ab(0xbc)][_0x4c74ab(0xaf)](_0x4c74ab(0xc8)),_0x52669a=_0x2c3068?parseInt(_0x2c3068,0xa)*0x3e8:getRetryDelay(_0x244d48,this[_0x4c74ab(0xcf)]);console[_0x4c74ab(0x73)](_0x4c74ab(0xa1)+(_0x244d48+0x1)+'/'+retries+_0x4c74ab(0x9e)+_0x2dc2f2[_0x4c74ab(0xb3)]+',\x20'+(_0x4c74ab(0xa2)+Math[_0x4c74ab(0xb2)](_0x52669a)+_0x4c74ab(0x98))),await this[_0x4c74ab(0x90)](_0x52669a);continue;}!_0x2dc2f2['ok']&&await this[_0x4c74ab(0x8b)](_0x2dc2f2);let _0x4e625f;if(responseType===_0x4c74ab(0x75)){const _0x59c3b0=await _0x2dc2f2[_0x4c74ab(0xdc)]();_0x4e625f=Buffer[_0x4c74ab(0x7e)](_0x59c3b0);}else responseType===_0x4c74ab(0xa8)?_0x4e625f=await _0x2dc2f2[_0x4c74ab(0xa8)]():_0x4e625f=await this[_0x4c74ab(0xb8)](_0x2dc2f2);this[_0x4c74ab(0xab)][_0x4c74ab(0xb9)]('Response\x20['+_0x2dc2f2['status']+']:\x20'+_0x4f3836+'\x20'+_0x340cab),this[_0x4c74ab(0xab)][_0x4c74ab(0xb4)](JSON[_0x4c74ab(0x96)](_0x4e625f,null,0x2));if(includeHeaders){const _0x28f518={};return _0x2dc2f2['headers'][_0x4c74ab(0x81)]((_0x4efa6f,_0x16947f)=>{_0x28f518[_0x16947f]=_0x4efa6f;}),{'data':_0x4e625f,'status':_0x2dc2f2['status'],'headers':_0x28f518};}return _0x4e625f;}catch(_0x97bde3){_0x5e62f3=_0x97bde3 instanceof Error?_0x97bde3:new Error(String(_0x97bde3));if(_0x97bde3 instanceof HTTPClientError){if(!isRetryableStatus(_0x97bde3[_0x4c74ab(0xb3)])||_0x97bde3[_0x4c74ab(0xb3)]===0x1ad&&isNonRetryable429(_0x97bde3[_0x4c74ab(0xd4)]))throw _0x97bde3;}if(_0x244d48>=retries){if(!(_0x5e62f3 instanceof HTTPClientError)){const _0x5c4e0e=extractRootCause(_0x5e62f3);if(this[_0x4c74ab(0x9d)]&&this[_0x4c74ab(0xca)](_0x5e62f3))throw new SDKError(ErrorCode['PROXY_CONNECTION_FAILURE'],_0x4c74ab(0xd3)+this[_0x4c74ab(0xb1)](this[_0x4c74ab(0x9d)])+':\x20'+_0x5c4e0e,_0x5e62f3);throw new SDKError(ErrorCode[_0x4c74ab(0xb0)],_0x4c74ab(0x83)+_0x225ad8+_0x4c74ab(0xae)+_0x5c4e0e,_0x5e62f3);}throw _0x5e62f3;}const _0x362e93=getRetryDelay(_0x244d48,this[_0x4c74ab(0xcf)]);let _0xefd160;_0x5e62f3 instanceof HTTPClientError?_0xefd160=_0x4c74ab(0xa1)+(_0x244d48+0x1)+'/'+retries+_0x4c74ab(0xd7)+_0x5e62f3['status']+':\x20'+_0x5e62f3[_0x4c74ab(0xd4)]+',\x20'+('retrying\x20in\x20'+Math['round'](_0x362e93)+_0x4c74ab(0x98)):_0xefd160=_0x4c74ab(0xa1)+(_0x244d48+0x1)+'/'+retries+_0x4c74ab(0xb6)+_0x225ad8+_0x4c74ab(0xae)+_0x5e62f3[_0x4c74ab(0xd4)]+',\x20'+(_0x4c74ab(0xa2)+Math[_0x4c74ab(0xb2)](_0x362e93)+_0x4c74ab(0x98)),console['warn'](_0xefd160),await this[_0x4c74ab(0x90)](_0x362e93);}}throw _0x5e62f3||new SDKError(ErrorCode['INTERNAL'],'Request\x20failed\x20after\x20retries');}async[a93_0x408024(0xb8)](_0x529165){const _0x5af39f=a93_0x408024,_0x47375f=await _0x529165['text']();if(!_0x47375f)return null;try{const _0x4d62a0=a93_0x24cf46({'storeAsString':!![]});return _0x4d62a0[_0x5af39f(0xdb)](_0x47375f);}catch{return{'body':_0x47375f};}}[a93_0x408024(0x7a)](_0x1287a4,_0x13d06f){const _0x496f4e=a93_0x408024;if(!_0x1287a4||typeof _0x1287a4!==_0x496f4e(0x71))return undefined;let _0xbd55e5=_0x1287a4;_0xbd55e5[_0x496f4e(0xa7)]&&typeof _0xbd55e5[_0x496f4e(0xa7)]===_0x496f4e(0x71)&&(_0xbd55e5=_0xbd55e5['errors']);if(_0xbd55e5[_0x496f4e(0x74)]||_0xbd55e5['title']||_0xbd55e5[_0x496f4e(0xc9)])return{'type':_0xbd55e5[_0x496f4e(0x74)]||_0x496f4e(0x99),'title':_0xbd55e5[_0x496f4e(0xa3)]||'Error','status':_0xbd55e5[_0x496f4e(0xb3)]||_0x13d06f,'detail':_0xbd55e5[_0x496f4e(0xc9)]||_0x496f4e(0x94),'instance':_0xbd55e5[_0x496f4e(0xce)]||'',..._0xbd55e5};const _0x21bf63=_0xbd55e5[_0x496f4e(0xd4)]||_0xbd55e5[_0x496f4e(0x84)]||_0xbd55e5[_0x496f4e(0xa8)];if(typeof _0x21bf63===_0x496f4e(0xd1))return{'type':_0x496f4e(0x99),'title':_0xbd55e5[_0x496f4e(0xb5)]||'Error','status':_0xbd55e5[_0x496f4e(0x80)]||_0x13d06f,'detail':_0x21bf63,'instance':'',..._0xbd55e5};return undefined;}async['handleErrorResponse'](_0x325076){const _0x2eb46f=a93_0x408024,_0x391d38=await this[_0x2eb46f(0xb8)](_0x325076),_0x4ef9a5=this[_0x2eb46f(0x7a)](_0x391d38,_0x325076[_0x2eb46f(0xb3)]);_0x391d38&&this[_0x2eb46f(0xab)][_0x2eb46f(0xb9)]('Error\x20response\x20body:\x20'+JSON[_0x2eb46f(0x96)](_0x391d38));let _0x1c7f7c;if(_0x4ef9a5?.[_0x2eb46f(0xc9)])_0x1c7f7c=_0x4ef9a5[_0x2eb46f(0xc9)];else _0x391d38?_0x1c7f7c=_0x2eb46f(0xd2)+_0x325076['status']+':\x20'+_0x325076[_0x2eb46f(0xc6)]+_0x2eb46f(0xa4)+JSON[_0x2eb46f(0x96)](_0x391d38):_0x1c7f7c=_0x2eb46f(0xd2)+_0x325076[_0x2eb46f(0xb3)]+':\x20'+_0x325076[_0x2eb46f(0xc6)];throw new HTTPClientError(_0x1c7f7c,_0x325076[_0x2eb46f(0xb3)],_0x4ef9a5);}['sleep'](_0x2b6a7c){return new Promise(_0x54a701=>setTimeout(_0x54a701,_0x2b6a7c));}['extractErrorMessage'](_0x28bf47){const _0x54e1c7=a93_0x408024;try{const _0x586aca=JSON[_0x54e1c7(0xdb)](_0x28bf47);return _0x586aca[_0x54e1c7(0xc9)]||_0x586aca[_0x54e1c7(0xd4)]||_0x586aca[_0x54e1c7(0x84)]||null;}catch{return _0x28bf47[_0x54e1c7(0xb7)]<0x1f4?_0x28bf47:null;}}async[a93_0x408024(0xcb)](_0x4f639f,_0x4a0017,_0xabe4bc={}){const _0x57cb92=a93_0x408024,{headers:headers={},body:_0x2d3d96,timeout:timeout=0x7530,signal:_0xfd0175}=_0xabe4bc,_0x10b209=''+this['baseUrl']+_0x4a0017,_0x16792a={...this[_0x57cb92(0x8f)],...headers},_0x36bf7b=new AbortController(),_0xcc31ff=setTimeout(()=>_0x36bf7b[_0x57cb92(0xad)](),timeout),_0x5729aa=_0xfd0175?[_0x36bf7b[_0x57cb92(0x95)],_0xfd0175]:[_0x36bf7b[_0x57cb92(0x95)]],_0x49cbbd=this[_0x57cb92(0x8d)](_0x5729aa);try{this['proxyReady']&&await this['proxyReady'];const _0x108fba={'method':_0x4f639f,'headers':_0x16792a,'signal':_0x49cbbd};this[_0x57cb92(0x82)]&&(_0x108fba[_0x57cb92(0x82)]=this[_0x57cb92(0x82)]);if(_0x2d3d96){if(typeof _0x2d3d96==='string')_0x108fba[_0x57cb92(0xc3)]=_0x2d3d96;else _0x2d3d96 instanceof Buffer?_0x108fba[_0x57cb92(0xc3)]=_0x2d3d96:_0x108fba[_0x57cb92(0xc3)]=JSON['stringify'](_0x2d3d96);}const _0x16eb9a=await fetch(_0x10b209,_0x108fba);return clearTimeout(_0xcc31ff),!_0x16eb9a['ok']&&await this[_0x57cb92(0x8b)](_0x16eb9a),_0x16eb9a;}catch(_0x4b9cb5){clearTimeout(_0xcc31ff);if(_0x4b9cb5 instanceof HTTPClientError)throw _0x4b9cb5;if(_0x4b9cb5[_0x57cb92(0xaa)]===_0x57cb92(0x9a))throw new Error(_0x57cb92(0xbe));if(this[_0x57cb92(0x9d)]&&_0x4b9cb5 instanceof Error&&this['isProxyConnectionError'](_0x4b9cb5))throw new SDKError(ErrorCode['PROXY_CONNECTION_FAILURE'],'Failed\x20to\x20connect\x20through\x20proxy\x20'+this[_0x57cb92(0xb1)](this['proxyUrl'])+':\x20'+_0x4b9cb5[_0x57cb92(0xd4)],_0x4b9cb5);throw _0x4b9cb5;}}[a93_0x408024(0x8d)](_0x21c591){const _0x3e5676=a93_0x408024,_0x5d6a78=new AbortController();for(const _0x34182a of _0x21c591){if(_0x34182a['aborted'])return _0x5d6a78[_0x3e5676(0xad)](),_0x5d6a78['signal'];_0x34182a[_0x3e5676(0xc0)](_0x3e5676(0xad),()=>_0x5d6a78[_0x3e5676(0xad)](),{'once':!![]});}return _0x5d6a78['signal'];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a94_0x515b(_0x40aa53,_0xb3f2ea){_0x40aa53=_0x40aa53-0xb4;const _0x18bcaa=a94_0x18bc();let _0x515b74=_0x18bcaa[_0x40aa53];return _0x515b74;}const a94_0x2bdfb7=a94_0x515b;function a94_0x18bc(){const _0xb9c544=['18165DJGmwv','/api/experimental_knowledge_bases','data','createExperimentalKnowledgeBase','/api/experimental_artifacts?filter[projectId]=','updatePrompt','714686nIyBIT','/api/tool_targets?filter[targetType]=ExperimentalKnowledgeBase&filter[project_id]=','GET','\x20characters','listPrompts','approximate','88UgwXXd','prompts','Failed\x20to\x20create\x20chat:\x20unexpected\x20error','LLM_CHAT_CREATION_FAILURE','/history','getExperimentalKnowledgeBase','outputs','webSearchTools','updateExperimentalArtifact','POST','listToolTargets','userLocation','parentSegmentKnowledgeBases','search','/api/text_knowledge_bases','12464YxlUvc','America/Los_Angeles','/api/prompts','/api/projects/','tdx.client.llm','prompt','getChatInfo','getParentSegmentKnowledgeBase','searchContextSize','integrations','logger','createIntegration','toString','debug','&filter[project_id]=','length','/api/integrations?filter[projectId]=','LLM_STREAM_ERROR','/api/knowledge_bases?filter[projectId]=','site','/api/chats/','getAgent','listWebSearchTools','requestSSE','getTextKnowledgeBase','imageReturnMode','12215VsHaoE','/api/agents/','80qFccdp','http','textKnowledgeBases','experimentalArtifacts','status','name','createExperimentalArtifact','/api/tool_targets?filter[targetType]=TextKnowledgeBase&filter[project_id]=','listAgents','createProject','listChats','starterMessage','/api/tool_targets?filter[targetType]=WebSearchTool&filter[project_id]=','projectId','[Retry\x20','next','-last_conversation_at','\x20attempts:\x20API\x20returned\x20empty\x20chat\x20ID','1091096KnbhHn','updateKnowledgeBase','/api/experimental_artifacts/','accessToken','request','/api/chats?','modelType','PATCH','/api/agents','imageGenerators','maxToolIterations','continueChat','description','San\x20Francisco','map','California','createImageGenerator','systemPrompt','startChat','Continuing\x20chat\x20','LLM_EMPTY_MESSAGE','/api/web_search_tools','/langfuse','append','Failed\x20to\x20continue\x20chat\x20(chatId:\x20','createTextKnowledgeBase','getChatHistory','application/json','/api/text_knowledge_bases/','listExperimentalKnowledgeBases','authHeaders','warn','chats','updateAgent','reasoningEffort','paginateAll','sort','&page[limit]=50','&page[limit]=1','/continue','knowledge_bases','nova-canvas','updateIntegration','getChatLog','95660WrtzZB',']\x20Streaming\x20SSE\x20stream\x20for\x20chatId:\x20','baseUrl','/api/chats','2493NDsDkD','/api/prompts/','httpClient','/api/agents?page[limit]=50','DELETE','listAgentsFull','listExperimentalArtifacts','startsWith','application/vnd.api+json','proxy','links','createAgentResponse','/api/tool_targets?filter[targetType]=ParentSegmentKnowledgeBase&filter[project_id]=','getProject','createWebSearchTool',',\x20message\x20length:\x20','ms...','Message\x20cannot\x20be\x20empty\x20or\x20whitespace\x20only','5443320WghLcF','pathname','createKnowledgeBase','846GHCULO','page[limit]','agents','Failed\x20to\x20create\x20chat\x20after\x20','experimentalKnowledgeBases','/api/integrations/','updateExperimentalKnowledgeBase','/api/experimental_artifacts','/api/experimental_knowledge_bases/','getUserSettings','filters','/api/tool_targets?filter[targetType]=ImageGenerator&filter[project_id]=','getExperimentalArtifact','/api/knowledge_bases','updateAgentResponse','1ImJePc'];a94_0x18bc=function(){return _0xb9c544;};return a94_0x18bc();}(function(_0x139254,_0x553d8c){const _0xb239d6=a94_0x515b,_0xb44ca1=_0x139254();while(!![]){try{const _0x5657c5=-parseInt(_0xb239d6(0x10f))/0x1*(-parseInt(_0xb239d6(0xbb))/0x2)+parseInt(_0xb239d6(0x110))/0x3*(parseInt(_0xb239d6(0x147))/0x4)+parseInt(_0xb239d6(0x145))/0x5*(-parseInt(_0xb239d6(0x100))/0x6)+-parseInt(_0xb239d6(0x116))/0x7+parseInt(_0xb239d6(0x12b))/0x8*(parseInt(_0xb239d6(0xeb))/0x9)+-parseInt(_0xb239d6(0xe7))/0xa*(-parseInt(_0xb239d6(0x11c))/0xb)+-parseInt(_0xb239d6(0xfd))/0xc;if(_0x5657c5===_0x553d8c)break;else _0xb44ca1['push'](_0xb44ca1['shift']());}catch(_0x537d56){_0xb44ca1['push'](_0xb44ca1['shift']());}}}(a94_0x18bc,0x4308b));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';import{Logger}from'../../utils/logger/index.js';export class LLMApiClient{[a94_0x2bdfb7(0xed)];[a94_0x2bdfb7(0xe9)];[a94_0x2bdfb7(0xd9)];[a94_0x2bdfb7(0x135)]=Logger['of'](a94_0x2bdfb7(0x12f));constructor(_0x110fc3){const _0x142cc0=a94_0x2bdfb7;this[_0x142cc0(0xe9)]=getEndpoint(_0x110fc3[_0x142cc0(0x13e)],'llm'),this['authHeaders']=toHeaderRecord(getAuthHeaders(_0x110fc3[_0x142cc0(0x13e)],_0x110fc3['apiKey'],_0x110fc3[_0x142cc0(0xbe)])),this[_0x142cc0(0xed)]=new HTTPClient(this[_0x142cc0(0xe9)],this[_0x142cc0(0xd9)],{'proxy':_0x110fc3[_0x142cc0(0xf4)]});}async[a94_0x2bdfb7(0xde)](_0x270734){const _0x286dfb=a94_0x2bdfb7,_0x281f5b=[];let _0xaf907a=_0x270734;while(_0xaf907a){const _0x2b3611=await this[_0x286dfb(0xed)][_0x286dfb(0xbf)](_0x286dfb(0x118),_0xaf907a);_0x2b3611[_0x286dfb(0x112)]&&_0x281f5b['push'](..._0x2b3611[_0x286dfb(0x112)]);_0xaf907a=_0x2b3611[_0x286dfb(0xf5)]?.[_0x286dfb(0xb8)];if(_0xaf907a&&_0xaf907a[_0x286dfb(0xf2)](_0x286dfb(0x148))){const _0x43f1c6=new URL(_0xaf907a);_0xaf907a=_0x43f1c6[_0x286dfb(0xfe)]+_0x43f1c6[_0x286dfb(0x129)];}}return _0x281f5b;}async[a94_0x2bdfb7(0x109)](){const _0x2cf68d=a94_0x2bdfb7;return await this[_0x2cf68d(0xed)]['request']('GET','/api/users/current_settings');}async[a94_0x2bdfb7(0x150)](_0x5986ee){const _0x1ee62d=a94_0x2bdfb7,_0x29ed50={'data':{'type':'projects','attributes':{'name':_0x5986ee[_0x1ee62d(0x14c)],..._0x5986ee[_0x1ee62d(0xc7)]&&{'description':_0x5986ee[_0x1ee62d(0xc7)]}}}},_0x2f9c53=await this[_0x1ee62d(0xed)][_0x1ee62d(0xbf)]('POST','/api/projects',{'headers':{'Content-Type':_0x1ee62d(0xf3),'Accept':_0x1ee62d(0xf3)},'body':_0x29ed50});return _0x2f9c53[_0x1ee62d(0x112)];}async['deleteProject'](_0xdd706e){const _0x2d464c=a94_0x2bdfb7,_0x3c2898='/api/projects/'+encodeURIComponent(_0xdd706e);await this[_0x2d464c(0xed)][_0x2d464c(0xbf)](_0x2d464c(0xef),_0x3c2898);}async['listProjects'](_0x2072aa=0x32){const _0x25fa67=a94_0x2bdfb7;return this[_0x25fa67(0xde)]('/api/projects?page[limit]='+_0x2072aa);}async[a94_0x2bdfb7(0x14f)](_0x2eaa5e){const _0x12e107=a94_0x2bdfb7;let _0xd5050a=_0x12e107(0xee);return _0x2eaa5e&&(_0xd5050a+=_0x12e107(0x139)+encodeURIComponent(_0x2eaa5e)),this[_0x12e107(0xde)](_0xd5050a);}async[a94_0x2bdfb7(0x140)](_0x1012e6){const _0x1657ad=a94_0x2bdfb7,_0x551e4f='/api/agents/'+encodeURIComponent(_0x1012e6),_0xa57697=await this[_0x1657ad(0xed)][_0x1657ad(0xbf)](_0x1657ad(0x118),_0x551e4f);return _0xa57697[_0x1657ad(0x112)];}async['createAgent'](_0x31bc4c){const _0xff579=a94_0x2bdfb7,_0x577529={'name':_0x31bc4c[_0xff579(0x14c)],'projectId':_0x31bc4c[_0xff579(0xb6)],'modelType':_0x31bc4c[_0xff579(0xc1)],'maxToolIterations':_0x31bc4c[_0xff579(0xc5)]??0x4,'temperature':_0x31bc4c['temperature']??0.7};_0x31bc4c['systemPrompt']!==undefined&&(_0x577529[_0xff579(0xcc)]=_0x31bc4c[_0xff579(0xcc)]);_0x31bc4c[_0xff579(0xb4)]&&(_0x577529[_0xff579(0xb4)]=_0x31bc4c['starterMessage']);_0x31bc4c[_0xff579(0xdd)]&&(_0x577529[_0xff579(0xdd)]=_0x31bc4c[_0xff579(0xdd)]);_0x31bc4c[_0xff579(0x122)]&&_0x31bc4c[_0xff579(0x122)][_0xff579(0x13a)]>0x0&&(_0x577529['outputs']=_0x31bc4c[_0xff579(0x122)]);const _0x5dc90c={'data':{'type':_0xff579(0x102),'attributes':_0x577529}},_0x1f89c8=await this['httpClient']['request'](_0xff579(0x125),_0xff579(0xc3),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0xff579(0xf3)},'body':_0x5dc90c});return _0x1f89c8[_0xff579(0x112)];}async[a94_0x2bdfb7(0xdc)](_0x3d5edd,_0x217a2f){const _0x21ad5b=a94_0x2bdfb7,_0x4e3d61={'data':{'type':_0x21ad5b(0x102),'id':_0x3d5edd,'attributes':{..._0x217a2f[_0x21ad5b(0x14c)]&&{'name':_0x217a2f[_0x21ad5b(0x14c)]},..._0x217a2f[_0x21ad5b(0xc7)]&&{'description':_0x217a2f[_0x21ad5b(0xc7)]},..._0x217a2f[_0x21ad5b(0x130)]&&{'prompt':_0x217a2f[_0x21ad5b(0x130)]},..._0x217a2f[_0x21ad5b(0xb4)]&&{'starter_message':_0x217a2f[_0x21ad5b(0xb4)]},..._0x217a2f['reasoningEffort']&&{'reasoningEffort':_0x217a2f[_0x21ad5b(0xdd)]}}}},_0x4cfc83=_0x21ad5b(0x146)+encodeURIComponent(_0x3d5edd),_0x1b8700=await this[_0x21ad5b(0xed)][_0x21ad5b(0xbf)](_0x21ad5b(0xc2),_0x4cfc83,{'headers':{'Content-Type':'application/vnd.api+json'},'body':_0x4e3d61});return _0x1b8700['data'];}async['deleteAgent'](_0x14c980){const _0x56ba61=a94_0x2bdfb7,_0x2ed88d=_0x56ba61(0x146)+encodeURIComponent(_0x14c980);await this[_0x56ba61(0xed)]['request']('DELETE',_0x2ed88d);}async[a94_0x2bdfb7(0x151)](_0xad47da=0x32){const _0x516393=a94_0x2bdfb7,_0x28f061=new URLSearchParams();_0x28f061['append'](_0x516393(0x101),String(_0xad47da)),_0x28f061[_0x516393(0xd2)](_0x516393(0xdf),_0x516393(0xb9));const _0x4db69a=_0x516393(0xc0)+_0x28f061[_0x516393(0x137)](),_0x3cfb35=await this['httpClient'][_0x516393(0xbf)](_0x516393(0x118),_0x4db69a);return _0x3cfb35[_0x516393(0x112)]||[];}async[a94_0x2bdfb7(0x131)](_0x1abb80){const _0x1b6ea6=a94_0x2bdfb7,_0x162072=_0x1b6ea6(0x13f)+encodeURIComponent(_0x1abb80),_0xfe2a84=await this[_0x1b6ea6(0xed)][_0x1b6ea6(0xbf)]('GET',_0x162072);return _0xfe2a84[_0x1b6ea6(0x112)];}async[a94_0x2bdfb7(0xd5)](_0x7ceb93){const _0x366867=a94_0x2bdfb7,_0x3887b9=_0x366867(0x13f)+encodeURIComponent(_0x7ceb93)+_0x366867(0x120);return await this['httpClient'][_0x366867(0xbf)](_0x366867(0x118),_0x3887b9);}async[a94_0x2bdfb7(0xe6)](_0x273433){const _0x392f5f=a94_0x2bdfb7,_0x39c6cf=_0x392f5f(0x13f)+encodeURIComponent(_0x273433)+_0x392f5f(0xd1);return await this[_0x392f5f(0xed)][_0x392f5f(0xbf)](_0x392f5f(0x118),_0x39c6cf);}async[a94_0x2bdfb7(0xcd)](_0x1f6187){const _0x5cc84c=a94_0x2bdfb7,_0x1784ac={'data':{'type':_0x5cc84c(0xdb),'attributes':{'agentId':_0x1f6187['agentId']}}},_0x1797a6=0x3,_0x3cd948=[0x3e8,0x7d0,0xfa0];for(let _0x558040=0x0;_0x558040<=_0x1797a6;_0x558040++){const _0x560146=await this[_0x5cc84c(0xed)][_0x5cc84c(0xbf)](_0x5cc84c(0x125),_0x5cc84c(0xea),{'headers':{'Content-Type':_0x5cc84c(0xf3),'Accept':_0x5cc84c(0xf3)},'body':_0x1784ac});if(_0x560146[_0x5cc84c(0x112)]&&_0x560146[_0x5cc84c(0x112)]['id'])return _0x560146['data'];if(_0x558040>=_0x1797a6)throw new SDKError(ErrorCode[_0x5cc84c(0x11f)],_0x5cc84c(0x103)+(_0x1797a6+0x1)+_0x5cc84c(0xba));const _0x16c59c=_0x3cd948[_0x558040];console[_0x5cc84c(0xda)](_0x5cc84c(0xb7)+(_0x558040+0x1)+'/'+_0x1797a6+']\x20Chat\x20creation\x20returned\x20empty\x20ID,\x20retrying\x20in\x20'+_0x16c59c+_0x5cc84c(0xfb)),await new Promise(_0x1cffb1=>setTimeout(_0x1cffb1,_0x16c59c));}throw new SDKError(ErrorCode[_0x5cc84c(0x11f)],_0x5cc84c(0x11e));}async*[a94_0x2bdfb7(0xc6)](_0x16b62c,_0xc92839,_0x2254ed){const _0x4621aa=a94_0x2bdfb7,_0x5cfadd=_0xc92839['trim']();if(!_0x5cfadd)throw new SDKError(ErrorCode[_0x4621aa(0xcf)],_0x4621aa(0xfc),undefined,{'helpText':'Please\x20provide\x20a\x20non-empty\x20message\x20to\x20continue\x20the\x20chat.'});this[_0x4621aa(0x135)]['debug'](_0x4621aa(0xce)+_0x16b62c+'\x20with\x20message\x20size:\x20'+_0xc92839[_0x4621aa(0x13a)]+_0x4621aa(0x119));const _0x2871ca=_0x4621aa(0x13f)+encodeURIComponent(_0x16b62c)+_0x4621aa(0xe2),_0xc97e41={'input':_0xc92839};try{const _0x544578=await this[_0x4621aa(0xed)][_0x4621aa(0x142)](_0x4621aa(0x125),_0x2871ca,{'headers':{'Content-Type':_0x4621aa(0xd6),'Accept':'text/event-stream'},'body':_0xc97e41,'signal':_0x2254ed});this['logger'][_0x4621aa(0x138)]('['+_0x544578[_0x4621aa(0x14b)]+_0x4621aa(0xe8)+_0x16b62c),yield*parseSSEStream(_0x544578,this[_0x4621aa(0x135)]);}catch(_0x197c92){throw new SDKError(ErrorCode[_0x4621aa(0x13c)],_0x4621aa(0xd3)+_0x16b62c+_0x4621aa(0xfa)+_0xc92839[_0x4621aa(0x13a)]+')',_0x197c92);}}async[a94_0x2bdfb7(0xf8)](_0x389dbf){const _0x5aa9a7=a94_0x2bdfb7,_0x4ae646=_0x5aa9a7(0x12e)+encodeURIComponent(_0x389dbf),_0x45c7ef=await this[_0x5aa9a7(0xed)]['request'](_0x5aa9a7(0x118),_0x4ae646);return _0x45c7ef[_0x5aa9a7(0x112)];}async['listKnowledgeBases'](_0x65ebd0){const _0x4a7f6e=a94_0x2bdfb7;return this[_0x4a7f6e(0xde)](_0x4a7f6e(0x13d)+encodeURIComponent(_0x65ebd0)+_0x4a7f6e(0xe0));}async[a94_0x2bdfb7(0xff)](_0x3c063c){const _0x32908c=a94_0x2bdfb7,_0x48209a={'data':{'type':_0x32908c(0xe3),'attributes':_0x3c063c}},_0xcb89bb=await this[_0x32908c(0xed)]['request']('POST',_0x32908c(0x10d),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x48209a});return _0xcb89bb[_0x32908c(0x112)];}async[a94_0x2bdfb7(0x126)](_0x3cd22c,_0x532c47){const _0x35f6c4=a94_0x2bdfb7;return this[_0x35f6c4(0xde)]('/api/tool_targets?filter[targetType]='+encodeURIComponent(_0x3cd22c)+'&filter[project_id]='+encodeURIComponent(_0x532c47)+'&page[limit]=50');}async['listTextKnowledgeBases'](_0x43b127){const _0x51bdda=a94_0x2bdfb7,_0x5a3fd7=await this[_0x51bdda(0xde)](_0x51bdda(0x14e)+encodeURIComponent(_0x43b127)+'&page[limit]=50');return _0x5a3fd7[_0x51bdda(0xc9)](_0x4fb205=>({..._0x4fb205,'type':'textKnowledgeBases'}));}async[a94_0x2bdfb7(0x143)](_0x68e753){const _0x7180e3=a94_0x2bdfb7,_0x262ec1=await this[_0x7180e3(0xed)][_0x7180e3(0xbf)](_0x7180e3(0x118),_0x7180e3(0xd7)+encodeURIComponent(_0x68e753),{'headers':{'Accept':_0x7180e3(0xf3)}});return _0x262ec1[_0x7180e3(0x112)];}async[a94_0x2bdfb7(0xd4)](_0x2b597e){const _0x3c8d40=a94_0x2bdfb7,_0x3122ed={'data':{'type':'textKnowledgeBases','attributes':_0x2b597e}},_0x10e8d2=await this[_0x3c8d40(0xed)][_0x3c8d40(0xbf)]('POST',_0x3c8d40(0x12a),{'headers':{'Content-Type':_0x3c8d40(0xf3),'Accept':_0x3c8d40(0xf3)},'body':_0x3122ed});return _0x10e8d2[_0x3c8d40(0x112)];}async['updateTextKnowledgeBase'](_0x1afcd2,_0x2fef8b){const _0x51ed80=a94_0x2bdfb7,_0x4b6599={'data':{'type':_0x51ed80(0x149),'id':_0x1afcd2,'attributes':_0x2fef8b}},_0x5206aa=await this['httpClient'][_0x51ed80(0xbf)](_0x51ed80(0xc2),_0x51ed80(0xd7)+encodeURIComponent(_0x1afcd2),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x51ed80(0xf3)},'body':_0x4b6599});return _0x5206aa[_0x51ed80(0x112)];}async[a94_0x2bdfb7(0xcb)](_0x8a7939){const _0x288d4b=a94_0x2bdfb7,_0x24cba0={'data':{'type':_0x288d4b(0xc4),'attributes':{..._0x8a7939,'imageModelType':_0x8a7939['imageModelType']||_0x288d4b(0xe4),'imageReturnMode':_0x8a7939[_0x288d4b(0x144)]||'ID'}}},_0x45b4b6=await this[_0x288d4b(0xed)][_0x288d4b(0xbf)](_0x288d4b(0x125),'/api/image_generators',{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x288d4b(0xf3)},'body':_0x24cba0});return _0x45b4b6[_0x288d4b(0x112)];}async[a94_0x2bdfb7(0xf9)](_0x411b79){const _0x2fcb63=a94_0x2bdfb7,_0x51d51f={'data':{'type':_0x2fcb63(0x123),'attributes':{'projectId':_0x411b79[_0x2fcb63(0xb6)],'name':_0x411b79['name'],'modelType':_0x411b79[_0x2fcb63(0xc1)]||'gpt-4o','searchContextSize':_0x411b79[_0x2fcb63(0x133)]||'medium','userLocation':_0x411b79[_0x2fcb63(0x127)]||{'type':_0x2fcb63(0x11b),'country':'US','city':_0x2fcb63(0xc8),'region':_0x2fcb63(0xca),'timezone':_0x2fcb63(0x12c)},'systemPrompt':_0x411b79['systemPrompt']||'You\x20are\x20a\x20helpful\x20search\x20assistant.','filters':_0x411b79[_0x2fcb63(0x10a)]||{'allowed_domains':[]}}}},_0x1bf4a4=await this[_0x2fcb63(0xed)][_0x2fcb63(0xbf)](_0x2fcb63(0x125),_0x2fcb63(0xd0),{'headers':{'Content-Type':_0x2fcb63(0xf3),'Accept':_0x2fcb63(0xf3)},'body':_0x51d51f});return _0x1bf4a4[_0x2fcb63(0x112)];}async['listImageGenerators'](_0x27db7a){const _0x2b3bbb=a94_0x2bdfb7,_0x2b0bac=await this[_0x2b3bbb(0xde)](_0x2b3bbb(0x10b)+encodeURIComponent(_0x27db7a)+'&page[limit]=50');return _0x2b0bac[_0x2b3bbb(0xc9)](_0x360dad=>({..._0x360dad,'type':_0x2b3bbb(0xc4)}));}async[a94_0x2bdfb7(0x141)](_0x8d5348){const _0x39f213=a94_0x2bdfb7,_0x12d6da=await this['paginateAll'](_0x39f213(0xb5)+encodeURIComponent(_0x8d5348)+'&page[limit]=50');return _0x12d6da[_0x39f213(0xc9)](_0x112b1c=>({..._0x112b1c,'type':_0x39f213(0x123)}));}async[a94_0x2bdfb7(0x132)](_0x31c4d9){const _0x1f97fb=a94_0x2bdfb7,_0x32c54e=await this[_0x1f97fb(0xde)](_0x1f97fb(0xf7)+encodeURIComponent(_0x31c4d9)+_0x1f97fb(0xe1));if(_0x32c54e['length']===0x0)return undefined;return{..._0x32c54e[0x0],'type':_0x1f97fb(0x128)};}async[a94_0x2bdfb7(0x11a)](_0x1e1cb5){const _0x282785=a94_0x2bdfb7;return this[_0x282785(0xde)]('/api/prompts?filter[projectId]='+encodeURIComponent(_0x1e1cb5)+_0x282785(0xe0));}async['createPrompt'](_0x2936f7){const _0x2bb7ef=a94_0x2bdfb7,{jsonSchemaHint:_0x40bd25,..._0x1988ec}=_0x2936f7,_0x2891f9={'data':{'type':_0x2bb7ef(0x11d),'attributes':_0x1988ec}},_0x9350f=await this[_0x2bb7ef(0xed)][_0x2bb7ef(0xbf)](_0x2bb7ef(0x125),_0x2bb7ef(0x12d),{'headers':{'Content-Type':_0x2bb7ef(0xf3),'Accept':_0x2bb7ef(0xf3)},'body':_0x2891f9});return _0x9350f['data'];}async['listIntegrations'](_0x5908e4){const _0x3a58c4=a94_0x2bdfb7;return this[_0x3a58c4(0xde)](_0x3a58c4(0x13b)+encodeURIComponent(_0x5908e4)+_0x3a58c4(0xe0));}async[a94_0x2bdfb7(0x136)](_0x50f212){const _0x579b8f=a94_0x2bdfb7,_0x4cccba={'data':{'type':'integrations','attributes':_0x50f212}},_0xbcd656=await this[_0x579b8f(0xed)][_0x579b8f(0xbf)]('POST','/api/integrations',{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x579b8f(0xf3)},'body':_0x4cccba});return _0xbcd656['data'];}async[a94_0x2bdfb7(0xd8)](_0x36907a){const _0x5c6afc=a94_0x2bdfb7,_0x17ce19=await this[_0x5c6afc(0xde)](_0x5c6afc(0x117)+encodeURIComponent(_0x36907a)+'&page[limit]=50');return _0x17ce19[_0x5c6afc(0xc9)](_0x290033=>({..._0x290033,'type':_0x5c6afc(0x104)}));}async[a94_0x2bdfb7(0x121)](_0x5298a8){const _0x10a533=a94_0x2bdfb7,_0x3d7579=await this[_0x10a533(0xed)][_0x10a533(0xbf)](_0x10a533(0x118),_0x10a533(0x108)+encodeURIComponent(_0x5298a8),{'headers':{'Accept':_0x10a533(0xf3)}});return _0x3d7579[_0x10a533(0x112)];}async[a94_0x2bdfb7(0x113)](_0x2b0c5f){const _0x205506=a94_0x2bdfb7,_0x25c2ef={'data':{'type':_0x205506(0x104),'attributes':_0x2b0c5f}},_0x4577bf=await this[_0x205506(0xed)]['request'](_0x205506(0x125),_0x205506(0x111),{'headers':{'Content-Type':_0x205506(0xf3),'Accept':_0x205506(0xf3)},'body':_0x25c2ef});return _0x4577bf[_0x205506(0x112)];}async[a94_0x2bdfb7(0x106)](_0x22f51d,_0x48bac8){const _0x575e4b=a94_0x2bdfb7,_0x59bb48={'data':{'type':_0x575e4b(0x104),'id':_0x22f51d,'attributes':_0x48bac8}},_0x57d1df=await this[_0x575e4b(0xed)][_0x575e4b(0xbf)](_0x575e4b(0xc2),'/api/experimental_knowledge_bases/'+encodeURIComponent(_0x22f51d),{'headers':{'Content-Type':_0x575e4b(0xf3),'Accept':'application/vnd.api+json'},'body':_0x59bb48});return _0x57d1df[_0x575e4b(0x112)];}async[a94_0x2bdfb7(0xf1)](_0x1c02b1){const _0x3d394a=a94_0x2bdfb7;return this[_0x3d394a(0xde)](_0x3d394a(0x114)+encodeURIComponent(_0x1c02b1)+_0x3d394a(0xe0));}async[a94_0x2bdfb7(0x10c)](_0x22e044){const _0x6a5dfa=a94_0x2bdfb7,_0x4fd1f8=await this[_0x6a5dfa(0xed)]['request']('GET',_0x6a5dfa(0xbd)+encodeURIComponent(_0x22e044),{'headers':{'Accept':_0x6a5dfa(0xf3)}});return _0x4fd1f8[_0x6a5dfa(0x112)];}async[a94_0x2bdfb7(0x14d)](_0x339f63){const _0x135297=a94_0x2bdfb7,_0x24d8fc={'data':{'type':_0x135297(0x14a),'attributes':_0x339f63}},_0xb996ad=await this['httpClient'][_0x135297(0xbf)](_0x135297(0x125),_0x135297(0x107),{'headers':{'Content-Type':_0x135297(0xf3),'Accept':'application/vnd.api+json'},'body':_0x24d8fc});return _0xb996ad[_0x135297(0x112)];}async[a94_0x2bdfb7(0x124)](_0x3dc7fa,_0x5aef48){const _0x2a0eab=a94_0x2bdfb7,_0x218399={'data':{'type':'experimentalArtifacts','id':_0x3dc7fa,'attributes':_0x5aef48}},_0x43c92c=await this[_0x2a0eab(0xed)][_0x2a0eab(0xbf)](_0x2a0eab(0xc2),'/api/experimental_artifacts/'+encodeURIComponent(_0x3dc7fa),{'headers':{'Content-Type':_0x2a0eab(0xf3),'Accept':'application/vnd.api+json'},'body':_0x218399});return _0x43c92c[_0x2a0eab(0x112)];}async[a94_0x2bdfb7(0xf0)](_0xa81367){const _0x32b73f=a94_0x2bdfb7,_0x45b7a1=await this[_0x32b73f(0x14f)](_0xa81367),_0x1b5bd9=[];for(const _0x216de7 of _0x45b7a1){const _0x16bace=_0x32b73f(0x146)+encodeURIComponent(_0x216de7['id']),_0x429d73=await this[_0x32b73f(0xed)][_0x32b73f(0xbf)](_0x32b73f(0x118),_0x16bace);_0x1b5bd9['push'](_0x429d73[_0x32b73f(0x112)]);}return _0x1b5bd9;}async[a94_0x2bdfb7(0xf6)](_0x5c99ad){const _0x23d9d1=a94_0x2bdfb7,_0x202bcb={'data':{'type':'agents','attributes':_0x5c99ad}},_0x2d1169=await this[_0x23d9d1(0xed)][_0x23d9d1(0xbf)]('POST','/api/agents',{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x23d9d1(0xf3)},'body':_0x202bcb});return _0x2d1169[_0x23d9d1(0x112)];}async[a94_0x2bdfb7(0x10e)](_0x1dcd43,_0x338a79){const _0x42dad0=a94_0x2bdfb7,_0x401725={'data':{'type':_0x42dad0(0x102),'id':_0x1dcd43,'attributes':_0x338a79}},_0x58ab89=_0x42dad0(0x146)+encodeURIComponent(_0x1dcd43),_0x4a56c1=await this[_0x42dad0(0xed)][_0x42dad0(0xbf)](_0x42dad0(0xc2),_0x58ab89,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x42dad0(0xf3)},'body':_0x401725});return _0x4a56c1['data'];}async[a94_0x2bdfb7(0xbc)](_0x520ec1,_0x319a92){const _0x4195be=a94_0x2bdfb7,_0x48dfd1={'data':{'type':_0x4195be(0xe3),'id':_0x520ec1,'attributes':_0x319a92}},_0x22ff18='/api/knowledge_bases/'+encodeURIComponent(_0x520ec1),_0x1c5da2=await this[_0x4195be(0xed)]['request']('PATCH',_0x22ff18,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x4195be(0xf3)},'body':_0x48dfd1});return _0x1c5da2[_0x4195be(0x112)];}async[a94_0x2bdfb7(0x115)](_0x274af0,_0x413ad3){const _0x28e176=a94_0x2bdfb7,{jsonSchemaHint:_0x218628,..._0x2ece52}=_0x413ad3,_0x5baef2={'data':{'type':_0x28e176(0x11d),'id':_0x274af0,'attributes':_0x2ece52}},_0x3f16d1=_0x28e176(0xec)+encodeURIComponent(_0x274af0),_0x21e4ef=await this['httpClient'][_0x28e176(0xbf)](_0x28e176(0xc2),_0x3f16d1,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x28e176(0xf3)},'body':_0x5baef2});return _0x21e4ef[_0x28e176(0x112)];}async[a94_0x2bdfb7(0xe5)](_0x50b93b,_0x5748c7){const _0x2fa5e3=a94_0x2bdfb7,_0x1beeda={'data':{'type':_0x2fa5e3(0x134),'id':_0x50b93b,'attributes':_0x5748c7}},_0x4e5865=_0x2fa5e3(0x105)+encodeURIComponent(_0x50b93b),_0x43e304=await this[_0x2fa5e3(0xed)]['request']('PATCH',_0x4e5865,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x2fa5e3(0xf3)},'body':_0x1beeda});return _0x43e304[_0x2fa5e3(0x112)];}async['deleteIntegration'](_0x3efc1c){const _0x24f4e6=a94_0x2bdfb7,_0x13b3b5=_0x24f4e6(0x105)+encodeURIComponent(_0x3efc1c);await this['httpClient']['request']('DELETE',_0x13b3b5);}}
|
|
1
|
+
const a94_0x5a351e=a94_0x4c87;(function(_0x163087,_0x59a4ef){const _0x38064f=a94_0x4c87,_0x4f306d=_0x163087();while(!![]){try{const _0x6df4e9=-parseInt(_0x38064f(0x11a))/0x1+-parseInt(_0x38064f(0x11e))/0x2+parseInt(_0x38064f(0x173))/0x3*(-parseInt(_0x38064f(0x147))/0x4)+parseInt(_0x38064f(0x14d))/0x5+parseInt(_0x38064f(0x101))/0x6+parseInt(_0x38064f(0x144))/0x7*(-parseInt(_0x38064f(0x155))/0x8)+parseInt(_0x38064f(0x12a))/0x9;if(_0x6df4e9===_0x59a4ef)break;else _0x4f306d['push'](_0x4f306d['shift']());}catch(_0x199569){_0x4f306d['push'](_0x4f306d['shift']());}}}(a94_0x5a1a,0x61f5a));import{HTTPClient}from'./http-client.js';function a94_0x4c87(_0x1bcbd4,_0x397716){_0x1bcbd4=_0x1bcbd4-0xff;const _0x5a1a99=a94_0x5a1a();let _0x4c872d=_0x5a1a99[_0x1bcbd4];return _0x4c872d;}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 a94_0x5a1a(){const _0x10e56a=['maxToolIterations','agentId','1208964ZXjLEP','\x20attempts:\x20API\x20returned\x20empty\x20chat\x20ID','/api/prompts','Please\x20provide\x20a\x20non-empty\x20message\x20to\x20continue\x20the\x20chat.','httpClient','Failed\x20to\x20continue\x20chat\x20(chatId:\x20','listProjects','apiKey','/api/integrations/','[Retry\x20','getAgent','deleteIntegration','13129776UnWvlP','listIntegrations','projectId','listKnowledgeBases','/api/text_knowledge_bases','listPrompts','application/json','getChatLog','continueChat','prompt','/api/projects?page[limit]=','webSearchTools','temperature','LLM_EMPTY_MESSAGE','knowledge_bases','debug','/api/projects','listTextKnowledgeBases','description','GET','application/vnd.api+json','imageGenerators',']\x20Streaming\x20SSE\x20stream\x20for\x20chatId:\x20','parentSegmentKnowledgeBases','http','createKnowledgeBase','7qioxfj','/api/experimental_knowledge_bases','/api/image_generators','176WdinPz','filters','\x20characters',',\x20message\x20length:\x20','request','textKnowledgeBases','4010910WcHesG','ms...','/api/experimental_artifacts?filter[projectId]=','integrations','startsWith','You\x20are\x20a\x20helpful\x20search\x20assistant.','modelType','reasoningEffort','6253224Pxngmm','outputs','Continuing\x20chat\x20','LLM_CHAT_CREATION_FAILURE','/api/experimental_artifacts','starterMessage','/api/knowledge_bases','systemPrompt','createWebSearchTool','/api/experimental_artifacts/','getExperimentalKnowledgeBase','sort','\x20with\x20message\x20size:\x20','map','data','prompts','listWebSearchTools','/api/chats','tdx.client.llm','logger','authHeaders','DELETE','updatePrompt',']\x20Chat\x20creation\x20returned\x20empty\x20ID,\x20retrying\x20in\x20','searchContextSize','push','/api/knowledge_bases/','deleteProject','site','PATCH','48252QWECgu','paginateAll','createTextKnowledgeBase','/api/tool_targets?filter[targetType]=ExperimentalKnowledgeBase&filter[project_id]=','nova-canvas','getExperimentalArtifact','/api/agents','search','getChatHistory','userLocation','createProject','updateKnowledgeBase','status','getParentSegmentKnowledgeBase','/api/agents?page[limit]=50','/api/tool_targets?filter[targetType]=','createExperimentalArtifact','agents','San\x20Francisco','medium','warn','listExperimentalArtifacts','requestSSE','&page[limit]=50','/api/integrations?filter[projectId]=','projects','createAgent','&filter[project_id]=','experimentalArtifacts','experimentalKnowledgeBases','/api/integrations','Failed\x20to\x20create\x20chat:\x20unexpected\x20error','listChats','pathname','accessToken','listAgents','length','chats','append','baseUrl','/api/text_knowledge_bases/','getProject','California','-last_conversation_at','LLM_STREAM_ERROR','getChatInfo','updateAgent','approximate','/langfuse','3292386vAgNUJ','/api/experimental_knowledge_bases/','listExperimentalKnowledgeBases','POST','/api/prompts?filter[projectId]=','/api/tool_targets?filter[targetType]=WebSearchTool&filter[project_id]=','/api/tool_targets?filter[targetType]=TextKnowledgeBase&filter[project_id]=','updateExperimentalArtifact','/api/agents/','imageModelType','/api/projects/','/api/tool_targets?filter[targetType]=ImageGenerator&filter[project_id]=','createImageGenerator','listToolTargets','Message\x20cannot\x20be\x20empty\x20or\x20whitespace\x20only','/api/knowledge_bases?filter[projectId]=','/continue','/api/web_search_tools','createAgentResponse','/api/tool_targets?filter[targetType]=ParentSegmentKnowledgeBase&filter[project_id]=','name','/api/chats/','links','proxy','llm','314704UNCYvd','getUserSettings'];a94_0x5a1a=function(){return _0x10e56a;};return a94_0x5a1a();}import{Logger}from'../../utils/logger/index.js';export class LLMApiClient{[a94_0x5a351e(0x122)];[a94_0x5a351e(0x19a)];[a94_0x5a351e(0x169)];[a94_0x5a351e(0x168)]=Logger['of'](a94_0x5a351e(0x167));constructor(_0x3e8c03){const _0x324b46=a94_0x5a351e;this[_0x324b46(0x19a)]=getEndpoint(_0x3e8c03[_0x324b46(0x171)],_0x324b46(0x119)),this[_0x324b46(0x169)]=toHeaderRecord(getAuthHeaders(_0x3e8c03[_0x324b46(0x171)],_0x3e8c03[_0x324b46(0x125)],_0x3e8c03[_0x324b46(0x195)])),this[_0x324b46(0x122)]=new HTTPClient(this[_0x324b46(0x19a)],this[_0x324b46(0x169)],{'proxy':_0x3e8c03[_0x324b46(0x118)]});}async[a94_0x5a351e(0x174)](_0x1c984c){const _0x367dc6=a94_0x5a351e,_0x3c406d=[];let _0x34a70e=_0x1c984c;while(_0x34a70e){const _0x14ba07=await this['httpClient'][_0x367dc6(0x14b)](_0x367dc6(0x13d),_0x34a70e);_0x14ba07[_0x367dc6(0x163)]&&_0x3c406d[_0x367dc6(0x16e)](..._0x14ba07[_0x367dc6(0x163)]);_0x34a70e=_0x14ba07[_0x367dc6(0x117)]?.['next'];if(_0x34a70e&&_0x34a70e[_0x367dc6(0x151)](_0x367dc6(0x142))){const _0xd9254a=new URL(_0x34a70e);_0x34a70e=_0xd9254a[_0x367dc6(0x194)]+_0xd9254a[_0x367dc6(0x17a)];}}return _0x3c406d;}async[a94_0x5a351e(0x11b)](){const _0x16c318=a94_0x5a351e;return await this[_0x16c318(0x122)][_0x16c318(0x14b)](_0x16c318(0x13d),'/api/users/current_settings');}async[a94_0x5a351e(0x17d)](_0x194c39){const _0x1dcda8=a94_0x5a351e,_0x18cacd={'data':{'type':_0x1dcda8(0x18c),'attributes':{'name':_0x194c39[_0x1dcda8(0x115)],..._0x194c39[_0x1dcda8(0x13c)]&&{'description':_0x194c39[_0x1dcda8(0x13c)]}}}},_0x4f7aea=await this[_0x1dcda8(0x122)][_0x1dcda8(0x14b)](_0x1dcda8(0x104),_0x1dcda8(0x13a),{'headers':{'Content-Type':_0x1dcda8(0x13e),'Accept':_0x1dcda8(0x13e)},'body':_0x18cacd});return _0x4f7aea[_0x1dcda8(0x163)];}async[a94_0x5a351e(0x170)](_0x55346c){const _0x52521e=a94_0x5a351e,_0x37e19f=_0x52521e(0x10b)+encodeURIComponent(_0x55346c);await this[_0x52521e(0x122)][_0x52521e(0x14b)](_0x52521e(0x16a),_0x37e19f);}async[a94_0x5a351e(0x124)](_0x23d448=0x32){const _0x570e2c=a94_0x5a351e;return this[_0x570e2c(0x174)](_0x570e2c(0x134)+_0x23d448);}async[a94_0x5a351e(0x196)](_0x45d370){const _0x4f1fe8=a94_0x5a351e;let _0x200b20=_0x4f1fe8(0x181);return _0x45d370&&(_0x200b20+=_0x4f1fe8(0x18e)+encodeURIComponent(_0x45d370)),this[_0x4f1fe8(0x174)](_0x200b20);}async[a94_0x5a351e(0x128)](_0x3c7116){const _0x20ae4d=a94_0x5a351e,_0x522570='/api/agents/'+encodeURIComponent(_0x3c7116),_0x47024b=await this[_0x20ae4d(0x122)][_0x20ae4d(0x14b)]('GET',_0x522570);return _0x47024b[_0x20ae4d(0x163)];}async[a94_0x5a351e(0x18d)](_0x550a71){const _0x50a3d7=a94_0x5a351e,_0x309b40={'name':_0x550a71[_0x50a3d7(0x115)],'projectId':_0x550a71[_0x50a3d7(0x12c)],'modelType':_0x550a71[_0x50a3d7(0x153)],'maxToolIterations':_0x550a71[_0x50a3d7(0x11c)]??0x4,'temperature':_0x550a71[_0x50a3d7(0x136)]??0.7};_0x550a71[_0x50a3d7(0x15c)]!==undefined&&(_0x309b40[_0x50a3d7(0x15c)]=_0x550a71[_0x50a3d7(0x15c)]);_0x550a71['starterMessage']&&(_0x309b40[_0x50a3d7(0x15a)]=_0x550a71[_0x50a3d7(0x15a)]);_0x550a71[_0x50a3d7(0x154)]&&(_0x309b40[_0x50a3d7(0x154)]=_0x550a71[_0x50a3d7(0x154)]);_0x550a71[_0x50a3d7(0x156)]&&_0x550a71[_0x50a3d7(0x156)][_0x50a3d7(0x197)]>0x0&&(_0x309b40[_0x50a3d7(0x156)]=_0x550a71[_0x50a3d7(0x156)]);const _0x42c662={'data':{'type':_0x50a3d7(0x184),'attributes':_0x309b40}},_0x2c12e9=await this[_0x50a3d7(0x122)][_0x50a3d7(0x14b)](_0x50a3d7(0x104),_0x50a3d7(0x179),{'headers':{'Content-Type':_0x50a3d7(0x13e),'Accept':_0x50a3d7(0x13e)},'body':_0x42c662});return _0x2c12e9['data'];}async[a94_0x5a351e(0x1a1)](_0xe8f7b1,_0x261ad8){const _0xf49613=a94_0x5a351e,_0x3a6186={'data':{'type':_0xf49613(0x184),'id':_0xe8f7b1,'attributes':{..._0x261ad8[_0xf49613(0x115)]&&{'name':_0x261ad8[_0xf49613(0x115)]},..._0x261ad8[_0xf49613(0x13c)]&&{'description':_0x261ad8['description']},..._0x261ad8[_0xf49613(0x133)]&&{'prompt':_0x261ad8['prompt']},..._0x261ad8[_0xf49613(0x15a)]&&{'starter_message':_0x261ad8[_0xf49613(0x15a)]},..._0x261ad8[_0xf49613(0x154)]&&{'reasoningEffort':_0x261ad8['reasoningEffort']}}}},_0x1ce7c2=_0xf49613(0x109)+encodeURIComponent(_0xe8f7b1),_0x14ffa1=await this[_0xf49613(0x122)]['request']('PATCH',_0x1ce7c2,{'headers':{'Content-Type':'application/vnd.api+json'},'body':_0x3a6186});return _0x14ffa1['data'];}async['deleteAgent'](_0x51f3a1){const _0x4e43ec=a94_0x5a351e,_0x41c3c8='/api/agents/'+encodeURIComponent(_0x51f3a1);await this['httpClient'][_0x4e43ec(0x14b)](_0x4e43ec(0x16a),_0x41c3c8);}async[a94_0x5a351e(0x193)](_0x24a0a3=0x32){const _0x3fd190=a94_0x5a351e,_0x401d4f=new URLSearchParams();_0x401d4f[_0x3fd190(0x199)]('page[limit]',String(_0x24a0a3)),_0x401d4f['append'](_0x3fd190(0x160),_0x3fd190(0x19e));const _0x24b5e4='/api/chats?'+_0x401d4f['toString'](),_0x1055a1=await this[_0x3fd190(0x122)]['request'](_0x3fd190(0x13d),_0x24b5e4);return _0x1055a1[_0x3fd190(0x163)]||[];}async[a94_0x5a351e(0x1a0)](_0x10ae63){const _0x24c077=a94_0x5a351e,_0x3db543=_0x24c077(0x116)+encodeURIComponent(_0x10ae63),_0x13d5c9=await this[_0x24c077(0x122)][_0x24c077(0x14b)](_0x24c077(0x13d),_0x3db543);return _0x13d5c9[_0x24c077(0x163)];}async[a94_0x5a351e(0x17b)](_0x43eb76){const _0x437b6f=a94_0x5a351e,_0x21b027=_0x437b6f(0x116)+encodeURIComponent(_0x43eb76)+'/history';return await this[_0x437b6f(0x122)][_0x437b6f(0x14b)](_0x437b6f(0x13d),_0x21b027);}async[a94_0x5a351e(0x131)](_0x900cc4){const _0x4333b6=a94_0x5a351e,_0x1492be=_0x4333b6(0x116)+encodeURIComponent(_0x900cc4)+_0x4333b6(0x100);return await this['httpClient'][_0x4333b6(0x14b)](_0x4333b6(0x13d),_0x1492be);}async['startChat'](_0x561e90){const _0x5d55ef=a94_0x5a351e,_0x3490fd={'data':{'type':_0x5d55ef(0x198),'attributes':{'agentId':_0x561e90[_0x5d55ef(0x11d)]}}},_0x448d1a=0x3,_0x2a2012=[0x3e8,0x7d0,0xfa0];for(let _0x586ac6=0x0;_0x586ac6<=_0x448d1a;_0x586ac6++){const _0x44402a=await this['httpClient'][_0x5d55ef(0x14b)](_0x5d55ef(0x104),_0x5d55ef(0x166),{'headers':{'Content-Type':_0x5d55ef(0x13e),'Accept':_0x5d55ef(0x13e)},'body':_0x3490fd});if(_0x44402a[_0x5d55ef(0x163)]&&_0x44402a[_0x5d55ef(0x163)]['id'])return _0x44402a[_0x5d55ef(0x163)];if(_0x586ac6>=_0x448d1a)throw new SDKError(ErrorCode['LLM_CHAT_CREATION_FAILURE'],'Failed\x20to\x20create\x20chat\x20after\x20'+(_0x448d1a+0x1)+_0x5d55ef(0x11f));const _0x5bc8d5=_0x2a2012[_0x586ac6];console[_0x5d55ef(0x187)](_0x5d55ef(0x127)+(_0x586ac6+0x1)+'/'+_0x448d1a+_0x5d55ef(0x16c)+_0x5bc8d5+_0x5d55ef(0x14e)),await new Promise(_0x2592b5=>setTimeout(_0x2592b5,_0x5bc8d5));}throw new SDKError(ErrorCode[_0x5d55ef(0x158)],_0x5d55ef(0x192));}async*[a94_0x5a351e(0x132)](_0x566c88,_0x12004c,_0x4472c4){const _0x4aaca1=a94_0x5a351e,_0x5dd0ca=_0x12004c['trim']();if(!_0x5dd0ca)throw new SDKError(ErrorCode[_0x4aaca1(0x137)],_0x4aaca1(0x10f),undefined,{'helpText':_0x4aaca1(0x121)});this['logger'][_0x4aaca1(0x139)](_0x4aaca1(0x157)+_0x566c88+_0x4aaca1(0x161)+_0x12004c[_0x4aaca1(0x197)]+_0x4aaca1(0x149));const _0x28ffd8=_0x4aaca1(0x116)+encodeURIComponent(_0x566c88)+_0x4aaca1(0x111),_0x205f73={'input':_0x12004c};try{const _0xd703ec=await this[_0x4aaca1(0x122)][_0x4aaca1(0x189)](_0x4aaca1(0x104),_0x28ffd8,{'headers':{'Content-Type':_0x4aaca1(0x130),'Accept':'text/event-stream'},'body':_0x205f73,'signal':_0x4472c4});this[_0x4aaca1(0x168)][_0x4aaca1(0x139)]('['+_0xd703ec[_0x4aaca1(0x17f)]+_0x4aaca1(0x140)+_0x566c88),yield*parseSSEStream(_0xd703ec,this[_0x4aaca1(0x168)]);}catch(_0x171d2a){throw new SDKError(ErrorCode[_0x4aaca1(0x19f)],_0x4aaca1(0x123)+_0x566c88+_0x4aaca1(0x14a)+_0x12004c[_0x4aaca1(0x197)]+')',_0x171d2a);}}async[a94_0x5a351e(0x19c)](_0x21d739){const _0x44c01e=a94_0x5a351e,_0x4d733f=_0x44c01e(0x10b)+encodeURIComponent(_0x21d739),_0x50ded7=await this[_0x44c01e(0x122)][_0x44c01e(0x14b)](_0x44c01e(0x13d),_0x4d733f);return _0x50ded7[_0x44c01e(0x163)];}async[a94_0x5a351e(0x12d)](_0x3e6a88){const _0x1a6cef=a94_0x5a351e;return this[_0x1a6cef(0x174)](_0x1a6cef(0x110)+encodeURIComponent(_0x3e6a88)+_0x1a6cef(0x18a));}async[a94_0x5a351e(0x143)](_0x311322){const _0x34229b=a94_0x5a351e,_0xb68e17={'data':{'type':_0x34229b(0x138),'attributes':_0x311322}},_0x5e5579=await this[_0x34229b(0x122)]['request'](_0x34229b(0x104),_0x34229b(0x15b),{'headers':{'Content-Type':_0x34229b(0x13e),'Accept':_0x34229b(0x13e)},'body':_0xb68e17});return _0x5e5579[_0x34229b(0x163)];}async[a94_0x5a351e(0x10e)](_0x2635f3,_0x394fb2){const _0x2def5f=a94_0x5a351e;return this[_0x2def5f(0x174)](_0x2def5f(0x182)+encodeURIComponent(_0x2635f3)+_0x2def5f(0x18e)+encodeURIComponent(_0x394fb2)+_0x2def5f(0x18a));}async[a94_0x5a351e(0x13b)](_0x4fd58f){const _0xf845d9=a94_0x5a351e,_0x58c8ed=await this[_0xf845d9(0x174)](_0xf845d9(0x107)+encodeURIComponent(_0x4fd58f)+_0xf845d9(0x18a));return _0x58c8ed[_0xf845d9(0x162)](_0x57dc02=>({..._0x57dc02,'type':_0xf845d9(0x14c)}));}async['getTextKnowledgeBase'](_0xb685eb){const _0x13af07=a94_0x5a351e,_0x2beea5=await this[_0x13af07(0x122)]['request'](_0x13af07(0x13d),_0x13af07(0x19b)+encodeURIComponent(_0xb685eb),{'headers':{'Accept':_0x13af07(0x13e)}});return _0x2beea5[_0x13af07(0x163)];}async[a94_0x5a351e(0x175)](_0x4aecfb){const _0x2fdc1b=a94_0x5a351e,_0x3853a3={'data':{'type':_0x2fdc1b(0x14c),'attributes':_0x4aecfb}},_0x10bf8c=await this[_0x2fdc1b(0x122)][_0x2fdc1b(0x14b)](_0x2fdc1b(0x104),_0x2fdc1b(0x12e),{'headers':{'Content-Type':_0x2fdc1b(0x13e),'Accept':_0x2fdc1b(0x13e)},'body':_0x3853a3});return _0x10bf8c['data'];}async['updateTextKnowledgeBase'](_0x4cea1d,_0x1b699c){const _0x311871=a94_0x5a351e,_0x57528b={'data':{'type':_0x311871(0x14c),'id':_0x4cea1d,'attributes':_0x1b699c}},_0x97d055=await this[_0x311871(0x122)][_0x311871(0x14b)](_0x311871(0x172),_0x311871(0x19b)+encodeURIComponent(_0x4cea1d),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x311871(0x13e)},'body':_0x57528b});return _0x97d055[_0x311871(0x163)];}async[a94_0x5a351e(0x10d)](_0x11bb0f){const _0x29b6a9=a94_0x5a351e,_0x3844fb={'data':{'type':_0x29b6a9(0x13f),'attributes':{..._0x11bb0f,'imageModelType':_0x11bb0f[_0x29b6a9(0x10a)]||_0x29b6a9(0x177),'imageReturnMode':_0x11bb0f['imageReturnMode']||'ID'}}},_0x3c9e6f=await this[_0x29b6a9(0x122)][_0x29b6a9(0x14b)](_0x29b6a9(0x104),_0x29b6a9(0x146),{'headers':{'Content-Type':_0x29b6a9(0x13e),'Accept':_0x29b6a9(0x13e)},'body':_0x3844fb});return _0x3c9e6f[_0x29b6a9(0x163)];}async[a94_0x5a351e(0x15d)](_0xf9eb8a){const _0x243348=a94_0x5a351e,_0x132f0e={'data':{'type':'webSearchTools','attributes':{'projectId':_0xf9eb8a[_0x243348(0x12c)],'name':_0xf9eb8a[_0x243348(0x115)],'modelType':_0xf9eb8a[_0x243348(0x153)]||'gpt-4o','searchContextSize':_0xf9eb8a[_0x243348(0x16d)]||_0x243348(0x186),'userLocation':_0xf9eb8a[_0x243348(0x17c)]||{'type':_0x243348(0xff),'country':'US','city':_0x243348(0x185),'region':_0x243348(0x19d),'timezone':'America/Los_Angeles'},'systemPrompt':_0xf9eb8a['systemPrompt']||_0x243348(0x152),'filters':_0xf9eb8a[_0x243348(0x148)]||{'allowed_domains':[]}}}},_0x4f1a34=await this['httpClient'][_0x243348(0x14b)](_0x243348(0x104),_0x243348(0x112),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x132f0e});return _0x4f1a34['data'];}async['listImageGenerators'](_0x4b23c2){const _0x2023c6=a94_0x5a351e,_0x4492c5=await this[_0x2023c6(0x174)](_0x2023c6(0x10c)+encodeURIComponent(_0x4b23c2)+'&page[limit]=50');return _0x4492c5['map'](_0x72d1e8=>({..._0x72d1e8,'type':_0x2023c6(0x13f)}));}async[a94_0x5a351e(0x165)](_0x408c73){const _0x4a370a=a94_0x5a351e,_0x4b2e09=await this[_0x4a370a(0x174)](_0x4a370a(0x106)+encodeURIComponent(_0x408c73)+_0x4a370a(0x18a));return _0x4b2e09['map'](_0x4082c5=>({..._0x4082c5,'type':_0x4a370a(0x135)}));}async[a94_0x5a351e(0x180)](_0x57782b){const _0x3e1c8c=a94_0x5a351e,_0x3d8019=await this[_0x3e1c8c(0x174)](_0x3e1c8c(0x114)+encodeURIComponent(_0x57782b)+'&page[limit]=1');if(_0x3d8019[_0x3e1c8c(0x197)]===0x0)return undefined;return{..._0x3d8019[0x0],'type':_0x3e1c8c(0x141)};}async[a94_0x5a351e(0x12f)](_0x8a4051){const _0x3a6df1=a94_0x5a351e;return this[_0x3a6df1(0x174)](_0x3a6df1(0x105)+encodeURIComponent(_0x8a4051)+_0x3a6df1(0x18a));}async['createPrompt'](_0x36f56d){const _0x2508b4=a94_0x5a351e,{jsonSchemaHint:_0x56a7d1,..._0x5eb64b}=_0x36f56d,_0x4e3152={'data':{'type':_0x2508b4(0x164),'attributes':_0x5eb64b}},_0x375b8f=await this[_0x2508b4(0x122)][_0x2508b4(0x14b)](_0x2508b4(0x104),_0x2508b4(0x120),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x2508b4(0x13e)},'body':_0x4e3152});return _0x375b8f[_0x2508b4(0x163)];}async[a94_0x5a351e(0x12b)](_0x10a3ec){const _0x4139b3=a94_0x5a351e;return this[_0x4139b3(0x174)](_0x4139b3(0x18b)+encodeURIComponent(_0x10a3ec)+'&page[limit]=50');}async['createIntegration'](_0x2e98c2){const _0x2aed5d=a94_0x5a351e,_0x3459a8={'data':{'type':_0x2aed5d(0x150),'attributes':_0x2e98c2}},_0x267675=await this['httpClient'][_0x2aed5d(0x14b)](_0x2aed5d(0x104),_0x2aed5d(0x191),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x3459a8});return _0x267675[_0x2aed5d(0x163)];}async[a94_0x5a351e(0x103)](_0x18a4dc){const _0xa68637=a94_0x5a351e,_0x49e6b0=await this['paginateAll'](_0xa68637(0x176)+encodeURIComponent(_0x18a4dc)+'&page[limit]=50');return _0x49e6b0[_0xa68637(0x162)](_0x160ac7=>({..._0x160ac7,'type':_0xa68637(0x190)}));}async[a94_0x5a351e(0x15f)](_0xd189d6){const _0xcc59a1=a94_0x5a351e,_0x19aff3=await this['httpClient'][_0xcc59a1(0x14b)](_0xcc59a1(0x13d),_0xcc59a1(0x102)+encodeURIComponent(_0xd189d6),{'headers':{'Accept':'application/vnd.api+json'}});return _0x19aff3[_0xcc59a1(0x163)];}async['createExperimentalKnowledgeBase'](_0x37af6b){const _0x2e600f=a94_0x5a351e,_0x3a6485={'data':{'type':_0x2e600f(0x190),'attributes':_0x37af6b}},_0x5addc2=await this[_0x2e600f(0x122)][_0x2e600f(0x14b)](_0x2e600f(0x104),_0x2e600f(0x145),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x2e600f(0x13e)},'body':_0x3a6485});return _0x5addc2['data'];}async['updateExperimentalKnowledgeBase'](_0x15cd09,_0x534bec){const _0x3a55f3=a94_0x5a351e,_0x2dc71f={'data':{'type':_0x3a55f3(0x190),'id':_0x15cd09,'attributes':_0x534bec}},_0x5108de=await this[_0x3a55f3(0x122)][_0x3a55f3(0x14b)]('PATCH',_0x3a55f3(0x102)+encodeURIComponent(_0x15cd09),{'headers':{'Content-Type':_0x3a55f3(0x13e),'Accept':_0x3a55f3(0x13e)},'body':_0x2dc71f});return _0x5108de[_0x3a55f3(0x163)];}async[a94_0x5a351e(0x188)](_0x569668){const _0x296454=a94_0x5a351e;return this[_0x296454(0x174)](_0x296454(0x14f)+encodeURIComponent(_0x569668)+_0x296454(0x18a));}async[a94_0x5a351e(0x178)](_0x51a526){const _0xfba2c0=a94_0x5a351e,_0x3efcc7=await this[_0xfba2c0(0x122)][_0xfba2c0(0x14b)](_0xfba2c0(0x13d),_0xfba2c0(0x15e)+encodeURIComponent(_0x51a526),{'headers':{'Accept':_0xfba2c0(0x13e)}});return _0x3efcc7[_0xfba2c0(0x163)];}async[a94_0x5a351e(0x183)](_0x149369){const _0x5d6876=a94_0x5a351e,_0x944e7b={'data':{'type':_0x5d6876(0x18f),'attributes':_0x149369}},_0x31fd31=await this[_0x5d6876(0x122)][_0x5d6876(0x14b)](_0x5d6876(0x104),_0x5d6876(0x159),{'headers':{'Content-Type':_0x5d6876(0x13e),'Accept':_0x5d6876(0x13e)},'body':_0x944e7b});return _0x31fd31['data'];}async[a94_0x5a351e(0x108)](_0x579130,_0x4f956d){const _0x31d40f=a94_0x5a351e,_0x31e8f6={'data':{'type':_0x31d40f(0x18f),'id':_0x579130,'attributes':_0x4f956d}},_0x3dcac1=await this['httpClient'][_0x31d40f(0x14b)](_0x31d40f(0x172),'/api/experimental_artifacts/'+encodeURIComponent(_0x579130),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x31e8f6});return _0x3dcac1[_0x31d40f(0x163)];}async['listAgentsFull'](_0x91a858){const _0x1a0ec0=a94_0x5a351e,_0xbe0825=await this[_0x1a0ec0(0x196)](_0x91a858),_0x6f0fae=[];for(const _0x9c75f6 of _0xbe0825){const _0x9ffe51=_0x1a0ec0(0x109)+encodeURIComponent(_0x9c75f6['id']),_0x4c42c3=await this['httpClient'][_0x1a0ec0(0x14b)](_0x1a0ec0(0x13d),_0x9ffe51);_0x6f0fae['push'](_0x4c42c3[_0x1a0ec0(0x163)]);}return _0x6f0fae;}async[a94_0x5a351e(0x113)](_0x3e4c10){const _0x567c13=a94_0x5a351e,_0x1e85d3={'data':{'type':_0x567c13(0x184),'attributes':_0x3e4c10}},_0x804040=await this[_0x567c13(0x122)]['request'](_0x567c13(0x104),_0x567c13(0x179),{'headers':{'Content-Type':_0x567c13(0x13e),'Accept':_0x567c13(0x13e)},'body':_0x1e85d3});return _0x804040['data'];}async['updateAgentResponse'](_0x4c5714,_0x2a78be){const _0x51553f=a94_0x5a351e,_0x229310={'data':{'type':_0x51553f(0x184),'id':_0x4c5714,'attributes':_0x2a78be}},_0x39c5a2=_0x51553f(0x109)+encodeURIComponent(_0x4c5714),_0x5ac8f4=await this[_0x51553f(0x122)][_0x51553f(0x14b)](_0x51553f(0x172),_0x39c5a2,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x51553f(0x13e)},'body':_0x229310});return _0x5ac8f4[_0x51553f(0x163)];}async[a94_0x5a351e(0x17e)](_0x135bc1,_0x21330b){const _0x209cb1=a94_0x5a351e,_0x571058={'data':{'type':'knowledge_bases','id':_0x135bc1,'attributes':_0x21330b}},_0x1b3825=_0x209cb1(0x16f)+encodeURIComponent(_0x135bc1),_0x5386ef=await this[_0x209cb1(0x122)]['request'](_0x209cb1(0x172),_0x1b3825,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x209cb1(0x13e)},'body':_0x571058});return _0x5386ef[_0x209cb1(0x163)];}async[a94_0x5a351e(0x16b)](_0x5058ac,_0xbf5400){const _0x406286=a94_0x5a351e,{jsonSchemaHint:_0x46fa37,..._0x4ac9f1}=_0xbf5400,_0x1ffb5c={'data':{'type':_0x406286(0x164),'id':_0x5058ac,'attributes':_0x4ac9f1}},_0x34c646='/api/prompts/'+encodeURIComponent(_0x5058ac),_0x240186=await this[_0x406286(0x122)][_0x406286(0x14b)](_0x406286(0x172),_0x34c646,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x406286(0x13e)},'body':_0x1ffb5c});return _0x240186[_0x406286(0x163)];}async['updateIntegration'](_0x3ce9ba,_0x2e55dd){const _0x122216=a94_0x5a351e,_0x342413={'data':{'type':'integrations','id':_0x3ce9ba,'attributes':_0x2e55dd}},_0x1380ee=_0x122216(0x126)+encodeURIComponent(_0x3ce9ba),_0x525d04=await this[_0x122216(0x122)][_0x122216(0x14b)](_0x122216(0x172),_0x1380ee,{'headers':{'Content-Type':_0x122216(0x13e),'Accept':_0x122216(0x13e)},'body':_0x342413});return _0x525d04['data'];}async[a94_0x5a351e(0x129)](_0x1c9fab){const _0x21d189=a94_0x5a351e,_0x27f1e4='/api/integrations/'+encodeURIComponent(_0x1c9fab);await this[_0x21d189(0x122)]['request'](_0x21d189(0x16a),_0x27f1e4);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xc7bd67,_0x434bb4){const _0x3eb0e2=a95_0x55ea,_0xbba216=_0xc7bd67();while(!![]){try{const _0x455184=parseInt(_0x3eb0e2(0x1d3))/0x1+-parseInt(_0x3eb0e2(0x1d7))/0x2+parseInt(_0x3eb0e2(0x1d5))/0x3*(-parseInt(_0x3eb0e2(0x1d1))/0x4)+-parseInt(_0x3eb0e2(0x1cf))/0x5+parseInt(_0x3eb0e2(0x1d0))/0x6*(-parseInt(_0x3eb0e2(0x1d2))/0x7)+-parseInt(_0x3eb0e2(0x1d6))/0x8+parseInt(_0x3eb0e2(0x1d4))/0x9*(parseInt(_0x3eb0e2(0x1d9))/0xa);if(_0x455184===_0x434bb4)break;else _0xbba216['push'](_0xbba216['shift']());}catch(_0x39a57a){_0xbba216['push'](_0xbba216['shift']());}}}(a95_0x1577,0xdd5ad));function a95_0x55ea(_0x32d4e0,_0x1fb884){_0x32d4e0=_0x32d4e0-0x1cf;const _0x15770a=a95_0x1577();let _0x55ea52=_0x15770a[_0x32d4e0];return _0x55ea52;}function a95_0x1577(){const _0x21f27a=['refresh_token','5383880LDZLKb','6154340VJlKmr','30GyWBPg','529720HeBdaa','894719nPkJjq','1708057fxqyER','81lFmwZe','12FppOVH','12361208NZeggX','3404112FFpjei'];a95_0x1577=function(){return _0x21f27a;};return a95_0x1577();}import{getOAuthClientId,postTokenRequest}from'../../core/oauth.js';export async function refreshAccessToken(_0x420229,_0x49bcbc){const _0x57651d=a95_0x55ea,_0x12e570=_0x420229+'/oauth/token';return postTokenRequest(_0x12e570,{'grant_type':_0x57651d(0x1d8),'client_id':getOAuthClientId(),'refresh_token':_0x49bcbc});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a96_0x4f78(_0x5dd177,_0x35372e){_0x5dd177=_0x5dd177-0x107;const _0x44f504=a96_0x44f5();let _0x4f781c=_0x44f504[_0x5dd177];return _0x4f781c;}const a96_0x2267a6=a96_0x4f78;(function(_0x38c8fe,_0x5bfc7f){const _0x4bbacf=a96_0x4f78,_0x2c4844=_0x38c8fe();while(!![]){try{const _0x19c312=-parseInt(_0x4bbacf(0x113))/0x1+parseInt(_0x4bbacf(0x10a))/0x2+-parseInt(_0x4bbacf(0x116))/0x3+-parseInt(_0x4bbacf(0x109))/0x4*(parseInt(_0x4bbacf(0x11d))/0x5)+parseInt(_0x4bbacf(0x11a))/0x6*(-parseInt(_0x4bbacf(0x112))/0x7)+parseInt(_0x4bbacf(0x111))/0x8+parseInt(_0x4bbacf(0x10c))/0x9;if(_0x19c312===_0x5bfc7f)break;else _0x2c4844['push'](_0x2c4844['shift']());}catch(_0x1cd41f){_0x2c4844['push'](_0x2c4844['shift']());}}}(a96_0x44f5,0x3b483));export class RateLimiter{[a96_0x2267a6(0x10f)];[a96_0x2267a6(0x108)];[a96_0x2267a6(0x119)];['refillRate'];constructor(_0x59dc55){const _0x1ee35f=a96_0x2267a6;this[_0x1ee35f(0x119)]=_0x59dc55['maxRequests'],this[_0x1ee35f(0x10f)]=_0x59dc55['maxRequests'],this['lastRefill']=Date[_0x1ee35f(0x110)](),this['refillRate']=_0x59dc55[_0x1ee35f(0x117)]/_0x59dc55[_0x1ee35f(0x11c)];}async[a96_0x2267a6(0x10b)](){const _0x125efd=a96_0x2267a6;while(!![]){this[_0x125efd(0x11e)]();if(this[_0x125efd(0x10f)]>=0x1){this[_0x125efd(0x10f)]-=0x1;return;}const _0x12bcbf=Math[_0x125efd(0x118)](0x1,Math[_0x125efd(0x10e)](0x1/this['refillRate']));await this[_0x125efd(0x114)](_0x12bcbf);}}[a96_0x2267a6(0x107)](){const _0x57a0a3=a96_0x2267a6;this[_0x57a0a3(0x11e)]();if(this[_0x57a0a3(0x10f)]>=0x1)return this[_0x57a0a3(0x10f)]-=0x1,!![];return![];}[a96_0x2267a6(0x11e)](){const _0x5a84ce=a96_0x2267a6,_0x4906cd=Date[_0x5a84ce(0x110)](),_0x5e0209=_0x4906cd-this['lastRefill'];if(_0x5e0209>0x0){const _0x2dfa05=_0x5e0209*this[_0x5a84ce(0x11b)];this['tokens']=Math[_0x5a84ce(0x10d)](this[_0x5a84ce(0x119)],this['tokens']+_0x2dfa05),this[_0x5a84ce(0x108)]=_0x4906cd;}}[a96_0x2267a6(0x115)](){const _0x36a035=a96_0x2267a6;return this[_0x36a035(0x11e)](),Math['floor'](this[_0x36a035(0x10f)]);}['reset'](){const _0x2388b4=a96_0x2267a6;this[_0x2388b4(0x10f)]=this[_0x2388b4(0x119)],this[_0x2388b4(0x108)]=Date[_0x2388b4(0x110)]();}['sleep'](_0x2e08da){return new Promise(_0x362bbb=>setTimeout(_0x362bbb,_0x2e08da));}}function a96_0x44f5(){const _0x65d748=['refillRate','windowMs','1415965MBoreb','refill','tryAcquire','lastRefill','4wueetZ','607966KPsygC','acquire','3409578IuOCPB','min','ceil','tokens','now','2608232lVemem','82747fdxsJX','212277BKoFYN','sleep','getAvailableTokens','315213ByUUSy','maxRequests','max','maxTokens','84ytXTkn'];a96_0x44f5=function(){return _0x65d748;};return a96_0x44f5();}export const defaultRateLimiter=new RateLimiter({'maxRequests':0x64,'windowMs':0xea60});
|