@cyc-seattle/gsuite-sdk 0.2.0 → 0.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/README.md +10 -2
- package/dist/fake/server.js +5 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -114,10 +114,18 @@ Derived membership isn't modeled, because the SDK reads only direct members.
|
|
|
114
114
|
|
|
115
115
|
Groups Settings answers in Atom XML unless the request asks for `alt=json`, like Google.
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
### Container image
|
|
118
|
+
|
|
119
|
+
Every release publishes `ghcr.io/cyc-seattle/workspace-fake:<version>` and `:latest`, built from the `Dockerfile`. The fake ignores auth tokens, so any bearer token works.
|
|
120
|
+
|
|
121
|
+
- It listens on port 8080. `PORT` changes that.
|
|
122
|
+
- `NEW_GROUP_DELAY_MS` sets how long a new group refuses member inserts (default 60000). Set it to `0` to seed a group and its members at once.
|
|
123
|
+
- `GET /healthz` returns 200.
|
|
124
|
+
- It runs as uid 1000 and writes no files, so it works with a read-only root filesystem and all capabilities dropped.
|
|
125
|
+
- Seed it through the Directory API: `POST /admin/directory/v1/groups`, then `POST .../groups/<group>/members`.
|
|
118
126
|
|
|
119
127
|
```sh
|
|
120
|
-
docker
|
|
128
|
+
docker run -p 8080:8080 -e NEW_GROUP_DELAY_MS=0 ghcr.io/cyc-seattle/workspace-fake
|
|
121
129
|
```
|
|
122
130
|
|
|
123
131
|
## Development
|
package/dist/fake/server.js
CHANGED
|
@@ -87,6 +87,11 @@ export async function startFakeServer(options = {}) {
|
|
|
87
87
|
}
|
|
88
88
|
async function handle(model, request, response) {
|
|
89
89
|
const url = new URL(request.url ?? "/", "http://fake");
|
|
90
|
+
// Kubernetes probes this; it isn't part of Google's API, so it stays out of ROUTES.
|
|
91
|
+
if (request.method === "GET" && url.pathname === "/healthz") {
|
|
92
|
+
send(response, 200, { status: "ok" });
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
90
95
|
const route = ROUTES.find((candidate) => candidate.method === request.method && candidate.path.test(url.pathname));
|
|
91
96
|
if (!route) {
|
|
92
97
|
sendError(response, new FakeApiError(404, "notFound", "Not Found"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyc-seattle/gsuite-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Domain-agnostic wrappers around Google Workspace APIs",
|
|
5
5
|
"author": "CYC Community Sailing Center",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=22"
|
|
21
21
|
},
|
|
22
|
-
"packageManager": "pnpm@10.34.
|
|
22
|
+
"packageManager": "pnpm@10.34.7",
|
|
23
23
|
"prettier": "@cyc-seattle/ts-config/prettier",
|
|
24
24
|
"exports": {
|
|
25
25
|
".": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"exponential-backoff": "^3.1.3",
|
|
45
|
-
"google-spreadsheet": "^
|
|
45
|
+
"google-spreadsheet": "^5.0.0",
|
|
46
46
|
"googleapis": "^144.0.0",
|
|
47
47
|
"luxon": "^3.7.2",
|
|
48
48
|
"winston": "^3.18.3"
|