@fabrika/provider-contract 0.0.21 → 0.0.23

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/control.ts +23 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabrika/provider-contract",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,6 +26,6 @@
26
26
  "test": "bun test"
27
27
  },
28
28
  "dependencies": {
29
- "@fabrika/auth-core": "^0.0.21"
29
+ "@fabrika/auth-core": "^0.0.23"
30
30
  }
31
31
  }
package/src/control.ts CHANGED
@@ -148,6 +148,22 @@ export interface ProviderManagedSecrets {
148
148
  delete(input: ProviderSecretDeleteInput): Promise<void>
149
149
  }
150
150
 
151
+ /**
152
+ * A namespace lifecycle failure an operator can act on.
153
+ *
154
+ * `code` is a STABLE identifier — a platform error code, or one this provider defines for a lifecycle
155
+ * invariant — so core can record and a console can render the CLASS of a failure instead of matching
156
+ * prose. `message` is the provider's own summary; `detail` carries the upstream's words VERBATIM.
157
+ * Neither is safe to persist as-is: core redacts both before they reach a row or a log, because only
158
+ * core knows what a credential looks like in this installation.
159
+ */
160
+ export class ProviderNamespaceError extends Error {
161
+ constructor(message: string, readonly code: string, readonly retryable: boolean, readonly detail?: string) {
162
+ super(message)
163
+ this.name = 'ProviderNamespaceError'
164
+ }
165
+ }
166
+
151
167
  /** Persist a canonical namespace target immediately after one external mutation succeeds. */
152
168
  export interface ProviderNamespaceEvents {
153
169
  checkpoint(namespace: ProviderDeploymentNamespace): Promise<void>
@@ -187,6 +203,13 @@ export interface ProviderNamespacePlanInput {
187
203
  export interface ProviderNamespaceFact {
188
204
  readonly label: string
189
205
  readonly value: string
206
+ /**
207
+ * Marks a fact that NAMES A LIVE PROVIDER RESOURCE, not a policy choice. Core deletes no provider
208
+ * resource, so removal has to tell the operator what it stopped tracking — and only the provider
209
+ * knows which of its facts is a real thing with an id. Absent means "not a resource"; a fact is
210
+ * marked only when its value identifies something that outlives the namespace row.
211
+ */
212
+ readonly resource?: true
190
213
  }
191
214
 
192
215
  /** Provider-owned operator copy for a planned or persisted namespace. */