@fabrika/provider-contract 0.9.0-dev.1 → 0.9.0-dev.10

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.
@@ -0,0 +1,17 @@
1
+ /** A value that can cross the provider persistence boundary without provider-specific types. */
2
+ export type JsonValue = null | boolean | number | string | JsonValue[] | {
3
+ [key: string]: JsonValue;
4
+ };
5
+ /** Persisted provider data. The provider owns the payload schema and its version. */
6
+ export interface ProviderEnvelope {
7
+ readonly provider: string;
8
+ readonly version: number;
9
+ readonly payload: JsonValue;
10
+ }
11
+ /** Converts one provider-owned value to and from its versioned JSON payload. */
12
+ export interface ProviderCodec<T> {
13
+ readonly version: number;
14
+ encode(value: T): JsonValue;
15
+ decode(payload: JsonValue): T;
16
+ }
17
+ export declare const decodeEnvelope: <T>(kind: string, provider: string, envelope: ProviderEnvelope, codec: ProviderCodec<T>) => T;
@@ -0,0 +1,17 @@
1
+ import type { AppSchema } from '@fabrika/auth-core';
2
+ /** Inputs needed to reconcile one app's authorization vocabulary into IAM. */
3
+ export interface SchemaReconcileInput {
4
+ url: string;
5
+ app: string;
6
+ schema: AppSchema;
7
+ /**
8
+ * Every origin IAM may hand this app a session at, as known by the control plane. Omitted leaves
9
+ * IAM's registry alone; a supplied set replaces it. It travels beside the schema and never inside
10
+ * it — an app declares its vocabulary, the control plane declares where the app lives.
11
+ */
12
+ returnOrigins?: readonly string[];
13
+ adminKey?: string;
14
+ signal: AbortSignal;
15
+ }
16
+ /** Provider-neutral port for authorization schema reconciliation. */
17
+ export type SchemaReconciler = (input: SchemaReconcileInput) => Promise<void>;
@@ -0,0 +1,23 @@
1
+ /** What happened to one provider deploy step. */
2
+ export interface DeployStepResult {
3
+ readonly id: string;
4
+ readonly status: 'succeeded' | 'failed' | 'skipped';
5
+ readonly error?: string;
6
+ readonly startedAt?: number;
7
+ readonly finishedAt?: number;
8
+ }
9
+ export interface RunStepsOptions {
10
+ readonly appId: string;
11
+ readonly env: string;
12
+ readonly dryRun: boolean;
13
+ readonly signal: AbortSignal;
14
+ readonly log: (line: string) => void;
15
+ }
16
+ /** Run a provider's steps in order. The first failure or a cancellation skips every later step. */
17
+ export declare const runSteps: <TStep extends {
18
+ readonly id: string;
19
+ readonly description: string;
20
+ }>(steps: readonly TStep[], options: RunStepsOptions, runOne: (step: TStep) => Promise<void>) => Promise<{
21
+ readonly status: "succeeded" | "failed";
22
+ readonly steps: readonly DeployStepResult[];
23
+ }>;