@fabrika/provider-contract 0.0.25 → 0.2.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 +2 -2
- package/src/control.ts +26 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabrika/provider-contract",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
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
|
|
29
|
+
"@fabrika/auth-core": "^0.2.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/control.ts
CHANGED
|
@@ -164,6 +164,18 @@ export class ProviderNamespaceError extends Error {
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
+
/**
|
|
168
|
+
* A provider-managed secret write the provider refuses on the app's own terms — a value naming a
|
|
169
|
+
* service the app does not own, say. `message` carries the secret's name and the offending host,
|
|
170
|
+
* never the value, so core may hand it to the caller as a 4xx.
|
|
171
|
+
*/
|
|
172
|
+
export class ProviderSecretError extends Error {
|
|
173
|
+
constructor(message: string, readonly code: string) {
|
|
174
|
+
super(message)
|
|
175
|
+
this.name = 'ProviderSecretError'
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
167
179
|
/** Persist a canonical namespace target immediately after one external mutation succeeds. */
|
|
168
180
|
export interface ProviderNamespaceEvents {
|
|
169
181
|
checkpoint(namespace: ProviderDeploymentNamespace): Promise<void>
|
|
@@ -212,12 +224,26 @@ export interface ProviderNamespaceFact {
|
|
|
212
224
|
readonly resource?: true
|
|
213
225
|
}
|
|
214
226
|
|
|
227
|
+
/**
|
|
228
|
+
* One public host this namespace's own entry point answers on, with the listener port that publishes it.
|
|
229
|
+
*
|
|
230
|
+
* Only the provider knows how a host comes to exist — Zerops generates one per published HTTP port — and
|
|
231
|
+
* core knows which of them an application environment already claims, so the provider names them and core
|
|
232
|
+
* marks them. A namespace whose domains are bound out of band names none: the provider cannot see them.
|
|
233
|
+
*/
|
|
234
|
+
export interface ProviderNamespaceHost {
|
|
235
|
+
readonly host: string
|
|
236
|
+
readonly port: number
|
|
237
|
+
}
|
|
238
|
+
|
|
215
239
|
/** Provider-owned operator copy for a planned or persisted namespace. */
|
|
216
240
|
export interface ProviderNamespacePresentation {
|
|
217
241
|
readonly preset: string
|
|
218
242
|
readonly title: string
|
|
219
243
|
readonly facts: readonly ProviderNamespaceFact[]
|
|
220
244
|
readonly instructions: readonly string[]
|
|
245
|
+
/** The hosts this namespace can serve, so an operator can name one as an environment's domain. */
|
|
246
|
+
readonly hosts?: readonly ProviderNamespaceHost[]
|
|
221
247
|
}
|
|
222
248
|
|
|
223
249
|
/** A mutation-free preview that can be submitted unchanged to namespace creation. */
|