@fabrika/provider-contract 0.6.0 → 0.8.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 +19 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabrika/provider-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,6 +31,6 @@
|
|
|
31
31
|
"test": "bun test"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@fabrika/auth-core": "0.
|
|
34
|
+
"@fabrika/auth-core": "0.8.0"
|
|
35
35
|
}
|
|
36
36
|
}
|
package/src/control.ts
CHANGED
|
@@ -41,16 +41,29 @@ export interface ProviderDeploymentNamespace {
|
|
|
41
41
|
readonly target: ProviderEnvelope
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/** A framework release as npm publishes it; the only form one may take before it reaches a generated build command. */
|
|
45
|
+
export const FRAMEWORK_RELEASE_PATTERN = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/
|
|
46
|
+
|
|
44
47
|
/**
|
|
45
48
|
* The access Control approved for one application environment (ADR-0050): the contract the proxy enforces and the
|
|
46
49
|
* IAM vocabulary compiled from it. A provider publishes a contract application's endpoint table and reconciles its
|
|
47
50
|
* IAM schema from this, never from the artifact or a runner's report.
|
|
48
51
|
*/
|
|
49
52
|
export interface ProviderApprovedAccess {
|
|
53
|
+
/** The contract in this platform release's model, upcast from the application's own release's artifact (ADR-0062). */
|
|
50
54
|
readonly contract: ContractArtifact
|
|
51
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* The digest the application's own framework release computes for its contract, which it compares with
|
|
57
|
+
* `FABRIKA_CONTRACT_DIGEST` at startup. It is `contractDigest(contract)` only when the application is on this
|
|
58
|
+
* release's artifact format, so a provider never derives it from `contract`.
|
|
59
|
+
*/
|
|
52
60
|
readonly contractDigest: string
|
|
53
61
|
readonly schema: AppSchema
|
|
62
|
+
/**
|
|
63
|
+
* The `@fabrika/check` release whose reader read the application (`FRAMEWORK_RELEASE_PATTERN`): the newest patch of
|
|
64
|
+
* the framework minor it pins (ADR-0062). Its build checks with that release.
|
|
65
|
+
*/
|
|
66
|
+
readonly checker: string
|
|
54
67
|
}
|
|
55
68
|
|
|
56
69
|
/** Persisted deploy data for one app environment. */
|
|
@@ -481,6 +494,11 @@ export interface ControlProvider {
|
|
|
481
494
|
/** Absent means core stores the registration as submitted. */
|
|
482
495
|
normalizeRegistration?(input: ProviderRegistrationInput): ProviderRegistration
|
|
483
496
|
resolveSource?(input: ProviderSourceResolutionInput): Promise<ProviderSourceResolution>
|
|
497
|
+
/**
|
|
498
|
+
* Mutation-free check of a candidate's compatibility with its placement. Control calls it before publishing the
|
|
499
|
+
* snapshot, under the namespace lease, on every publication attempt. The candidate is not yet approved access.
|
|
500
|
+
*/
|
|
501
|
+
validateAccess?(input: { readonly environment: ProviderEnvironment; readonly access: ProviderApprovedAccess }): void
|
|
484
502
|
deploy(input: ProviderDeployInput): Promise<ProviderDeployOutcome>
|
|
485
503
|
cancel?(input: ProviderCancelInput): Promise<ProviderCancelOutcome>
|
|
486
504
|
reconcile?(input: ProviderReconcileInput): Promise<ProviderReconcileOutcome>
|