@crvouga/mockingbird-service-google-calendar 3.1.0 → 3.3.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 +14 -2
- package/DISCOVERY.md +23 -0
- package/README.md +25 -3
- package/dist/chunk-3ETUQIA5.js +6582 -0
- package/dist/chunk-3ETUQIA5.js.map +7 -0
- package/dist/{chunk-WUARTWSJ.js → chunk-XDPKS2CC.js} +139 -26
- package/dist/chunk-XDPKS2CC.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +435 -121
- package/dist/index.js +1 -1
- package/dist/server.d.ts +819 -188
- package/dist/server.js +2 -2
- package/package.json +3 -2
- package/dist/chunk-UJ2PZVYF.js +0 -4702
- package/dist/chunk-UJ2PZVYF.js.map +0 -7
- package/dist/chunk-WUARTWSJ.js.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-google-calendar
|
|
2
2
|
|
|
3
|
-
## 3.
|
|
3
|
+
## 3.3.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
8
|
|
|
9
9
|
### Dependencies
|
|
10
10
|
|
|
11
11
|
- `@crvouga/mockingbird-service-sqlite`
|
|
12
12
|
|
|
13
|
+
## 3.2.0 (2026-10-08)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
- match Emulate provider coverage ([16b65ce](https://github.com/crvouga/mockingbird/commit/16b65ce791fa216f28ec1521df636f57771d9c5e))
|
|
18
|
+
|
|
19
|
+
## 3.1.0 (2026-10-08)
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
- redesign emulator experience ([d6038c2](https://github.com/crvouga/mockingbird/commit/d6038c27eebbaa1751f02bc9305002a5b1304779))
|
|
24
|
+
|
|
13
25
|
## 3.0.0 (2026-10-07)
|
|
14
26
|
|
|
15
27
|
### ⚠️ Breaking changes
|
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
|
@@ -38,19 +38,21 @@ posts pushes to whatever `address` the app registers (http is allowed unless
|
|
|
38
38
|
npx mockingbird-google-calendar serve --port 8820 --client "$GOOGLE_CLIENT_ID:$GOOGLE_CLIENT_SECRET"
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
```
|
|
41
|
+
```ts
|
|
42
42
|
import { auth, calendar } from "@googleapis/calendar"
|
|
43
43
|
import { OAuth2Client } from "google-auth-library"
|
|
44
44
|
import { createServer } from "@crvouga/mockingbird-service-google-calendar/server"
|
|
45
45
|
|
|
46
46
|
const google = await createServer()
|
|
47
|
+
|
|
48
|
+
// The application's OAuth and Calendar clients. Only their URLs change.
|
|
47
49
|
const oauth = new OAuth2Client({
|
|
48
50
|
clientId: "c",
|
|
49
51
|
clientSecret: "s",
|
|
50
52
|
redirectUri: "postmessage",
|
|
51
53
|
endpoints: { oauth2TokenUrl: `${google.url}/token`, oauth2RevokeUrl: `${google.url}/revoke` },
|
|
52
54
|
})
|
|
53
|
-
// Authorization code "4/
|
|
55
|
+
// Authorization code "4/mock-<name>" signs in <name>@example.com ("4/mock-<email>" for others).
|
|
54
56
|
const { tokens } = await oauth.getToken("4/mock-dr.house")
|
|
55
57
|
const client = new auth.OAuth2()
|
|
56
58
|
client.setCredentials({ access_token: tokens.access_token ?? null })
|
|
@@ -59,14 +61,20 @@ await cal.events.insert({
|
|
|
59
61
|
calendarId: "primary",
|
|
60
62
|
requestBody: { summary: "Rounds", start: { dateTime: "2026-10-01T15:00:00Z" }, end: { dateTime: "2026-10-01T16:00:00Z" } },
|
|
61
63
|
})
|
|
64
|
+
|
|
65
|
+
await google.close()
|
|
62
66
|
```
|
|
63
67
|
|
|
64
68
|
An event created "in Google's UI" (admin route) is what the app then lists and syncs:
|
|
65
69
|
|
|
66
70
|
```ts
|
|
71
|
+
import { auth, calendar } from "@googleapis/calendar"
|
|
72
|
+
import { OAuth2Client } from "google-auth-library"
|
|
67
73
|
import { createServer } from "@crvouga/mockingbird-service-google-calendar/server"
|
|
68
74
|
|
|
69
75
|
const google = await createServer()
|
|
76
|
+
|
|
77
|
+
// Test control: the practitioner adds an event in Google's UI.
|
|
70
78
|
await fetch(`${google.url}/__admin/events`, {
|
|
71
79
|
method: "POST",
|
|
72
80
|
headers: { "content-type": "application/json" },
|
|
@@ -75,7 +83,21 @@ await fetch(`${google.url}/__admin/events`, {
|
|
|
75
83
|
event: { summary: "Rounds", start: { dateTime: "2026-10-01T15:00:00Z" }, end: { dateTime: "2026-10-01T16:00:00Z" } },
|
|
76
84
|
}),
|
|
77
85
|
})
|
|
78
|
-
|
|
86
|
+
|
|
87
|
+
// The application lists it through the Calendar client.
|
|
88
|
+
const oauth = new OAuth2Client({
|
|
89
|
+
clientId: "c",
|
|
90
|
+
clientSecret: "s",
|
|
91
|
+
redirectUri: "postmessage",
|
|
92
|
+
endpoints: { oauth2TokenUrl: `${google.url}/token` },
|
|
93
|
+
})
|
|
94
|
+
const { tokens } = await oauth.getToken("4/mock-dr.house")
|
|
95
|
+
const client = new auth.OAuth2()
|
|
96
|
+
client.setCredentials({ access_token: tokens.access_token ?? null })
|
|
97
|
+
const cal = calendar({ version: "v3", auth: client, rootUrl: `${google.url}/` })
|
|
98
|
+
const { data } = await cal.events.list({ calendarId: "primary" })
|
|
99
|
+
console.log(data.items?.map((event) => event.summary)) // ["Rounds"]
|
|
100
|
+
|
|
79
101
|
await google.close()
|
|
80
102
|
```
|
|
81
103
|
|