@nexeraid/identity-schemas 2.164.0-dev → 2.165.0-dev
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/dist/declarations/src/providers/index.d.ts +1 -0
- package/dist/declarations/src/providers/index.d.ts.map +1 -1
- package/dist/declarations/src/providers/trm-labs/trm.schema.d.ts +358 -0
- package/dist/declarations/src/providers/trm-labs/trm.schema.d.ts.map +1 -0
- package/dist/{identity-api.schema-073b77e8.cjs.dev.cjs → identity-api.schema-9a1b028a.cjs.dev.cjs} +446 -446
- package/dist/{identity-api.schema-b0cdf833.cjs.prod.cjs → identity-api.schema-a6843fb9.cjs.prod.cjs} +446 -446
- package/dist/nexeraid-identity-schemas.cjs.dev.cjs +59 -59
- package/dist/nexeraid-identity-schemas.cjs.prod.cjs +59 -59
- package/dist/package.json +1 -1
- package/dist/{tfhe-utilities-f68d3b85.cjs.prod.cjs → tfhe-utilities-2ff3b3c1.cjs.prod.cjs} +2 -2
- package/dist/{tfhe-utilities-7506bbe3.cjs.dev.cjs → tfhe-utilities-5af6eb2a.cjs.dev.cjs} +2 -2
- package/dist/{toArray-d4a6f7df.cjs.dev.cjs → toArray-96f8cc3a.cjs.dev.cjs} +1 -1
- package/dist/{toArray-19bbf25f.cjs.prod.cjs → toArray-f5e38cce.cjs.prod.cjs} +1 -1
- package/dist/{CoinMarketCap.schema-ab71ee5f.cjs.prod.cjs → trm.schema-2ae40855.cjs.prod.cjs} +1276 -1207
- package/dist/{CoinMarketCap.schema-0c52a356.cjs.dev.cjs → trm.schema-4556df89.cjs.dev.cjs} +1276 -1207
- package/dist/{CoinMarketCap.schema-71fcc409.esm.mjs → trm.schema-d593fe86.esm.mjs} +62 -2
- package/dist/{vault.schema-68148c82.cjs.dev.cjs → vault.schema-6368506b.cjs.dev.cjs} +1268 -1268
- package/dist/{vault.schema-83220a2a.cjs.prod.cjs → vault.schema-b41992ec.cjs.prod.cjs} +1268 -1268
- package/dist/{zod-utils-22ad76a6.cjs.prod.cjs → zod-utils-46b101c1.cjs.prod.cjs} +12 -12
- package/dist/{zod-utils-373653ad.cjs.dev.cjs → zod-utils-4e3fa4df.cjs.dev.cjs} +12 -12
- package/identity/dist/nexeraid-identity-schemas-identity.cjs.dev.cjs +2 -2
- package/identity/dist/nexeraid-identity-schemas-identity.cjs.prod.cjs +2 -2
- package/package.json +1 -1
- package/providers/dist/nexeraid-identity-schemas-providers.cjs.dev.cjs +294 -289
- package/providers/dist/nexeraid-identity-schemas-providers.cjs.prod.cjs +294 -289
- package/providers/dist/nexeraid-identity-schemas-providers.esm.mjs +1 -1
- package/vault/dist/nexeraid-identity-schemas-vault.cjs.dev.cjs +3 -3
- package/vault/dist/nexeraid-identity-schemas-vault.cjs.prod.cjs +3 -3
- package/verifiable-credentials/dist/nexeraid-identity-schemas-verifiable-credentials.cjs.dev.cjs +3 -3
- package/verifiable-credentials/dist/nexeraid-identity-schemas-verifiable-credentials.cjs.prod.cjs +3 -3
- package/webhooks/dist/nexeraid-identity-schemas-webhooks.cjs.dev.cjs +484 -484
- package/webhooks/dist/nexeraid-identity-schemas-webhooks.cjs.prod.cjs +484 -484
- package/webhooks/dist/nexeraid-identity-schemas-webhooks.esm.mjs +1 -1
package/dist/{identity-api.schema-073b77e8.cjs.dev.cjs → identity-api.schema-9a1b028a.cjs.dev.cjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var vault_schema = require('./vault.schema-
|
|
3
|
+
var z = require('zod');
|
|
4
|
+
var vault_schema = require('./vault.schema-6368506b.cjs.dev.cjs');
|
|
5
5
|
|
|
6
6
|
var CredentialSchemas = {
|
|
7
7
|
ProofOfResidence: vault_schema.ProofOfResidenceCredentialSubjectSchema,
|
|
@@ -42,24 +42,24 @@ var CredentialTypes = ["AMLScreeningsResults", "ProofOfResidence", "SelfieImage"
|
|
|
42
42
|
// this is for backwards compatibility
|
|
43
43
|
"IDScanPassport" // this is for backwards compatibility
|
|
44
44
|
];
|
|
45
|
-
var NexeraCredentialType =
|
|
45
|
+
var NexeraCredentialType = z.z["enum"](CredentialTypes);
|
|
46
46
|
var getCredentialName = function getCredentialName(value) {
|
|
47
47
|
var _CredentialNames$find;
|
|
48
48
|
return (_CredentialNames$find = CredentialNames.find(function (obj) {
|
|
49
49
|
return obj.value === value;
|
|
50
50
|
})) === null || _CredentialNames$find === void 0 ? void 0 : _CredentialNames$find.label;
|
|
51
51
|
};
|
|
52
|
-
var CredentialType =
|
|
52
|
+
var CredentialType = z.z.string().transform(function (x) {
|
|
53
53
|
return x.replace("_", "-");
|
|
54
54
|
}) // TODO determine why this is needed
|
|
55
|
-
.pipe(
|
|
55
|
+
.pipe(z.z["enum"](CredentialTypes));
|
|
56
56
|
// Should this be replaced by GenericVerifiableCredentialSchema?
|
|
57
57
|
|
|
58
|
-
var VerifiableCredential =
|
|
59
|
-
issuer:
|
|
60
|
-
type:
|
|
61
|
-
credentialSubject:
|
|
62
|
-
}).catchall(
|
|
58
|
+
var VerifiableCredential = z.z.object({
|
|
59
|
+
issuer: z.z.string(),
|
|
60
|
+
type: z.z.array(z.z.union([z.z.string(), CredentialType])),
|
|
61
|
+
credentialSubject: z.z.record(z.z.unknown())
|
|
62
|
+
}).catchall(z.z.any());
|
|
63
63
|
var CredentialMediaType = vault_schema.IDImageCredentialSubjectSchema.shape.mediaType_front;
|
|
64
64
|
|
|
65
65
|
// Request
|
|
@@ -70,14 +70,14 @@ var MediaType = /*#__PURE__*/function (MediaType) {
|
|
|
70
70
|
MediaType["SignedMessage"] = "application/iden3comm-signed-json";
|
|
71
71
|
return MediaType;
|
|
72
72
|
}({});
|
|
73
|
-
var MediaTypePID =
|
|
73
|
+
var MediaTypePID = z.z.nativeEnum(MediaType);
|
|
74
74
|
var CIRCUIT_IDS = ["authV2", "stateTransition", "credentialAtomicQueryMTPV2", "credentialAtomicQueryMTPV2OnChain", "credentialAtomicQuerySigV2", "credentialAtomicQuerySigV2OnChain", "credentialAtomicQueryV3-beta.1", "credentialAtomicQueryV3OnChain-beta.1", "linkedMultiQuery10-beta.1"];
|
|
75
|
-
var CircuitId =
|
|
76
|
-
var ZeroKnowledgeProofRequest =
|
|
77
|
-
id:
|
|
78
|
-
circuitId:
|
|
79
|
-
optional:
|
|
80
|
-
query:
|
|
75
|
+
var CircuitId = z.z["enum"](CIRCUIT_IDS);
|
|
76
|
+
var ZeroKnowledgeProofRequest = z.z.object({
|
|
77
|
+
id: z.z.number().or(z.z.string()),
|
|
78
|
+
circuitId: z.z.string(),
|
|
79
|
+
optional: z.z["boolean"]().optional(),
|
|
80
|
+
query: z.z.record(z.z.string(), z.z.any())
|
|
81
81
|
});
|
|
82
82
|
var AUTHORIZATION_REQUEST_MESSAGE_TYPES = {
|
|
83
83
|
AUTHORIZATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/authorization/1.0/request",
|
|
@@ -102,78 +102,78 @@ var AUTHORIZATION_REQUEST_MESSAGE_TYPES = {
|
|
|
102
102
|
PAYMENT_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/payment"
|
|
103
103
|
};
|
|
104
104
|
var AuthorizationRequestMessageTypes = ["https://iden3-communication.io/authorization/1.0/request", "https://iden3-communication.io/authorization/1.0/response", "https://iden3-communication.io/credentials/1.0/issuance-request", "https://iden3-communication.io/credentials/1.0/fetch-request", "https://iden3-communication.io/credentials/1.0/offer", "https://iden3-communication.io/credentials/1.0/issuance-response", "https://iden3-communication.io/credentials/1.0/refresh", "https://iden3-communication.io/devices/1.0/registration", "https://iden3-communication.io/messages/1.0/fetch", "https://iden3-communication.io/proofs/1.0/request", "https://iden3-communication.io/proofs/1.0/response", "https://iden3-communication.io/revocation/1.0/request-status", "https://iden3-communication.io/revocation/1.0/status", "https://iden3-communication.io/proofs/1.0/contract-invoke-request", "https://iden3-communication.io/proofs/1.0/contract-invoke-response", "https://iden3-communication.io/credentials/1.0/onchain-offer", "https://iden3-communication.io/credentials/0.1/proposal-request", "https://iden3-communication.io/credentials/0.1/proposal", "https://iden3-communication.io/credentials/0.1/payment-request", "https://iden3-communication.io/credentials/0.1/payment"];
|
|
105
|
-
var AuthorizationRequestMessageType =
|
|
106
|
-
var AuthorizationRequestMessage =
|
|
107
|
-
id:
|
|
105
|
+
var AuthorizationRequestMessageType = z.z["enum"](AuthorizationRequestMessageTypes);
|
|
106
|
+
var AuthorizationRequestMessage = z.z.object({
|
|
107
|
+
id: z.z.string(),
|
|
108
108
|
typ: MediaTypePID.optional(),
|
|
109
109
|
type: AuthorizationRequestMessageType,
|
|
110
|
-
thid:
|
|
111
|
-
body:
|
|
112
|
-
callbackUrl:
|
|
113
|
-
reason:
|
|
114
|
-
did_doc:
|
|
115
|
-
message:
|
|
116
|
-
scope:
|
|
110
|
+
thid: z.z.string().optional(),
|
|
111
|
+
body: z.z.object({
|
|
112
|
+
callbackUrl: z.z.string(),
|
|
113
|
+
reason: z.z.string().optional(),
|
|
114
|
+
did_doc: z.z.any().optional(),
|
|
115
|
+
message: z.z.string().optional(),
|
|
116
|
+
scope: z.z.array(ZeroKnowledgeProofRequest)
|
|
117
117
|
}),
|
|
118
|
-
from:
|
|
119
|
-
to:
|
|
118
|
+
from: z.z.string(),
|
|
119
|
+
to: z.z.string().optional()
|
|
120
120
|
});
|
|
121
121
|
// Response
|
|
122
|
-
var ProofData =
|
|
123
|
-
pi_a:
|
|
124
|
-
pi_b:
|
|
125
|
-
pi_c:
|
|
126
|
-
protocol:
|
|
127
|
-
curve:
|
|
128
|
-
});
|
|
129
|
-
var ZeroKnowledgeProofResponse =
|
|
130
|
-
id:
|
|
131
|
-
circuitId:
|
|
132
|
-
vp:
|
|
122
|
+
var ProofData = z.z.object({
|
|
123
|
+
pi_a: z.z.array(z.z.string()),
|
|
124
|
+
pi_b: z.z.array(z.z.array(z.z.string())),
|
|
125
|
+
pi_c: z.z.array(z.z.string()),
|
|
126
|
+
protocol: z.z.string(),
|
|
127
|
+
curve: z.z.string().optional()
|
|
128
|
+
});
|
|
129
|
+
var ZeroKnowledgeProofResponse = z.z.object({
|
|
130
|
+
id: z.z.number(),
|
|
131
|
+
circuitId: z.z.string(),
|
|
132
|
+
vp: z.z.any().optional(),
|
|
133
133
|
proof: ProofData,
|
|
134
|
-
pub_signals:
|
|
134
|
+
pub_signals: z.z.array(z.z.string())
|
|
135
135
|
});
|
|
136
|
-
var AuthorizationResponseMessage =
|
|
137
|
-
id:
|
|
136
|
+
var AuthorizationResponseMessage = z.z.object({
|
|
137
|
+
id: z.z.string(),
|
|
138
138
|
typ: MediaTypePID.optional(),
|
|
139
|
-
type:
|
|
140
|
-
thid:
|
|
141
|
-
body:
|
|
142
|
-
did_doc:
|
|
143
|
-
message:
|
|
144
|
-
scope:
|
|
139
|
+
type: z.z.string(),
|
|
140
|
+
thid: z.z.string().optional(),
|
|
141
|
+
body: z.z.object({
|
|
142
|
+
did_doc: z.z.any().optional(),
|
|
143
|
+
message: z.z.string().optional(),
|
|
144
|
+
scope: z.z.array(ZeroKnowledgeProofResponse)
|
|
145
145
|
}),
|
|
146
|
-
from:
|
|
147
|
-
to:
|
|
146
|
+
from: z.z.string().optional(),
|
|
147
|
+
to: z.z.string().optional()
|
|
148
148
|
});
|
|
149
149
|
// Polygon Wallet
|
|
150
|
-
var CredentialQrCodeData =
|
|
151
|
-
id:
|
|
152
|
-
typ:
|
|
153
|
-
type:
|
|
154
|
-
thid:
|
|
155
|
-
body:
|
|
156
|
-
url:
|
|
157
|
-
credentials:
|
|
150
|
+
var CredentialQrCodeData = z.z.object({
|
|
151
|
+
id: z.z.string(),
|
|
152
|
+
typ: z.z.string(),
|
|
153
|
+
type: z.z.string(),
|
|
154
|
+
thid: z.z.string(),
|
|
155
|
+
body: z.z.object({
|
|
156
|
+
url: z.z.string(),
|
|
157
|
+
credentials: z.z.unknown()
|
|
158
158
|
}),
|
|
159
|
-
from:
|
|
160
|
-
to:
|
|
161
|
-
});
|
|
162
|
-
var AuthQrCodeData =
|
|
163
|
-
id:
|
|
164
|
-
typ:
|
|
165
|
-
type:
|
|
166
|
-
thid:
|
|
167
|
-
body:
|
|
168
|
-
callbackUrl:
|
|
169
|
-
reason:
|
|
170
|
-
scope:
|
|
159
|
+
from: z.z.string(),
|
|
160
|
+
to: z.z.string()
|
|
161
|
+
});
|
|
162
|
+
var AuthQrCodeData = z.z.object({
|
|
163
|
+
id: z.z.string(),
|
|
164
|
+
typ: z.z.string(),
|
|
165
|
+
type: z.z.string(),
|
|
166
|
+
thid: z.z.string(),
|
|
167
|
+
body: z.z.object({
|
|
168
|
+
callbackUrl: z.z.string(),
|
|
169
|
+
reason: z.z.string(),
|
|
170
|
+
scope: z.z.unknown()
|
|
171
171
|
}),
|
|
172
|
-
from:
|
|
172
|
+
from: z.z.string()
|
|
173
173
|
});
|
|
174
|
-
var QrCodeLinkWithSchemaType =
|
|
175
|
-
qrCodeLink:
|
|
176
|
-
schemaType:
|
|
174
|
+
var QrCodeLinkWithSchemaType = z.z.object({
|
|
175
|
+
qrCodeLink: z.z.string().nullish(),
|
|
176
|
+
schemaType: z.z.string().nullish()
|
|
177
177
|
}).describe("Polygon ID Verifiable Credential Offer, to be consumed by the Polygon ID Wallet");
|
|
178
178
|
function parseIden3Message(input) {
|
|
179
179
|
var prefix = "request_uri=";
|
|
@@ -181,7 +181,7 @@ function parseIden3Message(input) {
|
|
|
181
181
|
if (startIndex === -1) {
|
|
182
182
|
throw new Error("Wrong request - request doesn't start with request_uri=");
|
|
183
183
|
}
|
|
184
|
-
return
|
|
184
|
+
return z.z.string().url().parse(input.substring(startIndex + prefix.length));
|
|
185
185
|
}
|
|
186
186
|
function parseSessionIdFromUrl(urlString) {
|
|
187
187
|
var url = new URL(urlString);
|
|
@@ -195,7 +195,7 @@ function parseSessionIdFromUrl(urlString) {
|
|
|
195
195
|
|
|
196
196
|
var _operatorDisplayMap;
|
|
197
197
|
var QUERY_LOGIC_OPERATOR = ["AND", "OR"];
|
|
198
|
-
var QueryLogicOperator =
|
|
198
|
+
var QueryLogicOperator = z.z["enum"](QUERY_LOGIC_OPERATOR);
|
|
199
199
|
var OPERATORS = ["$noop",
|
|
200
200
|
// noop can be used in zkps as proof of credential issuance https://docs.privado.id/docs/verifier/verification-library/zk-query-language#exists---operator-11
|
|
201
201
|
"$eq",
|
|
@@ -222,42 +222,42 @@ var OPERATORS = ["$noop",
|
|
|
222
222
|
// has
|
|
223
223
|
"$nhas" // has not
|
|
224
224
|
];
|
|
225
|
-
var Operator =
|
|
226
|
-
var ZKPOperator =
|
|
225
|
+
var Operator = z.z["enum"](OPERATORS);
|
|
226
|
+
var ZKPOperator = z.z["enum"](OPERATORS).exclude(["$lte", "$gte", "$has", "$nhas"]);
|
|
227
227
|
var operatorDisplayMap = (_operatorDisplayMap = {}, vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(_operatorDisplayMap, Operator["enum"].$eq, "is"), Operator["enum"].$ne, "is not"), Operator["enum"].$gt, "is greater than"), Operator["enum"].$lt, "is lower than"), Operator["enum"].$gte, "is greater than or equal to"), Operator["enum"].$lte, "is lower than or equal to"), Operator["enum"].$in, "is one of"), Operator["enum"].$nin, "is not one of"), Operator["enum"].$has, "has"), Operator["enum"].$nhas, "has not"), vault_schema._defineProperty(vault_schema._defineProperty(_operatorDisplayMap, Operator["enum"].$noop, "noop"), Operator["enum"].$exists, "exists"));
|
|
228
228
|
var ARRAY_OPERATORS = [Operator["enum"].$has, Operator["enum"].$nhas];
|
|
229
|
-
var ArrayOperator =
|
|
229
|
+
var ArrayOperator = z.z["enum"](ARRAY_OPERATORS);
|
|
230
230
|
var STRING_OPERATORS = [Operator["enum"].$eq, Operator["enum"].$ne, Operator["enum"].$in, Operator["enum"].$nin];
|
|
231
|
-
var StringOperator =
|
|
231
|
+
var StringOperator = z.z["enum"](STRING_OPERATORS);
|
|
232
232
|
var NUMERIC_OPERATORS = [Operator["enum"].$eq, Operator["enum"].$ne, Operator["enum"].$gt, Operator["enum"].$gte, Operator["enum"].$lt, Operator["enum"].$lte
|
|
233
233
|
//Operator.enum.$between,
|
|
234
234
|
//Operator.enum.$nonbetween,
|
|
235
235
|
];
|
|
236
|
-
var NumericOperator =
|
|
236
|
+
var NumericOperator = z.z["enum"](NUMERIC_OPERATORS);
|
|
237
237
|
var BOOLEAN_OPERATORS = [Operator["enum"].$eq, Operator["enum"].$ne];
|
|
238
|
-
var BooleanOperator =
|
|
238
|
+
var BooleanOperator = z.z["enum"](BOOLEAN_OPERATORS);
|
|
239
239
|
var DATE_OPERATORS = [Operator["enum"].$eq, Operator["enum"].$ne, Operator["enum"].$gt, Operator["enum"].$gte, Operator["enum"].$lt, Operator["enum"].$lte
|
|
240
240
|
//Operator.enum.$between,
|
|
241
241
|
//Operator.enum.$nonbetween,
|
|
242
242
|
];
|
|
243
|
-
var DateOperator =
|
|
243
|
+
var DateOperator = z.z["enum"](DATE_OPERATORS);
|
|
244
244
|
var SUPPORTED_TYPES = ["string", "integer", "boolean", "number", "array", "date", "decimal"];
|
|
245
|
-
var SupportedType =
|
|
246
|
-
var SupportedTypes =
|
|
247
|
-
var IDInformationTfhe =
|
|
248
|
-
type:
|
|
249
|
-
requestId:
|
|
250
|
-
attribute:
|
|
251
|
-
secondaryAttribute:
|
|
252
|
-
value:
|
|
245
|
+
var SupportedType = z.z["enum"](SUPPORTED_TYPES);
|
|
246
|
+
var SupportedTypes = z.z.object(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty({}, SupportedType["enum"].string, StringOperator), SupportedType["enum"].integer, NumericOperator), SupportedType["enum"]["boolean"], BooleanOperator), SupportedType["enum"].number, NumericOperator), SupportedType["enum"].array, ArrayOperator), SupportedType["enum"].date, DateOperator), SupportedType["enum"].decimal, NumericOperator));
|
|
247
|
+
var IDInformationTfhe = z.z.object({
|
|
248
|
+
type: z.z.literal("IDInformationTfhe"),
|
|
249
|
+
requestId: z.z.coerce.number().nullish(),
|
|
250
|
+
attribute: z.z.string(),
|
|
251
|
+
secondaryAttribute: z.z.string().nullish(),
|
|
252
|
+
value: z.z.string(),
|
|
253
253
|
operator: Operator
|
|
254
254
|
});
|
|
255
|
-
var AllCredentialValues =
|
|
256
|
-
var QueriesOptions =
|
|
257
|
-
title:
|
|
255
|
+
var AllCredentialValues = z.z.union([z.z["boolean"](), z.z.string(), z.z.number(), z.z.array(z.z.string()), z.z.array(z.z.number())]);
|
|
256
|
+
var QueriesOptions = z.z.array(z.z.object({
|
|
257
|
+
title: z.z.string(),
|
|
258
258
|
link: vault_schema.VaultMetadataLinkZodSchema
|
|
259
259
|
}));
|
|
260
|
-
var QueryType =
|
|
260
|
+
var QueryType = z.z["enum"](["IDInformation", "IDInformationTfhe", "SelfieImage", "IDImage", "ProofOfResidence", "AMLScreeningsResults",
|
|
261
261
|
// backwards compatibility
|
|
262
262
|
"ID3",
|
|
263
263
|
// this is for backwards compatibility
|
|
@@ -267,20 +267,20 @@ var QueryType = zod.z["enum"](["IDInformation", "IDInformationTfhe", "SelfieImag
|
|
|
267
267
|
// this is for backwards compatibility
|
|
268
268
|
"IDScanPassport" // this is for backwards compatibility
|
|
269
269
|
]);
|
|
270
|
-
var QueryConfigTfhe =
|
|
271
|
-
type:
|
|
272
|
-
requestId:
|
|
273
|
-
attribute:
|
|
274
|
-
secondaryAttribute:
|
|
275
|
-
value:
|
|
270
|
+
var QueryConfigTfhe = z.z.object({
|
|
271
|
+
type: z.z.literal("IDInformationTfhe"),
|
|
272
|
+
requestId: z.z.coerce.number().nullish(),
|
|
273
|
+
attribute: z.z.string(),
|
|
274
|
+
secondaryAttribute: z.z.string().nullish(),
|
|
275
|
+
value: z.z.string(),
|
|
276
276
|
operator: Operator
|
|
277
277
|
});
|
|
278
|
-
var QueryConfigSimplified =
|
|
278
|
+
var QueryConfigSimplified = z.z.object({
|
|
279
279
|
queryId: vault_schema.QueryId.describe("Unique ID for the query").optional(),
|
|
280
280
|
// TODO: this should not be optional?
|
|
281
281
|
id: vault_schema.QueryId.describe("Unique ID for the query").optional(),
|
|
282
282
|
// TODO: this should not be optional?
|
|
283
|
-
requestId:
|
|
283
|
+
requestId: z.z.coerce.number().nullish().describe("Request ID for ZKPs"),
|
|
284
284
|
attribute: vault_schema.VaultMetadataLinkZodSchema,
|
|
285
285
|
secondaryAttribute: vault_schema.VaultMetadataLinkZodSchema.nullish(),
|
|
286
286
|
value: AllCredentialValues.nullish(),
|
|
@@ -289,34 +289,34 @@ var QueryConfigSimplified = zod.z.object({
|
|
|
289
289
|
// TODO: Make the operator type dynamic based on the attribute type
|
|
290
290
|
datasetColumnId: vault_schema.DatasetColumnId.nullish()
|
|
291
291
|
});
|
|
292
|
-
var QueryGroupConfigSimplified =
|
|
292
|
+
var QueryGroupConfigSimplified = z.z.object({
|
|
293
293
|
id: vault_schema.QueryGroupId.describe("Unique ID for the query group").optional(),
|
|
294
294
|
operator: QueryLogicOperator,
|
|
295
|
-
queries:
|
|
295
|
+
queries: z.z.array(QueryConfigSimplified)
|
|
296
296
|
});
|
|
297
297
|
var RuleResultQueryConfig = QueryConfigSimplified.extend({
|
|
298
|
-
attribute:
|
|
298
|
+
attribute: z.z.union([z.z.string(), vault_schema.VaultMetadataLinkZodSchema]),
|
|
299
299
|
// string for backwards compatibility
|
|
300
|
-
secondaryAttribute:
|
|
300
|
+
secondaryAttribute: z.z.union([z.z.string(), vault_schema.VaultMetadataLinkZodSchema]).nullish(),
|
|
301
301
|
// string for backwards compatibility
|
|
302
302
|
type: QueryType.nullish() // Backwards compatibility
|
|
303
303
|
});
|
|
304
304
|
var PartialQueryConfigSimplified = QueryConfigSimplified.partial();
|
|
305
|
-
var OLD_ChallengeQuerySchema =
|
|
306
|
-
id:
|
|
305
|
+
var OLD_ChallengeQuerySchema = z.z.object({
|
|
306
|
+
id: z.z.string().optional(),
|
|
307
307
|
query: QueryConfigSimplified
|
|
308
308
|
});
|
|
309
309
|
var QueryCredentialTypes = ["IDInformation", "IDInformationTfhe", "IDImage", "SelfieImage", "ProofOfResidence"];
|
|
310
|
-
var QueryCredentialType =
|
|
311
|
-
var ChallengeQuerySchema =
|
|
312
|
-
id:
|
|
310
|
+
var QueryCredentialType = z.z["enum"](QueryCredentialTypes);
|
|
311
|
+
var ChallengeQuerySchema = z.z.object({
|
|
312
|
+
id: z.z.string().optional(),
|
|
313
313
|
query: QueryConfigSimplified
|
|
314
314
|
});
|
|
315
315
|
var OLD_CHALLENGE_QUERY_OPERATORS = ["GREATER_THAN", "LESS_THAN", "EQUAL_TO", "NOT_EQUAL_TO", "LESS_THAN_OR_EQUAL_TO", "GREATER_THAN_OR_EQUAL_TO", "IN", "NOT_IN",
|
|
316
316
|
//"BETWEEN",
|
|
317
317
|
//"NOT_BETWEEN",
|
|
318
318
|
"EXISTS"];
|
|
319
|
-
var OLD_ChallengeQueryOperator =
|
|
319
|
+
var OLD_ChallengeQueryOperator = z.z["enum"](OLD_CHALLENGE_QUERY_OPERATORS);
|
|
320
320
|
var OperatorMappings = {
|
|
321
321
|
toChallenge: vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty({}, Operator["enum"].$noop, OLD_ChallengeQueryOperator["enum"].EQUAL_TO), Operator["enum"].$eq, OLD_ChallengeQueryOperator["enum"].EQUAL_TO), Operator["enum"].$lt, OLD_ChallengeQueryOperator["enum"].LESS_THAN), Operator["enum"].$lte, OLD_ChallengeQueryOperator["enum"].LESS_THAN_OR_EQUAL_TO), Operator["enum"].$gt, OLD_ChallengeQueryOperator["enum"].GREATER_THAN), Operator["enum"].$gte, OLD_ChallengeQueryOperator["enum"].GREATER_THAN_OR_EQUAL_TO), Operator["enum"].$in, OLD_ChallengeQueryOperator["enum"].IN), Operator["enum"].$nin, OLD_ChallengeQueryOperator["enum"].NOT_IN), Operator["enum"].$ne, OLD_ChallengeQueryOperator["enum"].NOT_EQUAL_TO), Operator["enum"].$exists, OLD_ChallengeQueryOperator["enum"].EXISTS),
|
|
322
322
|
fromChallenge: vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty({}, OLD_ChallengeQueryOperator["enum"].EQUAL_TO, Operator["enum"].$eq), OLD_ChallengeQueryOperator["enum"].LESS_THAN, Operator["enum"].$lt), OLD_ChallengeQueryOperator["enum"].LESS_THAN_OR_EQUAL_TO, Operator["enum"].$lte), OLD_ChallengeQueryOperator["enum"].GREATER_THAN, Operator["enum"].$gt), OLD_ChallengeQueryOperator["enum"].GREATER_THAN_OR_EQUAL_TO, Operator["enum"].$gte), OLD_ChallengeQueryOperator["enum"].IN, Operator["enum"].$in), OLD_ChallengeQueryOperator["enum"].NOT_IN, Operator["enum"].$nin), OLD_ChallengeQueryOperator["enum"].NOT_EQUAL_TO, Operator["enum"].$ne), OLD_ChallengeQueryOperator["enum"].EXISTS, Operator["enum"].$exists)
|
|
@@ -326,7 +326,7 @@ var OLD_ChallengeQueryOperatorToOperator = OperatorMappings.fromChallenge;
|
|
|
326
326
|
|
|
327
327
|
// FIXME: Remove this once we migrate to the vault metadata
|
|
328
328
|
var OLD_QueryCredentialTypes = ["IDInformation", "IDImage", "SelfieImage", "ProofOfResidence", "AMLScreeningsResults", "ID3", "IDScan", "IDScanSelfie", "IDScanPassport"];
|
|
329
|
-
var OLD_QueryCredentialType =
|
|
329
|
+
var OLD_QueryCredentialType = z.z["enum"](OLD_QueryCredentialTypes);
|
|
330
330
|
/**
|
|
331
331
|
* @deprecated Use vault client and services instead
|
|
332
332
|
*
|
|
@@ -394,97 +394,97 @@ function oldCredentialPathToDataLink(path, credentialType) {
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
396
|
var SCENARIO_ACTION_TYPES = ["SET_CUSTOMER_RISK_LEVEL", "SET_CUSTOMER_STATUS", "SET_ALERT_RISK_LEVEL", "SET_TRANSACTION_RISK_LEVEL", "SET_TRANSACTION_STATUS", "ASSIGN_COMPLIANCE_OFFICER", "CREATE_ALERT", "ASSIGN_TAG", "BLOCK_ON_CHAIN_TRANSACTION"];
|
|
397
|
-
var ActionType =
|
|
397
|
+
var ActionType = z.z["enum"](SCENARIO_ACTION_TYPES);
|
|
398
398
|
var ACTION_TRIGGERS = ["ON_TRUE", "ON_FALSE", "ALWAYS"];
|
|
399
|
-
var ActionTrigger =
|
|
399
|
+
var ActionTrigger = z.z["enum"](ACTION_TRIGGERS);
|
|
400
400
|
var ACTION_STATUSES = ["ENABLED", "DISABLED"];
|
|
401
|
-
var ActionStatus =
|
|
402
|
-
var ActionValue =
|
|
401
|
+
var ActionStatus = z.z["enum"](ACTION_STATUSES);
|
|
402
|
+
var ActionValue = z.z.string();
|
|
403
403
|
var ScenarioTypes = ["PrivacyPreservingMonitoring", "IndividualMonitoring", "TransactionMonitoring", "TFHE",
|
|
404
404
|
// TODO integrate TFHE verification
|
|
405
405
|
"BlockchainPolicies"];
|
|
406
|
-
var ScenarioType =
|
|
406
|
+
var ScenarioType = z.z["enum"](ScenarioTypes);
|
|
407
407
|
var ScenarioModes = ["INTERNAL", "EXTERNAL"];
|
|
408
|
-
var ScenarioMode =
|
|
408
|
+
var ScenarioMode = z.z["enum"](ScenarioModes);
|
|
409
409
|
var ScenarioStatuses = ["enabled", "disabled"];
|
|
410
|
-
var ScenarioStatus =
|
|
411
|
-
var ScenarioSchema =
|
|
412
|
-
title:
|
|
413
|
-
link:
|
|
414
|
-
version:
|
|
415
|
-
schema:
|
|
416
|
-
path:
|
|
410
|
+
var ScenarioStatus = z.z["enum"](ScenarioStatuses);
|
|
411
|
+
var ScenarioSchema = z.z.object({
|
|
412
|
+
title: z.z.string(),
|
|
413
|
+
link: z.z.object({
|
|
414
|
+
version: z.z.string(),
|
|
415
|
+
schema: z.z.string(),
|
|
416
|
+
path: z.z.string()
|
|
417
417
|
}),
|
|
418
|
-
status:
|
|
418
|
+
status: z.z["enum"]([ScenarioStatus.Enum.enabled, ScenarioStatus.Enum.disabled]).optional()
|
|
419
419
|
});
|
|
420
420
|
var BackwardsCompatibleScenarioTypes = ["PrivacyPreservingMonitoring", "IndividualMonitoring", "TransactionMonitoring", "TFHE", "OffChainZKP",
|
|
421
421
|
// Backwards compatible
|
|
422
422
|
"ChallengeQuery",
|
|
423
423
|
// Backwards compatible
|
|
424
424
|
"BlockchainPolicies"];
|
|
425
|
-
var BackwardsCompatibleScenarioType =
|
|
426
|
-
var BaseQueryResponse =
|
|
427
|
-
result:
|
|
428
|
-
is_valid:
|
|
429
|
-
reasons:
|
|
425
|
+
var BackwardsCompatibleScenarioType = z.z["enum"](BackwardsCompatibleScenarioTypes);
|
|
426
|
+
var BaseQueryResponse = z.z.object({
|
|
427
|
+
result: z.z.object({
|
|
428
|
+
is_valid: z.z["boolean"](),
|
|
429
|
+
reasons: z.z.array(z.z.string())
|
|
430
430
|
})
|
|
431
431
|
});
|
|
432
432
|
var OffChainZKPRuleResult = BaseQueryResponse.extend({
|
|
433
|
-
result:
|
|
434
|
-
is_valid:
|
|
433
|
+
result: z.z.object({
|
|
434
|
+
is_valid: z.z["boolean"](),
|
|
435
435
|
query: QueryConfigSimplified,
|
|
436
|
-
reasons:
|
|
436
|
+
reasons: z.z.array(z.z.string())
|
|
437
437
|
})
|
|
438
438
|
});
|
|
439
439
|
var ExecuteQueryResponse = BaseQueryResponse.extend({
|
|
440
440
|
executionId: vault_schema.UuidString
|
|
441
441
|
});
|
|
442
|
-
var RuleEngineResponse =
|
|
442
|
+
var RuleEngineResponse = z.z.object({
|
|
443
443
|
objectType: BackwardsCompatibleScenarioType,
|
|
444
|
-
objectId:
|
|
445
|
-
name:
|
|
444
|
+
objectId: z.z.string().describe("Object id in the cms (challengeQueryid, offChainZKPid)"),
|
|
445
|
+
name: z.z.string(),
|
|
446
446
|
address: vault_schema.BlockchainAddress.nullish(),
|
|
447
447
|
result: ExecuteQueryResponse,
|
|
448
448
|
executionId: vault_schema.UuidString,
|
|
449
|
-
scenarioId:
|
|
449
|
+
scenarioId: z.z.string()
|
|
450
450
|
});
|
|
451
|
-
var ScenarioExecutionResponse =
|
|
451
|
+
var ScenarioExecutionResponse = z.z.array(RuleEngineResponse);
|
|
452
452
|
var RuleResultStatuses = ["valid", "not-valid", "skipped", "error", "unknown"];
|
|
453
|
-
var RuleResultStatus =
|
|
453
|
+
var RuleResultStatus = z.z["enum"](RuleResultStatuses);
|
|
454
454
|
var RuleResultStatusLabels = vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty(vault_schema._defineProperty({}, RuleResultStatus.Enum.valid, "Valid"), RuleResultStatus.Enum["not-valid"], "Not Valid"), RuleResultStatus.Enum.skipped, "Skipped"), RuleResultStatus.Enum.error, "Error"), RuleResultStatus.Enum.unknown, "Unknown");
|
|
455
|
-
var SdkVerificationOutput =
|
|
456
|
-
customerId:
|
|
455
|
+
var SdkVerificationOutput = z.z.object({
|
|
456
|
+
customerId: z.z.string().optional(),
|
|
457
457
|
// for v1
|
|
458
|
-
scenarioExecutionId:
|
|
458
|
+
scenarioExecutionId: z.z.string().optional(),
|
|
459
459
|
// for v1
|
|
460
460
|
status: RuleResultStatus.optional(),
|
|
461
461
|
// for v1
|
|
462
|
-
results:
|
|
462
|
+
results: z.z.array(ScenarioExecutionResponse).optional() // for v1,
|
|
463
463
|
});
|
|
464
464
|
var VerificationSessionStatuses = ["IN_PROGRESS", "COMPLETED", "NOT_STARTED"];
|
|
465
|
-
var VerificationSessionStatus =
|
|
466
|
-
var VerificationOutput =
|
|
465
|
+
var VerificationSessionStatus = z.z["enum"](VerificationSessionStatuses);
|
|
466
|
+
var VerificationOutput = z.z.object({
|
|
467
467
|
id: vault_schema.UuidString.nullable(),
|
|
468
468
|
verificationResult: SdkVerificationOutput.nullable(),
|
|
469
469
|
status: VerificationSessionStatus
|
|
470
470
|
});
|
|
471
|
-
var Action =
|
|
471
|
+
var Action = z.z.object({
|
|
472
472
|
type: ActionType,
|
|
473
473
|
trigger: ActionTrigger,
|
|
474
474
|
status: ActionStatus,
|
|
475
475
|
value: ActionValue
|
|
476
476
|
});
|
|
477
|
-
var SimplifiedScenario =
|
|
477
|
+
var SimplifiedScenario = z.z.object({
|
|
478
478
|
id: vault_schema.ScenarioId,
|
|
479
|
-
name:
|
|
480
|
-
description:
|
|
481
|
-
queries:
|
|
482
|
-
queryGroups:
|
|
483
|
-
actions:
|
|
479
|
+
name: z.z.string(),
|
|
480
|
+
description: z.z.string().nullish(),
|
|
481
|
+
queries: z.z.array(QueryConfigSimplified),
|
|
482
|
+
queryGroups: z.z.array(QueryGroupConfigSimplified),
|
|
483
|
+
actions: z.z.array(Action),
|
|
484
484
|
type: ScenarioType,
|
|
485
485
|
mode: ScenarioMode,
|
|
486
486
|
workspaceId: vault_schema.WorkspaceId,
|
|
487
|
-
vcsIncluded:
|
|
487
|
+
vcsIncluded: z.z.array(CredentialType).nullish()
|
|
488
488
|
});
|
|
489
489
|
|
|
490
490
|
// creating this because SmartContractDeployment has an issue with EvmAddress
|
|
@@ -494,7 +494,7 @@ var AbbreviatedWorkflowScenario = SimplifiedScenario.omit({
|
|
|
494
494
|
vcsIncluded: true,
|
|
495
495
|
queries: true
|
|
496
496
|
}).extend({
|
|
497
|
-
queries:
|
|
497
|
+
queries: z.z.array(QueryConfigSimplified)
|
|
498
498
|
});
|
|
499
499
|
var TemplateScenario = SimplifiedScenario.omit({
|
|
500
500
|
workspaceId: true
|
|
@@ -502,478 +502,478 @@ var TemplateScenario = SimplifiedScenario.omit({
|
|
|
502
502
|
var CreateTemplateScenario = TemplateScenario.omit({
|
|
503
503
|
id: true
|
|
504
504
|
}).extend({
|
|
505
|
-
entityType:
|
|
505
|
+
entityType: z.z["enum"](["individual", "company", "transaction"]).optional()
|
|
506
506
|
});
|
|
507
507
|
|
|
508
|
-
var ScenarioAuthorizationData =
|
|
508
|
+
var ScenarioAuthorizationData = z.z.object({
|
|
509
509
|
executionId: vault_schema.UuidString,
|
|
510
510
|
sessionId: vault_schema.UuidString,
|
|
511
|
-
projectId:
|
|
511
|
+
projectId: z.z.string(),
|
|
512
512
|
address: vault_schema.BlockchainAddress.nullish(),
|
|
513
|
-
status:
|
|
514
|
-
scenarioId:
|
|
515
|
-
scenarioName:
|
|
513
|
+
status: z.z["enum"](["pending", "authorised", "unauthorised"]),
|
|
514
|
+
scenarioId: z.z.string(),
|
|
515
|
+
scenarioName: z.z.string(),
|
|
516
516
|
requestMessage: AuthorizationRequestMessage,
|
|
517
517
|
responseMessage: AuthorizationResponseMessage.nullish(),
|
|
518
|
-
verificationError:
|
|
518
|
+
verificationError: z.z.string().nullish(),
|
|
519
519
|
query: QueryConfigSimplified.array(),
|
|
520
520
|
workflowSessionId: vault_schema.UuidString.optional()
|
|
521
521
|
});
|
|
522
522
|
// v1 sdk
|
|
523
523
|
var SdkVerificationResponseSchema = SdkVerificationOutput;
|
|
524
|
-
var CloseScreenNotification =
|
|
525
|
-
type:
|
|
526
|
-
identifier:
|
|
527
|
-
data:
|
|
528
|
-
});
|
|
529
|
-
var KycCompletionData =
|
|
530
|
-
var KycCompletionNotification =
|
|
531
|
-
type:
|
|
532
|
-
identifier:
|
|
524
|
+
var CloseScreenNotification = z.z.object({
|
|
525
|
+
type: z.z.literal("closeScreen"),
|
|
526
|
+
identifier: z.z.string(),
|
|
527
|
+
data: z.z.undefined()
|
|
528
|
+
});
|
|
529
|
+
var KycCompletionData = z.z.array(VerifiableCredential);
|
|
530
|
+
var KycCompletionNotification = z.z.object({
|
|
531
|
+
type: z.z.literal("kycCompletion"),
|
|
532
|
+
identifier: z.z.string(),
|
|
533
533
|
data: KycCompletionData
|
|
534
534
|
});
|
|
535
|
-
var RuleEngineScenarioExecutionData =
|
|
536
|
-
type:
|
|
535
|
+
var RuleEngineScenarioExecutionData = z.z.object({
|
|
536
|
+
type: z.z.literal("RuleEngineScenarioExecution"),
|
|
537
537
|
data: SdkVerificationResponseSchema
|
|
538
538
|
});
|
|
539
|
-
var OffChainScenarioExecutionData =
|
|
540
|
-
type:
|
|
541
|
-
data:
|
|
539
|
+
var OffChainScenarioExecutionData = z.z.object({
|
|
540
|
+
type: z.z.literal("OffChainScenarioExecution"),
|
|
541
|
+
data: z.z.array(ScenarioAuthorizationData)
|
|
542
542
|
});
|
|
543
|
-
var OnChainScenarioExecutionData =
|
|
544
|
-
type:
|
|
545
|
-
data:
|
|
543
|
+
var OnChainScenarioExecutionData = z.z.object({
|
|
544
|
+
type: z.z.literal("OnChainScenarioExecution"),
|
|
545
|
+
data: z.z.any()
|
|
546
546
|
});
|
|
547
|
-
var ScenarioExecutionData =
|
|
548
|
-
var ScenarioExecutionNotification =
|
|
549
|
-
type:
|
|
550
|
-
identifier:
|
|
547
|
+
var ScenarioExecutionData = z.z.union([RuleEngineScenarioExecutionData, OffChainScenarioExecutionData, OnChainScenarioExecutionData]);
|
|
548
|
+
var ScenarioExecutionNotification = z.z.object({
|
|
549
|
+
type: z.z.literal("scenarioExecution"),
|
|
550
|
+
identifier: z.z.string(),
|
|
551
551
|
data: ScenarioExecutionData
|
|
552
552
|
});
|
|
553
|
-
var IsVerifiedNotification =
|
|
554
|
-
type:
|
|
555
|
-
identifier:
|
|
556
|
-
isVerified:
|
|
557
|
-
});
|
|
558
|
-
var PolygonIdInitialized =
|
|
559
|
-
type:
|
|
560
|
-
identifier:
|
|
561
|
-
data:
|
|
562
|
-
});
|
|
563
|
-
var OcvSdkInitialized =
|
|
564
|
-
type:
|
|
565
|
-
identifier:
|
|
566
|
-
});
|
|
567
|
-
var StartCompletedNotification =
|
|
568
|
-
type:
|
|
569
|
-
identifier:
|
|
570
|
-
});
|
|
571
|
-
var IdentityNotificationMessage =
|
|
572
|
-
var InitialDataRequest =
|
|
573
|
-
type:
|
|
574
|
-
identifier:
|
|
575
|
-
});
|
|
576
|
-
var SignatureRequest =
|
|
577
|
-
type:
|
|
578
|
-
identifier:
|
|
579
|
-
data:
|
|
580
|
-
message:
|
|
553
|
+
var IsVerifiedNotification = z.z.object({
|
|
554
|
+
type: z.z.literal("isVerifiedNotification"),
|
|
555
|
+
identifier: z.z.string(),
|
|
556
|
+
isVerified: z.z["boolean"]()
|
|
557
|
+
});
|
|
558
|
+
var PolygonIdInitialized = z.z.object({
|
|
559
|
+
type: z.z.literal("polygonIdInitialized"),
|
|
560
|
+
identifier: z.z.string(),
|
|
561
|
+
data: z.z.string()
|
|
562
|
+
});
|
|
563
|
+
var OcvSdkInitialized = z.z.object({
|
|
564
|
+
type: z.z.literal("ocvSdkInitialized"),
|
|
565
|
+
identifier: z.z.string()
|
|
566
|
+
});
|
|
567
|
+
var StartCompletedNotification = z.z.object({
|
|
568
|
+
type: z.z.literal("startCompletedNotification"),
|
|
569
|
+
identifier: z.z.string()
|
|
570
|
+
});
|
|
571
|
+
var IdentityNotificationMessage = z.z.union([CloseScreenNotification, PolygonIdInitialized, OcvSdkInitialized, StartCompletedNotification, KycCompletionNotification, ScenarioExecutionNotification, IsVerifiedNotification]);
|
|
572
|
+
var InitialDataRequest = z.z.object({
|
|
573
|
+
type: z.z.literal("initialDataRequest"),
|
|
574
|
+
identifier: z.z.string()
|
|
575
|
+
});
|
|
576
|
+
var SignatureRequest = z.z.object({
|
|
577
|
+
type: z.z.literal("signatureRequest"),
|
|
578
|
+
identifier: z.z.string(),
|
|
579
|
+
data: z.z.object({
|
|
580
|
+
message: z.z.string()
|
|
581
581
|
})
|
|
582
582
|
});
|
|
583
|
-
var TransactionData =
|
|
583
|
+
var TransactionData = z.z.object({
|
|
584
584
|
accountAddress: vault_schema.BlockchainAddress,
|
|
585
585
|
to: vault_schema.BlockchainAddress,
|
|
586
586
|
data: vault_schema.String0x,
|
|
587
|
-
value:
|
|
587
|
+
value: z.z.string().optional()
|
|
588
588
|
});
|
|
589
|
-
var SendTransactionRequest =
|
|
590
|
-
type:
|
|
591
|
-
identifier:
|
|
589
|
+
var SendTransactionRequest = z.z.object({
|
|
590
|
+
type: z.z.literal("sendTransactionRequest"),
|
|
591
|
+
identifier: z.z.string(),
|
|
592
592
|
data: TransactionData
|
|
593
593
|
});
|
|
594
|
-
var IdentityRequestMessage =
|
|
594
|
+
var IdentityRequestMessage = z.z.union([InitialDataRequest, SignatureRequest, SendTransactionRequest]);
|
|
595
595
|
var AVAILABLE_FLOWS = ["VERIFICATION", "MANAGEMENT", "POLYGON_ID", "KYB"];
|
|
596
|
-
var AvailableFlow =
|
|
597
|
-
var DataAvailableOnStart =
|
|
598
|
-
identifier:
|
|
599
|
-
flow:
|
|
600
|
-
accessToken:
|
|
601
|
-
signingMessage:
|
|
602
|
-
signature:
|
|
603
|
-
});
|
|
604
|
-
var InitialDataResponse =
|
|
605
|
-
type:
|
|
596
|
+
var AvailableFlow = z.z["enum"](AVAILABLE_FLOWS);
|
|
597
|
+
var DataAvailableOnStart = z.z.object({
|
|
598
|
+
identifier: z.z.string().optional(),
|
|
599
|
+
flow: z.z["enum"](AVAILABLE_FLOWS).optional(),
|
|
600
|
+
accessToken: z.z.string(),
|
|
601
|
+
signingMessage: z.z.string(),
|
|
602
|
+
signature: z.z.string()
|
|
603
|
+
});
|
|
604
|
+
var InitialDataResponse = z.z.object({
|
|
605
|
+
type: z.z.literal("onStartKyc"),
|
|
606
606
|
data: DataAvailableOnStart
|
|
607
607
|
});
|
|
608
|
-
var SignatureResponse =
|
|
609
|
-
type:
|
|
608
|
+
var SignatureResponse = z.z.object({
|
|
609
|
+
type: z.z.literal("signature"),
|
|
610
610
|
data: vault_schema.BlockchainSignature
|
|
611
611
|
});
|
|
612
|
-
var TransactionResponse =
|
|
613
|
-
type:
|
|
614
|
-
data:
|
|
612
|
+
var TransactionResponse = z.z.object({
|
|
613
|
+
type: z.z.literal("transactionResponse"),
|
|
614
|
+
data: z.z.object({
|
|
615
615
|
txHash: vault_schema.TxHash
|
|
616
616
|
})
|
|
617
617
|
});
|
|
618
|
-
var HostResponseMessage =
|
|
618
|
+
var HostResponseMessage = z.z.union([InitialDataResponse, SignatureResponse, TransactionResponse]);
|
|
619
619
|
|
|
620
620
|
/**
|
|
621
621
|
* Exported types
|
|
622
622
|
*/
|
|
623
623
|
|
|
624
|
-
var ComplianceImplementationStepsInput =
|
|
625
|
-
identityChecks:
|
|
626
|
-
configureIdentity:
|
|
627
|
-
deployIdentity:
|
|
628
|
-
monitorIdentity:
|
|
624
|
+
var ComplianceImplementationStepsInput = z.z.object({
|
|
625
|
+
identityChecks: z.z["boolean"]().nullish(),
|
|
626
|
+
configureIdentity: z.z["boolean"]().nullish(),
|
|
627
|
+
deployIdentity: z.z["boolean"]().nullish(),
|
|
628
|
+
monitorIdentity: z.z["boolean"]().nullish()
|
|
629
629
|
});
|
|
630
630
|
|
|
631
631
|
/////////////
|
|
632
632
|
// EIP-155 //
|
|
633
633
|
/////////////
|
|
634
634
|
|
|
635
|
-
var TxAuthInput =
|
|
635
|
+
var TxAuthInput = z.z.object({
|
|
636
636
|
workflowId: vault_schema.WorkflowId.optional(),
|
|
637
637
|
chainId: vault_schema.EvmChainId,
|
|
638
|
-
contractAbi:
|
|
638
|
+
contractAbi: z.z.array(z.z.record(z.z.unknown())),
|
|
639
639
|
contractAddress: vault_schema.EvmAddress,
|
|
640
|
-
functionName:
|
|
641
|
-
args:
|
|
640
|
+
functionName: z.z.string(),
|
|
641
|
+
args: z.z.array(z.z.unknown()),
|
|
642
642
|
userAddress: vault_schema.EvmAddress,
|
|
643
|
-
blockExpiration:
|
|
644
|
-
nonce:
|
|
643
|
+
blockExpiration: z.z.number()["int"]().optional(),
|
|
644
|
+
nonce: z.z.number()["int"]().optional()
|
|
645
645
|
});
|
|
646
646
|
// the api endpoint can source the userAddress from the session if it's not provided
|
|
647
647
|
var ApiTxAuthInput = TxAuthInput.extend({
|
|
648
648
|
userAddress: vault_schema.EvmAddress.optional()
|
|
649
649
|
});
|
|
650
|
-
var TxSignatureResponse =
|
|
650
|
+
var TxSignatureResponse = z.z.object({
|
|
651
651
|
signature: vault_schema.EIP155Signature,
|
|
652
|
-
blockExpiration:
|
|
652
|
+
blockExpiration: z.z.number()
|
|
653
653
|
});
|
|
654
|
-
var GetTxAuthDataSignatureSuccessResponse =
|
|
655
|
-
isAuthorized:
|
|
654
|
+
var GetTxAuthDataSignatureSuccessResponse = z.z.object({
|
|
655
|
+
isAuthorized: z.z.literal(true),
|
|
656
656
|
signature: vault_schema.EIP155Signature,
|
|
657
|
-
payload:
|
|
658
|
-
blockExpiration:
|
|
657
|
+
payload: z.z.string(),
|
|
658
|
+
blockExpiration: z.z.number()
|
|
659
659
|
});
|
|
660
|
-
var GetTxAuthDataSignatureFailureResponse =
|
|
661
|
-
isAuthorized:
|
|
662
|
-
errorMessage:
|
|
660
|
+
var GetTxAuthDataSignatureFailureResponse = z.z.object({
|
|
661
|
+
isAuthorized: z.z.literal(false),
|
|
662
|
+
errorMessage: z.z.string()
|
|
663
663
|
});
|
|
664
|
-
var GetTxAuthDataSignatureResponse =
|
|
664
|
+
var GetTxAuthDataSignatureResponse = z.z.union([GetTxAuthDataSignatureSuccessResponse, GetTxAuthDataSignatureFailureResponse]);
|
|
665
665
|
/////////////
|
|
666
666
|
// Tezos //
|
|
667
667
|
/////////////
|
|
668
668
|
|
|
669
|
-
var TezosTxAuthInput =
|
|
669
|
+
var TezosTxAuthInput = z.z.object({
|
|
670
670
|
workflowId: vault_schema.WorkflowId.optional(),
|
|
671
671
|
chainID: vault_schema.TezosChainId,
|
|
672
672
|
contractAddress: vault_schema.TezosContractAddress,
|
|
673
673
|
functionName: vault_schema.TezosEntrypointName,
|
|
674
|
-
args:
|
|
674
|
+
args: z.z.string(),
|
|
675
675
|
userAddress: vault_schema.TezosImplicitAddress,
|
|
676
|
-
blockExpiration:
|
|
677
|
-
nonce:
|
|
676
|
+
blockExpiration: z.z.number()["int"]().optional(),
|
|
677
|
+
nonce: z.z.number()["int"]().optional()
|
|
678
678
|
});
|
|
679
679
|
// the api endpoint can source the userAddress from the session if it's not provided
|
|
680
680
|
var ApiTezosTxAuthInput = TezosTxAuthInput.extend({
|
|
681
681
|
userAddress: vault_schema.TezosImplicitAddress.optional()
|
|
682
682
|
});
|
|
683
|
-
var TezosTxSignatureResponse =
|
|
683
|
+
var TezosTxSignatureResponse = z.z.object({
|
|
684
684
|
signature: vault_schema.EdSignature,
|
|
685
|
-
blockExpiration:
|
|
685
|
+
blockExpiration: z.z.number()
|
|
686
686
|
});
|
|
687
|
-
var GetTezosTxAuthDataSignatureResponse =
|
|
688
|
-
isAuthorized:
|
|
687
|
+
var GetTezosTxAuthDataSignatureResponse = z.z.union([z.z.object({
|
|
688
|
+
isAuthorized: z.z.literal(true),
|
|
689
689
|
signature: vault_schema.EdSignature,
|
|
690
|
-
blockExpiration:
|
|
691
|
-
}),
|
|
692
|
-
isAuthorized:
|
|
693
|
-
errorMessage:
|
|
690
|
+
blockExpiration: z.z.number()
|
|
691
|
+
}), z.z.object({
|
|
692
|
+
isAuthorized: z.z.literal(false),
|
|
693
|
+
errorMessage: z.z.any()
|
|
694
694
|
})]);
|
|
695
695
|
/////////////
|
|
696
696
|
// General //
|
|
697
697
|
/////////////
|
|
698
698
|
|
|
699
|
-
var ExtendedTxAuthInput = TxAuthInput.and(
|
|
700
|
-
namespace:
|
|
699
|
+
var ExtendedTxAuthInput = TxAuthInput.and(z.z.object({
|
|
700
|
+
namespace: z.z.literal(vault_schema.BlockchainNamespace.Enum.eip155),
|
|
701
701
|
userAddress: vault_schema.EvmAddress
|
|
702
702
|
}));
|
|
703
|
-
var ExtendedTezosTxAuthInput = TezosTxAuthInput.and(
|
|
704
|
-
namespace:
|
|
703
|
+
var ExtendedTezosTxAuthInput = TezosTxAuthInput.and(z.z.object({
|
|
704
|
+
namespace: z.z.literal(vault_schema.BlockchainNamespace.Enum.tezos),
|
|
705
705
|
userAddress: vault_schema.TezosImplicitAddress
|
|
706
706
|
}));
|
|
707
|
-
var ExtendedTxAuthDataSignatureResponse = GetTxAuthDataSignatureResponse.and(
|
|
708
|
-
namespace:
|
|
707
|
+
var ExtendedTxAuthDataSignatureResponse = GetTxAuthDataSignatureResponse.and(z.z.object({
|
|
708
|
+
namespace: z.z.literal(vault_schema.BlockchainNamespace.Enum.eip155),
|
|
709
709
|
userAddress: vault_schema.EvmAddress
|
|
710
710
|
}));
|
|
711
|
-
var ExtendedTezosTxAuthDataSignatureResponse = GetTezosTxAuthDataSignatureResponse.and(
|
|
712
|
-
namespace:
|
|
711
|
+
var ExtendedTezosTxAuthDataSignatureResponse = GetTezosTxAuthDataSignatureResponse.and(z.z.object({
|
|
712
|
+
namespace: z.z.literal(vault_schema.BlockchainNamespace.Enum.tezos),
|
|
713
713
|
userAddress: vault_schema.TezosImplicitAddress
|
|
714
714
|
}));
|
|
715
|
-
var AnyTxAuthDataSignatureResponse =
|
|
715
|
+
var AnyTxAuthDataSignatureResponse = z.z.union([ExtendedTxAuthDataSignatureResponse, ExtendedTezosTxAuthDataSignatureResponse]);
|
|
716
716
|
/////////////
|
|
717
717
|
// JS SDK //
|
|
718
718
|
/////////////
|
|
719
719
|
|
|
720
|
-
var Eip155TxAuthInputJsSdk = ExtendedTxAuthInput.and(
|
|
720
|
+
var Eip155TxAuthInputJsSdk = ExtendedTxAuthInput.and(z.z.object({
|
|
721
721
|
workflowId: vault_schema.WorkflowId
|
|
722
722
|
}));
|
|
723
|
-
var TezosTxAuthInputJsSdk = ExtendedTezosTxAuthInput.and(
|
|
723
|
+
var TezosTxAuthInputJsSdk = ExtendedTezosTxAuthInput.and(z.z.object({
|
|
724
724
|
workflowId: vault_schema.WorkflowId
|
|
725
725
|
}));
|
|
726
|
-
var AnyTxAuthInputJsSdk =
|
|
726
|
+
var AnyTxAuthInputJsSdk = z.z.union([Eip155TxAuthInputJsSdk, TezosTxAuthInputJsSdk]);
|
|
727
727
|
|
|
728
|
-
var SimplifiedCredential =
|
|
729
|
-
id:
|
|
730
|
-
type:
|
|
731
|
-
issuanceDate:
|
|
732
|
-
journeyId:
|
|
728
|
+
var SimplifiedCredential = z.z.object({
|
|
729
|
+
id: z.z.string(),
|
|
730
|
+
type: z.z.array(z.z.string()),
|
|
731
|
+
issuanceDate: z.z.string(),
|
|
732
|
+
journeyId: z.z.string()
|
|
733
733
|
});
|
|
734
734
|
/**
|
|
735
735
|
* GetCredentialsRequest
|
|
736
736
|
*/
|
|
737
|
-
var GetCredentialsRequest =
|
|
738
|
-
type:
|
|
739
|
-
data:
|
|
737
|
+
var GetCredentialsRequest = z.z.object({
|
|
738
|
+
type: z.z.literal("getCredentials"),
|
|
739
|
+
data: z.z.undefined()
|
|
740
740
|
});
|
|
741
741
|
/**
|
|
742
742
|
* GetCredentialsResponse
|
|
743
743
|
*/
|
|
744
|
-
var GetCredentialsResponse =
|
|
745
|
-
type:
|
|
746
|
-
credentials:
|
|
747
|
-
identifier:
|
|
744
|
+
var GetCredentialsResponse = z.z.object({
|
|
745
|
+
type: z.z.literal("polygonIdCredentials"),
|
|
746
|
+
credentials: z.z.array(SimplifiedCredential),
|
|
747
|
+
identifier: z.z.string()
|
|
748
748
|
});
|
|
749
749
|
/**
|
|
750
750
|
* PolygonIdRequest
|
|
751
751
|
*/
|
|
752
|
-
var PolygonIdRequestData =
|
|
753
|
-
type:
|
|
752
|
+
var PolygonIdRequestData = z.z.union([z.z.object({
|
|
753
|
+
type: z.z.literal("auth"),
|
|
754
754
|
authRequest: AuthorizationRequestMessage
|
|
755
|
-
}),
|
|
756
|
-
type:
|
|
755
|
+
}), z.z.object({
|
|
756
|
+
type: z.z.literal("credentialOffer"),
|
|
757
757
|
credentialOfferRequest: QrCodeLinkWithSchemaType
|
|
758
|
-
}),
|
|
759
|
-
type:
|
|
758
|
+
}), z.z.object({
|
|
759
|
+
type: z.z.literal("zkp"),
|
|
760
760
|
zkpRequest: ZeroKnowledgeProofRequest
|
|
761
761
|
})]);
|
|
762
|
-
var PolygonIdRequest =
|
|
763
|
-
type:
|
|
762
|
+
var PolygonIdRequest = z.z.object({
|
|
763
|
+
type: z.z.literal("polygonIdRequest"),
|
|
764
764
|
data: PolygonIdRequestData
|
|
765
765
|
});
|
|
766
766
|
/**
|
|
767
767
|
* PolygonIdResponse
|
|
768
768
|
*/
|
|
769
|
-
var PolygonIdResponseData =
|
|
770
|
-
type:
|
|
769
|
+
var PolygonIdResponseData = z.z.union([z.z.object({
|
|
770
|
+
type: z.z.literal("auth"),
|
|
771
771
|
authResponse: AuthorizationResponseMessage
|
|
772
|
-
}),
|
|
773
|
-
type:
|
|
774
|
-
credentialOfferResponse:
|
|
775
|
-
}),
|
|
776
|
-
type:
|
|
772
|
+
}), z.z.object({
|
|
773
|
+
type: z.z.literal("credentialOffer"),
|
|
774
|
+
credentialOfferResponse: z.z.array(vault_schema.GenericVerifiableCredentialSchema)
|
|
775
|
+
}), z.z.object({
|
|
776
|
+
type: z.z.literal("zkp"),
|
|
777
777
|
zkpResponse: ZeroKnowledgeProofResponse
|
|
778
|
-
}),
|
|
779
|
-
type:
|
|
780
|
-
screen:
|
|
781
|
-
closeResponse:
|
|
778
|
+
}), z.z.object({
|
|
779
|
+
type: z.z.literal("close"),
|
|
780
|
+
screen: z.z["enum"](["auth", "credentialOffer", "zkp", "getCredentials"]),
|
|
781
|
+
closeResponse: z.z.string()
|
|
782
782
|
})]);
|
|
783
|
-
var PolygonIdResponse =
|
|
784
|
-
type:
|
|
785
|
-
identifier:
|
|
783
|
+
var PolygonIdResponse = z.z.object({
|
|
784
|
+
type: z.z.literal("polygonIdResponse"),
|
|
785
|
+
identifier: z.z.string(),
|
|
786
786
|
data: PolygonIdResponseData
|
|
787
787
|
});
|
|
788
788
|
/**
|
|
789
789
|
* StartFlowRequest
|
|
790
790
|
*/
|
|
791
|
-
var StartFlowRequest =
|
|
792
|
-
type:
|
|
793
|
-
data:
|
|
794
|
-
}),
|
|
795
|
-
type:
|
|
796
|
-
data:
|
|
797
|
-
}),
|
|
798
|
-
type:
|
|
799
|
-
data:
|
|
791
|
+
var StartFlowRequest = z.z.union([z.z.object({
|
|
792
|
+
type: z.z.literal("startVerification"),
|
|
793
|
+
data: z.z.undefined()
|
|
794
|
+
}), z.z.object({
|
|
795
|
+
type: z.z.literal("startManagement"),
|
|
796
|
+
data: z.z.undefined()
|
|
797
|
+
}), z.z.object({
|
|
798
|
+
type: z.z.literal("startKYB"),
|
|
799
|
+
data: z.z.undefined()
|
|
800
800
|
})]);
|
|
801
801
|
/**
|
|
802
802
|
* IsVerifiedRequest
|
|
803
803
|
*/
|
|
804
|
-
var IsVerifiedRequest =
|
|
805
|
-
type:
|
|
806
|
-
data:
|
|
804
|
+
var IsVerifiedRequest = z.z.object({
|
|
805
|
+
type: z.z.literal("isVerifiedRequest"),
|
|
806
|
+
data: z.z.object({
|
|
807
807
|
userAddress: vault_schema.EvmAddress
|
|
808
808
|
}),
|
|
809
|
-
identifier:
|
|
809
|
+
identifier: z.z.string()
|
|
810
810
|
});
|
|
811
811
|
/**
|
|
812
812
|
* IsVerifiedResponse
|
|
813
813
|
*/
|
|
814
|
-
var IsVerifiedResponse =
|
|
815
|
-
type:
|
|
816
|
-
isVerified:
|
|
817
|
-
identifier:
|
|
814
|
+
var IsVerifiedResponse = z.z.object({
|
|
815
|
+
type: z.z.literal("isVerifiedResponse"),
|
|
816
|
+
isVerified: z.z["boolean"](),
|
|
817
|
+
identifier: z.z.string()
|
|
818
818
|
});
|
|
819
819
|
/**
|
|
820
820
|
* GetTxAuthSigRequest
|
|
821
821
|
*/
|
|
822
|
-
var GetTxAuthSigRequest =
|
|
823
|
-
type:
|
|
822
|
+
var GetTxAuthSigRequest = z.z.object({
|
|
823
|
+
type: z.z.literal("getTxAuthSigRequest"),
|
|
824
824
|
data: ApiTxAuthInput,
|
|
825
|
-
identifier:
|
|
825
|
+
identifier: z.z.string()
|
|
826
826
|
});
|
|
827
827
|
/**
|
|
828
828
|
* GetTxAuthSigResponse
|
|
829
829
|
*/
|
|
830
|
-
var GetTxAuthSigResponse =
|
|
831
|
-
type:
|
|
830
|
+
var GetTxAuthSigResponse = z.z.object({
|
|
831
|
+
type: z.z.literal("getTxAuthSigResponse"),
|
|
832
832
|
signatureResponse: GetTxAuthDataSignatureResponse,
|
|
833
|
-
identifier:
|
|
833
|
+
identifier: z.z.string()
|
|
834
834
|
});
|
|
835
835
|
/**
|
|
836
836
|
* GetTxAuthSigRequest Tezos
|
|
837
837
|
*/
|
|
838
|
-
var GetTxAuthSigRequestTezos =
|
|
839
|
-
type:
|
|
838
|
+
var GetTxAuthSigRequestTezos = z.z.object({
|
|
839
|
+
type: z.z.literal("getTxAuthSigRequestTezos"),
|
|
840
840
|
data: ApiTezosTxAuthInput,
|
|
841
|
-
identifier:
|
|
841
|
+
identifier: z.z.string()
|
|
842
842
|
});
|
|
843
843
|
/**
|
|
844
844
|
* GetTxAuthSigResponse Tezos
|
|
845
845
|
*/
|
|
846
|
-
var GetTxAuthSigResponseTezos =
|
|
847
|
-
type:
|
|
846
|
+
var GetTxAuthSigResponseTezos = z.z.object({
|
|
847
|
+
type: z.z.literal("getTezosTxAuthSigResponse"),
|
|
848
848
|
signatureResponse: GetTezosTxAuthDataSignatureResponse,
|
|
849
|
-
identifier:
|
|
849
|
+
identifier: z.z.string()
|
|
850
850
|
});
|
|
851
|
-
var HostRequestMessage =
|
|
852
|
-
var IdentityResponseMessage =
|
|
851
|
+
var HostRequestMessage = z.z.union([GetCredentialsRequest, PolygonIdRequest, StartFlowRequest, IsVerifiedRequest, GetTxAuthSigRequest, GetTxAuthSigRequestTezos]);
|
|
852
|
+
var IdentityResponseMessage = z.z.union([GetCredentialsResponse, PolygonIdResponse, IsVerifiedResponse, GetTxAuthSigResponse, GetTxAuthSigResponseTezos]);
|
|
853
853
|
|
|
854
854
|
/**
|
|
855
855
|
* Wallet challenge parameters
|
|
856
856
|
*/
|
|
857
857
|
|
|
858
|
-
var GenerateWalletChallengeRequest =
|
|
858
|
+
var GenerateWalletChallengeRequest = z.z.object({
|
|
859
859
|
address: vault_schema.BlockchainAddress,
|
|
860
860
|
namespace: vault_schema.SupportedBlockchainNamespaceForSignatureAuth,
|
|
861
861
|
blockchainId: vault_schema.BlockchainId.optional(),
|
|
862
|
-
origin:
|
|
862
|
+
origin: z.z.string().url(),
|
|
863
863
|
workflowId: vault_schema.WorkflowId,
|
|
864
864
|
externalCustomerId: vault_schema.ExternalCustomerId.optional(),
|
|
865
865
|
additionalInformation: vault_schema.AdditionalCustomerInformationParams.optional()
|
|
866
866
|
});
|
|
867
|
-
var AuthSession =
|
|
867
|
+
var AuthSession = z.z.object({
|
|
868
868
|
// JWT token containing user authentication data
|
|
869
869
|
// Generated by the Identity-api using the IdentityWidgetAccessToken_NEW schema
|
|
870
870
|
// Used for user identification in the identity-v2-app
|
|
871
871
|
// We don't want users to rely on the structure of the token so we expose it as a string
|
|
872
|
-
token:
|
|
872
|
+
token: z.z.string(),
|
|
873
873
|
// the timestamp at which the session will expire
|
|
874
874
|
// in seconds since epoch to avoid timezone issues and date parsing errors
|
|
875
875
|
// this is exposed in case the app needs to store the session so it knows when
|
|
876
876
|
// the session becomes invalid again
|
|
877
877
|
// We don't want users to rely on the fact that the token is a JWT, as we
|
|
878
878
|
// want to change to openId in the future, so we expose the expiration as a number
|
|
879
|
-
expiresAt:
|
|
879
|
+
expiresAt: z.z.number(),
|
|
880
880
|
// if an external customer id was provided, it will be returned
|
|
881
881
|
// when obtaining the auth session to facilitate integration with the user's system
|
|
882
882
|
externalCustomerId: vault_schema.ExternalCustomerId.optional()
|
|
883
883
|
});
|
|
884
|
-
var AuthSessionData =
|
|
884
|
+
var AuthSessionData = z.z.object({
|
|
885
885
|
/**
|
|
886
886
|
* The unique identifier of the user
|
|
887
887
|
*/
|
|
888
|
-
identityId:
|
|
888
|
+
identityId: z.z.string(),
|
|
889
889
|
/**
|
|
890
890
|
* The unique identifier of the user's session
|
|
891
891
|
*/
|
|
892
|
-
customerId:
|
|
892
|
+
customerId: z.z.string(),
|
|
893
893
|
/**
|
|
894
894
|
* The identifier passed by the user platform
|
|
895
895
|
*/
|
|
896
896
|
externalCustomerId: vault_schema.ExternalCustomerId.optional()
|
|
897
897
|
});
|
|
898
|
-
var ChallengeResponse =
|
|
899
|
-
challenge:
|
|
898
|
+
var ChallengeResponse = z.z.object({
|
|
899
|
+
challenge: z.z.string()
|
|
900
900
|
});
|
|
901
901
|
////////////////
|
|
902
902
|
// SDK messages
|
|
903
903
|
////////////////
|
|
904
904
|
|
|
905
|
-
var AppConfigRequest =
|
|
906
|
-
type:
|
|
907
|
-
data:
|
|
905
|
+
var AppConfigRequest = z.z.object({
|
|
906
|
+
type: z.z.literal("appConfig"),
|
|
907
|
+
data: z.z.object({
|
|
908
908
|
authSession: AuthSession
|
|
909
909
|
})
|
|
910
910
|
});
|
|
911
|
-
var WalletUpdated =
|
|
912
|
-
type:
|
|
913
|
-
data:
|
|
911
|
+
var WalletUpdated = z.z.object({
|
|
912
|
+
type: z.z.literal("walletUpdated"),
|
|
913
|
+
data: z.z.object({
|
|
914
914
|
address: vault_schema.BlockchainAddress
|
|
915
915
|
})
|
|
916
916
|
});
|
|
917
|
-
var WalletSignResponse =
|
|
918
|
-
type:
|
|
919
|
-
data:
|
|
920
|
-
message:
|
|
917
|
+
var WalletSignResponse = z.z.object({
|
|
918
|
+
type: z.z.literal("walletSignResponse"),
|
|
919
|
+
data: z.z.object({
|
|
920
|
+
message: z.z.string(),
|
|
921
921
|
signature: vault_schema.BlockchainSignature
|
|
922
922
|
})
|
|
923
923
|
});
|
|
924
|
-
var TxAuthDataSignatureGatingRequest =
|
|
925
|
-
type:
|
|
926
|
-
data:
|
|
924
|
+
var TxAuthDataSignatureGatingRequest = z.z.object({
|
|
925
|
+
type: z.z.literal("txAuthDataSignatureGatingRequest"),
|
|
926
|
+
data: z.z.object({
|
|
927
927
|
input: AnyTxAuthInputJsSdk
|
|
928
928
|
})
|
|
929
929
|
});
|
|
930
|
-
var GetCustomerStatusRequest =
|
|
931
|
-
type:
|
|
930
|
+
var GetCustomerStatusRequest = z.z.object({
|
|
931
|
+
type: z.z.literal("getCustomerStatusRequest")
|
|
932
932
|
});
|
|
933
|
-
var IdentitySdkMessage =
|
|
934
|
-
var IdentitySdkMessageWithIdentifier =
|
|
935
|
-
identifier:
|
|
933
|
+
var IdentitySdkMessage = z.z.union([AppConfigRequest, WalletUpdated, WalletSignResponse, TransactionResponse, TxAuthDataSignatureGatingRequest, GetCustomerStatusRequest]);
|
|
934
|
+
var IdentitySdkMessageWithIdentifier = z.z.intersection(IdentitySdkMessage, z.z.object({
|
|
935
|
+
identifier: z.z.string()
|
|
936
936
|
}));
|
|
937
937
|
////////////////
|
|
938
938
|
// App messages
|
|
939
939
|
////////////////
|
|
940
940
|
|
|
941
|
-
var IdentityAppLoadedNotification =
|
|
942
|
-
type:
|
|
941
|
+
var IdentityAppLoadedNotification = z.z.object({
|
|
942
|
+
type: z.z.literal("identityAppLoaded")
|
|
943
943
|
});
|
|
944
|
-
var IdentityAppConfiguredNotification =
|
|
945
|
-
type:
|
|
946
|
-
data:
|
|
944
|
+
var IdentityAppConfiguredNotification = z.z.object({
|
|
945
|
+
type: z.z.literal("identityAppConfigured"),
|
|
946
|
+
data: z.z.object({
|
|
947
947
|
auth: AuthSession
|
|
948
948
|
})
|
|
949
949
|
});
|
|
950
|
-
var AuthenticationExpiredNotification =
|
|
951
|
-
type:
|
|
952
|
-
data:
|
|
950
|
+
var AuthenticationExpiredNotification = z.z.object({
|
|
951
|
+
type: z.z.literal("authenticationExpired"),
|
|
952
|
+
data: z.z.object({
|
|
953
953
|
authSession: AuthSession
|
|
954
954
|
})
|
|
955
955
|
});
|
|
956
|
-
var WalletSignRequest =
|
|
957
|
-
type:
|
|
958
|
-
data:
|
|
959
|
-
message:
|
|
956
|
+
var WalletSignRequest = z.z.object({
|
|
957
|
+
type: z.z.literal("walletSignRequest"),
|
|
958
|
+
data: z.z.object({
|
|
959
|
+
message: z.z.string()
|
|
960
960
|
})
|
|
961
961
|
});
|
|
962
|
-
var TxAuthDataSignatureResponse =
|
|
963
|
-
type:
|
|
962
|
+
var TxAuthDataSignatureResponse = z.z.object({
|
|
963
|
+
type: z.z.literal("txAuthDataSignatureResponse"),
|
|
964
964
|
data: AnyTxAuthDataSignatureResponse
|
|
965
965
|
});
|
|
966
|
-
var TxAuthDataSignatureGatingError =
|
|
967
|
-
type:
|
|
968
|
-
data:
|
|
969
|
-
error:
|
|
966
|
+
var TxAuthDataSignatureGatingError = z.z.object({
|
|
967
|
+
type: z.z.literal("txAuthDataSignatureGatingError"),
|
|
968
|
+
data: z.z.object({
|
|
969
|
+
error: z.z.string()
|
|
970
970
|
})
|
|
971
971
|
});
|
|
972
|
-
var GetCustomerStatusResponse =
|
|
973
|
-
type:
|
|
974
|
-
data:
|
|
972
|
+
var GetCustomerStatusResponse = z.z.object({
|
|
973
|
+
type: z.z.literal("getCustomerStatusResponse"),
|
|
974
|
+
data: z.z.union([vault_schema.CustomerStatus, z.z["null"]()])
|
|
975
975
|
});
|
|
976
|
-
var IdentityAppMessage =
|
|
976
|
+
var IdentityAppMessage = z.z.union([IdentityAppLoadedNotification, IdentityAppConfiguredNotification, AuthenticationExpiredNotification, WalletSignRequest, TxAuthDataSignatureResponse, TxAuthDataSignatureGatingError, GetCustomerStatusResponse,
|
|
977
977
|
// `identifier` is a technical detail that should not be exposed to the app
|
|
978
978
|
KycCompletionNotification.omit({
|
|
979
979
|
identifier: true
|
|
@@ -986,76 +986,76 @@ KycCompletionNotification.omit({
|
|
|
986
986
|
}), SendTransactionRequest.omit({
|
|
987
987
|
identifier: true
|
|
988
988
|
})]);
|
|
989
|
-
var IdentityWallet =
|
|
989
|
+
var IdentityWallet = z.z.object({
|
|
990
990
|
address: vault_schema.BlockchainAddress,
|
|
991
991
|
namespace: vault_schema.SupportedBlockchainNamespaceForSignatureAuth
|
|
992
992
|
});
|
|
993
993
|
|
|
994
|
-
var ZKPRequest =
|
|
995
|
-
id:
|
|
996
|
-
circuitId:
|
|
997
|
-
optional:
|
|
994
|
+
var ZKPRequest = z.z.object({
|
|
995
|
+
id: z.z.number(),
|
|
996
|
+
circuitId: z.z["enum"](["credentialAtomicQuerySigV2", "credentialAtomicQuerySigV2OnChain"]),
|
|
997
|
+
optional: z.z["boolean"]().optional(),
|
|
998
998
|
query: QueryConfigSimplified
|
|
999
999
|
});
|
|
1000
|
-
var ZKPRequestFromZKVerifier =
|
|
1001
|
-
id:
|
|
1002
|
-
circuitId:
|
|
1003
|
-
optional:
|
|
1004
|
-
query:
|
|
1000
|
+
var ZKPRequestFromZKVerifier = z.z.object({
|
|
1001
|
+
id: z.z.number(),
|
|
1002
|
+
circuitId: z.z.string(),
|
|
1003
|
+
optional: z.z["boolean"]().optional(),
|
|
1004
|
+
query: z.z.record(z.z.unknown())
|
|
1005
1005
|
});
|
|
1006
|
-
var PrivacyPreservingMonitoring =
|
|
1007
|
-
requestingAuthorizationMessage:
|
|
1008
|
-
zkpRequest:
|
|
1006
|
+
var PrivacyPreservingMonitoring = z.z.object({
|
|
1007
|
+
requestingAuthorizationMessage: z.z.string().nullish(),
|
|
1008
|
+
zkpRequest: z.z.array(ZKPRequest).nullish()
|
|
1009
1009
|
});
|
|
1010
|
-
var CreateAuthRequestProps =
|
|
1011
|
-
hostUrl:
|
|
1010
|
+
var CreateAuthRequestProps = z.z.object({
|
|
1011
|
+
hostUrl: z.z.string().url(),
|
|
1012
1012
|
sessionId: vault_schema.UuidString,
|
|
1013
|
-
audience:
|
|
1014
|
-
callbackURL:
|
|
1015
|
-
query:
|
|
1016
|
-
onChainVerification:
|
|
1017
|
-
id:
|
|
1018
|
-
thid:
|
|
1019
|
-
message:
|
|
1020
|
-
});
|
|
1021
|
-
var AllScenarioExecutionAuthorizationData =
|
|
1013
|
+
audience: z.z.string().describe("DID of the verifier"),
|
|
1014
|
+
callbackURL: z.z.string().describe("URL to which the auth response of the client callback will be sent"),
|
|
1015
|
+
query: z.z.array(QueryConfigSimplified),
|
|
1016
|
+
onChainVerification: z.z["boolean"]().optional(),
|
|
1017
|
+
id: z.z.string().uuid(),
|
|
1018
|
+
thid: z.z.string().uuid(),
|
|
1019
|
+
message: z.z.string().describe("Message shown to the user")
|
|
1020
|
+
});
|
|
1021
|
+
var AllScenarioExecutionAuthorizationData = z.z.object({
|
|
1022
1022
|
executionId: vault_schema.UuidString,
|
|
1023
|
-
projectId:
|
|
1024
|
-
scenarioExecutionIds:
|
|
1023
|
+
projectId: z.z.string(),
|
|
1024
|
+
scenarioExecutionIds: z.z.array(vault_schema.UuidString)
|
|
1025
1025
|
});
|
|
1026
1026
|
var SCENARIO_AUTHORIZATION_STATUSES = ["pending", "authorised", "unauthorised"];
|
|
1027
|
-
var ScenarioAuthorizationStatus =
|
|
1027
|
+
var ScenarioAuthorizationStatus = z.z["enum"](SCENARIO_AUTHORIZATION_STATUSES);
|
|
1028
1028
|
|
|
1029
|
-
var HostMessage =
|
|
1030
|
-
var IdentityMessage =
|
|
1031
|
-
var RequiredDataRowSchema =
|
|
1029
|
+
var HostMessage = z.z.union([HostRequestMessage, HostResponseMessage]);
|
|
1030
|
+
var IdentityMessage = z.z.union([IdentityNotificationMessage, IdentityRequestMessage, IdentityResponseMessage]);
|
|
1031
|
+
var RequiredDataRowSchema = z.z.object({
|
|
1032
1032
|
type: CredentialType,
|
|
1033
|
-
requiredAttributes:
|
|
1034
|
-
attribute:
|
|
1035
|
-
value:
|
|
1036
|
-
operator:
|
|
1033
|
+
requiredAttributes: z.z.array(z.z.object({
|
|
1034
|
+
attribute: z.z.string(),
|
|
1035
|
+
value: z.z.string(),
|
|
1036
|
+
operator: z.z.string()
|
|
1037
1037
|
}))
|
|
1038
1038
|
});
|
|
1039
|
-
var RequiredVerificationData =
|
|
1040
|
-
ruleEngine:
|
|
1041
|
-
requiredData:
|
|
1039
|
+
var RequiredVerificationData = z.z.object({
|
|
1040
|
+
ruleEngine: z.z.object({
|
|
1041
|
+
requiredData: z.z.array(RequiredDataRowSchema)
|
|
1042
1042
|
}),
|
|
1043
|
-
PrivacyPreservingMonitoring:
|
|
1044
|
-
requiredData:
|
|
1045
|
-
verifications:
|
|
1046
|
-
scenarioVerifierAddress:
|
|
1047
|
-
conditions:
|
|
1043
|
+
PrivacyPreservingMonitoring: z.z.object({
|
|
1044
|
+
requiredData: z.z.array(RequiredDataRowSchema),
|
|
1045
|
+
verifications: z.z.array(z.z.object({
|
|
1046
|
+
scenarioVerifierAddress: z.z.string(),
|
|
1047
|
+
conditions: z.z.array(ZKPRequest)
|
|
1048
1048
|
}))
|
|
1049
1049
|
}),
|
|
1050
|
-
tfhe:
|
|
1051
|
-
requiredData:
|
|
1052
|
-
verifications:
|
|
1050
|
+
tfhe: z.z.object({
|
|
1051
|
+
requiredData: z.z.array(RequiredDataRowSchema),
|
|
1052
|
+
verifications: z.z.array(QueryConfigSimplified)
|
|
1053
1053
|
})
|
|
1054
1054
|
});
|
|
1055
1055
|
|
|
1056
|
-
var WalletSignatureResponse =
|
|
1056
|
+
var WalletSignatureResponse = z.z.object({
|
|
1057
1057
|
// the message we requested the user to sign
|
|
1058
|
-
message:
|
|
1058
|
+
message: z.z.string(),
|
|
1059
1059
|
// the signature of the message
|
|
1060
1060
|
signature: vault_schema.BlockchainSignature,
|
|
1061
1061
|
// some wallets like Cardano Nami generate a new address for each transaction or signature
|
|
@@ -1064,12 +1064,12 @@ var WalletSignatureResponse = zod.z.object({
|
|
|
1064
1064
|
// the type of the signer's public key
|
|
1065
1065
|
// this is optional because some wallets don't provide this information
|
|
1066
1066
|
// but for other wallets like cosmos kepler, this is required to verify the signature
|
|
1067
|
-
signerPublicKeyType:
|
|
1067
|
+
signerPublicKeyType: z.z.string().optional(),
|
|
1068
1068
|
// some wallets like Aptos Petra wrap the message in some text metadata before signing
|
|
1069
1069
|
// this means the user doesn't sign the message directly, but a message that contains the original message
|
|
1070
|
-
signedMessage:
|
|
1070
|
+
signedMessage: z.z.string()
|
|
1071
1071
|
});
|
|
1072
|
-
var VerifyWalletChallengeRequest = WalletSignatureResponse.and(
|
|
1072
|
+
var VerifyWalletChallengeRequest = WalletSignatureResponse.and(z.z.object({
|
|
1073
1073
|
address: vault_schema.BlockchainAddress,
|
|
1074
1074
|
namespace: vault_schema.SupportedBlockchainNamespaceForSignatureAuth,
|
|
1075
1075
|
blockchainId: vault_schema.BlockchainId.optional()
|