@treasuredata/tdx 2026.3.12 → 2026.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a88_0x1e9b17=a88_0x3d69;(function(_0x42222d,_0x559b77){const _0x93aeb1=a88_0x3d69,_0x2e642f=_0x42222d();while(!![]){try{const _0x3d8910=parseInt(_0x93aeb1(0x1a5))/0x1*(-parseInt(_0x93aeb1(0x1a8))/0x2)+-parseInt(_0x93aeb1(0x16b))/0x3+parseInt(_0x93aeb1(0x162))/0x4*(-parseInt(_0x93aeb1(0x16e))/0x5)+-parseInt(_0x93aeb1(0x19f))/0x6+-parseInt(_0x93aeb1(0x1ac))/0x7+-parseInt(_0x93aeb1(0x1af))/0x8+-parseInt(_0x93aeb1(0x161))/0x9*(-parseInt(_0x93aeb1(0x177))/0xa);if(_0x3d8910===_0x559b77)break;else _0x2e642f['push'](_0x2e642f['shift']());}catch(_0x4aeee0){_0x2e642f['push'](_0x2e642f['shift']());}}}(a88_0x6451,0xd01fd));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';function a88_0x3d69(_0x491b26,_0x2a1e28){_0x491b26=_0x491b26-0x156;const _0x6451ba=a88_0x6451();let _0x3d69b3=_0x6451ba[_0x491b26];return _0x3d69b3;}export class CDPApiClient{[a88_0x1e9b17(0x181)];[a88_0x1e9b17(0x1c8)];constructor(_0x3b6196){const _0x3309f6=a88_0x1e9b17,_0x1b0cb4=getEndpoint(_0x3b6196[_0x3309f6(0x1c5)],_0x3309f6(0x17e));this[_0x3309f6(0x1c8)]=toHeaderRecord(getAuthHeaders(_0x3b6196[_0x3309f6(0x1c5)],_0x3b6196['apiKey'],_0x3b6196[_0x3309f6(0x19c)])),this['httpClient']=new HTTPClient(_0x1b0cb4,{...this['authHeaders'],'Accept':_0x3309f6(0x1aa),'Content-Type':_0x3309f6(0x1b2)},{'proxy':_0x3b6196['proxy']});}async['listParentSegments'](){const _0x3ea820=a88_0x1e9b17,_0x3e942e=_0x3ea820(0x15d),_0x355e21=await this[_0x3ea820(0x181)][_0x3ea820(0x1de)](_0x3ea820(0x189),_0x3e942e);return Array['isArray'](_0x355e21)?_0x355e21:_0x355e21[_0x3ea820(0x185)];}async[a88_0x1e9b17(0x1d4)](_0x42ca54){const _0x4da3e6=a88_0x1e9b17,_0x5f4dee=_0x4da3e6(0x1bb)+_0x42ca54,_0x33c8c7=await this[_0x4da3e6(0x181)][_0x4da3e6(0x1de)](_0x4da3e6(0x189),_0x5f4dee);return'data'in _0x33c8c7?_0x33c8c7['data']:_0x33c8c7;}async['listSegments'](_0x16ee23){const _0x373520=a88_0x1e9b17,_0x30b591=_0x373520(0x1d0)+_0x16ee23+_0x373520(0x1e1),_0x1f0d88=await this[_0x373520(0x181)][_0x373520(0x1de)](_0x373520(0x189),_0x30b591);return Array['isArray'](_0x1f0d88)?_0x1f0d88:_0x1f0d88['data'];}async['getSegment'](_0x3dab4f,_0x324044){const _0x12c4fc=a88_0x1e9b17,_0x22bc7a=_0x12c4fc(0x1d0)+_0x3dab4f+'/segments/'+_0x324044,_0x39ea4e=await this[_0x12c4fc(0x181)][_0x12c4fc(0x1de)](_0x12c4fc(0x189),_0x22bc7a);return _0x12c4fc(0x185)in _0x39ea4e?_0x39ea4e[_0x12c4fc(0x185)]:_0x39ea4e;}async[a88_0x1e9b17(0x157)](_0x1fd236){const _0x4feb5e=a88_0x1e9b17,_0x5764b7='/entities/segments/'+_0x1fd236,_0x50e0b9=await this[_0x4feb5e(0x181)][_0x4feb5e(0x1de)](_0x4feb5e(0x189),_0x5764b7);if(_0x4feb5e(0x185)in _0x50e0b9){const _0x4435f0=_0x50e0b9['data'];if('attributes'in _0x4435f0&&_0x4435f0[_0x4feb5e(0x1a6)]&&typeof _0x4435f0[_0x4feb5e(0x1a6)]==='object'){const _0x3994a8=_0x4435f0[_0x4feb5e(0x1a6)];return{'id':_0x4435f0['id'],'name':_0x3994a8[_0x4feb5e(0x182)],..._0x3994a8};}return _0x4435f0;}return _0x50e0b9;}async['listSegmentFolders'](_0x36814c){const _0x47a215=a88_0x1e9b17,_0x300025=_0x47a215(0x1d0)+_0x36814c+_0x47a215(0x1d2),_0x41f0de=await this['httpClient'][_0x47a215(0x1de)]('GET',_0x300025);return Array[_0x47a215(0x1ba)](_0x41f0de)?_0x41f0de:_0x41f0de['data'];}async['getSegmentFolder'](_0x150523){const _0x2921b2=a88_0x1e9b17,_0x3026ff=_0x2921b2(0x178)+_0x150523,_0x38ba06=await this[_0x2921b2(0x181)][_0x2921b2(0x1de)]('GET',_0x3026ff);return _0x2921b2(0x185)in _0x38ba06?_0x38ba06['data']:_0x38ba06;}async[a88_0x1e9b17(0x1e2)](_0x5a1dbc,_0x2ee5fe=0x20,_0x325a0d=![]){const _0x38a91d=a88_0x1e9b17,_0x57c79a='/entities/by-folder/'+_0x5a1dbc+_0x38a91d(0x1c9)+_0x2ee5fe+_0x38a91d(0x191)+_0x325a0d;return await this[_0x38a91d(0x181)][_0x38a91d(0x1de)](_0x38a91d(0x189),_0x57c79a);}async[a88_0x1e9b17(0x1b0)](_0x34e8ff,_0x457ff1){const _0x3e41ba=a88_0x1e9b17,_0x4f9bc1=_0x3e41ba(0x1d0)+_0x34e8ff+_0x3e41ba(0x16f)+_0x457ff1+_0x3e41ba(0x165),_0x71010c=await this[_0x3e41ba(0x181)][_0x3e41ba(0x1de)]('GET',_0x4f9bc1);return Array[_0x3e41ba(0x1ba)](_0x71010c)?_0x71010c:_0x71010c[_0x3e41ba(0x185)];}async['getActivation'](_0x2bdfe3,_0x3b03f0,_0x1b317f){const _0x483234=a88_0x1e9b17,_0x157dff=_0x483234(0x1d0)+_0x2bdfe3+_0x483234(0x16f)+_0x3b03f0+'/syndications/'+_0x1b317f,_0x56e7eb=await this[_0x483234(0x181)][_0x483234(0x1de)](_0x483234(0x189),_0x157dff);return _0x483234(0x185)in _0x56e7eb?_0x56e7eb[_0x483234(0x185)]:_0x56e7eb;}async['createActivation'](_0x56f05c,_0x10cea6,_0xc28214){const _0x29e8a3=a88_0x1e9b17,_0x3f5ddb=_0x29e8a3(0x1d0)+_0x56f05c+'/segments/'+_0x10cea6+_0x29e8a3(0x165),_0x12727e=await this[_0x29e8a3(0x181)]['request'](_0x29e8a3(0x1d5),_0x3f5ddb,{'body':_0xc28214});return _0x12727e;}async[a88_0x1e9b17(0x1b1)](_0x1eb2fa,_0x3bfa09,_0x33d42b,_0x382fd4){const _0x1755cd=a88_0x1e9b17,_0x31a36f='/audiences/'+_0x1eb2fa+_0x1755cd(0x16f)+_0x3bfa09+'/syndications/'+_0x33d42b,_0x1aeb22=await this['httpClient']['request'](_0x1755cd(0x173),_0x31a36f,{'body':_0x382fd4});return _0x1aeb22;}async[a88_0x1e9b17(0x18b)](_0x4105d7,_0x197036,_0x3376f2){const _0xc6709c=a88_0x1e9b17,_0x49296a=_0xc6709c(0x1d0)+_0x4105d7+_0xc6709c(0x16f)+_0x197036+'/syndications/'+_0x3376f2;await this['httpClient'][_0xc6709c(0x1de)]('DELETE',_0x49296a);}async[a88_0x1e9b17(0x1b6)](_0xa8e351){return this['requestSegmentSQL'](_0xa8e351);}async[a88_0x1e9b17(0x196)](_0x217e21,_0x4208cd){const _0x5052e4=a88_0x1e9b17;return this[_0x5052e4(0x197)](_0x217e21,_0x4208cd);}async[a88_0x1e9b17(0x18f)](_0x4e3683,_0x447dcd){const _0x3959c1=a88_0x1e9b17,_0xf78705=await this[_0x3959c1(0x16d)](_0x4e3683,_0x447dcd),_0x447f21=_0x3959c1(0x1ad)in _0xf78705&&_0xf78705[_0x3959c1(0x1ad)]?_0xf78705[_0x3959c1(0x1ad)]:undefined;return this['requestSegmentSQL'](_0x4e3683,_0x447f21);}async['requestSegmentSQL'](_0x39484,_0x50d620){const _0x195897=a88_0x1e9b17,_0x2c746c=_0x195897(0x1d0)+_0x39484+_0x195897(0x1c2),_0x412306={'format':_0x195897(0x164)};_0x50d620&&(_0x412306[_0x195897(0x1ad)]=_0x50d620);const _0xb3c08=await this[_0x195897(0x181)][_0x195897(0x1de)](_0x195897(0x1d5),_0x2c746c,{'body':_0x412306});return _0xb3c08['sql']||_0xb3c08[_0x195897(0x1cc)]||'';}async[a88_0x1e9b17(0x1db)](_0xaa1522){const _0x107bfa=a88_0x1e9b17,_0x280102=_0x107bfa(0x19e),_0x3e4f6f=await this[_0x107bfa(0x181)][_0x107bfa(0x1de)]('POST',_0x280102,{'body':_0xaa1522,'headers':{'Content-Type':_0x107bfa(0x1aa)}});return _0x3e4f6f;}async[a88_0x1e9b17(0x1a2)](_0x3be3ed,_0x1d43da){const _0x523978=a88_0x1e9b17,_0x34d008=_0x523978(0x1d0)+_0x3be3ed,_0x218be2=await this[_0x523978(0x181)][_0x523978(0x1de)](_0x523978(0x173),_0x34d008,{'body':_0x1d43da,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x218be2;}async[a88_0x1e9b17(0x190)](_0x1168b7){const _0x2a7f14=a88_0x1e9b17,_0x5775a9=_0x2a7f14(0x1d0)+_0x1168b7,_0x28e35c=await this[_0x2a7f14(0x181)][_0x2a7f14(0x1de)](_0x2a7f14(0x189),_0x5775a9,{'headers':{'Accept':_0x2a7f14(0x1aa)}});return _0x28e35c;}async[a88_0x1e9b17(0x1c4)](_0xe882e1){const _0x43c33e=a88_0x1e9b17,_0x203c22=_0x43c33e(0x1d0)+_0xe882e1+_0x43c33e(0x158),_0x3d0655=await this['httpClient'][_0x43c33e(0x1de)](_0x43c33e(0x189),_0x203c22);return _0x3d0655;}async[a88_0x1e9b17(0x174)](_0x197766,_0x33ec7e){const _0x3c1f29=a88_0x1e9b17;let _0x146dda='/audiences/'+_0x197766+_0x3c1f29(0x17b);_0x33ec7e!==undefined&&(_0x146dda+=_0x3c1f29(0x17f)+_0x33ec7e);const _0x5dd6a1=await this[_0x3c1f29(0x181)][_0x3c1f29(0x1de)](_0x3c1f29(0x189),_0x146dda);return _0x5dd6a1;}async[a88_0x1e9b17(0x176)](_0x597508,_0x3a014a){const _0xb01859=a88_0x1e9b17,_0x165f7d='/audiences/'+_0x597508+'/segments',_0x5568c1=await this['httpClient'][_0xb01859(0x1de)](_0xb01859(0x1d5),_0x165f7d,{'body':_0x3a014a});return _0x5568c1;}async['createJourneySegment'](_0x50e90b){const _0x1a7343=a88_0x1e9b17,_0x2e9c91=_0x1a7343(0x18e),_0x1957bc={'type':_0x1a7343(0x18d),'attributes':{'name':_0x50e90b[_0x1a7343(0x182)],'description':_0x50e90b[_0x1a7343(0x1dc)]||'','journeyId':_0x50e90b[_0x1a7343(0x1a1)],'rule':_0x50e90b[_0x1a7343(0x1ad)],'countPopulation':_0x50e90b[_0x1a7343(0x1cb)]??!![]},'relationships':{'parentFolder':{'data':{'id':_0x50e90b[_0x1a7343(0x1ca)],'type':_0x1a7343(0x1d7)}}}},_0x267370=await this['httpClient'][_0x1a7343(0x1de)](_0x1a7343(0x1d5),_0x2e9c91,{'body':_0x1957bc,'headers':{'Content-Type':_0x1a7343(0x1aa)}});return _0x267370['data']['id'];}async[a88_0x1e9b17(0x156)](_0x57bf69,_0x4f3628,_0x27bad6){const _0x249a96=a88_0x1e9b17,_0x2c61a0=_0x249a96(0x1d0)+_0x57bf69+'/segments/'+_0x4f3628,_0x5c29c3=await this[_0x249a96(0x181)][_0x249a96(0x1de)](_0x249a96(0x173),_0x2c61a0,{'body':_0x27bad6});return _0x5c29c3;}async[a88_0x1e9b17(0x1e0)](_0x51c2e5){const _0x491af6=a88_0x1e9b17,_0x15ad55=_0x491af6(0x15e)+_0x51c2e5;await this[_0x491af6(0x181)][_0x491af6(0x1de)]('DELETE',_0x15ad55);}async[a88_0x1e9b17(0x16c)](_0x114846,_0x2c45e1){const _0x8233bf=a88_0x1e9b17,_0x340527=_0x8233bf(0x1d0)+_0x114846+'/folders',_0x482f64=await this[_0x8233bf(0x181)][_0x8233bf(0x1de)](_0x8233bf(0x1d5),_0x340527,{'body':_0x2c45e1});if(_0x8233bf(0x185)in _0x482f64&&_0x482f64[_0x8233bf(0x185)]){const _0x574e30=_0x482f64[_0x8233bf(0x185)];return{'id':_0x574e30['id'],'name':_0x574e30['name'],'description':_0x574e30['description'],'audienceId':_0x574e30[_0x8233bf(0x1b9)]||String(_0x114846),'parentFolderId':_0x574e30['parentFolderId'],'createdAt':_0x574e30[_0x8233bf(0x172)],'updatedAt':_0x574e30['updatedAt']};}return _0x482f64;}async[a88_0x1e9b17(0x1ab)](_0x3b1307){const _0x514cc4=a88_0x1e9b17,_0x5683ae=_0x514cc4(0x1d0)+_0x3b1307+'/run',_0xa95d2b=await this['httpClient'][_0x514cc4(0x1de)](_0x514cc4(0x1d5),_0x5683ae);return _0xa95d2b;}async['listJourneys'](_0x2ca892){const _0x2ac0b1=a88_0x1e9b17,_0x3e90d9=_0x2ac0b1(0x159)+_0x2ca892,_0x489f39=await this[_0x2ac0b1(0x181)][_0x2ac0b1(0x1de)](_0x2ac0b1(0x189),_0x3e90d9);return _0x489f39[_0x2ac0b1(0x185)][_0x2ac0b1(0x168)](_0x15749f=>({'id':_0x15749f['id'],'name':_0x15749f[_0x2ac0b1(0x1a6)][_0x2ac0b1(0x182)],'journeyBundleName':_0x15749f[_0x2ac0b1(0x1a6)]['journeyBundleName'],'journeyBundleId':_0x15749f['attributes']['journeyBundleId'],'versionNumber':_0x15749f[_0x2ac0b1(0x1a6)][_0x2ac0b1(0x186)],'description':_0x15749f[_0x2ac0b1(0x1a6)][_0x2ac0b1(0x1dc)],'state':_0x15749f[_0x2ac0b1(0x1a6)]['state'],'paused':_0x15749f[_0x2ac0b1(0x1a6)][_0x2ac0b1(0x1c1)],'audienceId':_0x15749f[_0x2ac0b1(0x1a6)][_0x2ac0b1(0x1b9)],'folderId':_0x15749f['relationships']?.[_0x2ac0b1(0x1e3)]?.[_0x2ac0b1(0x185)]?.['id'],'createdAt':_0x15749f[_0x2ac0b1(0x1a6)]['createdAt'],'updatedAt':_0x15749f['attributes'][_0x2ac0b1(0x1df)]}));}async['listJourneysWithDetails'](_0x532a7e){const _0x313329=a88_0x1e9b17,_0x550d5d=_0x313329(0x159)+_0x532a7e,_0x122990=await this[_0x313329(0x181)]['request']('GET',_0x550d5d),_0x3f1f6c=new Map();if(_0x122990['included'])for(const _0x50f5e1 of _0x122990['included']){_0x50f5e1['type']===_0x313329(0x1ae)&&_0x3f1f6c[_0x313329(0x1b3)](_0x50f5e1['id'],_0x50f5e1);}return{'journeys':_0x122990[_0x313329(0x185)],'activationStepsById':_0x3f1f6c};}async[a88_0x1e9b17(0x194)](_0x4320cd){const _0x133ddb=a88_0x1e9b17,_0x6625d8=_0x133ddb(0x175)+_0x4320cd,_0x69287c=await this[_0x133ddb(0x181)]['request'](_0x133ddb(0x189),_0x6625d8);return _0x133ddb(0x185)in _0x69287c?_0x69287c[_0x133ddb(0x185)]:_0x69287c;}async['getJourneyBundle'](_0x1ec6dd){const _0x2a2b52=a88_0x1e9b17,_0x5d4335=_0x2a2b52(0x187)+_0x1ec6dd,_0x550d38=await this[_0x2a2b52(0x181)][_0x2a2b52(0x1de)](_0x2a2b52(0x189),_0x5d4335);return parseJourneyBundleResponse(_0x550d38);}async[a88_0x1e9b17(0x183)](_0x16e74d){const _0x864ded=a88_0x1e9b17,_0x18edd8='/entities/journey_bundles/'+_0x16e74d+'/journeys_appendable';await this[_0x864ded(0x181)][_0x864ded(0x1de)](_0x864ded(0x189),_0x18edd8);}async[a88_0x1e9b17(0x1bf)](_0x4721ef,_0x36352f){const _0x448536=a88_0x1e9b17,_0x1179c2='/entities/journey_bundles/'+_0x4721ef+_0x448536(0x1c6),_0x340d0b=await this[_0x448536(0x181)][_0x448536(0x1de)](_0x448536(0x1d5),_0x1179c2,{'body':_0x36352f});return _0x448536(0x185)in _0x340d0b?_0x340d0b[_0x448536(0x185)]:_0x340d0b;}async[a88_0x1e9b17(0x160)](_0x42a4ef){const _0x49f0c8=a88_0x1e9b17,_0x249cdd=_0x49f0c8(0x1cd),_0x4cfa75=await this[_0x49f0c8(0x181)][_0x49f0c8(0x1de)](_0x49f0c8(0x1d5),_0x249cdd,{'body':_0x42a4ef,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x49f0c8(0x185)in _0x4cfa75?_0x4cfa75['data']:_0x4cfa75;}async[a88_0x1e9b17(0x15a)](_0x21bd52,_0x5b34c4){const _0x19c51c=a88_0x1e9b17,_0x5db664=_0x19c51c(0x175)+_0x21bd52,_0x504d9d=await this[_0x19c51c(0x181)]['request'](_0x19c51c(0x170),_0x5db664,{'body':_0x5b34c4,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return'data'in _0x504d9d?_0x504d9d['data']:_0x504d9d;}async['updateJourneyDetail'](_0x6a71dc,_0x245db4){const _0x34037a=a88_0x1e9b17,_0x433b3a=_0x34037a(0x175)+_0x6a71dc+'/detail',_0x34782a=await this[_0x34037a(0x181)][_0x34037a(0x1de)](_0x34037a(0x1d5),_0x433b3a,{'body':_0x245db4,'headers':{'Content-Type':_0x34037a(0x1aa)}});return _0x34037a(0x185)in _0x34782a?_0x34782a[_0x34037a(0x185)]:_0x34782a;}async[a88_0x1e9b17(0x15f)](_0x42a821,_0x25bb66){const _0x416b42=a88_0x1e9b17,_0x236951=buildJourneyEndpoint(_0x42a821,_0x416b42(0x180),_0x25bb66),_0x4d5507=await this[_0x416b42(0x181)][_0x416b42(0x1de)]('GET',_0x236951);return parseJourneyStatisticsResponse(_0x4d5507);}async['getConversionSankeyChart'](_0x8b3444,_0x88578f){const _0x1306b3=a88_0x1e9b17,_0xfb0de=buildJourneyEndpoint(_0x8b3444,_0x1306b3(0x1cf),_0x88578f),_0x3e1aae=await this['httpClient'][_0x1306b3(0x1de)](_0x1306b3(0x189),_0xfb0de);return parseConversionSankeyResponse(_0x3e1aae);}async[a88_0x1e9b17(0x1a4)](_0x235c27,_0xd7a5d8){const _0x380952=a88_0x1e9b17,_0xfd0032=buildJourneyEndpoint(_0x235c27,_0x380952(0x1a3),_0xd7a5d8),_0xf462c5=await this[_0x380952(0x181)][_0x380952(0x1de)](_0x380952(0x189),_0xfd0032);return parseActivationSankeyResponse(_0xf462c5);}async[a88_0x1e9b17(0x1b8)](_0x59d078){const _0x38be40=a88_0x1e9b17,_0x8d5d8c=_0x38be40(0x175)+_0x59d078+_0x38be40(0x184),_0x5c20d1=await this[_0x38be40(0x181)][_0x38be40(0x1de)](_0x38be40(0x170),_0x8d5d8c);return _0x38be40(0x185)in _0x5c20d1?_0x5c20d1[_0x38be40(0x185)]:_0x5c20d1;}async['resumeJourney'](_0x18f41b){const _0x23a377=a88_0x1e9b17,_0x4e574a=_0x23a377(0x175)+_0x18f41b+'/resume',_0x42f8a0=await this['httpClient'][_0x23a377(0x1de)](_0x23a377(0x170),_0x4e574a);return _0x23a377(0x185)in _0x42f8a0?_0x42f8a0['data']:_0x42f8a0;}async[a88_0x1e9b17(0x16a)](_0xcca862,_0x167d8b){const _0x1a8ef3=a88_0x1e9b17,_0x13db08=_0x1a8ef3(0x175)+_0xcca862+_0x1a8ef3(0x1a7)+_0x167d8b,_0x46b4ac=await this['httpClient'][_0x1a8ef3(0x1de)](_0x1a8ef3(0x189),_0x13db08);return _0x1a8ef3(0x185)in _0x46b4ac?_0x46b4ac[_0x1a8ef3(0x185)]:_0x46b4ac;}async[a88_0x1e9b17(0x195)](_0x27d027){const _0x3a66f7=a88_0x1e9b17,_0x4c706b=_0x3a66f7(0x175)+_0x27d027+'/activations',_0xa7f9d0=await this['httpClient'][_0x3a66f7(0x1de)]('GET',_0x4c706b);return _0x3a66f7(0x185)in _0xa7f9d0?_0xa7f9d0[_0x3a66f7(0x185)]:_0xa7f9d0;}async[a88_0x1e9b17(0x1b5)](_0x16c12a,_0x4c1925){const _0x9f7d42=a88_0x1e9b17,_0x36b300='/entities/journeys/'+_0x16c12a+_0x9f7d42(0x15c),_0x26983d={'name':_0x4c1925[_0x9f7d42(0x182)],'scheduleType':_0x4c1925[_0x9f7d42(0x15b)]||_0x9f7d42(0x163),'connectionId':String(_0x4c1925['connectionId']),'columns':_0x4c1925[_0x9f7d42(0x192)]??[],'notifyOn':_0x4c1925[_0x9f7d42(0x19b)]??[],..._0x4c1925[_0x9f7d42(0x1dc)]!==undefined&&{'description':_0x4c1925[_0x9f7d42(0x1dc)]},..._0x4c1925[_0x9f7d42(0x1b7)]!==undefined&&{'allColumns':_0x4c1925[_0x9f7d42(0x1b7)]},..._0x4c1925[_0x9f7d42(0x199)]!==undefined&&{'timezone':_0x4c1925[_0x9f7d42(0x199)]},..._0x4c1925[_0x9f7d42(0x1c0)]!==undefined&&{'connectorConfig':_0x4c1925[_0x9f7d42(0x1c0)]},..._0x4c1925[_0x9f7d42(0x1be)]!==undefined&&{'emailRecipients':_0x4c1925[_0x9f7d42(0x1be)]},..._0x4c1925['activationTemplateId']!==undefined&&{'activationTemplateId':_0x4c1925[_0x9f7d42(0x198)]},..._0x4c1925[_0x9f7d42(0x1d1)]!==undefined&&{'syndicationBehavior':_0x4c1925[_0x9f7d42(0x1d1)]}},_0x2b8b16=await this[_0x9f7d42(0x181)][_0x9f7d42(0x1de)]('POST',_0x36b300,{'body':{'type':_0x9f7d42(0x1ae),'attributes':{'runAfterJourneyRefresh':_0x4c1925[_0x9f7d42(0x17a)]??![],'activationParams':_0x26983d}},'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x9f7d42(0x185)in _0x2b8b16?_0x2b8b16[_0x9f7d42(0x185)]:_0x2b8b16;}}export function buildJourneyEndpoint(_0x19f55b,_0x21a4d8,_0x593f77){const _0x66d2c0=a88_0x1e9b17,_0x24b02b=_0x66d2c0(0x175)+_0x19f55b+'/'+_0x21a4d8,_0x29a52d=new URLSearchParams();if(_0x593f77?.[_0x66d2c0(0x167)])_0x29a52d[_0x66d2c0(0x1b3)]('from',_0x593f77['from']);if(_0x593f77?.['to'])_0x29a52d[_0x66d2c0(0x1b3)]('to',_0x593f77['to']);if(_0x593f77?.[_0x66d2c0(0x171)]!=null)_0x29a52d[_0x66d2c0(0x1b3)](_0x66d2c0(0x171),String(_0x593f77[_0x66d2c0(0x171)]));const _0x555f7c=_0x29a52d[_0x66d2c0(0x1a9)]();return _0x555f7c?_0x24b02b+'?'+_0x555f7c:_0x24b02b;}function a88_0x6451(){const _0x4b3ae3=['journeys','getAudienceAttributes','site','/journeys','links','authHeaders','?depth=','parentFolderId','countPopulation','query','/entities/journeys','filter','conversion_sankey_charts','/audiences/','syndicationBehavior','/folders','journeyStageStatistics','getParentSegment','POST','Invalid\x20journey\x20bundle\x20response','folder-segment','stepSizes','string','latestJourneyId','createParentSegment','description','exitOrJumpSize','request','updatedAt','deleteSegment','/segments','listEntitiesByFolder','parentFolder','chart','updateSegment','getSegmentEntity','/attributes','/entities/journeys?folder_id=','updateJourney','scheduleType','/activations','/entities/parent_segments','/entities/segments/','getJourneyStatistics','createJourney','99lAyhZW','5833100vesBxq','none','sql','/syndications','completeMilestoneRate','from','map','completionRate','getJourneyActivation','724473EcNrFo','createSegmentFolder','getSegment','5kOdKFO','/segments/','PATCH','limit','createdAt','PUT','getAudienceBehaviors','/entities/journeys/','createSegment','6981270PNQoQc','/entities/folders/','goalSize','runAfterJourneyRefresh','/behaviors','object','exitOrJumpRate','cdp','?realtime=','statistics','httpClient','name','checkJourneyAppendable','/pause','data','versionNumber','/entities/journey_bundles/','journeyStageId','GET','milestoneSize','deleteActivation','metaData','segment-journey','/entities/segments','getSegmentSQL','getParentSegmentFull','&with_rule=','columns','exitSizes','getJourney','listJourneyActivations','getSegmentSQLFromRule','requestSegmentSQL','activationTemplateId','timezone','stepInfluxes','notifyOn','accessToken','length','/audiences','9616806PRqXTZ','size','journeyId','updateParentSegment','activation_sankey_charts','getActivationSankeyChart','11IkQCtt','attributes','/activations/','145410iyqZzC','toString','application/vnd.treasuredata.v1+json','runParentSegment','7986937cfJxWx','rule','journeyActivationStep','12668856yBnTmn','listActivations','updateActivation','application/json','set','lastVersionNumber','createJourneyActivation','getParentSegmentSQL','allColumns','pauseJourney','audienceId','isArray','/entities/parent_segments/','enteredSize','history','emailRecipients','createJourneyVersion','connectorConfig','paused','/segments/query'];a88_0x6451=function(){return _0x4b3ae3;};return a88_0x6451();}export function parseJourneyStatisticsResponse(_0x378b09){const _0x375b2e=a88_0x1e9b17;if(!(_0x375b2e(0x185)in _0x378b09))return _0x378b09;const _0x3bef07=_0x378b09['data'];if(!(_0x375b2e(0x1a6)in _0x3bef07)||!_0x3bef07['attributes']||typeof _0x3bef07[_0x375b2e(0x1a6)]!==_0x375b2e(0x17c))return _0x3bef07;const _0x4bad2d=_0x3bef07['attributes'],_0x2f8e06={'journeyId':_0x4bad2d['journeyId'],'size':_0x4bad2d[_0x375b2e(0x1a0)],'goalSize':_0x4bad2d[_0x375b2e(0x179)],'enteredSize':_0x4bad2d[_0x375b2e(0x1bc)],'completionRate':_0x4bad2d[_0x375b2e(0x169)],'exitOrJumpSize':_0x4bad2d[_0x375b2e(0x1dd)],'exitOrJumpRate':_0x4bad2d[_0x375b2e(0x17d)],'stages':(_0x4bad2d[_0x375b2e(0x1d3)]??[])['map'](_0x162696=>{const _0x593b9f=_0x375b2e,_0x88dda2={'id':_0x162696['id'],'enteredSize':_0x162696[_0x593b9f(0x1bc)],'milestoneSize':_0x162696[_0x593b9f(0x18a)],'completeMilestoneRate':_0x162696[_0x593b9f(0x166)],'exitOrJumpSize':_0x162696['exitOrJumpSize'],'exitOrJumpRate':_0x162696[_0x593b9f(0x17d)],'size':_0x162696['size']};if(_0x162696[_0x593b9f(0x1bd)])_0x88dda2[_0x593b9f(0x1bd)]=_0x162696[_0x593b9f(0x1bd)];if(_0x162696[_0x593b9f(0x1d8)])_0x88dda2[_0x593b9f(0x1d8)]=_0x162696[_0x593b9f(0x1d8)];if(_0x162696[_0x593b9f(0x19a)])_0x88dda2[_0x593b9f(0x19a)]=_0x162696[_0x593b9f(0x19a)];if(_0x162696[_0x593b9f(0x193)])_0x88dda2[_0x593b9f(0x193)]=_0x162696[_0x593b9f(0x193)];return _0x88dda2;})};return Array['isArray'](_0x4bad2d[_0x375b2e(0x1bd)])&&(_0x2f8e06[_0x375b2e(0x1bd)]=_0x4bad2d[_0x375b2e(0x1bd)]),_0x2f8e06;}function extractSankeyChart(_0x4a2a3d){const _0x2fe22f=a88_0x1e9b17,_0x2addc8=Array['isArray'](_0x4a2a3d[_0x2fe22f(0x185)])?_0x4a2a3d[_0x2fe22f(0x185)]:[],_0x56bade=_0x4a2a3d[_0x2fe22f(0x18c)]&&typeof _0x4a2a3d['metaData']==='object'?_0x4a2a3d[_0x2fe22f(0x18c)]:{},_0x2a056e=Array[_0x2fe22f(0x1ba)](_0x56bade[_0x2fe22f(0x1c7)])?_0x56bade[_0x2fe22f(0x1c7)]:[];return{'nodes':_0x2addc8,'links':_0x2a056e};}function extractJsonApiAttributes(_0x12b965){const _0x50b6d5=a88_0x1e9b17;if(!_0x12b965||typeof _0x12b965!==_0x50b6d5(0x17c))return[];const _0x35194b=_0x12b965;if(!Array[_0x50b6d5(0x1ba)](_0x35194b[_0x50b6d5(0x185)]))return[];return _0x35194b['data']['filter'](_0x2d7586=>!!_0x2d7586&&typeof _0x2d7586==='object')[_0x50b6d5(0x168)](_0x23c11d=>_0x23c11d[_0x50b6d5(0x1a6)])[_0x50b6d5(0x1ce)](_0x518506=>!!_0x518506&&typeof _0x518506===_0x50b6d5(0x17c));}export function parseConversionSankeyResponse(_0x2fde3e){const _0x558dc2=a88_0x1e9b17,_0x51936={'nodes':[],'links':[]},_0x39deaa=extractJsonApiAttributes(_0x2fde3e);if(_0x39deaa[_0x558dc2(0x19d)]===0x0)return _0x51936;const _0xd71fd7=_0x39deaa[0x0],_0x804725=_0xd71fd7['chart'];if(_0x804725&&typeof _0x804725===_0x558dc2(0x17c)){const {nodes:_0x23ded3,links:_0x1d0521}=extractSankeyChart(_0x804725);return{'nodes':_0x23ded3,'links':_0x1d0521,...typeof _0xd71fd7['updatedAt']==='string'?{'updatedAt':_0xd71fd7[_0x558dc2(0x1df)]}:{}};}return _0x51936;}export function parseActivationSankeyResponse(_0x1cffda){const _0x5a6984=a88_0x1e9b17,_0x3bcad5=extractJsonApiAttributes(_0x1cffda);if(_0x3bcad5[_0x5a6984(0x19d)]>0x0)return _0x3bcad5[_0x5a6984(0x168)](_0x51fa0b=>{const _0x1dec91=_0x5a6984,_0x2bfaff=_0x51fa0b[_0x1dec91(0x1e4)],{nodes:_0x21ed8f,links:_0x60a6bd}=_0x2bfaff&&typeof _0x2bfaff===_0x1dec91(0x17c)?extractSankeyChart(_0x2bfaff):{'nodes':[],'links':[]};return{'journeyStageId':typeof _0x51fa0b['journeyStageId']==='string'?_0x51fa0b[_0x1dec91(0x188)]:'','nodes':_0x21ed8f,'links':_0x60a6bd,...typeof _0x51fa0b['updatedAt']===_0x1dec91(0x1d9)?{'updatedAt':_0x51fa0b[_0x1dec91(0x1df)]}:{}};});if(Array[_0x5a6984(0x1ba)](_0x1cffda))return _0x1cffda;return[];}export function parseJourneyBundleResponse(_0x4c3ec5){const _0x32c172=a88_0x1e9b17;if(!_0x4c3ec5||typeof _0x4c3ec5!==_0x32c172(0x17c))throw new Error(_0x32c172(0x1d6));const _0xb62428=_0x4c3ec5,_0x39a98f=_0xb62428['data'],_0x5cb0ff=_0x39a98f?.[_0x32c172(0x1a6)]??_0xb62428,_0x31a466=Array[_0x32c172(0x1ba)](_0x5cb0ff[_0x32c172(0x1c3)])?_0x5cb0ff['journeys']:[],_0x111778=_0x31a466[_0x32c172(0x168)](_0xbebbc6=>{const _0x217985=_0x32c172;if(!_0xbebbc6||typeof _0xbebbc6!=='object')return _0xbebbc6;const _0x94eac8=_0xbebbc6;if(_0x94eac8[_0x217985(0x185)]&&typeof _0x94eac8['data']===_0x217985(0x17c))return _0x94eac8[_0x217985(0x185)];return _0x94eac8;});return{'name':_0x5cb0ff[_0x32c172(0x182)],'description':_0x5cb0ff['description']??null,'latestJourneyId':_0x5cb0ff[_0x32c172(0x1da)],'lastVersionNumber':_0x5cb0ff[_0x32c172(0x1b4)],'journeys':_0x111778};}
|
|
1
|
+
function a88_0x4357(_0x2646e7,_0xbef683){_0x2646e7=_0x2646e7-0x7e;const _0x12b25b=a88_0x12b2();let _0x4357bb=_0x12b25b[_0x2646e7];return _0x4357bb;}const a88_0x2f1bd6=a88_0x4357;(function(_0x5a352e,_0x5c95f4){const _0xbeaae0=a88_0x4357,_0x41c1ea=_0x5a352e();while(!![]){try{const _0x4be1d8=-parseInt(_0xbeaae0(0x93))/0x1*(-parseInt(_0xbeaae0(0xe8))/0x2)+-parseInt(_0xbeaae0(0xdb))/0x3+parseInt(_0xbeaae0(0x94))/0x4*(parseInt(_0xbeaae0(0xfb))/0x5)+parseInt(_0xbeaae0(0xd4))/0x6+parseInt(_0xbeaae0(0xf9))/0x7+parseInt(_0xbeaae0(0x101))/0x8*(-parseInt(_0xbeaae0(0xc6))/0x9)+-parseInt(_0xbeaae0(0x8f))/0xa*(-parseInt(_0xbeaae0(0x85))/0xb);if(_0x4be1d8===_0x5c95f4)break;else _0x41c1ea['push'](_0x41c1ea['shift']());}catch(_0x1bc24e){_0x41c1ea['push'](_0x41c1ea['shift']());}}}(a88_0x12b2,0x8840e));function a88_0x12b2(){const _0x7e3bae=['request','goalSize','application/vnd.treasuredata.v1+json','8RCWhDE','length','/detail','journeyStageStatistics','sql','/folders','journeyId','parentFolderId','syndicationBehavior','toString','/entities/parent_segments','object','/resume','enteredSize','limit','chart','updateJourneyDetail','size','completionRate','latestJourneyId','createSegmentFolder','filter','Invalid\x20journey\x20bundle\x20response','/entities/journeys','getSegmentSQLFromRule','activation_sankey_charts','/entities/by-folder/','requestSegmentSQL','included','stepInfluxes','673508UcNeqP','/entities/segments/','/entities/journeys?folder_id=','PUT','pauseJourney','history','updateJourney','authHeaders','createJourney','allColumns','200czBoyk','&with_rule=','listJourneyActivations','listParentSegments','180781DBDkDP','43388JeQBWW','createdAt','getActivation','createJourneySegment','deleteActivation','/audiences/','map','/entities/journey_bundles/','journeyActivationStep','attributes','rule','/journeys','getActivationSankeyChart','/syndications/','listEntitiesByFolder','isArray','connectionId','createParentSegment','/activations/','folder-segment','listActivations','/entities/folders/','/journeys_appendable','journeyBundleId','statistics','httpClient','getParentSegmentSQL','exitOrJumpRate','resumeJourney','state','none','segment-journey','set','site','/segments','activationTemplateId','string','completeMilestoneRate','getSegment','cdp','/syndications','/run','checkJourneyAppendable','application/json','description','listJourneysWithDetails','createJourneyVersion','GET','data','paused','8171469PoNfvj','/entities/journeys/','/segments/','getJourneyActivation','getAudienceBehaviors','listSegmentFolders','from','timezone','type','countPopulation','getSegmentEntity','runAfterJourneyRefresh','createJourneyActivation','journeyStageId','59322ePpGlE','relationships','exitOrJumpSize','updatedAt','links','emailRecipients','conversion_sankey_charts','2768079tMTBog','proxy','updateSegment','/entities/segments','getJourney','PATCH','getJourneyStatistics','updateParentSegment','getSegmentSQL','getConversionSankeyChart','listJourneys','scheduleType','parentFolder','8lPncnT','DELETE','apiKey','metaData','name','?realtime=','?depth=','audienceId','getParentSegment','journeys','exitSizes','/attributes','milestoneSize','versionNumber','POST','notifyOn','lastVersionNumber','360584tOBByl','/activations','175ErogUl','getSegmentFolder','stepSizes'];a88_0x12b2=function(){return _0x7e3bae;};return a88_0x12b2();}import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class CDPApiClient{['httpClient'];[a88_0x2f1bd6(0x8c)];constructor(_0x23c2a0){const _0xe1b191=a88_0x2f1bd6,_0x517615=getEndpoint(_0x23c2a0[_0xe1b191(0xb5)],_0xe1b191(0xbb));this[_0xe1b191(0x8c)]=toHeaderRecord(getAuthHeaders(_0x23c2a0[_0xe1b191(0xb5)],_0x23c2a0[_0xe1b191(0xea)],_0x23c2a0['accessToken'])),this[_0xe1b191(0xad)]=new HTTPClient(_0x517615,{...this[_0xe1b191(0x8c)],'Accept':_0xe1b191(0x100),'Content-Type':_0xe1b191(0xbf)},{'proxy':_0x23c2a0[_0xe1b191(0xdc)]});}async[a88_0x2f1bd6(0x92)](){const _0x153760=a88_0x2f1bd6,_0x525041=_0x153760(0x10b),_0x56d9d5=await this[_0x153760(0xad)]['request'](_0x153760(0xc3),_0x525041);return Array[_0x153760(0xa3)](_0x56d9d5)?_0x56d9d5:_0x56d9d5[_0x153760(0xc4)];}async[a88_0x2f1bd6(0xf0)](_0x4019e1){const _0x472072=a88_0x2f1bd6,_0x4488ba='/entities/parent_segments/'+_0x4019e1,_0x25621a=await this[_0x472072(0xad)][_0x472072(0xfe)]('GET',_0x4488ba);return _0x472072(0xc4)in _0x25621a?_0x25621a[_0x472072(0xc4)]:_0x25621a;}async['listSegments'](_0x26a340){const _0x25cd23=a88_0x2f1bd6,_0x3fd869='/audiences/'+_0x26a340+'/segments',_0x593886=await this[_0x25cd23(0xad)]['request'](_0x25cd23(0xc3),_0x3fd869);return Array[_0x25cd23(0xa3)](_0x593886)?_0x593886:_0x593886['data'];}async[a88_0x2f1bd6(0xba)](_0x46a964,_0x475cb4){const _0x37f551=a88_0x2f1bd6,_0x4b632a=_0x37f551(0x99)+_0x46a964+_0x37f551(0xc8)+_0x475cb4,_0xf2ebe0=await this[_0x37f551(0xad)][_0x37f551(0xfe)](_0x37f551(0xc3),_0x4b632a);return _0x37f551(0xc4)in _0xf2ebe0?_0xf2ebe0['data']:_0xf2ebe0;}async[a88_0x2f1bd6(0xd0)](_0x4c288b){const _0x560798=a88_0x2f1bd6,_0x328764=_0x560798(0x86)+_0x4c288b,_0x3051b7=await this[_0x560798(0xad)][_0x560798(0xfe)](_0x560798(0xc3),_0x328764);if(_0x560798(0xc4)in _0x3051b7){const _0x1e1bef=_0x3051b7['data'];if(_0x560798(0x9d)in _0x1e1bef&&_0x1e1bef['attributes']&&typeof _0x1e1bef['attributes']===_0x560798(0x10c)){const _0x189b66=_0x1e1bef[_0x560798(0x9d)];return{'id':_0x1e1bef['id'],'name':_0x189b66[_0x560798(0xec)],..._0x189b66};}return _0x1e1bef;}return _0x3051b7;}async[a88_0x2f1bd6(0xcb)](_0x45a8da){const _0x128695=a88_0x2f1bd6,_0x13223e=_0x128695(0x99)+_0x45a8da+_0x128695(0x106),_0x33987c=await this[_0x128695(0xad)][_0x128695(0xfe)](_0x128695(0xc3),_0x13223e);return Array[_0x128695(0xa3)](_0x33987c)?_0x33987c:_0x33987c[_0x128695(0xc4)];}async[a88_0x2f1bd6(0xfc)](_0x109184){const _0x709e00=a88_0x2f1bd6,_0x962484=_0x709e00(0xa9)+_0x109184,_0x478d46=await this['httpClient']['request'](_0x709e00(0xc3),_0x962484);return _0x709e00(0xc4)in _0x478d46?_0x478d46['data']:_0x478d46;}async[a88_0x2f1bd6(0xa2)](_0x161f4e,_0x5099e9=0x20,_0x100630=![]){const _0x5bf7bb=a88_0x2f1bd6,_0x432eaf=_0x5bf7bb(0x81)+_0x161f4e+_0x5bf7bb(0xee)+_0x5099e9+_0x5bf7bb(0x90)+_0x100630;return await this[_0x5bf7bb(0xad)][_0x5bf7bb(0xfe)](_0x5bf7bb(0xc3),_0x432eaf);}async[a88_0x2f1bd6(0xa8)](_0x1dd771,_0x29bdf8){const _0xa54460=a88_0x2f1bd6,_0x13ae82=_0xa54460(0x99)+_0x1dd771+'/segments/'+_0x29bdf8+_0xa54460(0xbc),_0x5164ab=await this[_0xa54460(0xad)][_0xa54460(0xfe)]('GET',_0x13ae82);return Array[_0xa54460(0xa3)](_0x5164ab)?_0x5164ab:_0x5164ab[_0xa54460(0xc4)];}async[a88_0x2f1bd6(0x96)](_0x1bb2b3,_0x2d8fd2,_0x2116b9){const _0x34f9d8=a88_0x2f1bd6,_0x2536bc=_0x34f9d8(0x99)+_0x1bb2b3+_0x34f9d8(0xc8)+_0x2d8fd2+_0x34f9d8(0xa1)+_0x2116b9,_0x555f0f=await this[_0x34f9d8(0xad)][_0x34f9d8(0xfe)]('GET',_0x2536bc);return _0x34f9d8(0xc4)in _0x555f0f?_0x555f0f[_0x34f9d8(0xc4)]:_0x555f0f;}async['createActivation'](_0x2de755,_0x40207b,_0x204435){const _0x40c220=a88_0x2f1bd6,_0x2dcdcc=_0x40c220(0x99)+_0x2de755+_0x40c220(0xc8)+_0x40207b+_0x40c220(0xbc),_0x55d674=await this[_0x40c220(0xad)][_0x40c220(0xfe)](_0x40c220(0xf6),_0x2dcdcc,{'body':_0x204435});return _0x55d674;}async['updateActivation'](_0x19d6bf,_0x2eb38c,_0x3c4927,_0x2f663d){const _0x4d91f6=a88_0x2f1bd6,_0x1f33bf='/audiences/'+_0x19d6bf+_0x4d91f6(0xc8)+_0x2eb38c+_0x4d91f6(0xa1)+_0x3c4927,_0x37ad3d=await this['httpClient'][_0x4d91f6(0xfe)]('PUT',_0x1f33bf,{'body':_0x2f663d});return _0x37ad3d;}async[a88_0x2f1bd6(0x98)](_0x1c25e2,_0x2299db,_0xcf035f){const _0x22aa27=a88_0x2f1bd6,_0x1d124c=_0x22aa27(0x99)+_0x1c25e2+_0x22aa27(0xc8)+_0x2299db+_0x22aa27(0xa1)+_0xcf035f;await this[_0x22aa27(0xad)][_0x22aa27(0xfe)](_0x22aa27(0xe9),_0x1d124c);}async[a88_0x2f1bd6(0xae)](_0x2b87ee){const _0x5d49c5=a88_0x2f1bd6;return this[_0x5d49c5(0x82)](_0x2b87ee);}async[a88_0x2f1bd6(0x7f)](_0x4eac97,_0x5a3ec7){const _0x521e34=a88_0x2f1bd6;return this[_0x521e34(0x82)](_0x4eac97,_0x5a3ec7);}async[a88_0x2f1bd6(0xe3)](_0x396918,_0x549766){const _0x19719c=a88_0x2f1bd6,_0x11d9dd=await this[_0x19719c(0xba)](_0x396918,_0x549766),_0x11b88a=_0x19719c(0x9e)in _0x11d9dd&&_0x11d9dd['rule']?_0x11d9dd['rule']:undefined;return this[_0x19719c(0x82)](_0x396918,_0x11b88a);}async[a88_0x2f1bd6(0x82)](_0x282cb0,_0x446a23){const _0x151793=a88_0x2f1bd6,_0x22d1b5=_0x151793(0x99)+_0x282cb0+'/segments/query',_0x3957bb={'format':'sql'};_0x446a23&&(_0x3957bb[_0x151793(0x9e)]=_0x446a23);const _0xac5699=await this['httpClient'][_0x151793(0xfe)]('POST',_0x22d1b5,{'body':_0x3957bb});return _0xac5699[_0x151793(0x105)]||_0xac5699['query']||'';}async[a88_0x2f1bd6(0xa5)](_0x7722c8){const _0x1d1da2=a88_0x2f1bd6,_0x1b719a='/audiences',_0x40a72e=await this[_0x1d1da2(0xad)][_0x1d1da2(0xfe)]('POST',_0x1b719a,{'body':_0x7722c8,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x40a72e;}async[a88_0x2f1bd6(0xe2)](_0x2809de,_0x37f732){const _0x320af6=a88_0x2f1bd6,_0x27da17=_0x320af6(0x99)+_0x2809de,_0x568326=await this[_0x320af6(0xad)][_0x320af6(0xfe)](_0x320af6(0x88),_0x27da17,{'body':_0x37f732,'headers':{'Content-Type':_0x320af6(0x100)}});return _0x568326;}async['getParentSegmentFull'](_0x36532b){const _0x3ef51e=a88_0x2f1bd6,_0x17179d=_0x3ef51e(0x99)+_0x36532b,_0x7d04fa=await this[_0x3ef51e(0xad)][_0x3ef51e(0xfe)](_0x3ef51e(0xc3),_0x17179d,{'headers':{'Accept':'application/vnd.treasuredata.v1+json'}});return _0x7d04fa;}async['getAudienceAttributes'](_0x3d85f0){const _0x59ae1f=a88_0x2f1bd6,_0x275f14='/audiences/'+_0x3d85f0+_0x59ae1f(0xf3),_0x55e243=await this[_0x59ae1f(0xad)][_0x59ae1f(0xfe)](_0x59ae1f(0xc3),_0x275f14);return _0x55e243;}async[a88_0x2f1bd6(0xca)](_0x3c9d50,_0x1d2eb4){const _0xfa3eea=a88_0x2f1bd6;let _0x38865f=_0xfa3eea(0x99)+_0x3c9d50+'/behaviors';_0x1d2eb4!==undefined&&(_0x38865f+=_0xfa3eea(0xed)+_0x1d2eb4);const _0x28115d=await this[_0xfa3eea(0xad)][_0xfa3eea(0xfe)](_0xfa3eea(0xc3),_0x38865f);return _0x28115d;}async['createSegment'](_0x3b2cc3,_0x29bbe5){const _0x24ee58=a88_0x2f1bd6,_0x4a4c52='/audiences/'+_0x3b2cc3+_0x24ee58(0xb6),_0x4545d9=await this['httpClient'][_0x24ee58(0xfe)](_0x24ee58(0xf6),_0x4a4c52,{'body':_0x29bbe5});return _0x4545d9;}async[a88_0x2f1bd6(0x97)](_0x35c1dd){const _0x5cd36e=a88_0x2f1bd6,_0x3250fa=_0x5cd36e(0xde),_0x379756={'type':_0x5cd36e(0xb3),'attributes':{'name':_0x35c1dd[_0x5cd36e(0xec)],'description':_0x35c1dd[_0x5cd36e(0xc0)]||'','journeyId':_0x35c1dd[_0x5cd36e(0x107)],'rule':_0x35c1dd['rule'],'countPopulation':_0x35c1dd[_0x5cd36e(0xcf)]??!![]},'relationships':{'parentFolder':{'data':{'id':_0x35c1dd[_0x5cd36e(0x108)],'type':_0x5cd36e(0xa7)}}}},_0x3dfa24=await this['httpClient']['request']('POST',_0x3250fa,{'body':_0x379756,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x3dfa24[_0x5cd36e(0xc4)]['id'];}async[a88_0x2f1bd6(0xdd)](_0x131eee,_0x37aeee,_0x22118e){const _0x5af156=a88_0x2f1bd6,_0x5896ac=_0x5af156(0x99)+_0x131eee+_0x5af156(0xc8)+_0x37aeee,_0x57f31f=await this['httpClient']['request'](_0x5af156(0x88),_0x5896ac,{'body':_0x22118e});return _0x57f31f;}async['deleteSegment'](_0x56915c){const _0x18cce6=a88_0x2f1bd6,_0x17b3e5='/entities/segments/'+_0x56915c;await this[_0x18cce6(0xad)][_0x18cce6(0xfe)]('DELETE',_0x17b3e5);}async[a88_0x2f1bd6(0x115)](_0x5e5bff,_0x30615a){const _0x15f69a=a88_0x2f1bd6,_0x4b67ae='/audiences/'+_0x5e5bff+'/folders',_0x1229d0=await this[_0x15f69a(0xad)][_0x15f69a(0xfe)](_0x15f69a(0xf6),_0x4b67ae,{'body':_0x30615a});if('data'in _0x1229d0&&_0x1229d0['data']){const _0x556f4d=_0x1229d0[_0x15f69a(0xc4)];return{'id':_0x556f4d['id'],'name':_0x556f4d[_0x15f69a(0xec)],'description':_0x556f4d['description'],'audienceId':_0x556f4d[_0x15f69a(0xef)]||String(_0x5e5bff),'parentFolderId':_0x556f4d[_0x15f69a(0x108)],'createdAt':_0x556f4d[_0x15f69a(0x95)],'updatedAt':_0x556f4d[_0x15f69a(0xd7)]};}return _0x1229d0;}async['runParentSegment'](_0x3b4dce){const _0x3fe8cf=a88_0x2f1bd6,_0x288f1c=_0x3fe8cf(0x99)+_0x3b4dce+_0x3fe8cf(0xbd),_0x5925b8=await this['httpClient'][_0x3fe8cf(0xfe)]('POST',_0x288f1c);return _0x5925b8;}async[a88_0x2f1bd6(0xe5)](_0x2bdc3a){const _0x27e805=a88_0x2f1bd6,_0x15201e=_0x27e805(0x87)+_0x2bdc3a,_0x4dcdc9=await this[_0x27e805(0xad)][_0x27e805(0xfe)]('GET',_0x15201e);return _0x4dcdc9['data'][_0x27e805(0x9a)](_0x3174fe=>({'id':_0x3174fe['id'],'name':_0x3174fe['attributes'][_0x27e805(0xec)],'journeyBundleName':_0x3174fe[_0x27e805(0x9d)]['journeyBundleName'],'journeyBundleId':_0x3174fe[_0x27e805(0x9d)][_0x27e805(0xab)],'versionNumber':_0x3174fe['attributes'][_0x27e805(0xf5)],'description':_0x3174fe[_0x27e805(0x9d)][_0x27e805(0xc0)],'state':_0x3174fe[_0x27e805(0x9d)][_0x27e805(0xb1)],'paused':_0x3174fe[_0x27e805(0x9d)][_0x27e805(0xc5)],'audienceId':_0x3174fe['attributes'][_0x27e805(0xef)],'folderId':_0x3174fe[_0x27e805(0xd5)]?.[_0x27e805(0xe7)]?.[_0x27e805(0xc4)]?.['id'],'createdAt':_0x3174fe[_0x27e805(0x9d)][_0x27e805(0x95)],'updatedAt':_0x3174fe['attributes'][_0x27e805(0xd7)]}));}async[a88_0x2f1bd6(0xc1)](_0x5b6db0){const _0x265a32=a88_0x2f1bd6,_0x1f8b9d=_0x265a32(0x87)+_0x5b6db0,_0x13fb2c=await this[_0x265a32(0xad)][_0x265a32(0xfe)]('GET',_0x1f8b9d),_0x3ddd0a=new Map();if(_0x13fb2c[_0x265a32(0x83)])for(const _0x281b5f of _0x13fb2c[_0x265a32(0x83)]){_0x281b5f[_0x265a32(0xce)]===_0x265a32(0x9c)&&_0x3ddd0a['set'](_0x281b5f['id'],_0x281b5f);}return{'journeys':_0x13fb2c[_0x265a32(0xc4)],'activationStepsById':_0x3ddd0a};}async[a88_0x2f1bd6(0xdf)](_0x578e25){const _0x4e3b57=a88_0x2f1bd6,_0x398304='/entities/journeys/'+_0x578e25,_0x1527c9=await this[_0x4e3b57(0xad)][_0x4e3b57(0xfe)](_0x4e3b57(0xc3),_0x398304);return _0x4e3b57(0xc4)in _0x1527c9?_0x1527c9[_0x4e3b57(0xc4)]:_0x1527c9;}async['getJourneyBundle'](_0x281355){const _0x10cc62=a88_0x2f1bd6,_0x2dccbd='/entities/journey_bundles/'+_0x281355,_0x1b6659=await this[_0x10cc62(0xad)][_0x10cc62(0xfe)]('GET',_0x2dccbd);return parseJourneyBundleResponse(_0x1b6659);}async[a88_0x2f1bd6(0xbe)](_0x395745){const _0xa31e20=a88_0x2f1bd6,_0x4d1372='/entities/journey_bundles/'+_0x395745+_0xa31e20(0xaa);await this['httpClient'][_0xa31e20(0xfe)]('GET',_0x4d1372);}async[a88_0x2f1bd6(0xc2)](_0x1f7a91,_0x1ce186){const _0x567b3b=a88_0x2f1bd6,_0x11c325=_0x567b3b(0x9b)+_0x1f7a91+_0x567b3b(0x9f),_0xdd0872=await this[_0x567b3b(0xad)][_0x567b3b(0xfe)](_0x567b3b(0xf6),_0x11c325,{'body':_0x1ce186});return'data'in _0xdd0872?_0xdd0872[_0x567b3b(0xc4)]:_0xdd0872;}async[a88_0x2f1bd6(0x8d)](_0x3a06e7){const _0x4d9164=a88_0x2f1bd6,_0x504e36=_0x4d9164(0x7e),_0x2d2b86=await this['httpClient'][_0x4d9164(0xfe)](_0x4d9164(0xf6),_0x504e36,{'body':_0x3a06e7,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x4d9164(0xc4)in _0x2d2b86?_0x2d2b86[_0x4d9164(0xc4)]:_0x2d2b86;}async[a88_0x2f1bd6(0x8b)](_0x228ca8,_0x4ad5be){const _0x136df8=a88_0x2f1bd6,_0x13036b=_0x136df8(0xc7)+_0x228ca8,_0x2fb65a=await this[_0x136df8(0xad)][_0x136df8(0xfe)](_0x136df8(0xe0),_0x13036b,{'body':_0x4ad5be,'headers':{'Content-Type':_0x136df8(0x100)}});return _0x136df8(0xc4)in _0x2fb65a?_0x2fb65a[_0x136df8(0xc4)]:_0x2fb65a;}async[a88_0x2f1bd6(0x111)](_0x4d2085,_0x569c04){const _0x2f1efa=a88_0x2f1bd6,_0xb3fec5=_0x2f1efa(0xc7)+_0x4d2085+_0x2f1efa(0x103),_0x5d153a=await this['httpClient'][_0x2f1efa(0xfe)](_0x2f1efa(0xf6),_0xb3fec5,{'body':_0x569c04,'headers':{'Content-Type':_0x2f1efa(0x100)}});return'data'in _0x5d153a?_0x5d153a[_0x2f1efa(0xc4)]:_0x5d153a;}async[a88_0x2f1bd6(0xe1)](_0x12474f,_0x4dc13d){const _0x2d2be8=a88_0x2f1bd6,_0x58a36c=buildJourneyEndpoint(_0x12474f,_0x2d2be8(0xac),_0x4dc13d),_0x2200ee=await this['httpClient'][_0x2d2be8(0xfe)](_0x2d2be8(0xc3),_0x58a36c);return parseJourneyStatisticsResponse(_0x2200ee);}async[a88_0x2f1bd6(0xe4)](_0x36d1f8,_0x13b29c){const _0x90f00f=a88_0x2f1bd6,_0x5bb94b=buildJourneyEndpoint(_0x36d1f8,_0x90f00f(0xda),_0x13b29c),_0xcc30d=await this[_0x90f00f(0xad)][_0x90f00f(0xfe)]('GET',_0x5bb94b);return parseConversionSankeyResponse(_0xcc30d);}async[a88_0x2f1bd6(0xa0)](_0x3e9b7f,_0x1bd397){const _0x29b07c=a88_0x2f1bd6,_0x300afa=buildJourneyEndpoint(_0x3e9b7f,_0x29b07c(0x80),_0x1bd397),_0x308991=await this['httpClient']['request'](_0x29b07c(0xc3),_0x300afa);return parseActivationSankeyResponse(_0x308991);}async[a88_0x2f1bd6(0x89)](_0x1b5035){const _0x400e95=a88_0x2f1bd6,_0x1f76e6=_0x400e95(0xc7)+_0x1b5035+'/pause',_0x2422e6=await this['httpClient'][_0x400e95(0xfe)](_0x400e95(0xe0),_0x1f76e6);return _0x400e95(0xc4)in _0x2422e6?_0x2422e6[_0x400e95(0xc4)]:_0x2422e6;}async[a88_0x2f1bd6(0xb0)](_0x564245){const _0x2d1fa4=a88_0x2f1bd6,_0x17d23c=_0x2d1fa4(0xc7)+_0x564245+_0x2d1fa4(0x10d),_0x503c28=await this[_0x2d1fa4(0xad)]['request'](_0x2d1fa4(0xe0),_0x17d23c);return'data'in _0x503c28?_0x503c28['data']:_0x503c28;}async[a88_0x2f1bd6(0xc9)](_0x53bfb4,_0x5772c6){const _0x50be14=a88_0x2f1bd6,_0x321f13='/entities/journeys/'+_0x53bfb4+_0x50be14(0xa6)+_0x5772c6,_0x27a2a7=await this[_0x50be14(0xad)][_0x50be14(0xfe)](_0x50be14(0xc3),_0x321f13);return _0x50be14(0xc4)in _0x27a2a7?_0x27a2a7['data']:_0x27a2a7;}async[a88_0x2f1bd6(0x91)](_0x238f21){const _0x139df9=a88_0x2f1bd6,_0x6af5ca=_0x139df9(0xc7)+_0x238f21+_0x139df9(0xfa),_0x35f69f=await this[_0x139df9(0xad)]['request']('GET',_0x6af5ca);return _0x139df9(0xc4)in _0x35f69f?_0x35f69f[_0x139df9(0xc4)]:_0x35f69f;}async[a88_0x2f1bd6(0xd2)](_0x44ad6d,_0x455245){const _0x4a0512=a88_0x2f1bd6,_0xed8750='/entities/journeys/'+_0x44ad6d+_0x4a0512(0xfa),_0x254b94={'name':_0x455245['name'],'scheduleType':_0x455245[_0x4a0512(0xe6)]||_0x4a0512(0xb2),'connectionId':String(_0x455245[_0x4a0512(0xa4)]),'columns':_0x455245['columns']??[],'notifyOn':_0x455245[_0x4a0512(0xf7)]??[],..._0x455245[_0x4a0512(0xc0)]!==undefined&&{'description':_0x455245[_0x4a0512(0xc0)]},..._0x455245['allColumns']!==undefined&&{'allColumns':_0x455245[_0x4a0512(0x8e)]},..._0x455245['timezone']!==undefined&&{'timezone':_0x455245[_0x4a0512(0xcd)]},..._0x455245['connectorConfig']!==undefined&&{'connectorConfig':_0x455245['connectorConfig']},..._0x455245[_0x4a0512(0xd9)]!==undefined&&{'emailRecipients':_0x455245[_0x4a0512(0xd9)]},..._0x455245[_0x4a0512(0xb7)]!==undefined&&{'activationTemplateId':_0x455245[_0x4a0512(0xb7)]},..._0x455245[_0x4a0512(0x109)]!==undefined&&{'syndicationBehavior':_0x455245[_0x4a0512(0x109)]}},_0x4baaa3=await this['httpClient'][_0x4a0512(0xfe)](_0x4a0512(0xf6),_0xed8750,{'body':{'type':'journeyActivationStep','attributes':{'runAfterJourneyRefresh':_0x455245[_0x4a0512(0xd1)]??![],'activationParams':_0x254b94}},'headers':{'Content-Type':_0x4a0512(0x100)}});return _0x4a0512(0xc4)in _0x4baaa3?_0x4baaa3[_0x4a0512(0xc4)]:_0x4baaa3;}}export function buildJourneyEndpoint(_0x4b0371,_0x2babaa,_0x2227d3){const _0x3dbba6=a88_0x2f1bd6,_0x44ece3='/entities/journeys/'+_0x4b0371+'/'+_0x2babaa,_0x595235=new URLSearchParams();if(_0x2227d3?.[_0x3dbba6(0xcc)])_0x595235['set'](_0x3dbba6(0xcc),_0x2227d3[_0x3dbba6(0xcc)]);if(_0x2227d3?.['to'])_0x595235[_0x3dbba6(0xb4)]('to',_0x2227d3['to']);if(_0x2227d3?.['limit']!=null)_0x595235[_0x3dbba6(0xb4)](_0x3dbba6(0x10f),String(_0x2227d3[_0x3dbba6(0x10f)]));const _0x22cbc1=_0x595235[_0x3dbba6(0x10a)]();return _0x22cbc1?_0x44ece3+'?'+_0x22cbc1:_0x44ece3;}export function parseJourneyStatisticsResponse(_0x3b7358){const _0x224836=a88_0x2f1bd6;if(!(_0x224836(0xc4)in _0x3b7358))return _0x3b7358;const _0x396461=_0x3b7358[_0x224836(0xc4)];if(!(_0x224836(0x9d)in _0x396461)||!_0x396461[_0x224836(0x9d)]||typeof _0x396461[_0x224836(0x9d)]!==_0x224836(0x10c))return _0x396461;const _0x3aac9b=_0x396461[_0x224836(0x9d)],_0xad4c3c={'journeyId':_0x3aac9b[_0x224836(0x107)],'size':_0x3aac9b[_0x224836(0x112)],'goalSize':_0x3aac9b[_0x224836(0xff)],'enteredSize':_0x3aac9b['enteredSize'],'completionRate':_0x3aac9b[_0x224836(0x113)],'exitOrJumpSize':_0x3aac9b[_0x224836(0xd6)],'exitOrJumpRate':_0x3aac9b[_0x224836(0xaf)],'stages':(_0x3aac9b[_0x224836(0x104)]??[])[_0x224836(0x9a)](_0x31407a=>{const _0xd2c4f5=_0x224836,_0x49ae7d={'id':_0x31407a['id'],'enteredSize':_0x31407a[_0xd2c4f5(0x10e)],'milestoneSize':_0x31407a[_0xd2c4f5(0xf4)],'completeMilestoneRate':_0x31407a[_0xd2c4f5(0xb9)],'exitOrJumpSize':_0x31407a[_0xd2c4f5(0xd6)],'exitOrJumpRate':_0x31407a['exitOrJumpRate'],'size':_0x31407a[_0xd2c4f5(0x112)]};if(_0x31407a['history'])_0x49ae7d[_0xd2c4f5(0x8a)]=_0x31407a[_0xd2c4f5(0x8a)];if(_0x31407a[_0xd2c4f5(0xfd)])_0x49ae7d[_0xd2c4f5(0xfd)]=_0x31407a[_0xd2c4f5(0xfd)];if(_0x31407a[_0xd2c4f5(0x84)])_0x49ae7d[_0xd2c4f5(0x84)]=_0x31407a[_0xd2c4f5(0x84)];if(_0x31407a[_0xd2c4f5(0xf2)])_0x49ae7d[_0xd2c4f5(0xf2)]=_0x31407a['exitSizes'];return _0x49ae7d;})};return Array['isArray'](_0x3aac9b[_0x224836(0x8a)])&&(_0xad4c3c[_0x224836(0x8a)]=_0x3aac9b[_0x224836(0x8a)]),_0xad4c3c;}function extractSankeyChart(_0x4ff25b){const _0x226a7a=a88_0x2f1bd6,_0x1646fd=Array[_0x226a7a(0xa3)](_0x4ff25b['data'])?_0x4ff25b[_0x226a7a(0xc4)]:[],_0x4c678f=_0x4ff25b[_0x226a7a(0xeb)]&&typeof _0x4ff25b[_0x226a7a(0xeb)]===_0x226a7a(0x10c)?_0x4ff25b['metaData']:{},_0x4e10ad=Array[_0x226a7a(0xa3)](_0x4c678f[_0x226a7a(0xd8)])?_0x4c678f[_0x226a7a(0xd8)]:[];return{'nodes':_0x1646fd,'links':_0x4e10ad};}function extractJsonApiAttributes(_0x488484){const _0x18cae2=a88_0x2f1bd6;if(!_0x488484||typeof _0x488484!==_0x18cae2(0x10c))return[];const _0x538dae=_0x488484;if(!Array[_0x18cae2(0xa3)](_0x538dae['data']))return[];return _0x538dae['data']['filter'](_0xe7c8e0=>!!_0xe7c8e0&&typeof _0xe7c8e0==='object')[_0x18cae2(0x9a)](_0xf67674=>_0xf67674[_0x18cae2(0x9d)])[_0x18cae2(0x116)](_0x1dd011=>!!_0x1dd011&&typeof _0x1dd011===_0x18cae2(0x10c));}export function parseConversionSankeyResponse(_0x1448e6){const _0x2d2588=a88_0x2f1bd6,_0x3a3701={'nodes':[],'links':[]},_0x4bedd8=extractJsonApiAttributes(_0x1448e6);if(_0x4bedd8[_0x2d2588(0x102)]===0x0)return _0x3a3701;const _0x1f3f30=_0x4bedd8[0x0],_0x16b78d=_0x1f3f30[_0x2d2588(0x110)];if(_0x16b78d&&typeof _0x16b78d===_0x2d2588(0x10c)){const {nodes:_0x1a447b,links:_0x2b1dac}=extractSankeyChart(_0x16b78d);return{'nodes':_0x1a447b,'links':_0x2b1dac,...typeof _0x1f3f30[_0x2d2588(0xd7)]===_0x2d2588(0xb8)?{'updatedAt':_0x1f3f30[_0x2d2588(0xd7)]}:{}};}return _0x3a3701;}export function parseActivationSankeyResponse(_0x2cf04f){const _0xdfdf51=a88_0x2f1bd6,_0x24f1a=extractJsonApiAttributes(_0x2cf04f);if(_0x24f1a[_0xdfdf51(0x102)]>0x0)return _0x24f1a['map'](_0x3ada44=>{const _0x540e1c=_0xdfdf51,_0x3e835e=_0x3ada44[_0x540e1c(0x110)],{nodes:_0x2cbe6a,links:_0x5c06fa}=_0x3e835e&&typeof _0x3e835e===_0x540e1c(0x10c)?extractSankeyChart(_0x3e835e):{'nodes':[],'links':[]};return{'journeyStageId':typeof _0x3ada44[_0x540e1c(0xd3)]===_0x540e1c(0xb8)?_0x3ada44['journeyStageId']:'','nodes':_0x2cbe6a,'links':_0x5c06fa,...typeof _0x3ada44[_0x540e1c(0xd7)]===_0x540e1c(0xb8)?{'updatedAt':_0x3ada44[_0x540e1c(0xd7)]}:{}};});if(Array[_0xdfdf51(0xa3)](_0x2cf04f))return _0x2cf04f;return[];}export function parseJourneyBundleResponse(_0x39e75d){const _0x177668=a88_0x2f1bd6;if(!_0x39e75d||typeof _0x39e75d!=='object')throw new Error(_0x177668(0x117));const _0xf33f6a=_0x39e75d,_0x63567f=_0xf33f6a[_0x177668(0xc4)],_0x340ddf=_0x63567f?.[_0x177668(0x9d)]??_0xf33f6a,_0x3b2d60=Array['isArray'](_0x340ddf[_0x177668(0xf1)])?_0x340ddf['journeys']:[],_0x4fcb1d=_0x3b2d60['map'](_0x5350dd=>{const _0x2abee3=_0x177668;if(!_0x5350dd||typeof _0x5350dd!=='object')return _0x5350dd;const _0x54cd0b=_0x5350dd;if(_0x54cd0b[_0x2abee3(0xc4)]&&typeof _0x54cd0b[_0x2abee3(0xc4)]===_0x2abee3(0x10c))return _0x54cd0b[_0x2abee3(0xc4)];return _0x54cd0b;});return{'name':_0x340ddf[_0x177668(0xec)],'description':_0x340ddf[_0x177668(0xc0)]??null,'latestJourneyId':_0x340ddf[_0x177668(0x114)],'lastVersionNumber':_0x340ddf[_0x177668(0xf8)],'journeys':_0x4fcb1d};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a89_0x2a1d80=a89_0x5a42;(function(_0x2eeb8b,_0x2e8f01){const _0xd61b8b=a89_0x5a42,_0x2c7fbe=_0x2eeb8b();while(!![]){try{const _0x69de8e=-parseInt(_0xd61b8b(0xa1))/0x1+-parseInt(_0xd61b8b(0x91))/0x2+-parseInt(_0xd61b8b(0x97))/0x3+-parseInt(_0xd61b8b(0xa7))/0x4+parseInt(_0xd61b8b(0x99))/0x5+-parseInt(_0xd61b8b(0xa0))/0x6+parseInt(_0xd61b8b(0xa2))/0x7*(parseInt(_0xd61b8b(0x9d))/0x8);if(_0x69de8e===_0x2e8f01)break;else _0x2c7fbe['push'](_0x2c7fbe['shift']());}catch(_0x2e09f9){_0x2c7fbe['push'](_0x2c7fbe['shift']());}}}(a89_0x19ed,0x9805a));import{HTTPClient}from'./http-client.js';function a89_0x19ed(){const _0x265757=['3261900vPcSog','site','apiKey','application/vnd.api+json','432iHHcDC','page[offset]','httpClient','2415792FjORip','101100ZcsDsk','310674pvCZEc','toString','append','proxy','listEmailSenders','4895444lYrXVf','/api/email_senders','page[limit]','422416BWZNnB','request','accessToken','offset','filter[workspaceId]','/api/email_senders?','1462575ZhkGQM','workspaceId'];a89_0x19ed=function(){return _0x265757;};return a89_0x19ed();}function a89_0x5a42(_0x320b92,_0x286e70){_0x320b92=_0x320b92-0x90;const _0x19ed34=a89_0x19ed();let _0x5a42d3=_0x19ed34[_0x320b92];return _0x5a42d3;}import{getDeliveryEndpoint}from'./endpoints.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class DeliveryApiClient{[a89_0x2a1d80(0x9f)];constructor(_0x4dd2f4){const _0x4633f3=a89_0x2a1d80,_0x3aad3b=getDeliveryEndpoint(_0x4dd2f4[_0x4633f3(0x9a)]),_0x3e64f3=toHeaderRecord(getAuthHeaders(_0x4dd2f4['site'],_0x4dd2f4[_0x4633f3(0x9b)],_0x4dd2f4[_0x4633f3(0x93)]));this[_0x4633f3(0x9f)]=new HTTPClient(_0x3aad3b,_0x3e64f3,{'proxy':_0x4dd2f4[_0x4633f3(0xa5)]});}async[a89_0x2a1d80(0xa6)](_0x20d2a0={}){const _0x157b39=a89_0x2a1d80,_0x789d39=new URLSearchParams();_0x20d2a0[_0x157b39(0x98)]&&_0x789d39[_0x157b39(0xa4)](_0x157b39(0x95),_0x20d2a0[_0x157b39(0x98)]);_0x20d2a0['limit']!==undefined&&_0x789d39[_0x157b39(0xa4)](_0x157b39(0x90),_0x20d2a0['limit'][_0x157b39(0xa3)]());_0x20d2a0[_0x157b39(0x94)]!==undefined&&_0x789d39[_0x157b39(0xa4)](_0x157b39(0x9e),_0x20d2a0[_0x157b39(0x94)][_0x157b39(0xa3)]());const _0x4a1fae=_0x789d39[_0x157b39(0xa3)](),_0x4d64f2=_0x4a1fae?_0x157b39(0x96)+_0x4a1fae:_0x157b39(0xa8);return await this[_0x157b39(0x9f)][_0x157b39(0x92)]('GET',_0x4d64f2,{'headers':{'Accept':_0x157b39(0x9c)}});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a90_0x53b277=a90_0x2837;function a90_0x2837(_0x376964,_0x3c6e87){_0x376964=_0x376964-0xf7;const _0xc2bfe2=a90_0xc2bf();let _0x2837cc=_0xc2bfe2[_0x376964];return _0x2837cc;}(function(_0x41859e,_0x2277e8){const _0x256d13=a90_0x2837,_0x1a47c6=_0x41859e();while(!![]){try{const _0x3089f5=-parseInt(_0x256d13(0x135))/0x1*(-parseInt(_0x256d13(0x10b))/0x2)+parseInt(_0x256d13(0x14e))/0x3*(parseInt(_0x256d13(0x143))/0x4)+-parseInt(_0x256d13(0x10e))/0x5+parseInt(_0x256d13(0x10c))/0x6*(-parseInt(_0x256d13(0x122))/0x7)+parseInt(_0x256d13(0xf9))/0x8+parseInt(_0x256d13(0x101))/0x9*(-parseInt(_0x256d13(0x111))/0xa)+-parseInt(_0x256d13(0x131))/0xb;if(_0x3089f5===_0x2277e8)break;else _0x1a47c6['push'](_0x1a47c6['shift']());}catch(_0x585485){_0x1a47c6['push'](_0x1a47c6['shift']());}}}(a90_0xc2bf,0xa753e));export const TD_ENDPOINTS={'us01':a90_0x53b277(0xfc),'ap01':a90_0x53b277(0x10f),'eu01':a90_0x53b277(0xfd),'ap02':a90_0x53b277(0x107),'ap03':a90_0x53b277(0x11c),'dev-us01':a90_0x53b277(0x138),'dev-eu01':a90_0x53b277(0x128),'stg-us01':a90_0x53b277(0x114),'stg-ap01':a90_0x53b277(0x14d),'stg-ap03':a90_0x53b277(0x124)};export const CDP_ENDPOINTS={'us01':a90_0x53b277(0x156),'ap01':a90_0x53b277(0x14b),'eu01':a90_0x53b277(0x14a),'ap02':a90_0x53b277(0xfa),'ap03':a90_0x53b277(0x123),'dev-us01':'https://api-development-cdp.us01.treasuredata.com','dev-eu01':a90_0x53b277(0x158),'stg-us01':a90_0x53b277(0x150),'stg-ap01':'https://api-staging-cdp.treasuredata.co.jp','stg-ap03':a90_0x53b277(0x12a)};export const WORKFLOW_ENDPOINTS={'us01':'https://api-workflow.treasuredata.com','ap01':a90_0x53b277(0xf8),'eu01':a90_0x53b277(0x115),'ap02':a90_0x53b277(0x10a),'ap03':'https://api-workflow.ap03.treasuredata.com','dev-us01':a90_0x53b277(0xff),'dev-eu01':'https://api-development-workflow.eu01.treasuredata.com','stg-us01':a90_0x53b277(0x152),'stg-ap01':a90_0x53b277(0x148),'stg-ap03':a90_0x53b277(0x109)};export const TRINO_ENDPOINTS={'us01':'https://api-presto.treasuredata.com','ap01':a90_0x53b277(0x12c),'eu01':a90_0x53b277(0x113),'ap02':a90_0x53b277(0x116),'ap03':a90_0x53b277(0x140),'dev-us01':'https://api-development-presto.treasuredata.com','dev-eu01':a90_0x53b277(0x151),'stg-us01':a90_0x53b277(0xfb),'stg-ap01':a90_0x53b277(0x154),'stg-ap03':'https://api-staging-presto.ap03.treasuredata.com'};export const LLM_ENDPOINTS={'us01':a90_0x53b277(0x12f),'ap01':a90_0x53b277(0x159),'eu01':a90_0x53b277(0x108),'ap02':'https://llm-api.ap02.treasuredata.com','ap03':a90_0x53b277(0x126),'dev-us01':a90_0x53b277(0x141),'dev-eu01':'https://llm-api-development.eu01.treasuredata.com','stg-us01':'https://llm-api-staging.us01.treasuredata.com','stg-ap01':a90_0x53b277(0x11e),'stg-ap03':'https://llm-api-staging.ap03.treasuredata.com'};export const LLM_PROXY_ENDPOINTS={'us01':a90_0x53b277(0x13c),'ap01':a90_0x53b277(0x112),'eu01':a90_0x53b277(0x14f),'ap02':a90_0x53b277(0x103),'ap03':a90_0x53b277(0x13d),'dev-us01':'https://llm-proxy-development.us01.treasuredata.com','dev-eu01':a90_0x53b277(0x127),'stg-us01':'https://llm-proxy-staging.us01.treasuredata.com','stg-ap01':a90_0x53b277(0x145),'stg-ap03':a90_0x53b277(0x13b)};export const ENGAGE_ENDPOINTS={'us01':a90_0x53b277(0x157),'ap01':a90_0x53b277(0x105),'eu01':a90_0x53b277(0x146),'ap02':'https://engage-api.ap02.treasuredata.com','ap03':a90_0x53b277(0x14c),'dev-us01':a90_0x53b277(0x13a),'dev-eu01':a90_0x53b277(0x120),'stg-us01':a90_0x53b277(0x155),'stg-ap01':a90_0x53b277(0x104),'stg-ap03':a90_0x53b277(0xfe)};export const DELIVERY_ENDPOINTS={'us01':a90_0x53b277(0x12e),'ap01':a90_0x53b277(0xf7),'eu01':a90_0x53b277(0x13f),'ap02':'https://delivery-api.ap02.treasuredata.com','ap03':'https://delivery-api.ap03.treasuredata.com','dev-us01':'https://delivery-api-development.us01.treasuredata.com','dev-eu01':a90_0x53b277(0x134),'stg-us01':'https://delivery-api-staging.us01.treasuredata.com','stg-ap01':'https://delivery-api-staging.treasuredata.co.jp','stg-ap03':a90_0x53b277(0x125)};export function getDeliveryEndpoint(_0x45d49d){const _0x386b2a=a90_0x53b277,_0x53cf1a=DELIVERY_ENDPOINTS[_0x45d49d];if(!_0x53cf1a)throw new Error(_0x386b2a(0x139)+_0x45d49d);return _0x53cf1a;}export const CONSOLE_ENDPOINTS={'us01':a90_0x53b277(0x137),'ap01':'https://console.treasuredata.co.jp','eu01':a90_0x53b277(0x11b),'ap02':a90_0x53b277(0x117),'ap03':a90_0x53b277(0x12b),'dev-us01':'https://console-development.us01.treasuredata.com','dev-eu01':a90_0x53b277(0x132),'stg-us01':'https://console-staging.us01.treasuredata.com','stg-ap01':a90_0x53b277(0x119),'stg-ap03':a90_0x53b277(0x11a)};export const CONSOLE_NEXT_ENDPOINTS={'us01':'https://console-next.us01.treasuredata.com','ap01':'https://console-next.treasuredata.co.jp','eu01':'https://console-next.eu01.treasuredata.com','ap02':'https://console-next.ap02.treasuredata.com','ap03':a90_0x53b277(0x153),'dev-us01':a90_0x53b277(0x106),'dev-eu01':'https://console-development-next.eu01.treasuredata.com','stg-us01':a90_0x53b277(0x144),'stg-ap01':a90_0x53b277(0x133),'stg-ap03':a90_0x53b277(0x142)};export function getConsoleUrl(_0x3118cf,_0x123316){const _0x120725=a90_0x53b277,_0x39bcd6=CONSOLE_ENDPOINTS[_0x3118cf]||_0x120725(0x130)+_0x3118cf+_0x120725(0x10d);return _0x123316?''+_0x39bcd6+_0x123316:_0x39bcd6;}export function getConsoleNextUrl(_0x3634d3,_0x3dd724){const _0x1eda1b=a90_0x53b277,_0x824c31=CONSOLE_NEXT_ENDPOINTS[_0x3634d3]||_0x1eda1b(0x102)+_0x3634d3+_0x1eda1b(0x10d);return _0x3dd724?''+_0x824c31+_0x3dd724:_0x824c31;}export function getLLMProjectUrl(_0x22fdd0,_0x5408df){const _0x4d8a69=a90_0x53b277;return getConsoleNextUrl(_0x22fdd0,_0x4d8a69(0x110)+_0x5408df+_0x4d8a69(0x149));}export function getLLMAgentChatUrl(_0xd3f11e,_0x5bb099,_0x19afdf){const _0x1e4ed4=a90_0x53b277;return getConsoleNextUrl(_0xd3f11e,_0x1e4ed4(0x110)+_0x5bb099+_0x1e4ed4(0x11d)+_0x19afdf+'/tc');}export function getLLMConversationUrl(_0x59fedb,_0x26a08c,_0x5d7e38,_0x20328b){const _0xaa13e7=a90_0x53b277;return getConsoleNextUrl(_0x59fedb,_0xaa13e7(0x110)+_0x26a08c+'/ag/'+_0x5d7e38+_0xaa13e7(0x100)+_0x20328b);}export function getWorkflowUrl(_0x32c598,_0x38bd04){const _0xc66412=a90_0x53b277;return getConsoleUrl(_0x32c598,_0xc66412(0x136)+_0x38bd04+'/info');}function a90_0xc2bf(){const _0x1b02b8=['https://llm-proxy.treasuredata.co.jp','https://api-presto.eu01.treasuredata.com','https://api-staging.treasuredata.com','https://api-workflow.eu01.treasuredata.com','https://api-presto.ap02.treasuredata.com','https://console.ap02.treasuredata.com','No\x20LLM\x20Proxy\x20endpoint\x20for\x20site:\x20','https://console-staging.treasuredata.co.jp','https://console-staging.ap03.treasuredata.com','https://console.eu01.treasuredata.com','https://api.ap03.treasuredata.com','/ag/','https://llm-api-staging.treasuredata.co.jp','/sessions/','https://engage-api-development.eu01.treasuredata.com','/attempt/','22925FXmgxk','https://api-cdp.ap03.treasuredata.com','https://api-staging.ap03.treasuredata.com','https://delivery-api-staging.ap03.treasuredata.com','https://llm-api.ap03.treasuredata.com','https://llm-proxy-development.eu01.treasuredata.com','https://api-development.eu01.treasuredata.com','\x27\x20and\x20site\x20\x27','https://api-staging-cdp.ap03.treasuredata.com','https://console.ap03.treasuredata.com','https://api-presto.treasuredata.co.jp','/app/jobs/','https://delivery-api.us01.treasuredata.com','https://llm-api.treasuredata.com','https://console.','1586739sLDpZN','https://console-development.eu01.treasuredata.com','https://console-staging-next.treasuredata.co.jp','https://delivery-api-development.eu01.treasuredata.com','144677GycCgc','/app/workflows/','https://console.us01.treasuredata.com','https://api-development.treasuredata.com','No\x20Delivery\x20API\x20endpoint\x20for\x20site:\x20','https://engage-api-development.us01.treasuredata.com','https://llm-proxy-staging.ap03.treasuredata.com','https://llm-proxy.us01.treasuredata.com','https://llm-proxy.ap03.treasuredata.com','/app/es/','https://delivery-api.eu01.treasuredata.com','https://api-presto.ap03.treasuredata.com','https://llm-api-development.us01.treasuredata.com','https://console-staging-next.ap03.treasuredata.com','1156gLPNdV','https://console-staging-next.us01.treasuredata.com','https://llm-proxy-staging.treasuredata.co.jp','https://engage-api.eu01.treasuredata.com','/em/','https://api-staging-workflow.treasuredata.co.jp','/ag','https://api-cdp.eu01.treasuredata.com','https://api-cdp.treasuredata.co.jp','https://engage-api.ap03.treasuredata.com','https://api-staging.treasuredata.co.jp','129PKkvIL','https://llm-proxy.eu01.treasuredata.com','https://api-staging-cdp.us01.treasuredata.com','https://api-development-presto.eu01.treasuredata.com','https://api-staging-workflow.us01.treasuredata.com','https://console-next.ap03.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','https://engage-api-staging.us01.treasuredata.com','https://api-cdp.treasuredata.com','https://engage-api.treasuredata.com','https://api-development-cdp.eu01.treasuredata.com','https://llm-api.treasuredata.co.jp','https://delivery-api.treasuredata.co.jp','https://api-workflow.treasuredata.co.jp','7230360FTrlMc','https://api-cdp.ap02.treasuredata.com','https://api-staging-presto.treasuredata.com','https://api.treasuredata.com','https://api.eu01.treasuredata.com','https://engage-api-staging.ap03.treasuredata.com','https://api-development-workflow.us01.treasuredata.com','/tc/','9TXLplm','https://console-next.','https://llm-proxy.ap02.treasuredata.com','https://engage-api-staging.treasuredata.co.jp','https://engage-api.treasuredata.co.jp','https://console-development-next.us01.treasuredata.com','https://api.ap02.treasuredata.com','https://llm-api.eu01.treasuredata.com','https://api-staging-workflow.ap03.treasuredata.com','https://api-workflow.ap02.treasuredata.com','10vsKOYX','36MoaTAS','.treasuredata.com','2792485HyhVmL','https://api.treasuredata.co.jp','/app/af/','2318370rTudGs'];a90_0xc2bf=function(){return _0x1b02b8;};return a90_0xc2bf();}export function getWorkflowSessionUrl(_0x2aa5e4,_0x4ac49c,_0x245bbe){const _0x59cdb2=a90_0x53b277;return getConsoleUrl(_0x2aa5e4,'/app/workflows/'+_0x4ac49c+_0x59cdb2(0x11f)+_0x245bbe);}export function getWorkflowAttemptUrl(_0x451a13,_0x1e5f60,_0x582184,_0x30ecd2){const _0x317283=a90_0x53b277;return getConsoleUrl(_0x451a13,'/app/workflows/'+_0x1e5f60+_0x317283(0x11f)+_0x582184+_0x317283(0x121)+_0x30ecd2);}export function getCampaignUrl(_0x45f5ea,_0x2dba93,_0x3a4bff){const _0x4b055c=a90_0x53b277;return getConsoleNextUrl(_0x45f5ea,_0x4b055c(0x13e)+_0x2dba93+'/ooc/'+_0x3a4bff);}export function getTemplateUrl(_0x4d2aba,_0x1bcea1,_0x21f7cc){const _0x2272db=a90_0x53b277;return getConsoleNextUrl(_0x4d2aba,_0x2272db(0x13e)+_0x1bcea1+_0x2272db(0x147)+_0x21f7cc+'/ce');}export function getJobUrl(_0x519bde,_0x70c49c){const _0x40e000=a90_0x53b277;return getConsoleNextUrl(_0x519bde,_0x40e000(0x12d)+_0x70c49c+'/result');}export function getWorkspaceUrl(_0x41cb9b,_0x3445b1){return getConsoleNextUrl(_0x41cb9b,'/app/es/'+_0x3445b1);}export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS,'engage':ENGAGE_ENDPOINTS,'llm-proxy':LLM_PROXY_ENDPOINTS};export function getLLMProxyEndpoint(_0x359db4){const _0x1f8d01=a90_0x53b277,_0xd44611=LLM_PROXY_ENDPOINTS[_0x359db4];if(!_0xd44611)throw new Error(_0x1f8d01(0x118)+_0x359db4);return _0xd44611;}export function getEndpoint(_0x20601e,_0x4828bc='td'){const _0x57b07f=a90_0x53b277,_0x2a6534=API_ENDPOINTS[_0x4828bc]?.[_0x20601e];if(!_0x2a6534)throw new Error('No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27'+_0x4828bc+_0x57b07f(0x129)+_0x20601e+'\x27');return _0x2a6534;}
|
|
1
|
+
const a90_0x1eebe3=a90_0x1a2d;(function(_0x3747a1,_0x551df9){const _0x39ddcd=a90_0x1a2d,_0x2517c4=_0x3747a1();while(!![]){try{const _0x47b15f=parseInt(_0x39ddcd(0x139))/0x1+-parseInt(_0x39ddcd(0x167))/0x2+-parseInt(_0x39ddcd(0x12a))/0x3+parseInt(_0x39ddcd(0x15f))/0x4*(parseInt(_0x39ddcd(0x17f))/0x5)+parseInt(_0x39ddcd(0x118))/0x6*(parseInt(_0x39ddcd(0x14b))/0x7)+parseInt(_0x39ddcd(0x152))/0x8+-parseInt(_0x39ddcd(0x125))/0x9;if(_0x47b15f===_0x551df9)break;else _0x2517c4['push'](_0x2517c4['shift']());}catch(_0x208c4e){_0x2517c4['push'](_0x2517c4['shift']());}}}(a90_0x334b,0x244e5));export const TD_ENDPOINTS={'us01':a90_0x1eebe3(0x17a),'ap01':'https://api.treasuredata.co.jp','eu01':a90_0x1eebe3(0x147),'ap02':a90_0x1eebe3(0x14f),'ap03':'https://api.ap03.treasuredata.com','dev-us01':'https://api-development.treasuredata.com','dev-eu01':a90_0x1eebe3(0x179),'stg-us01':a90_0x1eebe3(0x183),'stg-ap01':a90_0x1eebe3(0x164),'stg-ap03':a90_0x1eebe3(0x169)};function a90_0x334b(){const _0x16b11d=['No\x20Delivery\x20API\x20endpoint\x20for\x20site:\x20','https://api-staging-workflow.treasuredata.co.jp','https://engage-api-staging.us01.treasuredata.com','https://api-workflow.treasuredata.co.jp','https://api-presto.ap02.treasuredata.com','https://console.us01.treasuredata.com','/app/es/','https://console-next.eu01.treasuredata.com','https://engage-api-development.us01.treasuredata.com','https://delivery-api.us01.treasuredata.com','https://llm-proxy.ap02.treasuredata.com','https://api-workflow.treasuredata.com','212dUfkyO','https://engage-api-development.eu01.treasuredata.com','https://api-cdp.eu01.treasuredata.com','https://console-next.us01.treasuredata.com','https://llm-api-development.eu01.treasuredata.com','https://api-staging.treasuredata.co.jp','https://llm-proxy-staging.ap03.treasuredata.com','https://llm-proxy.eu01.treasuredata.com','138316pfzptH','https://llm-api-staging.treasuredata.co.jp','https://api-staging.ap03.treasuredata.com','https://delivery-api.ap03.treasuredata.com','https://api-staging-presto.treasuredata.com','https://delivery-api-development.eu01.treasuredata.com','https://api-workflow.ap02.treasuredata.com','https://delivery-api-development.us01.treasuredata.com','https://console-next.ap03.treasuredata.com','\x27\x20and\x20site\x20\x27','https://engage-api.eu01.treasuredata.com','https://api-development-presto.eu01.treasuredata.com','/info','https://console.','https://console.ap02.treasuredata.com','https://console-staging-next.us01.treasuredata.com','https://console.ap03.treasuredata.com','/app/af/','https://api-development.eu01.treasuredata.com','https://api.treasuredata.com','https://llm-proxy-staging.treasuredata.co.jp','https://console-next.treasuredata.co.jp','https://console-development-next.us01.treasuredata.com','https://api-staging-presto.ap03.treasuredata.com','23090jakepp','https://delivery-api.ap02.treasuredata.com','https://api-development-cdp.eu01.treasuredata.com','https://api-development-cdp.us01.treasuredata.com','https://api-staging.treasuredata.com','21246wewtpv','https://console-next.','https://console-staging.us01.treasuredata.com','https://api-development-workflow.eu01.treasuredata.com','/ag','https://llm-proxy.us01.treasuredata.com','/tc/','https://llm-proxy-development.eu01.treasuredata.com','https://llm-proxy-development.us01.treasuredata.com','https://llm-api.treasuredata.com','https://engage-api-staging.treasuredata.co.jp','https://api-staging-cdp.ap03.treasuredata.com','/em/','1879821NwIUxv','https://llm-proxy.ap03.treasuredata.com','https://llm-api.ap02.treasuredata.com','https://delivery-api-staging.us01.treasuredata.com','https://console-staging-next.ap03.treasuredata.com','205770waPXSG','https://console-development.us01.treasuredata.com','https://api-staging-workflow.us01.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','https://api-cdp.treasuredata.co.jp','/sessions/','/ag/','https://llm-api.eu01.treasuredata.com','https://api-staging-workflow.ap03.treasuredata.com','https://api-workflow.ap03.treasuredata.com','https://console.eu01.treasuredata.com','https://engage-api-staging.ap03.treasuredata.com','https://console.treasuredata.co.jp','https://api-presto.treasuredata.co.jp','https://api-cdp.treasuredata.com','70846kdTRQw','https://delivery-api-staging.treasuredata.co.jp','https://engage-api.treasuredata.co.jp','https://api-cdp.ap02.treasuredata.com','/app/workflows/','https://engage-api.treasuredata.com','https://api-development-presto.treasuredata.com','.treasuredata.com','https://llm-api-staging.us01.treasuredata.com','No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27','/app/jobs/','https://console-staging.ap03.treasuredata.com','https://api-presto.eu01.treasuredata.com','https://api-development-workflow.us01.treasuredata.com','https://api.eu01.treasuredata.com','/ooc/','https://console-staging.treasuredata.co.jp','https://console-development.eu01.treasuredata.com','49qeKNYm','https://llm-api.treasuredata.co.jp','/attempt/','https://api-cdp.ap03.treasuredata.com','https://api.ap02.treasuredata.com','https://delivery-api-staging.ap03.treasuredata.com','https://console-staging-next.treasuredata.co.jp','1239512MrKXRH'];a90_0x334b=function(){return _0x16b11d;};return a90_0x334b();}function a90_0x1a2d(_0x4025ae,_0x914ab){_0x4025ae=_0x4025ae-0x118;const _0x334b1b=a90_0x334b();let _0x1a2d03=_0x334b1b[_0x4025ae];return _0x1a2d03;}export const CDP_ENDPOINTS={'us01':a90_0x1eebe3(0x138),'ap01':a90_0x1eebe3(0x12e),'eu01':a90_0x1eebe3(0x161),'ap02':a90_0x1eebe3(0x13c),'ap03':a90_0x1eebe3(0x14e),'dev-us01':a90_0x1eebe3(0x182),'dev-eu01':a90_0x1eebe3(0x181),'stg-us01':'https://api-staging-cdp.us01.treasuredata.com','stg-ap01':'https://api-staging-cdp.treasuredata.co.jp','stg-ap03':a90_0x1eebe3(0x123)};export const WORKFLOW_ENDPOINTS={'us01':a90_0x1eebe3(0x15e),'ap01':a90_0x1eebe3(0x156),'eu01':'https://api-workflow.eu01.treasuredata.com','ap02':a90_0x1eebe3(0x16d),'ap03':a90_0x1eebe3(0x133),'dev-us01':a90_0x1eebe3(0x146),'dev-eu01':a90_0x1eebe3(0x11b),'stg-us01':a90_0x1eebe3(0x12c),'stg-ap01':a90_0x1eebe3(0x154),'stg-ap03':a90_0x1eebe3(0x132)};export const TRINO_ENDPOINTS={'us01':'https://api-presto.treasuredata.com','ap01':a90_0x1eebe3(0x137),'eu01':a90_0x1eebe3(0x145),'ap02':a90_0x1eebe3(0x157),'ap03':'https://api-presto.ap03.treasuredata.com','dev-us01':a90_0x1eebe3(0x13f),'dev-eu01':a90_0x1eebe3(0x172),'stg-us01':a90_0x1eebe3(0x16b),'stg-ap01':a90_0x1eebe3(0x12d),'stg-ap03':a90_0x1eebe3(0x17e)};export const LLM_ENDPOINTS={'us01':a90_0x1eebe3(0x121),'ap01':a90_0x1eebe3(0x14c),'eu01':a90_0x1eebe3(0x131),'ap02':a90_0x1eebe3(0x127),'ap03':'https://llm-api.ap03.treasuredata.com','dev-us01':'https://llm-api-development.us01.treasuredata.com','dev-eu01':a90_0x1eebe3(0x163),'stg-us01':a90_0x1eebe3(0x141),'stg-ap01':a90_0x1eebe3(0x168),'stg-ap03':'https://llm-api-staging.ap03.treasuredata.com'};export const LLM_PROXY_ENDPOINTS={'us01':a90_0x1eebe3(0x11d),'ap01':'https://llm-proxy.treasuredata.co.jp','eu01':a90_0x1eebe3(0x166),'ap02':a90_0x1eebe3(0x15d),'ap03':a90_0x1eebe3(0x126),'dev-us01':a90_0x1eebe3(0x120),'dev-eu01':a90_0x1eebe3(0x11f),'stg-us01':'https://llm-proxy-staging.us01.treasuredata.com','stg-ap01':a90_0x1eebe3(0x17b),'stg-ap03':a90_0x1eebe3(0x165)};export const ENGAGE_ENDPOINTS={'us01':a90_0x1eebe3(0x13e),'ap01':a90_0x1eebe3(0x13b),'eu01':a90_0x1eebe3(0x171),'ap02':'https://engage-api.ap02.treasuredata.com','ap03':'https://engage-api.ap03.treasuredata.com','dev-us01':a90_0x1eebe3(0x15b),'dev-eu01':a90_0x1eebe3(0x160),'stg-us01':a90_0x1eebe3(0x155),'stg-ap01':a90_0x1eebe3(0x122),'stg-ap03':a90_0x1eebe3(0x135)};export const DELIVERY_ENDPOINTS={'us01':a90_0x1eebe3(0x15c),'ap01':'https://delivery-api.treasuredata.co.jp','eu01':'https://delivery-api.eu01.treasuredata.com','ap02':a90_0x1eebe3(0x180),'ap03':a90_0x1eebe3(0x16a),'dev-us01':a90_0x1eebe3(0x16e),'dev-eu01':a90_0x1eebe3(0x16c),'stg-us01':a90_0x1eebe3(0x128),'stg-ap01':a90_0x1eebe3(0x13a),'stg-ap03':a90_0x1eebe3(0x150)};export function getDeliveryEndpoint(_0x297c0d){const _0x513c80=a90_0x1eebe3,_0x53c5ed=DELIVERY_ENDPOINTS[_0x297c0d];if(!_0x53c5ed)throw new Error(_0x513c80(0x153)+_0x297c0d);return _0x53c5ed;}export const CONSOLE_ENDPOINTS={'us01':a90_0x1eebe3(0x158),'ap01':a90_0x1eebe3(0x136),'eu01':a90_0x1eebe3(0x134),'ap02':a90_0x1eebe3(0x175),'ap03':a90_0x1eebe3(0x177),'dev-us01':a90_0x1eebe3(0x12b),'dev-eu01':a90_0x1eebe3(0x14a),'stg-us01':a90_0x1eebe3(0x11a),'stg-ap01':a90_0x1eebe3(0x149),'stg-ap03':a90_0x1eebe3(0x144)};export const CONSOLE_NEXT_ENDPOINTS={'us01':a90_0x1eebe3(0x162),'ap01':a90_0x1eebe3(0x17c),'eu01':a90_0x1eebe3(0x15a),'ap02':'https://console-next.ap02.treasuredata.com','ap03':a90_0x1eebe3(0x16f),'dev-us01':a90_0x1eebe3(0x17d),'dev-eu01':'https://console-development-next.eu01.treasuredata.com','stg-us01':a90_0x1eebe3(0x176),'stg-ap01':a90_0x1eebe3(0x151),'stg-ap03':a90_0x1eebe3(0x129)};export function getConsoleUrl(_0x163484,_0x3b2566){const _0x370780=a90_0x1eebe3,_0x5b37ca=CONSOLE_ENDPOINTS[_0x163484]||_0x370780(0x174)+_0x163484+_0x370780(0x140);return _0x3b2566?''+_0x5b37ca+_0x3b2566:_0x5b37ca;}export function getConsoleNextUrl(_0x474a4a,_0x56181e){const _0x39af67=a90_0x1eebe3,_0x4cdcae=CONSOLE_NEXT_ENDPOINTS[_0x474a4a]||_0x39af67(0x119)+_0x474a4a+_0x39af67(0x140);return _0x56181e?''+_0x4cdcae+_0x56181e:_0x4cdcae;}export function getLLMProjectUrl(_0xdceeae,_0x22883c){const _0x1724ba=a90_0x1eebe3;return getConsoleNextUrl(_0xdceeae,_0x1724ba(0x178)+_0x22883c+_0x1724ba(0x11c));}export function getLLMAgentChatUrl(_0x375f6b,_0x4f16be,_0x2d5d8a){return getConsoleNextUrl(_0x375f6b,'/app/af/'+_0x4f16be+'/ag/'+_0x2d5d8a+'/tc');}export function getLLMConversationUrl(_0x3f236b,_0x318693,_0x109b52,_0x32af6e){const _0x3aaa36=a90_0x1eebe3;return getConsoleNextUrl(_0x3f236b,_0x3aaa36(0x178)+_0x318693+_0x3aaa36(0x130)+_0x109b52+_0x3aaa36(0x11e)+_0x32af6e);}export function getWorkflowUrl(_0x3a2e1f,_0x44c860){const _0x4d574e=a90_0x1eebe3;return getConsoleUrl(_0x3a2e1f,_0x4d574e(0x13d)+_0x44c860+_0x4d574e(0x173));}export function getWorkflowSessionUrl(_0x439b79,_0x288fbb,_0x54c998){const _0x45434b=a90_0x1eebe3;return getConsoleUrl(_0x439b79,_0x45434b(0x13d)+_0x288fbb+_0x45434b(0x12f)+_0x54c998);}export function getWorkflowAttemptUrl(_0x39d96c,_0x1123e2,_0xf85f3d,_0x48dc31){const _0x7ab5d3=a90_0x1eebe3;return getConsoleUrl(_0x39d96c,_0x7ab5d3(0x13d)+_0x1123e2+'/sessions/'+_0xf85f3d+_0x7ab5d3(0x14d)+_0x48dc31);}export function getCampaignUrl(_0x188955,_0x4f90b2,_0xf0b533){const _0x269b60=a90_0x1eebe3;return getConsoleNextUrl(_0x188955,_0x269b60(0x159)+_0x4f90b2+_0x269b60(0x148)+_0xf0b533);}export function getTemplateUrl(_0x35796c,_0x20cbc9,_0xc42c61){const _0x24543c=a90_0x1eebe3;return getConsoleNextUrl(_0x35796c,_0x24543c(0x159)+_0x20cbc9+_0x24543c(0x124)+_0xc42c61+'/ce');}export function getJobUrl(_0x573134,_0x2ad67d){const _0x1dcf1d=a90_0x1eebe3;return getConsoleNextUrl(_0x573134,_0x1dcf1d(0x143)+_0x2ad67d+'/result');}export function getWorkspaceUrl(_0x3085f6,_0x46be36){const _0x42dd41=a90_0x1eebe3;return getConsoleNextUrl(_0x3085f6,_0x42dd41(0x159)+_0x46be36);}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(_0x418c1b){const _0x13ab6f=LLM_PROXY_ENDPOINTS[_0x418c1b];if(!_0x13ab6f)throw new Error('No\x20LLM\x20Proxy\x20endpoint\x20for\x20site:\x20'+_0x418c1b);return _0x13ab6f;}export function getEndpoint(_0x58c352,_0x2c0621='td'){const _0x147b30=a90_0x1eebe3,_0x50285b=API_ENDPOINTS[_0x2c0621]?.[_0x58c352];if(!_0x50285b)throw new Error(_0x147b30(0x142)+_0x2c0621+_0x147b30(0x170)+_0x58c352+'\x27');return _0x50285b;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a91_0x259a19=a91_0x4543;(function(_0x3efbbd,_0x3a0c99){const _0x5da338=a91_0x4543,_0x21dcb3=_0x3efbbd();while(!![]){try{const _0x4205d6=parseInt(_0x5da338(0xd2))/0x1*(parseInt(_0x5da338(0xfe))/0x2)+-parseInt(_0x5da338(0x102))/0x3*(-parseInt(_0x5da338(0xf7))/0x4)+parseInt(_0x5da338(0x10c))/0x5+-parseInt(_0x5da338(0xd4))/0x6+parseInt(_0x5da338(0x100))/0x7*(parseInt(_0x5da338(0xf1))/0x8)+-parseInt(_0x5da338(0xe2))/0x9*(-parseInt(_0x5da338(0x114))/0xa)+-parseInt(_0x5da338(0xd8))/0xb;if(_0x4205d6===_0x3a0c99)break;else _0x21dcb3['push'](_0x21dcb3['shift']());}catch(_0x58861d){_0x21dcb3['push'](_0x21dcb3['shift']());}}}(a91_0x414a,0x71598));function a91_0x414a(){const _0x41c1f0=['DELETE','createAlwaysOnCampaign','filter[workspaceId]','updateCampaign','getCampaign','emailTemplates','append','GET','listCampaigns','4337464TpfYOi','resumeCampaign','stringify','finish','createWorkspace','status','385668LZuLZR','/always_on_campaigns/','application/vnd.api+json','/api/workspaces','filter[name]','/api/campaigns','/api/campaigns/','2EczCfG','campaignType','7lsKQAE','site','9VmHNXO','proxy','request','toString','campaigns','resumeAlwaysOnCampaign','limit','createTemplate','duplicateCampaign','updateTemplate','2616680XHupOa','getWorkspace','pauseAlwaysOnCampaign','application/json','deleteTemplate','workspaceId','name','finishAlwaysOnCampaign','1793150EdTPNm','filter[status]','offset','/api/email_templates/','launchCampaign','page[offset]','/resume','page[limit]','createCampaign','ownerName','/api/workspaces?','pauseCampaign','/launch','listTemplates','deleteWorkspace','/pause','performAlwaysOnCampaignAction','POST','workspaces','785101qUNLiB','httpClient','4025682XmaNpk','/duplicate','updateAlwaysOnCampaign','engage','20913409MmmLWy','include','/always_on_campaigns','deleteCampaign','always_on_campaigns','PATCH','/api/campaigns?','getTemplate','deleteAlwaysOnCampaign','filter[campaignType]','45uZlrpU','/api/workspaces/','/api/email_templates','sort','duplicateAlwaysOnCampaign','/api/email_templates?'];a91_0x414a=function(){return _0x41c1f0;};return a91_0x414a();}import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';function a91_0x4543(_0xa77179,_0x27f9cd){_0xa77179=_0xa77179-0xce;const _0x414a9b=a91_0x414a();let _0x45431e=_0x414a9b[_0xa77179];return _0x45431e;}import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class EngageApiClient{[a91_0x259a19(0xd3)];constructor(_0x2a0fdd){const _0x5e1332=a91_0x259a19,_0x98373d=getEndpoint(_0x2a0fdd[_0x5e1332(0x101)],_0x5e1332(0xd7)),_0x1245b0=toHeaderRecord(getAuthHeaders(_0x2a0fdd[_0x5e1332(0x101)],_0x2a0fdd['apiKey'],_0x2a0fdd['accessToken']));this[_0x5e1332(0xd3)]=new HTTPClient(_0x98373d,_0x1245b0,{'proxy':_0x2a0fdd[_0x5e1332(0x103)]});}async[a91_0x259a19(0xf0)](_0x21e6f7={}){const _0x2dc1c5=a91_0x259a19,_0x3930e9=new URLSearchParams();_0x21e6f7[_0x2dc1c5(0xff)]&&_0x3930e9['append'](_0x2dc1c5(0xe1),_0x21e6f7[_0x2dc1c5(0xff)]);_0x21e6f7[_0x2dc1c5(0xf6)]&&_0x3930e9[_0x2dc1c5(0xee)]('filter[status]',_0x21e6f7[_0x2dc1c5(0xf6)]);_0x21e6f7[_0x2dc1c5(0x111)]&&_0x3930e9[_0x2dc1c5(0xee)](_0x2dc1c5(0xea),_0x21e6f7['workspaceId']);_0x21e6f7[_0x2dc1c5(0x108)]!==undefined&&_0x3930e9[_0x2dc1c5(0xee)](_0x2dc1c5(0x11b),_0x21e6f7[_0x2dc1c5(0x108)][_0x2dc1c5(0x105)]());_0x21e6f7[_0x2dc1c5(0x116)]!==undefined&&_0x3930e9[_0x2dc1c5(0xee)](_0x2dc1c5(0x119),_0x21e6f7[_0x2dc1c5(0x116)][_0x2dc1c5(0x105)]());_0x21e6f7[_0x2dc1c5(0xe5)]&&_0x3930e9[_0x2dc1c5(0xee)](_0x2dc1c5(0xe5),_0x21e6f7[_0x2dc1c5(0xe5)]);_0x21e6f7[_0x2dc1c5(0xd9)]&&_0x3930e9[_0x2dc1c5(0xee)](_0x2dc1c5(0xd9),_0x21e6f7[_0x2dc1c5(0xd9)]);const _0x5e46b7=_0x3930e9[_0x2dc1c5(0x105)](),_0x3c7b7c=_0x5e46b7?_0x2dc1c5(0xde)+_0x5e46b7:_0x2dc1c5(0xfc);return await this[_0x2dc1c5(0xd3)][_0x2dc1c5(0x104)]('GET',_0x3c7b7c,{'headers':{'Accept':_0x2dc1c5(0xf9)}});}async[a91_0x259a19(0xec)](_0x91a799){const _0x29cfb9=a91_0x259a19;return await this[_0x29cfb9(0xd3)][_0x29cfb9(0x104)](_0x29cfb9(0xef),'/api/campaigns/'+encodeURIComponent(_0x91a799),{'headers':{'Accept':_0x29cfb9(0xf9)}});}async[a91_0x259a19(0x11c)](_0x598eae){const _0x394923=a91_0x259a19,_0x44f06e={'data':{'type':_0x394923(0x106),'attributes':_0x598eae}};return await this[_0x394923(0xd3)]['request']('POST','/api/campaigns',{'headers':{'Content-Type':_0x394923(0xf9),'Accept':_0x394923(0xf9)},'body':JSON[_0x394923(0xf3)](_0x44f06e)});}async[a91_0x259a19(0xeb)](_0x559afc,_0x1be9ba){const _0x47ddac=a91_0x259a19,_0x3d942b={'data':{'type':_0x47ddac(0x106),'id':_0x559afc,'attributes':_0x1be9ba}};return await this[_0x47ddac(0xd3)][_0x47ddac(0x104)](_0x47ddac(0xdd),_0x47ddac(0xfd)+encodeURIComponent(_0x559afc),{'headers':{'Content-Type':_0x47ddac(0xf9),'Accept':_0x47ddac(0xf9)},'body':JSON[_0x47ddac(0xf3)](_0x3d942b)});}async[a91_0x259a19(0xdb)](_0x11d89c){const _0x5bc871=a91_0x259a19;await this[_0x5bc871(0xd3)][_0x5bc871(0x104)](_0x5bc871(0xe8),'/api/campaigns/'+encodeURIComponent(_0x11d89c),{'headers':{'Accept':_0x5bc871(0xf9)}});}async[a91_0x259a19(0x118)](_0x12cf40){const _0x3cc88b=a91_0x259a19;await this[_0x3cc88b(0xd3)][_0x3cc88b(0x104)](_0x3cc88b(0xd0),_0x3cc88b(0xfd)+encodeURIComponent(_0x12cf40)+_0x3cc88b(0x120),{'headers':{'Content-Type':_0x3cc88b(0x10f),'Accept':_0x3cc88b(0x10f)},'body':JSON[_0x3cc88b(0xf3)]({})});}async[a91_0x259a19(0x11f)](_0x2bf332){const _0x3ec48f=a91_0x259a19;await this['httpClient']['request'](_0x3ec48f(0xd0),_0x3ec48f(0xfd)+encodeURIComponent(_0x2bf332)+_0x3ec48f(0xce),{'headers':{'Content-Type':'application/json','Accept':_0x3ec48f(0x10f)},'body':JSON['stringify']({})});}async[a91_0x259a19(0xf2)](_0x18d877){const _0x7d3a8b=a91_0x259a19;await this[_0x7d3a8b(0xd3)]['request'](_0x7d3a8b(0xd0),_0x7d3a8b(0xfd)+encodeURIComponent(_0x18d877)+_0x7d3a8b(0x11a),{'headers':{'Content-Type':'application/json','Accept':_0x7d3a8b(0x10f)},'body':JSON['stringify']({})});}async[a91_0x259a19(0x10a)](_0x2874e7){const _0x160d5f=a91_0x259a19;return await this[_0x160d5f(0xd3)][_0x160d5f(0x104)](_0x160d5f(0xd0),_0x160d5f(0xfd)+encodeURIComponent(_0x2874e7)+_0x160d5f(0xd5),{'headers':{'Content-Type':_0x160d5f(0x10f),'Accept':'application/vnd.api+json'},'body':JSON[_0x160d5f(0xf3)]({})});}async[a91_0x259a19(0x121)](_0x1641e6={}){const _0x26121a=a91_0x259a19,_0x23f1cc=new URLSearchParams();_0x1641e6[_0x26121a(0x111)]&&_0x23f1cc[_0x26121a(0xee)](_0x26121a(0xea),_0x1641e6[_0x26121a(0x111)]);_0x1641e6[_0x26121a(0x108)]!==undefined&&_0x23f1cc[_0x26121a(0xee)]('page[limit]',_0x1641e6[_0x26121a(0x108)][_0x26121a(0x105)]());_0x1641e6[_0x26121a(0x116)]!==undefined&&_0x23f1cc['append'](_0x26121a(0x119),_0x1641e6[_0x26121a(0x116)][_0x26121a(0x105)]());_0x1641e6[_0x26121a(0xe5)]&&_0x23f1cc['append']('sort',_0x1641e6[_0x26121a(0xe5)]);const _0x124fa1=_0x23f1cc[_0x26121a(0x105)](),_0x57ebfa=_0x124fa1?_0x26121a(0xe7)+_0x124fa1:_0x26121a(0xe4);return await this[_0x26121a(0xd3)][_0x26121a(0x104)]('GET',_0x57ebfa,{'headers':{'Accept':_0x26121a(0xf9)}});}async[a91_0x259a19(0xdf)](_0x3ad3c1){const _0x1abcf5=a91_0x259a19;return await this['httpClient'][_0x1abcf5(0x104)]('GET',_0x1abcf5(0x117)+encodeURIComponent(_0x3ad3c1),{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x259a19(0x109)](_0x25fa8f){const _0x12a60d=a91_0x259a19,_0x13daca={'data':{'type':_0x12a60d(0xed),'attributes':_0x25fa8f}};return await this[_0x12a60d(0xd3)][_0x12a60d(0x104)](_0x12a60d(0xd0),'/api/email_templates',{'headers':{'Content-Type':_0x12a60d(0xf9),'Accept':_0x12a60d(0xf9)},'body':JSON['stringify'](_0x13daca)});}async[a91_0x259a19(0x10b)](_0x353155,_0xdb17b4){const _0x487eb8=a91_0x259a19,_0x70fde2={'data':{'type':_0x487eb8(0xed),'id':_0x353155,'attributes':_0xdb17b4}};return await this[_0x487eb8(0xd3)][_0x487eb8(0x104)](_0x487eb8(0xdd),'/api/email_templates/'+encodeURIComponent(_0x353155),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x487eb8(0xf9)},'body':JSON[_0x487eb8(0xf3)](_0x70fde2)});}async[a91_0x259a19(0x110)](_0xd406db){const _0x3b4e18=a91_0x259a19;await this[_0x3b4e18(0xd3)][_0x3b4e18(0x104)]('DELETE',_0x3b4e18(0x117)+encodeURIComponent(_0xd406db),{'headers':{'Accept':_0x3b4e18(0xf9)}});}async['listWorkspaces'](_0xd762e={}){const _0x3d5930=a91_0x259a19,_0x5c18ba=new URLSearchParams();_0xd762e['name']&&_0x5c18ba[_0x3d5930(0xee)](_0x3d5930(0xfb),_0xd762e[_0x3d5930(0x112)]);_0xd762e[_0x3d5930(0x11d)]&&_0x5c18ba['append']('filter[owner_user.name]',_0xd762e[_0x3d5930(0x11d)]);_0xd762e[_0x3d5930(0x108)]!==undefined&&_0x5c18ba[_0x3d5930(0xee)](_0x3d5930(0x11b),_0xd762e[_0x3d5930(0x108)]['toString']());_0xd762e[_0x3d5930(0x116)]!==undefined&&_0x5c18ba[_0x3d5930(0xee)]('page[offset]',_0xd762e[_0x3d5930(0x116)][_0x3d5930(0x105)]());_0xd762e['sort']&&_0x5c18ba[_0x3d5930(0xee)](_0x3d5930(0xe5),_0xd762e['sort']);const _0x767b47=_0x5c18ba[_0x3d5930(0x105)](),_0x2af03c=_0x767b47?_0x3d5930(0x11e)+_0x767b47:_0x3d5930(0xfa);return await this[_0x3d5930(0xd3)]['request']('GET',_0x2af03c,{'headers':{'Accept':_0x3d5930(0xf9)}});}async[a91_0x259a19(0x10d)](_0x3f908e){const _0x52bce5=a91_0x259a19;return await this[_0x52bce5(0xd3)][_0x52bce5(0x104)](_0x52bce5(0xef),_0x52bce5(0xe3)+encodeURIComponent(_0x3f908e),{'headers':{'Accept':_0x52bce5(0xf9)}});}async[a91_0x259a19(0xf5)](_0x8753c5){const _0x25ac2d=a91_0x259a19,_0x21c45b={'data':{'type':'workspaces','attributes':_0x8753c5}};return await this[_0x25ac2d(0xd3)][_0x25ac2d(0x104)]('POST',_0x25ac2d(0xfa),{'headers':{'Content-Type':_0x25ac2d(0xf9),'Accept':_0x25ac2d(0xf9)},'body':JSON[_0x25ac2d(0xf3)](_0x21c45b)});}async['updateWorkspace'](_0x150b0f,_0x1098d5){const _0x66c135=a91_0x259a19,_0x20afd9={'data':{'type':_0x66c135(0xd1),'id':_0x150b0f,'attributes':_0x1098d5}};return await this[_0x66c135(0xd3)]['request'](_0x66c135(0xdd),_0x66c135(0xe3)+encodeURIComponent(_0x150b0f),{'headers':{'Content-Type':_0x66c135(0xf9),'Accept':_0x66c135(0xf9)},'body':JSON[_0x66c135(0xf3)](_0x20afd9)});}async[a91_0x259a19(0x122)](_0x2a03b7){const _0x2119b4=a91_0x259a19;await this[_0x2119b4(0xd3)][_0x2119b4(0x104)](_0x2119b4(0xe8),_0x2119b4(0xe3)+encodeURIComponent(_0x2a03b7),{'headers':{'Accept':'application/vnd.api+json'}});}async['listAlwaysOnCampaigns'](_0x4a452b,_0x61d32a={}){const _0x2aa5fd=a91_0x259a19,_0x3e4316=new URLSearchParams();_0x61d32a[_0x2aa5fd(0xff)]&&_0x3e4316[_0x2aa5fd(0xee)](_0x2aa5fd(0xe1),_0x61d32a[_0x2aa5fd(0xff)]);_0x61d32a['status']&&_0x3e4316[_0x2aa5fd(0xee)](_0x2aa5fd(0x115),_0x61d32a[_0x2aa5fd(0xf6)]);_0x61d32a['limit']!==undefined&&_0x3e4316['append'](_0x2aa5fd(0x11b),_0x61d32a[_0x2aa5fd(0x108)][_0x2aa5fd(0x105)]());_0x61d32a[_0x2aa5fd(0x116)]!==undefined&&_0x3e4316['append'](_0x2aa5fd(0x119),_0x61d32a['offset'][_0x2aa5fd(0x105)]());_0x61d32a['sort']&&_0x3e4316[_0x2aa5fd(0xee)](_0x2aa5fd(0xe5),_0x61d32a[_0x2aa5fd(0xe5)]);const _0x14825d=_0x3e4316[_0x2aa5fd(0x105)](),_0x5f2472=_0x2aa5fd(0xe3)+encodeURIComponent(_0x4a452b)+_0x2aa5fd(0xda)+(_0x14825d?'?'+_0x14825d:'');return await this[_0x2aa5fd(0xd3)][_0x2aa5fd(0x104)](_0x2aa5fd(0xef),_0x5f2472,{'headers':{'Accept':_0x2aa5fd(0xf9)}});}async['getAlwaysOnCampaign'](_0x22a26d,_0x4f4cdd){const _0x46d73e=a91_0x259a19;return await this[_0x46d73e(0xd3)]['request'](_0x46d73e(0xef),_0x46d73e(0xe3)+encodeURIComponent(_0x22a26d)+'/always_on_campaigns/'+encodeURIComponent(_0x4f4cdd),{'headers':{'Accept':_0x46d73e(0xf9)}});}async[a91_0x259a19(0xe9)](_0x31430e,_0x1ea318){const _0x2c106c=a91_0x259a19,_0x379a00={'data':{'type':_0x2c106c(0xdc),'attributes':_0x1ea318}};return await this[_0x2c106c(0xd3)][_0x2c106c(0x104)](_0x2c106c(0xd0),'/api/workspaces/'+encodeURIComponent(_0x31430e)+_0x2c106c(0xda),{'headers':{'Content-Type':_0x2c106c(0xf9),'Accept':_0x2c106c(0xf9)},'body':JSON[_0x2c106c(0xf3)](_0x379a00)});}async[a91_0x259a19(0xd6)](_0x19d9a9,_0x34f114,_0x974ec4){const _0x590339=a91_0x259a19,_0xab2a83={'data':{'type':'always_on_campaigns','id':_0x34f114,'attributes':_0x974ec4}};return await this[_0x590339(0xd3)][_0x590339(0x104)](_0x590339(0xdd),_0x590339(0xe3)+encodeURIComponent(_0x19d9a9)+'/always_on_campaigns/'+encodeURIComponent(_0x34f114),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x590339(0xf9)},'body':JSON[_0x590339(0xf3)](_0xab2a83)});}async[a91_0x259a19(0xe0)](_0x447ae4,_0x290dba){const _0x3d0cd4=a91_0x259a19;await this['httpClient'][_0x3d0cd4(0x104)]('DELETE',_0x3d0cd4(0xe3)+encodeURIComponent(_0x447ae4)+_0x3d0cd4(0xf8)+encodeURIComponent(_0x290dba),{'headers':{'Accept':_0x3d0cd4(0xf9)}});}async[a91_0x259a19(0xcf)](_0x1fd16d,_0x2afe4b,_0x3e9346){const _0x95b8e1=a91_0x259a19;await this[_0x95b8e1(0xd3)][_0x95b8e1(0x104)](_0x95b8e1(0xd0),_0x95b8e1(0xe3)+encodeURIComponent(_0x1fd16d)+_0x95b8e1(0xf8)+encodeURIComponent(_0x2afe4b)+'/'+_0x3e9346,{'headers':{'Content-Type':_0x95b8e1(0x10f),'Accept':'application/json'},'body':JSON['stringify']({})});}async['launchAlwaysOnCampaign'](_0x1e9bdc,_0x404a14){await this['performAlwaysOnCampaignAction'](_0x1e9bdc,_0x404a14,'launch');}async[a91_0x259a19(0x10e)](_0x427d1c,_0x236c38){const _0x2b855d=a91_0x259a19;await this[_0x2b855d(0xcf)](_0x427d1c,_0x236c38,'pause');}async[a91_0x259a19(0x107)](_0x2c623f,_0x1ecacd){await this['performAlwaysOnCampaignAction'](_0x2c623f,_0x1ecacd,'resume');}async[a91_0x259a19(0x113)](_0x279857,_0x41cc0a){const _0xee182c=a91_0x259a19;await this[_0xee182c(0xcf)](_0x279857,_0x41cc0a,_0xee182c(0xf4));}async[a91_0x259a19(0xe6)](_0x172473,_0x463188,_0x4157d9){const _0x2a86c9=a91_0x259a19,_0x1a3f58=_0x4157d9?{'data':{'attributes':{'name':_0x4157d9}}}:{};return await this[_0x2a86c9(0xd3)][_0x2a86c9(0x104)]('POST','/api/workspaces/'+encodeURIComponent(_0x172473)+_0x2a86c9(0xf8)+encodeURIComponent(_0x463188)+'/duplicate',{'headers':{'Content-Type':'application/json','Accept':'application/vnd.api+json'},'body':JSON[_0x2a86c9(0xf3)](_0x1a3f58)});}}
|
|
1
|
+
const a91_0x5755df=a91_0x3ffc;(function(_0x1f3442,_0x2910ff){const _0x31dad2=a91_0x3ffc,_0x217c91=_0x1f3442();while(!![]){try{const _0x54f184=parseInt(_0x31dad2(0x13d))/0x1*(parseInt(_0x31dad2(0x143))/0x2)+parseInt(_0x31dad2(0x163))/0x3*(-parseInt(_0x31dad2(0x13f))/0x4)+parseInt(_0x31dad2(0x175))/0x5*(parseInt(_0x31dad2(0x12f))/0x6)+-parseInt(_0x31dad2(0x168))/0x7*(parseInt(_0x31dad2(0x12b))/0x8)+parseInt(_0x31dad2(0x136))/0x9*(-parseInt(_0x31dad2(0x162))/0xa)+-parseInt(_0x31dad2(0x155))/0xb*(-parseInt(_0x31dad2(0x158))/0xc)+parseInt(_0x31dad2(0x132))/0xd;if(_0x54f184===_0x2910ff)break;else _0x217c91['push'](_0x217c91['shift']());}catch(_0x40b36c){_0x217c91['push'](_0x217c91['shift']());}}}(a91_0x3445,0xbde04));function a91_0x3445(){const _0x445cc1=['createWorkspace','12MvCSQC','POST','getWorkspace','/api/email_templates?','188tCiIVx','apiKey','append','pause','/resume','page[offset]','listWorkspaces','httpClient','application/vnd.api+json','duplicateCampaign','engage','workspaces','listTemplates','always_on_campaigns','filter[owner_user.name]','/pause','resume','pauseAlwaysOnCampaign','22MiuENj','toString','sort','9288408AOskjw','request','include','name','PATCH','/launch','ownerName','page[limit]','listCampaigns','offset','9984110DvSNYb','1288344KulScN','/duplicate','limit','filter[campaignType]','launchCampaign','1155uKIuTx','application/json','campaignType','workspaceId','getTemplate','resumeAlwaysOnCampaign','filter[status]','deleteAlwaysOnCampaign','/always_on_campaigns','site','/always_on_campaigns/','accessToken','/api/campaigns/','5689145fcSSju','launch','status','GET','proxy','stringify','/api/workspaces','deleteTemplate','performAlwaysOnCampaignAction','/api/workspaces/','getCampaign','deleteWorkspace','finishAlwaysOnCampaign','72888StNbuR','/api/email_templates','listAlwaysOnCampaigns','/api/email_templates/','6yLdfBw','filter[name]','filter[workspaceId]','9000355tAQNwo','resumeCampaign','updateCampaign','/api/campaigns?','9vbNpvK','/api/campaigns','DELETE','updateWorkspace','pauseCampaign','finish','createTemplate','12655UmDMwJ'];a91_0x3445=function(){return _0x445cc1;};return a91_0x3445();}function a91_0x3ffc(_0xd7765d,_0x5141b8){_0xd7765d=_0xd7765d-0x128;const _0x344502=a91_0x3445();let _0x3ffcdd=_0x344502[_0xd7765d];return _0x3ffcdd;}import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class EngageApiClient{[a91_0x5755df(0x14a)];constructor(_0x101463){const _0x272e64=a91_0x5755df,_0x1f7abb=getEndpoint(_0x101463[_0x272e64(0x171)],_0x272e64(0x14d)),_0x9b630e=toHeaderRecord(getAuthHeaders(_0x101463[_0x272e64(0x171)],_0x101463[_0x272e64(0x144)],_0x101463[_0x272e64(0x173)]));this[_0x272e64(0x14a)]=new HTTPClient(_0x1f7abb,_0x9b630e,{'proxy':_0x101463[_0x272e64(0x179)]});}async[a91_0x5755df(0x160)](_0x27c6f7={}){const _0x113caa=a91_0x5755df,_0x73d434=new URLSearchParams();_0x27c6f7['campaignType']&&_0x73d434[_0x113caa(0x145)](_0x113caa(0x166),_0x27c6f7[_0x113caa(0x16a)]);_0x27c6f7['status']&&_0x73d434[_0x113caa(0x145)](_0x113caa(0x16e),_0x27c6f7[_0x113caa(0x177)]);_0x27c6f7[_0x113caa(0x16b)]&&_0x73d434[_0x113caa(0x145)](_0x113caa(0x131),_0x27c6f7[_0x113caa(0x16b)]);_0x27c6f7['limit']!==undefined&&_0x73d434[_0x113caa(0x145)](_0x113caa(0x15f),_0x27c6f7[_0x113caa(0x165)][_0x113caa(0x156)]());_0x27c6f7[_0x113caa(0x161)]!==undefined&&_0x73d434[_0x113caa(0x145)](_0x113caa(0x148),_0x27c6f7[_0x113caa(0x161)][_0x113caa(0x156)]());_0x27c6f7[_0x113caa(0x157)]&&_0x73d434['append'](_0x113caa(0x157),_0x27c6f7[_0x113caa(0x157)]);_0x27c6f7[_0x113caa(0x15a)]&&_0x73d434[_0x113caa(0x145)](_0x113caa(0x15a),_0x27c6f7[_0x113caa(0x15a)]);const _0xe4652f=_0x73d434[_0x113caa(0x156)](),_0x47330b=_0xe4652f?_0x113caa(0x135)+_0xe4652f:_0x113caa(0x137);return await this[_0x113caa(0x14a)][_0x113caa(0x159)]('GET',_0x47330b,{'headers':{'Accept':_0x113caa(0x14b)}});}async[a91_0x5755df(0x128)](_0x431219){const _0x1a5a30=a91_0x5755df;return await this['httpClient'][_0x1a5a30(0x159)]('GET',_0x1a5a30(0x174)+encodeURIComponent(_0x431219),{'headers':{'Accept':'application/vnd.api+json'}});}async['createCampaign'](_0x538627){const _0x1ed9a4=a91_0x5755df,_0x26a752={'data':{'type':'campaigns','attributes':_0x538627}};return await this[_0x1ed9a4(0x14a)]['request'](_0x1ed9a4(0x140),_0x1ed9a4(0x137),{'headers':{'Content-Type':_0x1ed9a4(0x14b),'Accept':_0x1ed9a4(0x14b)},'body':JSON[_0x1ed9a4(0x17a)](_0x26a752)});}async[a91_0x5755df(0x134)](_0x3f25e9,_0x3504ac){const _0x5937f2=a91_0x5755df,_0x117360={'data':{'type':'campaigns','id':_0x3f25e9,'attributes':_0x3504ac}};return await this[_0x5937f2(0x14a)][_0x5937f2(0x159)]('PATCH','/api/campaigns/'+encodeURIComponent(_0x3f25e9),{'headers':{'Content-Type':_0x5937f2(0x14b),'Accept':_0x5937f2(0x14b)},'body':JSON[_0x5937f2(0x17a)](_0x117360)});}async['deleteCampaign'](_0x48f7b8){const _0x5225b8=a91_0x5755df;await this[_0x5225b8(0x14a)][_0x5225b8(0x159)](_0x5225b8(0x138),_0x5225b8(0x174)+encodeURIComponent(_0x48f7b8),{'headers':{'Accept':_0x5225b8(0x14b)}});}async[a91_0x5755df(0x167)](_0x3c4e6b){const _0x2df0b9=a91_0x5755df;await this['httpClient'][_0x2df0b9(0x159)](_0x2df0b9(0x140),'/api/campaigns/'+encodeURIComponent(_0x3c4e6b)+_0x2df0b9(0x15d),{'headers':{'Content-Type':_0x2df0b9(0x169),'Accept':_0x2df0b9(0x169)},'body':JSON['stringify']({})});}async[a91_0x5755df(0x13a)](_0x1320bb){const _0x39ac1f=a91_0x5755df;await this[_0x39ac1f(0x14a)][_0x39ac1f(0x159)](_0x39ac1f(0x140),_0x39ac1f(0x174)+encodeURIComponent(_0x1320bb)+_0x39ac1f(0x152),{'headers':{'Content-Type':_0x39ac1f(0x169),'Accept':_0x39ac1f(0x169)},'body':JSON[_0x39ac1f(0x17a)]({})});}async[a91_0x5755df(0x133)](_0x20900f){const _0x3c049c=a91_0x5755df;await this[_0x3c049c(0x14a)][_0x3c049c(0x159)](_0x3c049c(0x140),_0x3c049c(0x174)+encodeURIComponent(_0x20900f)+_0x3c049c(0x147),{'headers':{'Content-Type':_0x3c049c(0x169),'Accept':_0x3c049c(0x169)},'body':JSON[_0x3c049c(0x17a)]({})});}async[a91_0x5755df(0x14c)](_0x77e52b){const _0x16cea7=a91_0x5755df;return await this[_0x16cea7(0x14a)]['request'](_0x16cea7(0x140),_0x16cea7(0x174)+encodeURIComponent(_0x77e52b)+'/duplicate',{'headers':{'Content-Type':_0x16cea7(0x169),'Accept':_0x16cea7(0x14b)},'body':JSON['stringify']({})});}async[a91_0x5755df(0x14f)](_0x4e2a7d={}){const _0x3bf84a=a91_0x5755df,_0x78cf17=new URLSearchParams();_0x4e2a7d['workspaceId']&&_0x78cf17['append'](_0x3bf84a(0x131),_0x4e2a7d[_0x3bf84a(0x16b)]);_0x4e2a7d[_0x3bf84a(0x165)]!==undefined&&_0x78cf17[_0x3bf84a(0x145)](_0x3bf84a(0x15f),_0x4e2a7d[_0x3bf84a(0x165)][_0x3bf84a(0x156)]());_0x4e2a7d['offset']!==undefined&&_0x78cf17[_0x3bf84a(0x145)](_0x3bf84a(0x148),_0x4e2a7d['offset'][_0x3bf84a(0x156)]());_0x4e2a7d[_0x3bf84a(0x157)]&&_0x78cf17[_0x3bf84a(0x145)]('sort',_0x4e2a7d[_0x3bf84a(0x157)]);const _0x53bd64=_0x78cf17[_0x3bf84a(0x156)](),_0x13c86b=_0x53bd64?_0x3bf84a(0x142)+_0x53bd64:'/api/email_templates';return await this[_0x3bf84a(0x14a)][_0x3bf84a(0x159)](_0x3bf84a(0x178),_0x13c86b,{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x5755df(0x16c)](_0x543c73){const _0x41d951=a91_0x5755df;return await this[_0x41d951(0x14a)][_0x41d951(0x159)](_0x41d951(0x178),'/api/email_templates/'+encodeURIComponent(_0x543c73),{'headers':{'Accept':_0x41d951(0x14b)}});}async[a91_0x5755df(0x13c)](_0x86fb40){const _0x22e1b9=a91_0x5755df,_0x506cb7={'data':{'type':'emailTemplates','attributes':_0x86fb40}};return await this['httpClient'][_0x22e1b9(0x159)](_0x22e1b9(0x140),_0x22e1b9(0x12c),{'headers':{'Content-Type':_0x22e1b9(0x14b),'Accept':_0x22e1b9(0x14b)},'body':JSON[_0x22e1b9(0x17a)](_0x506cb7)});}async['updateTemplate'](_0x507364,_0x208fd8){const _0x55a626=a91_0x5755df,_0x1f5af7={'data':{'type':'emailTemplates','id':_0x507364,'attributes':_0x208fd8}};return await this[_0x55a626(0x14a)][_0x55a626(0x159)]('PATCH',_0x55a626(0x12e)+encodeURIComponent(_0x507364),{'headers':{'Content-Type':_0x55a626(0x14b),'Accept':_0x55a626(0x14b)},'body':JSON[_0x55a626(0x17a)](_0x1f5af7)});}async[a91_0x5755df(0x17c)](_0x329ba5){const _0x3ec2e8=a91_0x5755df;await this[_0x3ec2e8(0x14a)]['request'](_0x3ec2e8(0x138),_0x3ec2e8(0x12e)+encodeURIComponent(_0x329ba5),{'headers':{'Accept':_0x3ec2e8(0x14b)}});}async[a91_0x5755df(0x149)](_0x304899={}){const _0x31c558=a91_0x5755df,_0x114adb=new URLSearchParams();_0x304899[_0x31c558(0x15b)]&&_0x114adb[_0x31c558(0x145)](_0x31c558(0x130),_0x304899[_0x31c558(0x15b)]);_0x304899['ownerName']&&_0x114adb['append'](_0x31c558(0x151),_0x304899[_0x31c558(0x15e)]);_0x304899[_0x31c558(0x165)]!==undefined&&_0x114adb[_0x31c558(0x145)]('page[limit]',_0x304899[_0x31c558(0x165)]['toString']());_0x304899[_0x31c558(0x161)]!==undefined&&_0x114adb['append'](_0x31c558(0x148),_0x304899[_0x31c558(0x161)][_0x31c558(0x156)]());_0x304899['sort']&&_0x114adb[_0x31c558(0x145)]('sort',_0x304899[_0x31c558(0x157)]);const _0x43fc73=_0x114adb[_0x31c558(0x156)](),_0x95df64=_0x43fc73?'/api/workspaces?'+_0x43fc73:'/api/workspaces';return await this['httpClient'][_0x31c558(0x159)](_0x31c558(0x178),_0x95df64,{'headers':{'Accept':_0x31c558(0x14b)}});}async[a91_0x5755df(0x141)](_0x39576b){const _0x20b062=a91_0x5755df;return await this['httpClient'][_0x20b062(0x159)](_0x20b062(0x178),'/api/workspaces/'+encodeURIComponent(_0x39576b),{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x5755df(0x13e)](_0x38f9b6){const _0xf840a2=a91_0x5755df,_0x1ced3b={'data':{'type':_0xf840a2(0x14e),'attributes':_0x38f9b6}};return await this[_0xf840a2(0x14a)][_0xf840a2(0x159)](_0xf840a2(0x140),_0xf840a2(0x17b),{'headers':{'Content-Type':_0xf840a2(0x14b),'Accept':_0xf840a2(0x14b)},'body':JSON[_0xf840a2(0x17a)](_0x1ced3b)});}async[a91_0x5755df(0x139)](_0x185e6b,_0x1383c3){const _0x367f26=a91_0x5755df,_0x10fea4={'data':{'type':_0x367f26(0x14e),'id':_0x185e6b,'attributes':_0x1383c3}};return await this[_0x367f26(0x14a)][_0x367f26(0x159)](_0x367f26(0x15c),_0x367f26(0x17e)+encodeURIComponent(_0x185e6b),{'headers':{'Content-Type':_0x367f26(0x14b),'Accept':_0x367f26(0x14b)},'body':JSON[_0x367f26(0x17a)](_0x10fea4)});}async[a91_0x5755df(0x129)](_0x3dcb1b){const _0x59116d=a91_0x5755df;await this[_0x59116d(0x14a)]['request'](_0x59116d(0x138),'/api/workspaces/'+encodeURIComponent(_0x3dcb1b),{'headers':{'Accept':'application/vnd.api+json'}});}async[a91_0x5755df(0x12d)](_0x579b6f,_0x336a15={}){const _0x690b31=a91_0x5755df,_0x3963ea=new URLSearchParams();_0x336a15[_0x690b31(0x16a)]&&_0x3963ea['append'](_0x690b31(0x166),_0x336a15[_0x690b31(0x16a)]);_0x336a15['status']&&_0x3963ea[_0x690b31(0x145)](_0x690b31(0x16e),_0x336a15[_0x690b31(0x177)]);_0x336a15[_0x690b31(0x165)]!==undefined&&_0x3963ea[_0x690b31(0x145)](_0x690b31(0x15f),_0x336a15[_0x690b31(0x165)]['toString']());_0x336a15[_0x690b31(0x161)]!==undefined&&_0x3963ea[_0x690b31(0x145)]('page[offset]',_0x336a15[_0x690b31(0x161)][_0x690b31(0x156)]());_0x336a15[_0x690b31(0x157)]&&_0x3963ea[_0x690b31(0x145)](_0x690b31(0x157),_0x336a15[_0x690b31(0x157)]);const _0x1ec89d=_0x3963ea[_0x690b31(0x156)](),_0x5c9eff=_0x690b31(0x17e)+encodeURIComponent(_0x579b6f)+_0x690b31(0x170)+(_0x1ec89d?'?'+_0x1ec89d:'');return await this[_0x690b31(0x14a)]['request'](_0x690b31(0x178),_0x5c9eff,{'headers':{'Accept':_0x690b31(0x14b)}});}async['getAlwaysOnCampaign'](_0x3c22b8,_0x218889){const _0x561d82=a91_0x5755df;return await this[_0x561d82(0x14a)][_0x561d82(0x159)]('GET',_0x561d82(0x17e)+encodeURIComponent(_0x3c22b8)+_0x561d82(0x172)+encodeURIComponent(_0x218889),{'headers':{'Accept':_0x561d82(0x14b)}});}async['createAlwaysOnCampaign'](_0x22f4ee,_0x1c68d2){const _0x318f84=a91_0x5755df,_0x393af8={'data':{'type':_0x318f84(0x150),'attributes':_0x1c68d2}};return await this['httpClient'][_0x318f84(0x159)](_0x318f84(0x140),_0x318f84(0x17e)+encodeURIComponent(_0x22f4ee)+'/always_on_campaigns',{'headers':{'Content-Type':_0x318f84(0x14b),'Accept':_0x318f84(0x14b)},'body':JSON['stringify'](_0x393af8)});}async['updateAlwaysOnCampaign'](_0x128ae7,_0x4af0ba,_0x3dfde3){const _0x58b03a=a91_0x5755df,_0x15ec68={'data':{'type':_0x58b03a(0x150),'id':_0x4af0ba,'attributes':_0x3dfde3}};return await this[_0x58b03a(0x14a)][_0x58b03a(0x159)](_0x58b03a(0x15c),_0x58b03a(0x17e)+encodeURIComponent(_0x128ae7)+_0x58b03a(0x172)+encodeURIComponent(_0x4af0ba),{'headers':{'Content-Type':_0x58b03a(0x14b),'Accept':_0x58b03a(0x14b)},'body':JSON[_0x58b03a(0x17a)](_0x15ec68)});}async[a91_0x5755df(0x16f)](_0x5d537e,_0x57b2d1){const _0x3beeca=a91_0x5755df;await this[_0x3beeca(0x14a)][_0x3beeca(0x159)](_0x3beeca(0x138),'/api/workspaces/'+encodeURIComponent(_0x5d537e)+_0x3beeca(0x172)+encodeURIComponent(_0x57b2d1),{'headers':{'Accept':_0x3beeca(0x14b)}});}async[a91_0x5755df(0x17d)](_0xb79cfa,_0x580575,_0x2bd1af){const _0xfb49b6=a91_0x5755df;await this[_0xfb49b6(0x14a)][_0xfb49b6(0x159)]('POST',_0xfb49b6(0x17e)+encodeURIComponent(_0xb79cfa)+'/always_on_campaigns/'+encodeURIComponent(_0x580575)+'/'+_0x2bd1af,{'headers':{'Content-Type':'application/json','Accept':_0xfb49b6(0x169)},'body':JSON[_0xfb49b6(0x17a)]({})});}async['launchAlwaysOnCampaign'](_0x415a23,_0x13a2e9){const _0x146370=a91_0x5755df;await this[_0x146370(0x17d)](_0x415a23,_0x13a2e9,_0x146370(0x176));}async[a91_0x5755df(0x154)](_0x1b5057,_0x38a67b){const _0x1fd73d=a91_0x5755df;await this['performAlwaysOnCampaignAction'](_0x1b5057,_0x38a67b,_0x1fd73d(0x146));}async[a91_0x5755df(0x16d)](_0x50d5bc,_0x2eab97){const _0x29dfd8=a91_0x5755df;await this[_0x29dfd8(0x17d)](_0x50d5bc,_0x2eab97,_0x29dfd8(0x153));}async[a91_0x5755df(0x12a)](_0x56e9c3,_0xa840e8){const _0x4146c7=a91_0x5755df;await this[_0x4146c7(0x17d)](_0x56e9c3,_0xa840e8,_0x4146c7(0x13b));}async['duplicateAlwaysOnCampaign'](_0x3a911b,_0x4f8d93,_0x53f611){const _0x5127ab=a91_0x5755df,_0x30607e=_0x53f611?{'data':{'attributes':{'name':_0x53f611}}}:{};return await this[_0x5127ab(0x14a)]['request'](_0x5127ab(0x140),_0x5127ab(0x17e)+encodeURIComponent(_0x3a911b)+_0x5127ab(0x172)+encodeURIComponent(_0x4f8d93)+_0x5127ab(0x164),{'headers':{'Content-Type':_0x5127ab(0x169),'Accept':'application/vnd.api+json'},'body':JSON['stringify'](_0x30607e)});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a92_0x2db522=a92_0x3a6f;function a92_0x3a6f(_0x3e1fb1,_0x4b8f74){_0x3e1fb1=_0x3e1fb1-0x1d7;const _0x591fca=a92_0x591f();let _0x3a6f77=_0x591fca[_0x3e1fb1];return _0x3a6f77;}(function(_0x534cf0,_0x151deb){const _0x322c75=a92_0x3a6f,_0x28ec37=_0x534cf0();while(!![]){try{const _0x5d3f32=parseInt(_0x322c75(0x1dc))/0x1*(parseInt(_0x322c75(0x216))/0x2)+parseInt(_0x322c75(0x1d7))/0x3+-parseInt(_0x322c75(0x1e5))/0x4*(parseInt(_0x322c75(0x245))/0x5)+-parseInt(_0x322c75(0x1fc))/0x6*(parseInt(_0x322c75(0x241))/0x7)+parseInt(_0x322c75(0x213))/0x8*(-parseInt(_0x322c75(0x201))/0x9)+parseInt(_0x322c75(0x1e2))/0xa+parseInt(_0x322c75(0x20a))/0xb;if(_0x5d3f32===_0x151deb)break;else _0x28ec37['push'](_0x28ec37['shift']());}catch(_0x5c8f4d){_0x28ec37['push'](_0x28ec37['shift']());}}}(a92_0x591f,0x982a2));import{ErrorCode,SDKError}from'../errors.js';import{Logger}from'../../utils/logger/index.js';import a92_0x2e22b2 from'json-bigint';function getErrorChain(_0x27e043,_0x17ecf7=0x5){const _0x5f083d=a92_0x3a6f,_0x6e9e11=[_0x27e043];let _0x541556=_0x27e043;for(let _0xa20786=0x0;_0xa20786<_0x17ecf7&&_0x541556;_0xa20786++){const _0x491474=_0x541556['cause'];if(_0x491474 instanceof Error)_0x6e9e11[_0x5f083d(0x1e0)](_0x491474),_0x541556=_0x491474;else break;}return _0x6e9e11;}function extractRootCause(_0x3af875){const _0x3c7da6=a92_0x3a6f,_0xc01dc0=getErrorChain(_0x3af875,0x4),_0x51b5ec=_0xc01dc0[_0xc01dc0[_0x3c7da6(0x223)]-0x1],_0x2648a5=_0x51b5ec[_0x3c7da6(0x21e)];if(_0x2648a5&&!(_0x2648a5 instanceof Error))return String(_0x2648a5);return _0x51b5ec[_0x3c7da6(0x22b)]||_0x3c7da6(0x22c);}const DEFAULT_RETRY_CONFIG={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1f40};function isRetryableStatus(_0x37b6d0){return _0x37b6d0>=0x1f4||_0x37b6d0===0x1ad;}function isNonRetryable429(_0x50b074){const _0x9a9851=a92_0x3a6f;return _0x50b074[_0x9a9851(0x212)](_0x9a9851(0x1fd));}function a92_0x591f(){const _0x40fd1d=['maskProxyCredentials','min','undici','length','text','retryConfig','[binary\x20data]','INVALID_ARGUMENT','pow','retrying\x20in\x20','combineSignals','message','Unknown\x20error','Request\x20to\x20','maxDelay','application/json','proxy','signal','Request\x20cancelled\x20by\x20user','status','request','RATE_LIMITED','ms...',']\x20Request\x20failed\x20with\x20','Failed\x20to\x20connect\x20through\x20proxy\x20','parseProblemDetails','Content-Type','defaultHeaders',']\x20Request\x20to\x20','info','toString','dispatcher','\x20failed:\x20','509068pzETiM','addEventListener','request\x20body:\x20','arrayBuffer','151370OuDrXx','object','string','name','235044SxbtIP','about:blank','get','title','Response\x20[','2737rzhOiN','error','Using\x20proxy:\x20','AbortError','push','random','2788270OyRrUe','UNAVAILABLE','safeParseJSON','92tbSdsi','tunnel','username','sleep','maxRetries','proxyUrl','HTTPClientError','body','round','requestSSE','baseUrl','stringify','statusText','arraybuffer','errors','HTTP\x20','An\x20error\x20occurred','from','toLowerCase','parse','PERMISSION_DENIED','forEach','debug','12uajbrg','already\x20running','warn','abort','instance','9cdBoEQ',']\x20Request\x20failed\x20with\x20HTTP\x20','detail','type','headers','logger','json','Retry-After','Error\x20response\x20body:\x20','10673025paVoSn','then','Request:\x20','extractErrorMessage','407','code','Error','INTERNAL','includes','629256GAstdm','handleErrorResponse','password','158Xvndlp','PROXY_CONNECTION_FAILURE','Request\x20failed\x20after\x20retries','proxyReady','[Retry\x20','HTTP_REQUEST_FAILURE','trace','UNAUTHENTICATED','cause','isProxyConnectionError'];a92_0x591f=function(){return _0x40fd1d;};return a92_0x591f();}function getRetryDelay(_0x50be77,_0x4cf483){const _0x8dc18a=a92_0x3a6f,_0x1f6e18=Math[_0x8dc18a(0x221)](_0x4cf483['baseDelay']*Math[_0x8dc18a(0x228)](0x2,_0x50be77),_0x4cf483[_0x8dc18a(0x22e)]);return Math[_0x8dc18a(0x1e1)]()*_0x1f6e18;}function statusCodeToErrorCode(_0x408ab9){const _0x415583=a92_0x3a6f;if(_0x408ab9===0x191)return ErrorCode[_0x415583(0x21d)];else{if(_0x408ab9===0x193)return ErrorCode[_0x415583(0x1f9)];else{if(_0x408ab9===0x194)return ErrorCode['NOT_FOUND'];else{if(_0x408ab9===0x1ad)return ErrorCode[_0x415583(0x235)];else return _0x408ab9>=0x1f4?ErrorCode[_0x415583(0x1e3)]:ErrorCode[_0x415583(0x227)];}}}}export class HTTPClientError extends Error{[a92_0x2db522(0x233)];['problemDetails'];[a92_0x2db522(0x20f)];constructor(_0x649ac6,_0x1c59eb,_0x1d5233){const _0x26c047=a92_0x2db522,_0x59b445=statusCodeToErrorCode(_0x1c59eb);super('['+_0x59b445+']\x20'+_0x649ac6),this[_0x26c047(0x233)]=_0x1c59eb,this['problemDetails']=_0x1d5233,this['name']=_0x26c047(0x1eb),this[_0x26c047(0x20f)]=_0x59b445;}}export class HTTPClient{[a92_0x2db522(0x225)];[a92_0x2db522(0x1ef)];[a92_0x2db522(0x23b)];['logger']=Logger['of']('tdx.client.http');[a92_0x2db522(0x23f)];[a92_0x2db522(0x219)];[a92_0x2db522(0x1ea)];constructor(_0x2359ac,_0x384e18,_0x1575ae){const _0x57f2ad=a92_0x2db522;this[_0x57f2ad(0x1ef)]=_0x2359ac,this['defaultHeaders']=_0x384e18,this[_0x57f2ad(0x225)]={...DEFAULT_RETRY_CONFIG,..._0x1575ae?.['retryConfig']},_0x1575ae?.[_0x57f2ad(0x230)]&&(this[_0x57f2ad(0x1ea)]=_0x1575ae[_0x57f2ad(0x230)],this[_0x57f2ad(0x219)]=import(_0x57f2ad(0x222))[_0x57f2ad(0x20b)](({ProxyAgent:_0x3fb86})=>{const _0x14159d=_0x57f2ad;this[_0x14159d(0x23f)]=new _0x3fb86(_0x1575ae[_0x14159d(0x230)]);}),this['logger'][_0x57f2ad(0x23d)](_0x57f2ad(0x1de)+this[_0x57f2ad(0x220)](_0x1575ae['proxy'])));}[a92_0x2db522(0x220)](_0xe83f5b){const _0x20ab0b=a92_0x2db522;try{const _0x4e80de=new URL(_0xe83f5b);return _0x4e80de['username']&&(_0x4e80de[_0x20ab0b(0x1e7)]='****'),_0x4e80de[_0x20ab0b(0x215)]&&(_0x4e80de[_0x20ab0b(0x215)]='****'),_0x4e80de[_0x20ab0b(0x23e)]();}catch{return _0xe83f5b;}}[a92_0x2db522(0x21f)](_0x4a7cca){const _0x2b8775=a92_0x2db522,_0x59b43a=getErrorChain(_0x4a7cca);for(const _0x5008e3 of _0x59b43a){const _0x108361=_0x5008e3[_0x2b8775(0x22b)][_0x2b8775(0x1f7)](),_0x52ef5b=_0x5008e3[_0x2b8775(0x248)]['toLowerCase']();if(_0x108361['includes'](_0x2b8775(0x230))||_0x52ef5b[_0x2b8775(0x212)]('proxy')||_0x108361['includes'](_0x2b8775(0x1e6))||_0x108361[_0x2b8775(0x212)](_0x2b8775(0x20e)))return!![];if(_0x2b8775(0x20f)in _0x5008e3&&typeof _0x5008e3[_0x2b8775(0x20f)]===_0x2b8775(0x247)){if(_0x5008e3[_0x2b8775(0x20f)][_0x2b8775(0x212)]('PROXY'))return!![];}}return![];}async[a92_0x2db522(0x234)](_0x323631,_0x39d870,_0x19fb10={}){const _0x187880=a92_0x2db522,{headers:headers={},body:_0x27abfd,timeout:timeout=0x7530,retries:retries=this[_0x187880(0x225)][_0x187880(0x1e9)],signal:_0x508041,includeHeaders:includeHeaders=![],responseType:responseType=_0x187880(0x207)}=_0x19fb10,_0x4f4e4b=''+this[_0x187880(0x1ef)]+_0x39d870;this['logger']['info'](_0x187880(0x20c)+_0x323631+'\x20'+_0x4f4e4b);const _0x5771b8={...this[_0x187880(0x23b)],...headers};if(_0x27abfd&&!_0x5771b8[_0x187880(0x23a)]){if(_0x27abfd instanceof Buffer){}else _0x5771b8['Content-Type']=_0x187880(0x22f);}let _0x2d2262;_0x27abfd&&(_0x27abfd instanceof Buffer?_0x2d2262=_0x27abfd:_0x2d2262=typeof _0x27abfd===_0x187880(0x247)?_0x27abfd:JSON[_0x187880(0x1f0)](_0x27abfd));_0x2d2262&&this[_0x187880(0x206)][_0x187880(0x1fb)](_0x187880(0x243)+(typeof _0x2d2262===_0x187880(0x247)?_0x2d2262:_0x187880(0x226)));let _0x64fbeb=null;for(let _0x383ace=0x0;_0x383ace<=retries;_0x383ace++){try{const _0x482538=new AbortController(),_0x53338b=setTimeout(()=>_0x482538[_0x187880(0x1ff)](),timeout);if(_0x508041){if(_0x508041['aborted'])throw new Error(_0x187880(0x232));_0x508041[_0x187880(0x242)](_0x187880(0x1ff),()=>_0x482538['abort'](),{'once':!![]});}this[_0x187880(0x219)]&&await this[_0x187880(0x219)];const _0x3db329={'method':_0x323631,'headers':_0x5771b8,'body':_0x2d2262,'signal':_0x482538['signal']};this['dispatcher']&&(_0x3db329['dispatcher']=this[_0x187880(0x23f)]);const _0x49a586=await fetch(_0x4f4e4b,_0x3db329);clearTimeout(_0x53338b);if(_0x383ace<retries&&isRetryableStatus(_0x49a586[_0x187880(0x233)])){if(_0x49a586[_0x187880(0x233)]===0x1ad){const _0x36d6cc=await _0x49a586['text']();if(isNonRetryable429(_0x36d6cc)){const _0x3a5280=this[_0x187880(0x20d)](_0x36d6cc)||_0x49a586[_0x187880(0x1f1)];throw new HTTPClientError(_0x3a5280,_0x49a586['status']);}}const _0x58ec12=_0x49a586[_0x187880(0x205)][_0x187880(0x1d9)](_0x187880(0x208)),_0x192f99=_0x58ec12?parseInt(_0x58ec12,0xa)*0x3e8:getRetryDelay(_0x383ace,this[_0x187880(0x225)]);console['warn']('[Retry\x20'+(_0x383ace+0x1)+'/'+retries+_0x187880(0x237)+_0x49a586[_0x187880(0x233)]+',\x20'+(_0x187880(0x229)+Math[_0x187880(0x1ed)](_0x192f99)+_0x187880(0x236))),await this['sleep'](_0x192f99);continue;}!_0x49a586['ok']&&await this[_0x187880(0x214)](_0x49a586);let _0xfdcbdf;if(responseType===_0x187880(0x1f2)){const _0x57ce16=await _0x49a586[_0x187880(0x244)]();_0xfdcbdf=Buffer[_0x187880(0x1f6)](_0x57ce16);}else responseType==='text'?_0xfdcbdf=await _0x49a586['text']():_0xfdcbdf=await this[_0x187880(0x1e4)](_0x49a586);this[_0x187880(0x206)]['debug'](_0x187880(0x1db)+_0x49a586['status']+']:\x20'+_0x323631+'\x20'+_0x39d870),this['logger'][_0x187880(0x21c)](JSON[_0x187880(0x1f0)](_0xfdcbdf,null,0x2));if(includeHeaders){const _0x24559a={};return _0x49a586[_0x187880(0x205)][_0x187880(0x1fa)]((_0x1cc2b4,_0x61d488)=>{_0x24559a[_0x61d488]=_0x1cc2b4;}),{'data':_0xfdcbdf,'status':_0x49a586[_0x187880(0x233)],'headers':_0x24559a};}return _0xfdcbdf;}catch(_0x5bd9b4){_0x64fbeb=_0x5bd9b4 instanceof Error?_0x5bd9b4:new Error(String(_0x5bd9b4));if(_0x5bd9b4 instanceof HTTPClientError){if(!isRetryableStatus(_0x5bd9b4[_0x187880(0x233)])||_0x5bd9b4['status']===0x1ad&&isNonRetryable429(_0x5bd9b4[_0x187880(0x22b)]))throw _0x5bd9b4;}if(_0x383ace>=retries){if(!(_0x64fbeb instanceof HTTPClientError)){const _0x394433=extractRootCause(_0x64fbeb);if(this['proxyUrl']&&this['isProxyConnectionError'](_0x64fbeb))throw new SDKError(ErrorCode[_0x187880(0x217)],_0x187880(0x238)+this['maskProxyCredentials'](this[_0x187880(0x1ea)])+':\x20'+_0x394433,_0x64fbeb);throw new SDKError(ErrorCode[_0x187880(0x21b)],_0x187880(0x22d)+_0x4f4e4b+_0x187880(0x240)+_0x394433,_0x64fbeb);}throw _0x64fbeb;}const _0x1d4ec7=getRetryDelay(_0x383ace,this[_0x187880(0x225)]);let _0x3526a0;_0x64fbeb instanceof HTTPClientError?_0x3526a0='[Retry\x20'+(_0x383ace+0x1)+'/'+retries+_0x187880(0x202)+_0x64fbeb[_0x187880(0x233)]+':\x20'+_0x64fbeb[_0x187880(0x22b)]+',\x20'+('retrying\x20in\x20'+Math['round'](_0x1d4ec7)+_0x187880(0x236)):_0x3526a0=_0x187880(0x21a)+(_0x383ace+0x1)+'/'+retries+_0x187880(0x23c)+_0x4f4e4b+'\x20failed:\x20'+_0x64fbeb[_0x187880(0x22b)]+',\x20'+(_0x187880(0x229)+Math['round'](_0x1d4ec7)+_0x187880(0x236)),console[_0x187880(0x1fe)](_0x3526a0),await this[_0x187880(0x1e8)](_0x1d4ec7);}}throw _0x64fbeb||new SDKError(ErrorCode[_0x187880(0x211)],_0x187880(0x218));}async[a92_0x2db522(0x1e4)](_0x1eb1fa){const _0x549cdb=a92_0x2db522,_0xfc8e93=await _0x1eb1fa[_0x549cdb(0x224)]();if(!_0xfc8e93)return null;try{const _0x2aa5e5=a92_0x2e22b2({'storeAsString':!![]});return _0x2aa5e5[_0x549cdb(0x1f8)](_0xfc8e93);}catch{return{'body':_0xfc8e93};}}[a92_0x2db522(0x239)](_0x3f5f5d,_0x303945){const _0x399244=a92_0x2db522;if(!_0x3f5f5d||typeof _0x3f5f5d!==_0x399244(0x246))return undefined;let _0x2f31f0=_0x3f5f5d;_0x2f31f0['errors']&&typeof _0x2f31f0[_0x399244(0x1f3)]==='object'&&(_0x2f31f0=_0x2f31f0[_0x399244(0x1f3)]);if(_0x2f31f0[_0x399244(0x204)]||_0x2f31f0['title']||_0x2f31f0[_0x399244(0x203)])return{'type':_0x2f31f0[_0x399244(0x204)]||'about:blank','title':_0x2f31f0[_0x399244(0x1da)]||_0x399244(0x210),'status':_0x2f31f0[_0x399244(0x233)]||_0x303945,'detail':_0x2f31f0[_0x399244(0x203)]||_0x399244(0x1f5),'instance':_0x2f31f0[_0x399244(0x200)]||'',..._0x2f31f0};const _0x10185c=_0x2f31f0[_0x399244(0x22b)]||_0x2f31f0[_0x399244(0x1dd)]||_0x2f31f0[_0x399244(0x224)];if(typeof _0x10185c===_0x399244(0x247))return{'type':_0x399244(0x1d8),'title':_0x2f31f0['severity']||_0x399244(0x210),'status':_0x2f31f0['status_code']||_0x303945,'detail':_0x10185c,'instance':'',..._0x2f31f0};return undefined;}async['handleErrorResponse'](_0x140fc5){const _0x642c98=a92_0x2db522,_0x688b53=await this['safeParseJSON'](_0x140fc5),_0x3fcab0=this[_0x642c98(0x239)](_0x688b53,_0x140fc5['status']);_0x688b53&&this[_0x642c98(0x206)][_0x642c98(0x1fb)](_0x642c98(0x209)+JSON[_0x642c98(0x1f0)](_0x688b53));let _0x3ad41c;if(_0x3fcab0?.['detail'])_0x3ad41c=_0x3fcab0[_0x642c98(0x203)];else _0x688b53?_0x3ad41c=_0x642c98(0x1f4)+_0x140fc5[_0x642c98(0x233)]+':\x20'+_0x140fc5[_0x642c98(0x1f1)]+'\x0a\x20\x20Details:\x20'+JSON[_0x642c98(0x1f0)](_0x688b53):_0x3ad41c='HTTP\x20'+_0x140fc5[_0x642c98(0x233)]+':\x20'+_0x140fc5['statusText'];throw new HTTPClientError(_0x3ad41c,_0x140fc5['status'],_0x3fcab0);}['sleep'](_0x468c7d){return new Promise(_0x3d87c0=>setTimeout(_0x3d87c0,_0x468c7d));}[a92_0x2db522(0x20d)](_0x4263ba){const _0x261085=a92_0x2db522;try{const _0x3c38d7=JSON[_0x261085(0x1f8)](_0x4263ba);return _0x3c38d7[_0x261085(0x203)]||_0x3c38d7[_0x261085(0x22b)]||_0x3c38d7[_0x261085(0x1dd)]||null;}catch{return _0x4263ba[_0x261085(0x223)]<0x1f4?_0x4263ba:null;}}async[a92_0x2db522(0x1ee)](_0x3a9488,_0x66c5a2,_0xae770d={}){const _0x3bfa8f=a92_0x2db522,{headers:headers={},body:_0xd831af,timeout:timeout=0x7530,signal:_0x1af079}=_0xae770d,_0x46c5fb=''+this[_0x3bfa8f(0x1ef)]+_0x66c5a2,_0x204a53={...this[_0x3bfa8f(0x23b)],...headers},_0x1796f6=new AbortController(),_0x30cad2=setTimeout(()=>_0x1796f6[_0x3bfa8f(0x1ff)](),timeout),_0x5482ad=_0x1af079?[_0x1796f6[_0x3bfa8f(0x231)],_0x1af079]:[_0x1796f6['signal']],_0x1a9451=this[_0x3bfa8f(0x22a)](_0x5482ad);try{this[_0x3bfa8f(0x219)]&&await this[_0x3bfa8f(0x219)];const _0x12a92e={'method':_0x3a9488,'headers':_0x204a53,'signal':_0x1a9451};this['dispatcher']&&(_0x12a92e[_0x3bfa8f(0x23f)]=this[_0x3bfa8f(0x23f)]);if(_0xd831af){if(typeof _0xd831af===_0x3bfa8f(0x247))_0x12a92e[_0x3bfa8f(0x1ec)]=_0xd831af;else _0xd831af instanceof Buffer?_0x12a92e[_0x3bfa8f(0x1ec)]=_0xd831af:_0x12a92e['body']=JSON[_0x3bfa8f(0x1f0)](_0xd831af);}const _0x1e2820=await fetch(_0x46c5fb,_0x12a92e);return clearTimeout(_0x30cad2),!_0x1e2820['ok']&&await this['handleErrorResponse'](_0x1e2820),_0x1e2820;}catch(_0x1e7c4b){clearTimeout(_0x30cad2);if(_0x1e7c4b instanceof HTTPClientError)throw _0x1e7c4b;if(_0x1e7c4b['name']===_0x3bfa8f(0x1df))throw new Error(_0x3bfa8f(0x232));if(this['proxyUrl']&&_0x1e7c4b instanceof Error&&this[_0x3bfa8f(0x21f)](_0x1e7c4b))throw new SDKError(ErrorCode[_0x3bfa8f(0x217)],'Failed\x20to\x20connect\x20through\x20proxy\x20'+this[_0x3bfa8f(0x220)](this[_0x3bfa8f(0x1ea)])+':\x20'+_0x1e7c4b['message'],_0x1e7c4b);throw _0x1e7c4b;}}[a92_0x2db522(0x22a)](_0x47bafe){const _0x2e8b1c=a92_0x2db522,_0x3beddf=new AbortController();for(const _0x1e0532 of _0x47bafe){if(_0x1e0532['aborted'])return _0x3beddf[_0x2e8b1c(0x1ff)](),_0x3beddf[_0x2e8b1c(0x231)];_0x1e0532['addEventListener']('abort',()=>_0x3beddf[_0x2e8b1c(0x1ff)](),{'once':!![]});}return _0x3beddf[_0x2e8b1c(0x231)];}}
|
|
1
|
+
const a92_0x4cfda0=a92_0x7fc7;(function(_0x53df72,_0x2f6058){const _0x36bc01=a92_0x7fc7,_0x4b686e=_0x53df72();while(!![]){try{const _0x171955=-parseInt(_0x36bc01(0x167))/0x1+-parseInt(_0x36bc01(0x176))/0x2+parseInt(_0x36bc01(0x186))/0x3*(parseInt(_0x36bc01(0x16e))/0x4)+-parseInt(_0x36bc01(0x162))/0x5+-parseInt(_0x36bc01(0x1b1))/0x6*(-parseInt(_0x36bc01(0x191))/0x7)+-parseInt(_0x36bc01(0x183))/0x8*(-parseInt(_0x36bc01(0x175))/0x9)+parseInt(_0x36bc01(0x180))/0xa;if(_0x171955===_0x2f6058)break;else _0x4b686e['push'](_0x4b686e['shift']());}catch(_0x6e3b45){_0x4b686e['push'](_0x4b686e['shift']());}}}(a92_0x10dc,0x43078));import{ErrorCode,SDKError}from'../errors.js';function a92_0x7fc7(_0x29bf75,_0x2eb0fd){_0x29bf75=_0x29bf75-0x15d;const _0x10dc8d=a92_0x10dc();let _0x7fc73e=_0x10dc8d[_0x29bf75];return _0x7fc73e;}import{Logger}from'../../utils/logger/index.js';import a92_0x37ae48 from'json-bigint';function getErrorChain(_0x4fa51b,_0x426b12=0x5){const _0x3eaa56=a92_0x7fc7,_0x457250=[_0x4fa51b];let _0x1b259b=_0x4fa51b;for(let _0x501198=0x0;_0x501198<_0x426b12&&_0x1b259b;_0x501198++){const _0x3041b1=_0x1b259b[_0x3eaa56(0x17c)];if(_0x3041b1 instanceof Error)_0x457250[_0x3eaa56(0x1ac)](_0x3041b1),_0x1b259b=_0x3041b1;else break;}return _0x457250;}function extractRootCause(_0x43cb23){const _0x42f608=a92_0x7fc7,_0x205dac=getErrorChain(_0x43cb23,0x4),_0x2b1759=_0x205dac[_0x205dac[_0x42f608(0x16c)]-0x1],_0x123593=_0x2b1759[_0x42f608(0x17c)];if(_0x123593&&!(_0x123593 instanceof Error))return String(_0x123593);return _0x2b1759[_0x42f608(0x1a7)]||_0x42f608(0x164);}const DEFAULT_RETRY_CONFIG={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1f40};function a92_0x10dc(){const _0x232d82=['random','addEventListener','requestSSE','PROXY','1495629QmBOjJ','255762YpwQsr','HTTP\x20','Request\x20cancelled\x20by\x20user','RATE_LIMITED','json','errors','cause','\x0a\x20\x20Details:\x20','Content-Type','then','4694510eidiKc','sleep','Error\x20response\x20body:\x20','8onEZui','stringify','baseDelay','3ugNERp','toString','extractErrorMessage','proxyUrl','ms...','baseUrl','Request\x20to\x20','includes','Using\x20proxy:\x20','headers','proxy','478534ztzdPL',']\x20Request\x20to\x20','debug','status','name','combineSignals','****','Response\x20[','get',']\x20Request\x20failed\x20with\x20HTTP\x20','text','error','Request\x20failed\x20after\x20retries','isProxyConnectionError','body','password','signal','dispatcher','undici','toLowerCase',']:\x20','from','message','Error','pow','type','severity','push','Retry-After','HTTP_REQUEST_FAILURE','safeParseJSON','parseProblemDetails','12sXOxVT','INTERNAL','retrying\x20in\x20','tdx.client.http','username','defaultHeaders','string','statusText','maskProxyCredentials','request\x20body:\x20','proxyReady','object','arraybuffer','maxRetries','about:blank','warn','HTTPClientError','UNAVAILABLE','\x20failed:\x20','round','info','code','request','retryConfig','[Retry\x20','PROXY_CONNECTION_FAILURE','logger','instance','detail','arrayBuffer','1632485odLYEp','handleErrorResponse','Unknown\x20error','forEach','INVALID_ARGUMENT','70775AeyuLb','aborted','parse','trace','title','length','abort','109396EGpOqE','Failed\x20to\x20connect\x20through\x20proxy\x20','An\x20error\x20occurred'];a92_0x10dc=function(){return _0x232d82;};return a92_0x10dc();}function isRetryableStatus(_0x5c26a8){return _0x5c26a8>=0x1f4||_0x5c26a8===0x1ad;}function isNonRetryable429(_0x4d3b8f){const _0x3ad763=a92_0x7fc7;return _0x4d3b8f[_0x3ad763(0x18d)]('already\x20running');}function getRetryDelay(_0x1b5053,_0x541b0f){const _0x54f431=a92_0x7fc7,_0xd59e72=Math['min'](_0x541b0f[_0x54f431(0x185)]*Math[_0x54f431(0x1a9)](0x2,_0x1b5053),_0x541b0f['maxDelay']);return Math[_0x54f431(0x171)]()*_0xd59e72;}function statusCodeToErrorCode(_0x15ae27){const _0x204f47=a92_0x7fc7;if(_0x15ae27===0x191)return ErrorCode['UNAUTHENTICATED'];else{if(_0x15ae27===0x193)return ErrorCode['PERMISSION_DENIED'];else{if(_0x15ae27===0x194)return ErrorCode['NOT_FOUND'];else{if(_0x15ae27===0x1ad)return ErrorCode[_0x204f47(0x179)];else return _0x15ae27>=0x1f4?ErrorCode[_0x204f47(0x1c2)]:ErrorCode[_0x204f47(0x166)];}}}}export class HTTPClientError extends Error{[a92_0x4cfda0(0x194)];['problemDetails'];[a92_0x4cfda0(0x1c6)];constructor(_0x239ac0,_0x5a92d1,_0x347065){const _0x255624=a92_0x4cfda0,_0xff993a=statusCodeToErrorCode(_0x5a92d1);super('['+_0xff993a+']\x20'+_0x239ac0),this[_0x255624(0x194)]=_0x5a92d1,this['problemDetails']=_0x347065,this[_0x255624(0x195)]=_0x255624(0x1c1),this[_0x255624(0x1c6)]=_0xff993a;}}export class HTTPClient{[a92_0x4cfda0(0x1c8)];[a92_0x4cfda0(0x18b)];[a92_0x4cfda0(0x1b6)];[a92_0x4cfda0(0x15e)]=Logger['of'](a92_0x4cfda0(0x1b4));[a92_0x4cfda0(0x1a2)];[a92_0x4cfda0(0x1bb)];[a92_0x4cfda0(0x189)];constructor(_0x2e01cb,_0x55a40f,_0x58a7df){const _0x58bfcf=a92_0x4cfda0;this[_0x58bfcf(0x18b)]=_0x2e01cb,this[_0x58bfcf(0x1b6)]=_0x55a40f,this[_0x58bfcf(0x1c8)]={...DEFAULT_RETRY_CONFIG,..._0x58a7df?.[_0x58bfcf(0x1c8)]},_0x58a7df?.['proxy']&&(this[_0x58bfcf(0x189)]=_0x58a7df['proxy'],this[_0x58bfcf(0x1bb)]=import(_0x58bfcf(0x1a3))[_0x58bfcf(0x17f)](({ProxyAgent:_0x188833})=>{const _0x50f892=_0x58bfcf;this[_0x50f892(0x1a2)]=new _0x188833(_0x58a7df[_0x50f892(0x190)]);}),this['logger'][_0x58bfcf(0x1c5)](_0x58bfcf(0x18e)+this[_0x58bfcf(0x1b9)](_0x58a7df[_0x58bfcf(0x190)])));}[a92_0x4cfda0(0x1b9)](_0x901acc){const _0x145d31=a92_0x4cfda0;try{const _0x24e9cd=new URL(_0x901acc);return _0x24e9cd[_0x145d31(0x1b5)]&&(_0x24e9cd[_0x145d31(0x1b5)]=_0x145d31(0x197)),_0x24e9cd['password']&&(_0x24e9cd[_0x145d31(0x1a0)]=_0x145d31(0x197)),_0x24e9cd[_0x145d31(0x187)]();}catch{return _0x901acc;}}[a92_0x4cfda0(0x19e)](_0x500ba4){const _0x3bec0e=a92_0x4cfda0,_0x1bc537=getErrorChain(_0x500ba4);for(const _0x378792 of _0x1bc537){const _0x165412=_0x378792['message'][_0x3bec0e(0x1a4)](),_0x434c1d=_0x378792[_0x3bec0e(0x195)][_0x3bec0e(0x1a4)]();if(_0x165412[_0x3bec0e(0x18d)](_0x3bec0e(0x190))||_0x434c1d[_0x3bec0e(0x18d)]('proxy')||_0x165412[_0x3bec0e(0x18d)]('tunnel')||_0x165412[_0x3bec0e(0x18d)]('407'))return!![];if(_0x3bec0e(0x1c6)in _0x378792&&typeof _0x378792[_0x3bec0e(0x1c6)]===_0x3bec0e(0x1b7)){if(_0x378792[_0x3bec0e(0x1c6)][_0x3bec0e(0x18d)](_0x3bec0e(0x174)))return!![];}}return![];}async[a92_0x4cfda0(0x1c7)](_0x526c15,_0x20bd32,_0x22a475={}){const _0x2abf94=a92_0x4cfda0,{headers:headers={},body:_0x16029f,timeout:timeout=0x7530,retries:retries=this[_0x2abf94(0x1c8)][_0x2abf94(0x1be)],signal:_0x23175d,includeHeaders:includeHeaders=![],responseType:responseType=_0x2abf94(0x17a)}=_0x22a475,_0x4ab50e=''+this[_0x2abf94(0x18b)]+_0x20bd32;this['logger'][_0x2abf94(0x1c5)]('Request:\x20'+_0x526c15+'\x20'+_0x4ab50e);const _0x5ecb70={...this['defaultHeaders'],...headers};if(_0x16029f&&!_0x5ecb70[_0x2abf94(0x17e)]){if(_0x16029f instanceof Buffer){}else _0x5ecb70[_0x2abf94(0x17e)]='application/json';}let _0x33f6b6;_0x16029f&&(_0x16029f instanceof Buffer?_0x33f6b6=_0x16029f:_0x33f6b6=typeof _0x16029f===_0x2abf94(0x1b7)?_0x16029f:JSON['stringify'](_0x16029f));_0x33f6b6&&this['logger'][_0x2abf94(0x193)](_0x2abf94(0x1ba)+(typeof _0x33f6b6==='string'?_0x33f6b6:'[binary\x20data]'));let _0x9fc649=null;for(let _0x4fb3f9=0x0;_0x4fb3f9<=retries;_0x4fb3f9++){try{const _0x2d161a=new AbortController(),_0x44ff63=setTimeout(()=>_0x2d161a['abort'](),timeout);if(_0x23175d){if(_0x23175d['aborted'])throw new Error(_0x2abf94(0x178));_0x23175d[_0x2abf94(0x172)](_0x2abf94(0x16d),()=>_0x2d161a[_0x2abf94(0x16d)](),{'once':!![]});}this['proxyReady']&&await this['proxyReady'];const _0x251773={'method':_0x526c15,'headers':_0x5ecb70,'body':_0x33f6b6,'signal':_0x2d161a[_0x2abf94(0x1a1)]};this[_0x2abf94(0x1a2)]&&(_0x251773[_0x2abf94(0x1a2)]=this[_0x2abf94(0x1a2)]);const _0x36cfa3=await fetch(_0x4ab50e,_0x251773);clearTimeout(_0x44ff63);if(_0x4fb3f9<retries&&isRetryableStatus(_0x36cfa3[_0x2abf94(0x194)])){if(_0x36cfa3[_0x2abf94(0x194)]===0x1ad){const _0x36e3a3=await _0x36cfa3[_0x2abf94(0x19b)]();if(isNonRetryable429(_0x36e3a3)){const _0x28f4c7=this[_0x2abf94(0x188)](_0x36e3a3)||_0x36cfa3[_0x2abf94(0x1b8)];throw new HTTPClientError(_0x28f4c7,_0x36cfa3[_0x2abf94(0x194)]);}}const _0x226d8f=_0x36cfa3['headers'][_0x2abf94(0x199)](_0x2abf94(0x1ad)),_0x516720=_0x226d8f?parseInt(_0x226d8f,0xa)*0x3e8:getRetryDelay(_0x4fb3f9,this['retryConfig']);console[_0x2abf94(0x1c0)](_0x2abf94(0x1c9)+(_0x4fb3f9+0x1)+'/'+retries+']\x20Request\x20failed\x20with\x20'+_0x36cfa3[_0x2abf94(0x194)]+',\x20'+('retrying\x20in\x20'+Math[_0x2abf94(0x1c4)](_0x516720)+_0x2abf94(0x18a))),await this[_0x2abf94(0x181)](_0x516720);continue;}!_0x36cfa3['ok']&&await this[_0x2abf94(0x163)](_0x36cfa3);let _0x333257;if(responseType===_0x2abf94(0x1bd)){const _0x503d05=await _0x36cfa3[_0x2abf94(0x161)]();_0x333257=Buffer[_0x2abf94(0x1a6)](_0x503d05);}else responseType==='text'?_0x333257=await _0x36cfa3['text']():_0x333257=await this[_0x2abf94(0x1af)](_0x36cfa3);this[_0x2abf94(0x15e)][_0x2abf94(0x193)](_0x2abf94(0x198)+_0x36cfa3[_0x2abf94(0x194)]+_0x2abf94(0x1a5)+_0x526c15+'\x20'+_0x20bd32),this['logger'][_0x2abf94(0x16a)](JSON[_0x2abf94(0x184)](_0x333257,null,0x2));if(includeHeaders){const _0x1a1b61={};return _0x36cfa3[_0x2abf94(0x18f)][_0x2abf94(0x165)]((_0x799281,_0xb875da)=>{_0x1a1b61[_0xb875da]=_0x799281;}),{'data':_0x333257,'status':_0x36cfa3[_0x2abf94(0x194)],'headers':_0x1a1b61};}return _0x333257;}catch(_0x496eca){_0x9fc649=_0x496eca instanceof Error?_0x496eca:new Error(String(_0x496eca));if(_0x496eca instanceof HTTPClientError){if(!isRetryableStatus(_0x496eca[_0x2abf94(0x194)])||_0x496eca['status']===0x1ad&&isNonRetryable429(_0x496eca[_0x2abf94(0x1a7)]))throw _0x496eca;}if(_0x4fb3f9>=retries){if(!(_0x9fc649 instanceof HTTPClientError)){const _0x2a48d1=extractRootCause(_0x9fc649);if(this[_0x2abf94(0x189)]&&this['isProxyConnectionError'](_0x9fc649))throw new SDKError(ErrorCode[_0x2abf94(0x15d)],_0x2abf94(0x16f)+this['maskProxyCredentials'](this[_0x2abf94(0x189)])+':\x20'+_0x2a48d1,_0x9fc649);throw new SDKError(ErrorCode[_0x2abf94(0x1ae)],_0x2abf94(0x18c)+_0x4ab50e+'\x20failed:\x20'+_0x2a48d1,_0x9fc649);}throw _0x9fc649;}const _0x1e2dc4=getRetryDelay(_0x4fb3f9,this['retryConfig']);let _0x4cf495;_0x9fc649 instanceof HTTPClientError?_0x4cf495=_0x2abf94(0x1c9)+(_0x4fb3f9+0x1)+'/'+retries+_0x2abf94(0x19a)+_0x9fc649['status']+':\x20'+_0x9fc649[_0x2abf94(0x1a7)]+',\x20'+(_0x2abf94(0x1b3)+Math['round'](_0x1e2dc4)+'ms...'):_0x4cf495=_0x2abf94(0x1c9)+(_0x4fb3f9+0x1)+'/'+retries+_0x2abf94(0x192)+_0x4ab50e+_0x2abf94(0x1c3)+_0x9fc649['message']+',\x20'+('retrying\x20in\x20'+Math[_0x2abf94(0x1c4)](_0x1e2dc4)+'ms...'),console[_0x2abf94(0x1c0)](_0x4cf495),await this[_0x2abf94(0x181)](_0x1e2dc4);}}throw _0x9fc649||new SDKError(ErrorCode[_0x2abf94(0x1b2)],_0x2abf94(0x19d));}async['safeParseJSON'](_0x4c1537){const _0x2a916c=a92_0x4cfda0,_0x5bf126=await _0x4c1537['text']();if(!_0x5bf126)return null;try{const _0x3cd35a=a92_0x37ae48({'storeAsString':!![]});return _0x3cd35a[_0x2a916c(0x169)](_0x5bf126);}catch{return{'body':_0x5bf126};}}['parseProblemDetails'](_0x498b81,_0x550b47){const _0x233dc6=a92_0x4cfda0;if(!_0x498b81||typeof _0x498b81!=='object')return undefined;let _0x5b71dd=_0x498b81;_0x5b71dd['errors']&&typeof _0x5b71dd[_0x233dc6(0x17b)]===_0x233dc6(0x1bc)&&(_0x5b71dd=_0x5b71dd['errors']);if(_0x5b71dd[_0x233dc6(0x1aa)]||_0x5b71dd['title']||_0x5b71dd[_0x233dc6(0x160)])return{'type':_0x5b71dd[_0x233dc6(0x1aa)]||'about:blank','title':_0x5b71dd[_0x233dc6(0x16b)]||'Error','status':_0x5b71dd[_0x233dc6(0x194)]||_0x550b47,'detail':_0x5b71dd[_0x233dc6(0x160)]||_0x233dc6(0x170),'instance':_0x5b71dd[_0x233dc6(0x15f)]||'',..._0x5b71dd};const _0x55cf9a=_0x5b71dd['message']||_0x5b71dd[_0x233dc6(0x19c)]||_0x5b71dd[_0x233dc6(0x19b)];if(typeof _0x55cf9a===_0x233dc6(0x1b7))return{'type':_0x233dc6(0x1bf),'title':_0x5b71dd[_0x233dc6(0x1ab)]||_0x233dc6(0x1a8),'status':_0x5b71dd['status_code']||_0x550b47,'detail':_0x55cf9a,'instance':'',..._0x5b71dd};return undefined;}async[a92_0x4cfda0(0x163)](_0x4a07d9){const _0x2ac6e9=a92_0x4cfda0,_0x14289c=await this[_0x2ac6e9(0x1af)](_0x4a07d9),_0x23dda6=this[_0x2ac6e9(0x1b0)](_0x14289c,_0x4a07d9[_0x2ac6e9(0x194)]);_0x14289c&&this[_0x2ac6e9(0x15e)]['debug'](_0x2ac6e9(0x182)+JSON['stringify'](_0x14289c));let _0xc7c7;if(_0x23dda6?.[_0x2ac6e9(0x160)])_0xc7c7=_0x23dda6[_0x2ac6e9(0x160)];else _0x14289c?_0xc7c7=_0x2ac6e9(0x177)+_0x4a07d9[_0x2ac6e9(0x194)]+':\x20'+_0x4a07d9[_0x2ac6e9(0x1b8)]+_0x2ac6e9(0x17d)+JSON['stringify'](_0x14289c):_0xc7c7=_0x2ac6e9(0x177)+_0x4a07d9[_0x2ac6e9(0x194)]+':\x20'+_0x4a07d9[_0x2ac6e9(0x1b8)];throw new HTTPClientError(_0xc7c7,_0x4a07d9['status'],_0x23dda6);}[a92_0x4cfda0(0x181)](_0x15b68c){return new Promise(_0x2dfbf2=>setTimeout(_0x2dfbf2,_0x15b68c));}[a92_0x4cfda0(0x188)](_0x3ea36a){const _0x4ac395=a92_0x4cfda0;try{const _0x2e503c=JSON[_0x4ac395(0x169)](_0x3ea36a);return _0x2e503c[_0x4ac395(0x160)]||_0x2e503c[_0x4ac395(0x1a7)]||_0x2e503c['error']||null;}catch{return _0x3ea36a[_0x4ac395(0x16c)]<0x1f4?_0x3ea36a:null;}}async[a92_0x4cfda0(0x173)](_0x1436e8,_0x60af62,_0x337c07={}){const _0x595a1d=a92_0x4cfda0,{headers:headers={},body:_0x2d10eb,timeout:timeout=0x7530,signal:_0x56a190}=_0x337c07,_0x48fd91=''+this[_0x595a1d(0x18b)]+_0x60af62,_0x33232c={...this[_0x595a1d(0x1b6)],...headers},_0x8be3b6=new AbortController(),_0x5b6130=setTimeout(()=>_0x8be3b6[_0x595a1d(0x16d)](),timeout),_0x885e03=_0x56a190?[_0x8be3b6['signal'],_0x56a190]:[_0x8be3b6[_0x595a1d(0x1a1)]],_0x3e043c=this[_0x595a1d(0x196)](_0x885e03);try{this['proxyReady']&&await this[_0x595a1d(0x1bb)];const _0x5c0f39={'method':_0x1436e8,'headers':_0x33232c,'signal':_0x3e043c};this[_0x595a1d(0x1a2)]&&(_0x5c0f39[_0x595a1d(0x1a2)]=this[_0x595a1d(0x1a2)]);if(_0x2d10eb){if(typeof _0x2d10eb==='string')_0x5c0f39[_0x595a1d(0x19f)]=_0x2d10eb;else _0x2d10eb instanceof Buffer?_0x5c0f39[_0x595a1d(0x19f)]=_0x2d10eb:_0x5c0f39[_0x595a1d(0x19f)]=JSON[_0x595a1d(0x184)](_0x2d10eb);}const _0x49a95a=await fetch(_0x48fd91,_0x5c0f39);return clearTimeout(_0x5b6130),!_0x49a95a['ok']&&await this[_0x595a1d(0x163)](_0x49a95a),_0x49a95a;}catch(_0x4e7391){clearTimeout(_0x5b6130);if(_0x4e7391 instanceof HTTPClientError)throw _0x4e7391;if(_0x4e7391['name']==='AbortError')throw new Error(_0x595a1d(0x178));if(this['proxyUrl']&&_0x4e7391 instanceof Error&&this[_0x595a1d(0x19e)](_0x4e7391))throw new SDKError(ErrorCode[_0x595a1d(0x15d)],_0x595a1d(0x16f)+this[_0x595a1d(0x1b9)](this['proxyUrl'])+':\x20'+_0x4e7391[_0x595a1d(0x1a7)],_0x4e7391);throw _0x4e7391;}}[a92_0x4cfda0(0x196)](_0x9bd848){const _0x526d09=a92_0x4cfda0,_0x252015=new AbortController();for(const _0x39dfd6 of _0x9bd848){if(_0x39dfd6[_0x526d09(0x168)])return _0x252015[_0x526d09(0x16d)](),_0x252015[_0x526d09(0x1a1)];_0x39dfd6[_0x526d09(0x172)](_0x526d09(0x16d),()=>_0x252015['abort'](),{'once':!![]});}return _0x252015[_0x526d09(0x1a1)];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a93_0x54b763=a93_0xcad8;function a93_0x5680(){const _0x5398f9=['Message\x20cannot\x20be\x20empty\x20or\x20whitespace\x20only','agentId','LLM_STREAM_ERROR','paginateAll','ms...','&filter[project_id]=','690423AiVkdr','description','/api/agents?page[limit]=50','16049bQswKJ','/api/text_knowledge_bases','/api/knowledge_bases?filter[projectId]=','updateAgentResponse','modelType',',\x20message\x20length:\x20','8kJOxri','/api/web_search_tools','imageGenerators','California','GET','/api/users/current_settings','chats','deleteProject','/api/chats?','gpt-4o','PATCH','apiKey','Failed\x20to\x20create\x20chat:\x20unexpected\x20error','logger','6yZWkGX','textKnowledgeBases','listToolTargets','application/json','debug','data','push','experimentalArtifacts','getChatInfo','10kPyjKi','/api/agents/','/langfuse','createProject','baseUrl','\x20with\x20message\x20size:\x20','agents','/api/experimental_artifacts/','warn','next','maxToolIterations','listPrompts','/api/prompts','LLM_EMPTY_MESSAGE','DELETE','listIntegrations','request',']\x20Chat\x20creation\x20returned\x20empty\x20ID,\x20retrying\x20in\x20','-last_conversation_at','medium','/api/knowledge_bases','imageModelType','createPrompt','userLocation','/continue','search','experimentalKnowledgeBases','/history','authHeaders','getChatHistory','/api/integrations?filter[projectId]=','filters','page[limit]','reasoningEffort','listAgents','Please\x20provide\x20a\x20non-empty\x20message\x20to\x20continue\x20the\x20chat.','/api/integrations','append','createIntegration','application/vnd.api+json','tdx.client.llm','webSearchTools','starterMessage','listProjects','listAgentsFull','/api/text_knowledge_bases/','/api/prompts/','LLM_CHAT_CREATION_FAILURE','getAgent','/api/tool_targets?filter[targetType]=','createKnowledgeBase','1390fffsgK','createTextKnowledgeBase','/api/projects?page[limit]=','2459250cWLFvR','Continuing\x20chat\x20','POST','listImageGenerators','/api/tool_targets?filter[targetType]=ParentSegmentKnowledgeBase&filter[project_id]=','835779xiVfhs','/api/experimental_knowledge_bases/','/api/image_generators','parentSegmentKnowledgeBases','createAgentResponse','site','/api/chats','[Retry\x20','America/Los_Angeles','/api/knowledge_bases/','deleteAgent','updateAgent','deleteIntegration','temperature','name',']\x20Streaming\x20SSE\x20stream\x20for\x20chatId:\x20','listTextKnowledgeBases','searchContextSize','listChats','map','updateExperimentalKnowledgeBase','listWebSearchTools','prompt','outputs','proxy','pathname','San\x20Francisco','trim','httpClient','createWebSearchTool','Failed\x20to\x20create\x20chat\x20after\x20','getExperimentalKnowledgeBase','listExperimentalKnowledgeBases','/api/chats/','/api/integrations/','/api/tool_targets?filter[targetType]=TextKnowledgeBase&filter[project_id]=','startsWith','continueChat','updateTextKnowledgeBase','/api/experimental_artifacts','/api/prompts?filter[projectId]=','&page[limit]=50','93266jsPZCE','systemPrompt','2402450ebmZtB','&page[limit]=1','getTextKnowledgeBase','/api/experimental_knowledge_bases','integrations','links','2129488qsjFpM','toString','length','getUserSettings','approximate','/api/tool_targets?filter[targetType]=WebSearchTool&filter[project_id]=','/api/projects/','startChat','knowledge_bases','/api/tool_targets?filter[targetType]=ImageGenerator&filter[project_id]=','text/event-stream','imageReturnMode','/api/agents','updateKnowledgeBase','\x20characters'];a93_0x5680=function(){return _0x5398f9;};return a93_0x5680();}(function(_0x2f4e42,_0x27de52){const _0x1a1a26=a93_0xcad8,_0xc70437=_0x2f4e42();while(!![]){try{const _0x5090db=parseInt(_0x1a1a26(0x239))/0x1*(parseInt(_0x1a1a26(0x1fc))/0x2)+-parseInt(_0x1a1a26(0x219))/0x3*(parseInt(_0x1a1a26(0x222))/0x4)+parseInt(_0x1a1a26(0x1fe))/0x5+parseInt(_0x1a1a26(0x230))/0x6*(parseInt(_0x1a1a26(0x1d2))/0x7)+-parseInt(_0x1a1a26(0x204))/0x8+-parseInt(_0x1a1a26(0x1cd))/0x9+parseInt(_0x1a1a26(0x1ca))/0xa*(parseInt(_0x1a1a26(0x21c))/0xb);if(_0x5090db===_0x27de52)break;else _0xc70437['push'](_0xc70437['shift']());}catch(_0x5199e3){_0xc70437['push'](_0xc70437['shift']());}}}(a93_0x5680,0x41bf4));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';import{parseSSEStream}from'../../utils/sse-parser.js';import{ErrorCode,SDKError}from'../errors.js';function a93_0xcad8(_0x550189,_0x422f65){_0x550189=_0x550189-0x1b8;const _0x5680ed=a93_0x5680();let _0xcad8c0=_0x5680ed[_0x550189];return _0xcad8c0;}import{Logger}from'../../utils/logger/index.js';export class LLMApiClient{[a93_0x54b763(0x1ee)];[a93_0x54b763(0x23d)];[a93_0x54b763(0x255)];[a93_0x54b763(0x22f)]=Logger['of'](a93_0x54b763(0x1bf));constructor(_0x56aeff){const _0x4f87c4=a93_0x54b763;this[_0x4f87c4(0x23d)]=getEndpoint(_0x56aeff[_0x4f87c4(0x1d7)],'llm'),this[_0x4f87c4(0x255)]=toHeaderRecord(getAuthHeaders(_0x56aeff[_0x4f87c4(0x1d7)],_0x56aeff[_0x4f87c4(0x22d)],_0x56aeff['accessToken'])),this[_0x4f87c4(0x1ee)]=new HTTPClient(this[_0x4f87c4(0x23d)],this[_0x4f87c4(0x255)],{'proxy':_0x56aeff[_0x4f87c4(0x1ea)]});}async[a93_0x54b763(0x216)](_0x4b3cb0){const _0x3652cd=a93_0x54b763,_0x9d728e=[];let _0x191876=_0x4b3cb0;while(_0x191876){const _0x268be7=await this[_0x3652cd(0x1ee)]['request'](_0x3652cd(0x226),_0x191876);_0x268be7[_0x3652cd(0x235)]&&_0x9d728e[_0x3652cd(0x236)](..._0x268be7[_0x3652cd(0x235)]);_0x191876=_0x268be7[_0x3652cd(0x203)]?.[_0x3652cd(0x242)];if(_0x191876&&_0x191876[_0x3652cd(0x1f6)]('http')){const _0x4050b0=new URL(_0x191876);_0x191876=_0x4050b0[_0x3652cd(0x1eb)]+_0x4050b0[_0x3652cd(0x252)];}}return _0x9d728e;}async[a93_0x54b763(0x207)](){const _0x1627cb=a93_0x54b763;return await this[_0x1627cb(0x1ee)]['request'](_0x1627cb(0x226),_0x1627cb(0x227));}async[a93_0x54b763(0x23c)](_0x4a14ba){const _0x433e1e=a93_0x54b763,_0x56d03c={'data':{'type':'projects','attributes':{'name':_0x4a14ba[_0x433e1e(0x1e0)],..._0x4a14ba['description']&&{'description':_0x4a14ba['description']}}}},_0x145bb4=await this[_0x433e1e(0x1ee)][_0x433e1e(0x249)]('POST','/api/projects',{'headers':{'Content-Type':_0x433e1e(0x1be),'Accept':_0x433e1e(0x1be)},'body':_0x56d03c});return _0x145bb4[_0x433e1e(0x235)];}async[a93_0x54b763(0x229)](_0xb30b87){const _0x1f5784=a93_0x54b763,_0x5a7f89=_0x1f5784(0x20a)+encodeURIComponent(_0xb30b87);await this['httpClient']['request']('DELETE',_0x5a7f89);}async[a93_0x54b763(0x1c2)](_0x2df636=0x32){const _0x3fe162=a93_0x54b763;return this[_0x3fe162(0x216)](_0x3fe162(0x1cc)+_0x2df636);}async[a93_0x54b763(0x1b9)](_0x5efd4e){const _0x32d7f5=a93_0x54b763;let _0x662e85=_0x32d7f5(0x21b);return _0x5efd4e&&(_0x662e85+=_0x32d7f5(0x218)+encodeURIComponent(_0x5efd4e)),this[_0x32d7f5(0x216)](_0x662e85);}async[a93_0x54b763(0x1c7)](_0x55daac){const _0x3f8a9b=a93_0x54b763,_0x41c30b=_0x3f8a9b(0x23a)+encodeURIComponent(_0x55daac),_0x2e9fbc=await this[_0x3f8a9b(0x1ee)]['request']('GET',_0x41c30b);return _0x2e9fbc['data'];}async['createAgent'](_0x53c6a9){const _0x47fa31=a93_0x54b763,_0x1d7966={'name':_0x53c6a9[_0x47fa31(0x1e0)],'projectId':_0x53c6a9['projectId'],'modelType':_0x53c6a9[_0x47fa31(0x220)],'maxToolIterations':_0x53c6a9[_0x47fa31(0x243)]??0x4,'temperature':_0x53c6a9[_0x47fa31(0x1df)]??0.7};_0x53c6a9[_0x47fa31(0x1fd)]!==undefined&&(_0x1d7966[_0x47fa31(0x1fd)]=_0x53c6a9[_0x47fa31(0x1fd)]);_0x53c6a9[_0x47fa31(0x1c1)]&&(_0x1d7966['starterMessage']=_0x53c6a9[_0x47fa31(0x1c1)]);_0x53c6a9[_0x47fa31(0x1b8)]&&(_0x1d7966[_0x47fa31(0x1b8)]=_0x53c6a9[_0x47fa31(0x1b8)]);_0x53c6a9[_0x47fa31(0x1e9)]&&_0x53c6a9['outputs'][_0x47fa31(0x206)]>0x0&&(_0x1d7966[_0x47fa31(0x1e9)]=_0x53c6a9[_0x47fa31(0x1e9)]);const _0x36fec0={'data':{'type':_0x47fa31(0x23f),'attributes':_0x1d7966}},_0x19ed02=await this[_0x47fa31(0x1ee)][_0x47fa31(0x249)](_0x47fa31(0x1cf),'/api/agents',{'headers':{'Content-Type':_0x47fa31(0x1be),'Accept':_0x47fa31(0x1be)},'body':_0x36fec0});return _0x19ed02[_0x47fa31(0x235)];}async[a93_0x54b763(0x1dd)](_0x44ee4f,_0x2072c4){const _0x17cc41=a93_0x54b763,_0x3dba9b={'data':{'type':'agents','id':_0x44ee4f,'attributes':{..._0x2072c4[_0x17cc41(0x1e0)]&&{'name':_0x2072c4[_0x17cc41(0x1e0)]},..._0x2072c4[_0x17cc41(0x21a)]&&{'description':_0x2072c4[_0x17cc41(0x21a)]},..._0x2072c4[_0x17cc41(0x1e8)]&&{'prompt':_0x2072c4['prompt']},..._0x2072c4[_0x17cc41(0x1c1)]&&{'starter_message':_0x2072c4[_0x17cc41(0x1c1)]},..._0x2072c4['reasoningEffort']&&{'reasoningEffort':_0x2072c4[_0x17cc41(0x1b8)]}}}},_0x3e27fc=_0x17cc41(0x23a)+encodeURIComponent(_0x44ee4f),_0x6baf71=await this['httpClient']['request'](_0x17cc41(0x22c),_0x3e27fc,{'headers':{'Content-Type':'application/vnd.api+json'},'body':_0x3dba9b});return _0x6baf71[_0x17cc41(0x235)];}async[a93_0x54b763(0x1dc)](_0x4ff61d){const _0x3d68dc=a93_0x54b763,_0x122e9c='/api/agents/'+encodeURIComponent(_0x4ff61d);await this['httpClient'][_0x3d68dc(0x249)](_0x3d68dc(0x247),_0x122e9c);}async[a93_0x54b763(0x1e4)](_0x41a05d=0x32){const _0x35e262=a93_0x54b763,_0x30e2d5=new URLSearchParams();_0x30e2d5[_0x35e262(0x1bc)](_0x35e262(0x259),String(_0x41a05d)),_0x30e2d5[_0x35e262(0x1bc)]('sort',_0x35e262(0x24b));const _0x4a1fe2=_0x35e262(0x22a)+_0x30e2d5[_0x35e262(0x205)](),_0x24724d=await this['httpClient']['request'](_0x35e262(0x226),_0x4a1fe2);return _0x24724d[_0x35e262(0x235)]||[];}async[a93_0x54b763(0x238)](_0x3ddbc4){const _0x27199f=a93_0x54b763,_0x270662='/api/chats/'+encodeURIComponent(_0x3ddbc4),_0x2fea9d=await this[_0x27199f(0x1ee)][_0x27199f(0x249)](_0x27199f(0x226),_0x270662);return _0x2fea9d[_0x27199f(0x235)];}async[a93_0x54b763(0x256)](_0x58d356){const _0x31bc8c=a93_0x54b763,_0x47ce3f=_0x31bc8c(0x1f3)+encodeURIComponent(_0x58d356)+_0x31bc8c(0x254);return await this[_0x31bc8c(0x1ee)][_0x31bc8c(0x249)](_0x31bc8c(0x226),_0x47ce3f);}async['getChatLog'](_0x1a3246){const _0x50d2c1=a93_0x54b763,_0x8094f4=_0x50d2c1(0x1f3)+encodeURIComponent(_0x1a3246)+_0x50d2c1(0x23b);return await this[_0x50d2c1(0x1ee)]['request'](_0x50d2c1(0x226),_0x8094f4);}async[a93_0x54b763(0x20b)](_0x23f7b4){const _0xb17c0f=a93_0x54b763,_0x22a64f={'data':{'type':_0xb17c0f(0x228),'attributes':{'agentId':_0x23f7b4[_0xb17c0f(0x214)]}}},_0x550de8=0x3,_0x370fb1=[0x3e8,0x7d0,0xfa0];for(let _0x1a2dbf=0x0;_0x1a2dbf<=_0x550de8;_0x1a2dbf++){const _0x3243ae=await this[_0xb17c0f(0x1ee)][_0xb17c0f(0x249)](_0xb17c0f(0x1cf),_0xb17c0f(0x1d8),{'headers':{'Content-Type':_0xb17c0f(0x1be),'Accept':_0xb17c0f(0x1be)},'body':_0x22a64f});if(_0x3243ae[_0xb17c0f(0x235)]&&_0x3243ae[_0xb17c0f(0x235)]['id'])return _0x3243ae['data'];if(_0x1a2dbf>=_0x550de8)throw new SDKError(ErrorCode[_0xb17c0f(0x1c6)],_0xb17c0f(0x1f0)+(_0x550de8+0x1)+'\x20attempts:\x20API\x20returned\x20empty\x20chat\x20ID');const _0x2c2f0e=_0x370fb1[_0x1a2dbf];console[_0xb17c0f(0x241)](_0xb17c0f(0x1d9)+(_0x1a2dbf+0x1)+'/'+_0x550de8+_0xb17c0f(0x24a)+_0x2c2f0e+_0xb17c0f(0x217)),await new Promise(_0x4f3aac=>setTimeout(_0x4f3aac,_0x2c2f0e));}throw new SDKError(ErrorCode['LLM_CHAT_CREATION_FAILURE'],_0xb17c0f(0x22e));}async*[a93_0x54b763(0x1f7)](_0x579765,_0x45f973,_0x2e7a06){const _0x45960a=a93_0x54b763,_0x15ba92=_0x45f973[_0x45960a(0x1ed)]();if(!_0x15ba92)throw new SDKError(ErrorCode[_0x45960a(0x246)],_0x45960a(0x213),undefined,{'helpText':_0x45960a(0x1ba)});this[_0x45960a(0x22f)][_0x45960a(0x234)](_0x45960a(0x1ce)+_0x579765+_0x45960a(0x23e)+_0x45f973[_0x45960a(0x206)]+_0x45960a(0x212));const _0x3bbb55=_0x45960a(0x1f3)+encodeURIComponent(_0x579765)+_0x45960a(0x251),_0x223e8d={'input':_0x45f973};try{const _0x4992c4=await this[_0x45960a(0x1ee)]['requestSSE'](_0x45960a(0x1cf),_0x3bbb55,{'headers':{'Content-Type':_0x45960a(0x233),'Accept':_0x45960a(0x20e)},'body':_0x223e8d,'signal':_0x2e7a06});this[_0x45960a(0x22f)][_0x45960a(0x234)]('['+_0x4992c4['status']+_0x45960a(0x1e1)+_0x579765),yield*parseSSEStream(_0x4992c4,this['logger']);}catch(_0x3e61db){throw new SDKError(ErrorCode[_0x45960a(0x215)],'Failed\x20to\x20continue\x20chat\x20(chatId:\x20'+_0x579765+_0x45960a(0x221)+_0x45f973[_0x45960a(0x206)]+')',_0x3e61db);}}async['getProject'](_0x93b144){const _0x376d1c=a93_0x54b763,_0x50b8a8=_0x376d1c(0x20a)+encodeURIComponent(_0x93b144),_0x35afa8=await this[_0x376d1c(0x1ee)][_0x376d1c(0x249)]('GET',_0x50b8a8);return _0x35afa8[_0x376d1c(0x235)];}async['listKnowledgeBases'](_0x5de1e3){const _0x322eaa=a93_0x54b763;return this[_0x322eaa(0x216)](_0x322eaa(0x21e)+encodeURIComponent(_0x5de1e3)+'&page[limit]=50');}async[a93_0x54b763(0x1c9)](_0x316964){const _0x864dc0=a93_0x54b763,_0x3d28d5={'data':{'type':_0x864dc0(0x20c),'attributes':_0x316964}},_0x830690=await this['httpClient'][_0x864dc0(0x249)](_0x864dc0(0x1cf),_0x864dc0(0x24d),{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x3d28d5});return _0x830690['data'];}async[a93_0x54b763(0x232)](_0x361815,_0x2281ad){const _0xc6ba1b=a93_0x54b763;return this['paginateAll'](_0xc6ba1b(0x1c8)+encodeURIComponent(_0x361815)+'&filter[project_id]='+encodeURIComponent(_0x2281ad)+'&page[limit]=50');}async[a93_0x54b763(0x1e2)](_0x2b09e6){const _0x44241e=a93_0x54b763,_0x3b61df=await this[_0x44241e(0x216)](_0x44241e(0x1f5)+encodeURIComponent(_0x2b09e6)+'&page[limit]=50');return _0x3b61df['map'](_0x1d79dd=>({..._0x1d79dd,'type':_0x44241e(0x231)}));}async[a93_0x54b763(0x200)](_0x4bb022){const _0x3272d9=a93_0x54b763,_0x2770a7=await this[_0x3272d9(0x1ee)]['request']('GET','/api/text_knowledge_bases/'+encodeURIComponent(_0x4bb022),{'headers':{'Accept':'application/vnd.api+json'}});return _0x2770a7[_0x3272d9(0x235)];}async[a93_0x54b763(0x1cb)](_0x3a74c8){const _0x419e03=a93_0x54b763,_0x5a3ea7={'data':{'type':'textKnowledgeBases','attributes':_0x3a74c8}},_0x54ef13=await this[_0x419e03(0x1ee)][_0x419e03(0x249)]('POST',_0x419e03(0x21d),{'headers':{'Content-Type':_0x419e03(0x1be),'Accept':_0x419e03(0x1be)},'body':_0x5a3ea7});return _0x54ef13[_0x419e03(0x235)];}async[a93_0x54b763(0x1f8)](_0x5f4395,_0x3d1946){const _0x5942cb=a93_0x54b763,_0x1d86e5={'data':{'type':'textKnowledgeBases','id':_0x5f4395,'attributes':_0x3d1946}},_0x13b8f1=await this[_0x5942cb(0x1ee)][_0x5942cb(0x249)]('PATCH',_0x5942cb(0x1c4)+encodeURIComponent(_0x5f4395),{'headers':{'Content-Type':_0x5942cb(0x1be),'Accept':_0x5942cb(0x1be)},'body':_0x1d86e5});return _0x13b8f1[_0x5942cb(0x235)];}async['createImageGenerator'](_0x5734f2){const _0x5cb406=a93_0x54b763,_0x3b6eb4={'data':{'type':_0x5cb406(0x224),'attributes':{..._0x5734f2,'imageModelType':_0x5734f2[_0x5cb406(0x24e)]||'nova-canvas','imageReturnMode':_0x5734f2[_0x5cb406(0x20f)]||'ID'}}},_0x41a5b9=await this[_0x5cb406(0x1ee)][_0x5cb406(0x249)](_0x5cb406(0x1cf),_0x5cb406(0x1d4),{'headers':{'Content-Type':_0x5cb406(0x1be),'Accept':_0x5cb406(0x1be)},'body':_0x3b6eb4});return _0x41a5b9[_0x5cb406(0x235)];}async[a93_0x54b763(0x1ef)](_0x26d961){const _0x1f8354=a93_0x54b763,_0x28eae6={'data':{'type':_0x1f8354(0x1c0),'attributes':{'projectId':_0x26d961['projectId'],'name':_0x26d961['name'],'modelType':_0x26d961[_0x1f8354(0x220)]||_0x1f8354(0x22b),'searchContextSize':_0x26d961[_0x1f8354(0x1e3)]||_0x1f8354(0x24c),'userLocation':_0x26d961[_0x1f8354(0x250)]||{'type':_0x1f8354(0x208),'country':'US','city':_0x1f8354(0x1ec),'region':_0x1f8354(0x225),'timezone':_0x1f8354(0x1da)},'systemPrompt':_0x26d961['systemPrompt']||'You\x20are\x20a\x20helpful\x20search\x20assistant.','filters':_0x26d961[_0x1f8354(0x258)]||{'allowed_domains':[]}}}},_0x4a5b21=await this[_0x1f8354(0x1ee)][_0x1f8354(0x249)](_0x1f8354(0x1cf),_0x1f8354(0x223),{'headers':{'Content-Type':_0x1f8354(0x1be),'Accept':_0x1f8354(0x1be)},'body':_0x28eae6});return _0x4a5b21[_0x1f8354(0x235)];}async[a93_0x54b763(0x1d0)](_0x168277){const _0x260e21=a93_0x54b763,_0x282df1=await this[_0x260e21(0x216)](_0x260e21(0x20d)+encodeURIComponent(_0x168277)+'&page[limit]=50');return _0x282df1[_0x260e21(0x1e5)](_0x3d0c37=>({..._0x3d0c37,'type':'imageGenerators'}));}async[a93_0x54b763(0x1e7)](_0x353ceb){const _0x13f8f3=a93_0x54b763,_0x5b1809=await this['paginateAll'](_0x13f8f3(0x209)+encodeURIComponent(_0x353ceb)+_0x13f8f3(0x1fb));return _0x5b1809[_0x13f8f3(0x1e5)](_0x4aed1e=>({..._0x4aed1e,'type':'webSearchTools'}));}async['getParentSegmentKnowledgeBase'](_0x5c06e5){const _0x3ee0b6=a93_0x54b763,_0x3be325=await this['paginateAll'](_0x3ee0b6(0x1d1)+encodeURIComponent(_0x5c06e5)+_0x3ee0b6(0x1ff));if(_0x3be325[_0x3ee0b6(0x206)]===0x0)return undefined;return{..._0x3be325[0x0],'type':_0x3ee0b6(0x1d5)};}async[a93_0x54b763(0x244)](_0x2aa7e9){const _0x31581a=a93_0x54b763;return this[_0x31581a(0x216)](_0x31581a(0x1fa)+encodeURIComponent(_0x2aa7e9)+_0x31581a(0x1fb));}async[a93_0x54b763(0x24f)](_0x3ab492){const _0x4248c4=a93_0x54b763,{jsonSchemaHint:_0x431a3b,..._0x1724f5}=_0x3ab492,_0x2c680e={'data':{'type':'prompts','attributes':_0x1724f5}},_0x5d699e=await this[_0x4248c4(0x1ee)][_0x4248c4(0x249)]('POST',_0x4248c4(0x245),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x4248c4(0x1be)},'body':_0x2c680e});return _0x5d699e[_0x4248c4(0x235)];}async[a93_0x54b763(0x248)](_0x1610db){const _0x1fa992=a93_0x54b763;return this[_0x1fa992(0x216)](_0x1fa992(0x257)+encodeURIComponent(_0x1610db)+_0x1fa992(0x1fb));}async[a93_0x54b763(0x1bd)](_0x216e8f){const _0x3c708c=a93_0x54b763,_0x509296={'data':{'type':_0x3c708c(0x202),'attributes':_0x216e8f}},_0x32d676=await this[_0x3c708c(0x1ee)]['request'](_0x3c708c(0x1cf),_0x3c708c(0x1bb),{'headers':{'Content-Type':_0x3c708c(0x1be),'Accept':'application/vnd.api+json'},'body':_0x509296});return _0x32d676['data'];}async[a93_0x54b763(0x1f2)](_0x373749){const _0xc28cd5=a93_0x54b763,_0x4a74ff=await this[_0xc28cd5(0x216)]('/api/tool_targets?filter[targetType]=ExperimentalKnowledgeBase&filter[project_id]='+encodeURIComponent(_0x373749)+'&page[limit]=50');return _0x4a74ff[_0xc28cd5(0x1e5)](_0x2ce67a=>({..._0x2ce67a,'type':_0xc28cd5(0x253)}));}async[a93_0x54b763(0x1f1)](_0x137c3e){const _0x17bf67=a93_0x54b763,_0x46e008=await this[_0x17bf67(0x1ee)][_0x17bf67(0x249)]('GET',_0x17bf67(0x1d3)+encodeURIComponent(_0x137c3e),{'headers':{'Accept':_0x17bf67(0x1be)}});return _0x46e008[_0x17bf67(0x235)];}async['createExperimentalKnowledgeBase'](_0x446c02){const _0x2a6bc2=a93_0x54b763,_0x3d1c55={'data':{'type':_0x2a6bc2(0x253),'attributes':_0x446c02}},_0x5cb58b=await this['httpClient']['request'](_0x2a6bc2(0x1cf),_0x2a6bc2(0x201),{'headers':{'Content-Type':_0x2a6bc2(0x1be),'Accept':_0x2a6bc2(0x1be)},'body':_0x3d1c55});return _0x5cb58b[_0x2a6bc2(0x235)];}async[a93_0x54b763(0x1e6)](_0x1e7341,_0x82e48e){const _0x46fc7=a93_0x54b763,_0x4639fe={'data':{'type':'experimentalKnowledgeBases','id':_0x1e7341,'attributes':_0x82e48e}},_0x53124b=await this[_0x46fc7(0x1ee)][_0x46fc7(0x249)](_0x46fc7(0x22c),'/api/experimental_knowledge_bases/'+encodeURIComponent(_0x1e7341),{'headers':{'Content-Type':_0x46fc7(0x1be),'Accept':_0x46fc7(0x1be)},'body':_0x4639fe});return _0x53124b[_0x46fc7(0x235)];}async['listExperimentalArtifacts'](_0x17712d){const _0x54d248=a93_0x54b763;return this[_0x54d248(0x216)]('/api/experimental_artifacts?filter[projectId]='+encodeURIComponent(_0x17712d)+_0x54d248(0x1fb));}async['getExperimentalArtifact'](_0x49baaf){const _0x2b5a03=a93_0x54b763,_0x36f8ef=await this[_0x2b5a03(0x1ee)][_0x2b5a03(0x249)](_0x2b5a03(0x226),_0x2b5a03(0x240)+encodeURIComponent(_0x49baaf),{'headers':{'Accept':_0x2b5a03(0x1be)}});return _0x36f8ef[_0x2b5a03(0x235)];}async['createExperimentalArtifact'](_0x4dbc0e){const _0x3ff84e=a93_0x54b763,_0x154eea={'data':{'type':_0x3ff84e(0x237),'attributes':_0x4dbc0e}},_0x6d40a6=await this[_0x3ff84e(0x1ee)][_0x3ff84e(0x249)](_0x3ff84e(0x1cf),_0x3ff84e(0x1f9),{'headers':{'Content-Type':_0x3ff84e(0x1be),'Accept':_0x3ff84e(0x1be)},'body':_0x154eea});return _0x6d40a6['data'];}async['updateExperimentalArtifact'](_0x4fe57c,_0x5b4c21){const _0x40a473=a93_0x54b763,_0x3a79f8={'data':{'type':'experimentalArtifacts','id':_0x4fe57c,'attributes':_0x5b4c21}},_0x120bca=await this['httpClient']['request'](_0x40a473(0x22c),_0x40a473(0x240)+encodeURIComponent(_0x4fe57c),{'headers':{'Content-Type':_0x40a473(0x1be),'Accept':_0x40a473(0x1be)},'body':_0x3a79f8});return _0x120bca['data'];}async[a93_0x54b763(0x1c3)](_0x177e90){const _0x55c193=a93_0x54b763,_0x565f22=await this[_0x55c193(0x1b9)](_0x177e90),_0x386cde=[];for(const _0x469bd5 of _0x565f22){const _0x351784=_0x55c193(0x23a)+encodeURIComponent(_0x469bd5['id']),_0x10b0bb=await this[_0x55c193(0x1ee)][_0x55c193(0x249)]('GET',_0x351784);_0x386cde[_0x55c193(0x236)](_0x10b0bb['data']);}return _0x386cde;}async[a93_0x54b763(0x1d6)](_0x578540){const _0x54ec7d=a93_0x54b763,_0x415e15={'data':{'type':_0x54ec7d(0x23f),'attributes':_0x578540}},_0x421381=await this[_0x54ec7d(0x1ee)]['request'](_0x54ec7d(0x1cf),_0x54ec7d(0x210),{'headers':{'Content-Type':_0x54ec7d(0x1be),'Accept':_0x54ec7d(0x1be)},'body':_0x415e15});return _0x421381[_0x54ec7d(0x235)];}async[a93_0x54b763(0x21f)](_0xfa5237,_0x47e5c7){const _0x4903c9=a93_0x54b763,_0x5afd27={'data':{'type':'agents','id':_0xfa5237,'attributes':_0x47e5c7}},_0x1f6009=_0x4903c9(0x23a)+encodeURIComponent(_0xfa5237),_0x1a0c5a=await this[_0x4903c9(0x1ee)][_0x4903c9(0x249)](_0x4903c9(0x22c),_0x1f6009,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x4903c9(0x1be)},'body':_0x5afd27});return _0x1a0c5a[_0x4903c9(0x235)];}async[a93_0x54b763(0x211)](_0x2122c4,_0x2c9456){const _0xdef69a=a93_0x54b763,_0x2d69fb={'data':{'type':_0xdef69a(0x20c),'id':_0x2122c4,'attributes':_0x2c9456}},_0x6f3315=_0xdef69a(0x1db)+encodeURIComponent(_0x2122c4),_0x5ca4f1=await this[_0xdef69a(0x1ee)][_0xdef69a(0x249)](_0xdef69a(0x22c),_0x6f3315,{'headers':{'Content-Type':'application/vnd.api+json','Accept':'application/vnd.api+json'},'body':_0x2d69fb});return _0x5ca4f1[_0xdef69a(0x235)];}async['updatePrompt'](_0xe081e3,_0x30f408){const _0x4c3bfa=a93_0x54b763,{jsonSchemaHint:_0x40004d,..._0x340898}=_0x30f408,_0x10ff34={'data':{'type':'prompts','id':_0xe081e3,'attributes':_0x340898}},_0x157ff9=_0x4c3bfa(0x1c5)+encodeURIComponent(_0xe081e3),_0x2f3e9b=await this[_0x4c3bfa(0x1ee)][_0x4c3bfa(0x249)](_0x4c3bfa(0x22c),_0x157ff9,{'headers':{'Content-Type':_0x4c3bfa(0x1be),'Accept':_0x4c3bfa(0x1be)},'body':_0x10ff34});return _0x2f3e9b[_0x4c3bfa(0x235)];}async['updateIntegration'](_0x1b524b,_0x306358){const _0x2d2e8c=a93_0x54b763,_0x55cd51={'data':{'type':_0x2d2e8c(0x202),'id':_0x1b524b,'attributes':_0x306358}},_0xaadde7='/api/integrations/'+encodeURIComponent(_0x1b524b),_0x572159=await this['httpClient'][_0x2d2e8c(0x249)](_0x2d2e8c(0x22c),_0xaadde7,{'headers':{'Content-Type':_0x2d2e8c(0x1be),'Accept':_0x2d2e8c(0x1be)},'body':_0x55cd51});return _0x572159['data'];}async[a93_0x54b763(0x1de)](_0x5c1353){const _0x423b62=a93_0x54b763,_0x59177a=_0x423b62(0x1f4)+encodeURIComponent(_0x5c1353);await this[_0x423b62(0x1ee)]['request'](_0x423b62(0x247),_0x59177a);}}
|
|
1
|
+
const a93_0x4fb191=a93_0x5619;function a93_0x13a1(){const _0x21e890=['Failed\x20to\x20create\x20chat\x20after\x20','/api/experimental_artifacts','updateKnowledgeBase','listExperimentalKnowledgeBases','POST','getExperimentalKnowledgeBase','1011bFTsYe','/api/projects?page[limit]=','gpt-4o','/api/web_search_tools','parentSegmentKnowledgeBases','/api/experimental_knowledge_bases','/api/tool_targets?filter[targetType]=ParentSegmentKnowledgeBase&filter[project_id]=','/api/prompts','/api/agents?page[limit]=50','site','accessToken','/api/chats','listPrompts','/api/prompts?filter[projectId]=','getProject','/api/chats/','/langfuse','startChat','listToolTargets','webSearchTools','/api/knowledge_bases','temperature','projectId','LLM_STREAM_ERROR','/api/experimental_knowledge_bases/','896872IYkiRM','createAgentResponse','&page[limit]=50','toString','getTextKnowledgeBase','/api/projects','http','trim','createTextKnowledgeBase','knowledge_bases','sort','listAgentsFull','searchContextSize','logger','push','imageModelType','updateAgentResponse','/api/integrations?filter[projectId]=','application/json','name','paginateAll','/api/agents',']\x20Chat\x20creation\x20returned\x20empty\x20ID,\x20retrying\x20in\x20','/api/projects/','updateExperimentalKnowledgeBase','/api/agents/','links','5XwdPDy','userLocation','PATCH','getAgent','search','DELETE','integrations','chats','434TJGsNa','updateAgent','httpClient','[Retry\x20','listWebSearchTools','&page[limit]=1','baseUrl','maxToolIterations','listTextKnowledgeBases','reasoningEffort','medium','/api/text_knowledge_bases','Continuing\x20chat\x20','104391gHwisJ','-last_conversation_at','/api/image_generators','text/event-stream','map','/api/tool_targets?filter[targetType]=ExperimentalKnowledgeBase&filter[project_id]=','\x20attempts:\x20API\x20returned\x20empty\x20chat\x20ID','agentId','/api/text_knowledge_bases/','application/vnd.api+json','textKnowledgeBases','createWebSearchTool','3989657oWmhPu','/api/experimental_artifacts/','page[limit]','experimentalArtifacts','warn','prompts','/api/knowledge_bases?filter[projectId]=','/history','updateIntegration','getParentSegmentKnowledgeBase','2476740UinZum','getChatLog','tdx.client.llm','imageGenerators','prompt','createIntegration','Failed\x20to\x20create\x20chat:\x20unexpected\x20error','authHeaders','/api/tool_targets?filter[targetType]=TextKnowledgeBase&filter[project_id]=','/api/chats?','getExperimentalArtifact','imageReturnMode','outputs','America/Los_Angeles','&filter[project_id]=','850SlYnkx','/api/knowledge_bases/','San\x20Francisco','listAgents','483504MROfTf','pathname','append','filters','GET','startsWith','llm','listProjects','experimentalKnowledgeBases','next','Please\x20provide\x20a\x20non-empty\x20message\x20to\x20continue\x20the\x20chat.','systemPrompt','request','deleteAgent','data','\x20characters','listIntegrations','California','createKnowledgeBase','starterMessage','proxy','agents','createAgent','continueChat','/api/integrations','836404QbJGuo','/api/tool_targets?filter[targetType]=ImageGenerator&filter[project_id]=','/api/users/current_settings','/api/integrations/','/api/tool_targets?filter[targetType]=WebSearchTool&filter[project_id]=','nova-canvas','debug','updatePrompt','getChatInfo','createImageGenerator','/api/experimental_artifacts?filter[projectId]=','description','length'];a93_0x13a1=function(){return _0x21e890;};return a93_0x13a1();}(function(_0x36a21d,_0x2e3313){const _0x35ff20=a93_0x5619,_0x167f61=_0x36a21d();while(!![]){try{const _0x326d9d=-parseInt(_0x35ff20(0x193))/0x1+-parseInt(_0x35ff20(0x1b6))/0x2*(-parseInt(_0x35ff20(0x218))/0x3)+-parseInt(_0x35ff20(0x205))/0x4*(-parseInt(_0x35ff20(0x1ae))/0x5)+-parseInt(_0x35ff20(0x1d9))/0x6+parseInt(_0x35ff20(0x1cf))/0x7+parseInt(_0x35ff20(0x1ec))/0x8+-parseInt(_0x35ff20(0x1c3))/0x9*(-parseInt(_0x35ff20(0x1e8))/0xa);if(_0x326d9d===_0x2e3313)break;else _0x167f61['push'](_0x167f61['shift']());}catch(_0x54eae5){_0x167f61['push'](_0x167f61['shift']());}}}(a93_0x13a1,0x8fc48));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';function a93_0x5619(_0x442ed8,_0x506891){_0x442ed8=_0x442ed8-0x18a;const _0x13a145=a93_0x13a1();let _0x5619ff=_0x13a145[_0x442ed8];return _0x5619ff;}export class LLMApiClient{[a93_0x4fb191(0x1b8)];[a93_0x4fb191(0x1bc)];[a93_0x4fb191(0x1e0)];[a93_0x4fb191(0x1a0)]=Logger['of'](a93_0x4fb191(0x1db));constructor(_0x2bc214){const _0xe15005=a93_0x4fb191;this[_0xe15005(0x1bc)]=getEndpoint(_0x2bc214['site'],_0xe15005(0x1f2)),this[_0xe15005(0x1e0)]=toHeaderRecord(getAuthHeaders(_0x2bc214[_0xe15005(0x221)],_0x2bc214['apiKey'],_0x2bc214[_0xe15005(0x222)])),this[_0xe15005(0x1b8)]=new HTTPClient(this['baseUrl'],this[_0xe15005(0x1e0)],{'proxy':_0x2bc214[_0xe15005(0x200)]});}async[a93_0x4fb191(0x1a7)](_0xa8ee8c){const _0x11ed90=a93_0x4fb191,_0xa484e7=[];let _0x5627b2=_0xa8ee8c;while(_0x5627b2){const _0x17a361=await this[_0x11ed90(0x1b8)][_0x11ed90(0x1f8)]('GET',_0x5627b2);_0x17a361[_0x11ed90(0x1fa)]&&_0xa484e7[_0x11ed90(0x1a1)](..._0x17a361['data']);_0x5627b2=_0x17a361[_0x11ed90(0x1ad)]?.[_0x11ed90(0x1f5)];if(_0x5627b2&&_0x5627b2[_0x11ed90(0x1f1)](_0x11ed90(0x199))){const _0x1ed40b=new URL(_0x5627b2);_0x5627b2=_0x1ed40b[_0x11ed90(0x1ed)]+_0x1ed40b[_0x11ed90(0x1b2)];}}return _0xa484e7;}async['getUserSettings'](){const _0x53cef6=a93_0x4fb191;return await this[_0x53cef6(0x1b8)]['request'](_0x53cef6(0x1f0),_0x53cef6(0x207));}async['createProject'](_0x146dd8){const _0x416989=a93_0x4fb191,_0x1200ae={'data':{'type':'projects','attributes':{'name':_0x146dd8[_0x416989(0x1a6)],..._0x146dd8[_0x416989(0x210)]&&{'description':_0x146dd8[_0x416989(0x210)]}}}},_0x2f887c=await this[_0x416989(0x1b8)][_0x416989(0x1f8)](_0x416989(0x216),_0x416989(0x198),{'headers':{'Content-Type':_0x416989(0x1cc),'Accept':_0x416989(0x1cc)},'body':_0x1200ae});return _0x2f887c[_0x416989(0x1fa)];}async['deleteProject'](_0x2f142d){const _0x3dd991=a93_0x4fb191,_0x86b101=_0x3dd991(0x1aa)+encodeURIComponent(_0x2f142d);await this['httpClient'][_0x3dd991(0x1f8)](_0x3dd991(0x1b3),_0x86b101);}async[a93_0x4fb191(0x1f3)](_0x2f9a09=0x32){const _0x11c336=a93_0x4fb191;return this[_0x11c336(0x1a7)](_0x11c336(0x219)+_0x2f9a09);}async['listAgents'](_0x2a6b66){const _0x4c4be9=a93_0x4fb191;let _0x1b8f68=_0x4c4be9(0x220);return _0x2a6b66&&(_0x1b8f68+=_0x4c4be9(0x1e7)+encodeURIComponent(_0x2a6b66)),this[_0x4c4be9(0x1a7)](_0x1b8f68);}async[a93_0x4fb191(0x1b1)](_0x41afa4){const _0xd7fd2d=a93_0x4fb191,_0x39a018=_0xd7fd2d(0x1ac)+encodeURIComponent(_0x41afa4),_0x3128be=await this[_0xd7fd2d(0x1b8)][_0xd7fd2d(0x1f8)](_0xd7fd2d(0x1f0),_0x39a018);return _0x3128be['data'];}async[a93_0x4fb191(0x202)](_0x322025){const _0x392f7d=a93_0x4fb191,_0x22e565={'name':_0x322025['name'],'projectId':_0x322025[_0x392f7d(0x190)],'modelType':_0x322025['modelType'],'maxToolIterations':_0x322025[_0x392f7d(0x1bd)]??0x4,'temperature':_0x322025[_0x392f7d(0x18f)]??0.7};_0x322025[_0x392f7d(0x1f7)]!==undefined&&(_0x22e565[_0x392f7d(0x1f7)]=_0x322025[_0x392f7d(0x1f7)]);_0x322025[_0x392f7d(0x1ff)]&&(_0x22e565[_0x392f7d(0x1ff)]=_0x322025[_0x392f7d(0x1ff)]);_0x322025[_0x392f7d(0x1bf)]&&(_0x22e565[_0x392f7d(0x1bf)]=_0x322025[_0x392f7d(0x1bf)]);_0x322025[_0x392f7d(0x1e5)]&&_0x322025[_0x392f7d(0x1e5)]['length']>0x0&&(_0x22e565[_0x392f7d(0x1e5)]=_0x322025[_0x392f7d(0x1e5)]);const _0x49ab8c={'data':{'type':_0x392f7d(0x201),'attributes':_0x22e565}},_0x4b78e6=await this[_0x392f7d(0x1b8)][_0x392f7d(0x1f8)](_0x392f7d(0x216),_0x392f7d(0x1a8),{'headers':{'Content-Type':_0x392f7d(0x1cc),'Accept':_0x392f7d(0x1cc)},'body':_0x49ab8c});return _0x4b78e6[_0x392f7d(0x1fa)];}async[a93_0x4fb191(0x1b7)](_0xded660,_0x239b1c){const _0x52d1b0=a93_0x4fb191,_0x36a5f0={'data':{'type':_0x52d1b0(0x201),'id':_0xded660,'attributes':{..._0x239b1c[_0x52d1b0(0x1a6)]&&{'name':_0x239b1c[_0x52d1b0(0x1a6)]},..._0x239b1c['description']&&{'description':_0x239b1c[_0x52d1b0(0x210)]},..._0x239b1c[_0x52d1b0(0x1dd)]&&{'prompt':_0x239b1c['prompt']},..._0x239b1c[_0x52d1b0(0x1ff)]&&{'starter_message':_0x239b1c[_0x52d1b0(0x1ff)]},..._0x239b1c['reasoningEffort']&&{'reasoningEffort':_0x239b1c[_0x52d1b0(0x1bf)]}}}},_0x5c9e2c=_0x52d1b0(0x1ac)+encodeURIComponent(_0xded660),_0x5df29d=await this['httpClient']['request'](_0x52d1b0(0x1b0),_0x5c9e2c,{'headers':{'Content-Type':_0x52d1b0(0x1cc)},'body':_0x36a5f0});return _0x5df29d[_0x52d1b0(0x1fa)];}async[a93_0x4fb191(0x1f9)](_0x969695){const _0xc4714f=a93_0x4fb191,_0x551392='/api/agents/'+encodeURIComponent(_0x969695);await this[_0xc4714f(0x1b8)][_0xc4714f(0x1f8)](_0xc4714f(0x1b3),_0x551392);}async['listChats'](_0x1787fe=0x32){const _0x4ce0ab=a93_0x4fb191,_0x452d03=new URLSearchParams();_0x452d03['append'](_0x4ce0ab(0x1d1),String(_0x1787fe)),_0x452d03[_0x4ce0ab(0x1ee)](_0x4ce0ab(0x19d),_0x4ce0ab(0x1c4));const _0x358e18=_0x4ce0ab(0x1e2)+_0x452d03[_0x4ce0ab(0x196)](),_0x2a90c3=await this['httpClient'][_0x4ce0ab(0x1f8)](_0x4ce0ab(0x1f0),_0x358e18);return _0x2a90c3[_0x4ce0ab(0x1fa)]||[];}async[a93_0x4fb191(0x20d)](_0x2a4c7d){const _0x1e6250=a93_0x4fb191,_0x449fd5=_0x1e6250(0x227)+encodeURIComponent(_0x2a4c7d),_0x1083ce=await this[_0x1e6250(0x1b8)][_0x1e6250(0x1f8)]('GET',_0x449fd5);return _0x1083ce['data'];}async['getChatHistory'](_0x418b72){const _0x469417=a93_0x4fb191,_0x1f3f5f=_0x469417(0x227)+encodeURIComponent(_0x418b72)+_0x469417(0x1d6);return await this[_0x469417(0x1b8)][_0x469417(0x1f8)]('GET',_0x1f3f5f);}async[a93_0x4fb191(0x1da)](_0x4ec3da){const _0xfeef55=a93_0x4fb191,_0x143dca=_0xfeef55(0x227)+encodeURIComponent(_0x4ec3da)+_0xfeef55(0x18a);return await this['httpClient'][_0xfeef55(0x1f8)](_0xfeef55(0x1f0),_0x143dca);}async[a93_0x4fb191(0x18b)](_0x45a8f0){const _0x2b8379=a93_0x4fb191,_0x5c6401={'data':{'type':_0x2b8379(0x1b5),'attributes':{'agentId':_0x45a8f0[_0x2b8379(0x1ca)]}}},_0x52e784=0x3,_0x341236=[0x3e8,0x7d0,0xfa0];for(let _0x1cf263=0x0;_0x1cf263<=_0x52e784;_0x1cf263++){const _0xd96b1f=await this[_0x2b8379(0x1b8)][_0x2b8379(0x1f8)](_0x2b8379(0x216),_0x2b8379(0x223),{'headers':{'Content-Type':_0x2b8379(0x1cc),'Accept':'application/vnd.api+json'},'body':_0x5c6401});if(_0xd96b1f[_0x2b8379(0x1fa)]&&_0xd96b1f[_0x2b8379(0x1fa)]['id'])return _0xd96b1f[_0x2b8379(0x1fa)];if(_0x1cf263>=_0x52e784)throw new SDKError(ErrorCode['LLM_CHAT_CREATION_FAILURE'],_0x2b8379(0x212)+(_0x52e784+0x1)+_0x2b8379(0x1c9));const _0xfb0e3b=_0x341236[_0x1cf263];console[_0x2b8379(0x1d3)](_0x2b8379(0x1b9)+(_0x1cf263+0x1)+'/'+_0x52e784+_0x2b8379(0x1a9)+_0xfb0e3b+'ms...'),await new Promise(_0x489752=>setTimeout(_0x489752,_0xfb0e3b));}throw new SDKError(ErrorCode['LLM_CHAT_CREATION_FAILURE'],_0x2b8379(0x1df));}async*[a93_0x4fb191(0x203)](_0xd22002,_0x58371e,_0x2dafef){const _0x486df5=a93_0x4fb191,_0x5b76d7=_0x58371e[_0x486df5(0x19a)]();if(!_0x5b76d7)throw new SDKError(ErrorCode['LLM_EMPTY_MESSAGE'],'Message\x20cannot\x20be\x20empty\x20or\x20whitespace\x20only',undefined,{'helpText':_0x486df5(0x1f6)});this[_0x486df5(0x1a0)][_0x486df5(0x20b)](_0x486df5(0x1c2)+_0xd22002+'\x20with\x20message\x20size:\x20'+_0x58371e['length']+_0x486df5(0x1fb));const _0x4164eb=_0x486df5(0x227)+encodeURIComponent(_0xd22002)+'/continue',_0x155f01={'input':_0x58371e};try{const _0x172330=await this[_0x486df5(0x1b8)]['requestSSE']('POST',_0x4164eb,{'headers':{'Content-Type':_0x486df5(0x1a5),'Accept':_0x486df5(0x1c6)},'body':_0x155f01,'signal':_0x2dafef});this['logger']['debug']('['+_0x172330['status']+']\x20Streaming\x20SSE\x20stream\x20for\x20chatId:\x20'+_0xd22002),yield*parseSSEStream(_0x172330,this[_0x486df5(0x1a0)]);}catch(_0x26eee8){throw new SDKError(ErrorCode[_0x486df5(0x191)],'Failed\x20to\x20continue\x20chat\x20(chatId:\x20'+_0xd22002+',\x20message\x20length:\x20'+_0x58371e['length']+')',_0x26eee8);}}async[a93_0x4fb191(0x226)](_0x3d5de5){const _0x40174d=a93_0x4fb191,_0x3595a0=_0x40174d(0x1aa)+encodeURIComponent(_0x3d5de5),_0x3e90d6=await this[_0x40174d(0x1b8)]['request'](_0x40174d(0x1f0),_0x3595a0);return _0x3e90d6[_0x40174d(0x1fa)];}async['listKnowledgeBases'](_0x2dbb62){const _0x5cda7a=a93_0x4fb191;return this[_0x5cda7a(0x1a7)](_0x5cda7a(0x1d5)+encodeURIComponent(_0x2dbb62)+_0x5cda7a(0x195));}async[a93_0x4fb191(0x1fe)](_0x5860c9){const _0x2b9008=a93_0x4fb191,_0x4f78f4={'data':{'type':_0x2b9008(0x19c),'attributes':_0x5860c9}},_0x2b3f82=await this[_0x2b9008(0x1b8)]['request']('POST',_0x2b9008(0x18e),{'headers':{'Content-Type':_0x2b9008(0x1cc),'Accept':_0x2b9008(0x1cc)},'body':_0x4f78f4});return _0x2b3f82[_0x2b9008(0x1fa)];}async[a93_0x4fb191(0x18c)](_0x1e5176,_0x655d01){const _0x470e23=a93_0x4fb191;return this[_0x470e23(0x1a7)]('/api/tool_targets?filter[targetType]='+encodeURIComponent(_0x1e5176)+_0x470e23(0x1e7)+encodeURIComponent(_0x655d01)+_0x470e23(0x195));}async[a93_0x4fb191(0x1be)](_0x3cbec0){const _0x568df0=a93_0x4fb191,_0x11d047=await this[_0x568df0(0x1a7)](_0x568df0(0x1e1)+encodeURIComponent(_0x3cbec0)+'&page[limit]=50');return _0x11d047['map'](_0x553256=>({..._0x553256,'type':_0x568df0(0x1cd)}));}async[a93_0x4fb191(0x197)](_0x39f320){const _0x3dfef1=a93_0x4fb191,_0x48d68b=await this[_0x3dfef1(0x1b8)][_0x3dfef1(0x1f8)](_0x3dfef1(0x1f0),_0x3dfef1(0x1cb)+encodeURIComponent(_0x39f320),{'headers':{'Accept':_0x3dfef1(0x1cc)}});return _0x48d68b[_0x3dfef1(0x1fa)];}async[a93_0x4fb191(0x19b)](_0x3f0fa1){const _0x30a917=a93_0x4fb191,_0x206fe4={'data':{'type':_0x30a917(0x1cd),'attributes':_0x3f0fa1}},_0x196057=await this[_0x30a917(0x1b8)][_0x30a917(0x1f8)](_0x30a917(0x216),_0x30a917(0x1c1),{'headers':{'Content-Type':_0x30a917(0x1cc),'Accept':'application/vnd.api+json'},'body':_0x206fe4});return _0x196057[_0x30a917(0x1fa)];}async['updateTextKnowledgeBase'](_0x1e7f4f,_0xe0affa){const _0x2fd08c=a93_0x4fb191,_0xc99322={'data':{'type':'textKnowledgeBases','id':_0x1e7f4f,'attributes':_0xe0affa}},_0x1c1c94=await this[_0x2fd08c(0x1b8)][_0x2fd08c(0x1f8)](_0x2fd08c(0x1b0),_0x2fd08c(0x1cb)+encodeURIComponent(_0x1e7f4f),{'headers':{'Content-Type':_0x2fd08c(0x1cc),'Accept':_0x2fd08c(0x1cc)},'body':_0xc99322});return _0x1c1c94['data'];}async[a93_0x4fb191(0x20e)](_0x3feb54){const _0x316daf=a93_0x4fb191,_0x511226={'data':{'type':_0x316daf(0x1dc),'attributes':{..._0x3feb54,'imageModelType':_0x3feb54[_0x316daf(0x1a2)]||_0x316daf(0x20a),'imageReturnMode':_0x3feb54[_0x316daf(0x1e4)]||'ID'}}},_0x217ef6=await this[_0x316daf(0x1b8)][_0x316daf(0x1f8)]('POST',_0x316daf(0x1c5),{'headers':{'Content-Type':_0x316daf(0x1cc),'Accept':'application/vnd.api+json'},'body':_0x511226});return _0x217ef6[_0x316daf(0x1fa)];}async[a93_0x4fb191(0x1ce)](_0x1be7ca){const _0x2a93e7=a93_0x4fb191,_0x985efc={'data':{'type':_0x2a93e7(0x18d),'attributes':{'projectId':_0x1be7ca[_0x2a93e7(0x190)],'name':_0x1be7ca['name'],'modelType':_0x1be7ca['modelType']||_0x2a93e7(0x21a),'searchContextSize':_0x1be7ca[_0x2a93e7(0x19f)]||_0x2a93e7(0x1c0),'userLocation':_0x1be7ca[_0x2a93e7(0x1af)]||{'type':'approximate','country':'US','city':_0x2a93e7(0x1ea),'region':_0x2a93e7(0x1fd),'timezone':_0x2a93e7(0x1e6)},'systemPrompt':_0x1be7ca[_0x2a93e7(0x1f7)]||'You\x20are\x20a\x20helpful\x20search\x20assistant.','filters':_0x1be7ca[_0x2a93e7(0x1ef)]||{'allowed_domains':[]}}}},_0x305bbb=await this['httpClient'][_0x2a93e7(0x1f8)]('POST',_0x2a93e7(0x21b),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x2a93e7(0x1cc)},'body':_0x985efc});return _0x305bbb[_0x2a93e7(0x1fa)];}async['listImageGenerators'](_0x174aa5){const _0x7f56d=a93_0x4fb191,_0x554a4d=await this[_0x7f56d(0x1a7)](_0x7f56d(0x206)+encodeURIComponent(_0x174aa5)+'&page[limit]=50');return _0x554a4d[_0x7f56d(0x1c7)](_0x1f456a=>({..._0x1f456a,'type':_0x7f56d(0x1dc)}));}async[a93_0x4fb191(0x1ba)](_0x208d1d){const _0xc58a36=a93_0x4fb191,_0x33a33f=await this[_0xc58a36(0x1a7)](_0xc58a36(0x209)+encodeURIComponent(_0x208d1d)+_0xc58a36(0x195));return _0x33a33f[_0xc58a36(0x1c7)](_0x526076=>({..._0x526076,'type':'webSearchTools'}));}async[a93_0x4fb191(0x1d8)](_0x476937){const _0x18ee92=a93_0x4fb191,_0x29e4b8=await this[_0x18ee92(0x1a7)](_0x18ee92(0x21e)+encodeURIComponent(_0x476937)+_0x18ee92(0x1bb));if(_0x29e4b8[_0x18ee92(0x211)]===0x0)return undefined;return{..._0x29e4b8[0x0],'type':_0x18ee92(0x21c)};}async[a93_0x4fb191(0x224)](_0x4a3b2f){const _0x4df4f4=a93_0x4fb191;return this[_0x4df4f4(0x1a7)](_0x4df4f4(0x225)+encodeURIComponent(_0x4a3b2f)+_0x4df4f4(0x195));}async['createPrompt'](_0x20aaaf){const _0x8b1385=a93_0x4fb191,{jsonSchemaHint:_0x461834,..._0x54f808}=_0x20aaaf,_0x28004e={'data':{'type':_0x8b1385(0x1d4),'attributes':_0x54f808}},_0x31a2bd=await this[_0x8b1385(0x1b8)][_0x8b1385(0x1f8)](_0x8b1385(0x216),_0x8b1385(0x21f),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x8b1385(0x1cc)},'body':_0x28004e});return _0x31a2bd[_0x8b1385(0x1fa)];}async[a93_0x4fb191(0x1fc)](_0x23f60d){const _0x517514=a93_0x4fb191;return this[_0x517514(0x1a7)](_0x517514(0x1a4)+encodeURIComponent(_0x23f60d)+_0x517514(0x195));}async[a93_0x4fb191(0x1de)](_0x39275a){const _0x1b492f=a93_0x4fb191,_0x15cb8f={'data':{'type':_0x1b492f(0x1b4),'attributes':_0x39275a}},_0x4d39b7=await this[_0x1b492f(0x1b8)][_0x1b492f(0x1f8)](_0x1b492f(0x216),_0x1b492f(0x204),{'headers':{'Content-Type':_0x1b492f(0x1cc),'Accept':'application/vnd.api+json'},'body':_0x15cb8f});return _0x4d39b7[_0x1b492f(0x1fa)];}async[a93_0x4fb191(0x215)](_0x4f98c9){const _0x22c33b=a93_0x4fb191,_0x538a10=await this[_0x22c33b(0x1a7)](_0x22c33b(0x1c8)+encodeURIComponent(_0x4f98c9)+_0x22c33b(0x195));return _0x538a10[_0x22c33b(0x1c7)](_0x1dde11=>({..._0x1dde11,'type':_0x22c33b(0x1f4)}));}async[a93_0x4fb191(0x217)](_0x532ae3){const _0x5eb7ab=a93_0x4fb191,_0x5b2b26=await this[_0x5eb7ab(0x1b8)][_0x5eb7ab(0x1f8)]('GET',_0x5eb7ab(0x192)+encodeURIComponent(_0x532ae3),{'headers':{'Accept':_0x5eb7ab(0x1cc)}});return _0x5b2b26[_0x5eb7ab(0x1fa)];}async['createExperimentalKnowledgeBase'](_0x35ef01){const _0x144961=a93_0x4fb191,_0x14f6bc={'data':{'type':_0x144961(0x1f4),'attributes':_0x35ef01}},_0x5f5941=await this['httpClient'][_0x144961(0x1f8)](_0x144961(0x216),_0x144961(0x21d),{'headers':{'Content-Type':_0x144961(0x1cc),'Accept':_0x144961(0x1cc)},'body':_0x14f6bc});return _0x5f5941[_0x144961(0x1fa)];}async[a93_0x4fb191(0x1ab)](_0xf13804,_0xf37427){const _0x39f0f2=a93_0x4fb191,_0xff4427={'data':{'type':'experimentalKnowledgeBases','id':_0xf13804,'attributes':_0xf37427}},_0x389c9c=await this[_0x39f0f2(0x1b8)][_0x39f0f2(0x1f8)](_0x39f0f2(0x1b0),'/api/experimental_knowledge_bases/'+encodeURIComponent(_0xf13804),{'headers':{'Content-Type':_0x39f0f2(0x1cc),'Accept':_0x39f0f2(0x1cc)},'body':_0xff4427});return _0x389c9c[_0x39f0f2(0x1fa)];}async['listExperimentalArtifacts'](_0x41eb23){const _0x5adbeb=a93_0x4fb191;return this[_0x5adbeb(0x1a7)](_0x5adbeb(0x20f)+encodeURIComponent(_0x41eb23)+_0x5adbeb(0x195));}async[a93_0x4fb191(0x1e3)](_0x42f244){const _0x4ec776=a93_0x4fb191,_0x1b0bb9=await this[_0x4ec776(0x1b8)]['request'](_0x4ec776(0x1f0),_0x4ec776(0x1d0)+encodeURIComponent(_0x42f244),{'headers':{'Accept':'application/vnd.api+json'}});return _0x1b0bb9[_0x4ec776(0x1fa)];}async['createExperimentalArtifact'](_0x362b00){const _0x43a0c7=a93_0x4fb191,_0x1e6a88={'data':{'type':_0x43a0c7(0x1d2),'attributes':_0x362b00}},_0x54cdf6=await this[_0x43a0c7(0x1b8)][_0x43a0c7(0x1f8)](_0x43a0c7(0x216),_0x43a0c7(0x213),{'headers':{'Content-Type':_0x43a0c7(0x1cc),'Accept':'application/vnd.api+json'},'body':_0x1e6a88});return _0x54cdf6[_0x43a0c7(0x1fa)];}async['updateExperimentalArtifact'](_0x58d327,_0x4ef61a){const _0x27cb15=a93_0x4fb191,_0x37b8ea={'data':{'type':'experimentalArtifacts','id':_0x58d327,'attributes':_0x4ef61a}},_0x577f4a=await this[_0x27cb15(0x1b8)][_0x27cb15(0x1f8)]('PATCH',_0x27cb15(0x1d0)+encodeURIComponent(_0x58d327),{'headers':{'Content-Type':_0x27cb15(0x1cc),'Accept':_0x27cb15(0x1cc)},'body':_0x37b8ea});return _0x577f4a[_0x27cb15(0x1fa)];}async[a93_0x4fb191(0x19e)](_0x54973f){const _0x39b129=a93_0x4fb191,_0x185118=await this[_0x39b129(0x1eb)](_0x54973f),_0x278dc5=[];for(const _0x326cd8 of _0x185118){const _0xeae165=_0x39b129(0x1ac)+encodeURIComponent(_0x326cd8['id']),_0x5157ee=await this[_0x39b129(0x1b8)][_0x39b129(0x1f8)]('GET',_0xeae165);_0x278dc5['push'](_0x5157ee[_0x39b129(0x1fa)]);}return _0x278dc5;}async[a93_0x4fb191(0x194)](_0x266c67){const _0x53b442=a93_0x4fb191,_0x1be4a7={'data':{'type':_0x53b442(0x201),'attributes':_0x266c67}},_0x1dbf98=await this['httpClient'][_0x53b442(0x1f8)]('POST',_0x53b442(0x1a8),{'headers':{'Content-Type':_0x53b442(0x1cc),'Accept':'application/vnd.api+json'},'body':_0x1be4a7});return _0x1dbf98['data'];}async[a93_0x4fb191(0x1a3)](_0x2f68ce,_0x1a8b2b){const _0x4313b4=a93_0x4fb191,_0x13e0a1={'data':{'type':_0x4313b4(0x201),'id':_0x2f68ce,'attributes':_0x1a8b2b}},_0x22fd9e=_0x4313b4(0x1ac)+encodeURIComponent(_0x2f68ce),_0x2a3aed=await this[_0x4313b4(0x1b8)][_0x4313b4(0x1f8)](_0x4313b4(0x1b0),_0x22fd9e,{'headers':{'Content-Type':_0x4313b4(0x1cc),'Accept':_0x4313b4(0x1cc)},'body':_0x13e0a1});return _0x2a3aed[_0x4313b4(0x1fa)];}async[a93_0x4fb191(0x214)](_0x332300,_0x34c265){const _0x4afaae=a93_0x4fb191,_0x205bfe={'data':{'type':_0x4afaae(0x19c),'id':_0x332300,'attributes':_0x34c265}},_0x3c4f71=_0x4afaae(0x1e9)+encodeURIComponent(_0x332300),_0x4f115e=await this['httpClient'][_0x4afaae(0x1f8)](_0x4afaae(0x1b0),_0x3c4f71,{'headers':{'Content-Type':_0x4afaae(0x1cc),'Accept':_0x4afaae(0x1cc)},'body':_0x205bfe});return _0x4f115e[_0x4afaae(0x1fa)];}async[a93_0x4fb191(0x20c)](_0x21fd88,_0x5a65db){const _0x4e8860=a93_0x4fb191,{jsonSchemaHint:_0x2c3663,..._0x57ffb8}=_0x5a65db,_0x5c2dae={'data':{'type':'prompts','id':_0x21fd88,'attributes':_0x57ffb8}},_0x5106b5='/api/prompts/'+encodeURIComponent(_0x21fd88),_0x441882=await this[_0x4e8860(0x1b8)][_0x4e8860(0x1f8)](_0x4e8860(0x1b0),_0x5106b5,{'headers':{'Content-Type':_0x4e8860(0x1cc),'Accept':_0x4e8860(0x1cc)},'body':_0x5c2dae});return _0x441882[_0x4e8860(0x1fa)];}async[a93_0x4fb191(0x1d7)](_0x163777,_0x5e4171){const _0x535a4b=a93_0x4fb191,_0xa2930e={'data':{'type':_0x535a4b(0x1b4),'id':_0x163777,'attributes':_0x5e4171}},_0x349349=_0x535a4b(0x208)+encodeURIComponent(_0x163777),_0x6b5c4b=await this[_0x535a4b(0x1b8)][_0x535a4b(0x1f8)](_0x535a4b(0x1b0),_0x349349,{'headers':{'Content-Type':_0x535a4b(0x1cc),'Accept':_0x535a4b(0x1cc)},'body':_0xa2930e});return _0x6b5c4b['data'];}async['deleteIntegration'](_0x37a8c9){const _0x2ebffa=a93_0x4fb191,_0x3b98e5='/api/integrations/'+encodeURIComponent(_0x37a8c9);await this[_0x2ebffa(0x1b8)][_0x2ebffa(0x1f8)](_0x2ebffa(0x1b3),_0x3b98e5);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x567b18,_0x5d78bc){const _0x4e32a1=a94_0x4092,_0x5423ec=_0x567b18();while(!![]){try{const _0x326954=parseInt(_0x4e32a1(0x158))/0x1*(parseInt(_0x4e32a1(0x162))/0x2)+parseInt(_0x4e32a1(0x15d))/0x3*(-parseInt(_0x4e32a1(0x15c))/0x4)+parseInt(_0x4e32a1(0x15f))/0x5+parseInt(_0x4e32a1(0x15a))/0x6+parseInt(_0x4e32a1(0x160))/0x7*(-parseInt(_0x4e32a1(0x15e))/0x8)+-parseInt(_0x4e32a1(0x159))/0x9+parseInt(_0x4e32a1(0x15b))/0xa;if(_0x326954===_0x5d78bc)break;else _0x5423ec['push'](_0x5423ec['shift']());}catch(_0x409d14){_0x5423ec['push'](_0x5423ec['shift']());}}}(a94_0x195c,0x361a2));function a94_0x4092(_0x5164bf,_0x3b769f){_0x5164bf=_0x5164bf-0x158;const _0x195c8a=a94_0x195c();let _0x4092cd=_0x195c8a[_0x5164bf];return _0x4092cd;}import{getOAuthClientId,postTokenRequest}from'../../core/oauth.js';function a94_0x195c(){const _0x386dfc=['/oauth/token','869770pQYcrI','1SqjfNS','3457665rhGTPM','677688kcRvgF','2623760ojVFXj','3772VrYPYY','555VKzCpQ','1108768XZvVBf','1929105fycBKC','21NNiEtk'];a94_0x195c=function(){return _0x386dfc;};return a94_0x195c();}export async function refreshAccessToken(_0x1c5603,_0x1e0264){const _0x44922b=a94_0x4092,_0x1ac3ac=_0x1c5603+_0x44922b(0x161);return postTokenRequest(_0x1ac3ac,{'grant_type':'refresh_token','client_id':getOAuthClientId(),'refresh_token':_0x1e0264});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a95_0x449a(){const _0x33acf2=['3089810GbnTlf','18lJYXll','getAvailableTokens','21msxFcf','refill','refillRate','tokens','574726HrFJyc','ceil','2194456QofvEM','maxTokens','acquire','max','now','2581555HKTRsv','5576328cTtVka','lastRefill','windowMs','maxRequests','6552076BqBHOQ','3nwMaqG','sleep','28152830rBqZqo','reset','min'];a95_0x449a=function(){return _0x33acf2;};return a95_0x449a();}const a95_0x1ecfbe=a95_0x4cd2;function a95_0x4cd2(_0x25181c,_0x9f2e8d){_0x25181c=_0x25181c-0xb4;const _0x449a87=a95_0x449a();let _0x4cd27e=_0x449a87[_0x25181c];return _0x4cd27e;}(function(_0x2d587f,_0x469742){const _0x26bcfc=a95_0x4cd2,_0x7f9586=_0x2d587f();while(!![]){try{const _0x139f8f=parseInt(_0x26bcfc(0xc0))/0x1+-parseInt(_0x26bcfc(0xb9))/0x2+-parseInt(_0x26bcfc(0xb4))/0x3*(-parseInt(_0x26bcfc(0xcc))/0x4)+-parseInt(_0x26bcfc(0xc7))/0x5*(-parseInt(_0x26bcfc(0xba))/0x6)+-parseInt(_0x26bcfc(0xbc))/0x7*(-parseInt(_0x26bcfc(0xc2))/0x8)+parseInt(_0x26bcfc(0xc8))/0x9+-parseInt(_0x26bcfc(0xb6))/0xa;if(_0x139f8f===_0x469742)break;else _0x7f9586['push'](_0x7f9586['shift']());}catch(_0x53e25a){_0x7f9586['push'](_0x7f9586['shift']());}}}(a95_0x449a,0xce0e3));export class RateLimiter{[a95_0x1ecfbe(0xbf)];[a95_0x1ecfbe(0xc9)];['maxTokens'];[a95_0x1ecfbe(0xbe)];constructor(_0xbc9ba){const _0x5cbb01=a95_0x1ecfbe;this['maxTokens']=_0xbc9ba['maxRequests'],this[_0x5cbb01(0xbf)]=_0xbc9ba[_0x5cbb01(0xcb)],this[_0x5cbb01(0xc9)]=Date[_0x5cbb01(0xc6)](),this[_0x5cbb01(0xbe)]=_0xbc9ba[_0x5cbb01(0xcb)]/_0xbc9ba[_0x5cbb01(0xca)];}async[a95_0x1ecfbe(0xc4)](){const _0x30442c=a95_0x1ecfbe;while(!![]){this[_0x30442c(0xbd)]();if(this[_0x30442c(0xbf)]>=0x1){this[_0x30442c(0xbf)]-=0x1;return;}const _0x24ccca=Math[_0x30442c(0xc5)](0x1,Math[_0x30442c(0xc1)](0x1/this[_0x30442c(0xbe)]));await this[_0x30442c(0xb5)](_0x24ccca);}}['tryAcquire'](){const _0x3c1caa=a95_0x1ecfbe;this[_0x3c1caa(0xbd)]();if(this[_0x3c1caa(0xbf)]>=0x1)return this[_0x3c1caa(0xbf)]-=0x1,!![];return![];}[a95_0x1ecfbe(0xbd)](){const _0x373e30=a95_0x1ecfbe,_0x50eee1=Date['now'](),_0x12bf89=_0x50eee1-this[_0x373e30(0xc9)];if(_0x12bf89>0x0){const _0x4cca1f=_0x12bf89*this[_0x373e30(0xbe)];this[_0x373e30(0xbf)]=Math[_0x373e30(0xb8)](this[_0x373e30(0xc3)],this[_0x373e30(0xbf)]+_0x4cca1f),this[_0x373e30(0xc9)]=_0x50eee1;}}[a95_0x1ecfbe(0xbb)](){const _0x57abbb=a95_0x1ecfbe;return this[_0x57abbb(0xbd)](),Math['floor'](this[_0x57abbb(0xbf)]);}[a95_0x1ecfbe(0xb7)](){const _0x46906a=a95_0x1ecfbe;this['tokens']=this['maxTokens'],this[_0x46906a(0xc9)]=Date[_0x46906a(0xc6)]();}[a95_0x1ecfbe(0xb5)](_0x78dfa6){return new Promise(_0x1e9c3f=>setTimeout(_0x1e9c3f,_0x78dfa6));}}export const defaultRateLimiter=new RateLimiter({'maxRequests':0x64,'windowMs':0xea60});
|