@things-factory/calendar 10.1.47 → 10.1.105

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/calendar",
3
- "version": "10.1.47",
3
+ "version": "10.1.105",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -30,8 +30,8 @@
30
30
  "@operato/event-view": "^10.0.0",
31
31
  "@operato/graphql": "^10.0.0",
32
32
  "@operato/shell": "^10.0.0",
33
- "@things-factory/auth-base": "^10.1.47",
34
- "@things-factory/shell": "^10.1.47"
33
+ "@things-factory/auth-base": "^10.1.79",
34
+ "@things-factory/shell": "^10.1.79"
35
35
  },
36
- "gitHead": "185f20d7d9a15715a0ee2757a6a8189ec36cfb9d"
36
+ "gitHead": "c8ad9b40d57709beefd5e3d6167fd9cab6efea3a"
37
37
  }
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Every mutation of calendar declares a privilege, and the domain owner may call it.
3
+ *
4
+ * Until 2026-10-01 no mutation of calendar declared anything: any member of a domain could call them. Calendars, events and attendees all ask for `calendar:mutation`.
5
+ * The queries are not gated yet and are not measured here.
6
+ */
7
+ import { gatesOf, openFields } from '../../../test/helpers/open-doors'
8
+
9
+ /** The category each mutation asks for; anything not named here asks for `calendar`. */
10
+ const CATEGORY: Record<string, string> = {}
11
+
12
+ /** Open on purpose or not decided yet, each with its reason. */
13
+ const OPEN: Record<string, string> = {}
14
+
15
+ let gates: Awaited<ReturnType<typeof gatesOf>>
16
+
17
+ beforeAll(async () => {
18
+ gates = await gatesOf('calendar')
19
+ })
20
+
21
+ it('every open mutation has a written reason', () => {
22
+ expect(openFields(gates.Mutation)).toEqual(Object.keys(OPEN).sort())
23
+ })
24
+
25
+ it('every declared mutation asks for its category and admits the domain owner', () => {
26
+ for (const [field, gate] of Object.entries(gates.Mutation)) {
27
+ if (field in OPEN) continue
28
+ expect({ field, ...gate }).toEqual({
29
+ field,
30
+ category: CATEGORY[field] ?? 'calendar',
31
+ privilege: 'mutation',
32
+ owner: true,
33
+ super: false
34
+ })
35
+ }
36
+ })
37
+
38
+ it('the walk reaches every mutation', () => {
39
+ /* If the resolver list shrank, the checks above would pass by having nothing to look at. */
40
+ expect(Object.keys(gates.Mutation)).toHaveLength(18)
41
+ })