@intuned/browser-dev 0.1.13-dev.0 → 0.1.14-dev.1

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.
@@ -104,7 +104,7 @@ export declare function sanitizeHtml(options: SanitizeHtmlOptions): string;
104
104
  * page,
105
105
  * trigger: "https://intuned-docs-public-images.s3.amazonaws.com/32UP83A_ENG_US.pdf"
106
106
  * });
107
- * file_name = download.suggestedFilename();
107
+ * const file_name = download.suggestedFilename();
108
108
  * return file_name;
109
109
  *
110
110
  * }
@@ -123,7 +123,7 @@ export declare function sanitizeHtml(options: SanitizeHtmlOptions): string;
123
123
  * page,
124
124
  * trigger: page.locator("xpath=//tbody/tr[1]//*[name()='svg']")
125
125
  * });
126
- * file_name = download.suggestedFilename();
126
+ * const file_name = download.suggestedFilename();
127
127
  * return file_name;
128
128
  * }
129
129
  * ```
@@ -143,7 +143,7 @@ export declare function sanitizeHtml(options: SanitizeHtmlOptions): string;
143
143
  * await page.locator("xpath=//tbody/tr[1]//*[name()='svg']").click();
144
144
  * }
145
145
  * });
146
- * file_name = download.suggestedFilename();
146
+ * const file_name = download.suggestedFilename();
147
147
  * return file_name;
148
148
  * }
149
149
  * ```
@@ -752,7 +752,7 @@ export declare function withNetworkSettledWait<T>(
752
752
  page: Page;
753
753
  timeoutInMs?: number;
754
754
  maxInflightRequests?: number;
755
- }
755
+ },
756
756
  ): Promise<T>;
757
757
 
758
758
  /**
@@ -1292,7 +1292,7 @@ export type FileType = Download | Uint8Array | Buffer | ReadStream;
1292
1292
  * export default async function handler(params: Params, page: Page, context: BrowserContext){
1293
1293
  * const uploadedFile = await saveFileToS3({
1294
1294
  * page,
1295
- * trigger: "https://sandbox.intuned.dev/pdfs/report.pdf",
1295
+ * trigger: "https://intuned-docs-public-images.s3.amazonaws.com/27UP600_27UP650_ENG_US.pdf",
1296
1296
  * configs: {
1297
1297
  * bucket: 'document-storage',
1298
1298
  * region: 'us-east-1',
@@ -104,7 +104,7 @@ export declare function sanitizeHtml(options: SanitizeHtmlOptions): string;
104
104
  * page,
105
105
  * trigger: "https://intuned-docs-public-images.s3.amazonaws.com/32UP83A_ENG_US.pdf"
106
106
  * });
107
- * file_name = download.suggestedFilename();
107
+ * const file_name = download.suggestedFilename();
108
108
  * return file_name;
109
109
  *
110
110
  * }
@@ -123,7 +123,7 @@ export declare function sanitizeHtml(options: SanitizeHtmlOptions): string;
123
123
  * page,
124
124
  * trigger: page.locator("xpath=//tbody/tr[1]//*[name()='svg']")
125
125
  * });
126
- * file_name = download.suggestedFilename();
126
+ * const file_name = download.suggestedFilename();
127
127
  * return file_name;
128
128
  * }
129
129
  * ```
@@ -143,7 +143,7 @@ export declare function sanitizeHtml(options: SanitizeHtmlOptions): string;
143
143
  * await page.locator("xpath=//tbody/tr[1]//*[name()='svg']").click();
144
144
  * }
145
145
  * });
146
- * file_name = download.suggestedFilename();
146
+ * const file_name = download.suggestedFilename();
147
147
  * return file_name;
148
148
  * }
149
149
  * ```
@@ -752,7 +752,7 @@ export declare function withNetworkSettledWait<T>(
752
752
  page: Page;
753
753
  timeoutInMs?: number;
754
754
  maxInflightRequests?: number;
755
- }
755
+ },
756
756
  ): Promise<T>;
757
757
 
758
758
  /**
@@ -1292,7 +1292,7 @@ export type FileType = Download | Uint8Array | Buffer | ReadStream;
1292
1292
  * export default async function handler(params: Params, page: Page, context: BrowserContext){
1293
1293
  * const uploadedFile = await saveFileToS3({
1294
1294
  * page,
1295
- * trigger: "https://sandbox.intuned.dev/pdfs/report.pdf",
1295
+ * trigger: "https://intuned-docs-public-images.s3.amazonaws.com/27UP600_27UP650_ENG_US.pdf",
1296
1296
  * configs: {
1297
1297
  * bucket: 'document-storage',
1298
1298
  * region: 'us-east-1',
@@ -10,6 +10,7 @@ var _OpenAI = require("./providers/OpenAI");
10
10
  var _Gemini = require("./providers/Gemini");
11
11
  var _dotenv = require("dotenv");
12
12
  var _loadRuntime = require("../../common/loadRuntime");
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
14
  (0, _dotenv.config)();
14
15
  class APIGateway {
15
16
  useGateway = false;
@@ -39,6 +40,15 @@ class APIGateway {
39
40
  this.config = this.getDefaultConfig();
40
41
  this.validateGatewayConfig(this.config);
41
42
  this.useGateway = true;
43
+ try {
44
+ const runtime = await Promise.resolve().then(() => _interopRequireWildcard(require("@intuned/runtime")));
45
+ const {
46
+ apiKey
47
+ } = runtime.getAiGatewayConfig();
48
+ if (apiKey) {
49
+ this.gatewayAuthToken = apiKey;
50
+ }
51
+ } catch {}
42
52
  this.isInitialized = true;
43
53
  }
44
54
  getApiKeyFromEnv(provider) {
@@ -108,7 +118,7 @@ class APIGateway {
108
118
  const baseUrl = this.buildGatewayUrl();
109
119
  return {
110
120
  model: this.model,
111
- apiKey: "--THIS_VALUE_WILL_BE_REPLACED_BY_INTUNED_BE--",
121
+ apiKey: this.gatewayAuthToken,
112
122
  extraHeaders,
113
123
  baseUrl
114
124
  };
@@ -17,7 +17,7 @@ const createAnthropicInstance = input => {
17
17
  });
18
18
  } else {
19
19
  return (0, _anthropic.createAnthropic)({
20
- apiKey: "--THI_VALUE_WILL_BE_REPLACED_BY_INTUNED_BE--",
20
+ apiKey: apiKey || "--THI_VALUE_WILL_BE_REPLACED_BY_INTUNED_BE--",
21
21
  baseURL: baseUrl,
22
22
  fetch: _jwtTokenManager.backendFunctionsTokenManager.fetchWithToken.bind(_jwtTokenManager.backendFunctionsTokenManager)
23
23
  });
@@ -19,7 +19,7 @@ const createGoogleInstance = input => {
19
19
  });
20
20
  } else {
21
21
  return (0, _google.createGoogleGenerativeAI)({
22
- apiKey: "--THI_VALUE_WILL_BE_REPLACED_BY_INTUNED_BE--",
22
+ apiKey: apiKey || "--THI_VALUE_WILL_BE_REPLACED_BY_INTUNED_BE--",
23
23
  headers,
24
24
  baseURL: baseUrl,
25
25
  fetch: _jwtTokenManager.backendFunctionsTokenManager.fetchWithToken.bind(_jwtTokenManager.backendFunctionsTokenManager)
@@ -19,7 +19,7 @@ const createOpenAIInstance = input => {
19
19
  });
20
20
  } else {
21
21
  return (0, _openai.createOpenAI)({
22
- apiKey: "--THI_VALUE_WILL_BE_REPLACED_BY_INTUNED_BE--",
22
+ apiKey: apiKey || "--THI_VALUE_WILL_BE_REPLACED_BY_INTUNED_BE--",
23
23
  headers,
24
24
  baseURL: baseUrl,
25
25
  fetch: _jwtTokenManager.backendFunctionsTokenManager.fetchWithToken.bind(_jwtTokenManager.backendFunctionsTokenManager)
@@ -233,7 +233,7 @@ const mockLoadRuntime = _vitest.vi.mocked(_loadRuntime.loadRuntime);
233
233
  });
234
234
  const result = await gateway.createProviderInstance();
235
235
  (0, _extendedTest.expect)(mockCreateAnthropicInstance).toHaveBeenCalledWith({
236
- apiKey: "--THIS_VALUE_WILL_BE_REPLACED_BY_INTUNED_BE--",
236
+ apiKey: undefined,
237
237
  headers: undefined,
238
238
  model: "claude-3-sonnet",
239
239
  baseUrl: "https://functions.example.com/api/workspace123/functions/integration456/intuned-ai-gateway"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/browser-dev",
3
- "version": "0.1.13-dev.0",
3
+ "version": "0.1.14-dev.1",
4
4
  "description": "runner package for intuned functions",
5
5
  "types": "./dist/index.d.ts",
6
6
  "typesVersions": {