@rathnasgala2/adapter-github-pages 0.1.2 → 0.1.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.
- package/CHANGELOG.md +13 -0
- package/package.json +1 -1
- package/types/index.d.ts +36 -0
- package/types/public-read.d.ts +9 -1
- package/types/store.d.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,19 @@ and this project adheres to
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [0.1.3] - 2026-10-23
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- The shipped TypeScript declarations (`types/`) are regenerated from `src/`.
|
|
16
|
+
The 0.1.2 package shipped the `observe` CDN wait and the transport error
|
|
17
|
+
policy in `src/` but declarations that predated them, so a TypeScript consumer
|
|
18
|
+
saw no `now` clock on the destination, no `cacheControl` on a public read and
|
|
19
|
+
no `entries` on the staged and certified records. The declarations now carry
|
|
20
|
+
`PagesDestination.now`, the `ObserveProgress` type, `readServedGeneration`,
|
|
21
|
+
`maxAgeSeconds` and the `cacheControl` and `entries` members. There is no
|
|
22
|
+
runtime change from 0.1.2.
|
|
23
|
+
|
|
11
24
|
## [0.1.2] - 2026-10-23
|
|
12
25
|
|
|
13
26
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rathnasgala2/adapter-github-pages",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Managed GitHub Pages deployment adapter: deterministic uncompressed ustar Pages carrier, raw Pages deployment REST catalog, bounded status polling and credential-free public verification.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
package/types/index.d.ts
CHANGED
|
@@ -300,6 +300,7 @@ export type PagesDestination = Readonly<{
|
|
|
300
300
|
fetch?: typeof globalThis.fetch;
|
|
301
301
|
publicFetch?: typeof globalThis.fetch;
|
|
302
302
|
sleep?: (seconds: number) => Promise<void>;
|
|
303
|
+
now?: () => number;
|
|
303
304
|
runId?: string;
|
|
304
305
|
runAttempt?: number;
|
|
305
306
|
headSha?: string;
|
|
@@ -308,6 +309,41 @@ export type StagedFile = Readonly<{
|
|
|
308
309
|
path: string;
|
|
309
310
|
bytes: Buffer;
|
|
310
311
|
}>;
|
|
312
|
+
/**
|
|
313
|
+
* What `observe` keeps between passes so a retry reads only what is still
|
|
314
|
+
* wrong: the routes whose bytes already match the staged entry, the latest
|
|
315
|
+
* bytes of the others, and the marker read until it matches.
|
|
316
|
+
*/
|
|
317
|
+
export type ObserveProgress = {
|
|
318
|
+
matched: Map<string, import("./artifact-projection.js").ArtifactEntry>;
|
|
319
|
+
matchedPass: Map<string, number>;
|
|
320
|
+
latest: Map<string, import("./artifact-projection.js").ArtifactEntry>;
|
|
321
|
+
statuses: Map<string, number>;
|
|
322
|
+
served: Awaited<ReturnType<typeof readServedGeneration>> | null;
|
|
323
|
+
markerPass: number;
|
|
324
|
+
pass: number;
|
|
325
|
+
cursor: number;
|
|
326
|
+
confirmed: boolean;
|
|
327
|
+
errorCode: string | null;
|
|
328
|
+
errorStreak: number;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* Read the generation identity the public origin currently serves, or
|
|
332
|
+
* `null` when nothing has ever been activated. A redirecting origin is
|
|
333
|
+
* reported as the `PAGES_PUBLIC_REDIRECT` failure with the generation
|
|
334
|
+
* unknown, never thrown.
|
|
335
|
+
*
|
|
336
|
+
* @param {PagesDestination} destination the bound destination
|
|
337
|
+
* @returns {Promise<{generationId: string | null, artifactDigest: string | null, findings: string[], cacheControl?: string | null | undefined, failure?: PublicRedirectFailure}>}
|
|
338
|
+
* the observed public generation
|
|
339
|
+
*/
|
|
340
|
+
declare function readServedGeneration(destination: PagesDestination): Promise<{
|
|
341
|
+
generationId: string | null;
|
|
342
|
+
artifactDigest: string | null;
|
|
343
|
+
findings: string[];
|
|
344
|
+
cacheControl?: string | null | undefined;
|
|
345
|
+
failure?: PublicRedirectFailure;
|
|
346
|
+
}>;
|
|
311
347
|
export { EXPECT_NOTHING_SERVED, fenceFor, generateUuidV7 } from "@rathnasgala2/adapter-protocol";
|
|
312
348
|
export { decodeCarrier, encodeCarrier } from "./carrier.js";
|
|
313
349
|
export { GENERATION_MARKER_PATH, ADAPTER_VERSION, NORMAL_MODE, RECOVERY_MODE } from "./constants.js";
|
package/types/public-read.d.ts
CHANGED
|
@@ -12,12 +12,19 @@
|
|
|
12
12
|
* @returns {string} the absolute public URL
|
|
13
13
|
*/
|
|
14
14
|
export function publicUrlFor(publicBaseUrl: string, artifactRelativePath: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* The `max-age` a `Cache-Control` header declares, in seconds.
|
|
17
|
+
*
|
|
18
|
+
* @param {string | null | undefined} cacheControl the header value
|
|
19
|
+
* @returns {number | null} the lifetime, `null` when none is declared
|
|
20
|
+
*/
|
|
21
|
+
export function maxAgeSeconds(cacheControl: string | null | undefined): number | null;
|
|
15
22
|
/**
|
|
16
23
|
* Read one public route.
|
|
17
24
|
*
|
|
18
25
|
* @param {PublicContext} context the public-origin context
|
|
19
26
|
* @param {string} artifactRelativePath the artifact-relative POSIX path
|
|
20
|
-
* @returns {Promise<{status: number | 'redirect', bytes: Buffer | null, etag: string | null, toHost?: string | null, location?: string | null}>}
|
|
27
|
+
* @returns {Promise<{status: number | 'redirect', bytes: Buffer | null, etag: string | null, cacheControl?: string | null | undefined, toHost?: string | null, location?: string | null}>}
|
|
21
28
|
* the bounded observation; `bytes` is `null` for any non-`200` status. A
|
|
22
29
|
* `'redirect'` status carries the `toHost` and absolute `location` the
|
|
23
30
|
* origin named (`null` when it named none that could be read).
|
|
@@ -26,6 +33,7 @@ export function readPublic(context: PublicContext, artifactRelativePath: string)
|
|
|
26
33
|
status: number | "redirect";
|
|
27
34
|
bytes: Buffer | null;
|
|
28
35
|
etag: string | null;
|
|
36
|
+
cacheControl?: string | null | undefined;
|
|
29
37
|
toHost?: string | null;
|
|
30
38
|
location?: string | null;
|
|
31
39
|
}>;
|
package/types/store.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export type StageRecord = Readonly<{
|
|
|
48
48
|
artifactId: string;
|
|
49
49
|
artifactDigest: string;
|
|
50
50
|
entryPaths: readonly string[];
|
|
51
|
+
entries: readonly import("./artifact-projection.js").ArtifactEntry[];
|
|
51
52
|
carrierBytes: Buffer;
|
|
52
53
|
carrierDigest: string;
|
|
53
54
|
pagesArtifactId: string;
|
|
@@ -61,6 +62,7 @@ export type DestinationState = {
|
|
|
61
62
|
pagesDeploymentId: string;
|
|
62
63
|
certifiedAt: string;
|
|
63
64
|
entryPaths: readonly string[];
|
|
65
|
+
entries: readonly import("./artifact-projection.js").ArtifactEntry[];
|
|
64
66
|
}>;
|
|
65
67
|
inFlight: Map<string, string>;
|
|
66
68
|
};
|