@proof-holdings/sdk 0.0.0-stage → 1.2.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/CHANGELOG.md +54 -0
- package/LICENSE +21 -0
- package/README.md +239 -2
- package/dist/cjs/client.d.ts +48 -0
- package/dist/cjs/client.d.ts.map +1 -0
- package/dist/cjs/client.js +73 -0
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/credentials.d.ts +46 -0
- package/dist/cjs/credentials.d.ts.map +1 -0
- package/dist/cjs/credentials.js +137 -0
- package/dist/cjs/credentials.js.map +1 -0
- package/dist/cjs/crypto/hitl-crypto.d.ts +95 -0
- package/dist/cjs/crypto/hitl-crypto.d.ts.map +1 -0
- package/dist/cjs/crypto/hitl-crypto.js +338 -0
- package/dist/cjs/crypto/hitl-crypto.js.map +1 -0
- package/dist/cjs/errors.d.ts +52 -0
- package/dist/cjs/errors.d.ts.map +1 -0
- package/dist/cjs/errors.js +121 -0
- package/dist/cjs/errors.js.map +1 -0
- package/dist/cjs/http.d.ts +62 -0
- package/dist/cjs/http.d.ts.map +1 -0
- package/dist/cjs/http.js +192 -0
- package/dist/cjs/http.js.map +1 -0
- package/dist/cjs/index.d.ts +26 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +79 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/jwks/key-set-cache.d.ts +105 -0
- package/dist/cjs/jwks/key-set-cache.d.ts.map +1 -0
- package/dist/cjs/jwks/key-set-cache.js +277 -0
- package/dist/cjs/jwks/key-set-cache.js.map +1 -0
- package/dist/cjs/jwks/keyset.d.ts +139 -0
- package/dist/cjs/jwks/keyset.d.ts.map +1 -0
- package/dist/cjs/jwks/keyset.js +503 -0
- package/dist/cjs/jwks/keyset.js.map +1 -0
- package/dist/cjs/jwks/support.d.ts +9 -0
- package/dist/cjs/jwks/support.d.ts.map +1 -0
- package/dist/cjs/jwks/support.js +12 -0
- package/dist/cjs/jwks/support.js.map +1 -0
- package/dist/cjs/polling.d.ts +10 -0
- package/dist/cjs/polling.d.ts.map +1 -0
- package/dist/cjs/polling.js +74 -0
- package/dist/cjs/polling.js.map +1 -0
- package/dist/cjs/resources/auth-sessions.d.ts +41 -0
- package/dist/cjs/resources/auth-sessions.d.ts.map +1 -0
- package/dist/cjs/resources/auth-sessions.js +34 -0
- package/dist/cjs/resources/auth-sessions.js.map +1 -0
- package/dist/cjs/resources/authorizations.d.ts +23 -0
- package/dist/cjs/resources/authorizations.d.ts.map +1 -0
- package/dist/cjs/resources/authorizations.js +29 -0
- package/dist/cjs/resources/authorizations.js.map +1 -0
- package/dist/cjs/resources/circles.d.ts +38 -0
- package/dist/cjs/resources/circles.d.ts.map +1 -0
- package/dist/cjs/resources/circles.js +67 -0
- package/dist/cjs/resources/circles.js.map +1 -0
- package/dist/cjs/resources/confirmations.d.ts +111 -0
- package/dist/cjs/resources/confirmations.d.ts.map +1 -0
- package/dist/cjs/resources/confirmations.js +86 -0
- package/dist/cjs/resources/confirmations.js.map +1 -0
- package/dist/cjs/resources/delegations.d.ts +36 -0
- package/dist/cjs/resources/delegations.d.ts.map +1 -0
- package/dist/cjs/resources/delegations.js +47 -0
- package/dist/cjs/resources/delegations.js.map +1 -0
- package/dist/cjs/resources/hitl-chat-id.d.ts +42 -0
- package/dist/cjs/resources/hitl-chat-id.d.ts.map +1 -0
- package/dist/cjs/resources/hitl-chat-id.js +37 -0
- package/dist/cjs/resources/hitl-chat-id.js.map +1 -0
- package/dist/cjs/resources/hitl-keys.d.ts +13 -0
- package/dist/cjs/resources/hitl-keys.d.ts.map +1 -0
- package/dist/cjs/resources/hitl-keys.js +22 -0
- package/dist/cjs/resources/hitl-keys.js.map +1 -0
- package/dist/cjs/resources/hitl.d.ts +39 -0
- package/dist/cjs/resources/hitl.d.ts.map +1 -0
- package/dist/cjs/resources/hitl.js +58 -0
- package/dist/cjs/resources/hitl.js.map +1 -0
- package/dist/cjs/resources/me.d.ts +102 -0
- package/dist/cjs/resources/me.d.ts.map +1 -0
- package/dist/cjs/resources/me.js +85 -0
- package/dist/cjs/resources/me.js.map +1 -0
- package/dist/cjs/resources/profiles.d.ts +47 -0
- package/dist/cjs/resources/profiles.d.ts.map +1 -0
- package/dist/cjs/resources/profiles.js +70 -0
- package/dist/cjs/resources/profiles.js.map +1 -0
- package/dist/cjs/resources/proof-me.d.ts +48 -0
- package/dist/cjs/resources/proof-me.d.ts.map +1 -0
- package/dist/cjs/resources/proof-me.js +24 -0
- package/dist/cjs/resources/proof-me.js.map +1 -0
- package/dist/cjs/resources/proofs.d.ts +81 -0
- package/dist/cjs/resources/proofs.d.ts.map +1 -0
- package/dist/cjs/resources/proofs.js +437 -0
- package/dist/cjs/resources/proofs.js.map +1 -0
- package/dist/cjs/resources/public-profiles.d.ts +36 -0
- package/dist/cjs/resources/public-profiles.d.ts.map +1 -0
- package/dist/cjs/resources/public-profiles.js +49 -0
- package/dist/cjs/resources/public-profiles.js.map +1 -0
- package/dist/cjs/resources/sessions.d.ts +15 -0
- package/dist/cjs/resources/sessions.d.ts.map +1 -0
- package/dist/cjs/resources/sessions.js +26 -0
- package/dist/cjs/resources/sessions.js.map +1 -0
- package/dist/cjs/resources/templates.d.ts +25 -0
- package/dist/cjs/resources/templates.d.ts.map +1 -0
- package/dist/cjs/resources/templates.js +46 -0
- package/dist/cjs/resources/templates.js.map +1 -0
- package/dist/cjs/resources/verification-requests.d.ts +56 -0
- package/dist/cjs/resources/verification-requests.d.ts.map +1 -0
- package/dist/cjs/resources/verification-requests.js +61 -0
- package/dist/cjs/resources/verification-requests.js.map +1 -0
- package/dist/cjs/resources/verifications.d.ts +60 -0
- package/dist/cjs/resources/verifications.d.ts.map +1 -0
- package/dist/cjs/resources/verifications.js +91 -0
- package/dist/cjs/resources/verifications.js.map +1 -0
- package/dist/cjs/resources/webhook-deliveries.d.ts +15 -0
- package/dist/cjs/resources/webhook-deliveries.d.ts.map +1 -0
- package/dist/cjs/resources/webhook-deliveries.js +26 -0
- package/dist/cjs/resources/webhook-deliveries.js.map +1 -0
- package/dist/cjs/streaming.d.ts +87 -0
- package/dist/cjs/streaming.d.ts.map +1 -0
- package/dist/cjs/streaming.js +289 -0
- package/dist/cjs/streaming.js.map +1 -0
- package/dist/cjs/types.d.ts +1483 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +6 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/version.d.ts +2 -0
- package/dist/cjs/version.d.ts.map +1 -0
- package/dist/cjs/version.js +5 -0
- package/dist/cjs/version.js.map +1 -0
- package/dist/esm/client.d.ts +48 -0
- package/dist/esm/client.d.ts.map +1 -0
- package/dist/esm/client.js +69 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/credentials.d.ts +46 -0
- package/dist/esm/credentials.d.ts.map +1 -0
- package/dist/esm/credentials.js +127 -0
- package/dist/esm/credentials.js.map +1 -0
- package/dist/esm/crypto/hitl-crypto.d.ts +95 -0
- package/dist/esm/crypto/hitl-crypto.d.ts.map +1 -0
- package/dist/esm/crypto/hitl-crypto.js +321 -0
- package/dist/esm/crypto/hitl-crypto.js.map +1 -0
- package/dist/esm/errors.d.ts +52 -0
- package/dist/esm/errors.d.ts.map +1 -0
- package/dist/esm/errors.js +106 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/http.d.ts +62 -0
- package/dist/esm/http.d.ts.map +1 -0
- package/dist/esm/http.js +187 -0
- package/dist/esm/http.js.map +1 -0
- package/dist/esm/index.d.ts +26 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +33 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/jwks/key-set-cache.d.ts +105 -0
- package/dist/esm/jwks/key-set-cache.d.ts.map +1 -0
- package/dist/esm/jwks/key-set-cache.js +268 -0
- package/dist/esm/jwks/key-set-cache.js.map +1 -0
- package/dist/esm/jwks/keyset.d.ts +139 -0
- package/dist/esm/jwks/keyset.d.ts.map +1 -0
- package/dist/esm/jwks/keyset.js +489 -0
- package/dist/esm/jwks/keyset.js.map +1 -0
- package/dist/esm/jwks/support.d.ts +9 -0
- package/dist/esm/jwks/support.d.ts.map +1 -0
- package/dist/esm/jwks/support.js +9 -0
- package/dist/esm/jwks/support.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/polling.d.ts +10 -0
- package/dist/esm/polling.d.ts.map +1 -0
- package/dist/esm/polling.js +71 -0
- package/dist/esm/polling.js.map +1 -0
- package/dist/esm/resources/auth-sessions.d.ts +41 -0
- package/dist/esm/resources/auth-sessions.d.ts.map +1 -0
- package/dist/esm/resources/auth-sessions.js +30 -0
- package/dist/esm/resources/auth-sessions.js.map +1 -0
- package/dist/esm/resources/authorizations.d.ts +23 -0
- package/dist/esm/resources/authorizations.d.ts.map +1 -0
- package/dist/esm/resources/authorizations.js +25 -0
- package/dist/esm/resources/authorizations.js.map +1 -0
- package/dist/esm/resources/circles.d.ts +38 -0
- package/dist/esm/resources/circles.d.ts.map +1 -0
- package/dist/esm/resources/circles.js +63 -0
- package/dist/esm/resources/circles.js.map +1 -0
- package/dist/esm/resources/confirmations.d.ts +111 -0
- package/dist/esm/resources/confirmations.d.ts.map +1 -0
- package/dist/esm/resources/confirmations.js +82 -0
- package/dist/esm/resources/confirmations.js.map +1 -0
- package/dist/esm/resources/delegations.d.ts +36 -0
- package/dist/esm/resources/delegations.d.ts.map +1 -0
- package/dist/esm/resources/delegations.js +43 -0
- package/dist/esm/resources/delegations.js.map +1 -0
- package/dist/esm/resources/hitl-chat-id.d.ts +42 -0
- package/dist/esm/resources/hitl-chat-id.d.ts.map +1 -0
- package/dist/esm/resources/hitl-chat-id.js +33 -0
- package/dist/esm/resources/hitl-chat-id.js.map +1 -0
- package/dist/esm/resources/hitl-keys.d.ts +13 -0
- package/dist/esm/resources/hitl-keys.d.ts.map +1 -0
- package/dist/esm/resources/hitl-keys.js +18 -0
- package/dist/esm/resources/hitl-keys.js.map +1 -0
- package/dist/esm/resources/hitl.d.ts +39 -0
- package/dist/esm/resources/hitl.d.ts.map +1 -0
- package/dist/esm/resources/hitl.js +54 -0
- package/dist/esm/resources/hitl.js.map +1 -0
- package/dist/esm/resources/me.d.ts +102 -0
- package/dist/esm/resources/me.d.ts.map +1 -0
- package/dist/esm/resources/me.js +81 -0
- package/dist/esm/resources/me.js.map +1 -0
- package/dist/esm/resources/profiles.d.ts +47 -0
- package/dist/esm/resources/profiles.d.ts.map +1 -0
- package/dist/esm/resources/profiles.js +66 -0
- package/dist/esm/resources/profiles.js.map +1 -0
- package/dist/esm/resources/proof-me.d.ts +48 -0
- package/dist/esm/resources/proof-me.d.ts.map +1 -0
- package/dist/esm/resources/proof-me.js +20 -0
- package/dist/esm/resources/proof-me.js.map +1 -0
- package/dist/esm/resources/proofs.d.ts +81 -0
- package/dist/esm/resources/proofs.d.ts.map +1 -0
- package/dist/esm/resources/proofs.js +433 -0
- package/dist/esm/resources/proofs.js.map +1 -0
- package/dist/esm/resources/public-profiles.d.ts +36 -0
- package/dist/esm/resources/public-profiles.d.ts.map +1 -0
- package/dist/esm/resources/public-profiles.js +45 -0
- package/dist/esm/resources/public-profiles.js.map +1 -0
- package/dist/esm/resources/sessions.d.ts +15 -0
- package/dist/esm/resources/sessions.d.ts.map +1 -0
- package/dist/esm/resources/sessions.js +22 -0
- package/dist/esm/resources/sessions.js.map +1 -0
- package/dist/esm/resources/templates.d.ts +25 -0
- package/dist/esm/resources/templates.d.ts.map +1 -0
- package/dist/esm/resources/templates.js +42 -0
- package/dist/esm/resources/templates.js.map +1 -0
- package/dist/esm/resources/verification-requests.d.ts +56 -0
- package/dist/esm/resources/verification-requests.d.ts.map +1 -0
- package/dist/esm/resources/verification-requests.js +57 -0
- package/dist/esm/resources/verification-requests.js.map +1 -0
- package/dist/esm/resources/verifications.d.ts +60 -0
- package/dist/esm/resources/verifications.d.ts.map +1 -0
- package/dist/esm/resources/verifications.js +87 -0
- package/dist/esm/resources/verifications.js.map +1 -0
- package/dist/esm/resources/webhook-deliveries.d.ts +15 -0
- package/dist/esm/resources/webhook-deliveries.d.ts.map +1 -0
- package/dist/esm/resources/webhook-deliveries.js +22 -0
- package/dist/esm/resources/webhook-deliveries.js.map +1 -0
- package/dist/esm/streaming.d.ts +87 -0
- package/dist/esm/streaming.d.ts.map +1 -0
- package/dist/esm/streaming.js +286 -0
- package/dist/esm/streaming.js.map +1 -0
- package/dist/esm/types.d.ts +1483 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +5 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/version.d.ts +2 -0
- package/dist/esm/version.d.ts.map +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- package/package.json +64 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hitl-chat-id.js","sourceRoot":"","sources":["../../../src/resources/hitl-chat-id.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAwC,MAAM,iBAAiB,CAAC;AA2BvF,MAAM,eAAe,GAAG,CAAC,WAAW,EAAE,SAAS,CAAU,CAAC;AAE1D;;;;GAIG;AACH,MAAM,OAAO,mBAAmB;IAC9B,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,sEAAsE;IACtE,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAgC,gCAAgC,CAAC,CAAC;IACzF,CAAC;IAED,4EAA4E;IAC5E,QAAQ,CAAC,KAAa;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,kCAAkC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAC9D,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,MAAM,CACJ,KAAa,EACb,OAAuB;QAEvB,OAAO,cAAc,CAA8C,IAAI,CAAC,IAAI,EAAE;YAC5E,IAAI,EAAE,kCAAkC,kBAAkB,CAAC,KAAK,CAAC,SAAS;YAC1E,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YACpC,cAAc,EAAE,eAAe;YAC/B,KAAK,EAAE,qBAAqB,KAAK,EAAE;SACpC,EAAE,OAAO,CAAC,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HttpClient } from '../http.js';
|
|
2
|
+
import type { HitlKeysResponse, HitlKeysPutResponse, HitlKeysDeleteResponse, HitlKeysPutParams } from '../types.js';
|
|
3
|
+
export declare class HitlKeys {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
/** Get encryption keypair for a HITL config */
|
|
7
|
+
get(hitlId: string): Promise<HitlKeysResponse>;
|
|
8
|
+
/** Upload encryption keypair for a HITL config */
|
|
9
|
+
upload(hitlId: string, params: HitlKeysPutParams): Promise<HitlKeysPutResponse>;
|
|
10
|
+
/** Delete encryption keypair from a HITL config */
|
|
11
|
+
delete(hitlId: string): Promise<HitlKeysDeleteResponse>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=hitl-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hitl-keys.d.ts","sourceRoot":"","sources":["../../../src/resources/hitl-keys.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEpH,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,+CAA+C;IAC/C,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAI9C,kDAAkD;IAClD,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI/E,mDAAmD;IACnD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAGxD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class HitlKeys {
|
|
2
|
+
constructor(http) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
}
|
|
5
|
+
/** Get encryption keypair for a HITL config */
|
|
6
|
+
get(hitlId) {
|
|
7
|
+
return this.http.get(`/api/v1/hitl/${encodeURIComponent(hitlId)}/keys`);
|
|
8
|
+
}
|
|
9
|
+
/** Upload encryption keypair for a HITL config */
|
|
10
|
+
upload(hitlId, params) {
|
|
11
|
+
return this.http.put(`/api/v1/hitl/${encodeURIComponent(hitlId)}/keys`, params);
|
|
12
|
+
}
|
|
13
|
+
/** Delete encryption keypair from a HITL config */
|
|
14
|
+
delete(hitlId) {
|
|
15
|
+
return this.http.del(`/api/v1/hitl/${encodeURIComponent(hitlId)}/keys`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=hitl-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hitl-keys.js","sourceRoot":"","sources":["../../../src/resources/hitl-keys.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,QAAQ;IACnB,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,+CAA+C;IAC/C,GAAG,CAAC,MAAc;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAmB,gBAAgB,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5F,CAAC;IAED,kDAAkD;IAClD,MAAM,CAAC,MAAc,EAAE,MAAyB;QAC9C,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAsB,gBAAgB,kBAAkB,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACvG,CAAC;IAED,mDAAmD;IACnD,MAAM,CAAC,MAAc;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAyB,gBAAgB,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClG,CAAC;CACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { HttpClient } from '../http.js';
|
|
2
|
+
import type { HitlConfig, CreateHitlParams, UpdateHitlParams, HitlListParams, HitlListResponse, HitlAuthorizationResponse, HitlFinalizeResponse, HitlApproverKeysResponse } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* HITL config CRUD. Configs are created in `pending` status; upload an
|
|
5
|
+
* encryption keypair (see `hitlKeys`) and call `finalize(id)` to activate.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Hitl {
|
|
8
|
+
private readonly http;
|
|
9
|
+
constructor(http: HttpClient);
|
|
10
|
+
/** Create a new HITL configuration (starts in `pending` status) */
|
|
11
|
+
create(params: CreateHitlParams): Promise<HitlConfig>;
|
|
12
|
+
/** List HITL configurations with optional filters */
|
|
13
|
+
list(params?: HitlListParams): Promise<HitlListResponse>;
|
|
14
|
+
/** Get a HITL configuration by ID */
|
|
15
|
+
retrieve(id: string): Promise<HitlConfig>;
|
|
16
|
+
/** Update a HITL configuration's name, channels, or timeout */
|
|
17
|
+
update(id: string, params: UpdateHitlParams): Promise<HitlConfig>;
|
|
18
|
+
/** Archive a HITL configuration (soft delete; returns the archived config) */
|
|
19
|
+
archive(id: string): Promise<HitlConfig>;
|
|
20
|
+
/**
|
|
21
|
+
* Finalize a pending HITL configuration (pending → active). Requires an
|
|
22
|
+
* uploaded encryption keypair; dispatches authorization consent messages.
|
|
23
|
+
*/
|
|
24
|
+
finalize(id: string): Promise<HitlFinalizeResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Request authorization consent for channels in an active HITL config
|
|
27
|
+
* that don't have one yet.
|
|
28
|
+
*/
|
|
29
|
+
requestAuthorization(id: string): Promise<HitlAuthorizationResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* List enrolled approver public keys for a config. Feed these into
|
|
32
|
+
* `encryptMessageV2` to wrap a confirmation message for every approver.
|
|
33
|
+
*
|
|
34
|
+
* A key holding `confirmations:create` without `hitl:read` receives each entry as
|
|
35
|
+
* `{ authorization_id, public_key, kid }` only — `recipient` and `channel` are omitted.
|
|
36
|
+
*/
|
|
37
|
+
getApproverKeys(id: string): Promise<HitlApproverKeysResponse>;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=hitl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hitl.d.ts","sourceRoot":"","sources":["../../../src/resources/hitl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,qBAAa,IAAI;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,mEAAmE;IACnE,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC;IAIrD,qDAAqD;IACrD,IAAI,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIxD,qCAAqC;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAIzC,+DAA+D;IAC/D,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC;IAQjE,8EAA8E;IAC9E,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAIxC;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAMnD;;;OAGG;IACH,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAMpE;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;CAK/D"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HITL config CRUD. Configs are created in `pending` status; upload an
|
|
3
|
+
* encryption keypair (see `hitlKeys`) and call `finalize(id)` to activate.
|
|
4
|
+
*/
|
|
5
|
+
export class Hitl {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
this.http = http;
|
|
8
|
+
}
|
|
9
|
+
/** Create a new HITL configuration (starts in `pending` status) */
|
|
10
|
+
create(params) {
|
|
11
|
+
return this.http.post('/api/v1/hitl', params);
|
|
12
|
+
}
|
|
13
|
+
/** List HITL configurations with optional filters */
|
|
14
|
+
list(params) {
|
|
15
|
+
return this.http.get('/api/v1/hitl', params);
|
|
16
|
+
}
|
|
17
|
+
/** Get a HITL configuration by ID */
|
|
18
|
+
retrieve(id) {
|
|
19
|
+
return this.http.get(`/api/v1/hitl/${encodeURIComponent(id)}`);
|
|
20
|
+
}
|
|
21
|
+
/** Update a HITL configuration's name, channels, or timeout */
|
|
22
|
+
update(id, params) {
|
|
23
|
+
return this.http.request('PATCH', `/api/v1/hitl/${encodeURIComponent(id)}`, { body: params });
|
|
24
|
+
}
|
|
25
|
+
/** Archive a HITL configuration (soft delete; returns the archived config) */
|
|
26
|
+
archive(id) {
|
|
27
|
+
return this.http.del(`/api/v1/hitl/${encodeURIComponent(id)}`);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Finalize a pending HITL configuration (pending → active). Requires an
|
|
31
|
+
* uploaded encryption keypair; dispatches authorization consent messages.
|
|
32
|
+
*/
|
|
33
|
+
finalize(id) {
|
|
34
|
+
return this.http.post(`/api/v1/hitl/${encodeURIComponent(id)}/finalize`);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Request authorization consent for channels in an active HITL config
|
|
38
|
+
* that don't have one yet.
|
|
39
|
+
*/
|
|
40
|
+
requestAuthorization(id) {
|
|
41
|
+
return this.http.post(`/api/v1/hitl/${encodeURIComponent(id)}/authorize`);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* List enrolled approver public keys for a config. Feed these into
|
|
45
|
+
* `encryptMessageV2` to wrap a confirmation message for every approver.
|
|
46
|
+
*
|
|
47
|
+
* A key holding `confirmations:create` without `hitl:read` receives each entry as
|
|
48
|
+
* `{ authorization_id, public_key, kid }` only — `recipient` and `channel` are omitted.
|
|
49
|
+
*/
|
|
50
|
+
getApproverKeys(id) {
|
|
51
|
+
return this.http.get(`/api/v1/hitl/${encodeURIComponent(id)}/approver-keys`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=hitl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hitl.js","sourceRoot":"","sources":["../../../src/resources/hitl.ts"],"names":[],"mappings":"AAYA;;;GAGG;AACH,MAAM,OAAO,IAAI;IACf,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,mEAAmE;IACnE,MAAM,CAAC,MAAwB;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAa,cAAc,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC;IAED,qDAAqD;IACrD,IAAI,CAAC,MAAuB;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAmB,cAAc,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;IAED,qCAAqC;IACrC,QAAQ,CAAC,EAAU;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAa,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,+DAA+D;IAC/D,MAAM,CAAC,EAAU,EAAE,MAAwB;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CACtB,OAAO,EACP,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE,EACxC,EAAE,IAAI,EAAE,MAAM,EAAE,CACjB,CAAC;IACJ,CAAC;IAED,8EAA8E;IAC9E,OAAO,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAa,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,EAAU;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CACnB,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,WAAW,CAClD,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,oBAAoB,CAAC,EAAU;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CACnB,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,YAAY,CACnD,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,eAAe,CAAC,EAAU;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,gBAAgB,CACvD,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { HttpClient } from '../http.js';
|
|
2
|
+
import { type StreamEvent, type StreamOptions } from '../streaming.js';
|
|
3
|
+
import type { ApiKeyMetadata, ApiKeyUsage, MeEnvironmentParams, MeSearchParams, MeSearchResults, PlatformSummary } from '../types.js';
|
|
4
|
+
/** Dashboard-side add-phone session. */
|
|
5
|
+
export interface PhoneAddSession {
|
|
6
|
+
id: string;
|
|
7
|
+
status: string;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
/** Dashboard-side add-email session. */
|
|
11
|
+
export interface EmailAddSession {
|
|
12
|
+
id: string;
|
|
13
|
+
status: string;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
/** Dashboard-side 2FA challenge session. */
|
|
17
|
+
export interface TwoFASession {
|
|
18
|
+
id: string;
|
|
19
|
+
status: string;
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
/** The `connected` frame of `me.streamPhoneAddSession()`, written once when the connection opens. */
|
|
23
|
+
export interface PhoneAddSessionStreamConnected {
|
|
24
|
+
session_id: string;
|
|
25
|
+
status: string;
|
|
26
|
+
channel: string;
|
|
27
|
+
}
|
|
28
|
+
/** The `update` frame of `me.streamPhoneAddSession()`: a status signal, not the session. */
|
|
29
|
+
export interface PhoneAddSessionStreamUpdate {
|
|
30
|
+
status: string;
|
|
31
|
+
timestamp: string;
|
|
32
|
+
phone_number?: string;
|
|
33
|
+
}
|
|
34
|
+
export type PhoneAddSessionStreamEvent = StreamEvent<'update', PhoneAddSessionStreamConnected, PhoneAddSessionStreamUpdate, PhoneAddSession>;
|
|
35
|
+
/** The `connected` frame of `me.streamEmailAddSession()`, written once when the connection opens. */
|
|
36
|
+
export interface EmailAddSessionStreamConnected {
|
|
37
|
+
session_id: string;
|
|
38
|
+
status: string;
|
|
39
|
+
email: string;
|
|
40
|
+
channel: string;
|
|
41
|
+
}
|
|
42
|
+
/** The `update` frame of `me.streamEmailAddSession()`: a status signal, not the session. */
|
|
43
|
+
export interface EmailAddSessionStreamUpdate {
|
|
44
|
+
status: string;
|
|
45
|
+
timestamp: string;
|
|
46
|
+
email?: string;
|
|
47
|
+
}
|
|
48
|
+
export type EmailAddSessionStreamEvent = StreamEvent<'update', EmailAddSessionStreamConnected, EmailAddSessionStreamUpdate, EmailAddSession>;
|
|
49
|
+
/** The `connected` frame of `me.stream2FASession()`, written once when the connection opens. */
|
|
50
|
+
export interface TwoFASessionStreamConnected {
|
|
51
|
+
session_id: string;
|
|
52
|
+
status: string;
|
|
53
|
+
action_type: string;
|
|
54
|
+
}
|
|
55
|
+
/** The `update` frame of `me.stream2FASession()`: a status signal, not the session. */
|
|
56
|
+
export interface TwoFASessionStreamUpdate {
|
|
57
|
+
status: string;
|
|
58
|
+
timestamp: string;
|
|
59
|
+
}
|
|
60
|
+
export type TwoFASessionStreamEvent = StreamEvent<'update', TwoFASessionStreamConnected, TwoFASessionStreamUpdate, TwoFASession>;
|
|
61
|
+
/**
|
|
62
|
+
* `/me` account-management resources: phone/email add flows and 2FA. All
|
|
63
|
+
* endpoints are JWT-authenticated and scoped to the current user on the
|
|
64
|
+
* backend, so the SDK just forwards the session ID.
|
|
65
|
+
*/
|
|
66
|
+
export declare class Me {
|
|
67
|
+
private readonly http;
|
|
68
|
+
constructor(http: HttpClient);
|
|
69
|
+
/** Retrieve an add-phone session (polling fallback). */
|
|
70
|
+
retrievePhoneAddSession(sessionId: string): Promise<PhoneAddSession>;
|
|
71
|
+
/** Retrieve an add-email session (polling fallback). */
|
|
72
|
+
retrieveEmailAddSession(sessionId: string): Promise<EmailAddSession>;
|
|
73
|
+
/** Retrieve a 2FA session (polling fallback). */
|
|
74
|
+
retrieve2FASession(sessionId: string): Promise<TwoFASession>;
|
|
75
|
+
/**
|
|
76
|
+
* Stream phone-add session status via SSE (`connected` / `update` signals),
|
|
77
|
+
* with a polling fallback that yields the session as `poll` / `terminal`.
|
|
78
|
+
*/
|
|
79
|
+
streamPhoneAddSession(sessionId: string, options?: StreamOptions): AsyncIterable<PhoneAddSessionStreamEvent>;
|
|
80
|
+
/**
|
|
81
|
+
* Stream email-add session status via SSE (`connected` / `update` signals),
|
|
82
|
+
* with a polling fallback that yields the session as `poll` / `terminal`.
|
|
83
|
+
*/
|
|
84
|
+
streamEmailAddSession(sessionId: string, options?: StreamOptions): AsyncIterable<EmailAddSessionStreamEvent>;
|
|
85
|
+
/**
|
|
86
|
+
* Stream 2FA session status via SSE (`connected` / `update` signals), with a
|
|
87
|
+
* polling fallback that yields the session as `poll` / `terminal`.
|
|
88
|
+
*/
|
|
89
|
+
stream2FASession(sessionId: string, options?: StreamOptions): AsyncIterable<TwoFASessionStreamEvent>;
|
|
90
|
+
/** One-call account snapshot: quota + EoM projection, request health, channel stats, HITL counts, active keys. */
|
|
91
|
+
summary(params?: MeEnvironmentParams): Promise<PlatformSummary>;
|
|
92
|
+
/** Prefix-anchored global account search across six resource buckets. */
|
|
93
|
+
search(params: MeSearchParams): Promise<MeSearchResults>;
|
|
94
|
+
/** Retrieve the calling API key's own redacted metadata (agent self-inspection). */
|
|
95
|
+
apiKeySelf(): Promise<ApiKeyMetadata>;
|
|
96
|
+
/**
|
|
97
|
+
* Per-API-key usage counts (verifications/requests/confirmations/authorizations) plus attribution
|
|
98
|
+
* context, for the key and every key it replaced (`api_key.replaced_key_ids`).
|
|
99
|
+
*/
|
|
100
|
+
apiKeyUsage(id: string, params?: MeEnvironmentParams): Promise<ApiKeyUsage>;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=me.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../src/resources/me.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAkB,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,eAAe,EAChB,MAAM,aAAa,CAAC;AAErB,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,4CAA4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
|
4
|
+
* `/me` account-management resources: phone/email add flows and 2FA. All
|
|
5
|
+
* endpoints are JWT-authenticated and scoped to the current user on the
|
|
6
|
+
* backend, so the SDK just forwards the session ID.
|
|
7
|
+
*/
|
|
8
|
+
export class Me {
|
|
9
|
+
constructor(http) {
|
|
10
|
+
this.http = http;
|
|
11
|
+
}
|
|
12
|
+
/** Retrieve an add-phone session (polling fallback). */
|
|
13
|
+
retrievePhoneAddSession(sessionId) {
|
|
14
|
+
return this.http.get(`/api/v1/me/phones/add/${encodeURIComponent(sessionId)}`);
|
|
15
|
+
}
|
|
16
|
+
/** Retrieve an add-email session (polling fallback). */
|
|
17
|
+
retrieveEmailAddSession(sessionId) {
|
|
18
|
+
return this.http.get(`/api/v1/me/emails/add/${encodeURIComponent(sessionId)}`);
|
|
19
|
+
}
|
|
20
|
+
/** Retrieve a 2FA session (polling fallback). */
|
|
21
|
+
retrieve2FASession(sessionId) {
|
|
22
|
+
return this.http.get(`/api/v1/me/2fa/${encodeURIComponent(sessionId)}`);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Stream phone-add session status via SSE (`connected` / `update` signals),
|
|
26
|
+
* with a polling fallback that yields the session as `poll` / `terminal`.
|
|
27
|
+
*/
|
|
28
|
+
streamPhoneAddSession(sessionId, options) {
|
|
29
|
+
return streamEndpoint(this.http, {
|
|
30
|
+
path: `/api/v1/me/phones/add/${encodeURIComponent(sessionId)}/events`,
|
|
31
|
+
retrieve: () => this.retrievePhoneAddSession(sessionId),
|
|
32
|
+
terminalStates: SESSION_TERMINAL_STATES,
|
|
33
|
+
label: `Phone-add session ${sessionId}`,
|
|
34
|
+
}, options);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Stream email-add session status via SSE (`connected` / `update` signals),
|
|
38
|
+
* with a polling fallback that yields the session as `poll` / `terminal`.
|
|
39
|
+
*/
|
|
40
|
+
streamEmailAddSession(sessionId, options) {
|
|
41
|
+
return streamEndpoint(this.http, {
|
|
42
|
+
path: `/api/v1/me/emails/add/${encodeURIComponent(sessionId)}/events`,
|
|
43
|
+
retrieve: () => this.retrieveEmailAddSession(sessionId),
|
|
44
|
+
terminalStates: SESSION_TERMINAL_STATES,
|
|
45
|
+
label: `Email-add session ${sessionId}`,
|
|
46
|
+
}, options);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Stream 2FA session status via SSE (`connected` / `update` signals), with a
|
|
50
|
+
* polling fallback that yields the session as `poll` / `terminal`.
|
|
51
|
+
*/
|
|
52
|
+
stream2FASession(sessionId, options) {
|
|
53
|
+
return streamEndpoint(this.http, {
|
|
54
|
+
path: `/api/v1/me/2fa/${encodeURIComponent(sessionId)}/events`,
|
|
55
|
+
retrieve: () => this.retrieve2FASession(sessionId),
|
|
56
|
+
terminalStates: SESSION_TERMINAL_STATES,
|
|
57
|
+
label: `2FA session ${sessionId}`,
|
|
58
|
+
}, options);
|
|
59
|
+
}
|
|
60
|
+
// --- Dashboard / agent data surface (dual-auth: JWT or API key) ---
|
|
61
|
+
/** One-call account snapshot: quota + EoM projection, request health, channel stats, HITL counts, active keys. */
|
|
62
|
+
summary(params) {
|
|
63
|
+
return this.http.get('/api/v1/me/summary', params);
|
|
64
|
+
}
|
|
65
|
+
/** Prefix-anchored global account search across six resource buckets. */
|
|
66
|
+
search(params) {
|
|
67
|
+
return this.http.get('/api/v1/me/search', params);
|
|
68
|
+
}
|
|
69
|
+
/** Retrieve the calling API key's own redacted metadata (agent self-inspection). */
|
|
70
|
+
apiKeySelf() {
|
|
71
|
+
return this.http.get('/api/v1/me/api-key');
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Per-API-key usage counts (verifications/requests/confirmations/authorizations) plus attribution
|
|
75
|
+
* context, for the key and every key it replaced (`api_key.replaced_key_ids`).
|
|
76
|
+
*/
|
|
77
|
+
apiKeyUsage(id, params) {
|
|
78
|
+
return this.http.get(`/api/v1/me/api-keys/${encodeURIComponent(id)}/usage`, params);
|
|
79
|
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@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { HttpClient } from '../http.js';
|
|
2
|
+
import type { Profile, CreateProfileParams, UpdateProfileParams, ProfileListResponse, ProfileDeleteResponse, ProfileTemplate, ProfileTemplateListResponse, ProfileTemplateUpdateParams, ProfileTemplatePreviewParams, ProfileTemplatePreviewResponse, TemplateChannel, TemplateMessageType } from '../types.js';
|
|
3
|
+
export declare class Profiles {
|
|
4
|
+
private readonly http;
|
|
5
|
+
constructor(http: HttpClient);
|
|
6
|
+
/** List all profiles for the authenticated user */
|
|
7
|
+
list(): Promise<ProfileListResponse>;
|
|
8
|
+
/** Create a new profile */
|
|
9
|
+
create(params?: CreateProfileParams): Promise<Profile>;
|
|
10
|
+
/** Get a profile by ID */
|
|
11
|
+
retrieve(profileId: string): Promise<Profile>;
|
|
12
|
+
/** Update a profile */
|
|
13
|
+
update(profileId: string, params: UpdateProfileParams): Promise<Profile>;
|
|
14
|
+
/** Delete a profile */
|
|
15
|
+
delete(profileId: string): Promise<ProfileDeleteResponse>;
|
|
16
|
+
/** Set a profile as the primary profile */
|
|
17
|
+
setPrimary(profileId: string): Promise<Profile>;
|
|
18
|
+
/**
|
|
19
|
+
* List a profile's message templates (custom and default)
|
|
20
|
+
*
|
|
21
|
+
* @deprecated The server retired this route (410 `endpoint_retired`). Use
|
|
22
|
+
* `templates.list({ profileId })`.
|
|
23
|
+
*/
|
|
24
|
+
listTemplates(profileId: string): Promise<ProfileTemplateListResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Create or update a profile template for a channel/message type
|
|
27
|
+
*
|
|
28
|
+
* @deprecated The server retired this route (410 `endpoint_retired`). Use
|
|
29
|
+
* `templates.upsert(channel, messageType, content, { profileId })`.
|
|
30
|
+
*/
|
|
31
|
+
updateTemplate(profileId: string, channel: TemplateChannel, type: TemplateMessageType, params: ProfileTemplateUpdateParams): Promise<ProfileTemplate>;
|
|
32
|
+
/**
|
|
33
|
+
* Delete a profile template (resets to default)
|
|
34
|
+
*
|
|
35
|
+
* @deprecated The server retired this route (410 `endpoint_retired`). Use
|
|
36
|
+
* `templates.delete(channel, messageType, { profileId })`.
|
|
37
|
+
*/
|
|
38
|
+
deleteTemplate(profileId: string, channel: TemplateChannel, type: TemplateMessageType): Promise<ProfileTemplate>;
|
|
39
|
+
/**
|
|
40
|
+
* Preview a profile template with the profile's branding
|
|
41
|
+
*
|
|
42
|
+
* @deprecated The server retired this route (410 `endpoint_retired`). Use
|
|
43
|
+
* `templates.preview(params, { profileId })`.
|
|
44
|
+
*/
|
|
45
|
+
previewTemplate(profileId: string, params: ProfileTemplatePreviewParams): Promise<ProfileTemplatePreviewResponse>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=profiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../../src/resources/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EACV,OAAO,EACP,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,8BAA8B,EAC9B,eAAe,EACf,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,mDAAmD;IACnD,IAAI,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAIpC,2BAA2B;IAC3B,MAAM,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAItD,0BAA0B;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI7C,uBAAuB;IACvB,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAQxE,uBAAuB;IACvB,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAIzD,2CAA2C;IAC3C,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI/C;;;;;OAKG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAMtE;;;;;OAKG;IACH,cAAc,CACZ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,mBAAmB,EACzB,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,eAAe,CAAC;IAO3B;;;;;OAKG;IACH,cAAc,CACZ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,eAAe,CAAC;IAM3B;;;;;OAKG;IACH,eAAe,CACb,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,8BAA8B,CAAC;CAM3C"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export class Profiles {
|
|
2
|
+
constructor(http) {
|
|
3
|
+
this.http = http;
|
|
4
|
+
}
|
|
5
|
+
/** List all profiles for the authenticated user */
|
|
6
|
+
list() {
|
|
7
|
+
return this.http.get('/api/v1/me/profiles');
|
|
8
|
+
}
|
|
9
|
+
/** Create a new profile */
|
|
10
|
+
create(params) {
|
|
11
|
+
return this.http.post('/api/v1/me/profiles', params);
|
|
12
|
+
}
|
|
13
|
+
/** Get a profile by ID */
|
|
14
|
+
retrieve(profileId) {
|
|
15
|
+
return this.http.get(`/api/v1/me/profiles/${encodeURIComponent(profileId)}`);
|
|
16
|
+
}
|
|
17
|
+
/** Update a profile */
|
|
18
|
+
update(profileId, params) {
|
|
19
|
+
return this.http.request('PATCH', `/api/v1/me/profiles/${encodeURIComponent(profileId)}`, { body: params });
|
|
20
|
+
}
|
|
21
|
+
/** Delete a profile */
|
|
22
|
+
delete(profileId) {
|
|
23
|
+
return this.http.del(`/api/v1/me/profiles/${encodeURIComponent(profileId)}`);
|
|
24
|
+
}
|
|
25
|
+
/** Set a profile as the primary profile */
|
|
26
|
+
setPrimary(profileId) {
|
|
27
|
+
return this.http.post(`/api/v1/me/profiles/${encodeURIComponent(profileId)}/primary`);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* List a profile's message templates (custom and default)
|
|
31
|
+
*
|
|
32
|
+
* @deprecated The server retired this route (410 `endpoint_retired`). Use
|
|
33
|
+
* `templates.list({ profileId })`.
|
|
34
|
+
*/
|
|
35
|
+
listTemplates(profileId) {
|
|
36
|
+
return this.http.get(`/api/v1/me/profiles/${encodeURIComponent(profileId)}/templates`);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Create or update a profile template for a channel/message type
|
|
40
|
+
*
|
|
41
|
+
* @deprecated The server retired this route (410 `endpoint_retired`). Use
|
|
42
|
+
* `templates.upsert(channel, messageType, content, { profileId })`.
|
|
43
|
+
*/
|
|
44
|
+
updateTemplate(profileId, channel, type, params) {
|
|
45
|
+
return this.http.put(`/api/v1/me/profiles/${encodeURIComponent(profileId)}/templates/${encodeURIComponent(channel)}/${encodeURIComponent(type)}`, params);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Delete a profile template (resets to default)
|
|
49
|
+
*
|
|
50
|
+
* @deprecated The server retired this route (410 `endpoint_retired`). Use
|
|
51
|
+
* `templates.delete(channel, messageType, { profileId })`.
|
|
52
|
+
*/
|
|
53
|
+
deleteTemplate(profileId, channel, type) {
|
|
54
|
+
return this.http.del(`/api/v1/me/profiles/${encodeURIComponent(profileId)}/templates/${encodeURIComponent(channel)}/${encodeURIComponent(type)}`);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Preview a profile template with the profile's branding
|
|
58
|
+
*
|
|
59
|
+
* @deprecated The server retired this route (410 `endpoint_retired`). Use
|
|
60
|
+
* `templates.preview(params, { profileId })`.
|
|
61
|
+
*/
|
|
62
|
+
previewTemplate(profileId, params) {
|
|
63
|
+
return this.http.post(`/api/v1/me/profiles/${encodeURIComponent(profileId)}/templates/preview`, params);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=profiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../../src/resources/profiles.ts"],"names":[],"mappings":"AAgBA,MAAM,OAAO,QAAQ;IACnB,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,mDAAmD;IACnD,IAAI;QACF,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAsB,qBAAqB,CAAC,CAAC;IACnE,CAAC;IAED,2BAA2B;IAC3B,MAAM,CAAC,MAA4B;QACjC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAU,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAChE,CAAC;IAED,0BAA0B;IAC1B,QAAQ,CAAC,SAAiB;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAU,uBAAuB,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACxF,CAAC;IAED,uBAAuB;IACvB,MAAM,CAAC,SAAiB,EAAE,MAA2B;QACnD,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CACtB,OAAO,EACP,uBAAuB,kBAAkB,CAAC,SAAS,CAAC,EAAE,EACtD,EAAE,IAAI,EAAE,MAAM,EAAE,CACjB,CAAC;IACJ,CAAC;IAED,uBAAuB;IACvB,MAAM,CAAC,SAAiB;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAwB,uBAAuB,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACtG,CAAC;IAED,2CAA2C;IAC3C,UAAU,CAAC,SAAiB;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAU,uBAAuB,kBAAkB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACjG,CAAC;IAED;;;;;OAKG;IACH,aAAa,CAAC,SAAiB;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,uBAAuB,kBAAkB,CAAC,SAAS,CAAC,YAAY,CACjE,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,cAAc,CACZ,SAAiB,EACjB,OAAwB,EACxB,IAAyB,EACzB,MAAmC;QAEnC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,uBAAuB,kBAAkB,CAAC,SAAS,CAAC,cAAc,kBAAkB,CAAC,OAAO,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAC3H,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,cAAc,CACZ,SAAiB,EACjB,OAAwB,EACxB,IAAyB;QAEzB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,uBAAuB,kBAAkB,CAAC,SAAS,CAAC,cAAc,kBAAkB,CAAC,OAAO,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAC5H,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,eAAe,CACb,SAAiB,EACjB,MAAoC;QAEpC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CACnB,uBAAuB,kBAAkB,CAAC,SAAS,CAAC,oBAAoB,EACxE,MAAM,CACP,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { HttpClient } from '../http.js';
|
|
2
|
+
/** Channel a Proof-Me identity challenge can run on. */
|
|
3
|
+
export type ProofMeChannel = 'telegram' | 'whatsapp';
|
|
4
|
+
export interface CreateIdentityChallengeParams {
|
|
5
|
+
circle_id: string;
|
|
6
|
+
member_id: string;
|
|
7
|
+
/** Channel the suspicious contact reached the member on; defaults to the member's channel. */
|
|
8
|
+
suspicious_channel?: ProofMeChannel;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The one status every read reports: `cancelled` — whoever started the check withdrew it; `failed` — it
|
|
13
|
+
* could not be delivered; `expired` — nobody answered; `revoked` / `suspended` — the confirmation's
|
|
14
|
+
* proof was revoked or suspended, or (`revoked` only) the member being checked was removed while the
|
|
15
|
+
* check was pending.
|
|
16
|
+
*/
|
|
17
|
+
export type IdentityChallengeStatus = 'pending' | 'confirmed' | 'denied' | 'cancelled' | 'failed' | 'expired' | 'revoked' | 'suspended';
|
|
18
|
+
export interface IdentityChallenge {
|
|
19
|
+
id: string;
|
|
20
|
+
status: IdentityChallengeStatus;
|
|
21
|
+
confirm_channel?: string;
|
|
22
|
+
channel?: string;
|
|
23
|
+
single_channel_warning?: boolean;
|
|
24
|
+
circle_id?: string | null;
|
|
25
|
+
is_drill?: boolean;
|
|
26
|
+
/** Public handle of the decision's proof — what `proofs.revoke(proof_id)` takes. */
|
|
27
|
+
proof_id?: string | null;
|
|
28
|
+
proof_token?: string | null;
|
|
29
|
+
created_at?: string;
|
|
30
|
+
resolved_at?: string | null;
|
|
31
|
+
expires_at?: string;
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Proof-Me — anti-impersonation reverse verification. A Circle member can trigger a
|
|
36
|
+
* cross-channel CONFIRM (identity challenge) so the account holder approves on a
|
|
37
|
+
* different channel than the suspicious contact reached them on. Member enrollment
|
|
38
|
+
* and drills live on the `circles` resource (the Circle people-primitive).
|
|
39
|
+
*/
|
|
40
|
+
export declare class ProofMe {
|
|
41
|
+
private readonly http;
|
|
42
|
+
constructor(http: HttpClient);
|
|
43
|
+
/** Create a cross-channel identity challenge (CONFIRM) for an enrolled Circle member. */
|
|
44
|
+
createIdentityChallenge(params: CreateIdentityChallengeParams): Promise<IdentityChallenge>;
|
|
45
|
+
/** Get an identity challenge by ID (poll for resolution). */
|
|
46
|
+
getIdentityChallenge(id: string): Promise<IdentityChallenge>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=proof-me.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proof-me.d.ts","sourceRoot":"","sources":["../../../src/resources/proof-me.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,wDAAwD;AACxD,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,UAAU,CAAC;AAErD,MAAM,WAAW,6BAA6B;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,8FAA8F;IAC9F,kBAAkB,CAAC,EAAE,cAAc,CAAC;IACpC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,GAC/B,SAAS,GACT,WAAW,GACX,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,SAAS,GACT,SAAS,GACT,WAAW,CAAC;AAEhB,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,uBAAuB,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oFAAoF;IACpF,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;GAKG;AACH,qBAAa,OAAO;IACN,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAE7C,yFAAyF;IACzF,uBAAuB,CAAC,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAI1F,6DAA6D;IAC7D,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAK7D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proof-Me — anti-impersonation reverse verification. A Circle member can trigger a
|
|
3
|
+
* cross-channel CONFIRM (identity challenge) so the account holder approves on a
|
|
4
|
+
* different channel than the suspicious contact reached them on. Member enrollment
|
|
5
|
+
* and drills live on the `circles` resource (the Circle people-primitive).
|
|
6
|
+
*/
|
|
7
|
+
export class ProofMe {
|
|
8
|
+
constructor(http) {
|
|
9
|
+
this.http = http;
|
|
10
|
+
}
|
|
11
|
+
/** Create a cross-channel identity challenge (CONFIRM) for an enrolled Circle member. */
|
|
12
|
+
createIdentityChallenge(params) {
|
|
13
|
+
return this.http.post('/api/v1/identity-challenges', params);
|
|
14
|
+
}
|
|
15
|
+
/** Get an identity challenge by ID (poll for resolution). */
|
|
16
|
+
getIdentityChallenge(id) {
|
|
17
|
+
return this.http.get(`/api/v1/identity-challenges/${encodeURIComponent(id)}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=proof-me.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proof-me.js","sourceRoot":"","sources":["../../../src/resources/proof-me.ts"],"names":[],"mappings":"AA8CA;;;;;GAKG;AACH,MAAM,OAAO,OAAO;IAClB,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;IAAG,CAAC;IAEjD,yFAAyF;IACzF,uBAAuB,CAAC,MAAqC;QAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAoB,6BAA6B,EAAE,MAAM,CAAC,CAAC;IAClF,CAAC;IAED,6DAA6D;IAC7D,oBAAoB,CAAC,EAAU;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,+BAA+B,kBAAkB,CAAC,EAAE,CAAC,EAAE,CACxD,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type HttpClient } from '../http.js';
|
|
2
|
+
import type { ProofStatus, ProofValidation, RevocationList, RevokeResponse, OfflineVerificationOptions, OfflineVerificationResult } from '../types.js';
|
|
3
|
+
export declare class Proofs {
|
|
4
|
+
private readonly http;
|
|
5
|
+
private readonly keySet;
|
|
6
|
+
/** The last status list read, reusable until the issuer's own `ttl`/`exp` runs out. */
|
|
7
|
+
private statusListCache;
|
|
8
|
+
constructor(http: HttpClient, options?: {
|
|
9
|
+
maxJwksAgeMs?: number;
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Validate a proof token online (checks revocation status).
|
|
13
|
+
*
|
|
14
|
+
* Pass `identifier` to also bind the proof to the identifier you expect it to be about: a
|
|
15
|
+
* proof about anything else answers `valid: false` with reason `identifier_mismatch`, and a
|
|
16
|
+
* proof of an encrypted decision — whose hash is over ciphertext — answers
|
|
17
|
+
* `identifier_unverifiable`. For a proof about a verified identifier any format is accepted
|
|
18
|
+
* and canonicalized as it was at issuance; a proof of an approval decision binds only on the
|
|
19
|
+
* exact recipient value it was issued for.
|
|
20
|
+
*/
|
|
21
|
+
validate(proofToken: string, identifier?: string): Promise<ProofValidation>;
|
|
22
|
+
/**
|
|
23
|
+
* Revoke a proof by public handle (`ph_ctl_*`/`ph_dlg_*`) or verification id.
|
|
24
|
+
*
|
|
25
|
+
* Revoking a PROOF does not withdraw the asset, consent or delegation it is about — those have
|
|
26
|
+
* their own surfaces.
|
|
27
|
+
*/
|
|
28
|
+
revoke(id: string, reason?: string): Promise<RevokeResponse>;
|
|
29
|
+
/** Get the status of a proof by public handle (`ph_ctl_*`/`ph_dlg_*`) or verification id. A live proof reads `active`. */
|
|
30
|
+
status(id: string): Promise<ProofStatus>;
|
|
31
|
+
/** Get the revocation list */
|
|
32
|
+
listRevoked(): Promise<RevocationList>;
|
|
33
|
+
/**
|
|
34
|
+
* Verify a proof token without calling the Proof API with your key.
|
|
35
|
+
*
|
|
36
|
+
* Two public documents are read, both cacheable and neither revealing which proof you are
|
|
37
|
+
* checking: the JWKS (for the signature) and the issuer's Token Status List (for revocation).
|
|
38
|
+
*
|
|
39
|
+
* By default the proof's status-list slot IS checked, so a revoked or suspended proof answers
|
|
40
|
+
* `valid: false` with `reason` `revoked`/`suspended`. A list that cannot be read — unreachable,
|
|
41
|
+
* failing its own checks, or not covering this slot — answers `status_unavailable`: the refusal
|
|
42
|
+
* to guess, not a claim that the proof is withdrawn. A token carrying no slot at all stays
|
|
43
|
+
* valid with `revocation_checked: false`, which is exactly what the issuer's own
|
|
44
|
+
* `POST /proofs/validate` answers for it.
|
|
45
|
+
*
|
|
46
|
+
* Pass `{ checkRevocation: false }` to check the signature alone; the result then reports
|
|
47
|
+
* `revocation_checked: false`.
|
|
48
|
+
*
|
|
49
|
+
* The key set follows the issuer's key-rotation rules (`sdks/shared/fixtures/jwks_rotation/`): a
|
|
50
|
+
* key the issuer revoked answers `key_revoked` with a `pull_hint` naming where a re-issued token
|
|
51
|
+
* can be fetched; a key set that could not be refreshed for longer than `maxJwksAgeMs` answers
|
|
52
|
+
* `jwks_stale` with its `cache_age_seconds`; a key of another family, a token signed outside its
|
|
53
|
+
* key's window or living longer than the key allows answer `wrong_key_purpose`,
|
|
54
|
+
* `outside_key_window` and `token_lifetime_exceeded`; a `kid` the issuer does not publish answers
|
|
55
|
+
* `unknown_key`. A key set that could not be read at all answers `status_unavailable`.
|
|
56
|
+
*/
|
|
57
|
+
verifyOffline(token: string, options?: OfflineVerificationOptions): Promise<OfflineVerificationResult>;
|
|
58
|
+
/**
|
|
59
|
+
* Make the next verification refetch the key set, ignoring its 10-minute reuse window and the
|
|
60
|
+
* 30-second cooldowns, and drop the cached status list. A successful refetch resets the key
|
|
61
|
+
* set's age — the remedy a `jwks_stale` answer names. What the verifier knows is kept: key
|
|
62
|
+
* confirmations and tombstones survive (`clearTombstones()` is the separate, deliberate reset).
|
|
63
|
+
*/
|
|
64
|
+
refreshJWKS(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Forget every revoked-key tombstone this client has applied or is waiting to confirm. They are
|
|
67
|
+
* held in memory only — a restart forgets them too — and otherwise kept until a year after the
|
|
68
|
+
* revocation, whatever later key sets say.
|
|
69
|
+
*/
|
|
70
|
+
clearTombstones(): void;
|
|
71
|
+
/**
|
|
72
|
+
* The signature against the issuer's key set, then the window and lifetime of the key that made
|
|
73
|
+
* it, then the token's own claims — so a forgery reads as a bad signature, never as a policy
|
|
74
|
+
* violation of a key it did not come from, and a policy violation outranks an expired token.
|
|
75
|
+
*/
|
|
76
|
+
private verifyAgainstKeySet;
|
|
77
|
+
/** Resolve one token's slot against the issuer's signed status list. */
|
|
78
|
+
private checkStatusList;
|
|
79
|
+
private loadStatusList;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=proofs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proofs.d.ts","sourceRoot":"","sources":["../../../src/resources/proofs.ts"],"names":[],"mappings":"AAUA,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAUzD,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EAEd,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,aAAa,CAAC;AAwFrB,qBAAa,MAAM;IAOf,OAAO,CAAC,QAAQ,CAAC,IAAI;IANvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,uFAAuF;IACvF,OAAO,CAAC,eAAe,CAChB;gBAGY,IAAI,EAAE,UAAU,EACjC,OAAO,GAAE;QAAE,YAAY,C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