@company-semantics/contracts 57.0.0 → 58.0.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/package.json
CHANGED
|
@@ -16,6 +16,10 @@ alongside `Meetings`, `Comms`, and `Docs`.
|
|
|
16
16
|
|
|
17
17
|
- `HrConnectionStatusSchema` is a read projection: count and sync fields are
|
|
18
18
|
`null` until the first successful sync (a connected, never-synced integration).
|
|
19
|
+
- `revokedReason` is non-null only when `credentialState` is `'unusable'`, and
|
|
20
|
+
its enum mirrors the backend's `ConnectionRevokedReason` exactly — the app
|
|
21
|
+
`parse`s this projection, so a value missing from the enum throws rather than
|
|
22
|
+
degrades (ADR-CONTRACTS-138).
|
|
19
23
|
- `HrConnectInputSchema` carries only the customer's provider `subdomain`; no
|
|
20
24
|
secrets or provider credentials live in contracts.
|
|
21
25
|
- Pure vocabulary — `zod` is the only runtime import (vocabulary-guard).
|
|
@@ -83,6 +83,32 @@ export const HrConnectionStatusSchema = z
|
|
|
83
83
|
description:
|
|
84
84
|
"Health of the most recent sync; null when no sync has run yet.",
|
|
85
85
|
}),
|
|
86
|
+
revokedReason: z
|
|
87
|
+
.enum([
|
|
88
|
+
"token_refresh_failed",
|
|
89
|
+
"missing_refresh_token",
|
|
90
|
+
"member_removed",
|
|
91
|
+
"app_uninstalled",
|
|
92
|
+
"tokens_revoked",
|
|
93
|
+
])
|
|
94
|
+
.nullable()
|
|
95
|
+
.meta({
|
|
96
|
+
description:
|
|
97
|
+
"Why the credential died, when `credentialState` is 'unusable'. " +
|
|
98
|
+
"'token_refresh_failed' — the provider rejected the refresh grant, " +
|
|
99
|
+
"which is a sign-in that simply aged out and is fixed by " +
|
|
100
|
+
"reconnecting. 'missing_refresh_token' — there is nothing left to " +
|
|
101
|
+
"refresh with, so reconnecting is the ONLY repair. " +
|
|
102
|
+
"'member_removed' — the person whose account backed this " +
|
|
103
|
+
"connection left the org, so someone else must reconnect it. " +
|
|
104
|
+
"'app_uninstalled' / 'tokens_revoked' — the grant was withdrawn on " +
|
|
105
|
+
"the provider's side, and reconnecting will fail again until it is " +
|
|
106
|
+
"restored there. The distinction matters because the four cases " +
|
|
107
|
+
"ask different things of the reader: three are 'click Reconnect' " +
|
|
108
|
+
"and one is 'go fix it in the provider first'. Null whenever " +
|
|
109
|
+
"`credentialState` is not 'unusable', and null on a connection " +
|
|
110
|
+
"revoked before this field existed.",
|
|
111
|
+
}),
|
|
86
112
|
})
|
|
87
113
|
.meta({
|
|
88
114
|
description: "Connection-status projection for an HR integration.",
|