@onkernel/sdk 0.13.0 → 0.14.0

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/client.d.mts +5 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +5 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/internal/to-file.d.mts +1 -1
  11. package/internal/to-file.d.ts +1 -1
  12. package/internal/to-file.js +1 -1
  13. package/internal/to-file.mjs +1 -1
  14. package/package.json +1 -1
  15. package/resources/browsers/browsers.d.mts +57 -1
  16. package/resources/browsers/browsers.d.mts.map +1 -1
  17. package/resources/browsers/browsers.d.ts +57 -1
  18. package/resources/browsers/browsers.d.ts.map +1 -1
  19. package/resources/browsers/browsers.js +20 -0
  20. package/resources/browsers/browsers.js.map +1 -1
  21. package/resources/browsers/browsers.mjs +20 -0
  22. package/resources/browsers/browsers.mjs.map +1 -1
  23. package/resources/browsers/index.d.mts +1 -1
  24. package/resources/browsers/index.d.mts.map +1 -1
  25. package/resources/browsers/index.d.ts +1 -1
  26. package/resources/browsers/index.d.ts.map +1 -1
  27. package/resources/browsers/index.js.map +1 -1
  28. package/resources/browsers/index.mjs.map +1 -1
  29. package/resources/extensions.d.mts +145 -0
  30. package/resources/extensions.d.mts.map +1 -0
  31. package/resources/extensions.d.ts +145 -0
  32. package/resources/extensions.d.ts.map +1 -0
  33. package/resources/extensions.js +94 -0
  34. package/resources/extensions.js.map +1 -0
  35. package/resources/extensions.mjs +90 -0
  36. package/resources/extensions.mjs.map +1 -0
  37. package/resources/index.d.mts +2 -1
  38. package/resources/index.d.mts.map +1 -1
  39. package/resources/index.d.ts +2 -1
  40. package/resources/index.d.ts.map +1 -1
  41. package/resources/index.js +3 -1
  42. package/resources/index.js.map +1 -1
  43. package/resources/index.mjs +1 -0
  44. package/resources/index.mjs.map +1 -1
  45. package/src/client.ts +19 -0
  46. package/src/internal/to-file.ts +1 -1
  47. package/src/resources/browsers/browsers.ts +77 -0
  48. package/src/resources/browsers/index.ts +1 -0
  49. package/src/resources/extensions.ts +200 -0
  50. package/src/resources/index.ts +8 -0
  51. package/src/version.ts +1 -1
  52. package/version.d.mts +1 -1
  53. package/version.d.ts +1 -1
  54. package/version.js +1 -1
  55. package/version.mjs +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions.js","sourceRoot":"","sources":["../src/resources/extensions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAEnD,oDAAkE;AAClE,oDAA8C;AAE9C,MAAa,UAAW,SAAQ,sBAAW;IACzC;;;;;;;OAOG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,EAAE,EAAE;YACxD,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,EAAE,EAAE;YACrD,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACjF,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,uBAAuB,CACrB,KAA6C,EAC7C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE;YACvD,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACjF,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3G,CAAC;CACF;AA1FD,gCA0FC"}
@@ -0,0 +1,90 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { buildHeaders } from "../internal/headers.mjs";
4
+ import { multipartFormRequestOptions } from "../internal/uploads.mjs";
5
+ import { path } from "../internal/utils/path.mjs";
6
+ export class Extensions extends APIResource {
7
+ /**
8
+ * List extensions owned by the caller's organization.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const extensions = await client.extensions.list();
13
+ * ```
14
+ */
15
+ list(options) {
16
+ return this._client.get('/extensions', options);
17
+ }
18
+ /**
19
+ * Delete an extension by its ID or by its name.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * await client.extensions.delete('id_or_name');
24
+ * ```
25
+ */
26
+ delete(idOrName, options) {
27
+ return this._client.delete(path `/extensions/${idOrName}`, {
28
+ ...options,
29
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
30
+ });
31
+ }
32
+ /**
33
+ * Download the extension as a ZIP archive by ID or name.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const response = await client.extensions.download(
38
+ * 'id_or_name',
39
+ * );
40
+ *
41
+ * const content = await response.blob();
42
+ * console.log(content);
43
+ * ```
44
+ */
45
+ download(idOrName, options) {
46
+ return this._client.get(path `/extensions/${idOrName}`, {
47
+ ...options,
48
+ headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
49
+ __binaryResponse: true,
50
+ });
51
+ }
52
+ /**
53
+ * Returns a ZIP archive containing the unpacked extension fetched from the Chrome
54
+ * Web Store.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const response =
59
+ * await client.extensions.downloadFromChromeStore({
60
+ * url: 'url',
61
+ * });
62
+ *
63
+ * const content = await response.blob();
64
+ * console.log(content);
65
+ * ```
66
+ */
67
+ downloadFromChromeStore(query, options) {
68
+ return this._client.get('/extensions/from_chrome_store', {
69
+ query,
70
+ ...options,
71
+ headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
72
+ __binaryResponse: true,
73
+ });
74
+ }
75
+ /**
76
+ * Upload a zip file containing an unpacked browser extension. Optionally provide a
77
+ * unique name for later reference.
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * const response = await client.extensions.upload({
82
+ * file: fs.createReadStream('path/to/file'),
83
+ * });
84
+ * ```
85
+ */
86
+ upload(body, options) {
87
+ return this._client.post('/extensions', multipartFormRequestOptions({ body, ...options }, this._client));
88
+ }
89
+ }
90
+ //# sourceMappingURL=extensions.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions.mjs","sourceRoot":"","sources":["../src/resources/extensions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,YAAY,EAAE;OAEhB,EAAE,2BAA2B,EAAE;OAC/B,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC;;;;;;;OAOG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAA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C;CACF"}
@@ -1,7 +1,8 @@
1
1
  export * from "./shared.mjs";
2
2
  export { Apps, type AppListResponse, type AppListParams } from "./apps.mjs";
3
- export { Browsers, type BrowserPersistence, type Profile, type BrowserCreateResponse, type BrowserRetrieveResponse, type BrowserListResponse, type BrowserCreateParams, type BrowserDeleteParams, } from "./browsers/browsers.mjs";
3
+ export { Browsers, type BrowserPersistence, type Profile, type BrowserCreateResponse, type BrowserRetrieveResponse, type BrowserListResponse, type BrowserCreateParams, type BrowserDeleteParams, type BrowserUploadExtensionsParams, } from "./browsers/browsers.mjs";
4
4
  export { Deployments, type DeploymentStateEvent, type DeploymentCreateResponse, type DeploymentRetrieveResponse, type DeploymentListResponse, type DeploymentFollowResponse, type DeploymentCreateParams, type DeploymentListParams, type DeploymentFollowParams, type DeploymentListResponsesOffsetPagination, } from "./deployments.mjs";
5
+ export { Extensions, type ExtensionListResponse, type ExtensionUploadResponse, type ExtensionDownloadFromChromeStoreParams, type ExtensionUploadParams, } from "./extensions.mjs";
5
6
  export { Invocations, type InvocationStateEvent, type InvocationCreateResponse, type InvocationRetrieveResponse, type InvocationUpdateResponse, type InvocationListResponse, type InvocationFollowResponse, type InvocationCreateParams, type InvocationUpdateParams, type InvocationListParams, type InvocationFollowParams, type InvocationListResponsesOffsetPagination, } from "./invocations.mjs";
6
7
  export { Profiles, type ProfileListResponse, type ProfileCreateParams } from "./profiles.mjs";
7
8
  export { Proxies, type ProxyCreateResponse, type ProxyRetrieveResponse, type ProxyListResponse, type ProxyCreateParams, } from "./proxies.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";OAGO,EAAE,IAAI,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE;OAClD,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,m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AAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,sCAAsC,EAC3C,KAAK,qBAAqB,GAC3B;OACM,EACL,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,uCAAuC,GAC7C;OACM,EAAE,QAAQ,EAAE,KAAK,mBAAmB,EAAE,KAAK,mBAAmB,EAAE;OAChE,EACL,OAAO,EACP,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB"}
@@ -1,7 +1,8 @@
1
1
  export * from "./shared.js";
2
2
  export { Apps, type AppListResponse, type AppListParams } from "./apps.js";
3
- export { Browsers, type BrowserPersistence, type Profile, type BrowserCreateResponse, type BrowserRetrieveResponse, type BrowserListResponse, type BrowserCreateParams, type BrowserDeleteParams, } from "./browsers/browsers.js";
3
+ export { Browsers, type BrowserPersistence, type Profile, type BrowserCreateResponse, type BrowserRetrieveResponse, type BrowserListResponse, type BrowserCreateParams, type BrowserDeleteParams, type BrowserUploadExtensionsParams, } from "./browsers/browsers.js";
4
4
  export { Deployments, type DeploymentStateEvent, type DeploymentCreateResponse, type DeploymentRetrieveResponse, type DeploymentListResponse, type DeploymentFollowResponse, type DeploymentCreateParams, type DeploymentListParams, type DeploymentFollowParams, type DeploymentListResponsesOffsetPagination, } from "./deployments.js";
5
+ export { Extensions, type ExtensionListResponse, type ExtensionUploadResponse, type ExtensionDownloadFromChromeStoreParams, type ExtensionUploadParams, } from "./extensions.js";
5
6
  export { Invocations, type InvocationStateEvent, type InvocationCreateResponse, type InvocationRetrieveResponse, type InvocationUpdateResponse, type InvocationListResponse, type InvocationFollowResponse, type InvocationCreateParams, type InvocationUpdateParams, type InvocationListParams, type InvocationFollowParams, type InvocationListResponsesOffsetPagination, } from "./invocations.js";
6
7
  export { Profiles, type ProfileListResponse, type ProfileCreateParams } from "./profiles.js";
7
8
  export { Proxies, type ProxyCreateResponse, type ProxyRetrieveResponse, type ProxyListResponse, type ProxyCreateParams, } from "./proxies.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";OAGO,EAAE,IAAI,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE;OAClD,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB;OACM,EACL,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,uCAAuC,GAC7C;OACM,EACL,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,uCAAuC,GAC7C;OACM,EAAE,QAAQ,EAAE,KAAK,mBAAmB,EAAE,KAAK,mBAAmB,EAAE;OAChE,EACL,OAAO,EACP,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";OAGO,EAAE,IAAI,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE;OAClD,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,GACnC;OACM,EACL,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,uCAAuC,GAC7C;OACM,EACL,UAAU,EACV,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,sCAAsC,EAC3C,KAAK,qBAAqB,GAC3B;OACM,EACL,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,uCAAuC,GAC7C;OACM,EAAE,QAAQ,EAAE,KAAK,mBAAmB,EAAE,KAAK,mBAAmB,EAAE;OAChE,EACL,OAAO,EACP,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Proxies = exports.Profiles = exports.Invocations = exports.Deployments = exports.Browsers = exports.Apps = void 0;
4
+ exports.Proxies = exports.Profiles = exports.Invocations = exports.Extensions = exports.Deployments = exports.Browsers = exports.Apps = void 0;
5
5
  const tslib_1 = require("../internal/tslib.js");
6
6
  tslib_1.__exportStar(require("./shared.js"), exports);
7
7
  var apps_1 = require("./apps.js");
@@ -10,6 +10,8 @@ var browsers_1 = require("./browsers/browsers.js");
10
10
  Object.defineProperty(exports, "Browsers", { enumerable: true, get: function () { return browsers_1.Browsers; } });
11
11
  var deployments_1 = require("./deployments.js");
12
12
  Object.defineProperty(exports, "Deployments", { enumerable: true, get: function () { return deployments_1.Deployments; } });
13
+ var extensions_1 = require("./extensions.js");
14
+ Object.defineProperty(exports, "Extensions", { enumerable: true, get: function () { return extensions_1.Extensions; } });
13
15
  var invocations_1 = require("./invocations.js");
14
16
  Object.defineProperty(exports, "Invocations", { enumerable: true, get: function () { return invocations_1.Invocations; } });
15
17
  var profiles_1 = require("./profiles.js");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,sDAAyB;AACzB,kCAAwE;AAA/D,4FAAA,IAAI,OAAA;AACb,mDAS6B;AAR3B,oGAAA,QAAQ,OAAA;AASV,gDAWuB;AAVrB,0GAAA,WAAW,OAAA;AAWb,gDAauB;AAZrB,0GAAA,WAAW,OAAA;AAab,0CAA0F;AAAjF,oGAAA,QAAQ,OAAA;AACjB,wCAMmB;AALjB,kGAAA,OAAO,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,sDAAyB;AACzB,kCAAwE;AAA/D,4FAAA,IAAI,OAAA;AACb,mDAU6B;AAT3B,oGAAA,QAAQ,OAAA;AAUV,gDAWuB;AAVrB,0GAAA,WAAW,OAAA;AAWb,8CAMsB;AALpB,wGAAA,UAAU,OAAA;AAMZ,gDAauB;AAZrB,0GAAA,WAAW,OAAA;AAab,0CAA0F;AAAjF,oGAAA,QAAQ,OAAA;AACjB,wCAMmB;AALjB,kGAAA,OAAO,OAAA"}
@@ -3,6 +3,7 @@ export * from "./shared.mjs";
3
3
  export { Apps } from "./apps.mjs";
4
4
  export { Browsers, } from "./browsers/browsers.mjs";
5
5
  export { Deployments, } from "./deployments.mjs";
6
+ export { Extensions, } from "./extensions.mjs";
6
7
  export { Invocations, } from "./invocations.mjs";
7
8
  export { Profiles } from "./profiles.mjs";
8
9
  export { Proxies, } from "./proxies.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,EAAE,IAAI,EAA4C;OAClD,EACL,QAAQ,GAQT;OACM,EACL,WAAW,GAUZ;OACM,EACL,WAAW,GAYZ;OACM,EAAE,QAAQ,EAAsD;OAChE,EACL,OAAO,GAKR"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,EAAE,IAAI,EAA4C;OAClD,EACL,QAAQ,GAST;OACM,EACL,WAAW,GAUZ;OACM,EACL,UAAU,GAKX;OACM,EACL,WAAW,GAYZ;OACM,EAAE,QAAQ,EAAsD;OAChE,EACL,OAAO,GAKR"}
package/src/client.ts CHANGED
@@ -32,6 +32,13 @@ import {
32
32
  Deployments,
33
33
  } from './resources/deployments';
34
34
  import { KernelApp } from './core/app-framework';
35
+ import {
36
+ ExtensionDownloadFromChromeStoreParams,
37
+ ExtensionListResponse,
38
+ ExtensionUploadParams,
39
+ ExtensionUploadResponse,
40
+ Extensions,
41
+ } from './resources/extensions';
35
42
  import {
36
43
  InvocationCreateParams,
37
44
  InvocationCreateResponse,
@@ -61,6 +68,7 @@ import {
61
68
  BrowserListResponse,
62
69
  BrowserPersistence,
63
70
  BrowserRetrieveResponse,
71
+ BrowserUploadExtensionsParams,
64
72
  Browsers,
65
73
  Profile,
66
74
  } from './resources/browsers/browsers';
@@ -832,6 +840,7 @@ export class Kernel {
832
840
  browsers: API.Browsers = new API.Browsers(this);
833
841
  profiles: API.Profiles = new API.Profiles(this);
834
842
  proxies: API.Proxies = new API.Proxies(this);
843
+ extensions: API.Extensions = new API.Extensions(this);
835
844
  }
836
845
 
837
846
  Kernel.Deployments = Deployments;
@@ -840,6 +849,7 @@ Kernel.Invocations = Invocations;
840
849
  Kernel.Browsers = Browsers;
841
850
  Kernel.Profiles = Profiles;
842
851
  Kernel.Proxies = Proxies;
852
+ Kernel.Extensions = Extensions;
843
853
 
844
854
  export declare namespace Kernel {
845
855
  export type RequestOptions = Opts.RequestOptions;
@@ -889,6 +899,7 @@ export declare namespace Kernel {
889
899
  type BrowserListResponse as BrowserListResponse,
890
900
  type BrowserCreateParams as BrowserCreateParams,
891
901
  type BrowserDeleteParams as BrowserDeleteParams,
902
+ type BrowserUploadExtensionsParams as BrowserUploadExtensionsParams,
892
903
  };
893
904
 
894
905
  export {
@@ -905,6 +916,14 @@ export declare namespace Kernel {
905
916
  type ProxyCreateParams as ProxyCreateParams,
906
917
  };
907
918
 
919
+ export {
920
+ Extensions as Extensions,
921
+ type ExtensionListResponse as ExtensionListResponse,
922
+ type ExtensionUploadResponse as ExtensionUploadResponse,
923
+ type ExtensionDownloadFromChromeStoreParams as ExtensionDownloadFromChromeStoreParams,
924
+ type ExtensionUploadParams as ExtensionUploadParams,
925
+ };
926
+
908
927
  export type AppAction = API.AppAction;
909
928
  export type ErrorDetail = API.ErrorDetail;
910
929
  export type ErrorEvent = API.ErrorEvent;
@@ -73,7 +73,7 @@ export type ToFileInput =
73
73
 
74
74
  /**
75
75
  * Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
76
- * @param value the raw content of the file. Can be an {@link Uploadable}, {@link BlobLikePart}, or {@link AsyncIterable} of {@link BlobLikePart}s
76
+ * @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts
77
77
  * @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
78
78
  * @param {Object=} options additional properties
79
79
  * @param {string=} options.type the MIME type of the content
@@ -48,8 +48,10 @@ import {
48
48
  Fs,
49
49
  } from './fs/fs';
50
50
  import { APIPromise } from '../../core/api-promise';
51
+ import { type Uploadable } from '../../core/uploads';
51
52
  import { buildHeaders } from '../../internal/headers';
52
53
  import { RequestOptions } from '../../internal/request-options';
54
+ import { multipartFormRequestOptions } from '../../internal/uploads';
53
55
  import { path } from '../../internal/utils/path';
54
56
 
55
57
  export class Browsers extends APIResource {
@@ -134,6 +136,36 @@ export class Browsers extends APIResource {
134
136
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
135
137
  });
136
138
  }
139
+
140
+ /**
141
+ * Loads one or more unpacked extensions and restarts Chromium on the browser
142
+ * instance.
143
+ *
144
+ * @example
145
+ * ```ts
146
+ * await client.browsers.uploadExtensions('id', {
147
+ * extensions: [
148
+ * {
149
+ * name: 'name',
150
+ * zip_file: fs.createReadStream('path/to/file'),
151
+ * },
152
+ * ],
153
+ * });
154
+ * ```
155
+ */
156
+ uploadExtensions(
157
+ id: string,
158
+ body: BrowserUploadExtensionsParams,
159
+ options?: RequestOptions,
160
+ ): APIPromise<void> {
161
+ return this._client.post(
162
+ path`/browsers/${id}/extensions`,
163
+ multipartFormRequestOptions(
164
+ { body, ...options, headers: buildHeaders([{ Accept: '*/*' }, options?.headers]) },
165
+ this._client,
166
+ ),
167
+ );
168
+ }
137
169
  }
138
170
 
139
171
  /**
@@ -340,6 +372,11 @@ export namespace BrowserListResponse {
340
372
  }
341
373
 
342
374
  export interface BrowserCreateParams {
375
+ /**
376
+ * List of browser extensions to load into the session. Provide each by id or name.
377
+ */
378
+ extensions?: Array<BrowserCreateParams.Extension>;
379
+
343
380
  /**
344
381
  * If true, launches the browser using a headless image (no VNC/GUI). Defaults to
345
382
  * false.
@@ -387,6 +424,23 @@ export interface BrowserCreateParams {
387
424
  }
388
425
 
389
426
  export namespace BrowserCreateParams {
427
+ /**
428
+ * Extension selection for the browser session. Provide either id or name of an
429
+ * extension uploaded to Kernel.
430
+ */
431
+ export interface Extension {
432
+ /**
433
+ * Extension ID to load for this browser session
434
+ */
435
+ id?: string;
436
+
437
+ /**
438
+ * Extension name to load for this browser session (instead of id). Must be 1-255
439
+ * characters, using letters, numbers, dots, underscores, or hyphens.
440
+ */
441
+ name?: string;
442
+ }
443
+
390
444
  /**
391
445
  * Profile selection for the browser session. Provide either id or name. If
392
446
  * specified, the matching profile will be loaded into the browser session.
@@ -419,6 +473,28 @@ export interface BrowserDeleteParams {
419
473
  persistent_id: string;
420
474
  }
421
475
 
476
+ export interface BrowserUploadExtensionsParams {
477
+ /**
478
+ * List of extensions to upload and activate
479
+ */
480
+ extensions: Array<BrowserUploadExtensionsParams.Extension>;
481
+ }
482
+
483
+ export namespace BrowserUploadExtensionsParams {
484
+ export interface Extension {
485
+ /**
486
+ * Folder name to place the extension under /home/kernel/extensions/<name>
487
+ */
488
+ name: string;
489
+
490
+ /**
491
+ * Zip archive containing an unpacked Chromium extension (must include
492
+ * manifest.json)
493
+ */
494
+ zip_file: Uploadable;
495
+ }
496
+ }
497
+
422
498
  Browsers.Replays = Replays;
423
499
  Browsers.Fs = Fs;
424
500
  Browsers.Process = Process;
@@ -433,6 +509,7 @@ export declare namespace Browsers {
433
509
  type BrowserListResponse as BrowserListResponse,
434
510
  type BrowserCreateParams as BrowserCreateParams,
435
511
  type BrowserDeleteParams as BrowserDeleteParams,
512
+ type BrowserUploadExtensionsParams as BrowserUploadExtensionsParams,
436
513
  };
437
514
 
438
515
  export {
@@ -9,6 +9,7 @@ export {
9
9
  type BrowserListResponse,
10
10
  type BrowserCreateParams,
11
11
  type BrowserDeleteParams,
12
+ type BrowserUploadExtensionsParams,
12
13
  } from './browsers';
13
14
  export {
14
15
  Fs,
@@ -0,0 +1,200 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { type Uploadable } from '../core/uploads';
6
+ import { buildHeaders } from '../internal/headers';
7
+ import { RequestOptions } from '../internal/request-options';
8
+ import { multipartFormRequestOptions } from '../internal/uploads';
9
+ import { path } from '../internal/utils/path';
10
+
11
+ export class Extensions extends APIResource {
12
+ /**
13
+ * List extensions owned by the caller's organization.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const extensions = await client.extensions.list();
18
+ * ```
19
+ */
20
+ list(options?: RequestOptions): APIPromise<ExtensionListResponse> {
21
+ return this._client.get('/extensions', options);
22
+ }
23
+
24
+ /**
25
+ * Delete an extension by its ID or by its name.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * await client.extensions.delete('id_or_name');
30
+ * ```
31
+ */
32
+ delete(idOrName: string, options?: RequestOptions): APIPromise<void> {
33
+ return this._client.delete(path`/extensions/${idOrName}`, {
34
+ ...options,
35
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
36
+ });
37
+ }
38
+
39
+ /**
40
+ * Download the extension as a ZIP archive by ID or name.
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const response = await client.extensions.download(
45
+ * 'id_or_name',
46
+ * );
47
+ *
48
+ * const content = await response.blob();
49
+ * console.log(content);
50
+ * ```
51
+ */
52
+ download(idOrName: string, options?: RequestOptions): APIPromise<Response> {
53
+ return this._client.get(path`/extensions/${idOrName}`, {
54
+ ...options,
55
+ headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
56
+ __binaryResponse: true,
57
+ });
58
+ }
59
+
60
+ /**
61
+ * Returns a ZIP archive containing the unpacked extension fetched from the Chrome
62
+ * Web Store.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const response =
67
+ * await client.extensions.downloadFromChromeStore({
68
+ * url: 'url',
69
+ * });
70
+ *
71
+ * const content = await response.blob();
72
+ * console.log(content);
73
+ * ```
74
+ */
75
+ downloadFromChromeStore(
76
+ query: ExtensionDownloadFromChromeStoreParams,
77
+ options?: RequestOptions,
78
+ ): APIPromise<Response> {
79
+ return this._client.get('/extensions/from_chrome_store', {
80
+ query,
81
+ ...options,
82
+ headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
83
+ __binaryResponse: true,
84
+ });
85
+ }
86
+
87
+ /**
88
+ * Upload a zip file containing an unpacked browser extension. Optionally provide a
89
+ * unique name for later reference.
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * const response = await client.extensions.upload({
94
+ * file: fs.createReadStream('path/to/file'),
95
+ * });
96
+ * ```
97
+ */
98
+ upload(body: ExtensionUploadParams, options?: RequestOptions): APIPromise<ExtensionUploadResponse> {
99
+ return this._client.post('/extensions', multipartFormRequestOptions({ body, ...options }, this._client));
100
+ }
101
+ }
102
+
103
+ export type ExtensionListResponse = Array<ExtensionListResponse.ExtensionListResponseItem>;
104
+
105
+ export namespace ExtensionListResponse {
106
+ /**
107
+ * A browser extension uploaded to Kernel.
108
+ */
109
+ export interface ExtensionListResponseItem {
110
+ /**
111
+ * Unique identifier for the extension
112
+ */
113
+ id: string;
114
+
115
+ /**
116
+ * Timestamp when the extension was created
117
+ */
118
+ created_at: string;
119
+
120
+ /**
121
+ * Size of the extension archive in bytes
122
+ */
123
+ size_bytes: number;
124
+
125
+ /**
126
+ * Timestamp when the extension was last used
127
+ */
128
+ last_used_at?: string | null;
129
+
130
+ /**
131
+ * Optional, easier-to-reference name for the extension. Must be unique within the
132
+ * organization.
133
+ */
134
+ name?: string | null;
135
+ }
136
+ }
137
+
138
+ /**
139
+ * A browser extension uploaded to Kernel.
140
+ */
141
+ export interface ExtensionUploadResponse {
142
+ /**
143
+ * Unique identifier for the extension
144
+ */
145
+ id: string;
146
+
147
+ /**
148
+ * Timestamp when the extension was created
149
+ */
150
+ created_at: string;
151
+
152
+ /**
153
+ * Size of the extension archive in bytes
154
+ */
155
+ size_bytes: number;
156
+
157
+ /**
158
+ * Timestamp when the extension was last used
159
+ */
160
+ last_used_at?: string | null;
161
+
162
+ /**
163
+ * Optional, easier-to-reference name for the extension. Must be unique within the
164
+ * organization.
165
+ */
166
+ name?: string | null;
167
+ }
168
+
169
+ export interface ExtensionDownloadFromChromeStoreParams {
170
+ /**
171
+ * Chrome Web Store URL for the extension.
172
+ */
173
+ url: string;
174
+
175
+ /**
176
+ * Target operating system for the extension package. Defaults to linux.
177
+ */
178
+ os?: 'win' | 'mac' | 'linux';
179
+ }
180
+
181
+ export interface ExtensionUploadParams {
182
+ /**
183
+ * ZIP file containing the browser extension.
184
+ */
185
+ file: Uploadable;
186
+
187
+ /**
188
+ * Optional unique name within the organization to reference this extension.
189
+ */
190
+ name?: string;
191
+ }
192
+
193
+ export declare namespace Extensions {
194
+ export {
195
+ type ExtensionListResponse as ExtensionListResponse,
196
+ type ExtensionUploadResponse as ExtensionUploadResponse,
197
+ type ExtensionDownloadFromChromeStoreParams as ExtensionDownloadFromChromeStoreParams,
198
+ type ExtensionUploadParams as ExtensionUploadParams,
199
+ };
200
+ }
@@ -11,6 +11,7 @@ export {
11
11
  type BrowserListResponse,
12
12
  type BrowserCreateParams,
13
13
  type BrowserDeleteParams,
14
+ type BrowserUploadExtensionsParams,
14
15
  } from './browsers/browsers';
15
16
  export {
16
17
  Deployments,
@@ -24,6 +25,13 @@ export {
24
25
  type DeploymentFollowParams,
25
26
  type DeploymentListResponsesOffsetPagination,
26
27
  } from './deployments';
28
+ export {
29
+ Extensions,
30
+ type ExtensionListResponse,
31
+ type ExtensionUploadResponse,
32
+ type ExtensionDownloadFromChromeStoreParams,
33
+ type ExtensionUploadParams,
34
+ } from './extensions';
27
35
  export {
28
36
  Invocations,
29
37
  type InvocationStateEvent,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.13.0'; // x-release-please-version
1
+ export const VERSION = '0.14.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.13.0";
1
+ export declare const VERSION = "0.14.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.13.0";
1
+ export declare const VERSION = "0.14.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.13.0'; // x-release-please-version
4
+ exports.VERSION = '0.14.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.13.0'; // x-release-please-version
1
+ export const VERSION = '0.14.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map