@scalepad/sdk-lm 0.1.0 → 0.1.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.
package/README.md ADDED
@@ -0,0 +1,90 @@
1
+ # @scalepad/sdk-lm
2
+
3
+ Typed client for the ScalePad Lifecycle Manager API routes used by the ScalePad CLI.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @scalepad/sdk-lm
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ import { createLifecycleManagerClient } from "@scalepad/sdk-lm";
15
+
16
+ const client = createLifecycleManagerClient({
17
+ apiKey: process.env.SCALEPAD_API_KEY!
18
+ });
19
+
20
+ const actionItems = await client.listActionItems({ pageSize: 10 });
21
+ console.log(actionItems.data);
22
+ ```
23
+
24
+ ## API
25
+
26
+ The package exports a generated client plus a small convenience wrapper.
27
+
28
+ Wrapper helpers:
29
+
30
+ - `createLifecycleManagerClient(config)`
31
+ - `ScalepadLifecycleManagerClient`
32
+ - `listActionItems(query)`
33
+ - `getActionItem(id)`
34
+
35
+ Generated and schema exports:
36
+
37
+ - `GeneratedLifecycleManagerClient`
38
+ - `lifecycleManagerOperations`
39
+ - `ScalepadLmApiError`
40
+ - `paths`
41
+
42
+ ## Client configuration
43
+
44
+ ```ts
45
+ type LifecycleManagerClientConfig = {
46
+ apiKey: string;
47
+ baseUrl?: string;
48
+ fetchImpl?: typeof fetch;
49
+ userAgent?: string;
50
+ maxRetries?: number;
51
+ };
52
+ ```
53
+
54
+ - `apiKey` is required and is sent as `x-api-key`
55
+ - `baseUrl` defaults to `https://api.scalepad.com`
56
+ - `fetchImpl` lets you inject a custom fetch implementation
57
+ - `userAgent` defaults to `@scalepad/cli`
58
+ - `maxRetries` controls retry attempts for `429` responses and defaults to `3`
59
+
60
+ ## List queries
61
+
62
+ List endpoints accept this shared shape:
63
+
64
+ ```ts
65
+ type ListQuery = {
66
+ cursor?: string;
67
+ pageSize?: number;
68
+ filters?: Record<string, string>;
69
+ sort?: string;
70
+ };
71
+ ```
72
+
73
+ Filters are translated to `filter[field]=expression` query parameters, and `pageSize` is translated to `page_size`.
74
+
75
+ ## Error handling
76
+
77
+ Failed responses throw `ScalepadLmApiError`, which includes:
78
+
79
+ - `status`: the HTTP status code
80
+ - `payload`: the parsed response body when one is available
81
+
82
+ ## Development
83
+
84
+ This package is generated from the checked-in OpenAPI spec in the monorepo root. To refresh or rebuild it:
85
+
86
+ ```bash
87
+ pnpm fetch:specs
88
+ pnpm generate:sdk
89
+ pnpm --filter @scalepad/sdk-lm build
90
+ ```
package/package.json CHANGED
@@ -1,9 +1,17 @@
1
1
  {
2
2
  "name": "@scalepad/sdk-lm",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
+ "description": "Typed ScalePad Lifecycle Manager API client used by the ScalePad CLI.",
4
5
  "type": "module",
5
6
  "main": "dist/index.js",
6
7
  "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "README.md"
11
+ ],
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
7
15
  "exports": {
8
16
  ".": {
9
17
  "types": "./dist/index.d.ts",