@nexeraid/identity-schemas 2.65.0 → 2.67.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/{CoinMarketCap.schema-9db73f74.cjs.dev.cjs → CoinMarketCap.schema-25910ca1.cjs.dev.cjs} +26 -201
- package/dist/{CoinMarketCap.schema-9200bd52.esm.mjs → CoinMarketCap.schema-863fe4bf.esm.mjs} +5 -166
- package/dist/{CoinMarketCap.schema-2c92523f.cjs.prod.cjs → CoinMarketCap.schema-9b46e91a.cjs.prod.cjs} +26 -201
- package/dist/declarations/src/blockchain/namespaces.schema.d.ts +5 -15
- package/dist/declarations/src/blockchain/namespaces.schema.d.ts.map +1 -1
- package/dist/declarations/src/countries.schema.d.ts +6 -1
- package/dist/declarations/src/countries.schema.d.ts.map +1 -1
- package/dist/declarations/src/customer.schema.d.ts +0 -7
- package/dist/declarations/src/customer.schema.d.ts.map +1 -1
- package/dist/declarations/src/identity-ids.schema.d.ts +6 -18
- package/dist/declarations/src/identity-ids.schema.d.ts.map +1 -1
- package/dist/declarations/src/index.d.ts +1 -0
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/declarations/src/nexeraSSID.schema.d.ts +9 -9
- package/dist/declarations/src/providers/big/BIGBitRankVerifiedScore.schema.d.ts +24 -24
- package/dist/declarations/src/providers/chainalysis/chainalysis.schema.d.ts +12 -12
- package/dist/declarations/src/providers/comply-advantage/comply-advantage.schema.d.ts +122 -122
- package/dist/declarations/src/providers/kyc-sessions.schema.d.ts +12 -12
- package/dist/declarations/src/providers/merkle-science/merkle-science.schema.d.ts +26 -26
- package/dist/declarations/src/providers/provider.schema.d.ts +319 -1243
- package/dist/declarations/src/providers/provider.schema.d.ts.map +1 -1
- package/dist/declarations/src/providers/scorechain/allScorechainBlockchains.schema.d.ts +1153 -0
- package/dist/declarations/src/providers/scorechain/allScorechainBlockchains.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/scorechain/scorechain.schema.d.ts +3472 -351
- package/dist/declarations/src/providers/scorechain/scorechain.schema.d.ts.map +1 -1
- package/dist/declarations/src/providers/sumsub/sumsub-applicant.schema.d.ts +281 -281
- package/dist/declarations/src/providers/sumsub/sumsub.schema.d.ts +10 -10
- package/dist/declarations/src/vault/schemas/generated/Customer.schema.json.d.ts +785 -1
- package/dist/declarations/src/vault/schemas/generated/Customer.type.d.ts +16 -1
- package/dist/declarations/src/vault/schemas/generated/Customer.type.d.ts.map +1 -1
- package/dist/declarations/src/vault/vault.schema.d.ts +146 -19
- package/dist/declarations/src/vault/vault.schema.d.ts.map +1 -1
- package/dist/declarations/src/wallet-screening.schema.d.ts +81 -0
- package/dist/declarations/src/wallet-screening.schema.d.ts.map +1 -0
- package/dist/declarations/src/webhooks/send-verification-flow-webhook.schema.d.ts +3189 -14681
- package/dist/declarations/src/webhooks/send-verification-flow-webhook.schema.d.ts.map +1 -1
- package/dist/declarations/src/webhooks/svix.webhooks.schema.d.ts +4201 -71554
- package/dist/declarations/src/webhooks/svix.webhooks.schema.d.ts.map +1 -1
- package/dist/identity-api.schema-095969b9.cjs.prod.cjs +1308 -0
- package/dist/identity-api.schema-36a2a1b2.esm.mjs +1113 -0
- package/dist/identity-api.schema-8829a875.cjs.dev.cjs +1308 -0
- package/dist/nexeraid-identity-schemas.cjs.dev.cjs +323 -327
- package/dist/nexeraid-identity-schemas.cjs.prod.cjs +323 -327
- package/dist/nexeraid-identity-schemas.esm.mjs +4 -4
- package/dist/package.json +1 -1
- package/dist/{tfhe-utilities-8b80d9aa.cjs.dev.cjs → tfhe-utilities-03589c6a.cjs.dev.cjs} +2 -2
- package/dist/{tfhe-utilities-151f4537.esm.mjs → tfhe-utilities-1fc75756.esm.mjs} +2 -2
- package/dist/{tfhe-utilities-24730089.cjs.prod.cjs → tfhe-utilities-6b015591.cjs.prod.cjs} +2 -2
- package/dist/{vault.schema-cc3c5ffc.esm.mjs → vault.schema-1c1dcdb7.esm.mjs} +2510 -82
- package/dist/{vault.schema-91f2c199.cjs.prod.cjs → vault.schema-7ed4edcb.cjs.dev.cjs} +2753 -104
- package/dist/{vault.schema-958064b8.cjs.dev.cjs → vault.schema-cc989cdf.cjs.prod.cjs} +2753 -104
- package/identity/dist/nexeraid-identity-schemas-identity.cjs.dev.cjs +3 -3
- package/identity/dist/nexeraid-identity-schemas-identity.cjs.prod.cjs +3 -3
- package/identity/dist/nexeraid-identity-schemas-identity.esm.mjs +3 -3
- package/package.json +2 -2
- package/providers/dist/nexeraid-identity-schemas-providers.cjs.dev.cjs +1190 -18
- package/providers/dist/nexeraid-identity-schemas-providers.cjs.prod.cjs +1190 -18
- package/providers/dist/nexeraid-identity-schemas-providers.esm.mjs +1158 -5
- package/vault/dist/nexeraid-identity-schemas-vault.cjs.dev.cjs +2 -1
- package/vault/dist/nexeraid-identity-schemas-vault.cjs.prod.cjs +2 -1
- package/vault/dist/nexeraid-identity-schemas-vault.esm.mjs +2 -1
- package/verifiable-credentials/dist/nexeraid-identity-schemas-verifiable-credentials.cjs.dev.cjs +4 -4
- package/verifiable-credentials/dist/nexeraid-identity-schemas-verifiable-credentials.cjs.prod.cjs +4 -4
- package/verifiable-credentials/dist/nexeraid-identity-schemas-verifiable-credentials.esm.mjs +4 -4
- package/webhooks/dist/nexeraid-identity-schemas-webhooks.cjs.dev.cjs +34 -58
- package/webhooks/dist/nexeraid-identity-schemas-webhooks.cjs.prod.cjs +34 -58
- package/webhooks/dist/nexeraid-identity-schemas-webhooks.esm.mjs +10 -31
- package/dist/identity-api.schema-60af6079.esm.mjs +0 -1751
- package/dist/identity-api.schema-63ee6cfc.cjs.dev.cjs +0 -2139
- package/dist/identity-api.schema-9119d895.cjs.prod.cjs +0 -2139
|
@@ -0,0 +1,1113 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { cM as IDImageCredentialSubjectSchema, cO as ProofOfResidenceCredentialSubjectSchema, cN as SelfieImageCredentialSubjectSchema, cL as IDInformationCredentialSubjectSchema, cK as IDInformationTfheCredentialSubjectSchema, cJ as OLD_AMLScreeningsResultsCredentialSubjectSchema, cB as ID3CredentialSubjectSchema, cC as IDScanCredentialSubjectSchema, cE as IDScanSelfieCredentialSubjectSchema, cD as IDScanPassportCredentialSubjectSchema, dV as _defineProperty, dM as VaultMetadataLinkZodSchema, c6 as QueryId, aS as UuidString, ar as BlockchainAddress, c4 as ScenarioId, cs as WorkspaceId, as as String0x, aN as BlockchainSignature, aa as TxHash, ct as WorkflowId, g as EvmChainId, a9 as AddressSchema, aD as EIP155Signature, T as TezosChainId, ah as TezosContractAddress, aP as TezosEntrypointName, ag as TezosImplicitAddress, aI as EdSignature, av as BlockchainNamespace, cP as GenericVerifiableCredentialSchema, ax as SupportedBlockchainNamespaceForSignatureAuth, B as BlockchainId, cv as ExternalCustomerId, cq as AdditionalCustomerInformationParams, a8 as PublicKey } from './vault.schema-1c1dcdb7.esm.mjs';
|
|
3
|
+
|
|
4
|
+
var CredentialSchemas = {
|
|
5
|
+
ProofOfResidence: ProofOfResidenceCredentialSubjectSchema,
|
|
6
|
+
SelfieImage: SelfieImageCredentialSubjectSchema,
|
|
7
|
+
IDImage: IDImageCredentialSubjectSchema,
|
|
8
|
+
IDInformation: IDInformationCredentialSubjectSchema,
|
|
9
|
+
IDInformationTfhe: IDInformationTfheCredentialSubjectSchema,
|
|
10
|
+
AMLScreeningsResults: OLD_AMLScreeningsResultsCredentialSubjectSchema,
|
|
11
|
+
ID3: ID3CredentialSubjectSchema,
|
|
12
|
+
IDScan: IDScanCredentialSubjectSchema,
|
|
13
|
+
IDScanSelfie: IDScanSelfieCredentialSubjectSchema,
|
|
14
|
+
IDScanPassport: IDScanPassportCredentialSubjectSchema
|
|
15
|
+
};
|
|
16
|
+
var CredentialNames = [{
|
|
17
|
+
value: "AMLScreeningsResults",
|
|
18
|
+
label: "AML screening results"
|
|
19
|
+
}, {
|
|
20
|
+
value: "ProofOfResidence",
|
|
21
|
+
label: "Proof of residence"
|
|
22
|
+
}, {
|
|
23
|
+
value: "SelfieImage",
|
|
24
|
+
label: "Selfie image"
|
|
25
|
+
}, {
|
|
26
|
+
value: "IDImage",
|
|
27
|
+
label: "ID image"
|
|
28
|
+
}, {
|
|
29
|
+
value: "IDInformation",
|
|
30
|
+
label: "ID information"
|
|
31
|
+
}, {
|
|
32
|
+
value: "IDInformationTfhe",
|
|
33
|
+
label: "ID information for TFHE"
|
|
34
|
+
}];
|
|
35
|
+
var CredentialTypes = ["AMLScreeningsResults", "ProofOfResidence", "SelfieImage", "IDImage", "IDInformation", "IDInformationTfhe", "ID3",
|
|
36
|
+
// this is for backwards compatibility
|
|
37
|
+
"IDScan",
|
|
38
|
+
// this is for backwards compatibility
|
|
39
|
+
"IDScanSelfie",
|
|
40
|
+
// this is for backwards compatibility
|
|
41
|
+
"IDScanPassport" // this is for backwards compatibility
|
|
42
|
+
];
|
|
43
|
+
var NexeraCredentialType = z["enum"](CredentialTypes);
|
|
44
|
+
var getCredentialName = function getCredentialName(value) {
|
|
45
|
+
var _CredentialNames$find;
|
|
46
|
+
return (_CredentialNames$find = CredentialNames.find(function (obj) {
|
|
47
|
+
return obj.value === value;
|
|
48
|
+
})) === null || _CredentialNames$find === void 0 ? void 0 : _CredentialNames$find.label;
|
|
49
|
+
};
|
|
50
|
+
var CredentialType = z.string().transform(function (x) {
|
|
51
|
+
return x.replace("_", "-");
|
|
52
|
+
}) // TODO determine why this is needed
|
|
53
|
+
.pipe(z["enum"](CredentialTypes));
|
|
54
|
+
// Should this be replaced by GenericVerifiableCredentialSchema?
|
|
55
|
+
|
|
56
|
+
var VerifiableCredential = z.object({
|
|
57
|
+
issuer: z.string(),
|
|
58
|
+
type: z.array(z.union([z.string(), CredentialType])),
|
|
59
|
+
credentialSubject: z.record(z.unknown())
|
|
60
|
+
}).catchall(z.any());
|
|
61
|
+
var CredentialMediaType = IDImageCredentialSubjectSchema.shape.mediaType_front;
|
|
62
|
+
|
|
63
|
+
// Request
|
|
64
|
+
|
|
65
|
+
var MediaType = /*#__PURE__*/function (MediaType) {
|
|
66
|
+
MediaType["ZKPMessage"] = "application/iden3-zkp-json";
|
|
67
|
+
MediaType["PlainMessage"] = "application/iden3comm-plain-json";
|
|
68
|
+
MediaType["SignedMessage"] = "application/iden3comm-signed-json";
|
|
69
|
+
return MediaType;
|
|
70
|
+
}({});
|
|
71
|
+
var MediaTypePID = z.nativeEnum(MediaType);
|
|
72
|
+
var CIRCUIT_IDS = ["authV2", "stateTransition", "credentialAtomicQueryMTPV2", "credentialAtomicQueryMTPV2OnChain", "credentialAtomicQuerySigV2", "credentialAtomicQuerySigV2OnChain", "credentialAtomicQueryV3-beta.1", "credentialAtomicQueryV3OnChain-beta.1", "linkedMultiQuery10-beta.1"];
|
|
73
|
+
var CircuitId = z["enum"](CIRCUIT_IDS);
|
|
74
|
+
var ZeroKnowledgeProofRequest = z.object({
|
|
75
|
+
id: z.number(),
|
|
76
|
+
circuitId: z.string(),
|
|
77
|
+
optional: z["boolean"]().optional(),
|
|
78
|
+
query: z.record(z.string(), z.any())
|
|
79
|
+
});
|
|
80
|
+
var AUTHORIZATION_REQUEST_MESSAGE_TYPES = {
|
|
81
|
+
AUTHORIZATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/authorization/1.0/request",
|
|
82
|
+
AUTHORIZATION_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/authorization/1.0/response",
|
|
83
|
+
CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/issuance-request",
|
|
84
|
+
CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/fetch-request",
|
|
85
|
+
CREDENTIAL_OFFER_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/offer",
|
|
86
|
+
CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/issuance-response",
|
|
87
|
+
CREDENTIAL_REFRESH_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/refresh",
|
|
88
|
+
DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/devices/1.0/registration",
|
|
89
|
+
MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/messages/1.0/fetch",
|
|
90
|
+
PROOF_GENERATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/request",
|
|
91
|
+
PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/response",
|
|
92
|
+
REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/revocation/1.0/request-status",
|
|
93
|
+
REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/revocation/1.0/status",
|
|
94
|
+
CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/contract-invoke-request",
|
|
95
|
+
CONTRACT_INVOKE_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/contract-invoke-response",
|
|
96
|
+
CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/onchain-offer",
|
|
97
|
+
PROPOSAL_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/proposal-request",
|
|
98
|
+
PROPOSAL_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/proposal",
|
|
99
|
+
PAYMENT_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/payment-request",
|
|
100
|
+
PAYMENT_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/payment"
|
|
101
|
+
};
|
|
102
|
+
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"];
|
|
103
|
+
var AuthorizationRequestMessageType = z["enum"](AuthorizationRequestMessageTypes);
|
|
104
|
+
var AuthorizationRequestMessage = z.object({
|
|
105
|
+
id: z.string(),
|
|
106
|
+
typ: MediaTypePID.optional(),
|
|
107
|
+
type: AuthorizationRequestMessageType,
|
|
108
|
+
thid: z.string().optional(),
|
|
109
|
+
body: z.object({
|
|
110
|
+
callbackUrl: z.string(),
|
|
111
|
+
reason: z.string().optional(),
|
|
112
|
+
did_doc: z.any().optional(),
|
|
113
|
+
message: z.string().optional(),
|
|
114
|
+
scope: z.array(ZeroKnowledgeProofRequest)
|
|
115
|
+
}),
|
|
116
|
+
from: z.string(),
|
|
117
|
+
to: z.string().optional()
|
|
118
|
+
});
|
|
119
|
+
// Response
|
|
120
|
+
var ProofData = z.object({
|
|
121
|
+
pi_a: z.array(z.string()),
|
|
122
|
+
pi_b: z.array(z.array(z.string())),
|
|
123
|
+
pi_c: z.array(z.string()),
|
|
124
|
+
protocol: z.string(),
|
|
125
|
+
curve: z.string().optional()
|
|
126
|
+
});
|
|
127
|
+
var ZeroKnowledgeProofResponse = z.object({
|
|
128
|
+
id: z.number(),
|
|
129
|
+
circuitId: z.string(),
|
|
130
|
+
vp: z.any().optional(),
|
|
131
|
+
proof: ProofData,
|
|
132
|
+
pub_signals: z.array(z.string())
|
|
133
|
+
});
|
|
134
|
+
var AuthorizationResponseMessage = z.object({
|
|
135
|
+
id: z.string(),
|
|
136
|
+
typ: MediaTypePID.optional(),
|
|
137
|
+
type: z.string(),
|
|
138
|
+
thid: z.string().optional(),
|
|
139
|
+
body: z.object({
|
|
140
|
+
did_doc: z.any().optional(),
|
|
141
|
+
message: z.string().optional(),
|
|
142
|
+
scope: z.array(ZeroKnowledgeProofResponse)
|
|
143
|
+
}),
|
|
144
|
+
from: z.string().optional(),
|
|
145
|
+
to: z.string().optional()
|
|
146
|
+
});
|
|
147
|
+
// Polygon Wallet
|
|
148
|
+
var CredentialQrCodeData = z.object({
|
|
149
|
+
id: z.string(),
|
|
150
|
+
typ: z.string(),
|
|
151
|
+
type: z.string(),
|
|
152
|
+
thid: z.string(),
|
|
153
|
+
body: z.object({
|
|
154
|
+
url: z.string(),
|
|
155
|
+
credentials: z.unknown()
|
|
156
|
+
}),
|
|
157
|
+
from: z.string(),
|
|
158
|
+
to: z.string()
|
|
159
|
+
});
|
|
160
|
+
var AuthQrCodeData = z.object({
|
|
161
|
+
id: z.string(),
|
|
162
|
+
typ: z.string(),
|
|
163
|
+
type: z.string(),
|
|
164
|
+
thid: z.string(),
|
|
165
|
+
body: z.object({
|
|
166
|
+
callbackUrl: z.string(),
|
|
167
|
+
reason: z.string(),
|
|
168
|
+
scope: z.unknown()
|
|
169
|
+
}),
|
|
170
|
+
from: z.string()
|
|
171
|
+
});
|
|
172
|
+
var QrCodeLinkWithSchemaType = z.object({
|
|
173
|
+
qrCodeLink: z.string().nullish(),
|
|
174
|
+
schemaType: z.string().nullish()
|
|
175
|
+
}).describe("Polygon ID Verifiable Credential Offer, to be consumed by the Polygon ID Wallet");
|
|
176
|
+
function parseIden3Message(input) {
|
|
177
|
+
var prefix = "request_uri=";
|
|
178
|
+
var startIndex = input.indexOf(prefix);
|
|
179
|
+
if (startIndex === -1) {
|
|
180
|
+
throw new Error("Wrong request - request doesn't start with request_uri=");
|
|
181
|
+
}
|
|
182
|
+
return z.string().url().parse(input.substring(startIndex + prefix.length));
|
|
183
|
+
}
|
|
184
|
+
function parseSessionIdFromUrl(urlString) {
|
|
185
|
+
var url = new URL(urlString);
|
|
186
|
+
var params = new URLSearchParams(url.search);
|
|
187
|
+
var sessionId = params.get("sessionID");
|
|
188
|
+
if (!sessionId) {
|
|
189
|
+
throw new Error("No Session Id found in callback url");
|
|
190
|
+
}
|
|
191
|
+
return sessionId;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
var QUERY_LOGIC_OPERATOR = ["AND", "OR"];
|
|
195
|
+
var QueryLogicOperator = z["enum"](QUERY_LOGIC_OPERATOR);
|
|
196
|
+
var OPERATORS = ["$noop",
|
|
197
|
+
// 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
|
|
198
|
+
"$eq",
|
|
199
|
+
// equal to
|
|
200
|
+
"$lt",
|
|
201
|
+
// less than
|
|
202
|
+
"$lte",
|
|
203
|
+
// less than or equal to
|
|
204
|
+
"$gt",
|
|
205
|
+
// greater than
|
|
206
|
+
"$gte",
|
|
207
|
+
// greater than or equal to
|
|
208
|
+
"$in",
|
|
209
|
+
// in
|
|
210
|
+
"$nin",
|
|
211
|
+
// not in
|
|
212
|
+
"$ne",
|
|
213
|
+
// not equal to
|
|
214
|
+
//"$between", // between
|
|
215
|
+
//"$nonbetween", // contains
|
|
216
|
+
"$exists" // exists
|
|
217
|
+
];
|
|
218
|
+
var Operator = z["enum"](OPERATORS);
|
|
219
|
+
var ZKPOperator = z["enum"](OPERATORS).exclude(["$lte", "$gte"]);
|
|
220
|
+
var operatorDisplayMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Operator["enum"].$eq, "="), Operator["enum"].$gt, ">"), Operator["enum"].$lt, "<"), Operator["enum"].$gte, ">="), Operator["enum"].$lte, "<="), Operator["enum"].$ne, "!="), Operator["enum"].$in, "in"), Operator["enum"].$nin, "not in"), Operator["enum"].$noop, "noop"), Operator["enum"].$exists, "exists");
|
|
221
|
+
var ARRAY_OPERATORS = [Operator["enum"].$in, Operator["enum"].$nin, Operator["enum"].$eq, Operator["enum"].$ne
|
|
222
|
+
//Operator.enum.$between,
|
|
223
|
+
//Operator.enum.$nonbetween,
|
|
224
|
+
];
|
|
225
|
+
var ArrayOperator = z["enum"](ARRAY_OPERATORS);
|
|
226
|
+
var STRING_OPERATORS = [Operator["enum"].$eq, Operator["enum"].$ne, Operator["enum"].$in, Operator["enum"].$nin, Operator["enum"].$exists];
|
|
227
|
+
var StringOperator = z["enum"](STRING_OPERATORS);
|
|
228
|
+
var NUMERIC_OPERATORS = [Operator["enum"].$eq, Operator["enum"].$ne, Operator["enum"].$gt, Operator["enum"].$gte, Operator["enum"].$lt, Operator["enum"].$lte
|
|
229
|
+
//Operator.enum.$between,
|
|
230
|
+
//Operator.enum.$nonbetween,
|
|
231
|
+
];
|
|
232
|
+
var NumericOperator = z["enum"](NUMERIC_OPERATORS);
|
|
233
|
+
var BOOLEAN_OPERATORS = [Operator["enum"].$eq, Operator["enum"].$ne];
|
|
234
|
+
var BooleanOperator = z["enum"](BOOLEAN_OPERATORS);
|
|
235
|
+
var DATE_OPERATORS = [Operator["enum"].$eq, Operator["enum"].$ne, Operator["enum"].$gt, Operator["enum"].$gte, Operator["enum"].$lt, Operator["enum"].$lte
|
|
236
|
+
//Operator.enum.$between,
|
|
237
|
+
//Operator.enum.$nonbetween,
|
|
238
|
+
];
|
|
239
|
+
var DateOperator = z["enum"](DATE_OPERATORS);
|
|
240
|
+
var SUPPORTED_TYPES = ["string", "integer", "boolean", "number", "array", "date", "decimal"];
|
|
241
|
+
var SupportedType = z["enum"](SUPPORTED_TYPES);
|
|
242
|
+
var SupportedTypes = z.object(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_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));
|
|
243
|
+
var IDInformationTfhe = z.object({
|
|
244
|
+
type: z.literal("IDInformationTfhe"),
|
|
245
|
+
requestId: z.coerce.number().nullish(),
|
|
246
|
+
attribute: z.string(),
|
|
247
|
+
value: z.string(),
|
|
248
|
+
operator: Operator
|
|
249
|
+
});
|
|
250
|
+
var AllCredentialValues = z.union([z["boolean"](), z.string(), z.number(), z.array(z.string()), z.array(z.number())]);
|
|
251
|
+
var QueriesOptions = z.array(z.object({
|
|
252
|
+
title: z.string(),
|
|
253
|
+
link: VaultMetadataLinkZodSchema
|
|
254
|
+
}));
|
|
255
|
+
var QueryType = z["enum"](["IDInformation", "IDInformationTfhe", "SelfieImage", "IDImage", "ProofOfResidence", "AMLScreeningsResults",
|
|
256
|
+
// backwards compatibility
|
|
257
|
+
"ID3",
|
|
258
|
+
// this is for backwards compatibility
|
|
259
|
+
"IDScan",
|
|
260
|
+
// this is for backwards compatibility
|
|
261
|
+
"IDScanSelfie",
|
|
262
|
+
// this is for backwards compatibility
|
|
263
|
+
"IDScanPassport" // this is for backwards compatibility
|
|
264
|
+
]);
|
|
265
|
+
var QueryConfigTfhe = z.object({
|
|
266
|
+
type: z.literal("IDInformationTfhe"),
|
|
267
|
+
requestId: z.coerce.number().nullish(),
|
|
268
|
+
attribute: z.string(),
|
|
269
|
+
value: z.string(),
|
|
270
|
+
operator: Operator
|
|
271
|
+
});
|
|
272
|
+
var QueryConfigSimplified = z.object({
|
|
273
|
+
queryId: QueryId.describe("Unique ID for the query").optional(),
|
|
274
|
+
// TODO: this should not be optional?
|
|
275
|
+
id: QueryId.describe("Unique ID for the query").optional(),
|
|
276
|
+
// TODO: this should not be optional?
|
|
277
|
+
requestId: z.coerce.number().nullish().describe("Request ID for ZKPs"),
|
|
278
|
+
attribute: VaultMetadataLinkZodSchema,
|
|
279
|
+
value: AllCredentialValues.nullish(),
|
|
280
|
+
// TODO: Make the value type dynamic based on the attribute type
|
|
281
|
+
operator: Operator // TODO: Make the operator type dynamic based on the attribute type
|
|
282
|
+
});
|
|
283
|
+
var RuleResultQueryConfig = QueryConfigSimplified.extend({
|
|
284
|
+
attribute: z.union([z.string(), VaultMetadataLinkZodSchema]),
|
|
285
|
+
// string for backwards compatibility
|
|
286
|
+
type: QueryType.nullish() // Backwards compatibility
|
|
287
|
+
});
|
|
288
|
+
var PartialQueryConfigSimplified = QueryConfigSimplified.partial();
|
|
289
|
+
var OLD_ChallengeQuerySchema = z.object({
|
|
290
|
+
id: z.string().optional(),
|
|
291
|
+
query: QueryConfigSimplified
|
|
292
|
+
});
|
|
293
|
+
var QueryCredentialTypes = ["IDInformation", "IDInformationTfhe", "IDImage", "SelfieImage", "ProofOfResidence"];
|
|
294
|
+
var QueryCredentialType = z["enum"](QueryCredentialTypes);
|
|
295
|
+
var ChallengeQuerySchema = z.object({
|
|
296
|
+
id: z.string().optional(),
|
|
297
|
+
query: QueryConfigSimplified
|
|
298
|
+
});
|
|
299
|
+
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",
|
|
300
|
+
//"BETWEEN",
|
|
301
|
+
//"NOT_BETWEEN",
|
|
302
|
+
"EXISTS"];
|
|
303
|
+
var OLD_ChallengeQueryOperator = z["enum"](OLD_CHALLENGE_QUERY_OPERATORS);
|
|
304
|
+
var OperatorMappings = {
|
|
305
|
+
toChallenge: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_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),
|
|
306
|
+
fromChallenge: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_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)
|
|
307
|
+
};
|
|
308
|
+
var OperatorToOLD_ChallengeQueryOperator = OperatorMappings.toChallenge;
|
|
309
|
+
var OLD_ChallengeQueryOperatorToOperator = OperatorMappings.fromChallenge;
|
|
310
|
+
|
|
311
|
+
// FIXME: Remove this once we migrate to the vault metadata
|
|
312
|
+
var OLD_QueryCredentialTypes = ["IDInformation", "IDImage", "SelfieImage", "ProofOfResidence", "AMLScreeningsResults", "ID3", "IDScan", "IDScanSelfie", "IDScanPassport"];
|
|
313
|
+
var OLD_QueryCredentialType = z["enum"](OLD_QueryCredentialTypes);
|
|
314
|
+
/**
|
|
315
|
+
* @deprecated Use vault client and services instead
|
|
316
|
+
*
|
|
317
|
+
* FIXME: Have a better way to determine which credentials are required, centralize this logic if possible
|
|
318
|
+
* and with a way that doesn't require looking into the link
|
|
319
|
+
*
|
|
320
|
+
* @param dataLink
|
|
321
|
+
* @returns
|
|
322
|
+
*/
|
|
323
|
+
function getOldCredentialType(dataLink) {
|
|
324
|
+
if (dataLink.path.includes("/vcs/")) {
|
|
325
|
+
var _dataLink$path$split$;
|
|
326
|
+
return (_dataLink$path$split$ = dataLink.path.split("/vcs/")[1]) === null || _dataLink$path$split$ === void 0 ? void 0 : _dataLink$path$split$.split("/")[0];
|
|
327
|
+
}
|
|
328
|
+
var mapping = {
|
|
329
|
+
"Customer/identityData/age": "IDInformation",
|
|
330
|
+
"Customer/identityData/nationality": "IDInformation",
|
|
331
|
+
"Customer/identityData/residence": "ProofOfResidence",
|
|
332
|
+
"Customer/kycStatus/selfieCheckStatus": "SelfieImage",
|
|
333
|
+
"Customer/kycStatus/idImageCheckStatus": "IDImage",
|
|
334
|
+
"Customer/kycStatus/idInformationCheckStatus": "IDInformation",
|
|
335
|
+
"Customer/kycStatus/proofOfResidenceCheckStatus": "ProofOfResidence"
|
|
336
|
+
};
|
|
337
|
+
if (dataLink.path in mapping) {
|
|
338
|
+
return mapping[dataLink.path];
|
|
339
|
+
}
|
|
340
|
+
return undefined;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* @deprecated Use vault client and services instead
|
|
345
|
+
*
|
|
346
|
+
* @param dataLink
|
|
347
|
+
* @returns
|
|
348
|
+
*/
|
|
349
|
+
function getOldCredentialPath(dataLink) {
|
|
350
|
+
if (dataLink.path.includes("credentialSubject")) {
|
|
351
|
+
var _dataLink$path$split$2;
|
|
352
|
+
var path = (_dataLink$path$split$2 = dataLink.path.split("credentialSubject")[1]) !== null && _dataLink$path$split$2 !== void 0 ? _dataLink$path$split$2 : "";
|
|
353
|
+
path = path.startsWith("/") ? path.slice(1) : path;
|
|
354
|
+
path = path.replaceAll("/", ".");
|
|
355
|
+
return path;
|
|
356
|
+
}
|
|
357
|
+
var mapping = {
|
|
358
|
+
"Customer/identityData/age": "personalData.age",
|
|
359
|
+
"Customer/identityData/nationality": "personalData.nationality",
|
|
360
|
+
"Customer/identityData/residence": "personalData.residence"
|
|
361
|
+
};
|
|
362
|
+
if (dataLink.path in mapping) {
|
|
363
|
+
return mapping[dataLink.path];
|
|
364
|
+
}
|
|
365
|
+
return dataLink.path;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* @deprecated Use vault client and services instead
|
|
370
|
+
*/
|
|
371
|
+
function oldCredentialPathToDataLink(path, credentialType) {
|
|
372
|
+
return {
|
|
373
|
+
version: "v1",
|
|
374
|
+
schema: "KycSession",
|
|
375
|
+
// all old paths are for customer credentials
|
|
376
|
+
path: "KycSession/vcs/".concat(credentialType, "/v1/credentialSubject/").concat(path.replaceAll(".", "/"))
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
var ScenarioTypes = ["PrivacyPreservingMonitoring", "IndividualMonitoring", "TransactionMonitoring", "TFHE" // TODO integrate TFHE verification
|
|
381
|
+
];
|
|
382
|
+
var ScenarioType = z["enum"](ScenarioTypes);
|
|
383
|
+
var ScenarioStatuses = ["enabled", "disabled"];
|
|
384
|
+
var ScenarioStatus = z["enum"](ScenarioStatuses);
|
|
385
|
+
var ScenarioSchema = z.object({
|
|
386
|
+
title: z.string(),
|
|
387
|
+
link: z.object({
|
|
388
|
+
version: z.string(),
|
|
389
|
+
schema: z.string(),
|
|
390
|
+
path: z.string()
|
|
391
|
+
}),
|
|
392
|
+
status: z["enum"]([ScenarioStatus.Enum.enabled, ScenarioStatus.Enum.disabled]).optional()
|
|
393
|
+
});
|
|
394
|
+
var BackwardsCompatibleScenarioTypes = ["PrivacyPreservingMonitoring", "IndividualMonitoring", "TransactionMonitoring", "TFHE", "OffChainZKP",
|
|
395
|
+
// Backwards compatible
|
|
396
|
+
"ChallengeQuery" // Backwards compatible
|
|
397
|
+
];
|
|
398
|
+
var BackwardsCompatibleScenarioType = z["enum"](BackwardsCompatibleScenarioTypes);
|
|
399
|
+
var BaseQueryResponse = z.object({
|
|
400
|
+
result: z.object({
|
|
401
|
+
is_valid: z["boolean"](),
|
|
402
|
+
reasons: z.array(z.string())
|
|
403
|
+
})
|
|
404
|
+
});
|
|
405
|
+
var OffChainZKPRuleResult = BaseQueryResponse.extend({
|
|
406
|
+
result: z.object({
|
|
407
|
+
is_valid: z["boolean"](),
|
|
408
|
+
query: QueryConfigSimplified,
|
|
409
|
+
reasons: z.array(z.string())
|
|
410
|
+
})
|
|
411
|
+
});
|
|
412
|
+
var ExecuteQueryResponse = BaseQueryResponse.extend({
|
|
413
|
+
executionId: UuidString
|
|
414
|
+
});
|
|
415
|
+
var RuleEngineResponse = z.object({
|
|
416
|
+
objectType: BackwardsCompatibleScenarioType,
|
|
417
|
+
objectId: z.string().describe("Object id in the cms (challengeQueryid, offChainZKPid)"),
|
|
418
|
+
name: z.string(),
|
|
419
|
+
address: BlockchainAddress.nullish(),
|
|
420
|
+
result: ExecuteQueryResponse,
|
|
421
|
+
executionId: UuidString,
|
|
422
|
+
scenarioId: z.string()
|
|
423
|
+
});
|
|
424
|
+
var ScenarioExecutionResponse = z.array(RuleEngineResponse);
|
|
425
|
+
var RuleResultStatuses = ["valid", "not-valid", "error", "unknown"];
|
|
426
|
+
var RuleResultStatus = z["enum"](RuleResultStatuses);
|
|
427
|
+
var RuleResultStatusLabels = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, RuleResultStatus.Enum.valid, "Valid"), RuleResultStatus.Enum["not-valid"], "Not Valid"), RuleResultStatus.Enum.error, "Error"), RuleResultStatus.Enum.unknown, "Unknown");
|
|
428
|
+
var SdkVerificationOutput = z.object({
|
|
429
|
+
customerId: z.string().optional(),
|
|
430
|
+
// for v1
|
|
431
|
+
scenarioExecutionId: z.string().optional(),
|
|
432
|
+
// for v1
|
|
433
|
+
status: RuleResultStatus.optional(),
|
|
434
|
+
// for v1
|
|
435
|
+
results: z.array(ScenarioExecutionResponse).optional() // for v1,
|
|
436
|
+
});
|
|
437
|
+
var VerificationSessionStatuses = ["IN_PROGRESS", "COMPLETED", "NOT_STARTED"];
|
|
438
|
+
var VerificationSessionStatus = z["enum"](VerificationSessionStatuses);
|
|
439
|
+
var VerificationOutput = z.object({
|
|
440
|
+
id: UuidString.nullable(),
|
|
441
|
+
verificationResult: SdkVerificationOutput.nullable(),
|
|
442
|
+
status: VerificationSessionStatus
|
|
443
|
+
});
|
|
444
|
+
var Scenario = z.object({
|
|
445
|
+
id: ScenarioId,
|
|
446
|
+
name: z.string(),
|
|
447
|
+
description: z.string().nullish(),
|
|
448
|
+
queries: z.array(QueryConfigSimplified),
|
|
449
|
+
type: ScenarioType,
|
|
450
|
+
workspaceId: WorkspaceId,
|
|
451
|
+
vcsIncluded: z.array(CredentialType).nullish()
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
// creating this because SmartContractDeployment has an issue with AddressSchema
|
|
455
|
+
// during rpcPublisher.send
|
|
456
|
+
// also the parsing of the queryconfiguration fields changes type slightly as well.
|
|
457
|
+
var AbbreviatedWorkflowScenario = Scenario.omit({
|
|
458
|
+
vcsIncluded: true,
|
|
459
|
+
queries: true
|
|
460
|
+
}).extend({
|
|
461
|
+
queries: z.array(QueryConfigSimplified)
|
|
462
|
+
});
|
|
463
|
+
var TemplateScenario = Scenario.omit({
|
|
464
|
+
workspaceId: true
|
|
465
|
+
});
|
|
466
|
+
var CreateTemplateScenario = TemplateScenario.omit({
|
|
467
|
+
id: true
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
var ScenarioAuthorizationData = z.object({
|
|
471
|
+
executionId: UuidString,
|
|
472
|
+
sessionId: UuidString,
|
|
473
|
+
projectId: z.string(),
|
|
474
|
+
address: BlockchainAddress.nullish(),
|
|
475
|
+
status: z["enum"](["pending", "authorised", "unauthorised"]),
|
|
476
|
+
scenarioId: z.string(),
|
|
477
|
+
scenarioName: z.string(),
|
|
478
|
+
requestMessage: AuthorizationRequestMessage,
|
|
479
|
+
responseMessage: AuthorizationResponseMessage.nullish(),
|
|
480
|
+
verificationError: z.string().nullish(),
|
|
481
|
+
query: QueryConfigSimplified.array(),
|
|
482
|
+
workflowSessionId: UuidString.optional()
|
|
483
|
+
});
|
|
484
|
+
// v1 sdk
|
|
485
|
+
var SdkVerificationResponseSchema = SdkVerificationOutput;
|
|
486
|
+
var CloseScreenNotification = z.object({
|
|
487
|
+
type: z.literal("closeScreen"),
|
|
488
|
+
identifier: z.string(),
|
|
489
|
+
data: z.undefined()
|
|
490
|
+
});
|
|
491
|
+
var KycCompletionData = z.array(VerifiableCredential);
|
|
492
|
+
var KycCompletionNotification = z.object({
|
|
493
|
+
type: z.literal("kycCompletion"),
|
|
494
|
+
identifier: z.string(),
|
|
495
|
+
data: KycCompletionData
|
|
496
|
+
});
|
|
497
|
+
var RuleEngineScenarioExecutionData = z.object({
|
|
498
|
+
type: z.literal("RuleEngineScenarioExecution"),
|
|
499
|
+
data: SdkVerificationResponseSchema
|
|
500
|
+
});
|
|
501
|
+
var OffChainScenarioExecutionData = z.object({
|
|
502
|
+
type: z.literal("OffChainScenarioExecution"),
|
|
503
|
+
data: z.array(ScenarioAuthorizationData)
|
|
504
|
+
});
|
|
505
|
+
var OnChainScenarioExecutionData = z.object({
|
|
506
|
+
type: z.literal("OnChainScenarioExecution"),
|
|
507
|
+
data: z.any()
|
|
508
|
+
});
|
|
509
|
+
var ScenarioExecutionData = z.union([RuleEngineScenarioExecutionData, OffChainScenarioExecutionData, OnChainScenarioExecutionData]);
|
|
510
|
+
var ScenarioExecutionNotification = z.object({
|
|
511
|
+
type: z.literal("scenarioExecution"),
|
|
512
|
+
identifier: z.string(),
|
|
513
|
+
data: ScenarioExecutionData
|
|
514
|
+
});
|
|
515
|
+
var IsVerifiedNotification = z.object({
|
|
516
|
+
type: z.literal("isVerifiedNotification"),
|
|
517
|
+
identifier: z.string(),
|
|
518
|
+
isVerified: z["boolean"]()
|
|
519
|
+
});
|
|
520
|
+
var PolygonIdInitialized = z.object({
|
|
521
|
+
type: z.literal("polygonIdInitialized"),
|
|
522
|
+
identifier: z.string(),
|
|
523
|
+
data: z.string()
|
|
524
|
+
});
|
|
525
|
+
var OcvSdkInitialized = z.object({
|
|
526
|
+
type: z.literal("ocvSdkInitialized"),
|
|
527
|
+
identifier: z.string()
|
|
528
|
+
});
|
|
529
|
+
var StartCompletedNotification = z.object({
|
|
530
|
+
type: z.literal("startCompletedNotification"),
|
|
531
|
+
identifier: z.string()
|
|
532
|
+
});
|
|
533
|
+
var IdentityNotificationMessage = z.union([CloseScreenNotification, PolygonIdInitialized, OcvSdkInitialized, StartCompletedNotification, KycCompletionNotification, ScenarioExecutionNotification, IsVerifiedNotification]);
|
|
534
|
+
var InitialDataRequest = z.object({
|
|
535
|
+
type: z.literal("initialDataRequest"),
|
|
536
|
+
identifier: z.string()
|
|
537
|
+
});
|
|
538
|
+
var SignatureRequest = z.object({
|
|
539
|
+
type: z.literal("signatureRequest"),
|
|
540
|
+
identifier: z.string(),
|
|
541
|
+
data: z.object({
|
|
542
|
+
message: z.string()
|
|
543
|
+
})
|
|
544
|
+
});
|
|
545
|
+
var TransactionData = z.object({
|
|
546
|
+
accountAddress: BlockchainAddress,
|
|
547
|
+
to: BlockchainAddress,
|
|
548
|
+
data: String0x,
|
|
549
|
+
value: z.string().optional()
|
|
550
|
+
});
|
|
551
|
+
var SendTransactionRequest = z.object({
|
|
552
|
+
type: z.literal("sendTransactionRequest"),
|
|
553
|
+
identifier: z.string(),
|
|
554
|
+
data: TransactionData
|
|
555
|
+
});
|
|
556
|
+
var IdentityRequestMessage = z.union([InitialDataRequest, SignatureRequest, SendTransactionRequest]);
|
|
557
|
+
var AVAILABLE_FLOWS = ["VERIFICATION", "MANAGEMENT", "POLYGON_ID", "KYB"];
|
|
558
|
+
var AvailableFlow = z["enum"](AVAILABLE_FLOWS);
|
|
559
|
+
var DataAvailableOnStart = z.object({
|
|
560
|
+
identifier: z.string().optional(),
|
|
561
|
+
flow: z["enum"](AVAILABLE_FLOWS).optional(),
|
|
562
|
+
accessToken: z.string(),
|
|
563
|
+
signingMessage: z.string(),
|
|
564
|
+
signature: z.string()
|
|
565
|
+
});
|
|
566
|
+
var InitialDataResponse = z.object({
|
|
567
|
+
type: z.literal("onStartKyc"),
|
|
568
|
+
data: DataAvailableOnStart
|
|
569
|
+
});
|
|
570
|
+
var SignatureResponse = z.object({
|
|
571
|
+
type: z.literal("signature"),
|
|
572
|
+
data: BlockchainSignature
|
|
573
|
+
});
|
|
574
|
+
var TransactionResponse = z.object({
|
|
575
|
+
type: z.literal("transactionResponse"),
|
|
576
|
+
data: z.object({
|
|
577
|
+
txHash: TxHash
|
|
578
|
+
})
|
|
579
|
+
});
|
|
580
|
+
var HostResponseMessage = z.union([InitialDataResponse, SignatureResponse, TransactionResponse]);
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Exported types
|
|
584
|
+
*/
|
|
585
|
+
|
|
586
|
+
var ComplianceImplementationStepsInput = z.object({
|
|
587
|
+
identityChecks: z["boolean"]().nullish(),
|
|
588
|
+
configureIdentity: z["boolean"]().nullish(),
|
|
589
|
+
deployIdentity: z["boolean"]().nullish(),
|
|
590
|
+
monitorIdentity: z["boolean"]().nullish()
|
|
591
|
+
});
|
|
592
|
+
|
|
593
|
+
/////////////
|
|
594
|
+
// EIP-155 //
|
|
595
|
+
/////////////
|
|
596
|
+
|
|
597
|
+
var TxAuthInput = z.object({
|
|
598
|
+
workflowId: WorkflowId.optional(),
|
|
599
|
+
chainId: EvmChainId,
|
|
600
|
+
contractAbi: z.array(z.record(z.unknown())),
|
|
601
|
+
contractAddress: AddressSchema,
|
|
602
|
+
functionName: z.string(),
|
|
603
|
+
args: z.array(z.unknown()),
|
|
604
|
+
userAddress: AddressSchema,
|
|
605
|
+
blockExpiration: z.number()["int"]().optional(),
|
|
606
|
+
nonce: z.number()["int"]().optional()
|
|
607
|
+
});
|
|
608
|
+
// the api endpoint can source the userAddress from the session if it's not provided
|
|
609
|
+
var ApiTxAuthInput = TxAuthInput.extend({
|
|
610
|
+
userAddress: AddressSchema.optional()
|
|
611
|
+
});
|
|
612
|
+
var TxSignatureResponse = z.object({
|
|
613
|
+
signature: EIP155Signature,
|
|
614
|
+
blockExpiration: z.number()
|
|
615
|
+
});
|
|
616
|
+
var GetTxAuthDataSignatureResponse = z.union([z.object({
|
|
617
|
+
isAuthorized: z.literal(true),
|
|
618
|
+
signature: EIP155Signature,
|
|
619
|
+
payload: z.string(),
|
|
620
|
+
blockExpiration: z.number()
|
|
621
|
+
}), z.object({
|
|
622
|
+
isAuthorized: z.literal(false),
|
|
623
|
+
errorMessage: z.any()
|
|
624
|
+
})]);
|
|
625
|
+
/////////////
|
|
626
|
+
// Tezos //
|
|
627
|
+
/////////////
|
|
628
|
+
|
|
629
|
+
var TezosTxAuthInput = z.object({
|
|
630
|
+
workflowId: WorkflowId.optional(),
|
|
631
|
+
chainID: TezosChainId,
|
|
632
|
+
contractAddress: TezosContractAddress,
|
|
633
|
+
functionName: TezosEntrypointName,
|
|
634
|
+
args: z.string(),
|
|
635
|
+
userAddress: TezosImplicitAddress,
|
|
636
|
+
blockExpiration: z.number()["int"]().optional(),
|
|
637
|
+
nonce: z.number()["int"]().optional()
|
|
638
|
+
});
|
|
639
|
+
// the api endpoint can source the userAddress from the session if it's not provided
|
|
640
|
+
var ApiTezosTxAuthInput = TezosTxAuthInput.extend({
|
|
641
|
+
userAddress: TezosImplicitAddress.optional()
|
|
642
|
+
});
|
|
643
|
+
var TezosTxSignatureResponse = z.object({
|
|
644
|
+
signature: EdSignature,
|
|
645
|
+
blockExpiration: z.number()
|
|
646
|
+
});
|
|
647
|
+
var GetTezosTxAuthDataSignatureResponse = z.union([z.object({
|
|
648
|
+
isAuthorized: z.literal(true),
|
|
649
|
+
signature: EdSignature,
|
|
650
|
+
blockExpiration: z.number()
|
|
651
|
+
}), z.object({
|
|
652
|
+
isAuthorized: z.literal(false),
|
|
653
|
+
errorMessage: z.any()
|
|
654
|
+
})]);
|
|
655
|
+
/////////////
|
|
656
|
+
// General //
|
|
657
|
+
/////////////
|
|
658
|
+
|
|
659
|
+
var ExtendedTxAuthInput = TxAuthInput.and(z.object({
|
|
660
|
+
namespace: z.literal(BlockchainNamespace.Enum.eip155),
|
|
661
|
+
userAddress: AddressSchema
|
|
662
|
+
}));
|
|
663
|
+
var ExtendedTezosTxAuthInput = TezosTxAuthInput.and(z.object({
|
|
664
|
+
namespace: z.literal(BlockchainNamespace.Enum.tezos),
|
|
665
|
+
userAddress: TezosImplicitAddress
|
|
666
|
+
}));
|
|
667
|
+
var ExtendedTxAuthDataSignatureResponse = GetTxAuthDataSignatureResponse.and(z.object({
|
|
668
|
+
namespace: z.literal(BlockchainNamespace.Enum.eip155),
|
|
669
|
+
userAddress: AddressSchema
|
|
670
|
+
}));
|
|
671
|
+
var ExtendedTezosTxAuthDataSignatureResponse = GetTezosTxAuthDataSignatureResponse.and(z.object({
|
|
672
|
+
namespace: z.literal(BlockchainNamespace.Enum.tezos),
|
|
673
|
+
userAddress: TezosImplicitAddress
|
|
674
|
+
}));
|
|
675
|
+
var AnyTxAuthDataSignatureResponse = z.union([ExtendedTxAuthDataSignatureResponse, ExtendedTezosTxAuthDataSignatureResponse]);
|
|
676
|
+
/////////////
|
|
677
|
+
// JS SDK //
|
|
678
|
+
/////////////
|
|
679
|
+
|
|
680
|
+
var Eip155TxAuthInputJsSdk = ExtendedTxAuthInput.and(z.object({
|
|
681
|
+
workflowId: WorkflowId
|
|
682
|
+
}));
|
|
683
|
+
var TezosTxAuthInputJsSdk = ExtendedTezosTxAuthInput.and(z.object({
|
|
684
|
+
workflowId: WorkflowId
|
|
685
|
+
}));
|
|
686
|
+
var AnyTxAuthInputJsSdk = z.union([Eip155TxAuthInputJsSdk, TezosTxAuthInputJsSdk]);
|
|
687
|
+
|
|
688
|
+
var SimplifiedCredential = z.object({
|
|
689
|
+
id: z.string(),
|
|
690
|
+
type: z.array(z.string()),
|
|
691
|
+
issuanceDate: z.string(),
|
|
692
|
+
journeyId: z.string()
|
|
693
|
+
});
|
|
694
|
+
/**
|
|
695
|
+
* GetCredentialsRequest
|
|
696
|
+
*/
|
|
697
|
+
var GetCredentialsRequest = z.object({
|
|
698
|
+
type: z.literal("getCredentials"),
|
|
699
|
+
data: z.undefined()
|
|
700
|
+
});
|
|
701
|
+
/**
|
|
702
|
+
* GetCredentialsResponse
|
|
703
|
+
*/
|
|
704
|
+
var GetCredentialsResponse = z.object({
|
|
705
|
+
type: z.literal("polygonIdCredentials"),
|
|
706
|
+
credentials: z.array(SimplifiedCredential),
|
|
707
|
+
identifier: z.string()
|
|
708
|
+
});
|
|
709
|
+
/**
|
|
710
|
+
* PolygonIdRequest
|
|
711
|
+
*/
|
|
712
|
+
var PolygonIdRequestData = z.union([z.object({
|
|
713
|
+
type: z.literal("auth"),
|
|
714
|
+
authRequest: AuthorizationRequestMessage
|
|
715
|
+
}), z.object({
|
|
716
|
+
type: z.literal("credentialOffer"),
|
|
717
|
+
credentialOfferRequest: QrCodeLinkWithSchemaType
|
|
718
|
+
}), z.object({
|
|
719
|
+
type: z.literal("zkp"),
|
|
720
|
+
zkpRequest: ZeroKnowledgeProofRequest
|
|
721
|
+
})]);
|
|
722
|
+
var PolygonIdRequest = z.object({
|
|
723
|
+
type: z.literal("polygonIdRequest"),
|
|
724
|
+
data: PolygonIdRequestData
|
|
725
|
+
});
|
|
726
|
+
/**
|
|
727
|
+
* PolygonIdResponse
|
|
728
|
+
*/
|
|
729
|
+
var PolygonIdResponseData = z.union([z.object({
|
|
730
|
+
type: z.literal("auth"),
|
|
731
|
+
authResponse: AuthorizationResponseMessage
|
|
732
|
+
}), z.object({
|
|
733
|
+
type: z.literal("credentialOffer"),
|
|
734
|
+
credentialOfferResponse: z.array(GenericVerifiableCredentialSchema)
|
|
735
|
+
}), z.object({
|
|
736
|
+
type: z.literal("zkp"),
|
|
737
|
+
zkpResponse: ZeroKnowledgeProofResponse
|
|
738
|
+
}), z.object({
|
|
739
|
+
type: z.literal("close"),
|
|
740
|
+
screen: z["enum"](["auth", "credentialOffer", "zkp", "getCredentials"]),
|
|
741
|
+
closeResponse: z.string()
|
|
742
|
+
})]);
|
|
743
|
+
var PolygonIdResponse = z.object({
|
|
744
|
+
type: z.literal("polygonIdResponse"),
|
|
745
|
+
identifier: z.string(),
|
|
746
|
+
data: PolygonIdResponseData
|
|
747
|
+
});
|
|
748
|
+
/**
|
|
749
|
+
* StartFlowRequest
|
|
750
|
+
*/
|
|
751
|
+
var StartFlowRequest = z.union([z.object({
|
|
752
|
+
type: z.literal("startVerification"),
|
|
753
|
+
data: z.undefined()
|
|
754
|
+
}), z.object({
|
|
755
|
+
type: z.literal("startManagement"),
|
|
756
|
+
data: z.undefined()
|
|
757
|
+
}), z.object({
|
|
758
|
+
type: z.literal("startKYB"),
|
|
759
|
+
data: z.undefined()
|
|
760
|
+
})]);
|
|
761
|
+
/**
|
|
762
|
+
* IsVerifiedRequest
|
|
763
|
+
*/
|
|
764
|
+
var IsVerifiedRequest = z.object({
|
|
765
|
+
type: z.literal("isVerifiedRequest"),
|
|
766
|
+
data: z.object({
|
|
767
|
+
userAddress: AddressSchema
|
|
768
|
+
}),
|
|
769
|
+
identifier: z.string()
|
|
770
|
+
});
|
|
771
|
+
/**
|
|
772
|
+
* IsVerifiedResponse
|
|
773
|
+
*/
|
|
774
|
+
var IsVerifiedResponse = z.object({
|
|
775
|
+
type: z.literal("isVerifiedResponse"),
|
|
776
|
+
isVerified: z["boolean"](),
|
|
777
|
+
identifier: z.string()
|
|
778
|
+
});
|
|
779
|
+
/**
|
|
780
|
+
* GetTxAuthSigRequest
|
|
781
|
+
*/
|
|
782
|
+
var GetTxAuthSigRequest = z.object({
|
|
783
|
+
type: z.literal("getTxAuthSigRequest"),
|
|
784
|
+
data: ApiTxAuthInput,
|
|
785
|
+
identifier: z.string()
|
|
786
|
+
});
|
|
787
|
+
/**
|
|
788
|
+
* GetTxAuthSigResponse
|
|
789
|
+
*/
|
|
790
|
+
var GetTxAuthSigResponse = z.object({
|
|
791
|
+
type: z.literal("getTxAuthSigResponse"),
|
|
792
|
+
signatureResponse: GetTxAuthDataSignatureResponse,
|
|
793
|
+
identifier: z.string()
|
|
794
|
+
});
|
|
795
|
+
/**
|
|
796
|
+
* GetTxAuthSigRequest Tezos
|
|
797
|
+
*/
|
|
798
|
+
var GetTxAuthSigRequestTezos = z.object({
|
|
799
|
+
type: z.literal("getTxAuthSigRequestTezos"),
|
|
800
|
+
data: ApiTezosTxAuthInput,
|
|
801
|
+
identifier: z.string()
|
|
802
|
+
});
|
|
803
|
+
/**
|
|
804
|
+
* GetTxAuthSigResponse Tezos
|
|
805
|
+
*/
|
|
806
|
+
var GetTxAuthSigResponseTezos = z.object({
|
|
807
|
+
type: z.literal("getTezosTxAuthSigResponse"),
|
|
808
|
+
signatureResponse: GetTezosTxAuthDataSignatureResponse,
|
|
809
|
+
identifier: z.string()
|
|
810
|
+
});
|
|
811
|
+
var HostRequestMessage = z.union([GetCredentialsRequest, PolygonIdRequest, StartFlowRequest, IsVerifiedRequest, GetTxAuthSigRequest, GetTxAuthSigRequestTezos]);
|
|
812
|
+
var IdentityResponseMessage = z.union([GetCredentialsResponse, PolygonIdResponse, IsVerifiedResponse, GetTxAuthSigResponse, GetTxAuthSigResponseTezos]);
|
|
813
|
+
|
|
814
|
+
// Risk Score
|
|
815
|
+
var RiskScoreTypes = ["Low", "Medium", "High", "No risk"];
|
|
816
|
+
var RiskScoreType = z["enum"](RiskScoreTypes);
|
|
817
|
+
// Customer Type
|
|
818
|
+
var CustomerTypes = ["Individual", "Company"];
|
|
819
|
+
var CustomerType = z["enum"](CustomerTypes);
|
|
820
|
+
// KYC Onboarding Level
|
|
821
|
+
var KycOnboardingLevels = ["Sign-up", "AML screening", "KYC", "Questionaire", "Onboarded"];
|
|
822
|
+
var KycOnboardingLevel = z["enum"](KycOnboardingLevels);
|
|
823
|
+
// KYB Onboarding Level
|
|
824
|
+
var KybOnboardingLevels = ["Onboarding", "KYB", "Onboarded"];
|
|
825
|
+
var KybOnboardingLevel = z["enum"](KybOnboardingLevels);
|
|
826
|
+
var CustomerOnboardingLevels = [].concat(KycOnboardingLevels, KybOnboardingLevels);
|
|
827
|
+
var CustomerOnboardingLevel = z["enum"](CustomerOnboardingLevels);
|
|
828
|
+
// Customer Status
|
|
829
|
+
var CustomerStatuses = ["Active", "Rejected", "Dormant", "To be reviewed", "Failed", "Escalated", "Terminated", "No status"];
|
|
830
|
+
var CustomerStatus = z["enum"](CustomerStatuses);
|
|
831
|
+
var BasicCustomerContactInformation = z.object({
|
|
832
|
+
email: z.string().email(),
|
|
833
|
+
phone: z.string().min(4),
|
|
834
|
+
twitter: z.string(),
|
|
835
|
+
discord: z.string(),
|
|
836
|
+
telegram: z.string()
|
|
837
|
+
}).partial();
|
|
838
|
+
var CUSTOMERS_CHARTS = ["totalCustomers", "onboarded", "active", "dormant", "rejected", "topCountriesByCustomersCount", "customersRiskLevel", "customersByStatus", "trendOfStatusesOverTime"];
|
|
839
|
+
var CustomersChartType = z["enum"](CUSTOMERS_CHARTS);
|
|
840
|
+
var CUSTOMER_TABLE_COLUMNS = ["selected", "wallets", "type", "country_of_residence", "risk_score", "onboarding_level", "open_alerts_count", "status", "date_onboarded"];
|
|
841
|
+
var CustomerTableColumn = z["enum"](CUSTOMER_TABLE_COLUMNS);
|
|
842
|
+
var CUSTOMER_AUTOMATION_REASONS = {
|
|
843
|
+
"rule-engine": {
|
|
844
|
+
fail: "Rules engine verification failed",
|
|
845
|
+
pass: "Rules engine verification passed"
|
|
846
|
+
},
|
|
847
|
+
kyc: {
|
|
848
|
+
green: {
|
|
849
|
+
"final": "Passed KYC"
|
|
850
|
+
},
|
|
851
|
+
yellow: {
|
|
852
|
+
retry: "User rejected by the KYC provider with possibility to retry",
|
|
853
|
+
fail: "User rejected by the KYC provider"
|
|
854
|
+
},
|
|
855
|
+
red: {
|
|
856
|
+
retry: "User rejected by the KYC provider with possibility to retry",
|
|
857
|
+
fail: "User rejected by the KYC provider"
|
|
858
|
+
}
|
|
859
|
+
},
|
|
860
|
+
kyb: {
|
|
861
|
+
green: {
|
|
862
|
+
"final": "Passed KYB"
|
|
863
|
+
},
|
|
864
|
+
yellow: {
|
|
865
|
+
retry: "Company rejected by the KYB provider with possibility to retry",
|
|
866
|
+
fail: "Company rejected by the KYB provider"
|
|
867
|
+
},
|
|
868
|
+
red: {
|
|
869
|
+
retry: "Company rejected by the KYB provider with possibility to retry",
|
|
870
|
+
fail: "Company rejected by the KYB provider"
|
|
871
|
+
},
|
|
872
|
+
beneficiaryOnToBeReviewState: "One or more beneficiaries are on 'To be reviewed' state"
|
|
873
|
+
},
|
|
874
|
+
"aml-screening": {
|
|
875
|
+
fail: "AML screening hits received during onboarding",
|
|
876
|
+
ongoingMonitoringFail: "AML screening hits received during ongoing monitoring",
|
|
877
|
+
pass: "Passed AML screening"
|
|
878
|
+
},
|
|
879
|
+
offchain_zkp: {
|
|
880
|
+
fail: "Offchain ZKP verification failed",
|
|
881
|
+
pass: "Offchain ZKP verification passed"
|
|
882
|
+
},
|
|
883
|
+
tfhe: {
|
|
884
|
+
fail: "TFHE verification failed",
|
|
885
|
+
pass: "TFHE verification passed"
|
|
886
|
+
}
|
|
887
|
+
};
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Wallet challenge parameters
|
|
891
|
+
*/
|
|
892
|
+
|
|
893
|
+
var GenerateWalletChallengeRequest = z.object({
|
|
894
|
+
address: BlockchainAddress,
|
|
895
|
+
namespace: SupportedBlockchainNamespaceForSignatureAuth,
|
|
896
|
+
blockchainId: BlockchainId.optional(),
|
|
897
|
+
origin: z.string().url(),
|
|
898
|
+
workflowId: WorkflowId,
|
|
899
|
+
externalCustomerId: ExternalCustomerId.optional(),
|
|
900
|
+
additionalInformation: AdditionalCustomerInformationParams.optional()
|
|
901
|
+
});
|
|
902
|
+
var AuthSession = z.object({
|
|
903
|
+
// JWT token containing user authentication data
|
|
904
|
+
// Generated by the Identity-api using the IdentityWidgetAccessToken_NEW schema
|
|
905
|
+
// Used for user identification in the identity-v2-app
|
|
906
|
+
// We don't want users to rely on the structure of the token so we expose it as a string
|
|
907
|
+
token: z.string(),
|
|
908
|
+
// the timestamp at which the session will expire
|
|
909
|
+
// in seconds since epoch to avoid timezone issues and date parsing errors
|
|
910
|
+
// this is exposed in case the app needs to store the session so it knows when
|
|
911
|
+
// the session becomes invalid again
|
|
912
|
+
// We don't want users to rely on the fact that the token is a JWT, as we
|
|
913
|
+
// want to change to openId in the future, so we expose the expiration as a number
|
|
914
|
+
expiresAt: z.number(),
|
|
915
|
+
// if an external customer id was provided, it will be returned
|
|
916
|
+
// when obtaining the auth session to facilitate integration with the user's system
|
|
917
|
+
externalCustomerId: ExternalCustomerId.optional()
|
|
918
|
+
});
|
|
919
|
+
var AuthSessionData = z.object({
|
|
920
|
+
/**
|
|
921
|
+
* The unique identifier of the user
|
|
922
|
+
*/
|
|
923
|
+
identityId: z.string(),
|
|
924
|
+
/**
|
|
925
|
+
* The unique identifier of the user's session
|
|
926
|
+
*/
|
|
927
|
+
customerId: z.string(),
|
|
928
|
+
/**
|
|
929
|
+
* The identifier passed by the user platform
|
|
930
|
+
*/
|
|
931
|
+
externalCustomerId: ExternalCustomerId.optional()
|
|
932
|
+
});
|
|
933
|
+
var ChallengeResponse = z.object({
|
|
934
|
+
challenge: z.string()
|
|
935
|
+
});
|
|
936
|
+
////////////////
|
|
937
|
+
// SDK messages
|
|
938
|
+
////////////////
|
|
939
|
+
|
|
940
|
+
var AppConfigRequest = z.object({
|
|
941
|
+
type: z.literal("appConfig"),
|
|
942
|
+
data: z.object({
|
|
943
|
+
authSession: AuthSession
|
|
944
|
+
})
|
|
945
|
+
});
|
|
946
|
+
var WalletUpdated = z.object({
|
|
947
|
+
type: z.literal("walletUpdated"),
|
|
948
|
+
data: z.object({
|
|
949
|
+
address: BlockchainAddress
|
|
950
|
+
})
|
|
951
|
+
});
|
|
952
|
+
var WalletSignResponse = z.object({
|
|
953
|
+
type: z.literal("walletSignResponse"),
|
|
954
|
+
data: z.object({
|
|
955
|
+
message: z.string(),
|
|
956
|
+
signature: BlockchainSignature
|
|
957
|
+
})
|
|
958
|
+
});
|
|
959
|
+
var TxAuthDataSignatureGatingRequest = z.object({
|
|
960
|
+
type: z.literal("txAuthDataSignatureGatingRequest"),
|
|
961
|
+
data: z.object({
|
|
962
|
+
input: AnyTxAuthInputJsSdk
|
|
963
|
+
})
|
|
964
|
+
});
|
|
965
|
+
var GetCustomerStatusRequest = z.object({
|
|
966
|
+
type: z.literal("getCustomerStatusRequest")
|
|
967
|
+
});
|
|
968
|
+
var IdentitySdkMessage = z.union([AppConfigRequest, WalletUpdated, WalletSignResponse, TransactionResponse, TxAuthDataSignatureGatingRequest, GetCustomerStatusRequest]);
|
|
969
|
+
var IdentitySdkMessageWithIdentifier = z.intersection(IdentitySdkMessage, z.object({
|
|
970
|
+
identifier: z.string()
|
|
971
|
+
}));
|
|
972
|
+
////////////////
|
|
973
|
+
// App messages
|
|
974
|
+
////////////////
|
|
975
|
+
|
|
976
|
+
var IdentityAppLoadedNotification = z.object({
|
|
977
|
+
type: z.literal("identityAppLoaded")
|
|
978
|
+
});
|
|
979
|
+
var IdentityAppConfiguredNotification = z.object({
|
|
980
|
+
type: z.literal("identityAppConfigured"),
|
|
981
|
+
data: z.object({
|
|
982
|
+
auth: AuthSession
|
|
983
|
+
})
|
|
984
|
+
});
|
|
985
|
+
var AuthenticationExpiredNotification = z.object({
|
|
986
|
+
type: z.literal("authenticationExpired"),
|
|
987
|
+
data: z.object({
|
|
988
|
+
authSession: AuthSession
|
|
989
|
+
})
|
|
990
|
+
});
|
|
991
|
+
var WalletSignRequest = z.object({
|
|
992
|
+
type: z.literal("walletSignRequest"),
|
|
993
|
+
data: z.object({
|
|
994
|
+
message: z.string()
|
|
995
|
+
})
|
|
996
|
+
});
|
|
997
|
+
var TxAuthDataSignatureResponse = z.object({
|
|
998
|
+
type: z.literal("txAuthDataSignatureResponse"),
|
|
999
|
+
data: AnyTxAuthDataSignatureResponse
|
|
1000
|
+
});
|
|
1001
|
+
var TxAuthDataSignatureGatingError = z.object({
|
|
1002
|
+
type: z.literal("txAuthDataSignatureGatingError"),
|
|
1003
|
+
data: z.object({
|
|
1004
|
+
error: z.string()
|
|
1005
|
+
})
|
|
1006
|
+
});
|
|
1007
|
+
var GetCustomerStatusResponse = z.object({
|
|
1008
|
+
type: z.literal("getCustomerStatusResponse"),
|
|
1009
|
+
data: z.union([CustomerStatus, z["null"]()])
|
|
1010
|
+
});
|
|
1011
|
+
var IdentityAppMessage = z.union([IdentityAppLoadedNotification, IdentityAppConfiguredNotification, AuthenticationExpiredNotification, WalletSignRequest, TxAuthDataSignatureResponse, TxAuthDataSignatureGatingError, GetCustomerStatusResponse,
|
|
1012
|
+
// `identifier` is a technical detail that should not be exposed to the app
|
|
1013
|
+
KycCompletionNotification.omit({
|
|
1014
|
+
identifier: true
|
|
1015
|
+
}), ScenarioExecutionNotification.omit({
|
|
1016
|
+
identifier: true
|
|
1017
|
+
}), CloseScreenNotification.omit({
|
|
1018
|
+
identifier: true
|
|
1019
|
+
}), IsVerifiedNotification.omit({
|
|
1020
|
+
identifier: true
|
|
1021
|
+
}), SendTransactionRequest.omit({
|
|
1022
|
+
identifier: true
|
|
1023
|
+
})]);
|
|
1024
|
+
var IdentityWallet = z.object({
|
|
1025
|
+
address: BlockchainAddress,
|
|
1026
|
+
namespace: SupportedBlockchainNamespaceForSignatureAuth
|
|
1027
|
+
});
|
|
1028
|
+
|
|
1029
|
+
var ZKPRequest = z.object({
|
|
1030
|
+
id: z.number(),
|
|
1031
|
+
circuitId: z["enum"](["credentialAtomicQuerySigV2", "credentialAtomicQuerySigV2OnChain"]),
|
|
1032
|
+
optional: z["boolean"]().optional(),
|
|
1033
|
+
query: QueryConfigSimplified
|
|
1034
|
+
});
|
|
1035
|
+
var ZKPRequestFromZKVerifier = z.object({
|
|
1036
|
+
id: z.number(),
|
|
1037
|
+
circuitId: z.string(),
|
|
1038
|
+
optional: z["boolean"]().optional(),
|
|
1039
|
+
query: z.record(z.unknown())
|
|
1040
|
+
});
|
|
1041
|
+
var PrivacyPreservingMonitoring = z.object({
|
|
1042
|
+
requestingAuthorizationMessage: z.string().nullish(),
|
|
1043
|
+
zkpRequest: z.array(ZKPRequest).nullish()
|
|
1044
|
+
});
|
|
1045
|
+
var CreateAuthRequestProps = z.object({
|
|
1046
|
+
hostUrl: z.string().url(),
|
|
1047
|
+
sessionId: UuidString,
|
|
1048
|
+
audience: z.string().describe("DID of the verifier"),
|
|
1049
|
+
callbackURL: z.string().describe("URL to which the auth response of the client callback will be sent"),
|
|
1050
|
+
query: z.array(QueryConfigSimplified),
|
|
1051
|
+
onChainVerification: z["boolean"]().optional(),
|
|
1052
|
+
id: z.string().uuid(),
|
|
1053
|
+
thid: z.string().uuid(),
|
|
1054
|
+
message: z.string().describe("Message shown to the user")
|
|
1055
|
+
});
|
|
1056
|
+
var AllScenarioExecutionAuthorizationData = z.object({
|
|
1057
|
+
executionId: UuidString,
|
|
1058
|
+
projectId: z.string(),
|
|
1059
|
+
scenarioExecutionIds: z.array(UuidString)
|
|
1060
|
+
});
|
|
1061
|
+
var SCENARIO_AUTHORIZATION_STATUSES = ["pending", "authorised", "unauthorised"];
|
|
1062
|
+
var ScenarioAuthorizationStatus = z["enum"](SCENARIO_AUTHORIZATION_STATUSES);
|
|
1063
|
+
|
|
1064
|
+
var HostMessage = z.union([HostRequestMessage, HostResponseMessage]);
|
|
1065
|
+
var IdentityMessage = z.union([IdentityNotificationMessage, IdentityRequestMessage, IdentityResponseMessage]);
|
|
1066
|
+
var RequiredDataRowSchema = z.object({
|
|
1067
|
+
type: CredentialType,
|
|
1068
|
+
requiredAttributes: z.array(z.object({
|
|
1069
|
+
attribute: z.string(),
|
|
1070
|
+
value: z.string(),
|
|
1071
|
+
operator: z.string()
|
|
1072
|
+
}))
|
|
1073
|
+
});
|
|
1074
|
+
var RequiredVerificationData = z.object({
|
|
1075
|
+
ruleEngine: z.object({
|
|
1076
|
+
requiredData: z.array(RequiredDataRowSchema)
|
|
1077
|
+
}),
|
|
1078
|
+
PrivacyPreservingMonitoring: z.object({
|
|
1079
|
+
requiredData: z.array(RequiredDataRowSchema),
|
|
1080
|
+
verifications: z.array(z.object({
|
|
1081
|
+
scenarioVerifierAddress: z.string(),
|
|
1082
|
+
conditions: z.array(ZKPRequest)
|
|
1083
|
+
}))
|
|
1084
|
+
}),
|
|
1085
|
+
tfhe: z.object({
|
|
1086
|
+
requiredData: z.array(RequiredDataRowSchema),
|
|
1087
|
+
verifications: z.array(QueryConfigSimplified)
|
|
1088
|
+
})
|
|
1089
|
+
});
|
|
1090
|
+
|
|
1091
|
+
var WalletSignatureResponse = z.object({
|
|
1092
|
+
// the message we requested the user to sign
|
|
1093
|
+
message: z.string(),
|
|
1094
|
+
// the signature of the message
|
|
1095
|
+
signature: BlockchainSignature,
|
|
1096
|
+
// some wallets like Cardano Nami generate a new address for each transaction or signature
|
|
1097
|
+
// this means we have to request the signer's public key to verify the signature
|
|
1098
|
+
signerPublicKey: PublicKey,
|
|
1099
|
+
// the type of the signer's public key
|
|
1100
|
+
// this is optional because some wallets don't provide this information
|
|
1101
|
+
// but for other wallets like cosmos kepler, this is required to verify the signature
|
|
1102
|
+
signerPublicKeyType: z.string().optional(),
|
|
1103
|
+
// some wallets like Aptos Petra wrap the message in some text metadata before signing
|
|
1104
|
+
// this means the user doesn't sign the message directly, but a message that contains the original message
|
|
1105
|
+
signedMessage: z.string()
|
|
1106
|
+
});
|
|
1107
|
+
var VerifyWalletChallengeRequest = WalletSignatureResponse.and(z.object({
|
|
1108
|
+
address: BlockchainAddress,
|
|
1109
|
+
namespace: SupportedBlockchainNamespaceForSignatureAuth,
|
|
1110
|
+
blockchainId: BlockchainId.optional()
|
|
1111
|
+
}));
|
|
1112
|
+
|
|
1113
|
+
export { BaseQueryResponse as $, InitialDataRequest as A, BasicCustomerContactInformation as B, CredentialTypes as C, SignatureRequest as D, SendTransactionRequest as E, IdentityRequestMessage as F, AVAILABLE_FLOWS as G, AvailableFlow as H, IsVerifiedNotification as I, DataAvailableOnStart as J, KycOnboardingLevels as K, InitialDataResponse as L, SignatureResponse as M, TransactionResponse as N, OffChainScenarioExecutionData as O, PolygonIdInitialized as P, HostResponseMessage as Q, RiskScoreTypes as R, ScenarioAuthorizationData as S, TransactionData as T, ScenarioTypes as U, ScenarioType as V, ScenarioStatuses as W, ScenarioStatus as X, ScenarioSchema as Y, BackwardsCompatibleScenarioTypes as Z, BackwardsCompatibleScenarioType as _, RiskScoreType as a, AuthQrCodeData as a$, OffChainZKPRuleResult as a0, ExecuteQueryResponse as a1, RuleEngineResponse as a2, ScenarioExecutionResponse as a3, RuleResultStatuses as a4, RuleResultStatus as a5, RuleResultStatusLabels as a6, SdkVerificationOutput as a7, VerificationSessionStatuses as a8, VerificationSessionStatus as a9, WalletSignResponse as aA, TxAuthDataSignatureGatingRequest as aB, GetCustomerStatusRequest as aC, IdentitySdkMessage as aD, IdentitySdkMessageWithIdentifier as aE, TxAuthDataSignatureResponse as aF, TxAuthDataSignatureGatingError as aG, GetCustomerStatusResponse as aH, IdentityAppMessage as aI, IdentityWallet as aJ, HostMessage as aK, IdentityMessage as aL, RequiredDataRowSchema as aM, RequiredVerificationData as aN, MediaType as aO, MediaTypePID as aP, CIRCUIT_IDS as aQ, CircuitId as aR, ZeroKnowledgeProofRequest as aS, AUTHORIZATION_REQUEST_MESSAGE_TYPES as aT, AuthorizationRequestMessageTypes as aU, AuthorizationRequestMessageType as aV, AuthorizationRequestMessage as aW, ProofData as aX, ZeroKnowledgeProofResponse as aY, AuthorizationResponseMessage as aZ, CredentialQrCodeData as a_, VerificationOutput as aa, Scenario as ab, AbbreviatedWorkflowScenario as ac, TemplateScenario as ad, CreateTemplateScenario as ae, ComplianceImplementationStepsInput as af, SimplifiedCredential as ag, GetCredentialsRequest as ah, GetCredentialsResponse as ai, PolygonIdRequestData as aj, PolygonIdRequest as ak, PolygonIdResponseData as al, PolygonIdResponse as am, StartFlowRequest as an, IsVerifiedRequest as ao, IsVerifiedResponse as ap, GetTxAuthSigRequest as aq, GetTxAuthSigResponse as ar, GetTxAuthSigRequestTezos as as, GetTxAuthSigResponseTezos as at, HostRequestMessage as au, IdentityResponseMessage as av, GenerateWalletChallengeRequest as aw, AuthSession as ax, AuthSessionData as ay, ChallengeResponse as az, CustomerTypes as b, CreateAuthRequestProps as b$, QrCodeLinkWithSchemaType as b0, parseIden3Message as b1, parseSessionIdFromUrl as b2, QUERY_LOGIC_OPERATOR as b3, QueryLogicOperator as b4, OPERATORS as b5, Operator as b6, ZKPOperator as b7, operatorDisplayMap as b8, ARRAY_OPERATORS as b9, OperatorMappings as bA, OperatorToOLD_ChallengeQueryOperator as bB, OLD_ChallengeQueryOperatorToOperator as bC, OLD_QueryCredentialTypes as bD, OLD_QueryCredentialType as bE, getOldCredentialType as bF, getOldCredentialPath as bG, oldCredentialPathToDataLink as bH, TxAuthInput as bI, ApiTxAuthInput as bJ, TxSignatureResponse as bK, GetTxAuthDataSignatureResponse as bL, TezosTxAuthInput as bM, ApiTezosTxAuthInput as bN, TezosTxSignatureResponse as bO, GetTezosTxAuthDataSignatureResponse as bP, ExtendedTxAuthInput as bQ, ExtendedTezosTxAuthInput as bR, ExtendedTxAuthDataSignatureResponse as bS, ExtendedTezosTxAuthDataSignatureResponse as bT, AnyTxAuthDataSignatureResponse as bU, Eip155TxAuthInputJsSdk as bV, TezosTxAuthInputJsSdk as bW, AnyTxAuthInputJsSdk as bX, ZKPRequest as bY, ZKPRequestFromZKVerifier as bZ, PrivacyPreservingMonitoring as b_, ArrayOperator as ba, STRING_OPERATORS as bb, StringOperator as bc, NUMERIC_OPERATORS as bd, NumericOperator as be, BOOLEAN_OPERATORS as bf, BooleanOperator as bg, DATE_OPERATORS as bh, DateOperator as bi, SUPPORTED_TYPES as bj, SupportedType as bk, SupportedTypes as bl, IDInformationTfhe as bm, AllCredentialValues as bn, QueriesOptions as bo, QueryType as bp, QueryConfigTfhe as bq, QueryConfigSimplified as br, RuleResultQueryConfig as bs, PartialQueryConfigSimplified as bt, OLD_ChallengeQuerySchema as bu, QueryCredentialTypes as bv, QueryCredentialType as bw, ChallengeQuerySchema as bx, OLD_CHALLENGE_QUERY_OPERATORS as by, OLD_ChallengeQueryOperator as bz, CustomerType as c, AllScenarioExecutionAuthorizationData as c0, SCENARIO_AUTHORIZATION_STATUSES as c1, ScenarioAuthorizationStatus as c2, WalletSignatureResponse as c3, VerifyWalletChallengeRequest as c4, CredentialSchemas as c5, CredentialNames as c6, NexeraCredentialType as c7, getCredentialName as c8, CredentialType as c9, VerifiableCredential as ca, CredentialMediaType as cb, KycOnboardingLevel as d, KybOnboardingLevels as e, KybOnboardingLevel as f, CustomerOnboardingLevels as g, CustomerOnboardingLevel as h, CustomerStatuses as i, CustomerStatus as j, CUSTOMERS_CHARTS as k, CustomersChartType as l, CUSTOMER_TABLE_COLUMNS as m, CustomerTableColumn as n, CUSTOMER_AUTOMATION_REASONS as o, SdkVerificationResponseSchema as p, CloseScreenNotification as q, KycCompletionData as r, KycCompletionNotification as s, RuleEngineScenarioExecutionData as t, OnChainScenarioExecutionData as u, ScenarioExecutionData as v, ScenarioExecutionNotification as w, OcvSdkInitialized as x, StartCompletedNotification as y, IdentityNotificationMessage as z };
|