@repost/client 0.2.0 → 0.4.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/README.md +15 -85
- package/dist/cjs/index-e0zw7VDH.cjs +2987 -0
- package/dist/cjs/index-e0zw7VDH.cjs.map +1 -0
- package/dist/cjs/index.cjs +23 -1046
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/node-Dd92VNS7.cjs +841 -0
- package/dist/cjs/node-Dd92VNS7.cjs.map +1 -0
- package/dist/cjs/observer-dykSFHYi.cjs +69 -0
- package/dist/cjs/observer-dykSFHYi.cjs.map +1 -0
- package/dist/cjs/otel/index.cjs +99 -0
- package/dist/cjs/otel/index.cjs.map +1 -0
- package/dist/cjs/testing/index.cjs +257 -0
- package/dist/cjs/testing/index.cjs.map +1 -0
- package/dist/cjs/types/config.d.ts +28 -0
- package/dist/cjs/types/errors.d.ts +83 -0
- package/dist/cjs/types/index.d.ts +8 -3
- package/dist/cjs/types/observer.d.ts +44 -0
- package/dist/cjs/types/operation-events.d.ts +8 -0
- package/dist/cjs/types/operation-input.d.ts +5 -0
- package/dist/cjs/types/operation-policy.d.ts +23 -0
- package/dist/cjs/types/operation.d.ts +14 -0
- package/dist/cjs/types/otel/index.d.ts +2 -0
- package/dist/cjs/types/otel/metrics.d.ts +5 -0
- package/dist/cjs/types/otel/telemetry.d.ts +5 -0
- package/dist/cjs/types/runtime-state.d.ts +45 -0
- package/dist/cjs/types/serialize.d.ts +9 -3
- package/dist/cjs/types/telemetry.d.ts +43 -0
- package/dist/cjs/types/testing/deterministic.d.ts +19 -0
- package/dist/cjs/types/testing/index.d.ts +16 -0
- package/dist/cjs/types/testing/manual-clock.d.ts +12 -0
- package/dist/cjs/types/testing/recording-observer.d.ts +11 -0
- package/dist/cjs/types/testing/stub-transport.d.ts +35 -0
- package/dist/cjs/types/transport/connect-proxy.d.ts +30 -0
- package/dist/cjs/types/transport/failure.d.ts +7 -0
- package/dist/cjs/types/transport/framing.d.ts +8 -0
- package/dist/cjs/types/transport/h2.d.ts +3 -0
- package/dist/cjs/types/transport/node.d.ts +3 -0
- package/dist/cjs/types/transport/response-reader.d.ts +6 -0
- package/dist/cjs/types/transport/strict-json.d.ts +5 -0
- package/dist/cjs/types/transport/tls.d.ts +14 -0
- package/dist/cjs/types/transport/undici-compat.d.ts +47 -0
- package/dist/cjs/types/transport.d.ts +42 -19
- package/dist/cjs/types/types.d.ts +146 -23
- package/dist/cjs/types/version.d.ts +2 -0
- package/dist/cjs/types/webhooks.d.ts +15 -0
- package/dist/cjs/version-CGqSWJir.cjs +7 -0
- package/dist/cjs/version-CGqSWJir.cjs.map +1 -0
- package/dist/esm/index-DRD5FBax.mjs +2967 -0
- package/dist/esm/index-DRD5FBax.mjs.map +1 -0
- package/dist/esm/index.mjs +3 -1041
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/node-BAJt_qhB.mjs +839 -0
- package/dist/esm/node-BAJt_qhB.mjs.map +1 -0
- package/dist/esm/observer-Dns2X4wE.mjs +66 -0
- package/dist/esm/observer-Dns2X4wE.mjs.map +1 -0
- package/dist/esm/otel/index.mjs +96 -0
- package/dist/esm/otel/index.mjs.map +1 -0
- package/dist/esm/testing/index.mjs +248 -0
- package/dist/esm/testing/index.mjs.map +1 -0
- package/dist/esm/version-Dp5vd2nu.mjs +5 -0
- package/dist/esm/version-Dp5vd2nu.mjs.map +1 -0
- package/index.d.ts +1 -1
- package/index.js +3 -4
- package/index.mjs +1 -1
- package/otel/index.d.ts +1 -0
- package/otel/index.js +3 -0
- package/otel/index.mjs +1 -0
- package/package.json +38 -9
- package/runtime/index.d.ts +1 -1
- package/runtime/index.js +2 -2
- package/runtime/index.mjs +1 -1
- package/scripts/postinstall.js +2 -2
- package/testing/index.d.ts +1 -0
- package/testing/index.js +3 -0
- package/testing/index.mjs +1 -0
package/README.md
CHANGED
|
@@ -1,93 +1,23 @@
|
|
|
1
1
|
# @repost/client
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
`@prisma/client`:
|
|
3
|
+
[](https://www.npmjs.com/package/@repost/client)
|
|
5
4
|
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
Type-safe webhook publishing generated from your Repost schema. `@repost/client`
|
|
6
|
+
exposes the models, enums, and webhook methods generated by the Repost CLI, then
|
|
7
|
+
handles deterministic serialization, Standard Webhooks envelopes, idempotency,
|
|
8
|
+
retries, and publishing — so a send is a single typed method call.
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
It is part of the [Repost](https://repost.sh) platform for defining webhook
|
|
11
|
+
contracts once and delivering them reliably. See the full documentation at
|
|
12
|
+
[repost.sh/docs](https://repost.sh/docs).
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
`@repost/client did not initialize yet. Please run "repost schema generate"`.
|
|
14
|
+
## Getting started
|
|
17
15
|
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
the transport (a no-network stub until workstream A). Generated code imports
|
|
22
|
-
it by subpath:
|
|
16
|
+
- [Quickstart](https://repost.sh/docs/send/typescript/quickstart) (5 min)
|
|
17
|
+
- [Schema & migrations](https://repost.sh/docs/send/typescript/generation) (15 min)
|
|
18
|
+
- [Add Repost to an existing project](https://repost.sh/docs/send/typescript/existing-project) (15 min)
|
|
23
19
|
|
|
24
|
-
|
|
25
|
-
import { buildWebhooks, type ModelDescriptor } from "@repost/client/runtime";
|
|
26
|
-
```
|
|
20
|
+
## Support
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
still serves them.
|
|
31
|
-
|
|
32
|
-
## Layout
|
|
33
|
-
|
|
34
|
-
| Path | Role |
|
|
35
|
-
|------|------|
|
|
36
|
-
| `index.js` / `index.mjs` / `index.d.ts` | Static stubs re-exporting `.repost/client/default` (the `@prisma/client` pattern — a single static spread, so `cjs-module-lexer` carries named exports into ESM). |
|
|
37
|
-
| `scripts/postinstall.js` | Writes the friendly-error placeholder `.repost/client` when nothing is generated yet. Never clobbers a real client; silent no-op outside `node_modules`. |
|
|
38
|
-
| `src/` → `dist/` (rollup) | The runtime, exported as `@repost/client/runtime`. |
|
|
39
|
-
| `tests/generated/` | The canonical generated package fixture, byte-identical to the Rust emitter (enforced by `canonical_generated_sdk_js_fixture_is_in_sync`; refresh with `UPDATE_EXPECT=1 cargo test -p repost-schema`). |
|
|
40
|
-
| `tests/stub-resolution.test.ts` | Real-`node` proof of the stub chain under npm and pnpm layouts, plus the before-generate error. |
|
|
41
|
-
| `tests/prisma-parity.test.ts` | Runs real `prisma generate` side by side and asserts the shared structural invariants (packaging spec R10). |
|
|
42
|
-
| `tests/e2e-session.test.ts` | The full consumer flow — `init` → multi-file schema → install → `migrate dev` → typed imports — against the real engine binary. |
|
|
43
|
-
|
|
44
|
-
## Local development
|
|
45
|
-
|
|
46
|
-
`@repost/client` is not published to npm yet (see below). Until it is, consumers
|
|
47
|
-
outside this monorepo can wire it up locally. The options are listed in order of
|
|
48
|
-
fidelity — the first is truest to a real install, the last is fastest to iterate.
|
|
49
|
-
|
|
50
|
-
### 1. Pack and install the tarball (recommended)
|
|
51
|
-
|
|
52
|
-
This exercises the exact `files` and `exports` a published package would ship,
|
|
53
|
-
so it catches a missing `dist/` file or a broken export before your users do.
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
# in this package
|
|
57
|
-
pnpm pack # writes repost-client-0.1.0.tgz (prepack builds dist/ first)
|
|
58
|
-
|
|
59
|
-
# in your consumer app
|
|
60
|
-
npm install ../path/to/repost-client-0.1.0.tgz
|
|
61
|
-
repost schema generate # writes node_modules/.repost/client
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
`pnpm pack` runs the `prepack` script, so the tarball always contains a fresh
|
|
65
|
-
`dist/`. Re-run `pnpm pack` and reinstall after each change you want to test.
|
|
66
|
-
Remember to re-run `repost schema generate` after any reinstall that prunes
|
|
67
|
-
`node_modules`.
|
|
68
|
-
|
|
69
|
-
### 2. Link a built checkout (fastest iteration)
|
|
70
|
-
|
|
71
|
-
Linking is quicker but only resolves what is on disk under `dist/`, so you must
|
|
72
|
-
build first — an unbuilt checkout resolves to nothing.
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
# in this package
|
|
76
|
-
pnpm build # or: pnpm dev (rollup -c -w, rebuilds dist/ on every save)
|
|
77
|
-
pnpm link --global # or: npm link
|
|
78
|
-
|
|
79
|
-
# in your consumer app
|
|
80
|
-
pnpm link --global @repost/client # or: npm link @repost/client
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Run `pnpm dev` in a separate terminal to keep `dist/` rebuilding while you edit,
|
|
84
|
-
and the linked consumer picks up each rebuild.
|
|
85
|
-
|
|
86
|
-
### 3. After npm publish
|
|
87
|
-
|
|
88
|
-
Publishing is pending license confirmation. Once `@repost/client` is on npm this
|
|
89
|
-
whole section collapses to:
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
npm install @repost/client
|
|
93
|
-
```
|
|
22
|
+
- [GitHub repository](https://github.com/repost-sh/monorepo)
|
|
23
|
+
- [Documentation](https://repost.sh/docs)
|