@certcrypt/sdk 0.0.0-stage → 1.0.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.
Potentially problematic release.
This version of @certcrypt/sdk might be problematic. Click here for more details.
- package/CHANGELOG.md +74 -0
- package/LICENSE +178 -0
- package/README.md +557 -2
- package/SECURITY.md +55 -0
- package/dist/src/artifacts/base-certificate.d.ts +336 -0
- package/dist/src/artifacts/base-certificate.js +373 -0
- package/dist/src/artifacts/base-certificate.js.map +1 -0
- package/dist/src/artifacts/capacity-evidence.d.ts +195 -0
- package/dist/src/artifacts/capacity-evidence.js +202 -0
- package/dist/src/artifacts/capacity-evidence.js.map +1 -0
- package/dist/src/artifacts/commitment-inclusion.d.ts +23 -0
- package/dist/src/artifacts/commitment-inclusion.js +91 -0
- package/dist/src/artifacts/commitment-inclusion.js.map +1 -0
- package/dist/src/artifacts/holder-keyset.d.ts +67 -0
- package/dist/src/artifacts/holder-keyset.js +149 -0
- package/dist/src/artifacts/holder-keyset.js.map +1 -0
- package/dist/src/artifacts/rfc3339.d.ts +9 -0
- package/dist/src/artifacts/rfc3339.js +39 -0
- package/dist/src/artifacts/rfc3339.js.map +1 -0
- package/dist/src/client.d.ts +552 -0
- package/dist/src/client.js +1347 -0
- package/dist/src/client.js.map +1 -0
- package/dist/src/crypto/ai-decision.d.ts +73 -0
- package/dist/src/crypto/ai-decision.js +94 -0
- package/dist/src/crypto/ai-decision.js.map +1 -0
- package/dist/src/crypto/canonical-subject.d.ts +33 -0
- package/dist/src/crypto/canonical-subject.js +240 -0
- package/dist/src/crypto/canonical-subject.js.map +1 -0
- package/dist/src/crypto/collection-merkle.d.ts +58 -0
- package/dist/src/crypto/collection-merkle.js +164 -0
- package/dist/src/crypto/collection-merkle.js.map +1 -0
- package/dist/src/crypto/composite.d.ts +53 -0
- package/dist/src/crypto/composite.js +69 -0
- package/dist/src/crypto/composite.js.map +1 -0
- package/dist/src/crypto/digest.d.ts +3 -0
- package/dist/src/crypto/digest.js +31 -0
- package/dist/src/crypto/digest.js.map +1 -0
- package/dist/src/crypto/ecdsa-p256.d.ts +79 -0
- package/dist/src/crypto/ecdsa-p256.js +277 -0
- package/dist/src/crypto/ecdsa-p256.js.map +1 -0
- package/dist/src/crypto/jcs.d.ts +13 -0
- package/dist/src/crypto/jcs.js +65 -0
- package/dist/src/crypto/jcs.js.map +1 -0
- package/dist/src/crypto/merkle.d.ts +18 -0
- package/dist/src/crypto/merkle.js +150 -0
- package/dist/src/crypto/merkle.js.map +1 -0
- package/dist/src/crypto/ml-dsa.d.ts +28 -0
- package/dist/src/crypto/ml-dsa.js +60 -0
- package/dist/src/crypto/ml-dsa.js.map +1 -0
- package/dist/src/crypto/pseudonym.d.ts +8 -0
- package/dist/src/crypto/pseudonym.js +50 -0
- package/dist/src/crypto/pseudonym.js.map +1 -0
- package/dist/src/crypto/strict-json.d.ts +25 -0
- package/dist/src/crypto/strict-json.js +180 -0
- package/dist/src/crypto/strict-json.js.map +1 -0
- package/dist/src/crypto/subject-json-preconditions.d.ts +46 -0
- package/dist/src/crypto/subject-json-preconditions.js +381 -0
- package/dist/src/crypto/subject-json-preconditions.js.map +1 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/src/index.js +80 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/issuer.d.ts +668 -0
- package/dist/src/issuer.js +1066 -0
- package/dist/src/issuer.js.map +1 -0
- package/dist/src/retry.d.ts +67 -0
- package/dist/src/retry.js +78 -0
- package/dist/src/retry.js.map +1 -0
- package/dist/src/types.d.ts +297 -0
- package/dist/src/types.js +15 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +62 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issuer.js","sourceRoot":"","sources":["../../src/issuer.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AAC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AAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACtC,CAAC;QACJ,CAAC;QAED,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,WAAW,EAAE;YACzF,2EAA2E;YAC3E,mEAAmE;YACnE,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,mBAAmB;YACnB,eAAe,EAAE,MAAM,CAAC,eAAe;SACxC,CAAC,CAAC;QAEH,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,CAAC,eAAe,EAAE,CAAC;IAChG,CAAC;IAED;mCAC+B;IAC/B,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The transport-retry policy: after a failed request to the node, wait as
|
|
3
|
+
* long as the node asked, back off, or give up.
|
|
4
|
+
*
|
|
5
|
+
* Every client of a node or of the issuance service applies the following rules
|
|
6
|
+
* identically. Two clients that decided differently would turn a node's planned
|
|
7
|
+
* pause — a restart, an outbox it cannot write — into one client's lost
|
|
8
|
+
* submission.
|
|
9
|
+
*
|
|
10
|
+
* - `Retry-After` is read as a whole number of seconds only.
|
|
11
|
+
* - A `Retry-After` the node sends with 503 or 429 is honored exactly
|
|
12
|
+
* (clamped to 1 s – 15 min) and is NOT a failed attempt.
|
|
13
|
+
* - Everything else retryable is a counted attempt with full-jitter backoff.
|
|
14
|
+
* - An attempt limit applies only when the caller sets one.
|
|
15
|
+
* - Retrying ends on a TIME budget (default 120 s), not a count of quick
|
|
16
|
+
* failures: a node that restarts in 20 s is waited out, however many times
|
|
17
|
+
* the connection was refused meanwhile.
|
|
18
|
+
* - A 4xx other than 408/425/429 is about the request, not the transport,
|
|
19
|
+
* and is handed back rather than retried.
|
|
20
|
+
*/
|
|
21
|
+
/** The policy a client runs under. `null` = no limit. */
|
|
22
|
+
export interface RetryPolicy {
|
|
23
|
+
maxElapsedMs: number | null;
|
|
24
|
+
maxAttempts: number | null;
|
|
25
|
+
backoffBaseMs: number;
|
|
26
|
+
backoffCapMs: number;
|
|
27
|
+
}
|
|
28
|
+
/** What a client does when the caller configures nothing. */
|
|
29
|
+
export declare const RETRY_DEFAULTS: Readonly<RetryPolicy>;
|
|
30
|
+
/** Bounds on an honored `Retry-After`. */
|
|
31
|
+
export declare const RETRY_AFTER_MIN_MS = 1000;
|
|
32
|
+
export declare const RETRY_AFTER_MAX_MS = 900000;
|
|
33
|
+
/** One failed request, as the policy sees it. */
|
|
34
|
+
export type TransportOutcome = {
|
|
35
|
+
kind: "transport";
|
|
36
|
+
} | {
|
|
37
|
+
kind: "http";
|
|
38
|
+
status: number;
|
|
39
|
+
retryAfter?: string | null;
|
|
40
|
+
};
|
|
41
|
+
/** What to do next. A backoff reports its ceiling; the wait is a draw under it. */
|
|
42
|
+
export type RetryDecision = {
|
|
43
|
+
action: "return";
|
|
44
|
+
} | {
|
|
45
|
+
action: "give_up";
|
|
46
|
+
} | {
|
|
47
|
+
action: "retry";
|
|
48
|
+
waitMs: number;
|
|
49
|
+
countsAttempt: false;
|
|
50
|
+
} | {
|
|
51
|
+
action: "retry";
|
|
52
|
+
waitMsMax: number;
|
|
53
|
+
countsAttempt: true;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Reads a whole number of seconds, trimmed, and returns milliseconds. Anything else — an
|
|
57
|
+
* HTTP date, a sign, a fraction, text — is treated as absent.
|
|
58
|
+
*/
|
|
59
|
+
export declare function parseRetryAfter(raw: string | null | undefined): number | null;
|
|
60
|
+
/**
|
|
61
|
+
* The decision after one failure. `countedBefore` is the number
|
|
62
|
+
* of counted attempts before this failure; `elapsedMs` the time since the
|
|
63
|
+
* first attempt.
|
|
64
|
+
*/
|
|
65
|
+
export declare function decideRetry(policy: RetryPolicy, outcome: TransportOutcome, countedBefore: number, elapsedMs: number): RetryDecision;
|
|
66
|
+
/** A full-jitter draw under a backoff ceiling. */
|
|
67
|
+
export declare function drawBackoffMs(waitMsMax: number): number;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Copyright © 2025-2026 CERTCRYPT, Inc., its affiliates or licensors. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
/** What a client does when the caller configures nothing. */
|
|
15
|
+
export const RETRY_DEFAULTS = Object.freeze({
|
|
16
|
+
maxElapsedMs: 120_000,
|
|
17
|
+
maxAttempts: null,
|
|
18
|
+
backoffBaseMs: 200,
|
|
19
|
+
backoffCapMs: 30_000,
|
|
20
|
+
});
|
|
21
|
+
/** Bounds on an honored `Retry-After`. */
|
|
22
|
+
export const RETRY_AFTER_MIN_MS = 1_000;
|
|
23
|
+
export const RETRY_AFTER_MAX_MS = 900_000;
|
|
24
|
+
/**
|
|
25
|
+
* Reads a whole number of seconds, trimmed, and returns milliseconds. Anything else — an
|
|
26
|
+
* HTTP date, a sign, a fraction, text — is treated as absent.
|
|
27
|
+
*/
|
|
28
|
+
export function parseRetryAfter(raw) {
|
|
29
|
+
if (raw == null)
|
|
30
|
+
return null;
|
|
31
|
+
const t = raw.trim();
|
|
32
|
+
if (!/^[0-9]+$/.test(t))
|
|
33
|
+
return null;
|
|
34
|
+
// Past MAX_SAFE_INTEGER it is still "as long as anyone could mean": the clamp
|
|
35
|
+
// brings it down to the ceiling.
|
|
36
|
+
const secs = Number(t);
|
|
37
|
+
return Number.isFinite(secs) ? secs * 1000 : Number.MAX_SAFE_INTEGER;
|
|
38
|
+
}
|
|
39
|
+
function isTransient(status) {
|
|
40
|
+
return status === 408 || status === 425 || status === 429 || (status >= 500 && status <= 599);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The decision after one failure. `countedBefore` is the number
|
|
44
|
+
* of counted attempts before this failure; `elapsedMs` the time since the
|
|
45
|
+
* first attempt.
|
|
46
|
+
*/
|
|
47
|
+
export function decideRetry(policy, outcome, countedBefore, elapsedMs) {
|
|
48
|
+
if (outcome.kind === "http" && !isTransient(outcome.status))
|
|
49
|
+
return { action: "return" };
|
|
50
|
+
if (policy.maxElapsedMs !== null && elapsedMs >= policy.maxElapsedMs) {
|
|
51
|
+
return { action: "give_up" };
|
|
52
|
+
}
|
|
53
|
+
if (outcome.kind === "http" && (outcome.status === 503 || outcome.status === 429)) {
|
|
54
|
+
const asked = parseRetryAfter(outcome.retryAfter);
|
|
55
|
+
if (asked !== null) {
|
|
56
|
+
const waitMs = Math.min(Math.max(asked, RETRY_AFTER_MIN_MS), RETRY_AFTER_MAX_MS);
|
|
57
|
+
if (policy.maxElapsedMs !== null && elapsedMs + waitMs > policy.maxElapsedMs) {
|
|
58
|
+
return { action: "give_up" }; // A shorter wait cannot succeed.
|
|
59
|
+
}
|
|
60
|
+
return { action: "retry", waitMs, countsAttempt: false };
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const n = countedBefore + 1;
|
|
64
|
+
if (policy.maxAttempts !== null && n >= policy.maxAttempts)
|
|
65
|
+
return { action: "give_up" };
|
|
66
|
+
let waitMsMax = Math.min(policy.backoffCapMs, policy.backoffBaseMs * 2 ** (n - 1));
|
|
67
|
+
if (policy.maxElapsedMs !== null) {
|
|
68
|
+
waitMsMax = Math.min(waitMsMax, policy.maxElapsedMs - elapsedMs); // Never exceed the time budget.
|
|
69
|
+
}
|
|
70
|
+
return { action: "retry", waitMsMax, countsAttempt: true };
|
|
71
|
+
}
|
|
72
|
+
/** A full-jitter draw under a backoff ceiling. */
|
|
73
|
+
export function drawBackoffMs(waitMsMax) {
|
|
74
|
+
// Uniform over the WHOLE window: under a thundering herd the halved variant
|
|
75
|
+
// leaves every client's retries clustered in the back half, colliding again.
|
|
76
|
+
return Math.floor(Math.random() * (waitMsMax + 1));
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/retry.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA+BjC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,cAAc,GAA0B,MAAM,CAAC,MAAM,CAAC;IACjE,YAAY,EAAE,OAAO;IACrB,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,GAAG;IAClB,YAAY,EAAE,MAAM;CACrB,CAAC,CAAC;AAEH,0CAA0C;AAC1C,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACxC,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAc1C;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,GAA8B;IAC5D,IAAI,GAAG,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAC7B,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACrB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,8EAA8E;IAC9E,iCAAiC;IACjC,MAAM,IAAI,GAA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AE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,iCAAiC;YACjE,CAAC;YACD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAC3D,CAAC;IACH,CAAC;IACD,MAAM,CAAC,GAAG,aAAa,GAAG,CAAC,CAAC;IAC5B,IAAI,MAAM,CAAC,WAAW,KAAK,IAAI,IAAI,CAAC,IAAI,MAAM,CAAC,WAAW;QAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IACzF,IAAI,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,aAAa,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACnF,IAAI,MAAM,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;QACjC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,gCAAgC;IACpG,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC7C,4EAA4E;IAC5E,6EAA6E;IAC7E,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire types for the node's HTTP surface — this SDK's only network peer.
|
|
3
|
+
*
|
|
4
|
+
* The issuer (this SDK) projects and Level-3 signs a `capacity.evidence/1` with a
|
|
5
|
+
* per-operation leaf of its operation-key tree and submits it. See
|
|
6
|
+
* `artifacts/capacity-evidence.ts` for the byte contract.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A closed `submission-set/1` artifact on the wire, as an opaque JSON object.
|
|
10
|
+
* The node assembles it from the commitments you submit.
|
|
11
|
+
*/
|
|
12
|
+
export type SubmissionSetWire = Record<string, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* One commitment as submitted. The SDK signs only the holder's
|
|
15
|
+
* `capacity_evidence` — the one step no one else can perform — and 1..N of these
|
|
16
|
+
* are assembled into a `submission-set/1`.
|
|
17
|
+
*
|
|
18
|
+
* `operative` carries the integration's fixed `(holder_id, pool_id)`, issued at
|
|
19
|
+
* onboarding and configured once in `NodeClientOptions.pool_id`: carried through,
|
|
20
|
+
* never freely declared per call. Safe in clear because it is not accepted on
|
|
21
|
+
* assertion — the server re-derives the holder/pool pseudonyms from it under the
|
|
22
|
+
* evidence's own `operation_salt` and rejects the member unless they equal the
|
|
23
|
+
* signed ones (submission-set/1 §7.2).
|
|
24
|
+
*
|
|
25
|
+
* These two fields are the whole member (submission-set/1 §7.1): the member
|
|
26
|
+
* carries what the protocol needs and can verify, and nothing chosen freely by
|
|
27
|
+
* the issuer. Results correlate by `commitment_index`.
|
|
28
|
+
*/
|
|
29
|
+
export interface LooseCommitment {
|
|
30
|
+
/** The holder-signed zero-data commitment (capacity.evidence/1, projected). */
|
|
31
|
+
capacity_evidence: unknown;
|
|
32
|
+
/** Routing context for this certificate. Never reaches the verifier. */
|
|
33
|
+
operative: {
|
|
34
|
+
holder_id: string;
|
|
35
|
+
pool_id: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** Request body for `POST /v1/issue`. */
|
|
39
|
+
export interface IssueRequest {
|
|
40
|
+
/**
|
|
41
|
+
* Optional idempotency key (26-char ULID). If omitted, the node generates
|
|
42
|
+
* one. Reusing it makes the upstream submission idempotent.
|
|
43
|
+
*/
|
|
44
|
+
request_id?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The loose commitments to wrap into one submission-set (1..N, same issuer +
|
|
47
|
+
* authorization). The node assembles the set; the SDK never builds it.
|
|
48
|
+
*/
|
|
49
|
+
commitments: LooseCommitment[];
|
|
50
|
+
/**
|
|
51
|
+
* Issuer-elected settlement-window preference: how soon the emission's window
|
|
52
|
+
* closes, and therefore how soon it can reach `Independent`. Omit to accept the
|
|
53
|
+
* default. Operational only — it is never part of the submission_set, the proof,
|
|
54
|
+
* or anything a verifier evaluates.
|
|
55
|
+
*/
|
|
56
|
+
settlement_preferences?: {
|
|
57
|
+
/**
|
|
58
|
+
* Which settlement window to close this emission's aggregate under — e.g.
|
|
59
|
+
* `"close_3min"` (the default profile) or `"close_6h"`.
|
|
60
|
+
*
|
|
61
|
+
* It is NEVER a trust tier or a proof level. A certificate settled under a
|
|
62
|
+
* slow window is evaluated by the same public rules and reaches
|
|
63
|
+
* `Independent` on the same conditions as one settled under a fast window.
|
|
64
|
+
*/
|
|
65
|
+
window_profile: string;
|
|
66
|
+
/**
|
|
67
|
+
* What to do when the elected `window_profile` cannot be honored.
|
|
68
|
+
* `"slower_allowed"` permits degrading to a slower profile; `"reject"`
|
|
69
|
+
* prefers to fail. A window is never degraded to a FASTER one: a fallback
|
|
70
|
+
* may only move toward a slower profile.
|
|
71
|
+
*/
|
|
72
|
+
fallback_policy: "reject" | "slower_allowed";
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Node-local operation state, discriminated by `state`. Mirrors the node's
|
|
77
|
+
* `OperationState`.
|
|
78
|
+
*/
|
|
79
|
+
export type OperationState = {
|
|
80
|
+
state: "accepted";
|
|
81
|
+
upstream_operation_id: string;
|
|
82
|
+
} | {
|
|
83
|
+
state: "rejected";
|
|
84
|
+
reason_code: string;
|
|
85
|
+
message: string;
|
|
86
|
+
} | {
|
|
87
|
+
state: "replay_detected";
|
|
88
|
+
message: string;
|
|
89
|
+
} | {
|
|
90
|
+
state: "insufficient_capacity";
|
|
91
|
+
} | {
|
|
92
|
+
state: "pre_evaluation_rejected";
|
|
93
|
+
reason_code: string;
|
|
94
|
+
message: string;
|
|
95
|
+
} | {
|
|
96
|
+
state: "accepted_for_retry";
|
|
97
|
+
error: string;
|
|
98
|
+
} | {
|
|
99
|
+
state: "submission_failed";
|
|
100
|
+
error: string;
|
|
101
|
+
upstream_status?: number;
|
|
102
|
+
} | {
|
|
103
|
+
state: "processing";
|
|
104
|
+
upstream_operation_id: string;
|
|
105
|
+
} | {
|
|
106
|
+
state: "independent_ready";
|
|
107
|
+
upstream_operation_id: string;
|
|
108
|
+
} | {
|
|
109
|
+
state: "expired";
|
|
110
|
+
reason_code: string;
|
|
111
|
+
message: string;
|
|
112
|
+
};
|
|
113
|
+
/** One per-member result in an IssueResponse (per `submission-set/1`). */
|
|
114
|
+
export interface MemberResult {
|
|
115
|
+
/** Node-local operation id for this member (key for GET /v1/operations/{id}). */
|
|
116
|
+
operation_id: string;
|
|
117
|
+
/** Position of this member in the submitted set — what maps this result back
|
|
118
|
+
* to its input. An issuer keeping its own label for a certificate associates
|
|
119
|
+
* it with this position locally. */
|
|
120
|
+
commitment_index: number;
|
|
121
|
+
state: OperationState;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Response of `POST /v1/issue`. The node returns EITHER a per-member shape
|
|
125
|
+
* (`results[]` populated, `state` absent — the normal path) OR a whole-request
|
|
126
|
+
* shape (`results` empty, `state` set — a pre-evaluation rejection or transport
|
|
127
|
+
* failure). Mutually exclusive.
|
|
128
|
+
*/
|
|
129
|
+
export interface IssueResponse {
|
|
130
|
+
request_id: string;
|
|
131
|
+
/** The server's submission-set identity, when member evaluation was reached. */
|
|
132
|
+
submission_set_id?: string;
|
|
133
|
+
/** One result per submitted member. Empty on a whole-request outcome. */
|
|
134
|
+
results: MemberResult[];
|
|
135
|
+
/** Whole-request outcome, set ONLY when no per-member evaluation happened. */
|
|
136
|
+
state?: OperationState;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Response of the issuance service's `by-commitment` lookup, relayed verbatim by the node.
|
|
140
|
+
*
|
|
141
|
+
* Deliberately smaller than `OperationRecord`: this lookup recovers a handle, not
|
|
142
|
+
* the scheduling view. What it must carry is what the issuer does NOT already
|
|
143
|
+
* hold — the proof and the settlement material. Everything else the verification
|
|
144
|
+
* package needs is in the handle the issuer kept.
|
|
145
|
+
*/
|
|
146
|
+
export interface EmissionHandleRecord {
|
|
147
|
+
operation_id: string;
|
|
148
|
+
status: string;
|
|
149
|
+
reason_code?: string;
|
|
150
|
+
/** base64 of the canonical `independence.proof/1`; only on `independent_ready`. */
|
|
151
|
+
independence_proof?: string;
|
|
152
|
+
/** base64 of the leaf's `settlement-material/1`; only on `independent_ready`. */
|
|
153
|
+
settlement_material?: string;
|
|
154
|
+
window_status?: string;
|
|
155
|
+
window_settled_at?: string;
|
|
156
|
+
}
|
|
157
|
+
/** Response of `GET /v1/operations/{id}`.
|
|
158
|
+
*
|
|
159
|
+
* The node returns one of TWO shapes on this route:
|
|
160
|
+
* - a local record `{operation_id, request_id, state}` (not yet reconciled), or
|
|
161
|
+
* - the server's authoritative body forwarded verbatim when a member reconciles to
|
|
162
|
+
* a terminal outcome: `{operation_id, status, independence_proof?,
|
|
163
|
+
* settlement_material?}` — `status` (string) instead of `state`, no
|
|
164
|
+
* `request_id`, and (only when `independent_ready`) the two server-produced proof
|
|
165
|
+
* artifacts, base64-encoded.
|
|
166
|
+
*
|
|
167
|
+
* `getOperation` normalizes both into this single shape: `state` is always
|
|
168
|
+
* populated (derived from `status` when the server body is forwarded), and the two
|
|
169
|
+
* proof fields are surfaced when present so a client can assemble the
|
|
170
|
+
* `verification_package`. `request_id` is optional (absent on the server body). */
|
|
171
|
+
export interface OperationRecord {
|
|
172
|
+
operation_id: string;
|
|
173
|
+
request_id?: string;
|
|
174
|
+
state: OperationState;
|
|
175
|
+
/** base64 of the canonical `independence.proof/1` bytes — present only when
|
|
176
|
+
* the operation is `independent_ready` (server-produced artifact). */
|
|
177
|
+
independence_proof?: string;
|
|
178
|
+
/** base64 of the canonical SettlementMaterial JSON — present only when
|
|
179
|
+
* `independent_ready` (server-produced artifact). */
|
|
180
|
+
settlement_material?: string;
|
|
181
|
+
/** The settlement window this operation is assigned to, while it is being settled.
|
|
182
|
+
* Lets a poller wait UNTIL the window instead of spinning. See
|
|
183
|
+
* {@link SettlementWindowEstimate}. */
|
|
184
|
+
settlement_window?: SettlementWindowEstimate;
|
|
185
|
+
/** How far the settlement backing this operation has come, while it is in flight.
|
|
186
|
+
* Distinguishes "queued behind a window" from "on chain, waiting for the
|
|
187
|
+
* substrate's irreversibility". See {@link SettlementProgress}. */
|
|
188
|
+
settlement_progress?: SettlementProgress;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Advisory progress indicator for an in-flight settlement.
|
|
192
|
+
*
|
|
193
|
+
* NOT A VERDICT, and never a substitute for the artifacts. `state` remains the
|
|
194
|
+
* authority; this only says how far along the wait is. In particular
|
|
195
|
+
* `finality_pending` is NOT verifiable evidence: the settlement profile refuses every
|
|
196
|
+
* provisional, head-only or soft-confirmed action, so an operation only carries a
|
|
197
|
+
* temporal claim once its artifacts are served with `independent_ready`.
|
|
198
|
+
*
|
|
199
|
+
* Deliberately opaque about the substrate: a coarse phase and a normalized fraction,
|
|
200
|
+
* never blocks, ledgers, finality heights or the chain's finality model. Render a bar from
|
|
201
|
+
* it; do not infer how the chain works, and do not gate anything on it.
|
|
202
|
+
*/
|
|
203
|
+
export interface SettlementProgress {
|
|
204
|
+
/**
|
|
205
|
+
* `queued` — assigned to a window, nothing on chain yet.
|
|
206
|
+
* `finality_pending` — settled on chain, waiting for irreversibility.
|
|
207
|
+
* `final` — irreversible.
|
|
208
|
+
*
|
|
209
|
+
* Treated as an open string on purpose: a future substrate may add a phase, and an
|
|
210
|
+
* SDK that switches exhaustively on it would break. Branch on the ones you know and
|
|
211
|
+
* fall through on the rest.
|
|
212
|
+
*/
|
|
213
|
+
phase: string;
|
|
214
|
+
/** Progress toward irreversibility as a fraction × 1e6 (743000 = 74.3%). Absent
|
|
215
|
+
* before broadcast, and where the substrate has immediate finality. */
|
|
216
|
+
progress_ppm?: number;
|
|
217
|
+
/** When the operator last sampled the chain for that fraction (RFC3339). An
|
|
218
|
+
* observation timestamp — NOT the settlement's temporal claim, which comes only
|
|
219
|
+
* from the irreversible block time inside the settlement material. */
|
|
220
|
+
observed_at?: string;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* The node's estimate of WHEN this operation's settlement window closes, so a
|
|
224
|
+
* poller can schedule its next check instead of guessing.
|
|
225
|
+
*
|
|
226
|
+
* OPERATIONAL ONLY. It is never part of the submission_set, the proof, or
|
|
227
|
+
* anything a verifier evaluates — the same character as the request's
|
|
228
|
+
* `settlement_preferences`. It describes the NODE's schedule, not the issuer:
|
|
229
|
+
* knowing that a window runs late says nothing about who issued into it.
|
|
230
|
+
*
|
|
231
|
+
* ZERO-DATA BOUNDARY — deliberately absent, and must stay absent: this carries
|
|
232
|
+
* NO amount and NO capacity figure. In the clear on every response, an
|
|
233
|
+
* operation's cost would make an issuer's operations correlatable over time —
|
|
234
|
+
* and once a value travels in a response it is copied into logs, whoever it was
|
|
235
|
+
* meant for. The consumed quantity is carried only in the `settlement_material`
|
|
236
|
+
* that the `independence_proof` binds.
|
|
237
|
+
*/
|
|
238
|
+
export interface SettlementWindowEstimate {
|
|
239
|
+
/** The frozen issuer-elected window profile, as an opaque versioned label.
|
|
240
|
+
* Log it, show it in support, but never branch on it: schedule on
|
|
241
|
+
* `target_close_by`. */
|
|
242
|
+
window_profile: string;
|
|
243
|
+
/** The profile version the election was frozen against. */
|
|
244
|
+
window_profile_version: string;
|
|
245
|
+
/** RFC 3339 instant the window is expected to CLOSE. Absent when the node has
|
|
246
|
+
* frozen a profile but cannot yet name a target. Note this is the window's
|
|
247
|
+
* close target, NOT the moment the package is ready: chain finality adds more
|
|
248
|
+
* after it. Treat it as "not before", never as a deadline. */
|
|
249
|
+
target_close_by?: string;
|
|
250
|
+
/** RFC 3339 instant by which the operator expects this window's settlement to be
|
|
251
|
+
* anchored and final, so that a read can return a terminal state. Never earlier
|
|
252
|
+
* than `target_close_by`; present exactly when it is. The SDK schedules its next
|
|
253
|
+
* check on it and reports the operation `overdue` only once it has passed.
|
|
254
|
+
* An operational ESTIMATE from the operator: not a promise of when the
|
|
255
|
+
* operation becomes Independent, and not proof material. */
|
|
256
|
+
expected_settled_by?: string;
|
|
257
|
+
}
|
|
258
|
+
/** One in-flight emission for this integration, as `listUnresolvedEmissions`
|
|
259
|
+
* returns it.
|
|
260
|
+
*
|
|
261
|
+
* Not handle material: enough to decide what to fetch and when to poll again,
|
|
262
|
+
* and cheap enough for a routine pending-work check. The recoverable half of a
|
|
263
|
+
* handle is fetched one emission at a time.
|
|
264
|
+
*
|
|
265
|
+
* `commitmentIndex` is absent here on purpose — it is not knowable while an
|
|
266
|
+
* emission is unresolved (it lives in the Proof of Independence, which does not
|
|
267
|
+
* exist until the settlement window closes). */
|
|
268
|
+
export interface UnresolvedEmission {
|
|
269
|
+
/** The id the issuer knows this emission by — the same value its lost handle
|
|
270
|
+
* carried as `operation_id`. */
|
|
271
|
+
operationId: string;
|
|
272
|
+
/** Public ontology only: the node reports public states, never internal ones. */
|
|
273
|
+
status: string;
|
|
274
|
+
reasonCode: string | null;
|
|
275
|
+
/** RFC 3339. */
|
|
276
|
+
updatedAt: string;
|
|
277
|
+
/** RFC 3339 close TARGET of the settlement window, when one was assigned.
|
|
278
|
+
* Schedule the next poll on it; treat it as "not before", never a deadline. */
|
|
279
|
+
targetCloseBy: string | null;
|
|
280
|
+
/** RFC 3339 instant by which the operator expects the settlement to be anchored
|
|
281
|
+
* and final, when a window was assigned (never earlier than `targetCloseBy`).
|
|
282
|
+
* An operational estimate: the best moment for the next poll. */
|
|
283
|
+
expectedSettledBy: string | null;
|
|
284
|
+
/** RFC 3339 effective settle time, when already settled. */
|
|
285
|
+
settledAt: string | null;
|
|
286
|
+
/** How many handles this emission yields for this integration. */
|
|
287
|
+
commitmentCount: number;
|
|
288
|
+
}
|
|
289
|
+
/** The answer to "what do I still have open?".
|
|
290
|
+
*
|
|
291
|
+
* `truncated` is true when the page hit the server-side cap. It MUST NOT be
|
|
292
|
+
* ignored: a reconciler that reads a truncated page as complete concludes there
|
|
293
|
+
* is nothing left to finish, and the recovery it skips becomes a re-emission. */
|
|
294
|
+
export interface UnresolvedEmissions {
|
|
295
|
+
emissions: UnresolvedEmission[];
|
|
296
|
+
truncated: boolean;
|
|
297
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright © 2025-2026 CERTCRYPT, Inc., its affiliates or licensors. All rights reserved.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@certcrypt/sdk",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Official issuer-side SDK for CERTCRYPT: certify material with a client-side composite post-quantum signature (ECDSA P-256 + ML-DSA-65), and produce the artifacts that let a third party independently evaluate the result offline under public rules, without either your systems or CERTCRYPT remaining online.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"auditability",
|
|
7
|
+
"certcrypt",
|
|
8
|
+
"composite-signature",
|
|
9
|
+
"digital-certification",
|
|
10
|
+
"fail-closed",
|
|
11
|
+
"fips-204",
|
|
12
|
+
"interoperability",
|
|
13
|
+
"issuer-side",
|
|
14
|
+
"jcs",
|
|
15
|
+
"ml-dsa",
|
|
16
|
+
"offline-verification",
|
|
17
|
+
"post-quantum",
|
|
18
|
+
"proof-of-independence",
|
|
19
|
+
"public-rules",
|
|
20
|
+
"rfc8785",
|
|
21
|
+
"sdk"
|
|
22
|
+
],
|
|
23
|
+
"homepage": "https://certcrypt.com",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/CERTCRYPT/certcrypt-sdk-js.git"
|
|
27
|
+
},
|
|
28
|
+
"type": "module",
|
|
29
|
+
"main": "dist/src/index.js",
|
|
30
|
+
"types": "dist/src/index.d.ts",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist/src",
|
|
33
|
+
"!dist/src/**/*.test.js",
|
|
34
|
+
"!dist/src/**/*.test.d.ts",
|
|
35
|
+
"!dist/src/**/*.test.js.map",
|
|
36
|
+
"!dist/src/test-support",
|
|
37
|
+
"LICENSE",
|
|
38
|
+
"README.md",
|
|
39
|
+
"SECURITY.md",
|
|
40
|
+
"CHANGELOG.md"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc",
|
|
44
|
+
"prepublishOnly": "npm run build && npm test",
|
|
45
|
+
"test": "node scripts/run-tests.mjs",
|
|
46
|
+
"lint": "tsc --noEmit"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@noble/curves": "2.2.0",
|
|
50
|
+
"@noble/hashes": "2.2.0",
|
|
51
|
+
"@noble/post-quantum": "^0.6.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/node": "^25.6.0",
|
|
55
|
+
"typescript": "^5.4"
|
|
56
|
+
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=20"
|
|
59
|
+
},
|
|
60
|
+
"license": "Apache-2.0",
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"access": "public"
|
|
63
|
+
}
|
|
64
|
+
}
|