@treasuredata/tdx 0.14.2 → 0.14.4
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/api-command.js +1 -1
- package/dist/commands/auth-command.d.ts.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-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/llm-proxy.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/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/tables.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/profile.d.ts +15 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +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/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.d.ts +13 -2
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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/api.js +1 -1
- package/dist/sdk/client/cdp-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/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/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-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.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-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-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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.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/tree-formatter.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/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/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.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
|
|
1
|
+
const a67_0x1f6d3f=a67_0x156e;function a67_0x5031(){const _0x1742e0=['https://api-development-presto.treasuredata.com','https://api-presto.ap03.treasuredata.com','4668oXbnMu','https://llm-proxy.eu01.treasuredata.com','6kUoNGQ','https://api-presto.treasuredata.com','https://engage-api.ap03.treasuredata.com','https://api-staging-workflow.ap03.treasuredata.com','https://engage-api.treasuredata.com','https://console-development.treasuredata.com','https://console-staging-next.us01.treasuredata.com','https://api-staging-presto.treasuredata.com','https://api-development-cdp.us01.treasuredata.com','https://api-cdp.ap03.treasuredata.com','2665310eOzNAN','https://api.ap02.treasuredata.com','https://api-presto.ap02.treasuredata.com','https://console-next.','2455DSZrQN','https://console.treasuredata.com','https://api-workflow.eu01.treasuredata.com','https://llm-api-staging.ap03.treasuredata.com','https://console-next.eu01.treasuredata.com','https://api.treasuredata.co.jp','https://console-staging.ap03.treasuredata.com','https://console-development.eu01.treasuredata.com','https://llm-api.treasuredata.com','https://api-cdp.eu01.treasuredata.com','https://api-presto.treasuredata.co.jp','https://api-development.eu01.treasuredata.com','3644559tncdus','https://api-staging-presto.treasuredata.co.jp','/tc','No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27','.treasuredata.com','https://llm-proxy.ap02.treasuredata.com','/app/workflows/','https://llm-proxy-development.us01.treasuredata.com','/ag','https://console.eu01.treasuredata.com','https://api-staging-presto.ap03.treasuredata.com','https://api-staging-workflow.treasuredata.co.jp','88ZoiZXw','https://llm-proxy.us01.treasuredata.com','https://console.ap03.treasuredata.com','https://api-cdp.treasuredata.co.jp','https://engage-api-staging.treasuredata.co.jp','https://llm-proxy-development.eu01.treasuredata.com','3dGzgGo','29558bSEUdK','https://console-staging-next.ap03.treasuredata.com','https://api-workflow.treasuredata.co.jp','/attempt/','/sessions/','https://api-development-workflow.us01.treasuredata.com','https://llm-api-development.eu01.treasuredata.com','https://console-development-next.us01.treasuredata.com','https://api-workflow.treasuredata.com','https://api-workflow.ap03.treasuredata.com','\x27\x20and\x20site\x20\x27','1616MMDZXV','https://llm-api.eu01.treasuredata.com','https://api-development.treasuredata.com','/info','476312YPUSYb','/app/af/','https://api-workflow.ap02.treasuredata.com','https://llm-api.ap02.treasuredata.com','https://api-development-cdp.eu01.treasuredata.com','https://console-next.ap03.treasuredata.com','8337wRCjQB','https://console-development-next.eu01.treasuredata.com','https://console.ap02.treasuredata.com','https://api-staging-cdp.us01.treasuredata.com','https://console-next.us01.treasuredata.com','https://api-staging-cdp.treasuredata.co.jp','https://engage-api.treasuredata.co.jp','1771044SFXYJU','https://llm-api.treasuredata.co.jp','https://api-staging-cdp.ap03.treasuredata.com','https://engage-api-staging.ap03.treasuredata.com','https://console.treasuredata.co.jp','https://console-next.treasuredata.co.jp','https://api-presto.eu01.treasuredata.com','https://console-next.ap02.treasuredata.com','https://api-staging-workflow.us01.treasuredata.com','https://api-development-workflow.eu01.treasuredata.com','https://api.ap03.treasuredata.com','https://llm-api-development.us01.treasuredata.com','https://engage-api-development.eu01.treasuredata.com','https://console.','https://api.treasuredata.com','/ag/','https://llm-proxy-stage.us01.treasuredata.com'];a67_0x5031=function(){return _0x1742e0;};return a67_0x5031();}(function(_0x499c84,_0xba6c82){const _0x18d6fe=a67_0x156e,_0x38779e=_0x499c84();while(!![]){try{const _0x2eb7d5=-parseInt(_0x18d6fe(0xac))/0x1*(parseInt(_0x18d6fe(0xdd))/0x2)+parseInt(_0x18d6fe(0xab))/0x3*(-parseInt(_0x18d6fe(0xbb))/0x4)+parseInt(_0x18d6fe(0x8d))/0x5*(-parseInt(_0x18d6fe(0xdb))/0x6)+-parseInt(_0x18d6fe(0xc1))/0x7*(parseInt(_0x18d6fe(0xb7))/0x8)+-parseInt(_0x18d6fe(0x99))/0x9+parseInt(_0x18d6fe(0x89))/0xa+parseInt(_0x18d6fe(0xa5))/0xb*(parseInt(_0x18d6fe(0xc8))/0xc);if(_0x2eb7d5===_0xba6c82)break;else _0x38779e['push'](_0x38779e['shift']());}catch(_0x432829){_0x38779e['push'](_0x38779e['shift']());}}}(a67_0x5031,0x33be8));export const TD_ENDPOINTS={'us01':a67_0x1f6d3f(0xd6),'jp01':a67_0x1f6d3f(0x92),'eu01':'https://api.eu01.treasuredata.com','ap02':a67_0x1f6d3f(0x8a),'ap03':a67_0x1f6d3f(0xd2),'dev-us01':a67_0x1f6d3f(0xb9),'dev-eu01':a67_0x1f6d3f(0x98),'stg-us01':'https://api-staging.us01.treasuredata.com','stg-jp01':'https://api-staging.treasuredata.co.jp','stg-ap03':'https://api-staging.ap03.treasuredata.com'};export const CDP_ENDPOINTS={'us01':'https://api-cdp.treasuredata.com','jp01':a67_0x1f6d3f(0xa8),'eu01':a67_0x1f6d3f(0x96),'ap02':'https://api-cdp.ap02.treasuredata.com','ap03':a67_0x1f6d3f(0x88),'dev-us01':a67_0x1f6d3f(0x87),'dev-eu01':a67_0x1f6d3f(0xbf),'stg-us01':a67_0x1f6d3f(0xc4),'stg-jp01':a67_0x1f6d3f(0xc6),'stg-ap03':a67_0x1f6d3f(0xca)};export const WORKFLOW_ENDPOINTS={'us01':a67_0x1f6d3f(0xb4),'jp01':a67_0x1f6d3f(0xae),'eu01':a67_0x1f6d3f(0x8f),'ap02':a67_0x1f6d3f(0xbd),'ap03':a67_0x1f6d3f(0xb5),'dev-us01':a67_0x1f6d3f(0xb1),'dev-eu01':a67_0x1f6d3f(0xd1),'stg-us01':a67_0x1f6d3f(0xd0),'stg-jp01':a67_0x1f6d3f(0xa4),'stg-ap03':a67_0x1f6d3f(0x82)};export const TRINO_ENDPOINTS={'us01':a67_0x1f6d3f(0xde),'jp01':a67_0x1f6d3f(0x97),'eu01':a67_0x1f6d3f(0xce),'ap02':a67_0x1f6d3f(0x8b),'ap03':a67_0x1f6d3f(0xda),'dev-us01':a67_0x1f6d3f(0xd9),'dev-eu01':'https://api-development-presto.eu01.treasuredata.com','stg-us01':a67_0x1f6d3f(0x86),'stg-jp01':a67_0x1f6d3f(0x9a),'stg-ap03':a67_0x1f6d3f(0xa3)};export const LLM_ENDPOINTS={'us01':a67_0x1f6d3f(0x95),'jp01':a67_0x1f6d3f(0xc9),'eu01':a67_0x1f6d3f(0xb8),'ap02':a67_0x1f6d3f(0xbe),'ap03':'https://llm-api.ap03.treasuredata.com','dev-us01':a67_0x1f6d3f(0xd3),'dev-eu01':a67_0x1f6d3f(0xb2),'stg-us01':'https://llm-api-staging.us01.treasuredata.com','stg-jp01':'https://llm-api-staging.treasuredata.co.jp','stg-ap03':a67_0x1f6d3f(0x90)};export const LLM_PROXY_ENDPOINTS={'us01':a67_0x1f6d3f(0xa6),'jp01':'https://llm-proxy.treasuredata.co.jp','eu01':a67_0x1f6d3f(0xdc),'ap02':a67_0x1f6d3f(0x9e),'ap03':'https://llm-proxy.ap03.treasuredata.com','dev-us01':a67_0x1f6d3f(0xa0),'dev-eu01':a67_0x1f6d3f(0xaa),'stg-us01':a67_0x1f6d3f(0xd8),'stg-jp01':'https://llm-proxy-stage.treasuredata.co.jp','stg-ap03':'https://llm-proxy-stage.ap03.treasuredata.com'};export const ENGAGE_ENDPOINTS={'us01':a67_0x1f6d3f(0x83),'jp01':a67_0x1f6d3f(0xc7),'eu01':'https://engage-api.eu01.treasuredata.com','ap02':'https://engage-api.ap02.treasuredata.com','ap03':a67_0x1f6d3f(0xdf),'dev-us01':'https://engage-api-development.us01.treasuredata.com','dev-eu01':a67_0x1f6d3f(0xd4),'stg-us01':'https://engage-api-staging.us01.treasuredata.com','stg-jp01':a67_0x1f6d3f(0xa9),'stg-ap03':a67_0x1f6d3f(0xcb)};export const CONSOLE_ENDPOINTS={'us01':a67_0x1f6d3f(0x8e),'jp01':a67_0x1f6d3f(0xcc),'eu01':a67_0x1f6d3f(0xa2),'ap02':a67_0x1f6d3f(0xc3),'ap03':a67_0x1f6d3f(0xa7),'dev-us01':a67_0x1f6d3f(0x84),'dev-eu01':a67_0x1f6d3f(0x94),'stg-us01':'https://console-staging.us01.treasuredata.com','stg-jp01':'https://console-staging.treasuredata.co.jp','stg-ap03':a67_0x1f6d3f(0x93)};export const CONSOLE_NEXT_ENDPOINTS={'us01':a67_0x1f6d3f(0xc5),'jp01':a67_0x1f6d3f(0xcd),'eu01':a67_0x1f6d3f(0x91),'ap02':a67_0x1f6d3f(0xcf),'ap03':a67_0x1f6d3f(0xc0),'dev-us01':a67_0x1f6d3f(0xb3),'dev-eu01':a67_0x1f6d3f(0xc2),'stg-us01':a67_0x1f6d3f(0x85),'stg-jp01':'https://console-staging-next.treasuredata.co.jp','stg-ap03':a67_0x1f6d3f(0xad)};export function getConsoleUrl(_0xe2dd51,_0x2028c4){const _0xf890c5=a67_0x1f6d3f,_0x3fddd5=CONSOLE_ENDPOINTS[_0xe2dd51]||_0xf890c5(0xd5)+_0xe2dd51+_0xf890c5(0x9d);return _0x2028c4?''+_0x3fddd5+_0x2028c4:_0x3fddd5;}export function getConsoleNextUrl(_0x516fcd,_0x7dda19){const _0xc3cf95=a67_0x1f6d3f,_0x2f8fd7=CONSOLE_NEXT_ENDPOINTS[_0x516fcd]||_0xc3cf95(0x8c)+_0x516fcd+_0xc3cf95(0x9d);return _0x7dda19?''+_0x2f8fd7+_0x7dda19:_0x2f8fd7;}export function getLLMProjectUrl(_0x63a9df,_0x21f418){const _0xb36ccd=a67_0x1f6d3f;return getConsoleNextUrl(_0x63a9df,_0xb36ccd(0xbc)+_0x21f418+_0xb36ccd(0xa1));}export function getLLMAgentChatUrl(_0x5026b3,_0x4c570f,_0x4ebccd){const _0x49747a=a67_0x1f6d3f;return getConsoleNextUrl(_0x5026b3,_0x49747a(0xbc)+_0x4c570f+_0x49747a(0xd7)+_0x4ebccd+_0x49747a(0x9b));}export function getWorkflowUrl(_0x2f8a89,_0x1c2023){const _0x4ae9b4=a67_0x1f6d3f;return getConsoleUrl(_0x2f8a89,_0x4ae9b4(0x9f)+_0x1c2023+_0x4ae9b4(0xba));}function a67_0x156e(_0x2da5cc,_0x28665d){_0x2da5cc=_0x2da5cc-0x82;const _0x50312c=a67_0x5031();let _0x156ea1=_0x50312c[_0x2da5cc];return _0x156ea1;}export function getWorkflowSessionUrl(_0x2aa863,_0x4b3608,_0x2f0d41){const _0x4ac6cd=a67_0x1f6d3f;return getConsoleUrl(_0x2aa863,_0x4ac6cd(0x9f)+_0x4b3608+_0x4ac6cd(0xb0)+_0x2f0d41);}export function getWorkflowAttemptUrl(_0x2d6778,_0x3a5e6d,_0x6729cf,_0x1d5f82){const _0x4349e5=a67_0x1f6d3f;return getConsoleUrl(_0x2d6778,_0x4349e5(0x9f)+_0x3a5e6d+_0x4349e5(0xb0)+_0x6729cf+_0x4349e5(0xaf)+_0x1d5f82);}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 getEndpoint(_0x457840,_0x5af97f='td'){const _0x201536=a67_0x1f6d3f,_0x110107=API_ENDPOINTS[_0x5af97f]?.[_0x457840];if(!_0x110107)throw new Error(_0x201536(0x9c)+_0x5af97f+_0x201536(0xb6)+_0x457840+'\x27');return _0x110107;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a68_0x8fefa6=a68_0x1662;function a68_0x4735(){const _0x5cd449=['filter[workspaceId]','page[offset]','createTemplate','site','offset','filter[status]','/api/email_templates?','listCampaigns','/api/email_templates/','launchCampaign','emailTemplates','/api/email_templates','logger','getCampaign','/api/workspaces/','25378020ieNXNe','stringify','POST','/duplicate','6924879UubpmC','toString','engage','getWorkspace','849fOPLAL','DELETE','createCampaign','/pause','getTemplate','request','limit','createWorkspace','listTemplates','filter[campaignType]','/launch','10084896RFVfuO','campaignType','filter[owner_user.name]','filter[name]','/api/workspaces','httpClient','/resume','listWorkspaces','/api/campaigns','append','ownerName','deleteWorkspace','workspaces','3963438GzJOnM','PATCH','include','2424724UCVyAt','/api/campaigns?','7VEHPBi','10UAmQCR','pauseCampaign','workspaceId','application/vnd.api+json','page[limit]','updateCampaign','5982JMhjOx','name','campaigns','/api/campaigns/','resumeCampaign','GET','sort','duplicateCampaign','application/json','145066cECZrw'];a68_0x4735=function(){return _0x5cd449;};return a68_0x4735();}function a68_0x1662(_0x2255a3,_0x268b7f){_0x2255a3=_0x2255a3-0xe0;const _0x4735a9=a68_0x4735();let _0x16621c=_0x4735a9[_0x2255a3];return _0x16621c;}(function(_0x4d06aa,_0x1368a8){const _0x59b780=a68_0x1662,_0x4329dd=_0x4d06aa();while(!![]){try{const _0x440848=-parseInt(_0x59b780(0x114))/0x1+parseInt(_0x59b780(0x10b))/0x2*(parseInt(_0x59b780(0xe7))/0x3)+parseInt(_0x59b780(0x102))/0x4*(parseInt(_0x59b780(0x105))/0x5)+parseInt(_0x59b780(0xff))/0x6*(-parseInt(_0x59b780(0x104))/0x7)+parseInt(_0x59b780(0xf2))/0x8+parseInt(_0x59b780(0xe3))/0x9+-parseInt(_0x59b780(0x124))/0xa;if(_0x440848===_0x1368a8)break;else _0x4329dd['push'](_0x4329dd['shift']());}catch(_0x544250){_0x4329dd['push'](_0x4329dd['shift']());}}}(a68_0x4735,0xb5fc9));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class EngageApiClient{['httpClient'];constructor(_0x2ce85e){const _0x19c0bb=a68_0x1662,_0x2160c9=getEndpoint(_0x2ce85e[_0x19c0bb(0x118)],_0x19c0bb(0xe5)),_0x38afe2=toHeaderRecord(getAuthHeaders(_0x2ce85e['site'],_0x2ce85e['apiKey']));this[_0x19c0bb(0xf7)]=new HTTPClient(_0x2160c9,_0x38afe2,_0x2ce85e[_0x19c0bb(0x121)]);}async[a68_0x8fefa6(0x11c)](_0x291515={}){const _0x30cd7f=a68_0x8fefa6,_0x4de227=new URLSearchParams();_0x291515[_0x30cd7f(0xf3)]&&_0x4de227[_0x30cd7f(0xfb)](_0x30cd7f(0xf0),_0x291515[_0x30cd7f(0xf3)]);_0x291515['status']&&_0x4de227[_0x30cd7f(0xfb)](_0x30cd7f(0x11a),_0x291515['status']);_0x291515[_0x30cd7f(0x107)]&&_0x4de227['append']('filter[workspaceId]',_0x291515[_0x30cd7f(0x107)]);_0x291515['limit']!==undefined&&_0x4de227[_0x30cd7f(0xfb)](_0x30cd7f(0x109),_0x291515[_0x30cd7f(0xed)]['toString']());_0x291515[_0x30cd7f(0x119)]!==undefined&&_0x4de227[_0x30cd7f(0xfb)](_0x30cd7f(0x116),_0x291515[_0x30cd7f(0x119)][_0x30cd7f(0xe4)]());_0x291515[_0x30cd7f(0x111)]&&_0x4de227[_0x30cd7f(0xfb)](_0x30cd7f(0x111),_0x291515[_0x30cd7f(0x111)]);_0x291515['include']&&_0x4de227[_0x30cd7f(0xfb)](_0x30cd7f(0x101),_0x291515['include']);const _0x30369a=_0x4de227[_0x30cd7f(0xe4)](),_0x38b43c=_0x30369a?_0x30cd7f(0x103)+_0x30369a:_0x30cd7f(0xfa);return await this[_0x30cd7f(0xf7)][_0x30cd7f(0xec)](_0x30cd7f(0x110),_0x38b43c,{'headers':{'Accept':_0x30cd7f(0x108)}});}async[a68_0x8fefa6(0x122)](_0x1e66f8){const _0xaf2846=a68_0x8fefa6;return await this['httpClient'][_0xaf2846(0xec)]('GET','/api/campaigns/'+encodeURIComponent(_0x1e66f8),{'headers':{'Accept':_0xaf2846(0x108)}});}async[a68_0x8fefa6(0xe9)](_0x507d68){const _0x56095c=a68_0x8fefa6,_0x28d808={'data':{'type':_0x56095c(0x10d),'attributes':_0x507d68}};return await this[_0x56095c(0xf7)][_0x56095c(0xec)](_0x56095c(0xe1),_0x56095c(0xfa),{'headers':{'Content-Type':_0x56095c(0x108),'Accept':_0x56095c(0x108)},'body':JSON['stringify'](_0x28d808)});}async[a68_0x8fefa6(0x10a)](_0xd5f820,_0xb661fc){const _0x23da6d=a68_0x8fefa6,_0x162433={'data':{'type':_0x23da6d(0x10d),'id':_0xd5f820,'attributes':_0xb661fc}};return await this[_0x23da6d(0xf7)][_0x23da6d(0xec)](_0x23da6d(0x100),_0x23da6d(0x10e)+encodeURIComponent(_0xd5f820),{'headers':{'Content-Type':_0x23da6d(0x108),'Accept':_0x23da6d(0x108)},'body':JSON[_0x23da6d(0xe0)](_0x162433)});}async['deleteCampaign'](_0x2905c4){const _0x3f917f=a68_0x8fefa6;await this[_0x3f917f(0xf7)]['request'](_0x3f917f(0xe8),_0x3f917f(0x10e)+encodeURIComponent(_0x2905c4),{'headers':{'Accept':_0x3f917f(0x108)}});}async[a68_0x8fefa6(0x11e)](_0x5913f5){const _0x249d49=a68_0x8fefa6;await this[_0x249d49(0xf7)]['request']('POST',_0x249d49(0x10e)+encodeURIComponent(_0x5913f5)+_0x249d49(0xf1),{'headers':{'Content-Type':_0x249d49(0x113),'Accept':_0x249d49(0x113)},'body':JSON[_0x249d49(0xe0)]({})});}async[a68_0x8fefa6(0x106)](_0x432822){const _0x3fa63b=a68_0x8fefa6;await this[_0x3fa63b(0xf7)][_0x3fa63b(0xec)]('POST','/api/campaigns/'+encodeURIComponent(_0x432822)+_0x3fa63b(0xea),{'headers':{'Content-Type':_0x3fa63b(0x113),'Accept':_0x3fa63b(0x113)},'body':JSON[_0x3fa63b(0xe0)]({})});}async[a68_0x8fefa6(0x10f)](_0x32aff4){const _0x482040=a68_0x8fefa6;await this['httpClient'][_0x482040(0xec)]('POST',_0x482040(0x10e)+encodeURIComponent(_0x32aff4)+_0x482040(0xf8),{'headers':{'Content-Type':_0x482040(0x113),'Accept':'application/json'},'body':JSON[_0x482040(0xe0)]({})});}async[a68_0x8fefa6(0x112)](_0x40f041){const _0x2ff655=a68_0x8fefa6;return await this[_0x2ff655(0xf7)][_0x2ff655(0xec)]('POST',_0x2ff655(0x10e)+encodeURIComponent(_0x40f041)+_0x2ff655(0xe2),{'headers':{'Content-Type':_0x2ff655(0x113),'Accept':_0x2ff655(0x108)},'body':JSON['stringify']({})});}async[a68_0x8fefa6(0xef)](_0x309f46={}){const _0x34f6b2=a68_0x8fefa6,_0x38c6be=new URLSearchParams();_0x309f46[_0x34f6b2(0x107)]&&_0x38c6be[_0x34f6b2(0xfb)](_0x34f6b2(0x115),_0x309f46[_0x34f6b2(0x107)]);_0x309f46[_0x34f6b2(0xed)]!==undefined&&_0x38c6be[_0x34f6b2(0xfb)]('page[limit]',_0x309f46[_0x34f6b2(0xed)][_0x34f6b2(0xe4)]());_0x309f46[_0x34f6b2(0x119)]!==undefined&&_0x38c6be[_0x34f6b2(0xfb)]('page[offset]',_0x309f46[_0x34f6b2(0x119)][_0x34f6b2(0xe4)]());_0x309f46[_0x34f6b2(0x111)]&&_0x38c6be[_0x34f6b2(0xfb)](_0x34f6b2(0x111),_0x309f46[_0x34f6b2(0x111)]);const _0x4adcb3=_0x38c6be['toString'](),_0x13c1c2=_0x4adcb3?_0x34f6b2(0x11b)+_0x4adcb3:_0x34f6b2(0x120);return await this[_0x34f6b2(0xf7)][_0x34f6b2(0xec)](_0x34f6b2(0x110),_0x13c1c2,{'headers':{'Accept':_0x34f6b2(0x108)}});}async[a68_0x8fefa6(0xeb)](_0x129795){const _0x1b3b34=a68_0x8fefa6;return await this[_0x1b3b34(0xf7)][_0x1b3b34(0xec)](_0x1b3b34(0x110),_0x1b3b34(0x11d)+encodeURIComponent(_0x129795),{'headers':{'Accept':'application/vnd.api+json'}});}async[a68_0x8fefa6(0x117)](_0x521091){const _0xd32270=a68_0x8fefa6,_0x558d15={'data':{'type':_0xd32270(0x11f),'attributes':_0x521091}};return await this[_0xd32270(0xf7)][_0xd32270(0xec)](_0xd32270(0xe1),_0xd32270(0x120),{'headers':{'Content-Type':_0xd32270(0x108),'Accept':_0xd32270(0x108)},'body':JSON[_0xd32270(0xe0)](_0x558d15)});}async['updateTemplate'](_0x1a94dc,_0x105a73){const _0x558023=a68_0x8fefa6,_0x1f7c8c={'data':{'type':'emailTemplates','id':_0x1a94dc,'attributes':_0x105a73}};return await this[_0x558023(0xf7)][_0x558023(0xec)]('PATCH',_0x558023(0x11d)+encodeURIComponent(_0x1a94dc),{'headers':{'Content-Type':_0x558023(0x108),'Accept':_0x558023(0x108)},'body':JSON['stringify'](_0x1f7c8c)});}async['deleteTemplate'](_0x5c1fe5){const _0x1dd04=a68_0x8fefa6;await this[_0x1dd04(0xf7)][_0x1dd04(0xec)](_0x1dd04(0xe8),_0x1dd04(0x11d)+encodeURIComponent(_0x5c1fe5),{'headers':{'Accept':'application/vnd.api+json'}});}async[a68_0x8fefa6(0xf9)](_0x4c3576={}){const _0x296baa=a68_0x8fefa6,_0x3f97cf=new URLSearchParams();_0x4c3576['name']&&_0x3f97cf[_0x296baa(0xfb)](_0x296baa(0xf5),_0x4c3576[_0x296baa(0x10c)]);_0x4c3576[_0x296baa(0xfc)]&&_0x3f97cf[_0x296baa(0xfb)](_0x296baa(0xf4),_0x4c3576[_0x296baa(0xfc)]);_0x4c3576[_0x296baa(0xed)]!==undefined&&_0x3f97cf[_0x296baa(0xfb)]('page[limit]',_0x4c3576[_0x296baa(0xed)][_0x296baa(0xe4)]());_0x4c3576[_0x296baa(0x119)]!==undefined&&_0x3f97cf[_0x296baa(0xfb)]('page[offset]',_0x4c3576['offset'][_0x296baa(0xe4)]());_0x4c3576[_0x296baa(0x111)]&&_0x3f97cf[_0x296baa(0xfb)]('sort',_0x4c3576[_0x296baa(0x111)]);const _0x51565a=_0x3f97cf[_0x296baa(0xe4)](),_0x19b3fb=_0x51565a?'/api/workspaces?'+_0x51565a:_0x296baa(0xf6);return await this['httpClient'][_0x296baa(0xec)]('GET',_0x19b3fb,{'headers':{'Accept':'application/vnd.api+json'}});}async[a68_0x8fefa6(0xe6)](_0x233a73){const _0x338f2c=a68_0x8fefa6;return await this[_0x338f2c(0xf7)][_0x338f2c(0xec)]('GET',_0x338f2c(0x123)+encodeURIComponent(_0x233a73),{'headers':{'Accept':_0x338f2c(0x108)}});}async[a68_0x8fefa6(0xee)](_0x27aa36){const _0x25526a=a68_0x8fefa6,_0x3097c5={'data':{'type':_0x25526a(0xfe),'attributes':_0x27aa36}};return await this[_0x25526a(0xf7)][_0x25526a(0xec)]('POST',_0x25526a(0xf6),{'headers':{'Content-Type':_0x25526a(0x108),'Accept':_0x25526a(0x108)},'body':JSON[_0x25526a(0xe0)](_0x3097c5)});}async['updateWorkspace'](_0x39048a,_0x55d92c){const _0xaee4b0=a68_0x8fefa6,_0x1554d4={'data':{'type':_0xaee4b0(0xfe),'id':_0x39048a,'attributes':_0x55d92c}};return await this[_0xaee4b0(0xf7)][_0xaee4b0(0xec)]('PATCH',_0xaee4b0(0x123)+encodeURIComponent(_0x39048a),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0xaee4b0(0x108)},'body':JSON[_0xaee4b0(0xe0)](_0x1554d4)});}async[a68_0x8fefa6(0xfd)](_0xdd1159){const _0x5ea9d5=a68_0x8fefa6;await this[_0x5ea9d5(0xf7)][_0x5ea9d5(0xec)]('DELETE',_0x5ea9d5(0x123)+encodeURIComponent(_0xdd1159),{'headers':{'Accept':_0x5ea9d5(0x108)}});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a69_0x9a23=a69_0x2f3f;(function(_0x205658,_0x12f2c3){const _0x38ac2e=a69_0x2f3f,_0x16794e=_0x205658();while(!![]){try{const _0x2c7623=-parseInt(_0x38ac2e(0x1d2))/0x1*(-parseInt(_0x38ac2e(0x1c7))/0x2)+parseInt(_0x38ac2e(0x1c5))/0x3+parseInt(_0x38ac2e(0x20b))/0x4*(parseInt(_0x38ac2e(0x207))/0x5)+parseInt(_0x38ac2e(0x20f))/0x6+parseInt(_0x38ac2e(0x219))/0x7*(parseInt(_0x38ac2e(0x1c4))/0x8)+parseInt(_0x38ac2e(0x1f0))/0x9*(-parseInt(_0x38ac2e(0x1e1))/0xa)+-parseInt(_0x38ac2e(0x20e))/0xb*(parseInt(_0x38ac2e(0x218))/0xc);if(_0x2c7623===_0x12f2c3)break;else _0x16794e['push'](_0x16794e['shift']());}catch(_0x1fd6ed){_0x16794e['push'](_0x16794e['shift']());}}}(a69_0x4b18,0xe2ce5));function a69_0x2f3f(_0x1df70e,_0x2b5746){_0x1df70e=_0x1df70e-0x1be;const _0x4b1834=a69_0x4b18();let _0x2f3fcb=_0x4b1834[_0x1df70e];return _0x2f3fcb;}import{ErrorCode,SDKError}from'../errors.js';import a69_0x2f77b0 from'json-bigint';const DEFAULT_RETRY_CONFIG={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1f40};function isRetryableStatus(_0x4b30c1){return _0x4b30c1>=0x1f4||_0x4b30c1===0x1ad;}function isNonRetryable429(_0xf98d15){const _0x2f4844=a69_0x2f3f;return _0xf98d15[_0x2f4844(0x1ce)](_0x2f4844(0x1c3));}function a69_0x4b18(){const _0x4c0308=['756TgBDgd','14ULfInT','abort','logger','INTERNAL','An\x20error\x20occurred','string','\x20failed:\x20','already\x20running','2695720AaKgMm','1369674PiwaeP','extractErrorMessage','2NshoTD','NOT_FOUND','handleErrorResponse','request',']\x20Request\x20to\x20','pow','retrying\x20in\x20','includes',']\x20Request\x20failed\x20with\x20HTTP\x20','type','baseUrl','673245qrKQKF','Error','errors','maxDelay','info','maxRetries','sleep','statusText','combineSignals','PERMISSION_DENIED','error','defaultHeaders','RATE_LIMITED','retryConfig','title','70qlTHSt','debug','safeParseJSON','name','status','severity','stringify','Request\x20cancelled\x20by\x20user','from','Error\x20response\x20body:\x20','Content-Type','HTTP_REQUEST_FAILURE','ms...','request\x20body:\x20','instance','1089162gqXzVt','[Retry\x20','forEach','HTTPClientError','message','Request\x20to\x20','HTTP\x20','arrayBuffer','Request\x20failed\x20after\x20retries','code','get','length','round','min','aborted','signal','UNAVAILABLE','warn','AbortError','text','body','addEventListener','application/json','8816890QTEjQS','json','arraybuffer','detail','4KPnSUG','about:blank','parse','486343csESoR','5966586PrBlLM','problemDetails','INVALID_ARGUMENT',']\x20Request\x20failed\x20with\x20','headers','object','\x0a\x20\x20Details:\x20','[binary\x20data]','parseProblemDetails'];a69_0x4b18=function(){return _0x4c0308;};return a69_0x4b18();}function getRetryDelay(_0xb3de0c,_0xc7f860){const _0x478358=a69_0x2f3f,_0x107dbe=Math[_0x478358(0x1fd)](_0xc7f860['baseDelay']*Math[_0x478358(0x1cc)](0x2,_0xb3de0c),_0xc7f860[_0x478358(0x1d5)]);return Math['random']()*_0x107dbe;}function statusCodeToErrorCode(_0x25fc48){const _0x12445e=a69_0x2f3f;if(_0x25fc48===0x191)return ErrorCode['UNAUTHENTICATED'];else{if(_0x25fc48===0x193)return ErrorCode[_0x12445e(0x1db)];else{if(_0x25fc48===0x194)return ErrorCode[_0x12445e(0x1c8)];else{if(_0x25fc48===0x1ad)return ErrorCode[_0x12445e(0x1de)];else return _0x25fc48>=0x1f4?ErrorCode[_0x12445e(0x200)]:ErrorCode[_0x12445e(0x211)];}}}}export class HTTPClientError extends Error{[a69_0x9a23(0x1e5)];[a69_0x9a23(0x210)];[a69_0x9a23(0x1f9)];constructor(_0x5ac789,_0x4ab782,_0x4405d7){const _0x933184=a69_0x9a23,_0x5696b5=statusCodeToErrorCode(_0x4ab782);super('['+_0x5696b5+']\x20'+_0x5ac789),this[_0x933184(0x1e5)]=_0x4ab782,this[_0x933184(0x210)]=_0x4405d7,this[_0x933184(0x1e4)]=_0x933184(0x1f3),this['code']=_0x5696b5;}}export class HTTPClient{[a69_0x9a23(0x1df)];[a69_0x9a23(0x1d1)];[a69_0x9a23(0x1dd)];[a69_0x9a23(0x1be)];constructor(_0x2dceb7,_0x4afbb8,_0x52c896,_0x13bf00){const _0x53ee28=a69_0x9a23;this['baseUrl']=_0x2dceb7,this[_0x53ee28(0x1dd)]=_0x4afbb8,this[_0x53ee28(0x1df)]={...DEFAULT_RETRY_CONFIG,..._0x13bf00},this['logger']=_0x52c896;}async[a69_0x9a23(0x1ca)](_0x23420b,_0x1e7add,_0x88f7ed={}){const _0x5cafc8=a69_0x9a23,{headers:headers={},body:_0x9e645c,timeout:timeout=0x7530,retries:retries=this[_0x5cafc8(0x1df)][_0x5cafc8(0x1d7)],signal:_0x571854,includeHeaders:includeHeaders=![],responseType:responseType=_0x5cafc8(0x208)}=_0x88f7ed,_0x1814da=''+this[_0x5cafc8(0x1d1)]+_0x1e7add;this['logger'][_0x5cafc8(0x1d6)]('Request:\x20'+_0x23420b+'\x20'+_0x1814da);const _0xd02994={...this[_0x5cafc8(0x1dd)],...headers};if(_0x9e645c&&!_0xd02994[_0x5cafc8(0x1eb)]){if(_0x9e645c instanceof Buffer){}else _0xd02994[_0x5cafc8(0x1eb)]=_0x5cafc8(0x206);}let _0x2a12b7;_0x9e645c&&(_0x9e645c instanceof Buffer?_0x2a12b7=_0x9e645c:_0x2a12b7=typeof _0x9e645c===_0x5cafc8(0x1c1)?_0x9e645c:JSON[_0x5cafc8(0x1e7)](_0x9e645c));_0x2a12b7&&this[_0x5cafc8(0x1be)][_0x5cafc8(0x1e2)](_0x5cafc8(0x1ee)+(typeof _0x2a12b7===_0x5cafc8(0x1c1)?_0x2a12b7:_0x5cafc8(0x216)));let _0x28ea9e=null;for(let _0x502b43=0x0;_0x502b43<=retries;_0x502b43++){try{const _0x4f3b0a=new AbortController(),_0x55850e=setTimeout(()=>_0x4f3b0a[_0x5cafc8(0x21a)](),timeout);if(_0x571854){if(_0x571854[_0x5cafc8(0x1fe)])throw new Error(_0x5cafc8(0x1e8));_0x571854[_0x5cafc8(0x205)](_0x5cafc8(0x21a),()=>_0x4f3b0a[_0x5cafc8(0x21a)](),{'once':!![]});}const _0x8ac823=await fetch(_0x1814da,{'method':_0x23420b,'headers':_0xd02994,'body':_0x2a12b7,'signal':_0x4f3b0a[_0x5cafc8(0x1ff)]});clearTimeout(_0x55850e);if(_0x502b43<retries&&isRetryableStatus(_0x8ac823[_0x5cafc8(0x1e5)])){if(_0x8ac823[_0x5cafc8(0x1e5)]===0x1ad){const _0x483972=await _0x8ac823[_0x5cafc8(0x203)]();if(isNonRetryable429(_0x483972)){const _0x56d847=this[_0x5cafc8(0x1c6)](_0x483972)||_0x8ac823['statusText'];throw new HTTPClientError(_0x56d847,_0x8ac823[_0x5cafc8(0x1e5)]);}}const _0x2ed814=_0x8ac823['headers'][_0x5cafc8(0x1fa)]('Retry-After'),_0xda79c1=_0x2ed814?parseInt(_0x2ed814,0xa)*0x3e8:getRetryDelay(_0x502b43,this[_0x5cafc8(0x1df)]);console[_0x5cafc8(0x201)](_0x5cafc8(0x1f1)+(_0x502b43+0x1)+'/'+retries+_0x5cafc8(0x212)+_0x8ac823['status']+',\x20'+(_0x5cafc8(0x1cd)+Math[_0x5cafc8(0x1fc)](_0xda79c1)+_0x5cafc8(0x1ed))),await this[_0x5cafc8(0x1d8)](_0xda79c1);continue;}!_0x8ac823['ok']&&await this['handleErrorResponse'](_0x8ac823);let _0x271326;if(responseType===_0x5cafc8(0x209)){const _0x3a2bdd=await _0x8ac823[_0x5cafc8(0x1f7)]();_0x271326=Buffer[_0x5cafc8(0x1e9)](_0x3a2bdd);}else responseType===_0x5cafc8(0x203)?_0x271326=await _0x8ac823[_0x5cafc8(0x203)]():_0x271326=await this['safeParseJSON'](_0x8ac823);this['logger'][_0x5cafc8(0x1e2)]('Response\x20['+_0x8ac823[_0x5cafc8(0x1e5)]+']:\x20'+_0x23420b+'\x20'+_0x1e7add),this[_0x5cafc8(0x1be)]['trace'](JSON[_0x5cafc8(0x1e7)](_0x271326,null,0x2));if(includeHeaders){const _0x3d5344={};return _0x8ac823[_0x5cafc8(0x213)][_0x5cafc8(0x1f2)]((_0x37ea66,_0x4d975d)=>{_0x3d5344[_0x4d975d]=_0x37ea66;}),{'data':_0x271326,'status':_0x8ac823['status'],'headers':_0x3d5344};}return _0x271326;}catch(_0x3628a8){_0x28ea9e=_0x3628a8 instanceof Error?_0x3628a8:new Error(String(_0x3628a8));if(_0x3628a8 instanceof HTTPClientError){if(!isRetryableStatus(_0x3628a8['status'])||_0x3628a8[_0x5cafc8(0x1e5)]===0x1ad&&isNonRetryable429(_0x3628a8['message']))throw _0x3628a8;}if(_0x502b43>=retries)throw _0x28ea9e;const _0x4225e2=getRetryDelay(_0x502b43,this['retryConfig']);let _0x6e209f;_0x28ea9e instanceof HTTPClientError?_0x6e209f=_0x5cafc8(0x1f1)+(_0x502b43+0x1)+'/'+retries+_0x5cafc8(0x1cf)+_0x28ea9e[_0x5cafc8(0x1e5)]+':\x20'+_0x28ea9e[_0x5cafc8(0x1f4)]+',\x20'+(_0x5cafc8(0x1cd)+Math['round'](_0x4225e2)+_0x5cafc8(0x1ed)):_0x6e209f=_0x5cafc8(0x1f1)+(_0x502b43+0x1)+'/'+retries+_0x5cafc8(0x1cb)+_0x1814da+_0x5cafc8(0x1c2)+_0x28ea9e[_0x5cafc8(0x1f4)]+',\x20'+(_0x5cafc8(0x1cd)+Math[_0x5cafc8(0x1fc)](_0x4225e2)+_0x5cafc8(0x1ed)),console[_0x5cafc8(0x201)](_0x6e209f),await this[_0x5cafc8(0x1d8)](_0x4225e2);}}if(_0x28ea9e&&!(_0x28ea9e instanceof HTTPClientError))throw new SDKError(ErrorCode[_0x5cafc8(0x1ec)],_0x5cafc8(0x1f5)+_0x1814da+_0x5cafc8(0x1c2)+_0x28ea9e[_0x5cafc8(0x1f4)],_0x28ea9e);throw _0x28ea9e||new SDKError(ErrorCode[_0x5cafc8(0x1bf)],_0x5cafc8(0x1f8));}async['safeParseJSON'](_0x22899f){const _0x1281ea=a69_0x9a23,_0x4f7508=await _0x22899f[_0x1281ea(0x203)]();if(!_0x4f7508)return null;try{const _0xd7a7ff=a69_0x2f77b0({'storeAsString':!![]});return _0xd7a7ff[_0x1281ea(0x20d)](_0x4f7508);}catch{return{'body':_0x4f7508};}}['parseProblemDetails'](_0x14d636,_0x5dd266){const _0x595e54=a69_0x9a23;if(!_0x14d636||typeof _0x14d636!==_0x595e54(0x214))return undefined;let _0x51f83b=_0x14d636;_0x51f83b[_0x595e54(0x1d4)]&&typeof _0x51f83b[_0x595e54(0x1d4)]===_0x595e54(0x214)&&(_0x51f83b=_0x51f83b['errors']);if(_0x51f83b[_0x595e54(0x1d0)]||_0x51f83b['title']||_0x51f83b[_0x595e54(0x20a)])return{'type':_0x51f83b[_0x595e54(0x1d0)]||_0x595e54(0x20c),'title':_0x51f83b[_0x595e54(0x1e0)]||_0x595e54(0x1d3),'status':_0x51f83b[_0x595e54(0x1e5)]||_0x5dd266,'detail':_0x51f83b[_0x595e54(0x20a)]||_0x595e54(0x1c0),'instance':_0x51f83b[_0x595e54(0x1ef)]||'',..._0x51f83b};const _0x50c511=_0x51f83b[_0x595e54(0x1f4)]||_0x51f83b[_0x595e54(0x1dc)]||_0x51f83b[_0x595e54(0x203)];if(typeof _0x50c511==='string')return{'type':_0x595e54(0x20c),'title':_0x51f83b[_0x595e54(0x1e6)]||_0x595e54(0x1d3),'status':_0x51f83b['status_code']||_0x5dd266,'detail':_0x50c511,'instance':'',..._0x51f83b};return undefined;}async[a69_0x9a23(0x1c9)](_0x49595d){const _0x53d7d9=a69_0x9a23,_0x31d870=await this[_0x53d7d9(0x1e3)](_0x49595d),_0x45a307=this[_0x53d7d9(0x217)](_0x31d870,_0x49595d[_0x53d7d9(0x1e5)]);_0x31d870&&this[_0x53d7d9(0x1be)][_0x53d7d9(0x1e2)](_0x53d7d9(0x1ea)+JSON['stringify'](_0x31d870));let _0x10d27c;if(_0x45a307?.[_0x53d7d9(0x20a)])_0x10d27c=_0x45a307[_0x53d7d9(0x20a)];else _0x31d870?_0x10d27c='HTTP\x20'+_0x49595d[_0x53d7d9(0x1e5)]+':\x20'+_0x49595d['statusText']+_0x53d7d9(0x215)+JSON[_0x53d7d9(0x1e7)](_0x31d870):_0x10d27c=_0x53d7d9(0x1f6)+_0x49595d[_0x53d7d9(0x1e5)]+':\x20'+_0x49595d[_0x53d7d9(0x1d9)];throw new HTTPClientError(_0x10d27c,_0x49595d[_0x53d7d9(0x1e5)],_0x45a307);}['sleep'](_0x3a1d6a){return new Promise(_0x1bb411=>setTimeout(_0x1bb411,_0x3a1d6a));}[a69_0x9a23(0x1c6)](_0x51983d){const _0x5d4e96=a69_0x9a23;try{const _0x3c2465=JSON[_0x5d4e96(0x20d)](_0x51983d);return _0x3c2465[_0x5d4e96(0x20a)]||_0x3c2465[_0x5d4e96(0x1f4)]||_0x3c2465[_0x5d4e96(0x1dc)]||null;}catch{return _0x51983d[_0x5d4e96(0x1fb)]<0x1f4?_0x51983d:null;}}async['requestSSE'](_0x8e9407,_0x40bab9,_0xf0a0d2={}){const _0x531f7a=a69_0x9a23,{headers:headers={},body:_0x1347b9,timeout:timeout=0x7530,signal:_0xccaf02}=_0xf0a0d2,_0x8262=''+this[_0x531f7a(0x1d1)]+_0x40bab9,_0x204372={...this[_0x531f7a(0x1dd)],...headers},_0x4fd4e9=new AbortController(),_0x3a0f7f=setTimeout(()=>_0x4fd4e9[_0x531f7a(0x21a)](),timeout),_0x541ec5=_0xccaf02?[_0x4fd4e9['signal'],_0xccaf02]:[_0x4fd4e9[_0x531f7a(0x1ff)]],_0xa1fc0b=this[_0x531f7a(0x1da)](_0x541ec5);try{const _0x12484d={'method':_0x8e9407,'headers':_0x204372,'signal':_0xa1fc0b};if(_0x1347b9){if(typeof _0x1347b9===_0x531f7a(0x1c1))_0x12484d['body']=_0x1347b9;else _0x1347b9 instanceof Buffer?_0x12484d[_0x531f7a(0x204)]=_0x1347b9:_0x12484d['body']=JSON['stringify'](_0x1347b9);}const _0x13a4c2=await fetch(_0x8262,_0x12484d);return clearTimeout(_0x3a0f7f),!_0x13a4c2['ok']&&await this[_0x531f7a(0x1c9)](_0x13a4c2),_0x13a4c2;}catch(_0x1a9409){clearTimeout(_0x3a0f7f);if(_0x1a9409 instanceof HTTPClientError)throw _0x1a9409;if(_0x1a9409[_0x531f7a(0x1e4)]===_0x531f7a(0x202))throw new Error('Request\x20cancelled\x20by\x20user');throw _0x1a9409;}}[a69_0x9a23(0x1da)](_0x1d98bd){const _0x1c5690=a69_0x9a23,_0x1327b8=new AbortController();for(const _0x345f51 of _0x1d98bd){if(_0x345f51[_0x1c5690(0x1fe)])return _0x1327b8[_0x1c5690(0x21a)](),_0x1327b8[_0x1c5690(0x1ff)];_0x345f51['addEventListener']('abort',()=>_0x1327b8['abort'](),{'once':!![]});}return _0x1327b8[_0x1c5690(0x1ff)];}}
|
|
1
|
+
const a69_0x1a688b=a69_0x1aae;(function(_0x1f6ec9,_0x25b2e5){const _0x5da739=a69_0x1aae,_0x43baad=_0x1f6ec9();while(!![]){try{const _0x4605fa=parseInt(_0x5da739(0x1de))/0x1*(-parseInt(_0x5da739(0x1d6))/0x2)+-parseInt(_0x5da739(0x1bb))/0x3*(parseInt(_0x5da739(0x1b8))/0x4)+parseInt(_0x5da739(0x1c2))/0x5+-parseInt(_0x5da739(0x1db))/0x6+-parseInt(_0x5da739(0x1e7))/0x7+parseInt(_0x5da739(0x1cc))/0x8*(parseInt(_0x5da739(0x204))/0x9)+parseInt(_0x5da739(0x1d0))/0xa;if(_0x4605fa===_0x25b2e5)break;else _0x43baad['push'](_0x43baad['shift']());}catch(_0x158069){_0x43baad['push'](_0x43baad['shift']());}}}(a69_0x3e70,0xe0b3a));import{ErrorCode,SDKError}from'../errors.js';import a69_0x3d5a08 from'json-bigint';function a69_0x1aae(_0x450fe7,_0x4db638){_0x450fe7=_0x450fe7-0x1b7;const _0x3e7042=a69_0x3e70();let _0x1aaefa=_0x3e7042[_0x450fe7];return _0x1aaefa;}function a69_0x3e70(){const _0x11bcca=['132dlkGlj','Request\x20cancelled\x20by\x20user','warn','81234iqmmNG','An\x20error\x20occurred','text','Content-Type','\x20failed:\x20','signal','retrying\x20in\x20','3288315yneBvT','Error\x20response\x20body:\x20','logger','body','extractErrorMessage','handleErrorResponse','parseProblemDetails',']\x20Request\x20failed\x20with\x20HTTP\x20','length','Request\x20failed\x20after\x20retries','6438216OuqQCC','Request\x20to\x20','status','UNAUTHENTICATED','34558590jrNrJT','Error','requestSSE','AbortError','min','NOT_FOUND','2607316ghuZhx','defaultHeaders','error','info','severity','8550606tgLaVR',']\x20Request\x20to\x20','retryConfig','1emHxTY','application/json','string','ms...','baseUrl','RATE_LIMITED','get','INTERNAL','request\x20body:\x20','8262555BYHdQP','json','problemDetails','maxRetries','debug','Response\x20[','message','maxDelay','aborted','status_code','trace','[binary\x20data]','sleep',']\x20Request\x20failed\x20with\x20','abort','round','request','\x0a\x20\x20Details:\x20','object','Retry-After','Request:\x20','code','safeParseJSON','errors','PERMISSION_DENIED','[Retry\x20','statusText','stringify','includes','18UNPvVx','headers','name','addEventListener','type','detail','HTTPClientError','HTTP\x20','about:blank','forEach'];a69_0x3e70=function(){return _0x11bcca;};return a69_0x3e70();}const DEFAULT_RETRY_CONFIG={'maxRetries':0x3,'baseDelay':0x3e8,'maxDelay':0x1f40};function isRetryableStatus(_0x2ec3d3){return _0x2ec3d3>=0x1f4||_0x2ec3d3===0x1ad;}function isNonRetryable429(_0x1625de){const _0x4621f3=a69_0x1aae;return _0x1625de[_0x4621f3(0x203)]('already\x20running');}function getRetryDelay(_0x34dad2,_0xd3c229){const _0x4aab50=a69_0x1aae,_0x193d1b=Math[_0x4aab50(0x1d4)](_0xd3c229['baseDelay']*Math['pow'](0x2,_0x34dad2),_0xd3c229[_0x4aab50(0x1ee)]);return Math['random']()*_0x193d1b;}function statusCodeToErrorCode(_0x453174){const _0x11974a=a69_0x1aae;if(_0x453174===0x191)return ErrorCode[_0x11974a(0x1cf)];else{if(_0x453174===0x193)return ErrorCode[_0x11974a(0x1ff)];else{if(_0x453174===0x194)return ErrorCode[_0x11974a(0x1d5)];else{if(_0x453174===0x1ad)return ErrorCode[_0x11974a(0x1e3)];else return _0x453174>=0x1f4?ErrorCode['UNAVAILABLE']:ErrorCode['INVALID_ARGUMENT'];}}}}export class HTTPClientError extends Error{['status'];['problemDetails'];[a69_0x1a688b(0x1fc)];constructor(_0x329174,_0x1d3f8f,_0x12d0d7){const _0x549dcc=a69_0x1a688b,_0x235505=statusCodeToErrorCode(_0x1d3f8f);super('['+_0x235505+']\x20'+_0x329174),this['status']=_0x1d3f8f,this[_0x549dcc(0x1e9)]=_0x12d0d7,this[_0x549dcc(0x206)]=_0x549dcc(0x20a),this[_0x549dcc(0x1fc)]=_0x235505;}}export class HTTPClient{[a69_0x1a688b(0x1dd)];[a69_0x1a688b(0x1e2)];['defaultHeaders'];[a69_0x1a688b(0x1c4)];constructor(_0x319a22,_0x1583e1,_0x32a089,_0x1ad506){const _0x4ca08a=a69_0x1a688b;this['baseUrl']=_0x319a22,this['defaultHeaders']=_0x1583e1,this[_0x4ca08a(0x1dd)]={...DEFAULT_RETRY_CONFIG,..._0x1ad506},this['logger']=_0x32a089;}async[a69_0x1a688b(0x1f7)](_0x2965c8,_0x3d7912,_0x20c5e3={}){const _0x313a10=a69_0x1a688b,{headers:headers={},body:_0x3edbe5,timeout:timeout=0x7530,retries:retries=this[_0x313a10(0x1dd)][_0x313a10(0x1ea)],signal:_0x34de4d,includeHeaders:includeHeaders=![],responseType:responseType=_0x313a10(0x1e8)}=_0x20c5e3,_0x13240f=''+this['baseUrl']+_0x3d7912;this[_0x313a10(0x1c4)][_0x313a10(0x1d9)](_0x313a10(0x1fb)+_0x2965c8+'\x20'+_0x13240f);const _0x1e2a0b={...this[_0x313a10(0x1d7)],...headers};if(_0x3edbe5&&!_0x1e2a0b[_0x313a10(0x1be)]){if(_0x3edbe5 instanceof Buffer){}else _0x1e2a0b[_0x313a10(0x1be)]=_0x313a10(0x1df);}let _0x2b3f13;_0x3edbe5&&(_0x3edbe5 instanceof Buffer?_0x2b3f13=_0x3edbe5:_0x2b3f13=typeof _0x3edbe5===_0x313a10(0x1e0)?_0x3edbe5:JSON[_0x313a10(0x202)](_0x3edbe5));_0x2b3f13&&this['logger'][_0x313a10(0x1eb)](_0x313a10(0x1e6)+(typeof _0x2b3f13===_0x313a10(0x1e0)?_0x2b3f13:_0x313a10(0x1f2)));let _0x400d49=null;for(let _0x57c3bc=0x0;_0x57c3bc<=retries;_0x57c3bc++){try{const _0x2d3404=new AbortController(),_0x561200=setTimeout(()=>_0x2d3404['abort'](),timeout);if(_0x34de4d){if(_0x34de4d[_0x313a10(0x1ef)])throw new Error(_0x313a10(0x1b9));_0x34de4d[_0x313a10(0x207)]('abort',()=>_0x2d3404['abort'](),{'once':!![]});}const _0x2133d1=await fetch(_0x13240f,{'method':_0x2965c8,'headers':_0x1e2a0b,'body':_0x2b3f13,'signal':_0x2d3404[_0x313a10(0x1c0)]});clearTimeout(_0x561200);if(_0x57c3bc<retries&&isRetryableStatus(_0x2133d1[_0x313a10(0x1ce)])){if(_0x2133d1[_0x313a10(0x1ce)]===0x1ad){const _0x457d8d=await _0x2133d1['text']();if(isNonRetryable429(_0x457d8d)){const _0x159981=this['extractErrorMessage'](_0x457d8d)||_0x2133d1[_0x313a10(0x201)];throw new HTTPClientError(_0x159981,_0x2133d1[_0x313a10(0x1ce)]);}}const _0x30653b=_0x2133d1['headers'][_0x313a10(0x1e4)](_0x313a10(0x1fa)),_0x59264a=_0x30653b?parseInt(_0x30653b,0xa)*0x3e8:getRetryDelay(_0x57c3bc,this[_0x313a10(0x1dd)]);console['warn'](_0x313a10(0x200)+(_0x57c3bc+0x1)+'/'+retries+_0x313a10(0x1f4)+_0x2133d1[_0x313a10(0x1ce)]+',\x20'+(_0x313a10(0x1c1)+Math[_0x313a10(0x1f6)](_0x59264a)+_0x313a10(0x1e1))),await this['sleep'](_0x59264a);continue;}!_0x2133d1['ok']&&await this['handleErrorResponse'](_0x2133d1);let _0x370c25;if(responseType==='arraybuffer'){const _0x2aa4db=await _0x2133d1['arrayBuffer']();_0x370c25=Buffer['from'](_0x2aa4db);}else responseType===_0x313a10(0x1bd)?_0x370c25=await _0x2133d1[_0x313a10(0x1bd)]():_0x370c25=await this[_0x313a10(0x1fd)](_0x2133d1);this[_0x313a10(0x1c4)][_0x313a10(0x1eb)](_0x313a10(0x1ec)+_0x2133d1[_0x313a10(0x1ce)]+']:\x20'+_0x2965c8+'\x20'+_0x3d7912),this[_0x313a10(0x1c4)][_0x313a10(0x1f1)](JSON[_0x313a10(0x202)](_0x370c25,null,0x2));if(includeHeaders){const _0x3dc358={};return _0x2133d1[_0x313a10(0x205)][_0x313a10(0x1b7)]((_0x49e495,_0x5073d7)=>{_0x3dc358[_0x5073d7]=_0x49e495;}),{'data':_0x370c25,'status':_0x2133d1[_0x313a10(0x1ce)],'headers':_0x3dc358};}return _0x370c25;}catch(_0x1f4e6d){_0x400d49=_0x1f4e6d instanceof Error?_0x1f4e6d:new Error(String(_0x1f4e6d));if(_0x1f4e6d instanceof HTTPClientError){if(!isRetryableStatus(_0x1f4e6d[_0x313a10(0x1ce)])||_0x1f4e6d['status']===0x1ad&&isNonRetryable429(_0x1f4e6d['message']))throw _0x1f4e6d;}if(_0x57c3bc>=retries)throw _0x400d49;const _0x5a31eb=getRetryDelay(_0x57c3bc,this[_0x313a10(0x1dd)]);let _0x4294ce;_0x400d49 instanceof HTTPClientError?_0x4294ce=_0x313a10(0x200)+(_0x57c3bc+0x1)+'/'+retries+_0x313a10(0x1c9)+_0x400d49[_0x313a10(0x1ce)]+':\x20'+_0x400d49[_0x313a10(0x1ed)]+',\x20'+(_0x313a10(0x1c1)+Math[_0x313a10(0x1f6)](_0x5a31eb)+_0x313a10(0x1e1)):_0x4294ce=_0x313a10(0x200)+(_0x57c3bc+0x1)+'/'+retries+_0x313a10(0x1dc)+_0x13240f+_0x313a10(0x1bf)+_0x400d49['message']+',\x20'+(_0x313a10(0x1c1)+Math[_0x313a10(0x1f6)](_0x5a31eb)+_0x313a10(0x1e1)),console[_0x313a10(0x1ba)](_0x4294ce),await this[_0x313a10(0x1f3)](_0x5a31eb);}}if(_0x400d49&&!(_0x400d49 instanceof HTTPClientError))throw new SDKError(ErrorCode['HTTP_REQUEST_FAILURE'],_0x313a10(0x1cd)+_0x13240f+_0x313a10(0x1bf)+_0x400d49[_0x313a10(0x1ed)],_0x400d49);throw _0x400d49||new SDKError(ErrorCode[_0x313a10(0x1e5)],_0x313a10(0x1cb));}async[a69_0x1a688b(0x1fd)](_0x460abc){const _0x18c3ea=a69_0x1a688b,_0x4f09f0=await _0x460abc[_0x18c3ea(0x1bd)]();if(!_0x4f09f0)return null;try{const _0x5b738f=a69_0x3d5a08({'storeAsString':!![]});return _0x5b738f['parse'](_0x4f09f0);}catch{return{'body':_0x4f09f0};}}[a69_0x1a688b(0x1c8)](_0x251182,_0x4af9fc){const _0x48a941=a69_0x1a688b;if(!_0x251182||typeof _0x251182!==_0x48a941(0x1f9))return undefined;let _0x3d8d05=_0x251182;_0x3d8d05[_0x48a941(0x1fe)]&&typeof _0x3d8d05[_0x48a941(0x1fe)]===_0x48a941(0x1f9)&&(_0x3d8d05=_0x3d8d05[_0x48a941(0x1fe)]);if(_0x3d8d05[_0x48a941(0x208)]||_0x3d8d05['title']||_0x3d8d05['detail'])return{'type':_0x3d8d05[_0x48a941(0x208)]||_0x48a941(0x20c),'title':_0x3d8d05['title']||'Error','status':_0x3d8d05[_0x48a941(0x1ce)]||_0x4af9fc,'detail':_0x3d8d05['detail']||_0x48a941(0x1bc),'instance':_0x3d8d05['instance']||'',..._0x3d8d05};const _0x505cf5=_0x3d8d05[_0x48a941(0x1ed)]||_0x3d8d05['error']||_0x3d8d05[_0x48a941(0x1bd)];if(typeof _0x505cf5===_0x48a941(0x1e0))return{'type':'about:blank','title':_0x3d8d05[_0x48a941(0x1da)]||_0x48a941(0x1d1),'status':_0x3d8d05[_0x48a941(0x1f0)]||_0x4af9fc,'detail':_0x505cf5,'instance':'',..._0x3d8d05};return undefined;}async[a69_0x1a688b(0x1c7)](_0x1087f6){const _0x5c41c9=a69_0x1a688b,_0x745677=await this['safeParseJSON'](_0x1087f6),_0x41e9e7=this[_0x5c41c9(0x1c8)](_0x745677,_0x1087f6['status']);_0x745677&&this['logger'][_0x5c41c9(0x1eb)](_0x5c41c9(0x1c3)+JSON['stringify'](_0x745677));let _0x58d412;if(_0x41e9e7?.[_0x5c41c9(0x209)])_0x58d412=_0x41e9e7['detail'];else _0x745677?_0x58d412=_0x5c41c9(0x20b)+_0x1087f6[_0x5c41c9(0x1ce)]+':\x20'+_0x1087f6[_0x5c41c9(0x201)]+_0x5c41c9(0x1f8)+JSON[_0x5c41c9(0x202)](_0x745677):_0x58d412=_0x5c41c9(0x20b)+_0x1087f6[_0x5c41c9(0x1ce)]+':\x20'+_0x1087f6['statusText'];throw new HTTPClientError(_0x58d412,_0x1087f6[_0x5c41c9(0x1ce)],_0x41e9e7);}[a69_0x1a688b(0x1f3)](_0x3e6506){return new Promise(_0x3c2e03=>setTimeout(_0x3c2e03,_0x3e6506));}[a69_0x1a688b(0x1c6)](_0x5b704b){const _0x107d5a=a69_0x1a688b;try{const _0x130a1f=JSON['parse'](_0x5b704b);return _0x130a1f[_0x107d5a(0x209)]||_0x130a1f[_0x107d5a(0x1ed)]||_0x130a1f[_0x107d5a(0x1d8)]||null;}catch{return _0x5b704b[_0x107d5a(0x1ca)]<0x1f4?_0x5b704b:null;}}async[a69_0x1a688b(0x1d2)](_0x3e63d9,_0x52c880,_0x45807b={}){const _0x496b2c=a69_0x1a688b,{headers:headers={},body:_0x124def,timeout:timeout=0x7530,signal:_0x1ebef6}=_0x45807b,_0x3f1524=''+this[_0x496b2c(0x1e2)]+_0x52c880,_0x273a98={...this[_0x496b2c(0x1d7)],...headers},_0x549e48=new AbortController(),_0x18a87c=setTimeout(()=>_0x549e48[_0x496b2c(0x1f5)](),timeout),_0x3fcd0e=_0x1ebef6?[_0x549e48[_0x496b2c(0x1c0)],_0x1ebef6]:[_0x549e48[_0x496b2c(0x1c0)]],_0x3f3211=this['combineSignals'](_0x3fcd0e);try{const _0x597c12={'method':_0x3e63d9,'headers':_0x273a98,'signal':_0x3f3211};if(_0x124def){if(typeof _0x124def===_0x496b2c(0x1e0))_0x597c12[_0x496b2c(0x1c5)]=_0x124def;else _0x124def instanceof Buffer?_0x597c12[_0x496b2c(0x1c5)]=_0x124def:_0x597c12[_0x496b2c(0x1c5)]=JSON['stringify'](_0x124def);}const _0x51e5f0=await fetch(_0x3f1524,_0x597c12);return clearTimeout(_0x18a87c),!_0x51e5f0['ok']&&await this[_0x496b2c(0x1c7)](_0x51e5f0),_0x51e5f0;}catch(_0x49939a){clearTimeout(_0x18a87c);if(_0x49939a instanceof HTTPClientError)throw _0x49939a;if(_0x49939a['name']===_0x496b2c(0x1d3))throw new Error('Request\x20cancelled\x20by\x20user');throw _0x49939a;}}['combineSignals'](_0x4bbccc){const _0x3df168=a69_0x1a688b,_0x49c515=new AbortController();for(const _0x4944f7 of _0x4bbccc){if(_0x4944f7[_0x3df168(0x1ef)])return _0x49c515['abort'](),_0x49c515[_0x3df168(0x1c0)];_0x4944f7[_0x3df168(0x207)](_0x3df168(0x1f5),()=>_0x49c515[_0x3df168(0x1f5)](),{'once':!![]});}return _0x49c515['signal'];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a70_0x28b4f5=a70_0x4abe;(function(_0xdc49c7,_0x586500){const _0x142c12=a70_0x4abe,_0x26d6c3=_0xdc49c7();while(!![]){try{const _0x2576b0=parseInt(_0x142c12(0x13a))/0x1+-parseInt(_0x142c12(0x170))/0x2+-parseInt(_0x142c12(0x164))/0x3*(parseInt(_0x142c12(0x131))/0x4)+parseInt(_0x142c12(0x14e))/0x5*(-parseInt(_0x142c12(0x1a4))/0x6)+-parseInt(_0x142c12(0x161))/0x7+-parseInt(_0x142c12(0x1a7))/0x8+parseInt(_0x142c12(0x17e))/0x9;if(_0x2576b0===_0x586500)break;else _0x26d6c3['push'](_0x26d6c3['shift']());}catch(_0x323904){_0x26d6c3['push'](_0x26d6c3['shift']());}}}(a70_0x2295,0xcc9ca));import{HTTPClient}from'./http-client.js';function a70_0x4abe(_0x38fbc0,_0x26da68){_0x38fbc0=_0x38fbc0-0x12f;const _0x2295ba=a70_0x2295();let _0x4abe28=_0x2295ba[_0x38fbc0];return _0x4abe28;}function a70_0x2295(){const _0x10fdc4=['PATCH','/api/text_knowledge_bases','application/vnd.api+json','medium','listIntegrations','toString','\x20with\x20message\x20size:\x20','filters','Please\x20provide\x20a\x20non-empty\x20message\x20to\x20continue\x20the\x20chat.','3054406wCUjSC','/api/projects','starterMessage','apiKey','deleteProject','knowledge_bases','DELETE','/api/knowledge_bases/','You\x20are\x20a\x20helpful\x20search\x20assistant.','getChatHistory','/api/integrations','[Retry\x20','Message\x20cannot\x20be\x20empty\x20or\x20whitespace\x20only','/api/text_knowledge_bases/','45220572dMdAqf','projectId','http','/api/image_generators','-last_conversation_at','/api/users/current_settings','getUserSettings','createKnowledgeBase','createAgent','createWebSearchTool','listPrompts','listImageGenerators','listChats','agents','/api/chats?','deleteAgent','nova-canvas','LLM_EMPTY_MESSAGE','trim','/api/chats','page[limit]','links','createProject','httpClient','description','textKnowledgeBases','ms...',']\x20Streaming\x20SSE\x20stream\x20for\x20chatId:\x20','createIntegration','\x20attempts:\x20API\x20returned\x20empty\x20chat\x20ID','search','prompts','imageModelType','Failed\x20to\x20create\x20chat:\x20unexpected\x20error','approximate','chats','/api/integrations?filter[projectId]=','/api/knowledge_bases','12jqTmCS','append','/api/web_search_tools','10416048XNCmBe','LLM_STREAM_ERROR','systemPrompt','listProjects','startChat','/api/integrations/','agentId','Continuing\x20chat\x20','listAgents','4aBiSRW','request','/api/chats/','listWebSearchTools','application/json','getProject','Failed\x20to\x20create\x20chat\x20after\x20','Failed\x20to\x20continue\x20chat\x20(chatId:\x20','POST','1258413ABPiVW','requestSSE','map','/api/tool_targets?filter[targetType]=ImageGenerator&filter[project_id]=','modelType','sort','site','status','paginateAll','getTextKnowledgeBase','/api/knowledge_bases?filter[projectId]=','next','logger','/api/agents','updateTextKnowledgeBase','baseUrl','continueChat','imageGenerators','&page[limit]=50','imageReturnMode','2138010iBabDx','authHeaders','reasoningEffort','pathname','/api/projects/','LLM_CHAT_CREATION_FAILURE','/api/agents/','integrations','listKnowledgeBases','/history',',\x20message\x20length:\x20','length','userLocation','/continue','push','updateKnowledgeBase','name','debug','data','4419597gEfuuK','GET',']\x20Chat\x20creation\x20returned\x20empty\x20ID,\x20retrying\x20in\x20','3387141cwwNEu','webSearchTools','updatePrompt'];a70_0x2295=function(){return _0x10fdc4;};return a70_0x2295();}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';export class LLMApiClient{[a70_0x28b4f5(0x195)];['baseUrl'];[a70_0x28b4f5(0x14f)];[a70_0x28b4f5(0x146)];constructor(_0x5cd4bd,_0x21b1b2){const _0x286077=a70_0x28b4f5;this[_0x286077(0x149)]=getEndpoint(_0x5cd4bd[_0x286077(0x140)],'llm'),this[_0x286077(0x14f)]=toHeaderRecord(getAuthHeaders(_0x5cd4bd['site'],_0x5cd4bd[_0x286077(0x173)])),this['logger']=_0x21b1b2,this['httpClient']=new HTTPClient(this[_0x286077(0x149)],this[_0x286077(0x14f)],_0x21b1b2);}async[a70_0x28b4f5(0x142)](_0xc020ee){const _0x58f745=a70_0x28b4f5,_0x13ff6a=[];let _0x313a76=_0xc020ee;while(_0x313a76){const _0x2ce93f=await this[_0x58f745(0x195)][_0x58f745(0x132)](_0x58f745(0x162),_0x313a76);_0x2ce93f[_0x58f745(0x160)]&&_0x13ff6a[_0x58f745(0x15c)](..._0x2ce93f[_0x58f745(0x160)]);_0x313a76=_0x2ce93f[_0x58f745(0x193)]?.[_0x58f745(0x145)];if(_0x313a76&&_0x313a76['startsWith'](_0x58f745(0x180))){const _0x4d80eb=new URL(_0x313a76);_0x313a76=_0x4d80eb[_0x58f745(0x151)]+_0x4d80eb[_0x58f745(0x19c)];}}return _0x13ff6a;}async[a70_0x28b4f5(0x184)](){const _0x1b9e96=a70_0x28b4f5;return await this[_0x1b9e96(0x195)][_0x1b9e96(0x132)]('GET',_0x1b9e96(0x183));}async[a70_0x28b4f5(0x194)](_0x425aa4){const _0x201b7b=a70_0x28b4f5,_0x3cfee8={'data':{'type':'projects','attributes':{'name':_0x425aa4[_0x201b7b(0x15e)],..._0x425aa4[_0x201b7b(0x196)]&&{'description':_0x425aa4['description']}}}},_0x46b878=await this[_0x201b7b(0x195)][_0x201b7b(0x132)](_0x201b7b(0x139),_0x201b7b(0x171),{'headers':{'Content-Type':_0x201b7b(0x169),'Accept':_0x201b7b(0x169)},'body':_0x3cfee8});return _0x46b878[_0x201b7b(0x160)];}async[a70_0x28b4f5(0x174)](_0x27a62b){const _0x275bd7=a70_0x28b4f5,_0x1f17aa=_0x275bd7(0x152)+encodeURIComponent(_0x27a62b);await this['httpClient'][_0x275bd7(0x132)]('DELETE',_0x1f17aa);}async[a70_0x28b4f5(0x1aa)](_0x121b3e=0x32){const _0x503ca0=a70_0x28b4f5;return this[_0x503ca0(0x142)]('/api/projects?page[limit]='+_0x121b3e);}async[a70_0x28b4f5(0x130)](_0x457510){const _0x37cb44=a70_0x28b4f5;let _0xa8de9e=_0x37cb44(0x147);_0x457510&&(_0xa8de9e+='?filter[project_id]='+encodeURIComponent(_0x457510));const _0x1f66c3=await this[_0x37cb44(0x195)][_0x37cb44(0x132)](_0x37cb44(0x162),_0xa8de9e);return _0x1f66c3[_0x37cb44(0x160)]||[];}async['getAgent'](_0x1cb7b4){const _0x565ca4=a70_0x28b4f5,_0x1ddbec='/api/agents/'+encodeURIComponent(_0x1cb7b4),_0x46d50b=await this[_0x565ca4(0x195)][_0x565ca4(0x132)](_0x565ca4(0x162),_0x1ddbec);return _0x46d50b[_0x565ca4(0x160)];}async[a70_0x28b4f5(0x186)](_0x26cda2){const _0x208476=a70_0x28b4f5,_0x4d0ff7={'name':_0x26cda2[_0x208476(0x15e)],'projectId':_0x26cda2[_0x208476(0x17f)],'modelType':_0x26cda2[_0x208476(0x13e)],'maxToolIterations':_0x26cda2['maxToolIterations']??0x4,'temperature':_0x26cda2['temperature']??0.7};_0x26cda2[_0x208476(0x1a9)]!==undefined&&(_0x4d0ff7[_0x208476(0x1a9)]=_0x26cda2[_0x208476(0x1a9)]);_0x26cda2[_0x208476(0x172)]&&(_0x4d0ff7[_0x208476(0x172)]=_0x26cda2[_0x208476(0x172)]);_0x26cda2[_0x208476(0x150)]&&(_0x4d0ff7['reasoningEffort']=_0x26cda2[_0x208476(0x150)]);const _0x1034aa={'data':{'type':_0x208476(0x18b),'attributes':_0x4d0ff7}},_0x4ed139=await this[_0x208476(0x195)][_0x208476(0x132)](_0x208476(0x139),_0x208476(0x147),{'headers':{'Content-Type':_0x208476(0x169),'Accept':_0x208476(0x169)},'body':_0x1034aa});return _0x4ed139['data'];}async['updateAgent'](_0x21c4e9,_0x2ab7ad){const _0x4cae0c=a70_0x28b4f5,_0x30167a={'data':{'type':_0x4cae0c(0x18b),'id':_0x21c4e9,'attributes':{..._0x2ab7ad['name']&&{'name':_0x2ab7ad[_0x4cae0c(0x15e)]},..._0x2ab7ad[_0x4cae0c(0x196)]&&{'description':_0x2ab7ad['description']},..._0x2ab7ad['prompt']&&{'prompt':_0x2ab7ad['prompt']},..._0x2ab7ad[_0x4cae0c(0x172)]&&{'starter_message':_0x2ab7ad[_0x4cae0c(0x172)]},..._0x2ab7ad[_0x4cae0c(0x150)]&&{'reasoningEffort':_0x2ab7ad[_0x4cae0c(0x150)]}}}},_0x573d48='/api/agents/'+encodeURIComponent(_0x21c4e9),_0x5811e5=await this[_0x4cae0c(0x195)][_0x4cae0c(0x132)]('PATCH',_0x573d48,{'body':_0x30167a});return _0x5811e5[_0x4cae0c(0x160)];}async[a70_0x28b4f5(0x18d)](_0x1b44ef){const _0x254ad9=a70_0x28b4f5,_0x2881d4=_0x254ad9(0x154)+encodeURIComponent(_0x1b44ef);await this[_0x254ad9(0x195)]['request'](_0x254ad9(0x176),_0x2881d4);}async[a70_0x28b4f5(0x18a)](_0x413405=0x32){const _0x10d73f=a70_0x28b4f5,_0x3fbd60=new URLSearchParams();_0x3fbd60['append'](_0x10d73f(0x192),String(_0x413405)),_0x3fbd60[_0x10d73f(0x1a5)](_0x10d73f(0x13f),_0x10d73f(0x182));const _0x35d291=_0x10d73f(0x18c)+_0x3fbd60[_0x10d73f(0x16c)](),_0x18481b=await this[_0x10d73f(0x195)][_0x10d73f(0x132)](_0x10d73f(0x162),_0x35d291);return _0x18481b['data']||[];}async['getChatInfo'](_0x419083){const _0x5763a5=a70_0x28b4f5,_0x3a0387=_0x5763a5(0x133)+encodeURIComponent(_0x419083),_0x3a439d=await this['httpClient'][_0x5763a5(0x132)](_0x5763a5(0x162),_0x3a0387);return _0x3a439d['data'];}async[a70_0x28b4f5(0x179)](_0x2e4481){const _0x438787=a70_0x28b4f5,_0x124483=_0x438787(0x133)+encodeURIComponent(_0x2e4481)+_0x438787(0x157);return await this[_0x438787(0x195)][_0x438787(0x132)](_0x438787(0x162),_0x124483);}async[a70_0x28b4f5(0x1ab)](_0xe15cae){const _0x2699fa=a70_0x28b4f5,_0x368745={'data':{'type':_0x2699fa(0x1a1),'attributes':{'agentId':_0xe15cae[_0x2699fa(0x1ad)]}}},_0x52cec6=0x3,_0x489207=[0x3e8,0x7d0,0xfa0];for(let _0x14bbdc=0x0;_0x14bbdc<=_0x52cec6;_0x14bbdc++){const _0x9a0922=await this[_0x2699fa(0x195)][_0x2699fa(0x132)]('POST',_0x2699fa(0x191),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x2699fa(0x169)},'body':_0x368745});if(_0x9a0922[_0x2699fa(0x160)]&&_0x9a0922[_0x2699fa(0x160)]['id'])return _0x9a0922[_0x2699fa(0x160)];if(_0x14bbdc>=_0x52cec6)throw new SDKError(ErrorCode[_0x2699fa(0x153)],_0x2699fa(0x137)+(_0x52cec6+0x1)+_0x2699fa(0x19b));const _0x353f13=_0x489207[_0x14bbdc];console['warn'](_0x2699fa(0x17b)+(_0x14bbdc+0x1)+'/'+_0x52cec6+_0x2699fa(0x163)+_0x353f13+_0x2699fa(0x198)),await new Promise(_0x2feceb=>setTimeout(_0x2feceb,_0x353f13));}throw new SDKError(ErrorCode[_0x2699fa(0x153)],_0x2699fa(0x19f));}async*[a70_0x28b4f5(0x14a)](_0x512e93,_0x2f0a8b,_0x121e49){const _0x5b33ec=a70_0x28b4f5,_0x5b2d27=_0x2f0a8b[_0x5b33ec(0x190)]();if(!_0x5b2d27)throw new SDKError(ErrorCode[_0x5b33ec(0x18f)],_0x5b33ec(0x17c),undefined,{'helpText':_0x5b33ec(0x16f)});this['logger'][_0x5b33ec(0x15f)](_0x5b33ec(0x12f)+_0x512e93+_0x5b33ec(0x16d)+_0x2f0a8b['length']+'\x20characters');const _0xfe5d90=_0x5b33ec(0x133)+encodeURIComponent(_0x512e93)+_0x5b33ec(0x15b),_0x2a8f9b={'input':_0x2f0a8b};try{const _0x261c1d=await this[_0x5b33ec(0x195)][_0x5b33ec(0x13b)](_0x5b33ec(0x139),_0xfe5d90,{'headers':{'Content-Type':_0x5b33ec(0x135),'Accept':'text/event-stream'},'body':_0x2a8f9b,'signal':_0x121e49});this['logger'][_0x5b33ec(0x15f)]('['+_0x261c1d[_0x5b33ec(0x141)]+_0x5b33ec(0x199)+_0x512e93),yield*parseSSEStream(_0x261c1d,this[_0x5b33ec(0x146)]);}catch(_0x3b91e7){throw new SDKError(ErrorCode[_0x5b33ec(0x1a8)],_0x5b33ec(0x138)+_0x512e93+_0x5b33ec(0x158)+_0x2f0a8b[_0x5b33ec(0x159)]+')',_0x3b91e7);}}async[a70_0x28b4f5(0x136)](_0x2e2970){const _0x5688e6=a70_0x28b4f5,_0x526b8b='/api/projects/'+encodeURIComponent(_0x2e2970),_0xf721fb=await this[_0x5688e6(0x195)][_0x5688e6(0x132)]('GET',_0x526b8b);return _0xf721fb[_0x5688e6(0x160)];}async[a70_0x28b4f5(0x156)](_0x3cbcfc){const _0x2affe1=a70_0x28b4f5;return this[_0x2affe1(0x142)](_0x2affe1(0x144)+encodeURIComponent(_0x3cbcfc)+_0x2affe1(0x14c));}async[a70_0x28b4f5(0x185)](_0x2d4982){const _0x3574a5=a70_0x28b4f5,_0x47c0e6={'data':{'type':_0x3574a5(0x175),'attributes':_0x2d4982}},_0x5bdf4f=await this[_0x3574a5(0x195)][_0x3574a5(0x132)](_0x3574a5(0x139),_0x3574a5(0x1a3),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x3574a5(0x169)},'body':_0x47c0e6});return _0x5bdf4f['data'];}async['listTextKnowledgeBases'](_0x50bb02){const _0x342d75=a70_0x28b4f5,_0x180380=await this[_0x342d75(0x142)]('/api/tool_targets?filter[targetType]=TextKnowledgeBase&filter[project_id]='+encodeURIComponent(_0x50bb02)+_0x342d75(0x14c));return _0x180380[_0x342d75(0x13c)](_0x5c6356=>({..._0x5c6356,'type':_0x342d75(0x197)}));}async[a70_0x28b4f5(0x143)](_0x4337d9){const _0x3689ff=a70_0x28b4f5,_0x2c10bc=await this[_0x3689ff(0x195)][_0x3689ff(0x132)](_0x3689ff(0x162),'/api/text_knowledge_bases/'+encodeURIComponent(_0x4337d9),{'headers':{'Accept':_0x3689ff(0x169)}});return _0x2c10bc[_0x3689ff(0x160)];}async['createTextKnowledgeBase'](_0x5682cc){const _0x509b17=a70_0x28b4f5,_0x3fb062={'data':{'type':_0x509b17(0x197),'attributes':_0x5682cc}},_0xa393ab=await this[_0x509b17(0x195)][_0x509b17(0x132)]('POST',_0x509b17(0x168),{'headers':{'Content-Type':_0x509b17(0x169),'Accept':_0x509b17(0x169)},'body':_0x3fb062});return _0xa393ab[_0x509b17(0x160)];}async[a70_0x28b4f5(0x148)](_0x49bdf4,_0x328875){const _0x5604b6=a70_0x28b4f5,_0x2bffbd={'data':{'type':'textKnowledgeBases','id':_0x49bdf4,'attributes':_0x328875}},_0x4162ab=await this[_0x5604b6(0x195)][_0x5604b6(0x132)]('PATCH',_0x5604b6(0x17d)+encodeURIComponent(_0x49bdf4),{'headers':{'Content-Type':_0x5604b6(0x169),'Accept':_0x5604b6(0x169)},'body':_0x2bffbd});return _0x4162ab[_0x5604b6(0x160)];}async['createImageGenerator'](_0x5965be){const _0x5afefe=a70_0x28b4f5,_0x5ca04a={'data':{'type':_0x5afefe(0x14b),'attributes':{..._0x5965be,'imageModelType':_0x5965be[_0x5afefe(0x19e)]||_0x5afefe(0x18e),'imageReturnMode':_0x5965be[_0x5afefe(0x14d)]||'ID'}}},_0x3121ae=await this[_0x5afefe(0x195)][_0x5afefe(0x132)](_0x5afefe(0x139),_0x5afefe(0x181),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x5afefe(0x169)},'body':_0x5ca04a});return _0x3121ae[_0x5afefe(0x160)];}async[a70_0x28b4f5(0x187)](_0x490744){const _0x906f60=a70_0x28b4f5,_0x10531e={'data':{'type':'webSearchTools','attributes':{'projectId':_0x490744[_0x906f60(0x17f)],'name':_0x490744[_0x906f60(0x15e)],'modelType':_0x490744[_0x906f60(0x13e)]||'gpt-4o','searchContextSize':_0x490744['searchContextSize']||_0x906f60(0x16a),'userLocation':_0x490744[_0x906f60(0x15a)]||{'type':_0x906f60(0x1a0),'country':'US','city':'San\x20Francisco','region':'California','timezone':'America/Los_Angeles'},'systemPrompt':_0x490744[_0x906f60(0x1a9)]||_0x906f60(0x178),'filters':_0x490744[_0x906f60(0x16e)]||{'allowed_domains':[]}}}},_0x584b7c=await this[_0x906f60(0x195)][_0x906f60(0x132)](_0x906f60(0x139),_0x906f60(0x1a6),{'headers':{'Content-Type':_0x906f60(0x169),'Accept':_0x906f60(0x169)},'body':_0x10531e});return _0x584b7c[_0x906f60(0x160)];}async[a70_0x28b4f5(0x189)](_0x31a317){const _0x52435f=a70_0x28b4f5,_0x37dd80=await this[_0x52435f(0x142)](_0x52435f(0x13d)+encodeURIComponent(_0x31a317)+_0x52435f(0x14c));return _0x37dd80['map'](_0x51f55f=>({..._0x51f55f,'type':'imageGenerators'}));}async[a70_0x28b4f5(0x134)](_0x45095d){const _0x320e20=a70_0x28b4f5,_0x48e1e0=await this[_0x320e20(0x142)]('/api/tool_targets?filter[targetType]=WebSearchTool&filter[project_id]='+encodeURIComponent(_0x45095d)+_0x320e20(0x14c));return _0x48e1e0[_0x320e20(0x13c)](_0x179b56=>({..._0x179b56,'type':_0x320e20(0x165)}));}async[a70_0x28b4f5(0x188)](_0x5367ab){const _0x3418a2=a70_0x28b4f5;return this['paginateAll']('/api/prompts?filter[projectId]='+encodeURIComponent(_0x5367ab)+_0x3418a2(0x14c));}async['createPrompt'](_0x276bbf){const _0x2f46cd=a70_0x28b4f5,{jsonSchemaHint:_0x532071,..._0x450982}=_0x276bbf,_0x3f9a40={'data':{'type':'prompts','attributes':_0x450982}},_0x299ade=await this[_0x2f46cd(0x195)][_0x2f46cd(0x132)]('POST','/api/prompts',{'headers':{'Content-Type':_0x2f46cd(0x169),'Accept':_0x2f46cd(0x169)},'body':_0x3f9a40});return _0x299ade[_0x2f46cd(0x160)];}async[a70_0x28b4f5(0x16b)](_0x4ec2f6){const _0x56a53e=a70_0x28b4f5;return this['paginateAll'](_0x56a53e(0x1a2)+encodeURIComponent(_0x4ec2f6)+_0x56a53e(0x14c));}async[a70_0x28b4f5(0x19a)](_0x55d48f){const _0x511cd9=a70_0x28b4f5,_0x566895={'data':{'type':_0x511cd9(0x155),'attributes':_0x55d48f}},_0xe142c6=await this[_0x511cd9(0x195)][_0x511cd9(0x132)](_0x511cd9(0x139),_0x511cd9(0x17a),{'headers':{'Content-Type':_0x511cd9(0x169),'Accept':_0x511cd9(0x169)},'body':_0x566895});return _0xe142c6[_0x511cd9(0x160)];}async['listAgentsFull'](_0x41dee7){const _0x3ec858=a70_0x28b4f5,_0x40d551=await this['listAgents'](_0x41dee7),_0x4f32a7=[];for(const _0x352cc2 of _0x40d551){const _0x2e13c3=_0x3ec858(0x154)+encodeURIComponent(_0x352cc2['id']),_0x3ff7d7=await this[_0x3ec858(0x195)][_0x3ec858(0x132)](_0x3ec858(0x162),_0x2e13c3);_0x4f32a7['push'](_0x3ff7d7['data']);}return _0x4f32a7;}async['createAgentResponse'](_0xb7b941){const _0x5594a5=a70_0x28b4f5,_0x32508a={'data':{'type':_0x5594a5(0x18b),'attributes':_0xb7b941}},_0x12081d=await this['httpClient'][_0x5594a5(0x132)]('POST','/api/agents',{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x5594a5(0x169)},'body':_0x32508a});return _0x12081d['data'];}async['updateAgentResponse'](_0x29e192,_0x38aeb7){const _0x3707f4=a70_0x28b4f5,_0x49d80a={'data':{'type':'agents','id':_0x29e192,'attributes':_0x38aeb7}},_0x40a713=_0x3707f4(0x154)+encodeURIComponent(_0x29e192),_0x226807=await this[_0x3707f4(0x195)][_0x3707f4(0x132)]('PATCH',_0x40a713,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x3707f4(0x169)},'body':_0x49d80a});return _0x226807[_0x3707f4(0x160)];}async[a70_0x28b4f5(0x15d)](_0x4f7254,_0x2ff2a9){const _0x13b238=a70_0x28b4f5,_0x6371f0={'data':{'type':_0x13b238(0x175),'id':_0x4f7254,'attributes':_0x2ff2a9}},_0x4c3331=_0x13b238(0x177)+encodeURIComponent(_0x4f7254),_0x24b461=await this[_0x13b238(0x195)]['request'](_0x13b238(0x167),_0x4c3331,{'headers':{'Content-Type':_0x13b238(0x169),'Accept':'application/vnd.api+json'},'body':_0x6371f0});return _0x24b461[_0x13b238(0x160)];}async[a70_0x28b4f5(0x166)](_0x23db1c,_0x34e92d){const _0x3aa39b=a70_0x28b4f5,{jsonSchemaHint:_0x3742a1,..._0x69abcf}=_0x34e92d,_0x13bd10={'data':{'type':_0x3aa39b(0x19d),'id':_0x23db1c,'attributes':_0x69abcf}},_0xd0dca3='/api/prompts/'+encodeURIComponent(_0x23db1c),_0x17e7f8=await this['httpClient']['request']('PATCH',_0xd0dca3,{'headers':{'Content-Type':_0x3aa39b(0x169),'Accept':_0x3aa39b(0x169)},'body':_0x13bd10});return _0x17e7f8['data'];}async['updateIntegration'](_0x845013,_0x15db11){const _0x132848=a70_0x28b4f5,_0xe208fe={'data':{'type':_0x132848(0x155),'id':_0x845013,'attributes':_0x15db11}},_0x3992a8=_0x132848(0x1ac)+encodeURIComponent(_0x845013),_0x2a0813=await this[_0x132848(0x195)][_0x132848(0x132)](_0x132848(0x167),_0x3992a8,{'headers':{'Content-Type':_0x132848(0x169),'Accept':'application/vnd.api+json'},'body':_0xe208fe});return _0x2a0813[_0x132848(0x160)];}}
|
|
1
|
+
const a70_0x33d0ca=a70_0x4a68;(function(_0x544814,_0x35c594){const _0x24e9c8=a70_0x4a68,_0x5a7b29=_0x544814();while(!![]){try{const _0x4dd2b6=-parseInt(_0x24e9c8(0x134))/0x1+-parseInt(_0x24e9c8(0x118))/0x2+-parseInt(_0x24e9c8(0xf5))/0x3*(parseInt(_0x24e9c8(0xea))/0x4)+parseInt(_0x24e9c8(0xdd))/0x5*(-parseInt(_0x24e9c8(0x107))/0x6)+parseInt(_0x24e9c8(0x10a))/0x7+parseInt(_0x24e9c8(0xd1))/0x8+parseInt(_0x24e9c8(0x112))/0x9;if(_0x4dd2b6===_0x35c594)break;else _0x5a7b29['push'](_0x5a7b29['shift']());}catch(_0x4c1fcd){_0x5a7b29['push'](_0x5a7b29['shift']());}}}(a70_0x2765,0xa3165));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';function a70_0x4a68(_0x2b084a,_0x1d3f58){_0x2b084a=_0x2b084a-0xc5;const _0x2765d5=a70_0x2765();let _0x4a6881=_0x2765d5[_0x2b084a];return _0x4a6881;}import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';function a70_0x2765(){const _0xb6672c=['-last_conversation_at','Message\x20cannot\x20be\x20empty\x20or\x20whitespace\x20only','continueChat','POST','&page[limit]=50','/api/web_search_tools','createAgentResponse','pathname','LLM_STREAM_ERROR','page[limit]','application/vnd.api+json','userLocation','agents','/api/projects','createProject','starterMessage','createKnowledgeBase','paginateAll','llm','listAgentsFull','authHeaders','Continuing\x20chat\x20','next','San\x20Francisco','push','1135852RpUYWC','trim','deleteAgent',',\x20message\x20length:\x20','listAgents','length','createTextKnowledgeBase','updateAgentResponse','imageGenerators','warn','listPrompts','imageModelType','updatePrompt','logger','Failed\x20to\x20create\x20chat:\x20unexpected\x20error','/api/text_knowledge_bases','startsWith','\x20attempts:\x20API\x20returned\x20empty\x20chat\x20ID','nova-canvas','data','httpClient','createPrompt','California','getChatInfo','baseUrl','textKnowledgeBases','/api/tool_targets?filter[targetType]=TextKnowledgeBase&filter[project_id]=','/api/knowledge_bases/','/api/chats/','\x20characters','/api/prompts?filter[projectId]=','/api/integrations?filter[projectId]=','maxToolIterations','listWebSearchTools','listChats','modelType','listTextKnowledgeBases','/api/integrations/','getProject','searchContextSize','text/event-stream','10126480UBwUji','application/json','getChatHistory','/api/projects?page[limit]=','systemPrompt','status','DELETE','LLM_EMPTY_MESSAGE','updateAgent','prompt','getAgent','/api/text_knowledge_bases/','2560IODPpr','/api/agents/','projectId','PATCH','startChat','name','toString','/api/integrations','description','createIntegration','/api/knowledge_bases?filter[projectId]=','imageReturnMode','deleteProject','5082608DNttvX','reasoningEffort','knowledge_bases','/api/tool_targets?filter[targetType]=WebSearchTool&filter[project_id]=','listProjects','LLM_CHAT_CREATION_FAILURE','/history','updateKnowledgeBase','/api/users/current_settings','Failed\x20to\x20create\x20chat\x20after\x20','temperature','3FKzqHo','createWebSearchTool','getTextKnowledgeBase','listIntegrations','sort','/api/agents','updateTextKnowledgeBase','projects','map','ms...','apiKey','createAgent','integrations','search','/api/chats','/api/projects/','debug','?filter[project_id]=','8706OvpkiM','append','You\x20are\x20a\x20helpful\x20search\x20assistant.','705845RlBqTP','webSearchTools','getUserSettings',']\x20Chat\x20creation\x20returned\x20empty\x20ID,\x20retrying\x20in\x20','GET','[Retry\x20','medium','Failed\x20to\x20continue\x20chat\x20(chatId:\x20','27604323EAeLko','http','/api/image_generators','filters','request','/api/chats?','1232742KtRfOx','chats','links'];a70_0x2765=function(){return _0xb6672c;};return a70_0x2765();}import{parseSSEStream}from'../../utils/sse-parser.js';import{ErrorCode,SDKError}from'../errors.js';export class LLMApiClient{[a70_0x33d0ca(0x148)];[a70_0x33d0ca(0x14c)];[a70_0x33d0ca(0x12f)];['logger'];constructor(_0x369461,_0x1f3bc5){const _0x4e70c1=a70_0x33d0ca;this['baseUrl']=getEndpoint(_0x369461['site'],_0x4e70c1(0x12d)),this[_0x4e70c1(0x12f)]=toHeaderRecord(getAuthHeaders(_0x369461['site'],_0x369461[_0x4e70c1(0xff)])),this['logger']=_0x1f3bc5,this['httpClient']=new HTTPClient(this['baseUrl'],this[_0x4e70c1(0x12f)],_0x1f3bc5);}async[a70_0x33d0ca(0x12c)](_0x4e73fa){const _0x199826=a70_0x33d0ca,_0x19b894=[];let _0x2b0a47=_0x4e73fa;while(_0x2b0a47){const _0x81194d=await this[_0x199826(0x148)]['request'](_0x199826(0x10e),_0x2b0a47);_0x81194d[_0x199826(0x147)]&&_0x19b894['push'](..._0x81194d[_0x199826(0x147)]);_0x2b0a47=_0x81194d[_0x199826(0x11a)]?.[_0x199826(0x131)];if(_0x2b0a47&&_0x2b0a47[_0x199826(0x144)](_0x199826(0x113))){const _0x1d8239=new URL(_0x2b0a47);_0x2b0a47=_0x1d8239[_0x199826(0x122)]+_0x1d8239[_0x199826(0x102)];}}return _0x19b894;}async[a70_0x33d0ca(0x10c)](){const _0x59aadd=a70_0x33d0ca;return await this[_0x59aadd(0x148)]['request']('GET',_0x59aadd(0xf2));}async[a70_0x33d0ca(0x129)](_0x1a74a8){const _0xa5703c=a70_0x33d0ca,_0x5505ba={'data':{'type':_0xa5703c(0xfc),'attributes':{'name':_0x1a74a8[_0xa5703c(0xe2)],..._0x1a74a8[_0xa5703c(0xe5)]&&{'description':_0x1a74a8['description']}}}},_0x372904=await this[_0xa5703c(0x148)][_0xa5703c(0x116)](_0xa5703c(0x11e),_0xa5703c(0x128),{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0xa5703c(0x125)},'body':_0x5505ba});return _0x372904['data'];}async[a70_0x33d0ca(0xe9)](_0x51d58c){const _0x2ffc7b=a70_0x33d0ca,_0x16d965=_0x2ffc7b(0x104)+encodeURIComponent(_0x51d58c);await this[_0x2ffc7b(0x148)][_0x2ffc7b(0x116)](_0x2ffc7b(0xd7),_0x16d965);}async[a70_0x33d0ca(0xee)](_0x203289=0x32){const _0x1bdccd=a70_0x33d0ca;return this[_0x1bdccd(0x12c)](_0x1bdccd(0xd4)+_0x203289);}async[a70_0x33d0ca(0x138)](_0x496705){const _0x590a2c=a70_0x33d0ca;let _0x555ed9=_0x590a2c(0xfa);_0x496705&&(_0x555ed9+=_0x590a2c(0x106)+encodeURIComponent(_0x496705));const _0x14de1c=await this[_0x590a2c(0x148)]['request'](_0x590a2c(0x10e),_0x555ed9);return _0x14de1c[_0x590a2c(0x147)]||[];}async[a70_0x33d0ca(0xdb)](_0x2590e5){const _0x38f658=a70_0x33d0ca,_0x191a6c=_0x38f658(0xde)+encodeURIComponent(_0x2590e5),_0xcf3650=await this[_0x38f658(0x148)][_0x38f658(0x116)](_0x38f658(0x10e),_0x191a6c);return _0xcf3650[_0x38f658(0x147)];}async[a70_0x33d0ca(0x100)](_0x1ee44d){const _0x20cf5a=a70_0x33d0ca,_0x156a55={'name':_0x1ee44d[_0x20cf5a(0xe2)],'projectId':_0x1ee44d[_0x20cf5a(0xdf)],'modelType':_0x1ee44d['modelType'],'maxToolIterations':_0x1ee44d[_0x20cf5a(0xc8)]??0x4,'temperature':_0x1ee44d[_0x20cf5a(0xf4)]??0.7};_0x1ee44d[_0x20cf5a(0xd5)]!==undefined&&(_0x156a55[_0x20cf5a(0xd5)]=_0x1ee44d['systemPrompt']);_0x1ee44d[_0x20cf5a(0x12a)]&&(_0x156a55['starterMessage']=_0x1ee44d['starterMessage']);_0x1ee44d[_0x20cf5a(0xeb)]&&(_0x156a55[_0x20cf5a(0xeb)]=_0x1ee44d['reasoningEffort']);const _0x42e92c={'data':{'type':_0x20cf5a(0x127),'attributes':_0x156a55}},_0x5d2e69=await this[_0x20cf5a(0x148)][_0x20cf5a(0x116)]('POST',_0x20cf5a(0xfa),{'headers':{'Content-Type':_0x20cf5a(0x125),'Accept':'application/vnd.api+json'},'body':_0x42e92c});return _0x5d2e69[_0x20cf5a(0x147)];}async[a70_0x33d0ca(0xd9)](_0x3002b0,_0x1c7991){const _0xee4e6f=a70_0x33d0ca,_0x35fe8a={'data':{'type':_0xee4e6f(0x127),'id':_0x3002b0,'attributes':{..._0x1c7991[_0xee4e6f(0xe2)]&&{'name':_0x1c7991['name']},..._0x1c7991[_0xee4e6f(0xe5)]&&{'description':_0x1c7991['description']},..._0x1c7991[_0xee4e6f(0xda)]&&{'prompt':_0x1c7991['prompt']},..._0x1c7991[_0xee4e6f(0x12a)]&&{'starter_message':_0x1c7991[_0xee4e6f(0x12a)]},..._0x1c7991['reasoningEffort']&&{'reasoningEffort':_0x1c7991[_0xee4e6f(0xeb)]}}}},_0x1af7f1=_0xee4e6f(0xde)+encodeURIComponent(_0x3002b0),_0x861b09=await this[_0xee4e6f(0x148)]['request'](_0xee4e6f(0xe0),_0x1af7f1,{'body':_0x35fe8a});return _0x861b09[_0xee4e6f(0x147)];}async[a70_0x33d0ca(0x136)](_0x2d73d8){const _0x2608bb=a70_0x33d0ca,_0x579cd0=_0x2608bb(0xde)+encodeURIComponent(_0x2d73d8);await this[_0x2608bb(0x148)]['request'](_0x2608bb(0xd7),_0x579cd0);}async[a70_0x33d0ca(0xca)](_0x5852e9=0x32){const _0x27d58a=a70_0x33d0ca,_0xd7d7ea=new URLSearchParams();_0xd7d7ea[_0x27d58a(0x108)](_0x27d58a(0x124),String(_0x5852e9)),_0xd7d7ea[_0x27d58a(0x108)](_0x27d58a(0xf9),_0x27d58a(0x11b));const _0x1cb1ab=_0x27d58a(0x117)+_0xd7d7ea[_0x27d58a(0xe3)](),_0x596695=await this['httpClient'][_0x27d58a(0x116)]('GET',_0x1cb1ab);return _0x596695['data']||[];}async[a70_0x33d0ca(0x14b)](_0x4046ff){const _0x551339=a70_0x33d0ca,_0x282336=_0x551339(0x150)+encodeURIComponent(_0x4046ff),_0x478a47=await this[_0x551339(0x148)][_0x551339(0x116)](_0x551339(0x10e),_0x282336);return _0x478a47[_0x551339(0x147)];}async[a70_0x33d0ca(0xd3)](_0x53b730){const _0x11ec4e=a70_0x33d0ca,_0x9deeb7=_0x11ec4e(0x150)+encodeURIComponent(_0x53b730)+_0x11ec4e(0xf0);return await this[_0x11ec4e(0x148)][_0x11ec4e(0x116)](_0x11ec4e(0x10e),_0x9deeb7);}async[a70_0x33d0ca(0xe1)](_0x28e449){const _0x4c51d2=a70_0x33d0ca,_0x25e41f={'data':{'type':_0x4c51d2(0x119),'attributes':{'agentId':_0x28e449['agentId']}}},_0x2b12db=0x3,_0x135067=[0x3e8,0x7d0,0xfa0];for(let _0x2aa77d=0x0;_0x2aa77d<=_0x2b12db;_0x2aa77d++){const _0x21418a=await this[_0x4c51d2(0x148)][_0x4c51d2(0x116)](_0x4c51d2(0x11e),_0x4c51d2(0x103),{'headers':{'Content-Type':_0x4c51d2(0x125),'Accept':'application/vnd.api+json'},'body':_0x25e41f});if(_0x21418a[_0x4c51d2(0x147)]&&_0x21418a['data']['id'])return _0x21418a['data'];if(_0x2aa77d>=_0x2b12db)throw new SDKError(ErrorCode[_0x4c51d2(0xef)],_0x4c51d2(0xf3)+(_0x2b12db+0x1)+_0x4c51d2(0x145));const _0x22bd89=_0x135067[_0x2aa77d];console[_0x4c51d2(0x13d)](_0x4c51d2(0x10f)+(_0x2aa77d+0x1)+'/'+_0x2b12db+_0x4c51d2(0x10d)+_0x22bd89+_0x4c51d2(0xfe)),await new Promise(_0x26197a=>setTimeout(_0x26197a,_0x22bd89));}throw new SDKError(ErrorCode[_0x4c51d2(0xef)],_0x4c51d2(0x142));}async*[a70_0x33d0ca(0x11d)](_0x18d6a9,_0x32b74c,_0x2fc9b9){const _0x2f3a78=a70_0x33d0ca,_0xafa1b4=_0x32b74c[_0x2f3a78(0x135)]();if(!_0xafa1b4)throw new SDKError(ErrorCode[_0x2f3a78(0xd8)],_0x2f3a78(0x11c),undefined,{'helpText':'Please\x20provide\x20a\x20non-empty\x20message\x20to\x20continue\x20the\x20chat.'});this[_0x2f3a78(0x141)][_0x2f3a78(0x105)](_0x2f3a78(0x130)+_0x18d6a9+'\x20with\x20message\x20size:\x20'+_0x32b74c[_0x2f3a78(0x139)]+_0x2f3a78(0xc5));const _0x1e493b=_0x2f3a78(0x150)+encodeURIComponent(_0x18d6a9)+'/continue',_0x5e846a={'input':_0x32b74c};try{const _0x4a405c=await this[_0x2f3a78(0x148)]['requestSSE'](_0x2f3a78(0x11e),_0x1e493b,{'headers':{'Content-Type':_0x2f3a78(0xd2),'Accept':_0x2f3a78(0xd0)},'body':_0x5e846a,'signal':_0x2fc9b9});this['logger'][_0x2f3a78(0x105)]('['+_0x4a405c[_0x2f3a78(0xd6)]+']\x20Streaming\x20SSE\x20stream\x20for\x20chatId:\x20'+_0x18d6a9),yield*parseSSEStream(_0x4a405c,this['logger']);}catch(_0x3b0844){throw new SDKError(ErrorCode[_0x2f3a78(0x123)],_0x2f3a78(0x111)+_0x18d6a9+_0x2f3a78(0x137)+_0x32b74c[_0x2f3a78(0x139)]+')',_0x3b0844);}}async[a70_0x33d0ca(0xce)](_0x265c5e){const _0x4b1aab=a70_0x33d0ca,_0x5e1e0f=_0x4b1aab(0x104)+encodeURIComponent(_0x265c5e),_0x155a0b=await this[_0x4b1aab(0x148)][_0x4b1aab(0x116)]('GET',_0x5e1e0f);return _0x155a0b[_0x4b1aab(0x147)];}async['listKnowledgeBases'](_0x565893){const _0x444d08=a70_0x33d0ca;return this[_0x444d08(0x12c)](_0x444d08(0xe7)+encodeURIComponent(_0x565893)+'&page[limit]=50');}async[a70_0x33d0ca(0x12b)](_0x347bf2){const _0x3e64e0=a70_0x33d0ca,_0x2fe58f={'data':{'type':'knowledge_bases','attributes':_0x347bf2}},_0x340d97=await this[_0x3e64e0(0x148)]['request']('POST','/api/knowledge_bases',{'headers':{'Content-Type':_0x3e64e0(0x125),'Accept':_0x3e64e0(0x125)},'body':_0x2fe58f});return _0x340d97[_0x3e64e0(0x147)];}async[a70_0x33d0ca(0xcc)](_0x1fc8de){const _0x1d6443=a70_0x33d0ca,_0x2cf9da=await this[_0x1d6443(0x12c)](_0x1d6443(0x14e)+encodeURIComponent(_0x1fc8de)+_0x1d6443(0x11f));return _0x2cf9da[_0x1d6443(0xfd)](_0x708e99=>({..._0x708e99,'type':_0x1d6443(0x14d)}));}async[a70_0x33d0ca(0xf7)](_0x4f7ce7){const _0xbfae1=a70_0x33d0ca,_0x420dc9=await this[_0xbfae1(0x148)][_0xbfae1(0x116)](_0xbfae1(0x10e),_0xbfae1(0xdc)+encodeURIComponent(_0x4f7ce7),{'headers':{'Accept':_0xbfae1(0x125)}});return _0x420dc9[_0xbfae1(0x147)];}async[a70_0x33d0ca(0x13a)](_0x2f80e0){const _0x19f091=a70_0x33d0ca,_0x4310d6={'data':{'type':_0x19f091(0x14d),'attributes':_0x2f80e0}},_0x2801f8=await this[_0x19f091(0x148)]['request'](_0x19f091(0x11e),_0x19f091(0x143),{'headers':{'Content-Type':_0x19f091(0x125),'Accept':'application/vnd.api+json'},'body':_0x4310d6});return _0x2801f8['data'];}async[a70_0x33d0ca(0xfb)](_0x3ad0b4,_0x19f002){const _0x40696e=a70_0x33d0ca,_0x1a9849={'data':{'type':'textKnowledgeBases','id':_0x3ad0b4,'attributes':_0x19f002}},_0x184516=await this[_0x40696e(0x148)][_0x40696e(0x116)](_0x40696e(0xe0),_0x40696e(0xdc)+encodeURIComponent(_0x3ad0b4),{'headers':{'Content-Type':_0x40696e(0x125),'Accept':_0x40696e(0x125)},'body':_0x1a9849});return _0x184516[_0x40696e(0x147)];}async['createImageGenerator'](_0x3ff054){const _0x454da2=a70_0x33d0ca,_0x174e33={'data':{'type':'imageGenerators','attributes':{..._0x3ff054,'imageModelType':_0x3ff054[_0x454da2(0x13f)]||_0x454da2(0x146),'imageReturnMode':_0x3ff054[_0x454da2(0xe8)]||'ID'}}},_0x114e5e=await this[_0x454da2(0x148)][_0x454da2(0x116)](_0x454da2(0x11e),_0x454da2(0x114),{'headers':{'Content-Type':_0x454da2(0x125),'Accept':'application/vnd.api+json'},'body':_0x174e33});return _0x114e5e[_0x454da2(0x147)];}async[a70_0x33d0ca(0xf6)](_0x5ce6d7){const _0x5ecc6f=a70_0x33d0ca,_0x2c21a2={'data':{'type':_0x5ecc6f(0x10b),'attributes':{'projectId':_0x5ce6d7[_0x5ecc6f(0xdf)],'name':_0x5ce6d7[_0x5ecc6f(0xe2)],'modelType':_0x5ce6d7[_0x5ecc6f(0xcb)]||'gpt-4o','searchContextSize':_0x5ce6d7[_0x5ecc6f(0xcf)]||_0x5ecc6f(0x110),'userLocation':_0x5ce6d7[_0x5ecc6f(0x126)]||{'type':'approximate','country':'US','city':_0x5ecc6f(0x132),'region':_0x5ecc6f(0x14a),'timezone':'America/Los_Angeles'},'systemPrompt':_0x5ce6d7[_0x5ecc6f(0xd5)]||_0x5ecc6f(0x109),'filters':_0x5ce6d7[_0x5ecc6f(0x115)]||{'allowed_domains':[]}}}},_0x135c68=await this['httpClient']['request'](_0x5ecc6f(0x11e),_0x5ecc6f(0x120),{'headers':{'Content-Type':_0x5ecc6f(0x125),'Accept':_0x5ecc6f(0x125)},'body':_0x2c21a2});return _0x135c68[_0x5ecc6f(0x147)];}async['listImageGenerators'](_0x55ecec){const _0x572674=a70_0x33d0ca,_0x81332f=await this[_0x572674(0x12c)]('/api/tool_targets?filter[targetType]=ImageGenerator&filter[project_id]='+encodeURIComponent(_0x55ecec)+'&page[limit]=50');return _0x81332f[_0x572674(0xfd)](_0x38e3de=>({..._0x38e3de,'type':_0x572674(0x13c)}));}async[a70_0x33d0ca(0xc9)](_0x30e012){const _0x5ce6c3=a70_0x33d0ca,_0x3ab68d=await this[_0x5ce6c3(0x12c)](_0x5ce6c3(0xed)+encodeURIComponent(_0x30e012)+_0x5ce6c3(0x11f));return _0x3ab68d[_0x5ce6c3(0xfd)](_0x254fec=>({..._0x254fec,'type':_0x5ce6c3(0x10b)}));}async[a70_0x33d0ca(0x13e)](_0x36d919){const _0x58282e=a70_0x33d0ca;return this['paginateAll'](_0x58282e(0xc6)+encodeURIComponent(_0x36d919)+_0x58282e(0x11f));}async[a70_0x33d0ca(0x149)](_0x5ccc6d){const _0x10a714=a70_0x33d0ca,{jsonSchemaHint:_0x40b569,..._0x5b1a6e}=_0x5ccc6d,_0x56e771={'data':{'type':'prompts','attributes':_0x5b1a6e}},_0x6d7715=await this[_0x10a714(0x148)][_0x10a714(0x116)](_0x10a714(0x11e),'/api/prompts',{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x10a714(0x125)},'body':_0x56e771});return _0x6d7715[_0x10a714(0x147)];}async[a70_0x33d0ca(0xf8)](_0x5f38d7){const _0x54b824=a70_0x33d0ca;return this[_0x54b824(0x12c)](_0x54b824(0xc7)+encodeURIComponent(_0x5f38d7)+_0x54b824(0x11f));}async[a70_0x33d0ca(0xe6)](_0x4e8616){const _0x4ddf83=a70_0x33d0ca,_0x1c1841={'data':{'type':_0x4ddf83(0x101),'attributes':_0x4e8616}},_0x412767=await this[_0x4ddf83(0x148)][_0x4ddf83(0x116)](_0x4ddf83(0x11e),_0x4ddf83(0xe4),{'headers':{'Content-Type':_0x4ddf83(0x125),'Accept':_0x4ddf83(0x125)},'body':_0x1c1841});return _0x412767['data'];}async[a70_0x33d0ca(0x12e)](_0x2893c5){const _0x49832e=a70_0x33d0ca,_0x120359=await this[_0x49832e(0x138)](_0x2893c5),_0x2e4b8e=[];for(const _0x1c19e1 of _0x120359){const _0x3f3245='/api/agents/'+encodeURIComponent(_0x1c19e1['id']),_0xd3b4b4=await this[_0x49832e(0x148)]['request']('GET',_0x3f3245);_0x2e4b8e[_0x49832e(0x133)](_0xd3b4b4[_0x49832e(0x147)]);}return _0x2e4b8e;}async[a70_0x33d0ca(0x121)](_0x37df3b){const _0x3cae64=a70_0x33d0ca,_0x4c1935={'data':{'type':'agents','attributes':_0x37df3b}},_0x4655ac=await this[_0x3cae64(0x148)][_0x3cae64(0x116)](_0x3cae64(0x11e),_0x3cae64(0xfa),{'headers':{'Content-Type':_0x3cae64(0x125),'Accept':_0x3cae64(0x125)},'body':_0x4c1935});return _0x4655ac[_0x3cae64(0x147)];}async[a70_0x33d0ca(0x13b)](_0x232083,_0x295af3){const _0x5d278a=a70_0x33d0ca,_0x53f4bd={'data':{'type':_0x5d278a(0x127),'id':_0x232083,'attributes':_0x295af3}},_0x139473=_0x5d278a(0xde)+encodeURIComponent(_0x232083),_0x4542b9=await this[_0x5d278a(0x148)]['request'](_0x5d278a(0xe0),_0x139473,{'headers':{'Content-Type':_0x5d278a(0x125),'Accept':_0x5d278a(0x125)},'body':_0x53f4bd});return _0x4542b9[_0x5d278a(0x147)];}async[a70_0x33d0ca(0xf1)](_0x3ee7a9,_0x21b459){const _0x4f2e3b=a70_0x33d0ca,_0xd66e34={'data':{'type':_0x4f2e3b(0xec),'id':_0x3ee7a9,'attributes':_0x21b459}},_0x1b9b90=_0x4f2e3b(0x14f)+encodeURIComponent(_0x3ee7a9),_0x5072cb=await this['httpClient']['request'](_0x4f2e3b(0xe0),_0x1b9b90,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x4f2e3b(0x125)},'body':_0xd66e34});return _0x5072cb[_0x4f2e3b(0x147)];}async[a70_0x33d0ca(0x140)](_0x4d9918,_0x61e7e){const _0x2b9c0f=a70_0x33d0ca,{jsonSchemaHint:_0x21ce6a,..._0x363114}=_0x61e7e,_0x537ad7={'data':{'type':'prompts','id':_0x4d9918,'attributes':_0x363114}},_0x584186='/api/prompts/'+encodeURIComponent(_0x4d9918),_0x1261c1=await this[_0x2b9c0f(0x148)]['request'](_0x2b9c0f(0xe0),_0x584186,{'headers':{'Content-Type':_0x2b9c0f(0x125),'Accept':_0x2b9c0f(0x125)},'body':_0x537ad7});return _0x1261c1['data'];}async['updateIntegration'](_0x3e73fe,_0xd70b66){const _0x198f1d=a70_0x33d0ca,_0xbe4fb2={'data':{'type':_0x198f1d(0x101),'id':_0x3e73fe,'attributes':_0xd70b66}},_0x10b415=_0x198f1d(0xcd)+encodeURIComponent(_0x3e73fe),_0x538e05=await this[_0x198f1d(0x148)][_0x198f1d(0x116)](_0x198f1d(0xe0),_0x10b415,{'headers':{'Content-Type':'application/vnd.api+json','Accept':_0x198f1d(0x125)},'body':_0xbe4fb2});return _0x538e05['data'];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a71_0x2a1b(_0x122b56,_0x1c7eec){_0x122b56=_0x122b56-0x111;const _0x472056=a71_0x4720();let _0x2a1ba4=_0x472056[_0x122b56];return _0x2a1ba4;}const a71_0x2afd2d=a71_0x2a1b;function a71_0x4720(){const _0x24c7ef=['ceil','refillRate','1286460jMumfc','1130230OYUCmt','1953520NPYYdJ','859284aeQuTv','now','5028960jbpwLC','min','24gKZEbO','44qwodCd','windowMs','floor','tokens','sleep','13644yJXUny','lastRefill','maxTokens','refill','27aFQXWG','max','102456dOtLmh','9647NvGQMY','14IDkwUI','maxRequests'];a71_0x4720=function(){return _0x24c7ef;};return a71_0x4720();}(function(_0x336a8f,_0x393ea3){const _0x3fa627=a71_0x2a1b,_0x48f165=_0x336a8f();while(!![]){try{const _0x4f3fb8=parseInt(_0x3fa627(0x11e))/0x1+parseInt(_0x3fa627(0x123))/0x2*(-parseInt(_0x3fa627(0x115))/0x3)+parseInt(_0x3fa627(0x11b))/0x4+-parseInt(_0x3fa627(0x11d))/0x5*(parseInt(_0x3fa627(0x122))/0x6)+parseInt(_0x3fa627(0x117))/0x7*(parseInt(_0x3fa627(0x120))/0x8)+parseInt(_0x3fa627(0x113))/0x9*(-parseInt(_0x3fa627(0x11c))/0xa)+parseInt(_0x3fa627(0x116))/0xb*(parseInt(_0x3fa627(0x128))/0xc);if(_0x4f3fb8===_0x393ea3)break;else _0x48f165['push'](_0x48f165['shift']());}catch(_0x31a10e){_0x48f165['push'](_0x48f165['shift']());}}}(a71_0x4720,0xbeeeb));export class RateLimiter{[a71_0x2afd2d(0x126)];[a71_0x2afd2d(0x129)];[a71_0x2afd2d(0x111)];['refillRate'];constructor(_0x10eeec){const _0x550817=a71_0x2afd2d;this['maxTokens']=_0x10eeec['maxRequests'],this[_0x550817(0x126)]=_0x10eeec['maxRequests'],this[_0x550817(0x129)]=Date[_0x550817(0x11f)](),this[_0x550817(0x11a)]=_0x10eeec[_0x550817(0x118)]/_0x10eeec[_0x550817(0x124)];}async['acquire'](){const _0x4b9a61=a71_0x2afd2d;while(!![]){this['refill']();if(this['tokens']>=0x1){this[_0x4b9a61(0x126)]-=0x1;return;}const _0x436da4=Math[_0x4b9a61(0x114)](0x1,Math[_0x4b9a61(0x119)](0x1/this[_0x4b9a61(0x11a)]));await this[_0x4b9a61(0x127)](_0x436da4);}}['tryAcquire'](){const _0x33f322=a71_0x2afd2d;this[_0x33f322(0x112)]();if(this['tokens']>=0x1)return this['tokens']-=0x1,!![];return![];}[a71_0x2afd2d(0x112)](){const _0x59acc1=a71_0x2afd2d,_0x286f0f=Date[_0x59acc1(0x11f)](),_0xf02b92=_0x286f0f-this['lastRefill'];if(_0xf02b92>0x0){const _0x43e9ed=_0xf02b92*this['refillRate'];this[_0x59acc1(0x126)]=Math[_0x59acc1(0x121)](this[_0x59acc1(0x111)],this[_0x59acc1(0x126)]+_0x43e9ed),this[_0x59acc1(0x129)]=_0x286f0f;}}['getAvailableTokens'](){const _0x5129b0=a71_0x2afd2d;return this[_0x5129b0(0x112)](),Math[_0x5129b0(0x125)](this[_0x5129b0(0x126)]);}['reset'](){const _0x24089f=a71_0x2afd2d;this[_0x24089f(0x126)]=this[_0x24089f(0x111)],this[_0x24089f(0x129)]=Date[_0x24089f(0x11f)]();}[a71_0x2afd2d(0x127)](_0x1481b9){return new Promise(_0x118a58=>setTimeout(_0x118a58,_0x1481b9));}}export const defaultRateLimiter=new RateLimiter({'maxRequests':0x64,'windowMs':0xea60});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a72_0x3467(_0x2ab6c1,_0xd94c20){_0x2ab6c1=_0x2ab6c1-0x67;const _0x55bf48=a72_0x55bf();let _0x3467ef=_0x55bf48[_0x2ab6c1];return _0x3467ef;}const a72_0x4265e6=a72_0x3467;(function(_0x4666ff,_0x50b451){const _0x2141a5=a72_0x3467,_0x2470fc=_0x4666ff();while(!![]){try{const _0x5741b5=parseInt(_0x2141a5(0x95))/0x1*(-parseInt(_0x2141a5(0x6e))/0x2)+-parseInt(_0x2141a5(0x6b))/0x3+-parseInt(_0x2141a5(0x8d))/0x4+parseInt(_0x2141a5(0xb2))/0x5*(-parseInt(_0x2141a5(0xa2))/0x6)+parseInt(_0x2141a5(0x6d))/0x7*(parseInt(_0x2141a5(0x9b))/0x8)+-parseInt(_0x2141a5(0x99))/0x9*(parseInt(_0x2141a5(0x96))/0xa)+parseInt(_0x2141a5(0xad))/0xb;if(_0x5741b5===_0x50b451)break;else _0x2470fc['push'](_0x2470fc['shift']());}catch(_0xe9b46b){_0x2470fc['push'](_0x2470fc['shift']());}}}(a72_0x55bf,0x8c2d1));import{HTTPClient}from'./http-client.js';function a72_0x55bf(){const _0xf465d0=['jobs','/v3/job/result/','/output','authHeaders','/v3/job/kill/','listConnectorMetadata','string','httpClient','getConnection','account_id','listConnections','status','/v4/form_schemas/','createDatabase','listJobs','/v4/connector_metadata','423876fQQZvK','push','apiKey','/v3/table/show/','/v3/job/issue/presto/','/v3/table/list/','/v3/user/list','isNaN','53oJUKMY','10MrcnjQ','/v3/table/create/','deleteTable','2596581ybbrjM','text','1192AFxwus','append','submitPrestoJob','length','from','?header=true','submitHiveJob','444504tzVGbs','/v4/connector_metadata/','validateConnectorConfig','GET','cancelJob','tables','/v3/database/delete/','request','showDatabase','users','POST','17454492MXNJjt','getUserInfo','trim','/v3/database/create/','toString','40FnnHpT','/v3/job/list?','split','listUsers','application/json','site','showJob','1884597Jpgtpz','createTable','29813NYycoK','1202rVywtb','parse','deleteDatabase','getOutputFormSchema','warn','/v4/connectors/','/v3/connector_configs/validate_with_connection','/v3/job/issue/hive/','getJobResult','/v3/job/show/','showTable','Failed\x20to\x20parse\x20NDJSON\x20line\x20','/v4/users/current','/v3/job/list','forEach'];a72_0x55bf=function(){return _0xf465d0;};return a72_0x55bf();}import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class TDApiClient{['httpClient'];[a72_0x4265e6(0x80)];constructor(_0xd0ff0e,_0x5ab12c){const _0x24bfca=a72_0x4265e6,_0x45efa9=getEndpoint(_0xd0ff0e[_0x24bfca(0x69)],'td');this['authHeaders']=toHeaderRecord(getAuthHeaders(_0xd0ff0e[_0x24bfca(0x69)],_0xd0ff0e[_0x24bfca(0x8f)])),this[_0x24bfca(0x84)]=new HTTPClient(_0x45efa9,this[_0x24bfca(0x80)],_0x5ab12c);}async['listDatabases'](){const _0x2cc003=a72_0x4265e6,_0x2385cb=await this[_0x2cc003(0x84)]['request'](_0x2cc003(0xa5),'/v3/database/list');return _0x2385cb['databases'];}async[a72_0x4265e6(0xaa)](_0x25b717){const _0x96d32c=a72_0x4265e6,_0x5ab778=await this['httpClient']['request'](_0x96d32c(0xa5),'/v3/database/show/'+encodeURIComponent(_0x25b717));return _0x5ab778;}async[a72_0x4265e6(0x8a)](_0x43d958){const _0x2acd82=a72_0x4265e6;await this['httpClient'][_0x2acd82(0xa9)](_0x2acd82(0xac),_0x2acd82(0xb0)+encodeURIComponent(_0x43d958));}async[a72_0x4265e6(0x70)](_0x406a88){const _0x595c25=a72_0x4265e6;await this[_0x595c25(0x84)][_0x595c25(0xa9)](_0x595c25(0xac),_0x595c25(0xa8)+encodeURIComponent(_0x406a88));}async['listTables'](_0x3ccf2d){const _0x15352d=a72_0x4265e6,_0x324853=await this[_0x15352d(0x84)]['request'](_0x15352d(0xa5),_0x15352d(0x92)+encodeURIComponent(_0x3ccf2d));return _0x324853[_0x15352d(0xa7)];}async[a72_0x4265e6(0x78)](_0x1fdb5a,_0x3ff2d5){const _0x594ecc=a72_0x4265e6,_0x4913b6=await this['httpClient']['request'](_0x594ecc(0xa5),_0x594ecc(0x90)+encodeURIComponent(_0x1fdb5a)+'/'+encodeURIComponent(_0x3ff2d5));return _0x4913b6;}async[a72_0x4265e6(0x6c)](_0x446bd5,_0x12eca3){const _0x56ad5f=a72_0x4265e6;await this[_0x56ad5f(0x84)][_0x56ad5f(0xa9)](_0x56ad5f(0xac),_0x56ad5f(0x97)+encodeURIComponent(_0x446bd5)+'/'+encodeURIComponent(_0x12eca3));}async[a72_0x4265e6(0x98)](_0x1d79d5,_0x52639a){const _0x380d27=a72_0x4265e6;await this[_0x380d27(0x84)]['request'](_0x380d27(0xac),'/v3/table/delete/'+encodeURIComponent(_0x1d79d5)+'/'+encodeURIComponent(_0x52639a));}async[a72_0x4265e6(0xa1)](_0x233af1,_0x11c476){const _0x5a2bca=a72_0x4265e6,_0x5b3bb4=await this[_0x5a2bca(0x84)]['request']('POST',_0x5a2bca(0x75)+encodeURIComponent(_0x233af1),{'body':{'query':_0x11c476}});return _0x5b3bb4;}async[a72_0x4265e6(0x9d)](_0x2d2c4c,_0x5be4de){const _0x5927bb=a72_0x4265e6,_0x46a9ed=await this[_0x5927bb(0x84)][_0x5927bb(0xa9)](_0x5927bb(0xac),_0x5927bb(0x91)+encodeURIComponent(_0x2d2c4c),{'body':{'query':_0x5be4de}});return _0x46a9ed;}async[a72_0x4265e6(0x8b)](_0x43b520){const _0x883f4=a72_0x4265e6,_0x571a9b=new URLSearchParams();if(_0x43b520?.[_0x883f4(0x9f)]!==undefined)_0x571a9b[_0x883f4(0x9c)]('from',_0x43b520[_0x883f4(0x9f)][_0x883f4(0xb1)]());if(_0x43b520?.['to']!==undefined)_0x571a9b[_0x883f4(0x9c)]('to',_0x43b520['to'][_0x883f4(0xb1)]());if(_0x43b520?.[_0x883f4(0x88)])_0x571a9b[_0x883f4(0x9c)](_0x883f4(0x88),_0x43b520['status']);const _0x3b6964=_0x571a9b[_0x883f4(0xb1)](),_0x25dcc3=_0x3b6964?_0x883f4(0xb3)+_0x3b6964:_0x883f4(0x7b),_0x5570c1=await this['httpClient'][_0x883f4(0xa9)](_0x883f4(0xa5),_0x25dcc3);return _0x5570c1[_0x883f4(0x7d)];}async[a72_0x4265e6(0x6a)](_0x3c5762){const _0x24cb14=a72_0x4265e6,_0x100538=await this[_0x24cb14(0x84)][_0x24cb14(0xa9)](_0x24cb14(0xa5),_0x24cb14(0x77)+encodeURIComponent(_0x3c5762));return _0x100538;}async[a72_0x4265e6(0xa6)](_0x57e430){const _0xcee6d4=a72_0x4265e6;await this[_0xcee6d4(0x84)]['request']('POST',_0xcee6d4(0x81)+encodeURIComponent(_0x57e430));}async[a72_0x4265e6(0xae)](){const _0x24b9e2=a72_0x4265e6,_0x50e2e9=await this['httpClient']['request'](_0x24b9e2(0xa5),_0x24b9e2(0x7a)),_0x5dbdac=parseInt(_0x50e2e9['id'],0xa),_0xab7a82=parseInt(_0x50e2e9[_0x24b9e2(0x86)],0xa);return{..._0x50e2e9,'id':Number[_0x24b9e2(0x94)](_0x5dbdac)?0x0:_0x5dbdac,'account_id':Number[_0x24b9e2(0x94)](_0xab7a82)?undefined:_0xab7a82};}async[a72_0x4265e6(0x67)](){const _0x2720d8=a72_0x4265e6,_0x11f9c0=await this[_0x2720d8(0x84)][_0x2720d8(0xa9)](_0x2720d8(0xa5),_0x2720d8(0x93));return _0x11f9c0[_0x2720d8(0xab)];}async[a72_0x4265e6(0x76)](_0x496e97){const _0x213e5c=a72_0x4265e6,_0x1ca000=await this[_0x213e5c(0x84)][_0x213e5c(0xa9)](_0x213e5c(0xa5),_0x213e5c(0x7e)+encodeURIComponent(_0x496e97)+_0x213e5c(0xa0),{'headers':{'Accept':_0x213e5c(0x68)},'responseType':_0x213e5c(0x9a)});if(typeof _0x1ca000===_0x213e5c(0x83)){const _0x1e9b03=_0x1ca000[_0x213e5c(0xb4)]('\x0a')['filter'](_0x124366=>_0x124366[_0x213e5c(0xaf)]());if(_0x1e9b03['length']===0x0)return[];let _0x5b3446;try{_0x5b3446=JSON[_0x213e5c(0x6f)](_0x1e9b03[0x0]);}catch(_0x426f50){return console[_0x213e5c(0x72)]('Failed\x20to\x20parse\x20column\x20names:\x20'+(_0x426f50 instanceof Error?_0x426f50['message']:String(_0x426f50))),[];}const _0x4c04a7=[];for(let _0x219bea=0x1;_0x219bea<_0x1e9b03[_0x213e5c(0x9e)];_0x219bea++){const _0x183c30=_0x1e9b03[_0x219bea][_0x213e5c(0xaf)]();if(!_0x183c30)continue;try{const _0xbf64da=JSON[_0x213e5c(0x6f)](_0x183c30),_0x1f2917={};_0x5b3446[_0x213e5c(0x7c)]((_0x5dbf0b,_0x1ea778)=>{_0x1f2917[_0x5dbf0b]=_0xbf64da[_0x1ea778];}),_0x4c04a7[_0x213e5c(0x8e)](_0x1f2917);}catch(_0x4212ae){console[_0x213e5c(0x72)](_0x213e5c(0x79)+(_0x219bea+0x1)+':\x20'+(_0x4212ae instanceof Error?_0x4212ae['message']:String(_0x4212ae)));}}return _0x4c04a7;}return[];}async[a72_0x4265e6(0x87)](){const _0x43108a=a72_0x4265e6;return await this[_0x43108a(0x84)][_0x43108a(0xa9)]('GET','/v4/connectors');}async[a72_0x4265e6(0x85)](_0x543eb8){const _0x544abe=a72_0x4265e6;return await this[_0x544abe(0x84)][_0x544abe(0xa9)](_0x544abe(0xa5),_0x544abe(0x73)+_0x543eb8);}async[a72_0x4265e6(0x71)](_0x1629fc){const _0x5dd117=a72_0x4265e6;return await this['httpClient'][_0x5dd117(0xa9)](_0x5dd117(0xa5),_0x5dd117(0x89)+encodeURIComponent(_0x1629fc)+_0x5dd117(0x7f));}async['getConnectorMetadata'](_0x2d7345){const _0x674646=a72_0x4265e6;return await this[_0x674646(0x84)][_0x674646(0xa9)](_0x674646(0xa5),_0x674646(0xa3)+encodeURIComponent(_0x2d7345));}async[a72_0x4265e6(0x82)](){const _0x3beaa9=a72_0x4265e6;return await this[_0x3beaa9(0x84)]['request']('GET',_0x3beaa9(0x8c));}async[a72_0x4265e6(0xa4)](_0x195dfb,_0x1d03f3,_0x10816d){const _0x3c2045=a72_0x4265e6;return await this[_0x3c2045(0x84)]['request'](_0x3c2045(0xac),_0x3c2045(0x74),{'body':{'type':_0x195dfb,'connection_id':_0x1d03f3,'settings':_0x10816d}});}}export function createTDApiClient(_0x1f57e3,_0x4aaaa0){return new TDApiClient(_0x1f57e3,_0x4aaaa0);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a73_0x1b30(_0x399b0a,_0x40b775){_0x399b0a=_0x399b0a-0xc5;const _0xb89236=a73_0xb892();let _0x1b30cb=_0xb89236[_0x399b0a];return _0x1b30cb;}const a73_0x1093a5=a73_0x1b30;(function(_0x15877f,_0x5a825d){const _0x2c44db=a73_0x1b30,_0x51d70a=_0x15877f();while(!![]){try{const _0x354236=-parseInt(_0x2c44db(0x10a))/0x1+parseInt(_0x2c44db(0xca))/0x2+parseInt(_0x2c44db(0xde))/0x3*(-parseInt(_0x2c44db(0xf9))/0x4)+parseInt(_0x2c44db(0xcc))/0x5*(-parseInt(_0x2c44db(0x104))/0x6)+parseInt(_0x2c44db(0xdd))/0x7*(parseInt(_0x2c44db(0xc9))/0x8)+-parseInt(_0x2c44db(0xe1))/0x9+parseInt(_0x2c44db(0xf5))/0xa*(parseInt(_0x2c44db(0x10d))/0xb);if(_0x354236===_0x5a825d)break;else _0x51d70a['push'](_0x51d70a['shift']());}catch(_0x116efe){_0x51d70a['push'](_0x51d70a['shift']());}}}(a73_0xb892,0xabc2b));import{HTTPClient}from'./http-client.js';function a73_0xb892(){const _0x5e0f65=['\x20rows)\x20-\x20','toLocaleString','INTERNAL','name','state','GET','TRINO_INTERNAL_ERROR','red','split','X-Trino-Catalog','errorName','isTTY','convertRowsToObjects','PERMISSION_DENIED','20HgEFXT','Failed\x20to\x20cancel\x20query:','USER_ERROR','errorCode','999532QVddCN','request','message','length','DELETE','site',']\x20Query\x20ID:\x20','TRINO_INSUFFICIENT_RESOURCES','errorType','httpClient','totalSplits','11622UXAtAX','headers','pathname','nextUri','processedRows','POST','3169grEGaB','X-Trino-Schema','data','16191549Tztmtm','Warning:\x20Large\x20result\x20set\x20(','/v1/statement','max','jobId','dim','TRINO_USER_CANCELLED','8BqKoth','1272878NSfMug','X-TD-JobId','3205AWydpo','completedSplits','apiKey','[query]','errorLocation','TRINO_SYNTAX_ERROR','Invalid\x20nextUri\x20format:\x20','checkResponseError','stdout','trino','push','EXTERNAL','ALREADY_EXISTS','streamResults','warn','map','stats','1268785alEHRL','9oTdALk','TRINO_NOT_FOUND','padStart','9572814EvORsW','min','join','warnings','aborted','columns'];a73_0xb892=function(){return _0x5e0f65;};return a73_0xb892();}import{getEndpoint}from'../types/index.js';import{getTrinoHeaders}from'../../core/auth.js';import{SDKError,ErrorCode}from'../errors.js';import{Chalk}from'chalk';export class TrinoApiClient{[a73_0x1093a5(0x102)];constructor(_0x58c956,_0x589d60){const _0x4b4fa3=a73_0x1093a5,_0x9a2b9=getEndpoint(_0x58c956[_0x4b4fa3(0xfe)],_0x4b4fa3(0xd5)),_0x233b5a=getTrinoHeaders(_0x58c956[_0x4b4fa3(0xfe)],_0x58c956[_0x4b4fa3(0xce)]);this[_0x4b4fa3(0x102)]=new HTTPClient(_0x9a2b9,_0x233b5a,_0x589d60);}async['executeQuery'](_0x5c7ee1,_0x542b9b={}){const _0x33e24c=a73_0x1093a5,{catalog:_0x44ea83,schema:_0x324706,timeout:_0xc6b1e0,signal:_0x5241ab,onJobId:_0x139402,onProgress:_0x2f7b86}=_0x542b9b,_0x23f165={'Content-Type':'text/plain'};(_0x44ea83||_0x324706)&&(_0x23f165[_0x33e24c(0xf0)]=_0x44ea83||'td');_0x324706&&(_0x23f165[_0x33e24c(0x10b)]=_0x324706);const _0x1790e4=await this[_0x33e24c(0x102)]['request'](_0x33e24c(0x109),_0x33e24c(0x10f),{'headers':_0x23f165,'body':_0x5c7ee1,'timeout':_0xc6b1e0,'signal':_0x5241ab,'includeHeaders':!![]}),_0x25c016=_0x1790e4[_0x33e24c(0x10c)],_0x48cf47=_0x1790e4[_0x33e24c(0x105)],_0x2cbbbd=_0x48cf47['x-td-jobid']||_0x48cf47[_0x33e24c(0xcb)];_0x2cbbbd&&_0x139402&&_0x139402(_0x2cbbbd);this[_0x33e24c(0xd3)](_0x25c016,_0x25c016['id'],_0x5c7ee1);const _0x1f28b0=await this[_0x33e24c(0xd9)](_0x25c016,_0x5c7ee1,_0x5241ab,_0x2f7b86);return _0x2cbbbd&&(_0x1f28b0[_0x33e24c(0xc6)]=_0x2cbbbd),_0x1f28b0;}async[a73_0x1093a5(0xd9)](_0x125d4e,_0x2d5305,_0x464680,_0x236017){const _0x4c2d2c=a73_0x1093a5,_0xb485d5=_0x125d4e['id'];let _0x1e9edc=[];const _0x5cb4f6=[],_0x118094=[];let _0x1b6583=_0x125d4e;const _0x395d00=0x186a0;_0x1b6583['columns']&&(_0x1e9edc=_0x1b6583[_0x4c2d2c(0xe6)]);_0x1b6583[_0x4c2d2c(0x10c)]&&_0x5cb4f6[_0x4c2d2c(0xd6)](..._0x1b6583[_0x4c2d2c(0x10c)]);_0x1b6583[_0x4c2d2c(0xe4)]&&_0x118094[_0x4c2d2c(0xd6)](..._0x1b6583[_0x4c2d2c(0xe4)]);_0x236017&&_0x1b6583['stats']&&_0x236017({'state':_0x1b6583['stats'][_0x4c2d2c(0xeb)],'processedRows':_0x1b6583[_0x4c2d2c(0xdc)]['processedRows'],'completedSplits':_0x1b6583[_0x4c2d2c(0xdc)][_0x4c2d2c(0xcd)],'totalSplits':_0x1b6583[_0x4c2d2c(0xdc)][_0x4c2d2c(0x103)]});while(_0x1b6583[_0x4c2d2c(0x107)]){if(_0x464680?.[_0x4c2d2c(0xe5)]){await this['cancelQuery'](_0x1b6583[_0x4c2d2c(0x107)]);throw new Error('Query\x20cancelled\x20by\x20user');}let _0x2f3cb8;try{_0x2f3cb8=new URL(_0x1b6583[_0x4c2d2c(0x107)])[_0x4c2d2c(0x106)];}catch{throw new Error(_0x4c2d2c(0xd2)+_0x1b6583[_0x4c2d2c(0x107)]);}_0x1b6583=await this[_0x4c2d2c(0x102)][_0x4c2d2c(0xfa)](_0x4c2d2c(0xec),_0x2f3cb8,{'signal':_0x464680}),this[_0x4c2d2c(0xd3)](_0x1b6583,_0xb485d5,_0x2d5305),_0x1b6583[_0x4c2d2c(0xe6)]&&_0x1e9edc[_0x4c2d2c(0xfc)]===0x0&&(_0x1e9edc=_0x1b6583[_0x4c2d2c(0xe6)]),_0x1b6583[_0x4c2d2c(0x10c)]&&(_0x5cb4f6[_0x4c2d2c(0xd6)](..._0x1b6583[_0x4c2d2c(0x10c)]),_0x5cb4f6[_0x4c2d2c(0xfc)]>_0x395d00&&_0x5cb4f6[_0x4c2d2c(0xfc)]%0xc350===0x0&&console[_0x4c2d2c(0xda)](_0x4c2d2c(0x10e)+_0x5cb4f6[_0x4c2d2c(0xfc)][_0x4c2d2c(0xe8)]()+_0x4c2d2c(0xe7)+'consider\x20adding\x20LIMIT\x20clause')),_0x1b6583[_0x4c2d2c(0xe4)]&&_0x118094['push'](..._0x1b6583['warnings']),_0x236017&&_0x1b6583[_0x4c2d2c(0xdc)]&&_0x236017({'state':_0x1b6583[_0x4c2d2c(0xdc)][_0x4c2d2c(0xeb)],'processedRows':_0x1b6583[_0x4c2d2c(0xdc)][_0x4c2d2c(0x108)],'completedSplits':_0x1b6583[_0x4c2d2c(0xdc)][_0x4c2d2c(0xcd)],'totalSplits':_0x1b6583['stats'][_0x4c2d2c(0x103)]});}const _0x498119=this[_0x4c2d2c(0xf3)](_0x1e9edc,_0x5cb4f6);return{'queryId':_0xb485d5,'columns':_0x1e9edc,'data':_0x498119,'stats':_0x1b6583[_0x4c2d2c(0xdc)],'warnings':_0x118094[_0x4c2d2c(0xfc)]>0x0?_0x118094:undefined};}['checkResponseError'](_0x3d9b09,_0x58e7ea,_0x1b265f){const _0x56b472=a73_0x1093a5;if(!_0x3d9b09['error'])return;const _0x17dfd7=_0x3d9b09['error'],_0x598d6e=mapTrinoErrorToErrorCode(_0x17dfd7),_0x32173d=process[_0x56b472(0xd4)][_0x56b472(0xf2)]?new Chalk({'level':0x3}):new Chalk({'level':0x0}),_0x5d7efa='['+_0x17dfd7[_0x56b472(0xf1)]+_0x56b472(0xff)+_0x58e7ea;let _0x3f63d0=_0x32173d[_0x56b472(0xee)](_0x5d7efa+'\x0a'+_0x17dfd7[_0x56b472(0xfb)]);if(_0x1b265f&&_0x17dfd7[_0x56b472(0xd0)]){const {lineNumber:_0x43994d,columnNumber:_0x793cf1}=_0x17dfd7[_0x56b472(0xd0)];_0x3f63d0+='\x0a\x0a'+_0x32173d[_0x56b472(0xc7)](_0x56b472(0xcf))+'\x0a'+formatSqlErrorContext(_0x1b265f,_0x43994d,_0x793cf1);}throw new SDKError(_0x598d6e,_0x3f63d0,_0x17dfd7);}[a73_0x1093a5(0xf3)](_0x1f10a4,_0x106221){const _0x3adfc0=a73_0x1093a5;if(_0x1f10a4['length']===0x0)return _0x106221;return _0x106221[_0x3adfc0(0xdb)](_0x50fd31=>{const _0x3918c1={};return _0x1f10a4['forEach']((_0x295cb0,_0x3fbd77)=>{const _0x4e3641=a73_0x1b30;_0x3918c1[_0x295cb0[_0x4e3641(0xea)]]=_0x50fd31[_0x3fbd77];}),_0x3918c1;});}async['cancelQuery'](_0x2dca27){const _0x4c978d=a73_0x1093a5;try{const _0x51ef15=new URL(_0x2dca27)[_0x4c978d(0x106)];await this[_0x4c978d(0x102)][_0x4c978d(0xfa)](_0x4c978d(0xfd),_0x51ef15);}catch(_0x2daf74){console[_0x4c978d(0xda)](_0x4c978d(0xf6),_0x2daf74);}}}function formatSqlErrorContext(_0xe9ab9,_0x3bbb30,_0xd59e88){const _0x2c9987=a73_0x1093a5,_0x157e0c=_0xe9ab9[_0x2c9987(0xef)]('\x0a');if(_0x3bbb30<0x1||_0x3bbb30>_0x157e0c[_0x2c9987(0xfc)])return _0xe9ab9;const _0x5065e3=_0x3bbb30-0x1,_0x1a27d=Math[_0x2c9987(0xc5)](0x0,_0x5065e3-0x2),_0x3c60d6=Math[_0x2c9987(0xe2)](_0x157e0c[_0x2c9987(0xfc)],_0x5065e3+0x3),_0x265add=[],_0x54aa77=process[_0x2c9987(0xd4)][_0x2c9987(0xf2)]?new Chalk({'level':0x3}):new Chalk({'level':0x0});for(let _0x2cdaeb=_0x1a27d;_0x2cdaeb<_0x3c60d6;_0x2cdaeb++){const _0x5884ad=_0x2cdaeb===_0x5065e3?'>\x20':'\x20\x20',_0x40b60e=String(_0x2cdaeb+0x1)[_0x2c9987(0xe0)](0x3,'\x20'),_0x1e1580=_0x54aa77[_0x2c9987(0xc7)](''+_0x5884ad+_0x40b60e+'\x20|');_0x265add[_0x2c9987(0xd6)](_0x1e1580+'\x20'+_0x157e0c[_0x2cdaeb]);if(_0x2cdaeb===_0x5065e3){const _0x135a3d=0x8+(_0xd59e88-0x1);_0x265add['push']('\x20'['repeat'](_0x135a3d)+'^');}}return _0x265add[_0x2c9987(0xe3)]('\x0a');}function mapTrinoErrorToErrorCode(_0x40cf4b){const _0x176c3b=a73_0x1093a5,_0x3519c7=_0x40cf4b[_0x176c3b(0x101)],_0x49555b=_0x40cf4b[_0x176c3b(0xf8)];if(_0x3519c7===_0x176c3b(0xf7))switch(_0x49555b){case 0x1:return ErrorCode[_0x176c3b(0xd1)];case 0x3:return ErrorCode[_0x176c3b(0xc8)];case 0x4:return ErrorCode[_0x176c3b(0xf4)];case 0x5:case 0x2c:case 0x2d:case 0x2e:case 0x2f:return ErrorCode[_0x176c3b(0xdf)];case 0xc:case 0x31:case 0x32:return ErrorCode[_0x176c3b(0xd8)];default:return ErrorCode['TRINO_INVALID_ARGUMENT'];}else{if(_0x3519c7==='INTERNAL_ERROR')return ErrorCode['TRINO_INTERNAL_ERROR'];else{if(_0x3519c7==='INSUFFICIENT_RESOURCES')return ErrorCode[_0x176c3b(0x100)];else{if(_0x3519c7===_0x176c3b(0xd7))return ErrorCode[_0x176c3b(0xed)];}}}return ErrorCode[_0x176c3b(0xe9)];}
|