@onkernel/sdk 0.11.0 → 0.11.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +31 -0
  3. package/client.d.mts +8 -2
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +8 -2
  6. package/client.d.ts.map +1 -1
  7. package/client.js +8 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +8 -0
  10. package/client.mjs.map +1 -1
  11. package/core/pagination.d.mts +53 -0
  12. package/core/pagination.d.mts.map +1 -0
  13. package/core/pagination.d.ts +53 -0
  14. package/core/pagination.d.ts.map +1 -0
  15. package/core/pagination.js +110 -0
  16. package/core/pagination.js.map +1 -0
  17. package/core/pagination.mjs +104 -0
  18. package/core/pagination.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/utils/values.js +3 -3
  28. package/internal/utils/values.js.map +1 -1
  29. package/internal/utils/values.mjs +3 -3
  30. package/internal/utils/values.mjs.map +1 -1
  31. package/package.json +11 -1
  32. package/pagination.d.mts +2 -0
  33. package/pagination.d.mts.map +1 -0
  34. package/pagination.d.ts +2 -0
  35. package/pagination.d.ts.map +1 -0
  36. package/pagination.js +6 -0
  37. package/pagination.js.map +1 -0
  38. package/pagination.mjs +2 -0
  39. package/pagination.mjs.map +1 -0
  40. package/resources/deployments.d.mts +45 -43
  41. package/resources/deployments.d.mts.map +1 -1
  42. package/resources/deployments.d.ts +45 -43
  43. package/resources/deployments.d.ts.map +1 -1
  44. package/resources/deployments.js +9 -2
  45. package/resources/deployments.js.map +1 -1
  46. package/resources/deployments.mjs +9 -2
  47. package/resources/deployments.mjs.map +1 -1
  48. package/resources/index.d.mts +1 -1
  49. package/resources/index.d.mts.map +1 -1
  50. package/resources/index.d.ts +1 -1
  51. package/resources/index.d.ts.map +1 -1
  52. package/resources/index.js.map +1 -1
  53. package/resources/index.mjs.map +1 -1
  54. package/src/client.ts +29 -0
  55. package/src/core/pagination.ts +167 -0
  56. package/src/index.ts +1 -0
  57. package/src/internal/utils/values.ts +3 -3
  58. package/src/pagination.ts +2 -0
  59. package/src/resources/deployments.ts +48 -42
  60. package/src/resources/index.ts +1 -0
  61. package/src/version.ts +1 -1
  62. package/version.d.mts +1 -1
  63. package/version.d.ts +1 -1
  64. package/version.js +1 -1
  65. package/version.mjs +1 -1
@@ -3,6 +3,7 @@
3
3
  import { APIResource } from '../core/resource';
4
4
  import * as Shared from './shared';
5
5
  import { APIPromise } from '../core/api-promise';
6
+ import { OffsetPagination, type OffsetPaginationParams, PagePromise } from '../core/pagination';
6
7
  import { Stream } from '../core/streaming';
7
8
  import { type Uploadable } from '../core/uploads';
8
9
  import { buildHeaders } from '../internal/headers';
@@ -43,14 +44,20 @@ export class Deployments extends APIResource {
43
44
  *
44
45
  * @example
45
46
  * ```ts
46
- * const deployments = await client.deployments.list();
47
+ * // Automatically fetches more pages as needed.
48
+ * for await (const deploymentListResponse of client.deployments.list()) {
49
+ * // ...
50
+ * }
47
51
  * ```
48
52
  */
49
53
  list(
50
54
  query: DeploymentListParams | null | undefined = {},
51
55
  options?: RequestOptions,
52
- ): APIPromise<DeploymentListResponse> {
53
- return this._client.get('/deployments', { query, ...options });
56
+ ): PagePromise<DeploymentListResponsesOffsetPagination, DeploymentListResponse> {
57
+ return this._client.getAPIList('/deployments', OffsetPagination<DeploymentListResponse>, {
58
+ query,
59
+ ...options,
60
+ });
54
61
  }
55
62
 
56
63
  /**
@@ -77,6 +84,8 @@ export class Deployments extends APIResource {
77
84
  }
78
85
  }
79
86
 
87
+ export type DeploymentListResponsesOffsetPagination = OffsetPagination<DeploymentListResponse>;
88
+
80
89
  /**
81
90
  * An event representing the current state of a deployment.
82
91
  */
@@ -234,53 +243,49 @@ export interface DeploymentRetrieveResponse {
234
243
  updated_at?: string | null;
235
244
  }
236
245
 
237
- export type DeploymentListResponse = Array<DeploymentListResponse.DeploymentListResponseItem>;
238
-
239
- export namespace DeploymentListResponse {
246
+ /**
247
+ * Deployment record information.
248
+ */
249
+ export interface DeploymentListResponse {
240
250
  /**
241
- * Deployment record information.
251
+ * Unique identifier for the deployment
242
252
  */
243
- export interface DeploymentListResponseItem {
244
- /**
245
- * Unique identifier for the deployment
246
- */
247
- id: string;
253
+ id: string;
248
254
 
249
- /**
250
- * Timestamp when the deployment was created
251
- */
252
- created_at: string;
255
+ /**
256
+ * Timestamp when the deployment was created
257
+ */
258
+ created_at: string;
253
259
 
254
- /**
255
- * Deployment region code
256
- */
257
- region: 'aws.us-east-1a';
260
+ /**
261
+ * Deployment region code
262
+ */
263
+ region: 'aws.us-east-1a';
258
264
 
259
- /**
260
- * Current status of the deployment
261
- */
262
- status: 'queued' | 'in_progress' | 'running' | 'failed' | 'stopped';
265
+ /**
266
+ * Current status of the deployment
267
+ */
268
+ status: 'queued' | 'in_progress' | 'running' | 'failed' | 'stopped';
263
269
 
264
- /**
265
- * Relative path to the application entrypoint
266
- */
267
- entrypoint_rel_path?: string;
270
+ /**
271
+ * Relative path to the application entrypoint
272
+ */
273
+ entrypoint_rel_path?: string;
268
274
 
269
- /**
270
- * Environment variables configured for this deployment
271
- */
272
- env_vars?: { [key: string]: string };
275
+ /**
276
+ * Environment variables configured for this deployment
277
+ */
278
+ env_vars?: { [key: string]: string };
273
279
 
274
- /**
275
- * Status reason
276
- */
277
- status_reason?: string;
280
+ /**
281
+ * Status reason
282
+ */
283
+ status_reason?: string;
278
284
 
279
- /**
280
- * Timestamp when the deployment was last updated
281
- */
282
- updated_at?: string | null;
283
- }
285
+ /**
286
+ * Timestamp when the deployment was last updated
287
+ */
288
+ updated_at?: string | null;
284
289
  }
285
290
 
286
291
  /**
@@ -373,7 +378,7 @@ export interface DeploymentCreateParams {
373
378
  version?: string;
374
379
  }
375
380
 
376
- export interface DeploymentListParams {
381
+ export interface DeploymentListParams extends OffsetPaginationParams {
377
382
  /**
378
383
  * Filter results by application name.
379
384
  */
@@ -394,6 +399,7 @@ export declare namespace Deployments {
394
399
  type DeploymentRetrieveResponse as DeploymentRetrieveResponse,
395
400
  type DeploymentListResponse as DeploymentListResponse,
396
401
  type DeploymentFollowResponse as DeploymentFollowResponse,
402
+ type DeploymentListResponsesOffsetPagination as DeploymentListResponsesOffsetPagination,
397
403
  type DeploymentCreateParams as DeploymentCreateParams,
398
404
  type DeploymentListParams as DeploymentListParams,
399
405
  type DeploymentFollowParams as DeploymentFollowParams,
@@ -22,6 +22,7 @@ export {
22
22
  type DeploymentCreateParams,
23
23
  type DeploymentListParams,
24
24
  type DeploymentFollowParams,
25
+ type DeploymentListResponsesOffsetPagination,
25
26
  } from './deployments';
26
27
  export {
27
28
  Invocations,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.11.0'; // x-release-please-version
1
+ export const VERSION = '0.11.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.11.0";
1
+ export declare const VERSION = "0.11.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.11.0";
1
+ export declare const VERSION = "0.11.1";
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.11.0'; // x-release-please-version
4
+ exports.VERSION = '0.11.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.11.0'; // x-release-please-version
1
+ export const VERSION = '0.11.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map