@nakafa/aksara-contracts 0.48.2 → 0.48.3
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.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { type RollbackSignedContentRelease } from "#contracts/release/spec";
|
|
3
2
|
/** Maximum rows the backend may delete in one cleanup transaction. */
|
|
4
3
|
export declare const MAX_CLEANUP_PAGE_COUNT = 100;
|
|
5
4
|
/** Exact immutable release identity requested from durable target state. */
|
|
@@ -84,10 +83,73 @@ export declare const ContentReleaseBundleSchema: Schema.Struct<{
|
|
|
84
83
|
}>;
|
|
85
84
|
}>;
|
|
86
85
|
export type ContentReleaseBundle = typeof ContentReleaseBundleSchema.Type;
|
|
86
|
+
/** Rollback provenance that narrows a bundle to its signed release. */
|
|
87
|
+
declare const RollbackBundleProvenanceSchema: Schema.Struct<{
|
|
88
|
+
readonly release: Schema.refine<import("#contracts/release/spec").RollbackSignedContentRelease, Schema.Struct<{
|
|
89
|
+
readonly keyId: Schema.brand<Schema.String, "@NakafaAI/AksaraSigningKeyId">;
|
|
90
|
+
readonly manifest: Schema.Struct<{
|
|
91
|
+
readonly baseActiveAppLocales: Schema.NullOr<Schema.NonEmptyArray<Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">>>;
|
|
92
|
+
readonly baseManifestHash: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
|
|
93
|
+
readonly baseReleaseId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">>;
|
|
94
|
+
readonly baseResultCount: Schema.Finite;
|
|
95
|
+
readonly baseResultDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
96
|
+
readonly deleteCount: Schema.Finite;
|
|
97
|
+
readonly itemCount: Schema.Finite;
|
|
98
|
+
readonly itemsDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
99
|
+
readonly origin: Schema.Union<readonly [Schema.Struct<{
|
|
100
|
+
readonly kind: Schema.Literal<"git">;
|
|
101
|
+
readonly sha: Schema.brand<Schema.String, "@NakafaAI/AksaraGitCommitSha">;
|
|
102
|
+
}>, Schema.Struct<{
|
|
103
|
+
readonly kind: Schema.Literal<"rollback">;
|
|
104
|
+
readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
|
|
105
|
+
}>]>;
|
|
106
|
+
readonly projectionCount: Schema.Finite;
|
|
107
|
+
readonly projectionDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
108
|
+
readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
|
|
109
|
+
readonly rendererManifestHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
110
|
+
readonly resultCount: Schema.Finite;
|
|
111
|
+
readonly resultDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
112
|
+
readonly rollbackCount: Schema.Finite;
|
|
113
|
+
readonly rollbackDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
114
|
+
readonly routeCount: Schema.Finite;
|
|
115
|
+
readonly routeDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
116
|
+
readonly scope: Schema.Struct<{
|
|
117
|
+
readonly families: Schema.$Array<Schema.Literals<readonly ["article", "material", "page", "question"]>>;
|
|
118
|
+
readonly snapshots: Schema.$Array<Schema.Literals<readonly ["program", "quran", "tryout"]>>;
|
|
119
|
+
}>;
|
|
120
|
+
readonly snapshots: Schema.Struct<{
|
|
121
|
+
readonly program: Schema.Struct<{
|
|
122
|
+
readonly baseSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
|
|
123
|
+
readonly mode: Schema.Literals<readonly ["inherit", "replace", "restore"]>;
|
|
124
|
+
readonly resultSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
|
|
125
|
+
readonly rowCount: Schema.Int;
|
|
126
|
+
readonly rowDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
127
|
+
}>;
|
|
128
|
+
readonly quran: Schema.Struct<{
|
|
129
|
+
readonly baseSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
|
|
130
|
+
readonly mode: Schema.Literals<readonly ["inherit", "replace", "restore"]>;
|
|
131
|
+
readonly resultSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
|
|
132
|
+
readonly rowCount: Schema.Int;
|
|
133
|
+
readonly rowDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
134
|
+
}>;
|
|
135
|
+
readonly tryout: Schema.Struct<{
|
|
136
|
+
readonly baseSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
|
|
137
|
+
readonly mode: Schema.Literals<readonly ["inherit", "replace", "restore"]>;
|
|
138
|
+
readonly resultSnapshotId: Schema.NullOr<Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">>;
|
|
139
|
+
readonly rowCount: Schema.Int;
|
|
140
|
+
readonly rowDigest: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
141
|
+
}>;
|
|
142
|
+
}>;
|
|
143
|
+
readonly upsertCount: Schema.Finite;
|
|
144
|
+
readonly activeAppLocales: Schema.NonEmptyArray<Schema.brand<Schema.Literals<readonly ["en", "id", "de"]>, "@NakafaAI/AksaraAppLocale">>;
|
|
145
|
+
readonly format: Schema.Literal<"localized-content-release">;
|
|
146
|
+
}>;
|
|
147
|
+
readonly manifestHash: Schema.brand<Schema.String, "@NakafaAI/AksaraSha256Hash">;
|
|
148
|
+
readonly signature: Schema.brand<Schema.String, "@NakafaAI/AksaraEd25519Signature">;
|
|
149
|
+
}>>;
|
|
150
|
+
}>;
|
|
87
151
|
/** Frozen renderer plus one signed rollback release at recovery boundaries. */
|
|
88
|
-
export type RollbackContentReleaseBundle = ContentReleaseBundle &
|
|
89
|
-
readonly release: RollbackSignedContentRelease;
|
|
90
|
-
};
|
|
152
|
+
export type RollbackContentReleaseBundle = ContentReleaseBundle & typeof RollbackBundleProvenanceSchema.Type;
|
|
91
153
|
/** Exact renderer-bound bundle accepted only for recovery publication. */
|
|
92
154
|
export declare const RollbackContentReleaseBundleSchema: Schema.refine<RollbackContentReleaseBundle, Schema.Struct<{
|
|
93
155
|
readonly release: Schema.Struct<{
|
|
@@ -249,3 +311,4 @@ export declare const ReleaseCleanupReceiptSchema: Schema.Struct<{
|
|
|
249
311
|
readonly retryAt: Schema.optional<Schema.Finite>;
|
|
250
312
|
}>;
|
|
251
313
|
export type ReleaseCleanupReceipt = typeof ReleaseCleanupReceiptSchema.Type;
|
|
314
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { ReleaseIdSchema, Sha256HashSchema } from "#contracts/ids";
|
|
3
|
-
import { PublicationReceiptSchema, SignedContentReleaseSchema, } from "#contracts/release/spec";
|
|
3
|
+
import { PublicationReceiptSchema, RollbackSignedContentReleaseSchema, SignedContentReleaseSchema, } from "#contracts/release/spec";
|
|
4
4
|
import { RendererManifestEnvelopeSchema } from "#contracts/renderer/contract";
|
|
5
5
|
const CleanupCountSchema = Schema.Finite.pipe(Schema.check(Schema.isInt()), Schema.check(Schema.isGreaterThanOrEqualTo(0)));
|
|
6
6
|
/** Maximum rows the backend may delete in one cleanup transaction. */
|
|
@@ -19,6 +19,10 @@ export const ContentReleaseBundleSchema = Schema.Struct({
|
|
|
19
19
|
bundle.rendererManifest.hash, {
|
|
20
20
|
message: "Expected the signed release to bind the frozen renderer envelope.",
|
|
21
21
|
})));
|
|
22
|
+
/** Rollback provenance that narrows a bundle to its signed release. */
|
|
23
|
+
const RollbackBundleProvenanceSchema = Schema.Struct({
|
|
24
|
+
release: RollbackSignedContentReleaseSchema,
|
|
25
|
+
});
|
|
22
26
|
/** Exact renderer-bound bundle accepted only for recovery publication. */
|
|
23
27
|
export const RollbackContentReleaseBundleSchema = ContentReleaseBundleSchema.pipe(Schema.refine((bundle) => bundle.release.manifest.origin.kind === "rollback", { message: "Expected a renderer-bound rollback release." }));
|
|
24
28
|
const ContentReleaseStatusIdentity = {
|
package/dist/release/spec.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { type ReleaseId } from "#contracts/ids";
|
|
3
2
|
import { type AppLocale } from "#contracts/locale";
|
|
4
3
|
/** Semantic wire identity of the current localized content release. */
|
|
5
4
|
export declare const CONTENT_RELEASE_FORMAT = "localized-content-release";
|
|
@@ -187,15 +186,17 @@ export declare const SignedContentReleaseSchema: Schema.Struct<{
|
|
|
187
186
|
export type SignedContentRelease = typeof SignedContentReleaseSchema.Type;
|
|
188
187
|
/** Checks whether one application locale is active in a signed release. */
|
|
189
188
|
export declare function releaseActivatesAppLocale(release: SignedContentRelease, appLocale: AppLocale): boolean;
|
|
189
|
+
/** Rollback provenance that narrows a signed release to its origin. */
|
|
190
|
+
declare const RollbackProvenanceSchema: Schema.Struct<{
|
|
191
|
+
readonly manifest: Schema.Struct<{
|
|
192
|
+
readonly origin: Schema.Struct<{
|
|
193
|
+
readonly kind: Schema.Literal<"rollback">;
|
|
194
|
+
readonly releaseId: Schema.brand<Schema.String, "@NakafaAI/AksaraReleaseId">;
|
|
195
|
+
}>;
|
|
196
|
+
}>;
|
|
197
|
+
}>;
|
|
190
198
|
/** Signed release whose provenance identifies one exact rollback target. */
|
|
191
|
-
export type RollbackSignedContentRelease = SignedContentRelease &
|
|
192
|
-
readonly manifest: SignedContentRelease["manifest"] & {
|
|
193
|
-
readonly origin: {
|
|
194
|
-
readonly kind: "rollback";
|
|
195
|
-
readonly releaseId: ReleaseId;
|
|
196
|
-
};
|
|
197
|
-
};
|
|
198
|
-
};
|
|
199
|
+
export type RollbackSignedContentRelease = SignedContentRelease & typeof RollbackProvenanceSchema.Type;
|
|
199
200
|
/** Signed release contract accepted only for rollback-owned operations. */
|
|
200
201
|
export declare const RollbackSignedContentReleaseSchema: Schema.refine<RollbackSignedContentRelease, Schema.Struct<{
|
|
201
202
|
readonly keyId: Schema.brand<Schema.String, "@NakafaAI/AksaraSigningKeyId">;
|
|
@@ -468,3 +469,4 @@ export declare const PublicationReceiptSchema: Schema.Struct<{
|
|
|
468
469
|
readonly stagedSnapshotRows: Schema.Finite;
|
|
469
470
|
}>;
|
|
470
471
|
export type PublicationReceipt = typeof PublicationReceiptSchema.Type;
|
|
472
|
+
export {};
|
package/dist/release/spec.js
CHANGED
|
@@ -3,7 +3,7 @@ import { ContentFamilySchema } from "#contracts/content";
|
|
|
3
3
|
import { ContentDeliveryClassSchema } from "#contracts/delivery";
|
|
4
4
|
import { ContentKeySchema, CorpusSourcePathSchema, Ed25519SignatureSchema, ReleaseIdSchema, Sha256HashSchema, SigningKeyIdSchema, } from "#contracts/ids";
|
|
5
5
|
import { ActiveAppLocaleListSchema, ArtifactLocaleSchema, } from "#contracts/locale";
|
|
6
|
-
import { ReleaseOriginSchema } from "#contracts/release/origin";
|
|
6
|
+
import { ReleaseOriginSchema, RollbackReleaseOriginSchema, } from "#contracts/release/origin";
|
|
7
7
|
import { EMPTY_RESULT_CATALOG_DIGEST } from "#contracts/release/result/spec";
|
|
8
8
|
import { PublicationScopeSchema } from "#contracts/release/snapshot/scope";
|
|
9
9
|
import { ContentSnapshotSetSchema, hasEmptySnapshotBases, hasGitSnapshotModes, hasRollbackSnapshotModes, hasScopedSnapshotTransitions, snapshotRowCount, } from "#contracts/release/snapshot/spec";
|
|
@@ -112,6 +112,10 @@ export const SignedContentReleaseSchema = Schema.Struct({
|
|
|
112
112
|
export function releaseActivatesAppLocale(release, appLocale) {
|
|
113
113
|
return Arr.contains(release.manifest.activeAppLocales, appLocale);
|
|
114
114
|
}
|
|
115
|
+
/** Rollback provenance that narrows a signed release to its origin. */
|
|
116
|
+
const RollbackProvenanceSchema = Schema.Struct({
|
|
117
|
+
manifest: Schema.Struct({ origin: RollbackReleaseOriginSchema }),
|
|
118
|
+
});
|
|
115
119
|
/** Signed release contract accepted only for rollback-owned operations. */
|
|
116
120
|
export const RollbackSignedContentReleaseSchema = SignedContentReleaseSchema.pipe(Schema.refine((release) => release.manifest.origin.kind === "rollback", { message: "Expected a signed rollback release." }));
|
|
117
121
|
/** Checks that every staged head has exactly one matching item and artifact. */
|
package/package.json
CHANGED