@reclaimprotocol/client 0.1.0-dev.1 → 0.1.0-dev.2
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 +256 -0
- package/lib/attestor-proof.d.ts +16 -0
- package/lib/attestor-proof.js +121 -0
- package/lib/canonical.d.ts +1 -0
- package/lib/canonical.js +18 -0
- package/lib/eip712.d.ts +20 -0
- package/lib/eip712.js +108 -0
- package/lib/enckeys.d.ts +33 -0
- package/lib/enckeys.js +14 -0
- package/lib/encoding.d.ts +11 -0
- package/lib/encoding.js +34 -0
- package/lib/index.d.ts +11 -3
- package/lib/index.js +10 -2
- package/lib/jwks.d.ts +26 -0
- package/lib/jwks.js +63 -0
- package/lib/keypair.d.ts +12 -0
- package/lib/keypair.js +18 -17
- package/lib/reclaim.d.ts +128 -0
- package/lib/reclaim.js +155 -0
- package/lib/result.d.ts +132 -0
- package/lib/result.js +298 -0
- package/lib/routes.gen.d.ts +121 -21
- package/lib/routes.gen.js +32 -7
- package/lib/secp.d.ts +6 -0
- package/lib/secp.js +21 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.js +1 -0
- package/lib/types/openapi.d.ts +18 -1
- package/lib/types/openapi.gen.d.ts +2657 -1148
- package/package.json +14 -5
- package/src/attestor-proof.ts +148 -0
- package/src/canonical.ts +20 -0
- package/src/enckeys.ts +46 -0
- package/src/encoding.ts +39 -0
- package/src/index.ts +60 -2
- package/src/jwks.ts +86 -0
- package/src/keypair.ts +22 -20
- package/src/reclaim.ts +332 -0
- package/src/result.ts +448 -0
- package/src/routes.gen.ts +32 -7
- package/src/secp.ts +24 -0
- package/src/types/index.ts +1 -1
- package/src/types/openapi.gen.ts +2657 -1148
- package/src/types/openapi.ts +48 -18
package/src/types/openapi.ts
CHANGED
|
@@ -2,13 +2,13 @@ import type { components, operations } from './openapi.gen.ts'
|
|
|
2
2
|
|
|
3
3
|
export type IOperationId = keyof operations
|
|
4
4
|
|
|
5
|
-
type RequestBodyContent<T> = T extends {
|
|
5
|
+
export type RequestBodyContent<T> = T extends {
|
|
6
6
|
content: { 'application/json': infer R }
|
|
7
7
|
}
|
|
8
8
|
? R
|
|
9
9
|
: T extends { content: { 'application/x-www-form-urlencoded': infer R } }
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
? R
|
|
11
|
+
: undefined
|
|
12
12
|
|
|
13
13
|
export type IJsonRequestBody<T extends IOperationId> = operations[T] extends {
|
|
14
14
|
requestBody?: infer B
|
|
@@ -21,10 +21,10 @@ type AnySuccess<R> = R extends {
|
|
|
21
21
|
}
|
|
22
22
|
? J
|
|
23
23
|
: R extends { 201: { content: { 'application/json': infer J } } }
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
? J
|
|
25
|
+
: R extends { 204: unknown }
|
|
26
|
+
? void
|
|
27
|
+
: unknown
|
|
28
28
|
|
|
29
29
|
export type IJsonResponseBody<T extends IOperationId> = operations[T] extends {
|
|
30
30
|
responses: infer R
|
|
@@ -61,20 +61,50 @@ export type IOperationArgs<T extends IOperationId> = {
|
|
|
61
61
|
body?: IJsonRequestBody<T> | undefined
|
|
62
62
|
headers?: IHeaders<T> | undefined
|
|
63
63
|
} & (
|
|
64
|
-
|
|
65
|
-
) & (
|
|
66
|
-
|
|
67
|
-
) & (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
) & (
|
|
72
|
-
|
|
73
|
-
)
|
|
64
|
+
[IParams<T>] extends [undefined] ? unknown : { params: IParams<T> }
|
|
65
|
+
) & (
|
|
66
|
+
[IQuery<T>] extends [undefined] ? unknown : { query: IQuery<T> }
|
|
67
|
+
) & (
|
|
68
|
+
[IJsonRequestBody<T>] extends [undefined]
|
|
69
|
+
? unknown
|
|
70
|
+
: { body: IJsonRequestBody<T> }
|
|
71
|
+
) & (
|
|
72
|
+
[IHeaders<T>] extends [undefined] ? unknown : { headers: IHeaders<T> }
|
|
73
|
+
)
|
|
74
74
|
|
|
75
75
|
export type IOperationResponse<T extends IOperationId> = IJsonResponseBody<T>
|
|
76
76
|
|
|
77
77
|
// RFC 9457 — Problem Details for HTTP APIs.
|
|
78
78
|
export type ProblemDetails = components['schemas']['Problem'] & {
|
|
79
79
|
[key: string]: unknown
|
|
80
|
-
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Consumer-facing schema types, re-exported so SDK users import them from
|
|
83
|
+
// `@reclaimprotocol/client` instead of reaching into the generated file.
|
|
84
|
+
export type VerificationSession =
|
|
85
|
+
components['schemas']['VerificationSession']
|
|
86
|
+
export type VerificationStatus = components['schemas']['VerificationStatus']
|
|
87
|
+
export type VerificationEventRecord =
|
|
88
|
+
components['schemas']['VerificationEventRecord']
|
|
89
|
+
export type CallbackSubscription =
|
|
90
|
+
components['schemas']['CallbackSubscription']
|
|
91
|
+
export type CallbackDeliveryStatus =
|
|
92
|
+
components['schemas']['CallbackDeliveryStatus']
|
|
93
|
+
export type VerificationResultDelivery =
|
|
94
|
+
components['schemas']['VerificationResultDelivery']
|
|
95
|
+
// (`Jws` is intentionally NOT re-exported here — `result.ts` exports the
|
|
96
|
+
// canonical hand-written Jws type the SDK helpers operate on.)
|
|
97
|
+
export type ProviderRequiredContext =
|
|
98
|
+
components['schemas']['ProviderRequiredContext']
|
|
99
|
+
export type Provider = components['schemas']['Provider']
|
|
100
|
+
export type ProviderVersion = components['schemas']['ProviderVersion']
|
|
101
|
+
export type OrgCredential = components['schemas']['OrgCredential']
|
|
102
|
+
export type JwkX25519Public = components['schemas']['JwkX25519Public']
|
|
103
|
+
export type OrgToken = components['schemas']['OrgToken']
|
|
104
|
+
export type OrgTokenMeta = components['schemas']['OrgTokenMeta']
|
|
105
|
+
export type Organization = components['schemas']['Organization']
|
|
106
|
+
export type CredentialAttachSession =
|
|
107
|
+
components['schemas']['CredentialAttachSession']
|
|
108
|
+
export type CreateProviderVersionRequest =
|
|
109
|
+
components['schemas']['CreateProviderVersionRequest']
|
|
110
|
+
export type ProviderVersionRef = components['schemas']['ProviderVersionRef']
|