samva 0.0.1 → 0.2.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.
- package/AGENTS.md +13 -0
- package/LICENSE +21 -0
- package/README.md +392 -5
- package/dist/categories-CsUa8ojo.js +143 -0
- package/dist/client/client/client.gen.d.ts +2 -0
- package/dist/client/client/index.d.ts +10 -0
- package/dist/client/client/types.gen.d.ts +120 -0
- package/dist/client/client/utils.gen.d.ts +37 -0
- package/dist/client/client.gen.d.ts +12 -0
- package/dist/client/core/auth.gen.d.ts +25 -0
- package/dist/client/core/bodySerializer.gen.d.ts +25 -0
- package/dist/client/core/params.gen.d.ts +43 -0
- package/dist/client/core/pathSerializer.gen.d.ts +33 -0
- package/dist/client/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/client/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/client/core/types.gen.d.ts +83 -0
- package/dist/client/core/utils.gen.d.ts +19 -0
- package/dist/client/sdk.gen.d.ts +1558 -0
- package/dist/client/types.gen.d.ts +7917 -0
- package/dist/client-BqkU-sFv.js +6049 -0
- package/dist/effect/api-keys.d.ts +190 -0
- package/dist/effect/api-keys.js +27 -0
- package/dist/effect/campaigns.d.ts +2055 -0
- package/dist/effect/campaigns.js +33 -0
- package/dist/effect/categories.d.ts +65 -0
- package/dist/effect/categories.js +2 -0
- package/dist/effect/client.d.ts +9 -0
- package/dist/effect/client.js +13 -0
- package/dist/effect/contacts.d.ts +1278 -0
- package/dist/effect/contacts.js +39 -0
- package/dist/effect/conversations.d.ts +1604 -0
- package/dist/effect/conversations.js +23 -0
- package/dist/effect/design.d.ts +209 -0
- package/dist/effect/design.js +13 -0
- package/dist/effect/email.d.ts +1022 -0
- package/dist/effect/email.js +111 -0
- package/dist/effect/generated-metadata.d.ts +54 -0
- package/dist/effect/generated.d.ts +32156 -0
- package/dist/effect/index.d.ts +36 -0
- package/dist/effect/index.js +17 -0
- package/dist/effect/internal/client.d.ts +35 -0
- package/dist/effect/internal/operation.d.ts +466 -0
- package/dist/effect/messages.d.ts +1047 -0
- package/dist/effect/messages.js +23 -0
- package/dist/effect/operations.d.ts +97 -0
- package/dist/effect/operations.js +15 -0
- package/dist/effect/organizations.d.ts +559 -0
- package/dist/effect/organizations.js +21 -0
- package/dist/effect/pagination.d.ts +37 -0
- package/dist/effect/retry.d.ts +60 -0
- package/dist/effect/retry.js +112 -0
- package/dist/effect/runtime.d.ts +7 -0
- package/dist/effect/scheduled-messages.d.ts +1009 -0
- package/dist/effect/scheduled-messages.js +17 -0
- package/dist/effect/templates.d.ts +2591 -0
- package/dist/effect/templates.js +66 -0
- package/dist/effect/webhooks.d.ts +228 -0
- package/dist/effect/webhooks.js +33 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/normalize-LkWl4HUF.js +82 -0
- package/dist/normalize.d.ts +87 -0
- package/dist/operation-Ccqh_yxb.js +596 -0
- package/dist/promises/errors.gen.d.ts +179 -0
- package/dist/promises/index.d.ts +153 -0
- package/dist/promises/index.js +2 -0
- package/dist/promises/types.gen.d.ts +1 -0
- package/dist/promises-Dgv8UmCC.js +5911 -0
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/service-map.d.ts +732 -0
- package/dist/webhooks/effect.d.ts +1 -0
- package/dist/webhooks/effect.js +1 -0
- package/dist/webhooks/promise.d.ts +1 -0
- package/dist/webhooks/promise.js +1 -0
- package/package.json +151 -4
- package/CLAUDE.md +0 -111
- package/bun.lock +0 -29
- package/index.ts +0 -1
- package/tsconfig.json +0 -29
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@samva/webhooks/effect";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@samva/webhooks/effect";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@samva/webhooks/promise";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@samva/webhooks/promise";
|
package/package.json
CHANGED
|
@@ -1,12 +1,159 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "samva",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "TypeScript SDK for the Samva messaging and billing APIs",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"api-client",
|
|
7
|
+
"cpaas",
|
|
8
|
+
"messaging",
|
|
9
|
+
"samva",
|
|
10
|
+
"sdk",
|
|
11
|
+
"sms",
|
|
12
|
+
"typescript",
|
|
13
|
+
"whatsapp"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://samva.dev",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/AryaLabsHQ/samva/issues"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": "Arya Labs, Inc.",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/AryaLabsHQ/samva.git",
|
|
24
|
+
"directory": "packages/sdk"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"!dist/**/*.map",
|
|
29
|
+
"package.json",
|
|
30
|
+
"README.md",
|
|
31
|
+
"AGENTS.md",
|
|
32
|
+
"LICENSE"
|
|
33
|
+
],
|
|
5
34
|
"type": "module",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"import": "./dist/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./promises": {
|
|
41
|
+
"types": "./dist/promises/index.d.ts",
|
|
42
|
+
"import": "./dist/promises/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./effect": {
|
|
45
|
+
"types": "./dist/effect/index.d.ts",
|
|
46
|
+
"import": "./dist/effect/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./effect/categories": {
|
|
49
|
+
"types": "./dist/effect/categories.d.ts",
|
|
50
|
+
"import": "./dist/effect/categories.js"
|
|
51
|
+
},
|
|
52
|
+
"./effect/api-keys": {
|
|
53
|
+
"types": "./dist/effect/api-keys.d.ts",
|
|
54
|
+
"import": "./dist/effect/api-keys.js"
|
|
55
|
+
},
|
|
56
|
+
"./effect/campaigns": {
|
|
57
|
+
"types": "./dist/effect/campaigns.d.ts",
|
|
58
|
+
"import": "./dist/effect/campaigns.js"
|
|
59
|
+
},
|
|
60
|
+
"./effect/client": {
|
|
61
|
+
"types": "./dist/effect/client.d.ts",
|
|
62
|
+
"import": "./dist/effect/client.js"
|
|
63
|
+
},
|
|
64
|
+
"./effect/contacts": {
|
|
65
|
+
"types": "./dist/effect/contacts.d.ts",
|
|
66
|
+
"import": "./dist/effect/contacts.js"
|
|
67
|
+
},
|
|
68
|
+
"./effect/conversations": {
|
|
69
|
+
"types": "./dist/effect/conversations.d.ts",
|
|
70
|
+
"import": "./dist/effect/conversations.js"
|
|
71
|
+
},
|
|
72
|
+
"./effect/design": {
|
|
73
|
+
"types": "./dist/effect/design.d.ts",
|
|
74
|
+
"import": "./dist/effect/design.js"
|
|
75
|
+
},
|
|
76
|
+
"./effect/email": {
|
|
77
|
+
"types": "./dist/effect/email.d.ts",
|
|
78
|
+
"import": "./dist/effect/email.js"
|
|
79
|
+
},
|
|
80
|
+
"./effect/messages": {
|
|
81
|
+
"types": "./dist/effect/messages.d.ts",
|
|
82
|
+
"import": "./dist/effect/messages.js"
|
|
83
|
+
},
|
|
84
|
+
"./effect/operations": {
|
|
85
|
+
"types": "./dist/effect/operations.d.ts",
|
|
86
|
+
"import": "./dist/effect/operations.js"
|
|
87
|
+
},
|
|
88
|
+
"./effect/organizations": {
|
|
89
|
+
"types": "./dist/effect/organizations.d.ts",
|
|
90
|
+
"import": "./dist/effect/organizations.js"
|
|
91
|
+
},
|
|
92
|
+
"./effect/retry": {
|
|
93
|
+
"types": "./dist/effect/retry.d.ts",
|
|
94
|
+
"import": "./dist/effect/retry.js"
|
|
95
|
+
},
|
|
96
|
+
"./effect/scheduled-messages": {
|
|
97
|
+
"types": "./dist/effect/scheduled-messages.d.ts",
|
|
98
|
+
"import": "./dist/effect/scheduled-messages.js"
|
|
99
|
+
},
|
|
100
|
+
"./effect/templates": {
|
|
101
|
+
"types": "./dist/effect/templates.d.ts",
|
|
102
|
+
"import": "./dist/effect/templates.js"
|
|
103
|
+
},
|
|
104
|
+
"./effect/webhooks": {
|
|
105
|
+
"types": "./dist/effect/webhooks.d.ts",
|
|
106
|
+
"import": "./dist/effect/webhooks.js"
|
|
107
|
+
},
|
|
108
|
+
"./webhooks": {
|
|
109
|
+
"types": "./dist/webhooks/promise.d.ts",
|
|
110
|
+
"import": "./dist/webhooks/promise.js"
|
|
111
|
+
},
|
|
112
|
+
"./webhooks/effect": {
|
|
113
|
+
"types": "./dist/webhooks/effect.d.ts",
|
|
114
|
+
"import": "./dist/webhooks/effect.js"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"publishConfig": {
|
|
118
|
+
"access": "public"
|
|
119
|
+
},
|
|
120
|
+
"scripts": {
|
|
121
|
+
"build": "NODE_OPTIONS=\"$NODE_OPTIONS --max-old-space-size=8192\" tsdown && tsc --project tsconfig.build.json",
|
|
122
|
+
"prepack": "bun run build",
|
|
123
|
+
"generate:openapi": "bun run scripts/openapi.ts",
|
|
124
|
+
"generate:promises": "openapi-ts && bun run scripts/loosen-optionals.ts && bun run scripts/generate-promise-errors.ts && oxfmt --config=../../oxfmt.config.ts src/client src/promises/errors.gen.ts src/promises/types.gen.ts",
|
|
125
|
+
"generate:effect": "bun run codegen/generate-effect.ts && oxfmt --config=../../oxfmt.config.ts src/effect/generated.ts src/effect/generated-metadata.ts && bun run codegen/normalize-effect.ts",
|
|
126
|
+
"generate": "bun generate:openapi && bun generate:promises && bun generate:effect",
|
|
127
|
+
"test:generation": "bun scripts/check-generation.ts",
|
|
128
|
+
"test:packed": "bun run build && bun scripts/test-packed-consumers.ts",
|
|
129
|
+
"test:tarball": "bun run build && bun scripts/check-tarball.ts",
|
|
130
|
+
"test:tree-shaking": "bun run build && bun scripts/check-tree-shaking.ts",
|
|
131
|
+
"test:types": "tsgo --noEmit --project tests/parity/tsconfig.json",
|
|
132
|
+
"typecheck": "tsgo --noEmit"
|
|
133
|
+
},
|
|
134
|
+
"dependencies": {
|
|
135
|
+
"@samva/webhooks": "0.2.0"
|
|
136
|
+
},
|
|
6
137
|
"devDependencies": {
|
|
7
|
-
"@
|
|
138
|
+
"@effect/openapi-generator": "4.0.0-beta.102",
|
|
139
|
+
"@effect/platform-node": "4.0.0-beta.102",
|
|
140
|
+
"@effect/vitest": "4.0.0-beta.102",
|
|
141
|
+
"@hey-api/openapi-ts": "0.99.0",
|
|
142
|
+
"@types/node": "^26.1.1",
|
|
143
|
+
"effect": "4.0.0-beta.102",
|
|
144
|
+
"tsdown": "^0.22.13",
|
|
145
|
+
"typescript": "^6.0.3",
|
|
146
|
+
"vitest": "^4.1.10"
|
|
8
147
|
},
|
|
9
148
|
"peerDependencies": {
|
|
10
|
-
"
|
|
149
|
+
"effect": "4.0.0-beta.102"
|
|
150
|
+
},
|
|
151
|
+
"peerDependenciesMeta": {
|
|
152
|
+
"effect": {
|
|
153
|
+
"optional": true
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"engines": {
|
|
157
|
+
"node": ">=22"
|
|
11
158
|
}
|
|
12
159
|
}
|
package/CLAUDE.md
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Use Bun instead of Node.js, npm, pnpm, or vite.
|
|
3
|
-
globs: "*.ts, *.tsx, *.html, *.css, *.js, *.jsx, package.json"
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Default to using Bun instead of Node.js.
|
|
8
|
-
|
|
9
|
-
- Use `bun <file>` instead of `node <file>` or `ts-node <file>`
|
|
10
|
-
- Use `bun test` instead of `jest` or `vitest`
|
|
11
|
-
- Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild`
|
|
12
|
-
- Use `bun install` instead of `npm install` or `yarn install` or `pnpm install`
|
|
13
|
-
- Use `bun run <script>` instead of `npm run <script>` or `yarn run <script>` or `pnpm run <script>`
|
|
14
|
-
- Bun automatically loads .env, so don't use dotenv.
|
|
15
|
-
|
|
16
|
-
## APIs
|
|
17
|
-
|
|
18
|
-
- `Bun.serve()` supports WebSockets, HTTPS, and routes. Don't use `express`.
|
|
19
|
-
- `bun:sqlite` for SQLite. Don't use `better-sqlite3`.
|
|
20
|
-
- `Bun.redis` for Redis. Don't use `ioredis`.
|
|
21
|
-
- `Bun.sql` for Postgres. Don't use `pg` or `postgres.js`.
|
|
22
|
-
- `WebSocket` is built-in. Don't use `ws`.
|
|
23
|
-
- Prefer `Bun.file` over `node:fs`'s readFile/writeFile
|
|
24
|
-
- Bun.$`ls` instead of execa.
|
|
25
|
-
|
|
26
|
-
## Testing
|
|
27
|
-
|
|
28
|
-
Use `bun test` to run tests.
|
|
29
|
-
|
|
30
|
-
```ts#index.test.ts
|
|
31
|
-
import { test, expect } from "bun:test";
|
|
32
|
-
|
|
33
|
-
test("hello world", () => {
|
|
34
|
-
expect(1).toBe(1);
|
|
35
|
-
});
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Frontend
|
|
39
|
-
|
|
40
|
-
Use HTML imports with `Bun.serve()`. Don't use `vite`. HTML imports fully support React, CSS, Tailwind.
|
|
41
|
-
|
|
42
|
-
Server:
|
|
43
|
-
|
|
44
|
-
```ts#index.ts
|
|
45
|
-
import index from "./index.html"
|
|
46
|
-
|
|
47
|
-
Bun.serve({
|
|
48
|
-
routes: {
|
|
49
|
-
"/": index,
|
|
50
|
-
"/api/users/:id": {
|
|
51
|
-
GET: (req) => {
|
|
52
|
-
return new Response(JSON.stringify({ id: req.params.id }));
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
// optional websocket support
|
|
57
|
-
websocket: {
|
|
58
|
-
open: (ws) => {
|
|
59
|
-
ws.send("Hello, world!");
|
|
60
|
-
},
|
|
61
|
-
message: (ws, message) => {
|
|
62
|
-
ws.send(message);
|
|
63
|
-
},
|
|
64
|
-
close: (ws) => {
|
|
65
|
-
// handle close
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
development: {
|
|
69
|
-
hmr: true,
|
|
70
|
-
console: true,
|
|
71
|
-
}
|
|
72
|
-
})
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
HTML files can import .tsx, .jsx or .js files directly and Bun's bundler will transpile & bundle automatically. `<link>` tags can point to stylesheets and Bun's CSS bundler will bundle.
|
|
76
|
-
|
|
77
|
-
```html#index.html
|
|
78
|
-
<html>
|
|
79
|
-
<body>
|
|
80
|
-
<h1>Hello, world!</h1>
|
|
81
|
-
<script type="module" src="./frontend.tsx"></script>
|
|
82
|
-
</body>
|
|
83
|
-
</html>
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
With the following `frontend.tsx`:
|
|
87
|
-
|
|
88
|
-
```tsx#frontend.tsx
|
|
89
|
-
import React from "react";
|
|
90
|
-
|
|
91
|
-
// import .css files directly and it works
|
|
92
|
-
import './index.css';
|
|
93
|
-
|
|
94
|
-
import { createRoot } from "react-dom/client";
|
|
95
|
-
|
|
96
|
-
const root = createRoot(document.body);
|
|
97
|
-
|
|
98
|
-
export default function Frontend() {
|
|
99
|
-
return <h1>Hello, world!</h1>;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
root.render(<Frontend />);
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Then, run index.ts
|
|
106
|
-
|
|
107
|
-
```sh
|
|
108
|
-
bun --hot ./index.ts
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
For more information, read the Bun API docs in `node_modules/bun-types/docs/**.md`.
|
package/bun.lock
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"lockfileVersion": 1,
|
|
3
|
-
"workspaces": {
|
|
4
|
-
"": {
|
|
5
|
-
"name": "samva",
|
|
6
|
-
"devDependencies": {
|
|
7
|
-
"@types/bun": "latest",
|
|
8
|
-
},
|
|
9
|
-
"peerDependencies": {
|
|
10
|
-
"typescript": "^5",
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
"packages": {
|
|
15
|
-
"@types/bun": ["@types/bun@1.3.0", "", { "dependencies": { "bun-types": "1.3.0" } }, "sha512-+lAGCYjXjip2qY375xX/scJeVRmZ5cY0wyHYyCYxNcdEXrQ4AOe3gACgd4iQ8ksOslJtW4VNxBJ8llUwc3a6AA=="],
|
|
16
|
-
|
|
17
|
-
"@types/node": ["@types/node@24.9.1", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-QoiaXANRkSXK6p0Duvt56W208du4P9Uye9hWLWgGMDTEoKPhuenzNcC4vGUmrNkiOKTlIrBoyNQYNpSwfEZXSg=="],
|
|
18
|
-
|
|
19
|
-
"@types/react": ["@types/react@19.2.2", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA=="],
|
|
20
|
-
|
|
21
|
-
"bun-types": ["bun-types@1.3.0", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-u8X0thhx+yJ0KmkxuEo9HAtdfgCBaM/aI9K90VQcQioAmkVp3SG3FkwWGibUFz3WdXAdcsqOcbU40lK7tbHdkQ=="],
|
|
22
|
-
|
|
23
|
-
"csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
|
|
24
|
-
|
|
25
|
-
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
|
|
26
|
-
|
|
27
|
-
"undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="],
|
|
28
|
-
}
|
|
29
|
-
}
|
package/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
console.log("Hello via Bun!");
|
package/tsconfig.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// Environment setup & latest features
|
|
4
|
-
"lib": ["ESNext"],
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"module": "Preserve",
|
|
7
|
-
"moduleDetection": "force",
|
|
8
|
-
"jsx": "react-jsx",
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
|
|
11
|
-
// Bundler mode
|
|
12
|
-
"moduleResolution": "bundler",
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
|
-
"verbatimModuleSyntax": true,
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
// Best practices
|
|
18
|
-
"strict": true,
|
|
19
|
-
"skipLibCheck": true,
|
|
20
|
-
"noFallthroughCasesInSwitch": true,
|
|
21
|
-
"noUncheckedIndexedAccess": true,
|
|
22
|
-
"noImplicitOverride": true,
|
|
23
|
-
|
|
24
|
-
// Some stricter flags (disabled by default)
|
|
25
|
-
"noUnusedLocals": false,
|
|
26
|
-
"noUnusedParameters": false,
|
|
27
|
-
"noPropertyAccessFromIndexSignature": false
|
|
28
|
-
}
|
|
29
|
-
}
|