@chitmark/sdk 0.8.0 → 0.9.0
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/README.md +41 -172
- package/dist/edge.cjs +34 -8
- package/dist/edge.cjs.map +1 -1
- package/dist/edge.d.cts +2 -2
- package/dist/edge.d.ts +2 -2
- package/dist/edge.js +34 -8
- package/dist/edge.js.map +1 -1
- package/dist/index.cjs +34 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +34 -8
- package/dist/index.js.map +1 -1
- package/dist/{trusted-ip-BvSjdU80.d.cts → trusted-ip-DNO3xzCU.d.cts} +41 -9
- package/dist/{trusted-ip-BvSjdU80.d.ts → trusted-ip-DNO3xzCU.d.ts} +41 -9
- package/package.json +1 -1
|
@@ -366,6 +366,18 @@ interface AttributionAgentProof {
|
|
|
366
366
|
issuedAt: number;
|
|
367
367
|
signature: string;
|
|
368
368
|
}
|
|
369
|
+
interface AttributionAgentKey {
|
|
370
|
+
kty: "OKP";
|
|
371
|
+
crv: "Ed25519";
|
|
372
|
+
x: string;
|
|
373
|
+
}
|
|
374
|
+
interface AttributionNetworkProof {
|
|
375
|
+
iss: "chitmark-agent-key-v1";
|
|
376
|
+
agentKey: AttributionAgentKey;
|
|
377
|
+
nonce: string;
|
|
378
|
+
issuedAt: number;
|
|
379
|
+
signature: string;
|
|
380
|
+
}
|
|
369
381
|
interface AttributionResolveOptions {
|
|
370
382
|
request: {
|
|
371
383
|
url?: string;
|
|
@@ -375,7 +387,9 @@ interface AttributionResolveOptions {
|
|
|
375
387
|
site?: string;
|
|
376
388
|
/** Opaque credential supplied by the integrating server, never a raw browser cookie. */
|
|
377
389
|
session?: string;
|
|
378
|
-
agentProof?: AttributionAgentProof;
|
|
390
|
+
agentProof?: AttributionAgentProof | AttributionNetworkProof;
|
|
391
|
+
/** The recipient's configured disclosure purpose. Defaults to identity_attribution. */
|
|
392
|
+
purpose?: string;
|
|
379
393
|
piiMode?: PiiMode;
|
|
380
394
|
idempotencyKey?: string;
|
|
381
395
|
}
|
|
@@ -390,10 +404,10 @@ interface AttributionResult {
|
|
|
390
404
|
recognized: boolean;
|
|
391
405
|
subject_id: string | null;
|
|
392
406
|
scope: "site" | null;
|
|
393
|
-
match: "none" | "existing_session" | "verified_identity_link";
|
|
407
|
+
match: "none" | "existing_session" | "verified_identity_link" | "verified_agent_account";
|
|
394
408
|
};
|
|
395
409
|
principal: {
|
|
396
|
-
status: "unknown" | "previously_verified";
|
|
410
|
+
status: "unknown" | "previously_verified" | "withheld";
|
|
397
411
|
email: string | null;
|
|
398
412
|
email_verified: boolean | null;
|
|
399
413
|
current_delegation_verified: boolean | null;
|
|
@@ -403,12 +417,30 @@ interface AttributionResult {
|
|
|
403
417
|
interface AttributionLinkRequest {
|
|
404
418
|
enrollmentId: string;
|
|
405
419
|
site: string;
|
|
406
|
-
agentKey:
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
420
|
+
agentKey: AttributionAgentKey;
|
|
421
|
+
recipientKeyId: string;
|
|
422
|
+
emailConsent: boolean;
|
|
423
|
+
expiresAt: number;
|
|
424
|
+
principalProof: string;
|
|
425
|
+
}
|
|
426
|
+
interface AttributionNetworkAgentRequest {
|
|
427
|
+
kind: "network_agent";
|
|
428
|
+
enrollmentId: string;
|
|
429
|
+
agentKey: AttributionAgentKey;
|
|
430
|
+
principalProof: string;
|
|
431
|
+
agentProof: string;
|
|
432
|
+
expiresAt: number;
|
|
433
|
+
rotation?: {
|
|
434
|
+
agentId: string;
|
|
435
|
+
previousKey: AttributionAgentKey;
|
|
410
436
|
};
|
|
437
|
+
}
|
|
438
|
+
interface AttributionNetworkGrantRequest {
|
|
439
|
+
kind: "network_grant";
|
|
440
|
+
agentId: string;
|
|
441
|
+
site: string;
|
|
411
442
|
recipientKeyId: string;
|
|
443
|
+
purpose: string;
|
|
412
444
|
emailConsent: boolean;
|
|
413
445
|
expiresAt: number;
|
|
414
446
|
principalProof: string;
|
|
@@ -734,7 +766,7 @@ declare class Chitmark {
|
|
|
734
766
|
readonly attribution: {
|
|
735
767
|
resolve: (input: AttributionResolveOptions) => Promise<AttributionResult>;
|
|
736
768
|
get: (id: string) => Promise<AttributionResult>;
|
|
737
|
-
createLink: (input: AttributionLinkRequest, idempotencyKey?: string) => Promise<AttributionLink>;
|
|
769
|
+
createLink: (input: AttributionLinkRequest | AttributionNetworkAgentRequest | AttributionNetworkGrantRequest, idempotencyKey?: string) => Promise<AttributionLink>;
|
|
738
770
|
revokeLink: (id: string) => Promise<void>;
|
|
739
771
|
};
|
|
740
772
|
/** Paid access lifecycle. Transport uncertainty must be resumed, never treated as payment. */
|
|
@@ -1053,4 +1085,4 @@ declare function verifyCheckpointInclusion(checkpoint: EvidenceCheckpoint, proof
|
|
|
1053
1085
|
*/
|
|
1054
1086
|
declare function getTrustedClientIp(req: Request): string;
|
|
1055
1087
|
|
|
1056
|
-
export { type
|
|
1088
|
+
export { type SensitiveReceiptAction as $, type Action as A, type ChitmarkHttpStatus as B, Chitmark as C, type ChitmarkOptions as D, type Commitment as E, type CredentialProvider as F, type Decision as G, type DecisionCosts as H, type EligibleAllowVerdict as I, type EnforcementMode as J, type EvidenceBundle as K, type EvidenceCheckpoint as L, EvidenceError as M, type EvidenceKey as N, type EvidenceManifest as O, type EvidenceSigningKey as P, type FeedbackRequest as Q, type FeedbackResponse as R, type FeedbackSource as S, type FeedbackUnit as T, type OnDegraded as U, type VerifyContext as V, type Outcome as W, type PiiMode as X, type PortableRecord as Y, type Principal as Z, SENSITIVE_RECEIPT_ACTIONS as _, type VerifyRequest as a, type Subject as a0, type TrialCreditOperation as a1, VERDICT_TOKEN_ISSUER as a2, type VerdictTokenClaims as a3, VerdictTokenError as a4, type VerdictTokenErrorCode as a5, type VerifyActionReceiptOptions as a6, type VerifyVerdictTokenOptions as a7, type WorkloadCredential as a8, canonicalEvidence as a9, type ChargeQuote as aA, type ChargeRequest as aB, type ChargeResponse as aC, type PaidResource as aD, summarizeCharge as aE, checkpointFromCommitments as aa, createDPoPCredentialProvider as ab, degradedChallengeVerdict as ac, enforceDegradedNeverAllow as ad, evidenceAssert as ae, evidenceCommitment as af, evidenceHash as ag, evidenceKeyAt as ah, getTrustedClientIp as ai, hashEmailSha256 as aj, isEligibleAllow as ak, minimizeFormData as al, signEvidence as am, trialCreditOperationDigest as an, truncateIp as ao, validateManifest as ap, verdictToHttpStatus as aq, verifyActionReceipt as ar, verifyCheckpointAppend as as, verifyCheckpointInclusion as at, verifyEvidenceBundle as au, verifyEvidenceSignature as av, verifyHistoricalReceipt as aw, verifyVerdictToken as ax, type ChargeExecution as ay, type ChargePurchase as az, type Verdict as b, type ActionBinding as c, type ActionReceiptClaims as d, type ActorType as e, type AttributionAgentKey as f, type AttributionAgentProof as g, type AttributionLink as h, type AttributionLinkRequest as i, type AttributionNetworkAgentRequest as j, type AttributionNetworkGrantRequest as k, type AttributionNetworkProof as l, type AttributionResolveOptions as m, type AttributionResult as n, CHITMARK_HTTP_STATUS as o, CHITMARK_HTTP_STATUS_MEANING as p, type ChallengeCompletionResponse as q, type ChallengeMethod as r, type ChallengeProof as s, type ChallengeRequest as t, type ChallengeResponse as u, type ChallengeRiskTier as v, ChitmarkApiError as w, type ChitmarkEnv as x, ChitmarkError as y, type ChitmarkErrorBody as z };
|
|
@@ -366,6 +366,18 @@ interface AttributionAgentProof {
|
|
|
366
366
|
issuedAt: number;
|
|
367
367
|
signature: string;
|
|
368
368
|
}
|
|
369
|
+
interface AttributionAgentKey {
|
|
370
|
+
kty: "OKP";
|
|
371
|
+
crv: "Ed25519";
|
|
372
|
+
x: string;
|
|
373
|
+
}
|
|
374
|
+
interface AttributionNetworkProof {
|
|
375
|
+
iss: "chitmark-agent-key-v1";
|
|
376
|
+
agentKey: AttributionAgentKey;
|
|
377
|
+
nonce: string;
|
|
378
|
+
issuedAt: number;
|
|
379
|
+
signature: string;
|
|
380
|
+
}
|
|
369
381
|
interface AttributionResolveOptions {
|
|
370
382
|
request: {
|
|
371
383
|
url?: string;
|
|
@@ -375,7 +387,9 @@ interface AttributionResolveOptions {
|
|
|
375
387
|
site?: string;
|
|
376
388
|
/** Opaque credential supplied by the integrating server, never a raw browser cookie. */
|
|
377
389
|
session?: string;
|
|
378
|
-
agentProof?: AttributionAgentProof;
|
|
390
|
+
agentProof?: AttributionAgentProof | AttributionNetworkProof;
|
|
391
|
+
/** The recipient's configured disclosure purpose. Defaults to identity_attribution. */
|
|
392
|
+
purpose?: string;
|
|
379
393
|
piiMode?: PiiMode;
|
|
380
394
|
idempotencyKey?: string;
|
|
381
395
|
}
|
|
@@ -390,10 +404,10 @@ interface AttributionResult {
|
|
|
390
404
|
recognized: boolean;
|
|
391
405
|
subject_id: string | null;
|
|
392
406
|
scope: "site" | null;
|
|
393
|
-
match: "none" | "existing_session" | "verified_identity_link";
|
|
407
|
+
match: "none" | "existing_session" | "verified_identity_link" | "verified_agent_account";
|
|
394
408
|
};
|
|
395
409
|
principal: {
|
|
396
|
-
status: "unknown" | "previously_verified";
|
|
410
|
+
status: "unknown" | "previously_verified" | "withheld";
|
|
397
411
|
email: string | null;
|
|
398
412
|
email_verified: boolean | null;
|
|
399
413
|
current_delegation_verified: boolean | null;
|
|
@@ -403,12 +417,30 @@ interface AttributionResult {
|
|
|
403
417
|
interface AttributionLinkRequest {
|
|
404
418
|
enrollmentId: string;
|
|
405
419
|
site: string;
|
|
406
|
-
agentKey:
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
420
|
+
agentKey: AttributionAgentKey;
|
|
421
|
+
recipientKeyId: string;
|
|
422
|
+
emailConsent: boolean;
|
|
423
|
+
expiresAt: number;
|
|
424
|
+
principalProof: string;
|
|
425
|
+
}
|
|
426
|
+
interface AttributionNetworkAgentRequest {
|
|
427
|
+
kind: "network_agent";
|
|
428
|
+
enrollmentId: string;
|
|
429
|
+
agentKey: AttributionAgentKey;
|
|
430
|
+
principalProof: string;
|
|
431
|
+
agentProof: string;
|
|
432
|
+
expiresAt: number;
|
|
433
|
+
rotation?: {
|
|
434
|
+
agentId: string;
|
|
435
|
+
previousKey: AttributionAgentKey;
|
|
410
436
|
};
|
|
437
|
+
}
|
|
438
|
+
interface AttributionNetworkGrantRequest {
|
|
439
|
+
kind: "network_grant";
|
|
440
|
+
agentId: string;
|
|
441
|
+
site: string;
|
|
411
442
|
recipientKeyId: string;
|
|
443
|
+
purpose: string;
|
|
412
444
|
emailConsent: boolean;
|
|
413
445
|
expiresAt: number;
|
|
414
446
|
principalProof: string;
|
|
@@ -734,7 +766,7 @@ declare class Chitmark {
|
|
|
734
766
|
readonly attribution: {
|
|
735
767
|
resolve: (input: AttributionResolveOptions) => Promise<AttributionResult>;
|
|
736
768
|
get: (id: string) => Promise<AttributionResult>;
|
|
737
|
-
createLink: (input: AttributionLinkRequest, idempotencyKey?: string) => Promise<AttributionLink>;
|
|
769
|
+
createLink: (input: AttributionLinkRequest | AttributionNetworkAgentRequest | AttributionNetworkGrantRequest, idempotencyKey?: string) => Promise<AttributionLink>;
|
|
738
770
|
revokeLink: (id: string) => Promise<void>;
|
|
739
771
|
};
|
|
740
772
|
/** Paid access lifecycle. Transport uncertainty must be resumed, never treated as payment. */
|
|
@@ -1053,4 +1085,4 @@ declare function verifyCheckpointInclusion(checkpoint: EvidenceCheckpoint, proof
|
|
|
1053
1085
|
*/
|
|
1054
1086
|
declare function getTrustedClientIp(req: Request): string;
|
|
1055
1087
|
|
|
1056
|
-
export { type
|
|
1088
|
+
export { type SensitiveReceiptAction as $, type Action as A, type ChitmarkHttpStatus as B, Chitmark as C, type ChitmarkOptions as D, type Commitment as E, type CredentialProvider as F, type Decision as G, type DecisionCosts as H, type EligibleAllowVerdict as I, type EnforcementMode as J, type EvidenceBundle as K, type EvidenceCheckpoint as L, EvidenceError as M, type EvidenceKey as N, type EvidenceManifest as O, type EvidenceSigningKey as P, type FeedbackRequest as Q, type FeedbackResponse as R, type FeedbackSource as S, type FeedbackUnit as T, type OnDegraded as U, type VerifyContext as V, type Outcome as W, type PiiMode as X, type PortableRecord as Y, type Principal as Z, SENSITIVE_RECEIPT_ACTIONS as _, type VerifyRequest as a, type Subject as a0, type TrialCreditOperation as a1, VERDICT_TOKEN_ISSUER as a2, type VerdictTokenClaims as a3, VerdictTokenError as a4, type VerdictTokenErrorCode as a5, type VerifyActionReceiptOptions as a6, type VerifyVerdictTokenOptions as a7, type WorkloadCredential as a8, canonicalEvidence as a9, type ChargeQuote as aA, type ChargeRequest as aB, type ChargeResponse as aC, type PaidResource as aD, summarizeCharge as aE, checkpointFromCommitments as aa, createDPoPCredentialProvider as ab, degradedChallengeVerdict as ac, enforceDegradedNeverAllow as ad, evidenceAssert as ae, evidenceCommitment as af, evidenceHash as ag, evidenceKeyAt as ah, getTrustedClientIp as ai, hashEmailSha256 as aj, isEligibleAllow as ak, minimizeFormData as al, signEvidence as am, trialCreditOperationDigest as an, truncateIp as ao, validateManifest as ap, verdictToHttpStatus as aq, verifyActionReceipt as ar, verifyCheckpointAppend as as, verifyCheckpointInclusion as at, verifyEvidenceBundle as au, verifyEvidenceSignature as av, verifyHistoricalReceipt as aw, verifyVerdictToken as ax, type ChargeExecution as ay, type ChargePurchase as az, type Verdict as b, type ActionBinding as c, type ActionReceiptClaims as d, type ActorType as e, type AttributionAgentKey as f, type AttributionAgentProof as g, type AttributionLink as h, type AttributionLinkRequest as i, type AttributionNetworkAgentRequest as j, type AttributionNetworkGrantRequest as k, type AttributionNetworkProof as l, type AttributionResolveOptions as m, type AttributionResult as n, CHITMARK_HTTP_STATUS as o, CHITMARK_HTTP_STATUS_MEANING as p, type ChallengeCompletionResponse as q, type ChallengeMethod as r, type ChallengeProof as s, type ChallengeRequest as t, type ChallengeResponse as u, type ChallengeRiskTier as v, ChitmarkApiError as w, type ChitmarkEnv as x, ChitmarkError as y, type ChitmarkErrorBody as z };
|
package/package.json
CHANGED