@rathnasgala2/adapter-github-pages 0.1.0 → 0.1.1
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 +39 -0
- package/LICENSE +201 -0
- package/README.md +24 -9
- package/package.json +32 -12
- package/src/artifact-projection.js +12 -5
- package/src/capability.js +8 -3
- package/src/carrier.js +77 -33
- package/src/constants.js +7 -3
- package/src/deployment.js +61 -56
- package/src/errors.js +32 -0
- package/src/index.js +40 -36
- package/src/marker.js +4 -2
- package/src/oidc.js +97 -8
- package/src/public-read.js +4 -2
- package/src/recovery.js +6 -4
- package/src/redaction.js +8 -4
- package/src/request-catalog.js +7 -4
- package/src/rest.js +63 -24
- package/types/artifact-projection.d.ts +48 -0
- package/types/capability.d.ts +23 -0
- package/types/carrier.d.ts +49 -0
- package/types/constants.d.ts +86 -0
- package/types/deployment.d.ts +107 -0
- package/types/errors.d.ts +28 -0
- package/types/index.d.ts +299 -0
- package/types/marker.d.ts +26 -0
- package/types/oidc.d.ts +108 -0
- package/types/public-read.d.ts +33 -0
- package/types/recovery.d.ts +175 -0
- package/types/redaction.d.ts +38 -0
- package/types/request-catalog.d.ts +106 -0
- package/types/rest.d.ts +159 -0
- package/types/store.d.ts +66 -0
- package/src/index.d.ts +0 -246
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compare two rows by their member JCS bytes. DEC-097 section 7:
|
|
3
|
+
* `requestTemplates` is "sorted by member JCS bytes", and the
|
|
4
|
+
* `callClassBinding` rows follow the same order.
|
|
5
|
+
*
|
|
6
|
+
* @param {Readonly<Record<string, unknown>>} left the first row
|
|
7
|
+
* @param {Readonly<Record<string, unknown>>} right the second row
|
|
8
|
+
* @returns {number} the byte-order comparison
|
|
9
|
+
*/
|
|
10
|
+
export function compareTemplatesByJcsBytes(left: Readonly<Record<string, unknown>>, right: Readonly<Record<string, unknown>>): number;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the declared binding row for one `(stage, callClass)` pair.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} stage the lifecycle stage
|
|
15
|
+
* @param {string} callClass the call class
|
|
16
|
+
* @returns {Readonly<{stage: string, callClass: string, pagesDeploymentIdSource: string, recoveryOnly: boolean}>}
|
|
17
|
+
* the binding row
|
|
18
|
+
*/
|
|
19
|
+
export function callClassIdBinding(stage: string, callClass: string): Readonly<{
|
|
20
|
+
stage: string;
|
|
21
|
+
callClass: string;
|
|
22
|
+
pagesDeploymentIdSource: string;
|
|
23
|
+
recoveryOnly: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Build the exact nine-template catalog bound to one API origin.
|
|
27
|
+
*
|
|
28
|
+
* @param {string} [apiOrigin] the canonical `https://` GitHub REST origin;
|
|
29
|
+
* defaults to the declared {@link GITHUB_API_ORIGIN}
|
|
30
|
+
* @returns {readonly Readonly<Record<string, unknown>>[]} the frozen catalog,
|
|
31
|
+
* sorted by member JCS bytes
|
|
32
|
+
*/
|
|
33
|
+
export function buildRequestTemplates(apiOrigin?: string): readonly Readonly<Record<string, unknown>>[];
|
|
34
|
+
/**
|
|
35
|
+
* Resolve one template by its `(stage, callClass)` pair. The same call class
|
|
36
|
+
* appears under several stages, so the pair — never the call class alone —
|
|
37
|
+
* is the catalog key.
|
|
38
|
+
*
|
|
39
|
+
* @param {readonly Readonly<Record<string, unknown>>[]} templates the catalog
|
|
40
|
+
* @param {string} stage the lifecycle stage issuing the call
|
|
41
|
+
* @param {string} callClass the call class to resolve
|
|
42
|
+
* @returns {Readonly<Record<string, unknown>>} the template
|
|
43
|
+
*/
|
|
44
|
+
export function requireTemplate(templates: readonly Readonly<Record<string, unknown>>[], stage: string, callClass: string): Readonly<Record<string, unknown>>;
|
|
45
|
+
/** The exact request-template profile this adapter declares. */
|
|
46
|
+
export const REQUEST_TEMPLATE_PROFILE: "gala-github-pages-http-v2";
|
|
47
|
+
/**
|
|
48
|
+
* The single origin every cataloged row targets. DEC-097 section 7: "Every
|
|
49
|
+
* row's origin is exactly `https://api.github.com`". The injectable
|
|
50
|
+
* `apiOrigin` exists only so a fixture can bind the identical code path to a
|
|
51
|
+
* local fake provider; the declared default is these exact bytes.
|
|
52
|
+
*/
|
|
53
|
+
export const GITHUB_API_ORIGIN: "https://api.github.com";
|
|
54
|
+
/**
|
|
55
|
+
* The GitHub REST API version header every call pins. DEC-097 section 7
|
|
56
|
+
* fixes it as the exact bytes below; it is not a free choice.
|
|
57
|
+
*/
|
|
58
|
+
export const GITHUB_API_VERSION: "2026-03-10";
|
|
59
|
+
/**
|
|
60
|
+
* The `pagesDeploymentId` source a row's call class statically selects.
|
|
61
|
+
* `none` means the row's request target has no `pagesDeploymentId` variable.
|
|
62
|
+
*/
|
|
63
|
+
export const DEPLOYMENT_ID_SOURCES: readonly string[];
|
|
64
|
+
/**
|
|
65
|
+
* The request-body profile of the only two rows that carry an entity.
|
|
66
|
+
* DEC-097 section 7: "Only `pages-create-deployment` carries
|
|
67
|
+
* `requestBodyProfile: gala-pages-create-deployment-jcs-v2`".
|
|
68
|
+
*/
|
|
69
|
+
export const CREATE_BODY_PROFILE: "gala-pages-create-deployment-jcs-v2";
|
|
70
|
+
/**
|
|
71
|
+
* The declared `callClassBinding` rows (`adapter-capability` 2.8.0,
|
|
72
|
+
* LOCAL-52 (2)): for every `(stage, callClass)` pair of the nine-row
|
|
73
|
+
* catalog, the `pagesDeploymentId` source its call class statically selects
|
|
74
|
+
* and whether the row is admitted only in `pages-reconciliation-recovery`
|
|
75
|
+
* mode.
|
|
76
|
+
*
|
|
77
|
+
* These two facts are contract-normative but cannot be members of the
|
|
78
|
+
* template rows themselves: `providerRequestTemplate` is closed with
|
|
79
|
+
* `additionalProperties: false`. Until schema 2.8.0 they lived here as an
|
|
80
|
+
* undeclared side table; they are now declared in the capability document
|
|
81
|
+
* under `limits.callClassBinding`, bound by their own
|
|
82
|
+
* `callClassBindingDigest` under `GALA-PROVIDER-CALL-CLASS-BINDING-V2\0`,
|
|
83
|
+
* and enforced in `rest.js`. The template catalog and its
|
|
84
|
+
* `requestTemplateCatalogDigest` are byte-identical to before.
|
|
85
|
+
*
|
|
86
|
+
* Sorted by member JCS bytes, like the template rows.
|
|
87
|
+
*
|
|
88
|
+
* @type {readonly Readonly<{stage: string, callClass: string, pagesDeploymentIdSource: string, recoveryOnly: boolean}>[]}
|
|
89
|
+
*/
|
|
90
|
+
export const CALL_CLASS_BINDING: readonly Readonly<{
|
|
91
|
+
stage: string;
|
|
92
|
+
callClass: string;
|
|
93
|
+
pagesDeploymentIdSource: string;
|
|
94
|
+
recoveryOnly: boolean;
|
|
95
|
+
}>[];
|
|
96
|
+
/**
|
|
97
|
+
* The exact nine `(stage, callClass)` pairs DEC-097 section 7 admits.
|
|
98
|
+
*
|
|
99
|
+
* @type {readonly Readonly<{stage: string, callClass: string}>[]}
|
|
100
|
+
*/
|
|
101
|
+
export const PAGES_CALL_PLAN: readonly Readonly<{
|
|
102
|
+
stage: string;
|
|
103
|
+
callClass: string;
|
|
104
|
+
}>[];
|
|
105
|
+
/** The exact closed response-profile catalog this adapter can parse. */
|
|
106
|
+
export const RESPONSE_PROFILES: readonly string[];
|
package/types/rest.d.ts
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Readonly<{
|
|
3
|
+
* status: number,
|
|
4
|
+
* headers: Readonly<Record<string, string>>,
|
|
5
|
+
* body: unknown,
|
|
6
|
+
* rawByteCount: number
|
|
7
|
+
* }>} ProviderResponse
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {Readonly<{
|
|
11
|
+
* apiOrigin: string,
|
|
12
|
+
* owner: string,
|
|
13
|
+
* repository: string,
|
|
14
|
+
* token: string,
|
|
15
|
+
* mode?: string,
|
|
16
|
+
* pagesBuildVersion?: string,
|
|
17
|
+
* priorPagesBuildVersion?: string,
|
|
18
|
+
* fetch?: typeof globalThis.fetch,
|
|
19
|
+
* requestTemplates: readonly Readonly<Record<string, unknown>>[]
|
|
20
|
+
* }>} RestContext
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Bind the per-activation identities a call class may statically select.
|
|
24
|
+
*
|
|
25
|
+
* @param {RestContext} context the bound REST context
|
|
26
|
+
* @param {{
|
|
27
|
+
* mode?: string,
|
|
28
|
+
* pagesBuildVersion?: string,
|
|
29
|
+
* priorPagesBuildVersion?: string
|
|
30
|
+
* }} identity the identities this attempt is authorized for
|
|
31
|
+
* @returns {RestContext} a new frozen context
|
|
32
|
+
*/
|
|
33
|
+
export function bindIdentity(context: RestContext, identity: {
|
|
34
|
+
mode?: string;
|
|
35
|
+
pagesBuildVersion?: string;
|
|
36
|
+
priorPagesBuildVersion?: string;
|
|
37
|
+
}): RestContext;
|
|
38
|
+
/**
|
|
39
|
+
* Render a catalog template's request target by substituting only the closed
|
|
40
|
+
* placeholder set. An unknown placeholder is a programming error, not a
|
|
41
|
+
* caller-controlled value.
|
|
42
|
+
*
|
|
43
|
+
* @param {string} template the `requestTargetTemplate`
|
|
44
|
+
* @param {Readonly<Record<string, string>>} values placeholder values
|
|
45
|
+
* @returns {string} the rendered request target
|
|
46
|
+
*/
|
|
47
|
+
export function renderRequestTarget(template: string, values: Readonly<Record<string, string>>): string;
|
|
48
|
+
/**
|
|
49
|
+
* Resolve the `pagesDeploymentId` a row's call class statically selects.
|
|
50
|
+
*
|
|
51
|
+
* @param {RestContext} context the bound REST context
|
|
52
|
+
* @param {Readonly<Record<string, unknown>>} template the resolved template
|
|
53
|
+
* @returns {string | undefined} the selected ID, or `undefined` for a row
|
|
54
|
+
* whose request target has no `pagesDeploymentId` variable
|
|
55
|
+
*/
|
|
56
|
+
export function selectDeploymentId(context: RestContext, template: Readonly<Record<string, unknown>>): string | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Refuse a recovery-prior call outside `pages-reconciliation-recovery` mode.
|
|
59
|
+
*
|
|
60
|
+
* @param {RestContext} context the bound REST context
|
|
61
|
+
* @param {Readonly<Record<string, unknown>>} tmpl the resolved template
|
|
62
|
+
* @returns {void}
|
|
63
|
+
*/
|
|
64
|
+
export function assertModePermitsCall(context: RestContext, tmpl: Readonly<Record<string, unknown>>): void;
|
|
65
|
+
/**
|
|
66
|
+
* Build the complete raw header map one cataloged call sends.
|
|
67
|
+
*
|
|
68
|
+
* @param {RestContext} context the bound REST context
|
|
69
|
+
* @param {Readonly<Record<string, unknown>>} tmpl the resolved template
|
|
70
|
+
* @returns {Record<string, string>} the header map, lower-case names
|
|
71
|
+
*/
|
|
72
|
+
export function buildHeaders(context: RestContext, tmpl: Readonly<Record<string, unknown>>): Record<string, string>;
|
|
73
|
+
/**
|
|
74
|
+
* Refuse a request that disagrees with the template it claims to implement.
|
|
75
|
+
*
|
|
76
|
+
* @param {Readonly<Record<string, unknown>>} tmpl the resolved template
|
|
77
|
+
* @param {{
|
|
78
|
+
* method: string,
|
|
79
|
+
* url: string,
|
|
80
|
+
* headers: Readonly<Record<string, string>>,
|
|
81
|
+
* body: string | undefined
|
|
82
|
+
* }} request the request about to be dispatched
|
|
83
|
+
* @returns {void}
|
|
84
|
+
*/
|
|
85
|
+
export function assertRequestMatchesTemplate(tmpl: Readonly<Record<string, unknown>>, request: {
|
|
86
|
+
method: string;
|
|
87
|
+
url: string;
|
|
88
|
+
headers: Readonly<Record<string, string>>;
|
|
89
|
+
body: string | undefined;
|
|
90
|
+
}): void;
|
|
91
|
+
/**
|
|
92
|
+
* The provider's own JSON `message`, for the unexpected-status diagnostic: a
|
|
93
|
+
* bounded, single-line text with every 40+ character token-like run replaced,
|
|
94
|
+
* so a credential echoed by a provider can never reach a message.
|
|
95
|
+
*
|
|
96
|
+
* @param {Buffer} rawBody the raw response body
|
|
97
|
+
* @returns {string} `: provider message: <message>` or the empty string
|
|
98
|
+
*/
|
|
99
|
+
export function providerMessageSuffix(rawBody: Buffer): string;
|
|
100
|
+
/**
|
|
101
|
+
* Issue one cataloged provider call.
|
|
102
|
+
*
|
|
103
|
+
* @param {RestContext} context the bound REST context
|
|
104
|
+
* @param {string} stage the lifecycle stage issuing the call
|
|
105
|
+
* @param {string} callClass the catalog `callClass` to issue
|
|
106
|
+
* @param {{
|
|
107
|
+
* bodyText?: string,
|
|
108
|
+
* acceptStatuses: readonly number[]
|
|
109
|
+
* }} options the call options; `bodyText` is already-canonical JCS text,
|
|
110
|
+
* because the create body's byte length is contract-visible
|
|
111
|
+
* @returns {Promise<ProviderResponse>} the parsed, bounded response
|
|
112
|
+
*/
|
|
113
|
+
export function callProvider(context: RestContext, stage: string, callClass: string, options: {
|
|
114
|
+
bodyText?: string;
|
|
115
|
+
acceptStatuses: readonly number[];
|
|
116
|
+
}): Promise<ProviderResponse>;
|
|
117
|
+
/**
|
|
118
|
+
* Independently construct the suffix-free poll URL for a deployment, rather
|
|
119
|
+
* than reusing a provider-supplied `status_url` (DEC-097 section 6.2: "The
|
|
120
|
+
* actual polling GET is the distinct suffix-free ... target constructed
|
|
121
|
+
* independently from the pre-authorized ID. Equality between those two URLs
|
|
122
|
+
* is forbidden.").
|
|
123
|
+
*
|
|
124
|
+
* @param {RestContext} context the bound REST context
|
|
125
|
+
* @param {string} pagesDeploymentId the deployment identity
|
|
126
|
+
* @param {string} [stage] the stage whose status row is used
|
|
127
|
+
* @returns {string} the canonical poll URL
|
|
128
|
+
*/
|
|
129
|
+
export function buildPollUrl(context: RestContext, pagesDeploymentId: string, stage?: string): string;
|
|
130
|
+
/**
|
|
131
|
+
* The exact `status_url` shape a create response is permitted to carry. A
|
|
132
|
+
* response whose `status_url` does not match is retained as evidence with
|
|
133
|
+
* `createResponseStatusUrl` absent rather than trusted. It is never followed
|
|
134
|
+
* and, by construction, never equal to {@link buildPollUrl}'s result.
|
|
135
|
+
*
|
|
136
|
+
* @param {RestContext} context the bound REST context
|
|
137
|
+
* @param {string} pagesDeploymentId the deployment identity
|
|
138
|
+
* @returns {string} the expected `status_url`
|
|
139
|
+
*/
|
|
140
|
+
export function expectedStatusUrl(context: RestContext, pagesDeploymentId: string): string;
|
|
141
|
+
/** Maximum response body this client will read, in bytes. */
|
|
142
|
+
export const MAXIMUM_RESPONSE_BODY_BYTES: 1048576;
|
|
143
|
+
export type ProviderResponse = Readonly<{
|
|
144
|
+
status: number;
|
|
145
|
+
headers: Readonly<Record<string, string>>;
|
|
146
|
+
body: unknown;
|
|
147
|
+
rawByteCount: number;
|
|
148
|
+
}>;
|
|
149
|
+
export type RestContext = Readonly<{
|
|
150
|
+
apiOrigin: string;
|
|
151
|
+
owner: string;
|
|
152
|
+
repository: string;
|
|
153
|
+
token: string;
|
|
154
|
+
mode?: string;
|
|
155
|
+
pagesBuildVersion?: string;
|
|
156
|
+
priorPagesBuildVersion?: string;
|
|
157
|
+
fetch?: typeof globalThis.fetch;
|
|
158
|
+
requestTemplates: readonly Readonly<Record<string, unknown>>[];
|
|
159
|
+
}>;
|
package/types/store.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the physical destination mutation key. DEC-097 section 4.3 fixes
|
|
3
|
+
* it as the immutable Pages repository identity: a logical alias, name or
|
|
4
|
+
* URL never creates a second physical fence, so the numeric repository id
|
|
5
|
+
* is preferred and `owner/repository` is only the fallback when the caller
|
|
6
|
+
* has not supplied one.
|
|
7
|
+
*
|
|
8
|
+
* @param {{owner: string, repository: string, repositoryId?: string | number}} destination
|
|
9
|
+
* the destination identity
|
|
10
|
+
* @returns {string} the destination key digest
|
|
11
|
+
*/
|
|
12
|
+
export function destinationKey(destination: {
|
|
13
|
+
owner: string;
|
|
14
|
+
repository: string;
|
|
15
|
+
repositoryId?: string | number;
|
|
16
|
+
}): string;
|
|
17
|
+
/**
|
|
18
|
+
* Get (creating on first use) the run-scoped state for one destination.
|
|
19
|
+
*
|
|
20
|
+
* @param {{owner: string, repository: string, repositoryId?: string | number}} destination
|
|
21
|
+
* the destination identity
|
|
22
|
+
* @returns {DestinationState} the mutable run-scoped state
|
|
23
|
+
*/
|
|
24
|
+
export function stateFor(destination: {
|
|
25
|
+
owner: string;
|
|
26
|
+
repository: string;
|
|
27
|
+
repositoryId?: string | number;
|
|
28
|
+
}): DestinationState;
|
|
29
|
+
/**
|
|
30
|
+
* Discard all run-scoped state for one destination. Used by a test fixture's
|
|
31
|
+
* teardown so one conformance destination can never leak into the next.
|
|
32
|
+
*
|
|
33
|
+
* @param {{owner: string, repository: string, repositoryId?: string | number}} destination
|
|
34
|
+
* the destination identity
|
|
35
|
+
* @returns {void}
|
|
36
|
+
*/
|
|
37
|
+
export function forgetDestination(destination: {
|
|
38
|
+
owner: string;
|
|
39
|
+
repository: string;
|
|
40
|
+
repositoryId?: string | number;
|
|
41
|
+
}): void;
|
|
42
|
+
export type StageRecord = Readonly<{
|
|
43
|
+
stageToken: string;
|
|
44
|
+
operationId: string;
|
|
45
|
+
attemptId: string;
|
|
46
|
+
idempotencyKey: string;
|
|
47
|
+
generationId: string;
|
|
48
|
+
artifactId: string;
|
|
49
|
+
artifactDigest: string;
|
|
50
|
+
entryPaths: readonly string[];
|
|
51
|
+
carrierBytes: Buffer;
|
|
52
|
+
carrierDigest: string;
|
|
53
|
+
pagesArtifactId: string;
|
|
54
|
+
pagesArtifactDigest: string;
|
|
55
|
+
carrierByteCount: number;
|
|
56
|
+
}>;
|
|
57
|
+
export type DestinationState = {
|
|
58
|
+
stages: Map<string, StageRecord>;
|
|
59
|
+
activations: Map<string, {
|
|
60
|
+
generationId: string;
|
|
61
|
+
pagesDeploymentId: string;
|
|
62
|
+
certifiedAt: string;
|
|
63
|
+
entryPaths: readonly string[];
|
|
64
|
+
}>;
|
|
65
|
+
inFlight: Map<string, string>;
|
|
66
|
+
};
|
package/src/index.d.ts
DELETED
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import type { Buffer } from 'node:buffer';
|
|
2
|
-
|
|
3
|
-
export interface PagesCarrierFile {
|
|
4
|
-
readonly path: string;
|
|
5
|
-
readonly bytes: Buffer;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The caller-supplied expected bindings a Pages OIDC token must carry. The
|
|
10
|
-
* adapter never mints the token and cannot invent these values; the
|
|
11
|
-
* `deploy-github-pages` job supplies both.
|
|
12
|
-
*/
|
|
13
|
-
export interface PagesOidcClaims {
|
|
14
|
-
readonly ref: string;
|
|
15
|
-
readonly sha: string;
|
|
16
|
-
readonly runId: string | number;
|
|
17
|
-
readonly runAttempt: string | number;
|
|
18
|
-
readonly jobWorkflowRef: string;
|
|
19
|
-
readonly jobWorkflowSha: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface PagesDestination {
|
|
23
|
-
readonly owner: string;
|
|
24
|
-
readonly repository: string;
|
|
25
|
-
readonly repositoryId?: string | number;
|
|
26
|
-
readonly repositoryOwnerId?: string | number;
|
|
27
|
-
/** The Pages OIDC JWT, when supplied at destination level. */
|
|
28
|
-
readonly oidcToken?: string;
|
|
29
|
-
/** The expected OIDC bindings, when supplied at destination level. */
|
|
30
|
-
readonly oidcClaims?: PagesOidcClaims;
|
|
31
|
-
readonly apiOrigin?: string;
|
|
32
|
-
readonly publicBaseUrl: string;
|
|
33
|
-
readonly token: string;
|
|
34
|
-
readonly publishCarrier: (input: {
|
|
35
|
-
bytes: Buffer;
|
|
36
|
-
generationId: string;
|
|
37
|
-
carrierDigest: string;
|
|
38
|
-
}) => Promise<{
|
|
39
|
-
pagesArtifactId: string | number;
|
|
40
|
-
artifactDigest?: string;
|
|
41
|
-
byteCount?: number;
|
|
42
|
-
}>;
|
|
43
|
-
readonly fetch?: typeof globalThis.fetch;
|
|
44
|
-
readonly publicFetch?: typeof globalThis.fetch;
|
|
45
|
-
readonly sleep?: (seconds: number) => Promise<void>;
|
|
46
|
-
readonly runId?: string;
|
|
47
|
-
readonly runAttempt?: number;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export declare const ADAPTER_VERSION: string;
|
|
51
|
-
export declare const GENERATION_MARKER_PATH: string;
|
|
52
|
-
export declare const PACKAGE_STATUS: Readonly<{
|
|
53
|
-
name: string;
|
|
54
|
-
implemented: true;
|
|
55
|
-
implementingTask: string;
|
|
56
|
-
}>;
|
|
57
|
-
|
|
58
|
-
export declare function generateUuidV7(): string;
|
|
59
|
-
/** Re-exported adapter-protocol 2.1.0 fence sentinel (LOCAL-47). */
|
|
60
|
-
export declare const EXPECT_NOTHING_SERVED: string;
|
|
61
|
-
/** Re-exported adapter-protocol fence constructor for an observation. */
|
|
62
|
-
export declare function fenceFor(
|
|
63
|
-
observedGenerationId: string | null | undefined,
|
|
64
|
-
): string;
|
|
65
|
-
export declare function computeArtifactDigest(
|
|
66
|
-
files: readonly PagesCarrierFile[],
|
|
67
|
-
): string;
|
|
68
|
-
export declare function encodeCarrier(
|
|
69
|
-
files: readonly PagesCarrierFile[],
|
|
70
|
-
): Buffer;
|
|
71
|
-
export declare function decodeCarrier(carrier: Buffer): PagesCarrierFile[];
|
|
72
|
-
export declare function forgetDestination(destination: {
|
|
73
|
-
owner: string;
|
|
74
|
-
repository: string;
|
|
75
|
-
repositoryId?: string | number;
|
|
76
|
-
}): void;
|
|
77
|
-
|
|
78
|
-
export declare function describeCapabilities(
|
|
79
|
-
destination: PagesDestination,
|
|
80
|
-
): Promise<Readonly<Record<string, unknown>>>;
|
|
81
|
-
export declare function inspectDestination(
|
|
82
|
-
destination: PagesDestination,
|
|
83
|
-
): Promise<Readonly<Record<string, unknown>>>;
|
|
84
|
-
export declare function preflight(input: {
|
|
85
|
-
destination: PagesDestination;
|
|
86
|
-
entries: readonly { path: string }[];
|
|
87
|
-
expectedGenerationId?: string;
|
|
88
|
-
}): Promise<Readonly<Record<string, unknown>>>;
|
|
89
|
-
export declare function stage(input: {
|
|
90
|
-
destination: PagesDestination;
|
|
91
|
-
operationId: string;
|
|
92
|
-
attemptId: string;
|
|
93
|
-
idempotencyKey: string;
|
|
94
|
-
generationId: string;
|
|
95
|
-
artifactId: string;
|
|
96
|
-
artifactDigest: string;
|
|
97
|
-
files: readonly PagesCarrierFile[];
|
|
98
|
-
}): Promise<Readonly<Record<string, unknown>>>;
|
|
99
|
-
export declare function activate(input: {
|
|
100
|
-
destination: PagesDestination;
|
|
101
|
-
stageToken: string;
|
|
102
|
-
generationId: string;
|
|
103
|
-
/**
|
|
104
|
-
* Adapter protocol 2.1.0 fence: a generation identity, or the
|
|
105
|
-
* `EXPECT_NOTHING_SERVED` sentinel. `null`/`undefined` are refused
|
|
106
|
-
* (`EXPECTED_GENERATION_FENCE_INVALID`, LOCAL-47).
|
|
107
|
-
*/
|
|
108
|
-
expectedCurrentGenerationId: string;
|
|
109
|
-
expectedArtifactDigest?: string;
|
|
110
|
-
/** The mandatory Pages OIDC JWT, unless supplied on the destination. */
|
|
111
|
-
pagesOidcToken?: string;
|
|
112
|
-
/** The mandatory expected OIDC bindings, unless on the destination. */
|
|
113
|
-
pagesOidcClaims?: PagesOidcClaims;
|
|
114
|
-
/** `normal` (default) or `pages-reconciliation-recovery`. */
|
|
115
|
-
mode?: 'normal' | 'pages-reconciliation-recovery';
|
|
116
|
-
/** The server-minted recovery record; forbidden in `normal` mode. */
|
|
117
|
-
pagesRecovery?: Readonly<Record<string, unknown>>;
|
|
118
|
-
crashInjectionHook?: () => void | Promise<void>;
|
|
119
|
-
}): Promise<Readonly<Record<string, unknown>>>;
|
|
120
|
-
|
|
121
|
-
export declare function recoverPriorAttempt(input: {
|
|
122
|
-
destination: PagesDestination;
|
|
123
|
-
pagesRecovery: Readonly<Record<string, unknown>>;
|
|
124
|
-
}): Promise<Readonly<Record<string, unknown>>>;
|
|
125
|
-
export declare function observe(input: {
|
|
126
|
-
destination: PagesDestination;
|
|
127
|
-
generationId: string;
|
|
128
|
-
expectedArtifactDigest: string;
|
|
129
|
-
}): Promise<Readonly<Record<string, unknown>>>;
|
|
130
|
-
export declare function cleanupStaged(input: {
|
|
131
|
-
destination: PagesDestination;
|
|
132
|
-
stageToken: string;
|
|
133
|
-
generationId?: string;
|
|
134
|
-
}): Promise<Readonly<{ removed: boolean; cancelled: boolean }>>;
|
|
135
|
-
export declare function rollback(input: {
|
|
136
|
-
destination: PagesDestination;
|
|
137
|
-
targetGenerationId: string;
|
|
138
|
-
newGenerationId: string;
|
|
139
|
-
newArtifactId: string;
|
|
140
|
-
operationId: string;
|
|
141
|
-
attemptId: string;
|
|
142
|
-
idempotencyKey: string;
|
|
143
|
-
files?: readonly PagesCarrierFile[];
|
|
144
|
-
artifactDigest?: string;
|
|
145
|
-
pagesOidcToken?: string;
|
|
146
|
-
pagesOidcClaims?: PagesOidcClaims;
|
|
147
|
-
}): Promise<Readonly<Record<string, unknown>>>;
|
|
148
|
-
|
|
149
|
-
export declare const NORMAL_MODE: 'normal';
|
|
150
|
-
export declare const RECOVERY_MODE: 'pages-reconciliation-recovery';
|
|
151
|
-
export declare const GITHUB_API_ORIGIN: string;
|
|
152
|
-
export declare const REQUEST_TEMPLATE_PROFILE: string;
|
|
153
|
-
export declare const PAGES_OIDC_PROFILE: string;
|
|
154
|
-
export declare const PAGES_OIDC_ISSUER: string;
|
|
155
|
-
export declare const PAGES_OIDC_ENVIRONMENT: string;
|
|
156
|
-
export declare const GAP_PROOF_PROFILE: string;
|
|
157
|
-
export declare const RECOVERY_RECORD_PROFILE: string;
|
|
158
|
-
export declare const NO_AUTHORITY_STATE: 'closed-no-destination-authority';
|
|
159
|
-
export declare const PAGES_CALL_PLAN: readonly Readonly<{
|
|
160
|
-
stage: string;
|
|
161
|
-
callClass: string;
|
|
162
|
-
}>[];
|
|
163
|
-
export declare const CALL_CLASS_BINDING: readonly Readonly<{
|
|
164
|
-
stage: string;
|
|
165
|
-
callClass: string;
|
|
166
|
-
pagesDeploymentIdSource: string;
|
|
167
|
-
recoveryOnly: boolean;
|
|
168
|
-
}>[];
|
|
169
|
-
export declare function callClassIdBinding(
|
|
170
|
-
stage: string,
|
|
171
|
-
callClass: string,
|
|
172
|
-
): Readonly<{
|
|
173
|
-
stage: string;
|
|
174
|
-
callClass: string;
|
|
175
|
-
pagesDeploymentIdSource: string;
|
|
176
|
-
recoveryOnly: boolean;
|
|
177
|
-
}>;
|
|
178
|
-
|
|
179
|
-
export declare function buildRequestTemplates(
|
|
180
|
-
apiOrigin?: string,
|
|
181
|
-
): readonly Readonly<Record<string, unknown>>[];
|
|
182
|
-
export declare function requireTemplate(
|
|
183
|
-
templates: readonly Readonly<Record<string, unknown>>[],
|
|
184
|
-
stage: string,
|
|
185
|
-
callClass: string,
|
|
186
|
-
): Readonly<Record<string, unknown>>;
|
|
187
|
-
|
|
188
|
-
export declare function verifyPagesOidcToken(
|
|
189
|
-
token: unknown,
|
|
190
|
-
expected: PagesOidcClaims & {
|
|
191
|
-
owner: string;
|
|
192
|
-
repository: string;
|
|
193
|
-
repositoryId: string | number;
|
|
194
|
-
repositoryOwnerId: string | number;
|
|
195
|
-
},
|
|
196
|
-
): Readonly<{
|
|
197
|
-
profile: string;
|
|
198
|
-
subjectForm: 'name' | 'identifier';
|
|
199
|
-
issuerSignatureVerified: false;
|
|
200
|
-
tokenByteCount: number;
|
|
201
|
-
}>;
|
|
202
|
-
export declare function buildSubjectForms(identity: {
|
|
203
|
-
owner: string;
|
|
204
|
-
repository: string;
|
|
205
|
-
repositoryId: string;
|
|
206
|
-
repositoryOwnerId: string;
|
|
207
|
-
}): { name: string; id: string };
|
|
208
|
-
|
|
209
|
-
export declare function computeInterveningAttemptDigest(input: {
|
|
210
|
-
repositoryId: string | number;
|
|
211
|
-
runId: string | number;
|
|
212
|
-
runAttempt: number;
|
|
213
|
-
}): string;
|
|
214
|
-
export declare function buildInterveningAttempts(input: {
|
|
215
|
-
repositoryId: string | number;
|
|
216
|
-
runId: string | number;
|
|
217
|
-
priorRunAttempt: number;
|
|
218
|
-
claimingRunAttempt: number;
|
|
219
|
-
}): readonly Readonly<{
|
|
220
|
-
runAttempt: number;
|
|
221
|
-
authorityState: string;
|
|
222
|
-
decisionDigest: string;
|
|
223
|
-
}>[];
|
|
224
|
-
export declare function buildRunAttemptGapProof(input: {
|
|
225
|
-
repositoryId: string | number;
|
|
226
|
-
runId: string | number;
|
|
227
|
-
priorRunAttempt: number;
|
|
228
|
-
claimingRunAttempt: number;
|
|
229
|
-
}): Readonly<Record<string, unknown>>;
|
|
230
|
-
export declare function computeGapProofDigest(
|
|
231
|
-
proof: Readonly<Record<string, unknown>>,
|
|
232
|
-
): string;
|
|
233
|
-
export declare function validateRunAttemptGapProof(
|
|
234
|
-
proof: unknown,
|
|
235
|
-
binding: { repositoryId: string | number },
|
|
236
|
-
): Readonly<Record<string, unknown>>;
|
|
237
|
-
export declare function computeRecoveryDigest(
|
|
238
|
-
recovery: Readonly<Record<string, unknown>>,
|
|
239
|
-
): string;
|
|
240
|
-
export declare function sealRecoveryRecord(
|
|
241
|
-
withoutDigest: Readonly<Record<string, unknown>>,
|
|
242
|
-
): Readonly<Record<string, unknown>>;
|
|
243
|
-
export declare function validateReconciliationRecovery(
|
|
244
|
-
recovery: unknown,
|
|
245
|
-
binding: { repositoryId: string | number },
|
|
246
|
-
): Readonly<Record<string, unknown>>;
|