@onkernel/sdk 0.1.0-alpha.1 → 0.1.0-alpha.11

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 (117) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/README.md +34 -45
  3. package/client.d.mts +28 -6
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +28 -6
  6. package/client.d.ts.map +1 -1
  7. package/client.js +28 -8
  8. package/client.js.map +1 -1
  9. package/client.mjs +28 -8
  10. package/client.mjs.map +1 -1
  11. package/core/app-framework.d.mts +49 -0
  12. package/core/app-framework.d.mts.map +1 -0
  13. package/core/app-framework.d.ts +49 -0
  14. package/core/app-framework.d.ts.map +1 -0
  15. package/core/app-framework.js +105 -0
  16. package/core/app-framework.js.map +1 -0
  17. package/core/app-framework.mjs +101 -0
  18. package/core/app-framework.mjs.map +1 -0
  19. package/index.d.mts +1 -0
  20. package/index.d.mts.map +1 -1
  21. package/index.d.ts +1 -0
  22. package/index.d.ts.map +1 -1
  23. package/index.js +3 -1
  24. package/index.js.map +1 -1
  25. package/index.mjs +1 -0
  26. package/index.mjs.map +1 -1
  27. package/internal/headers.js +1 -1
  28. package/internal/headers.js.map +1 -1
  29. package/internal/headers.mjs +1 -1
  30. package/internal/headers.mjs.map +1 -1
  31. package/internal/tslib.js +17 -17
  32. package/package.json +1 -4
  33. package/resources/apps/apps.d.mts +14 -0
  34. package/resources/apps/apps.d.mts.map +1 -0
  35. package/resources/apps/apps.d.ts +14 -0
  36. package/resources/apps/apps.d.ts.map +1 -0
  37. package/resources/apps/apps.js +21 -0
  38. package/resources/apps/apps.js.map +1 -0
  39. package/resources/apps/apps.mjs +16 -0
  40. package/resources/apps/apps.mjs.map +1 -0
  41. package/resources/apps/deployments.d.mts +82 -0
  42. package/resources/apps/deployments.d.mts.map +1 -0
  43. package/resources/apps/deployments.d.ts +82 -0
  44. package/resources/apps/deployments.d.ts.map +1 -0
  45. package/resources/apps/deployments.js +24 -0
  46. package/resources/apps/deployments.js.map +1 -0
  47. package/resources/apps/deployments.mjs +20 -0
  48. package/resources/apps/deployments.mjs.map +1 -0
  49. package/resources/apps/index.d.mts +4 -0
  50. package/resources/apps/index.d.mts.map +1 -0
  51. package/resources/apps/index.d.ts +4 -0
  52. package/resources/apps/index.d.ts.map +1 -0
  53. package/resources/apps/index.js +11 -0
  54. package/resources/apps/index.js.map +1 -0
  55. package/resources/apps/index.mjs +5 -0
  56. package/resources/apps/index.mjs.map +1 -0
  57. package/resources/apps/invocations.d.mts +110 -0
  58. package/resources/apps/invocations.d.mts.map +1 -0
  59. package/resources/apps/invocations.d.ts +110 -0
  60. package/resources/apps/invocations.d.ts.map +1 -0
  61. package/resources/apps/invocations.js +38 -0
  62. package/resources/apps/invocations.js.map +1 -0
  63. package/resources/apps/invocations.mjs +34 -0
  64. package/resources/apps/invocations.mjs.map +1 -0
  65. package/resources/apps.d.mts +1 -111
  66. package/resources/apps.d.mts.map +1 -1
  67. package/resources/apps.d.ts +1 -111
  68. package/resources/apps.d.ts.map +1 -1
  69. package/resources/apps.js +2 -50
  70. package/resources/apps.js.map +1 -1
  71. package/resources/apps.mjs +1 -48
  72. package/resources/apps.mjs.map +1 -1
  73. package/resources/browsers.d.mts +65 -0
  74. package/resources/browsers.d.mts.map +1 -0
  75. package/resources/browsers.d.ts +65 -0
  76. package/resources/browsers.d.ts.map +1 -0
  77. package/resources/browsers.js +36 -0
  78. package/resources/browsers.js.map +1 -0
  79. package/resources/browsers.mjs +32 -0
  80. package/resources/browsers.mjs.map +1 -0
  81. package/resources/index.d.mts +2 -2
  82. package/resources/index.d.mts.map +1 -1
  83. package/resources/index.d.ts +2 -2
  84. package/resources/index.d.ts.map +1 -1
  85. package/resources/index.js +4 -4
  86. package/resources/index.js.map +1 -1
  87. package/resources/index.mjs +2 -2
  88. package/resources/index.mjs.map +1 -1
  89. package/src/client.ts +53 -22
  90. package/src/core/app-framework.ts +137 -0
  91. package/src/index.ts +2 -0
  92. package/src/internal/headers.ts +1 -1
  93. package/src/resources/apps/apps.ts +35 -0
  94. package/src/resources/apps/deployments.ts +103 -0
  95. package/src/resources/apps/index.ts +10 -0
  96. package/src/resources/apps/invocations.ts +140 -0
  97. package/src/resources/apps.ts +1 -148
  98. package/src/resources/browsers.ts +85 -0
  99. package/src/resources/index.ts +6 -8
  100. package/src/version.ts +1 -1
  101. package/version.d.mts +1 -1
  102. package/version.d.mts.map +1 -1
  103. package/version.d.ts +1 -1
  104. package/version.d.ts.map +1 -1
  105. package/version.js +1 -1
  106. package/version.js.map +1 -1
  107. package/version.mjs +1 -1
  108. package/version.mjs.map +1 -1
  109. package/resources/browser.d.mts +0 -27
  110. package/resources/browser.d.mts.map +0 -1
  111. package/resources/browser.d.ts +0 -27
  112. package/resources/browser.d.ts.map +0 -1
  113. package/resources/browser.js +0 -15
  114. package/resources/browser.js.map +0 -1
  115. package/resources/browser.mjs +0 -11
  116. package/resources/browser.mjs.map +0 -1
  117. package/src/resources/browser.ts +0 -35
package/internal/tslib.js CHANGED
@@ -1,26 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.__setModuleDefault = exports.__createBinding = void 0;
4
+ exports.__importStar = __importStar;
4
5
  exports.__classPrivateFieldSet = __classPrivateFieldSet;
5
6
  exports.__classPrivateFieldGet = __classPrivateFieldGet;
6
- exports.__importStar = __importStar;
7
7
  exports.__exportStar = __exportStar;
8
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
9
- if (kind === "m")
10
- throw new TypeError("Private method is not writable");
11
- if (kind === "a" && !f)
12
- throw new TypeError("Private accessor was defined without a setter");
13
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
14
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
15
- return kind === "a" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;
16
- }
17
- function __classPrivateFieldGet(receiver, state, kind, f) {
18
- if (kind === "a" && !f)
19
- throw new TypeError("Private accessor was defined without a getter");
20
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
21
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
22
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
23
- }
24
8
  var __createBinding = Object.create
25
9
  ? function (o, m, k, k2) {
26
10
  if (k2 === void 0)
@@ -74,6 +58,22 @@ function __importStar(mod) {
74
58
  __setModuleDefault(result, mod);
75
59
  return result;
76
60
  }
61
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
62
+ if (kind === "m")
63
+ throw new TypeError("Private method is not writable");
64
+ if (kind === "a" && !f)
65
+ throw new TypeError("Private accessor was defined without a setter");
66
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
67
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
68
+ return kind === "a" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;
69
+ }
70
+ function __classPrivateFieldGet(receiver, state, kind, f) {
71
+ if (kind === "a" && !f)
72
+ throw new TypeError("Private accessor was defined without a getter");
73
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
74
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
75
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
76
+ }
77
77
  function __exportStar(m, o) {
78
78
  for (var p in m)
79
79
  if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onkernel/sdk",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.11",
4
4
  "description": "The official TypeScript library for the Kernel API",
5
5
  "author": "Kernel <>",
6
6
  "types": "./index.d.ts",
@@ -138,8 +138,5 @@
138
138
  "./version.mjs": {
139
139
  "default": "./version.mjs"
140
140
  }
141
- },
142
- "engines": {
143
- "node": ">= 20"
144
141
  }
145
142
  }
@@ -0,0 +1,14 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as DeploymentsAPI from "./deployments.mjs";
3
+ import { DeploymentCreateParams, DeploymentCreateResponse, Deployments } from "./deployments.mjs";
4
+ import * as InvocationsAPI from "./invocations.mjs";
5
+ import { InvocationCreateParams, InvocationCreateResponse, InvocationRetrieveResponse, Invocations } from "./invocations.mjs";
6
+ export declare class Apps extends APIResource {
7
+ deployments: DeploymentsAPI.Deployments;
8
+ invocations: InvocationsAPI.Invocations;
9
+ }
10
+ export declare namespace Apps {
11
+ export { Deployments as Deployments, type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentCreateParams as DeploymentCreateParams, };
12
+ export { Invocations as Invocations, type InvocationCreateResponse as InvocationCreateResponse, type InvocationRetrieveResponse as InvocationRetrieveResponse, type InvocationCreateParams as InvocationCreateParams, };
13
+ }
14
+ //# sourceMappingURL=apps.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apps.d.mts","sourceRoot":"","sources":["../../src/resources/apps/apps.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,WAAW,EAAE;OACjE,KAAK,cAAc;OACnB,EACL,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,WAAW,EACZ;AAED,qBAAa,IAAK,SAAQ,WAAW;IACnC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;IACvF,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;CACxF;AAKD,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;IAEF,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,14 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as DeploymentsAPI from "./deployments.js";
3
+ import { DeploymentCreateParams, DeploymentCreateResponse, Deployments } from "./deployments.js";
4
+ import * as InvocationsAPI from "./invocations.js";
5
+ import { InvocationCreateParams, InvocationCreateResponse, InvocationRetrieveResponse, Invocations } from "./invocations.js";
6
+ export declare class Apps extends APIResource {
7
+ deployments: DeploymentsAPI.Deployments;
8
+ invocations: InvocationsAPI.Invocations;
9
+ }
10
+ export declare namespace Apps {
11
+ export { Deployments as Deployments, type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentCreateParams as DeploymentCreateParams, };
12
+ export { Invocations as Invocations, type InvocationCreateResponse as InvocationCreateResponse, type InvocationRetrieveResponse as InvocationRetrieveResponse, type InvocationCreateParams as InvocationCreateParams, };
13
+ }
14
+ //# sourceMappingURL=apps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/resources/apps/apps.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,WAAW,EAAE;OACjE,KAAK,cAAc;OACnB,EACL,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,WAAW,EACZ;AAED,qBAAa,IAAK,SAAQ,WAAW;IACnC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;IACvF,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;CACxF;AAKD,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;IAEF,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Apps = void 0;
5
+ const tslib_1 = require("../../internal/tslib.js");
6
+ const resource_1 = require("../../core/resource.js");
7
+ const DeploymentsAPI = tslib_1.__importStar(require("./deployments.js"));
8
+ const deployments_1 = require("./deployments.js");
9
+ const InvocationsAPI = tslib_1.__importStar(require("./invocations.js"));
10
+ const invocations_1 = require("./invocations.js");
11
+ class Apps extends resource_1.APIResource {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.deployments = new DeploymentsAPI.Deployments(this._client);
15
+ this.invocations = new InvocationsAPI.Invocations(this._client);
16
+ }
17
+ }
18
+ exports.Apps = Apps;
19
+ Apps.Deployments = deployments_1.Deployments;
20
+ Apps.Invocations = invocations_1.Invocations;
21
+ //# sourceMappingURL=apps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apps.js","sourceRoot":"","sources":["../../src/resources/apps/apps.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,yEAAgD;AAChD,kDAA8F;AAC9F,yEAAgD;AAChD,kDAKuB;AAEvB,MAAa,IAAK,SAAQ,sBAAW;IAArC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC;CAAA;AAHD,oBAGC;AAED,IAAI,CAAC,WAAW,GAAG,yBAAW,CAAC;AAC/B,IAAI,CAAC,WAAW,GAAG,yBAAW,CAAC"}
@@ -0,0 +1,16 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import * as DeploymentsAPI from "./deployments.mjs";
4
+ import { Deployments } from "./deployments.mjs";
5
+ import * as InvocationsAPI from "./invocations.mjs";
6
+ import { Invocations, } from "./invocations.mjs";
7
+ export class Apps extends APIResource {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.deployments = new DeploymentsAPI.Deployments(this._client);
11
+ this.invocations = new InvocationsAPI.Invocations(this._client);
12
+ }
13
+ }
14
+ Apps.Deployments = Deployments;
15
+ Apps.Invocations = Invocations;
16
+ //# sourceMappingURL=apps.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apps.mjs","sourceRoot":"","sources":["../../src/resources/apps/apps.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAAoD,WAAW,EAAE;OACjE,KAAK,cAAc;OACnB,EAIL,WAAW,GACZ;AAED,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvF,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzF,CAAC;CAAA;AAED,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;AAC/B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC"}
@@ -0,0 +1,82 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { type Uploadable } from "../../core/uploads.mjs";
4
+ import { RequestOptions } from "../../internal/request-options.mjs";
5
+ export declare class Deployments extends APIResource {
6
+ /**
7
+ * Deploy a new application
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const deployment = await client.apps.deployments.create({
12
+ * entrypoint_rel_path: 'src/app.py',
13
+ * file: fs.createReadStream('path/to/file'),
14
+ * });
15
+ * ```
16
+ */
17
+ create(body: DeploymentCreateParams, options?: RequestOptions): APIPromise<DeploymentCreateResponse>;
18
+ }
19
+ export interface DeploymentCreateResponse {
20
+ /**
21
+ * List of apps deployed
22
+ */
23
+ apps: Array<DeploymentCreateResponse.App>;
24
+ /**
25
+ * Current status of the deployment
26
+ */
27
+ status: 'queued' | 'deploying' | 'succeeded' | 'failed';
28
+ /**
29
+ * Status reason
30
+ */
31
+ status_reason?: string;
32
+ }
33
+ export declare namespace DeploymentCreateResponse {
34
+ interface App {
35
+ /**
36
+ * ID for the app version deployed
37
+ */
38
+ id: string;
39
+ /**
40
+ * List of actions available on the app
41
+ */
42
+ actions: Array<App.Action>;
43
+ /**
44
+ * Name of the app
45
+ */
46
+ name: string;
47
+ }
48
+ namespace App {
49
+ interface Action {
50
+ /**
51
+ * Name of the action
52
+ */
53
+ name: string;
54
+ }
55
+ }
56
+ }
57
+ export interface DeploymentCreateParams {
58
+ /**
59
+ * Relative path to the entrypoint of the application
60
+ */
61
+ entrypoint_rel_path: string;
62
+ /**
63
+ * ZIP file containing the application source directory
64
+ */
65
+ file: Uploadable;
66
+ /**
67
+ * Allow overwriting an existing app version
68
+ */
69
+ force?: boolean;
70
+ /**
71
+ * Region for deployment. Currently we only support "aws.us-east-1a"
72
+ */
73
+ region?: 'aws.us-east-1a';
74
+ /**
75
+ * Version of the application. Can be any string.
76
+ */
77
+ version?: string;
78
+ }
79
+ export declare namespace Deployments {
80
+ export { type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentCreateParams as DeploymentCreateParams, };
81
+ }
82
+ //# sourceMappingURL=deployments.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployments.d.mts","sourceRoot":"","sources":["../../src/resources/apps/deployments.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OACnB,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrG;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;IAE1C;;OAEG;IACH,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;IAExD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,yBAAiB,wBAAwB,CAAC;IACxC,UAAiB,GAAG;QAClB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAE3B;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;IAED,UAAiB,GAAG,CAAC;QACnB,UAAiB,MAAM;YACrB;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;SACd;KACF;CACF;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,82 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { type Uploadable } from "../../core/uploads.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
5
+ export declare class Deployments extends APIResource {
6
+ /**
7
+ * Deploy a new application
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const deployment = await client.apps.deployments.create({
12
+ * entrypoint_rel_path: 'src/app.py',
13
+ * file: fs.createReadStream('path/to/file'),
14
+ * });
15
+ * ```
16
+ */
17
+ create(body: DeploymentCreateParams, options?: RequestOptions): APIPromise<DeploymentCreateResponse>;
18
+ }
19
+ export interface DeploymentCreateResponse {
20
+ /**
21
+ * List of apps deployed
22
+ */
23
+ apps: Array<DeploymentCreateResponse.App>;
24
+ /**
25
+ * Current status of the deployment
26
+ */
27
+ status: 'queued' | 'deploying' | 'succeeded' | 'failed';
28
+ /**
29
+ * Status reason
30
+ */
31
+ status_reason?: string;
32
+ }
33
+ export declare namespace DeploymentCreateResponse {
34
+ interface App {
35
+ /**
36
+ * ID for the app version deployed
37
+ */
38
+ id: string;
39
+ /**
40
+ * List of actions available on the app
41
+ */
42
+ actions: Array<App.Action>;
43
+ /**
44
+ * Name of the app
45
+ */
46
+ name: string;
47
+ }
48
+ namespace App {
49
+ interface Action {
50
+ /**
51
+ * Name of the action
52
+ */
53
+ name: string;
54
+ }
55
+ }
56
+ }
57
+ export interface DeploymentCreateParams {
58
+ /**
59
+ * Relative path to the entrypoint of the application
60
+ */
61
+ entrypoint_rel_path: string;
62
+ /**
63
+ * ZIP file containing the application source directory
64
+ */
65
+ file: Uploadable;
66
+ /**
67
+ * Allow overwriting an existing app version
68
+ */
69
+ force?: boolean;
70
+ /**
71
+ * Region for deployment. Currently we only support "aws.us-east-1a"
72
+ */
73
+ region?: 'aws.us-east-1a';
74
+ /**
75
+ * Version of the application. Can be any string.
76
+ */
77
+ version?: string;
78
+ }
79
+ export declare namespace Deployments {
80
+ export { type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentCreateParams as DeploymentCreateParams, };
81
+ }
82
+ //# sourceMappingURL=deployments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployments.d.ts","sourceRoot":"","sources":["../../src/resources/apps/deployments.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OACnB,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAGrG;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;IAE1C;;OAEG;IACH,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;IAExD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,yBAAiB,wBAAwB,CAAC;IACxC,UAAiB,GAAG;QAClB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAE3B;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;IAED,UAAiB,GAAG,CAAC;QACnB,UAAiB,MAAM;YACrB;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;SACd;KACF;CACF;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Deployments = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const uploads_1 = require("../../internal/uploads.js");
7
+ class Deployments extends resource_1.APIResource {
8
+ /**
9
+ * Deploy a new application
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const deployment = await client.apps.deployments.create({
14
+ * entrypoint_rel_path: 'src/app.py',
15
+ * file: fs.createReadStream('path/to/file'),
16
+ * });
17
+ * ```
18
+ */
19
+ create(body, options) {
20
+ return this._client.post('/deploy', (0, uploads_1.multipartFormRequestOptions)({ body, ...options }, this._client));
21
+ }
22
+ }
23
+ exports.Deployments = Deployments;
24
+ //# sourceMappingURL=deployments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployments.js","sourceRoot":"","sources":["../../src/resources/apps/deployments.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,uDAAqE;AAErE,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACvG,CAAC;CACF;AAfD,kCAeC"}
@@ -0,0 +1,20 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { multipartFormRequestOptions } from "../../internal/uploads.mjs";
4
+ export class Deployments extends APIResource {
5
+ /**
6
+ * Deploy a new application
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const deployment = await client.apps.deployments.create({
11
+ * entrypoint_rel_path: 'src/app.py',
12
+ * file: fs.createReadStream('path/to/file'),
13
+ * });
14
+ * ```
15
+ */
16
+ create(body, options) {
17
+ return this._client.post('/deploy', multipartFormRequestOptions({ body, ...options }, this._client));
18
+ }
19
+ }
20
+ //# sourceMappingURL=deployments.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deployments.mjs","sourceRoot":"","sources":["../../src/resources/apps/deployments.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAIf,EAAE,2BAA2B,EAAE;AAEtC,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,2BAA2B,CAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACvG,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ export { Apps } from "./apps.mjs";
2
+ export { Deployments, type DeploymentCreateResponse, type DeploymentCreateParams } from "./deployments.mjs";
3
+ export { Invocations, type InvocationCreateResponse, type InvocationRetrieveResponse, type InvocationCreateParams, } from "./invocations.mjs";
4
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EAAE,WAAW,EAAE,KAAK,wBAAwB,EAAE,KAAK,sBAAsB,EAAE;OAC3E,EACL,WAAW,EACX,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,GAC5B"}
@@ -0,0 +1,4 @@
1
+ export { Apps } from "./apps.js";
2
+ export { Deployments, type DeploymentCreateResponse, type DeploymentCreateParams } from "./deployments.js";
3
+ export { Invocations, type InvocationCreateResponse, type InvocationRetrieveResponse, type InvocationCreateParams, } from "./invocations.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EAAE,WAAW,EAAE,KAAK,wBAAwB,EAAE,KAAK,sBAAsB,EAAE;OAC3E,EACL,WAAW,EACX,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,GAC5B"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Invocations = exports.Deployments = exports.Apps = void 0;
5
+ var apps_1 = require("./apps.js");
6
+ Object.defineProperty(exports, "Apps", { enumerable: true, get: function () { return apps_1.Apps; } });
7
+ var deployments_1 = require("./deployments.js");
8
+ Object.defineProperty(exports, "Deployments", { enumerable: true, get: function () { return deployments_1.Deployments; } });
9
+ var invocations_1 = require("./invocations.js");
10
+ Object.defineProperty(exports, "Invocations", { enumerable: true, get: function () { return invocations_1.Invocations; } });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,gDAAwG;AAA/F,0GAAA,WAAW,OAAA;AACpB,gDAKuB;AAJrB,0GAAA,WAAW,OAAA"}
@@ -0,0 +1,5 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { Apps } from "./apps.mjs";
3
+ export { Deployments } from "./deployments.mjs";
4
+ export { Invocations, } from "./invocations.mjs";
5
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/apps/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAAE;OACR,EAAE,WAAW,EAA8D;OAC3E,EACL,WAAW,GAIZ"}
@@ -0,0 +1,110 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../internal/request-options.mjs";
4
+ export declare class Invocations extends APIResource {
5
+ /**
6
+ * Invoke an application
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const invocation = await client.apps.invocations.create({
11
+ * action_name: 'analyze',
12
+ * app_name: 'my-app',
13
+ * version: '1.0.0',
14
+ * });
15
+ * ```
16
+ */
17
+ create(body: InvocationCreateParams, options?: RequestOptions): APIPromise<InvocationCreateResponse>;
18
+ /**
19
+ * Get an app invocation by id
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const invocation = await client.apps.invocations.retrieve(
24
+ * 'ckqwer3o20000jb9s7abcdef',
25
+ * );
26
+ * ```
27
+ */
28
+ retrieve(id: string, options?: RequestOptions): APIPromise<InvocationRetrieveResponse>;
29
+ }
30
+ export interface InvocationCreateResponse {
31
+ /**
32
+ * ID of the invocation
33
+ */
34
+ id: string;
35
+ /**
36
+ * Status of the invocation
37
+ */
38
+ status: 'queued' | 'running' | 'succeeded' | 'failed';
39
+ /**
40
+ * The return value of the action that was invoked, rendered as a JSON string. This
41
+ * could be: string, number, boolean, array, object, or null.
42
+ */
43
+ output?: string;
44
+ /**
45
+ * Status reason
46
+ */
47
+ status_reason?: string;
48
+ }
49
+ export interface InvocationRetrieveResponse {
50
+ /**
51
+ * ID of the invocation
52
+ */
53
+ id: string;
54
+ /**
55
+ * Name of the action invoked
56
+ */
57
+ action_name: string;
58
+ /**
59
+ * Name of the application
60
+ */
61
+ app_name: string;
62
+ /**
63
+ * RFC 3339 Nanoseconds timestamp when the invocation started
64
+ */
65
+ started_at: string;
66
+ /**
67
+ * Status of the invocation
68
+ */
69
+ status: 'queued' | 'running' | 'succeeded' | 'failed';
70
+ /**
71
+ * RFC 3339 Nanoseconds timestamp when the invocation finished (null if still
72
+ * running)
73
+ */
74
+ finished_at?: string | null;
75
+ /**
76
+ * Output produced by the action, rendered as a JSON string. This could be: string,
77
+ * number, boolean, array, object, or null.
78
+ */
79
+ output?: string;
80
+ /**
81
+ * Payload provided to the invocation. This is a string that can be parsed as JSON.
82
+ */
83
+ payload?: string;
84
+ /**
85
+ * Status reason
86
+ */
87
+ status_reason?: string;
88
+ }
89
+ export interface InvocationCreateParams {
90
+ /**
91
+ * Name of the action to invoke
92
+ */
93
+ action_name: string;
94
+ /**
95
+ * Name of the application
96
+ */
97
+ app_name: string;
98
+ /**
99
+ * Version of the application
100
+ */
101
+ version: string;
102
+ /**
103
+ * Input data for the action, sent as a JSON string.
104
+ */
105
+ payload?: string;
106
+ }
107
+ export declare namespace Invocations {
108
+ export { type InvocationCreateResponse as InvocationCreateResponse, type InvocationRetrieveResponse as InvocationRetrieveResponse, type InvocationCreateParams as InvocationCreateParams, };
109
+ }
110
+ //# sourceMappingURL=invocations.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invocations.d.mts","sourceRoot":"","sources":["../../src/resources/apps/invocations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAIpG;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;CAGvF;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAEtD;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAEtD;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,110 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { RequestOptions } from "../../internal/request-options.js";
4
+ export declare class Invocations extends APIResource {
5
+ /**
6
+ * Invoke an application
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const invocation = await client.apps.invocations.create({
11
+ * action_name: 'analyze',
12
+ * app_name: 'my-app',
13
+ * version: '1.0.0',
14
+ * });
15
+ * ```
16
+ */
17
+ create(body: InvocationCreateParams, options?: RequestOptions): APIPromise<InvocationCreateResponse>;
18
+ /**
19
+ * Get an app invocation by id
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const invocation = await client.apps.invocations.retrieve(
24
+ * 'ckqwer3o20000jb9s7abcdef',
25
+ * );
26
+ * ```
27
+ */
28
+ retrieve(id: string, options?: RequestOptions): APIPromise<InvocationRetrieveResponse>;
29
+ }
30
+ export interface InvocationCreateResponse {
31
+ /**
32
+ * ID of the invocation
33
+ */
34
+ id: string;
35
+ /**
36
+ * Status of the invocation
37
+ */
38
+ status: 'queued' | 'running' | 'succeeded' | 'failed';
39
+ /**
40
+ * The return value of the action that was invoked, rendered as a JSON string. This
41
+ * could be: string, number, boolean, array, object, or null.
42
+ */
43
+ output?: string;
44
+ /**
45
+ * Status reason
46
+ */
47
+ status_reason?: string;
48
+ }
49
+ export interface InvocationRetrieveResponse {
50
+ /**
51
+ * ID of the invocation
52
+ */
53
+ id: string;
54
+ /**
55
+ * Name of the action invoked
56
+ */
57
+ action_name: string;
58
+ /**
59
+ * Name of the application
60
+ */
61
+ app_name: string;
62
+ /**
63
+ * RFC 3339 Nanoseconds timestamp when the invocation started
64
+ */
65
+ started_at: string;
66
+ /**
67
+ * Status of the invocation
68
+ */
69
+ status: 'queued' | 'running' | 'succeeded' | 'failed';
70
+ /**
71
+ * RFC 3339 Nanoseconds timestamp when the invocation finished (null if still
72
+ * running)
73
+ */
74
+ finished_at?: string | null;
75
+ /**
76
+ * Output produced by the action, rendered as a JSON string. This could be: string,
77
+ * number, boolean, array, object, or null.
78
+ */
79
+ output?: string;
80
+ /**
81
+ * Payload provided to the invocation. This is a string that can be parsed as JSON.
82
+ */
83
+ payload?: string;
84
+ /**
85
+ * Status reason
86
+ */
87
+ status_reason?: string;
88
+ }
89
+ export interface InvocationCreateParams {
90
+ /**
91
+ * Name of the action to invoke
92
+ */
93
+ action_name: string;
94
+ /**
95
+ * Name of the application
96
+ */
97
+ app_name: string;
98
+ /**
99
+ * Version of the application
100
+ */
101
+ version: string;
102
+ /**
103
+ * Input data for the action, sent as a JSON string.
104
+ */
105
+ payload?: string;
106
+ }
107
+ export declare namespace Invocations {
108
+ export { type InvocationCreateResponse as InvocationCreateResponse, type InvocationRetrieveResponse as InvocationRetrieveResponse, type InvocationCreateParams as InvocationCreateParams, };
109
+ }
110
+ //# sourceMappingURL=invocations.d.ts.map