@crvouga/mockingbird-service-workos 1.1.0 → 1.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/CHANGELOG.md +6 -4
- package/DISCOVERY.md +23 -0
- package/README.md +28 -3
- package/dist/chunk-LE5B6IJG.js +5417 -0
- package/dist/chunk-LE5B6IJG.js.map +7 -0
- package/dist/{chunk-BIGV6FI5.js → chunk-X5OR3IYU.js} +136 -25
- package/dist/chunk-X5OR3IYU.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +339 -40
- package/dist/index.js +1 -1
- package/dist/server.d.ts +678 -80
- package/dist/server.js +2 -2
- package/package.json +3 -2
- package/dist/chunk-BIGV6FI5.js.map +0 -7
- package/dist/chunk-JITNKKHL.js +0 -3626
- package/dist/chunk-JITNKKHL.js.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-workos
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.2.0 (2026-10-12)
|
|
4
4
|
|
|
5
5
|
### Features
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- unify the emulator control plane ([2068547](https://github.com/crvouga/mockingbird/commit/2068547bedde4e2e2331c1657c1a78120e84428b))
|
|
8
|
+
|
|
9
|
+
## 1.1.0 (2026-10-08)
|
|
8
10
|
|
|
9
|
-
###
|
|
11
|
+
### Features
|
|
10
12
|
|
|
11
|
-
-
|
|
13
|
+
- match Emulate provider coverage ([16b65ce](https://github.com/crvouga/mockingbird/commit/16b65ce791fa216f28ec1521df636f57771d9c5e))
|
|
12
14
|
|
|
13
15
|
## 1.0.0 (2026-10-08)
|
|
14
16
|
|
package/DISCOVERY.md
CHANGED
|
@@ -35,6 +35,7 @@ repository; live parity is an additional oracle check, not a substitute for the
|
|
|
35
35
|
|
|
36
36
|
- `GET /__admin/health`
|
|
37
37
|
- `GET /__admin`
|
|
38
|
+
- `GET /__admin/controls`
|
|
38
39
|
- `GET /__admin/state`
|
|
39
40
|
- `GET /__admin/requests`
|
|
40
41
|
- `GET /__admin/metrics`
|
|
@@ -45,6 +46,28 @@ For HTTP services, use `x-mockingbird-namespace` (or the documented credential/p
|
|
|
45
46
|
parallel tests do not share state. Admin state, journal, metrics and fault-preset endpoints are
|
|
46
47
|
designed for assertions and diagnosis by consuming test suites.
|
|
47
48
|
|
|
49
|
+
## Admin controls
|
|
50
|
+
|
|
51
|
+
Every HTTP emulator takes the same controls, and each means the same thing at boot
|
|
52
|
+
(`createRuntime({ adminControls })`, `serve --admin-controls`), over `/__admin`, and in a request header:
|
|
53
|
+
|
|
54
|
+
| Control | Admin API | Request header | Interface |
|
|
55
|
+
| --- | --- | --- | --- |
|
|
56
|
+
| Isolate state by key | `GET /__admin/namespaces` | `x-mockingbird-namespace: <key>` | [Namespaces](https://mockingbird.chrisvouga.dev/docs/admin-controls/namespaces) |
|
|
57
|
+
| Reset to boot | `POST /__admin/reset` | `x-mockingbird-reset: true` | [Reset](https://mockingbird.chrisvouga.dev/docs/admin-controls/reset) |
|
|
58
|
+
| Snapshot and restore | `POST /__admin/snapshots`, `POST /__admin/snapshots/<id>/restore` | `x-mockingbird-snapshot: <name>`, `x-mockingbird-restore: <name>` | [Snapshot and restore](https://mockingbird.chrisvouga.dev/docs/admin-controls/snapshot-and-restore) |
|
|
59
|
+
| Move the clock | `POST /__admin/clock` | `x-mockingbird-time: <instant>`, `x-mockingbird-advance: <duration>` | [Clock](https://mockingbird.chrisvouga.dev/docs/admin-controls/clock) |
|
|
60
|
+
| Read or branch from old state | `GET /__admin/timeline` | `x-mockingbird-at: <checkpoint>`, `x-mockingbird-branch: <name>` | [Checkpoints and branches](https://mockingbird.chrisvouga.dev/docs/admin-controls/checkpoints-and-branches) |
|
|
61
|
+
| Inject a fault | `POST /__admin/faults` | `x-mockingbird-fault: <fault>` | [Faults](https://mockingbird.chrisvouga.dev/docs/admin-controls/faults) |
|
|
62
|
+
| Latency and timeouts | `PUT /__admin/latency` | `x-mockingbird-delay: <duration>`, `x-mockingbird-timeout: <duration>` | [Latency and timeouts](https://mockingbird.chrisvouga.dev/docs/admin-controls/latency-and-timeouts) |
|
|
63
|
+
| Replay from a seed | `PUT /__admin/controls` | `x-mockingbird-seed: <seed>` | [Seed and determinism](https://mockingbird.chrisvouga.dev/docs/admin-controls/seed-and-determinism) |
|
|
64
|
+
| See what happened | `GET /__admin/requests`, `GET /__admin/state` | | [Journal, metrics and state](https://mockingbird.chrisvouga.dev/docs/admin-controls/journal-and-state) |
|
|
65
|
+
|
|
66
|
+
`GET /__admin` lists every route and header with a one-line summary, and `GET /__admin/controls`
|
|
67
|
+
is the namespace's current control document. The same seed and the same requests give the same
|
|
68
|
+
bytes. Setting controls as an emulator starts is [Boot](https://mockingbird.chrisvouga.dev/docs/admin-controls/boot); every route and header is in
|
|
69
|
+
the [Reference](https://mockingbird.chrisvouga.dev/docs/admin-controls/reference). The full guide: <https://mockingbird.chrisvouga.dev/docs/admin-controls>.
|
|
70
|
+
|
|
48
71
|
## Report a mismatch or missing capability
|
|
49
72
|
|
|
50
73
|
Follow the [agent reporting contract](https://github.com/crvouga/mockingbird/blob/main/docs/REPORTING_ISSUES.md). Include package version,
|
package/README.md
CHANGED
|
@@ -14,14 +14,39 @@ bun add -d @crvouga/mockingbird-service-workos
|
|
|
14
14
|
## Usage
|
|
15
15
|
|
|
16
16
|
```ts
|
|
17
|
+
import { WorkOS } from "@workos-inc/node"
|
|
17
18
|
import { createServer } from "@crvouga/mockingbird-service-workos/server"
|
|
19
|
+
|
|
18
20
|
const server = await createServer()
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
//
|
|
21
|
+
const url = new URL(server.url)
|
|
22
|
+
|
|
23
|
+
// The app's own WorkOS client. Only its API host changes.
|
|
24
|
+
const workos = new WorkOS("mock_workos_key", {
|
|
25
|
+
clientId: "client_mock",
|
|
26
|
+
apiHostname: url.hostname,
|
|
27
|
+
port: Number(url.port),
|
|
28
|
+
https: false,
|
|
29
|
+
})
|
|
30
|
+
const authorizationUrl = workos.userManagement.getAuthorizationUrl({
|
|
31
|
+
provider: "authkit",
|
|
32
|
+
clientId: "client_mock",
|
|
33
|
+
redirectUri: "http://localhost:3000/callback",
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
// The test stands in for the browser: the emulator signs in the seeded user and redirects with a code.
|
|
37
|
+
const redirect = await fetch(authorizationUrl, { redirect: "manual" })
|
|
38
|
+
const code = new URL(redirect.headers.get("location") ?? "").searchParams.get("code") ?? ""
|
|
39
|
+
|
|
40
|
+
const { user } = await workos.userManagement.authenticateWithCode({ code })
|
|
41
|
+
const { data: users } = await workos.userManagement.listUsers({ email: user.email })
|
|
42
|
+
console.log(users[0]?.id === user.id) // true
|
|
22
43
|
await server.close()
|
|
23
44
|
```
|
|
24
45
|
|
|
46
|
+
For AuthKit, set `WORKOS_API_HOSTNAME`/`WORKOS_API_PORT` from `server.url` and
|
|
47
|
+
`WORKOS_API_HTTPS=false`, with `WORKOS_API_KEY=mock_workos_key` and `WORKOS_CLIENT_ID=client_mock`.
|
|
48
|
+
Register your callback in the clients seed and use a local `WORKOS_COOKIE_PASSWORD`.
|
|
49
|
+
|
|
25
50
|
`createRuntime().fetch(Request)` supports in-process adapters. Raw user mirrors should use
|
|
26
51
|
the server URL in place of `https://api.workos.com`. The default registered callback is
|
|
27
52
|
`http://localhost:3000/callback`; authorization immediately chooses the client's seeded user.
|