@gtmi/ramp-api-client 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 twilio.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # @gtmi/ramp-api-client
2
+
3
+ Type-safe SDK for the **RAMP API server** (`apps/api`). Auto-generated from the
4
+ app's committed OpenAPI spec with [`@hey-api/openapi-ts`](https://heyapi.dev),
5
+ shipping tree-shakeable per-operation functions, request/response types, and
6
+ runtime [zod](https://zod.dev) schemas.
7
+
8
+ ## Install
9
+
10
+ ```sh
11
+ pnpm add @gtmi/ramp-api-client
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```ts
17
+ import { createRampApiClient, postConversations } from '@gtmi/ramp-api-client';
18
+
19
+ const client = createRampApiClient({
20
+ baseUrl: process.env.RAMP_API_URL!,
21
+ getAuthToken: () => process.env.CR_SERVER_API_KEY!, // sent as `Authorization: Bearer …`
22
+ });
23
+
24
+ const { data, error } = await postConversations({
25
+ client,
26
+ body: { configurationId: 'cfg_123' },
27
+ });
28
+ ```
29
+
30
+ Every operation accepts the `client` returned by `createRampApiClient`. Without
31
+ `getAuthToken`, no `Authorization` header is sent (use for public endpoints).
32
+
33
+ ### Runtime validation
34
+
35
+ Generated zod schemas are exported under `schemas`:
36
+
37
+ ```ts
38
+ import { schemas } from '@gtmi/ramp-api-client';
39
+
40
+ schemas.zPostConversationsBody.parse(input);
41
+ ```
42
+
43
+ ## A note on response types
44
+
45
+ Request inputs are fully typed and zod-validated. Response types are only as
46
+ rich as the OpenAPI spec's response schemas, which are sparse today — many
47
+ responses are loosely typed until handler `@response` JSDoc is enriched. As that
48
+ JSDoc lands, regenerating this SDK upgrades the response types with no API
49
+ change here.
50
+
51
+ ## Regenerating
52
+
53
+ This package is generated from `apps/api/public/openapi.json`:
54
+
55
+ ```sh
56
+ pnpm --filter @gtmi/ramp-api-client generate
57
+ ```
58
+
59
+ `src/generated/` is committed and drift-checked in CI. Do not edit it by hand.