@nexeraid/identity-schemas 2.3.24-dev → 2.3.25-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.
Files changed (42) hide show
  1. package/dist/{customers.schema-cc3df18f.cjs.dev.js → customers.schema-0ce8464a.cjs.dev.js} +1 -1
  2. package/dist/{customers.schema-f0d472b1.cjs.prod.js → customers.schema-459fdc4d.cjs.prod.js} +1 -1
  3. package/dist/{customers.schema-0306abb6.esm.js → customers.schema-8f6c7924.esm.js} +1 -1
  4. package/dist/declarations/src/identity/app-requests.schema.d.ts +366 -366
  5. package/dist/declarations/src/identity/app-requests.schema.d.ts.map +1 -1
  6. package/dist/declarations/src/identity/challenge-query.schema.d.ts +117 -149
  7. package/dist/declarations/src/identity/challenge-query.schema.d.ts.map +1 -1
  8. package/dist/declarations/src/identity/host-requests.schema.d.ts +44 -44
  9. package/dist/declarations/src/identity/identity-v2.schema.d.ts +94 -94
  10. package/dist/declarations/src/identity/kyc.schema.d.ts +150 -150
  11. package/dist/declarations/src/identity/polygon-id.schema.d.ts +8 -8
  12. package/dist/declarations/src/identity/query.schema.d.ts +69 -67
  13. package/dist/declarations/src/identity/query.schema.d.ts.map +1 -1
  14. package/dist/declarations/src/identity/zkps.schema.d.ts +97 -97
  15. package/dist/declarations/src/identity-ids.schema.d.ts +20 -2
  16. package/dist/declarations/src/identity-ids.schema.d.ts.map +1 -1
  17. package/dist/declarations/src/nexeraSSID.schema.d.ts +2 -0
  18. package/dist/declarations/src/nexeraSSID.schema.d.ts.map +1 -1
  19. package/dist/declarations/src/providers/kyc-sessions.schema.d.ts +75 -75
  20. package/dist/{frontend-utilities.schema-02fc8336.esm.js → frontend-utilities.schema-8b213997.esm.js} +1 -1
  21. package/dist/{frontend-utilities.schema-0be040b7.cjs.dev.js → frontend-utilities.schema-9ce4190b.cjs.dev.js} +1 -1
  22. package/dist/{frontend-utilities.schema-cd88e673.cjs.prod.js → frontend-utilities.schema-d4d6374c.cjs.prod.js} +1 -1
  23. package/dist/{identity-api.schema-2de31155.cjs.prod.js → identity-api.schema-a16ec830.cjs.dev.js} +417 -396
  24. package/dist/{identity-api.schema-68a83f54.esm.js → identity-api.schema-d1954107.esm.js} +406 -396
  25. package/dist/{identity-api.schema-bbb2c243.cjs.dev.js → identity-api.schema-f103ebd9.cjs.prod.js} +417 -396
  26. package/dist/nexeraid-identity-schemas.cjs.dev.js +14 -3
  27. package/dist/nexeraid-identity-schemas.cjs.prod.js +14 -3
  28. package/dist/nexeraid-identity-schemas.esm.js +3 -3
  29. package/dist/package.json +1 -1
  30. package/identity/dist/nexeraid-identity-schemas-identity.cjs.dev.js +3 -2
  31. package/identity/dist/nexeraid-identity-schemas-identity.cjs.prod.js +3 -2
  32. package/identity/dist/nexeraid-identity-schemas-identity.esm.js +1 -1
  33. package/package.json +1 -1
  34. package/providers/dist/nexeraid-identity-schemas-providers.cjs.dev.js +2 -2
  35. package/providers/dist/nexeraid-identity-schemas-providers.cjs.prod.js +2 -2
  36. package/providers/dist/nexeraid-identity-schemas-providers.esm.js +2 -2
  37. package/verifiable-credentials/dist/nexeraid-identity-schemas-verifiable-credentials.cjs.dev.js +2 -2
  38. package/verifiable-credentials/dist/nexeraid-identity-schemas-verifiable-credentials.cjs.prod.js +2 -2
  39. package/verifiable-credentials/dist/nexeraid-identity-schemas-verifiable-credentials.esm.js +2 -2
  40. package/webhooks/dist/nexeraid-identity-schemas-webhooks.cjs.dev.js +2 -2
  41. package/webhooks/dist/nexeraid-identity-schemas-webhooks.cjs.prod.js +2 -2
  42. package/webhooks/dist/nexeraid-identity-schemas-webhooks.esm.js +2 -2
@@ -2076,6 +2076,176 @@ function _toConsumableArray(r) {
2076
2076
  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
2077
2077
  }
2078
2078
 
2079
+ var StoragePrefix = "storage";
2080
+ var IdentityPrefix = "identity";
2081
+ var EmailPrefix = "email";
2082
+ var WalletPrefix = "wallet";
2083
+ var AppPrefix = "app";
2084
+ var ChallengePrefix = "challenge";
2085
+ var TestPrefix = "test";
2086
+ var CustomerScreeningPrefix = "cstscr";
2087
+ var TagPrefix = "tag";
2088
+
2089
+ // TMS
2090
+ var TransactionPrefix = "tx";
2091
+ var TransactionReviewPrefix = "txrev";
2092
+ var TransactionPartiesPrefix = "txpar";
2093
+ var TransactionInfosPrefix = "txi";
2094
+ var TransactionExtractedInfosPrefix = "txei";
2095
+ var TransactionMethodsPrefix = "txm";
2096
+ var TransactionMethodExtractedInfosPrefix = "txmei";
2097
+ var InstitutionPrefix = "ins";
2098
+ var InstitutionExtractedInfosPrefix = "insei";
2099
+
2100
+ // Add these lines near the top of the file with other prefix definitions
2101
+ var ScenarioPrefix = "scenario";
2102
+ var ListPrefix = "list";
2103
+ var QueryPrefix = "query";
2104
+ var ActionPrefix = "action";
2105
+
2106
+ // ---
2107
+
2108
+ // Add these lines in the type definitions section
2109
+
2110
+ // TMS
2111
+
2112
+ // ---
2113
+
2114
+ // TMS
2115
+
2116
+ // Scenarios service
2117
+
2118
+ var createBrandedSchemaId = function createBrandedSchemaId(brand) {
2119
+ return zod.z.custom(function (val) {
2120
+ if (typeof val !== "string") return false;
2121
+ return val.startsWith(brand);
2122
+ }, {
2123
+ message: "Invalid ".concat(brand, " id")
2124
+ });
2125
+ };
2126
+
2127
+ // ---
2128
+
2129
+ var StorageId = createBrandedSchemaId("".concat(StoragePrefix, "_"));
2130
+ var IdentityId = createBrandedSchemaId("".concat(IdentityPrefix, "_"));
2131
+ var EmailId = createBrandedSchemaId("".concat(EmailPrefix, "_"));
2132
+ var WalletId = createBrandedSchemaId("".concat(WalletPrefix, "_"));
2133
+ var AppId = createBrandedSchemaId("".concat(AppPrefix, "_"));
2134
+ var ChallengeId = createBrandedSchemaId("".concat(ChallengePrefix, "_"));
2135
+ var TestId = createBrandedSchemaId("".concat(TestPrefix, "_"));
2136
+ var CustomerScreeningId = createBrandedSchemaId("".concat(CustomerScreeningPrefix, "_"));
2137
+ var TagId = createBrandedSchemaId("".concat(TagPrefix, "_"));
2138
+ var ActionId = createBrandedSchemaId("".concat(ActionPrefix, "_"));
2139
+
2140
+ // TMS
2141
+ var TransactionId = createBrandedSchemaId("".concat(TransactionPrefix, "_"));
2142
+ var TransactionReviewId = createBrandedSchemaId("".concat(TransactionReviewPrefix, "_"));
2143
+ var TransactionPartiesId = createBrandedSchemaId("".concat(TransactionPartiesPrefix, "_"));
2144
+ var TransactionInfosId = createBrandedSchemaId("".concat(TransactionInfosPrefix, "_"));
2145
+ var TransactionExtractedInfosId = createBrandedSchemaId("".concat(TransactionExtractedInfosPrefix, "_"));
2146
+ var TransactionMethodsId = createBrandedSchemaId("".concat(TransactionMethodsPrefix, "_"));
2147
+ var TransactionMethodExtractedInfosId = createBrandedSchemaId("".concat(TransactionMethodExtractedInfosPrefix, "_"));
2148
+ var InstitutionId = createBrandedSchemaId("".concat(InstitutionPrefix, "_"));
2149
+ var InstitutionExtractedInfosId = createBrandedSchemaId("".concat(InstitutionExtractedInfosPrefix, "_"));
2150
+ var ScenarioId = createBrandedSchemaId("".concat(ScenarioPrefix, "_"));
2151
+ var ListId = createBrandedSchemaId("".concat(ListPrefix, "_"));
2152
+ var QueryId = createBrandedSchemaId("".concat(QueryPrefix, "_"));
2153
+ var generateId = function generateId(type // Add this line
2154
+ ) {
2155
+ return "".concat(type, "_").concat(nanoid.nanoid(12));
2156
+ };
2157
+ var MemberId = zod.z.string();
2158
+
2159
+ var FLOW_TYPES = ["web2", "web3"];
2160
+ var FlowType = zod.z["enum"](FLOW_TYPES).describe("The flow type of the user");
2161
+ var VerificationModes = ["full_verification", "sandbox"];
2162
+ var VerificationMode = zod.z["enum"](VerificationModes).describe("The verification mode of the project");
2163
+ var IDENTITY_DOCUMENT_COUNTRY_LIST_OPTIONS = ["allowedCountryIdentityDocuments", "excludedCountryIdentityDocuments"];
2164
+ var IdentityDocumentCountryListOption = zod.z["enum"](IDENTITY_DOCUMENT_COUNTRY_LIST_OPTIONS);
2165
+ var IDENTITY_DOCUMENT_OPTIONS = ["PASSPORT", "ID_CARD", "DRIVING_LICENSE"];
2166
+ var IdentityDocumentOptionsType = zod.z["enum"](IDENTITY_DOCUMENT_OPTIONS);
2167
+ var PERSONAL_INFORMATION_FIELDS = ["EMAIL", "PHONE", "TWITTER", "DISCORD", "TELEGRAM"];
2168
+ var PersonalInformationFieldsIdentityDocuments = zod.z["enum"](PERSONAL_INFORMATION_FIELDS);
2169
+ var Identifier = zod.z.union([zod.z.literal("verification"), zod.z.literal("management")]);
2170
+
2171
+ /**
2172
+ * Represents the additional data that can be attached to a customer
2173
+ */
2174
+
2175
+ var AdditionalCustomerInformationParams = zod.z.object({
2176
+ email: zod.z.string().email().optional(),
2177
+ phone: zod.z.string().min(4).optional(),
2178
+ wallet: zod.z.object({
2179
+ address: BlockchainAddress,
2180
+ namespace: BlockchainNamespace
2181
+ }).optional()
2182
+ });
2183
+ var OrganizationId = zod.z.string();
2184
+ var WorkspaceId = zod.z.string();
2185
+ var WorkflowId = UuidString;
2186
+ var CustomerId = UuidString;
2187
+ var IdentityWidgetAccessToken = zod.z.object({
2188
+ sub: BlockchainAddress,
2189
+ blockchainNamespace: BlockchainNamespace,
2190
+ exp: zod.z.number(),
2191
+ projectId: zod.z.string(),
2192
+ organizationId: OrganizationId,
2193
+ customerId: UuidString,
2194
+ workspaceId: WorkspaceId,
2195
+ // cmsProjectId
2196
+ workflowId: WorkflowId.optional(),
2197
+ ipAddress: zod.z.string().optional(),
2198
+ timestamp: zod.z.number(),
2199
+ storeSharedVC: zod.z["boolean"]().nullish(),
2200
+ verificationMode: VerificationMode,
2201
+ hosts: zod.z.array(zod.z.string())
2202
+ });
2203
+
2204
+ // represents an id of a consumer in the external system of our client
2205
+ // as it's an external id, it can be any string
2206
+ var ExternalCustomerId = zod.z.string();
2207
+ var IdentityAppV2BaseJWT = zod.z.object({
2208
+ sub: IdentityId,
2209
+ // @todo: this is named "flow type" here, but it's named "protocol" in the dashboard selection
2210
+ flowType: zod.z.union([zod.z.literal(FlowType.Values.web3), zod.z.literal(FlowType.Values.web2)]),
2211
+ exp: zod.z.number(),
2212
+ customerId: UuidString,
2213
+ verificationMode: VerificationMode,
2214
+ organizationId: OrganizationId,
2215
+ workspaceId: WorkspaceId,
2216
+ workflowId: WorkflowId,
2217
+ ipAddress: zod.z.string().optional(),
2218
+ timestamp: zod.z.number(),
2219
+ iat: zod.z.number(),
2220
+ hosts: zod.z.array(zod.z.string())
2221
+ });
2222
+ var IdentityAppV2Web3JWT = IdentityAppV2BaseJWT.extend({
2223
+ flowType: zod.z.literal(FlowType.Values.web3),
2224
+ blockchainAddress: BlockchainAddress,
2225
+ blockchainNamespace: BlockchainNamespace
2226
+ });
2227
+ var IdentityAppV2Web2JWT = IdentityAppV2BaseJWT.extend({
2228
+ flowType: zod.z.literal(FlowType.Values.web2),
2229
+ /**
2230
+ * @deprecated Fetch the additional user information from the services instead of relying on this field
2231
+ * We only have this field in web2 mode because most of the services are relying on the blockchain address to be present in the JWT
2232
+ */
2233
+ deprecated_additionalUserInformation: AdditionalCustomerInformationParams.optional()
2234
+ });
2235
+ var IdentityWidgetAccessToken_NEW = zod.z.union([IdentityAppV2Web3JWT, IdentityAppV2Web2JWT]);
2236
+ var IdentityWidgetSessionToken = zod.z.union([IdentityWidgetAccessToken, IdentityWidgetAccessToken_NEW]);
2237
+
2238
+ /**
2239
+ * The parameters required to create a new configuration in web2 mode.
2240
+ */
2241
+
2242
+ var Web2CreateSessionParams = zod.z.object({
2243
+ workflowId: WorkflowId,
2244
+ // required in web2 because we don't have the wallet address
2245
+ externalCustomerId: ExternalCustomerId,
2246
+ additionalInformation: AdditionalCustomerInformationParams.optional()
2247
+ });
2248
+
2079
2249
  var ScenarioTypes = ["ChallengeQuery", "OnChainZKP", "OffChainZKP"];
2080
2250
  var ScenarioType = zod.z["enum"](ScenarioTypes);
2081
2251
  var ScenarioStatuses = ["UpToDate", "NoRulesAdded", "HasNotDeployment"];
@@ -2102,137 +2272,6 @@ var RuleResultStatuses = ["valid", "not-valid", "error", "unknown"];
2102
2272
  var RuleResultStatus = zod.z["enum"](RuleResultStatuses);
2103
2273
  var RuleResultStatusLabels = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, RuleResultStatus.Enum.valid, "Valid"), RuleResultStatus.Enum["not-valid"], "Not Valid"), RuleResultStatus.Enum.error, "Error"), RuleResultStatus.Enum.unknown, "Unknown");
2104
2274
 
2105
- // Request
2106
-
2107
- var MediaType = /*#__PURE__*/function (MediaType) {
2108
- MediaType["ZKPMessage"] = "application/iden3-zkp-json";
2109
- MediaType["PlainMessage"] = "application/iden3comm-plain-json";
2110
- MediaType["SignedMessage"] = "application/iden3comm-signed-json";
2111
- return MediaType;
2112
- }({});
2113
- var MediaTypePID = zod.z.nativeEnum(MediaType);
2114
- var CIRCUIT_IDS = ["authV2", "stateTransition", "credentialAtomicQueryMTPV2", "credentialAtomicQueryMTPV2OnChain", "credentialAtomicQuerySigV2", "credentialAtomicQuerySigV2OnChain", "credentialAtomicQueryV3-beta.1", "credentialAtomicQueryV3OnChain-beta.1", "linkedMultiQuery10-beta.1"];
2115
- var CircuitId = zod.z["enum"](CIRCUIT_IDS);
2116
- var ZeroKnowledgeProofRequest = zod.z.object({
2117
- id: zod.z.number(),
2118
- circuitId: zod.z.string(),
2119
- optional: zod.z["boolean"]().optional(),
2120
- query: zod.z.record(zod.z.string(), zod.z.any())
2121
- });
2122
- var AUTHORIZATION_REQUEST_MESSAGE_TYPES = {
2123
- AUTHORIZATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/authorization/1.0/request",
2124
- AUTHORIZATION_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/authorization/1.0/response",
2125
- CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/issuance-request",
2126
- CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/fetch-request",
2127
- CREDENTIAL_OFFER_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/offer",
2128
- CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/issuance-response",
2129
- CREDENTIAL_REFRESH_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/refresh",
2130
- DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/devices/1.0/registration",
2131
- MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/messages/1.0/fetch",
2132
- PROOF_GENERATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/request",
2133
- PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/response",
2134
- REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/revocation/1.0/request-status",
2135
- REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/revocation/1.0/status",
2136
- CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/contract-invoke-request",
2137
- CONTRACT_INVOKE_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/contract-invoke-response",
2138
- CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/onchain-offer",
2139
- PROPOSAL_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/proposal-request",
2140
- PROPOSAL_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/proposal",
2141
- PAYMENT_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/payment-request",
2142
- PAYMENT_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/payment"
2143
- };
2144
- 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"];
2145
- var AuthorizationRequestMessageType = zod.z["enum"](AuthorizationRequestMessageTypes);
2146
- var AuthorizationRequestMessage = zod.z.object({
2147
- id: zod.z.string(),
2148
- typ: MediaTypePID.optional(),
2149
- type: AuthorizationRequestMessageType,
2150
- thid: zod.z.string().optional(),
2151
- body: zod.z.object({
2152
- callbackUrl: zod.z.string(),
2153
- reason: zod.z.string().optional(),
2154
- did_doc: zod.z.any().optional(),
2155
- message: zod.z.string().optional(),
2156
- scope: zod.z.array(ZeroKnowledgeProofRequest)
2157
- }),
2158
- from: zod.z.string(),
2159
- to: zod.z.string().optional()
2160
- });
2161
- // Response
2162
- var ProofData = zod.z.object({
2163
- pi_a: zod.z.array(zod.z.string()),
2164
- pi_b: zod.z.array(zod.z.array(zod.z.string())),
2165
- pi_c: zod.z.array(zod.z.string()),
2166
- protocol: zod.z.string(),
2167
- curve: zod.z.string().optional()
2168
- });
2169
- var ZeroKnowledgeProofResponse = zod.z.object({
2170
- id: zod.z.number(),
2171
- circuitId: zod.z.string(),
2172
- vp: zod.z.any().optional(),
2173
- proof: ProofData,
2174
- pub_signals: zod.z.array(zod.z.string())
2175
- });
2176
- var AuthorizationResponseMessage = zod.z.object({
2177
- id: zod.z.string(),
2178
- typ: MediaTypePID.optional(),
2179
- type: zod.z.string(),
2180
- thid: zod.z.string().optional(),
2181
- body: zod.z.object({
2182
- did_doc: zod.z.any().optional(),
2183
- message: zod.z.string().optional(),
2184
- scope: zod.z.array(ZeroKnowledgeProofResponse)
2185
- }),
2186
- from: zod.z.string().optional(),
2187
- to: zod.z.string().optional()
2188
- });
2189
- // Polygon Wallet
2190
- var CredentialQrCodeData = zod.z.object({
2191
- id: zod.z.string(),
2192
- typ: zod.z.string(),
2193
- type: zod.z.string(),
2194
- thid: zod.z.string(),
2195
- body: zod.z.object({
2196
- url: zod.z.string(),
2197
- credentials: zod.z.unknown()
2198
- }),
2199
- from: zod.z.string(),
2200
- to: zod.z.string()
2201
- });
2202
- var AuthQrCodeData = zod.z.object({
2203
- id: zod.z.string(),
2204
- typ: zod.z.string(),
2205
- type: zod.z.string(),
2206
- thid: zod.z.string(),
2207
- body: zod.z.object({
2208
- callbackUrl: zod.z.string(),
2209
- reason: zod.z.string(),
2210
- scope: zod.z.unknown()
2211
- }),
2212
- from: zod.z.string()
2213
- });
2214
- var QrCodeLinkWithSchemaType = zod.z.object({
2215
- qrCodeLink: zod.z.string().nullish(),
2216
- schemaType: zod.z.string().nullish()
2217
- }).describe("Polygon ID Verifiable Credential Offer, to be consumed by the Polygon ID Wallet");
2218
- function parseIden3Message(input) {
2219
- var prefix = "request_uri=";
2220
- var startIndex = input.indexOf(prefix);
2221
- if (startIndex === -1) {
2222
- throw new Error("Wrong request - request doesn't start with request_uri=");
2223
- }
2224
- return zod.z.string().url().parse(input.substring(startIndex + prefix.length));
2225
- }
2226
- function parseSessionIdFromUrl(urlString) {
2227
- var url = new URL(urlString);
2228
- var params = new URLSearchParams(url.search);
2229
- var sessionId = params.get("sessionID");
2230
- if (!sessionId) {
2231
- throw new Error("No Session Id found in callback url");
2232
- }
2233
- return sessionId;
2234
- }
2235
-
2236
2275
  function _arrayWithHoles(r) {
2237
2276
  if (Array.isArray(r)) return r;
2238
2277
  }
@@ -2253,9 +2292,10 @@ function zodEnumFromObjKeys(obj) {
2253
2292
  return zod.z["enum"]([firstKey].concat(_toConsumableArray(otherKeys)));
2254
2293
  }
2255
2294
  var AllCredentialAttributes = zod.z.union([zodEnumFromObjKeys(IDInformationCredentialSubjectSchema.shape), zodEnumFromObjKeys(IDImageCredentialSubjectSchema.shape), zodEnumFromObjKeys(SelfieImageCredentialSubjectSchema.shape), zodEnumFromObjKeys(ProofOfResidenceCredentialSubjectSchema.shape)]);
2256
- var AllCredentialValues = zod.z.union([zod.z["boolean"](), zod.z.string(), zod.z.number(), zod.z.array(zod.z.union([zod.z.string(), zod.z.number()]))]);
2257
- var Operator = zod.z["enum"](["$noop", "$eq", "$lt", "$lte", "$gt", "$gte", "$in", "$nin", "$ne"]);
2258
- var ZKPOperator = Operator.exclude(["$lte", "$gte"]);
2295
+ var AllCredentialValues = zod.z.union([zod.z["boolean"](), zod.z.string(), zod.z.number(), zod.z.array(zod.z.string()), zod.z.array(zod.z.number())]);
2296
+ var OPERATORS = ["$noop", "$eq", "$lt", "$lte", "$gt", "$gte", "$in", "$nin", "$ne"];
2297
+ var Operator = zod.z["enum"](OPERATORS);
2298
+ var ZKPOperator = zod.z["enum"](OPERATORS).exclude(["$lte", "$gte"]);
2259
2299
  var operatorDisplayMap = _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");
2260
2300
  var ARRAY_OPERATORS = [Operator["enum"].$in, Operator["enum"].$nin, Operator["enum"].$eq, Operator["enum"].$ne];
2261
2301
  var ArrayOperator = zod.z["enum"](ARRAY_OPERATORS);
@@ -2417,6 +2457,234 @@ var DeleteQueryConfigurationResponse = zod.z.object({
2417
2457
  var QueryCredentialTypes = ["IDInformation", "IDImage", "SelfieImage", "ProofOfResidence"];
2418
2458
  var QueryCredentialType = zod.z["enum"](QueryCredentialTypes);
2419
2459
 
2460
+ // these are attributes are marked optional to be better presented by openapi.
2461
+ // this is hopefully fixed in the refined version of the schema
2462
+ var ChallengeQueryOperators = zod.z.object({
2463
+ GREATER_THAN: zod.z.optional(zod.z.number()),
2464
+ LESS_THAN: zod.z.optional(zod.z.number()),
2465
+ EQUAL_TO: zod.z.optional(zod.z.union([zod.z.string(), zod.z.number(), zod.z.array(zod.z.never()), zod.z.array(zod.z.number()), zod.z.array(zod.z.string())])),
2466
+ NOT_EQUAL_TO: zod.z.optional(zod.z.union([zod.z.string(), zod.z.number(), zod.z.array(zod.z.never()), zod.z.array(zod.z.number()), zod.z.array(zod.z.string())])),
2467
+ LESS_THAN_OR_EQUAL_TO: zod.z.optional(zod.z.number()),
2468
+ GREATER_THAN_OR_EQUAL_TO: zod.z.optional(zod.z.number()),
2469
+ IN: zod.z.optional(zod.z.union([zod.z.string(), zod.z.array(zod.z.number()), zod.z.array(zod.z.string())])),
2470
+ NOT_IN: zod.z.optional(zod.z.union([zod.z.string(), zod.z.array(zod.z.number()), zod.z.array(zod.z.string())]))
2471
+ }).refine(function (data) {
2472
+ // make sure tht if an operator is defined, the value is also defined
2473
+ for (var operator in data) {
2474
+ var value = data[operator];
2475
+ if (value === undefined) {
2476
+ return false;
2477
+ }
2478
+ }
2479
+ // make sure that only one operator is defined at a time
2480
+ var operators = Object.keys(data);
2481
+ if (operators.length > 1) {
2482
+ return false;
2483
+ }
2484
+ return true;
2485
+ });
2486
+ var 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"];
2487
+ var ChallengeQueryOperator = zod.z["enum"](CHALLENGE_QUERY_OPERATORS);
2488
+ var OperatorToChallengeQueryOperator = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Operator["enum"].$noop, ChallengeQueryOperator["enum"].EQUAL_TO), Operator["enum"].$eq, ChallengeQueryOperator["enum"].EQUAL_TO), Operator["enum"].$lt, ChallengeQueryOperator["enum"].LESS_THAN), Operator["enum"].$lte, ChallengeQueryOperator["enum"].LESS_THAN_OR_EQUAL_TO), Operator["enum"].$gt, ChallengeQueryOperator["enum"].GREATER_THAN), Operator["enum"].$gte, ChallengeQueryOperator["enum"].GREATER_THAN_OR_EQUAL_TO), Operator["enum"].$in, ChallengeQueryOperator["enum"].IN), Operator["enum"].$nin, ChallengeQueryOperator["enum"].NOT_IN), Operator["enum"].$ne, ChallengeQueryOperator["enum"].NOT_EQUAL_TO);
2489
+ var ChallengeQueryOperatorToOperator = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ChallengeQueryOperator["enum"].EQUAL_TO, Operator["enum"].$eq), ChallengeQueryOperator["enum"].LESS_THAN, Operator["enum"].$lt), ChallengeQueryOperator["enum"].LESS_THAN_OR_EQUAL_TO, Operator["enum"].$lte), ChallengeQueryOperator["enum"].GREATER_THAN, Operator["enum"].$gt), ChallengeQueryOperator["enum"].GREATER_THAN_OR_EQUAL_TO, Operator["enum"].$gte), ChallengeQueryOperator["enum"].IN, Operator["enum"].$in), ChallengeQueryOperator["enum"].NOT_IN, Operator["enum"].$nin), ChallengeQueryOperator["enum"].NOT_EQUAL_TO, Operator["enum"].$ne);
2490
+ var ChallengeQuerySchema = zod.z.object({
2491
+ id: zod.z.string().optional(),
2492
+ query: QueryConfig
2493
+ });
2494
+ var ExecuteChallengeQueryInput = zod.z.object({
2495
+ externalCustomerId: ExternalCustomerId.nullish(),
2496
+ address: BlockchainAddress.nullish(),
2497
+ credentials: zod.z.array(GenericVerifiableCredentialSchema).min(1),
2498
+ challengeQuery: QueryConfig
2499
+ });
2500
+ var ExecuteChallengeQueryConfig = zod.z.object({
2501
+ input: ExecuteChallengeQueryInput,
2502
+ executionId: zod.z.string(),
2503
+ sessionId: zod.z.string().nullish(),
2504
+ cmsObjectId: zod.z.string(),
2505
+ cmsScenarioId: zod.z.string().optional()
2506
+ });
2507
+ var OpaChallengeQueryResponse = zod.z.object({
2508
+ result: zod.z.object({
2509
+ is_valid: zod.z["boolean"](),
2510
+ reasons: zod.z.array(zod.z.string())
2511
+ })
2512
+ });
2513
+ var ExecuteChallengeQueryResponse = OpaChallengeQueryResponse.extend({
2514
+ executionId: zod.z.string()
2515
+ });
2516
+ var OPAChallengeQuery = zod.z.record(ChallengeQueryOperators).refine(function (data) {
2517
+ // we are not validating the dotPath, only the operators
2518
+ for (var dotPath in data) {
2519
+ var operatorsData = data[dotPath];
2520
+ if (operatorsData === undefined) {
2521
+ return false;
2522
+ }
2523
+ // if the operator is not a valid operator, operatorsData will be {}
2524
+ var operators = Object.keys(operatorsData);
2525
+ if (operators.length === 0) {
2526
+ return false;
2527
+ }
2528
+ }
2529
+ return true;
2530
+ }, {
2531
+ message: "Invalid operator found."
2532
+ });
2533
+ var OffChainZKPRuleResult = zod.z.object({
2534
+ result: zod.z.object({
2535
+ is_valid: zod.z["boolean"](),
2536
+ query: QueryConfigSimplified,
2537
+ reasons: zod.z.array(zod.z.string())
2538
+ })
2539
+ });
2540
+ var SdkVerificationOutput = zod.z.object({
2541
+ customerId: zod.z.string().optional(),
2542
+ // for v1
2543
+ scenarioExecutionId: zod.z.string().optional(),
2544
+ // for v1
2545
+ status: RuleResultStatus.optional(),
2546
+ // for v1
2547
+ results: zod.z.array(ScenarioExecutionResponse).optional() // for v1,
2548
+ });
2549
+ var VerificationSessionStatuses = ["IN_PROGRESS", "COMPLETED", "NOT_STARTED"];
2550
+ var VerificationSessionStatus = zod.z["enum"](VerificationSessionStatuses);
2551
+ var VerificationOutput = zod.z.object({
2552
+ id: UuidString.nullable(),
2553
+ verificationResult: SdkVerificationOutput.nullable(),
2554
+ status: VerificationSessionStatus
2555
+ });
2556
+
2557
+ // Request
2558
+
2559
+ var MediaType = /*#__PURE__*/function (MediaType) {
2560
+ MediaType["ZKPMessage"] = "application/iden3-zkp-json";
2561
+ MediaType["PlainMessage"] = "application/iden3comm-plain-json";
2562
+ MediaType["SignedMessage"] = "application/iden3comm-signed-json";
2563
+ return MediaType;
2564
+ }({});
2565
+ var MediaTypePID = zod.z.nativeEnum(MediaType);
2566
+ var CIRCUIT_IDS = ["authV2", "stateTransition", "credentialAtomicQueryMTPV2", "credentialAtomicQueryMTPV2OnChain", "credentialAtomicQuerySigV2", "credentialAtomicQuerySigV2OnChain", "credentialAtomicQueryV3-beta.1", "credentialAtomicQueryV3OnChain-beta.1", "linkedMultiQuery10-beta.1"];
2567
+ var CircuitId = zod.z["enum"](CIRCUIT_IDS);
2568
+ var ZeroKnowledgeProofRequest = zod.z.object({
2569
+ id: zod.z.number(),
2570
+ circuitId: zod.z.string(),
2571
+ optional: zod.z["boolean"]().optional(),
2572
+ query: zod.z.record(zod.z.string(), zod.z.any())
2573
+ });
2574
+ var AUTHORIZATION_REQUEST_MESSAGE_TYPES = {
2575
+ AUTHORIZATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/authorization/1.0/request",
2576
+ AUTHORIZATION_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/authorization/1.0/response",
2577
+ CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/issuance-request",
2578
+ CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/fetch-request",
2579
+ CREDENTIAL_OFFER_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/offer",
2580
+ CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/issuance-response",
2581
+ CREDENTIAL_REFRESH_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/refresh",
2582
+ DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/devices/1.0/registration",
2583
+ MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/messages/1.0/fetch",
2584
+ PROOF_GENERATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/request",
2585
+ PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/response",
2586
+ REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/revocation/1.0/request-status",
2587
+ REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/revocation/1.0/status",
2588
+ CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/contract-invoke-request",
2589
+ CONTRACT_INVOKE_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/contract-invoke-response",
2590
+ CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/onchain-offer",
2591
+ PROPOSAL_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/proposal-request",
2592
+ PROPOSAL_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/proposal",
2593
+ PAYMENT_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/payment-request",
2594
+ PAYMENT_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/payment"
2595
+ };
2596
+ 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"];
2597
+ var AuthorizationRequestMessageType = zod.z["enum"](AuthorizationRequestMessageTypes);
2598
+ var AuthorizationRequestMessage = zod.z.object({
2599
+ id: zod.z.string(),
2600
+ typ: MediaTypePID.optional(),
2601
+ type: AuthorizationRequestMessageType,
2602
+ thid: zod.z.string().optional(),
2603
+ body: zod.z.object({
2604
+ callbackUrl: zod.z.string(),
2605
+ reason: zod.z.string().optional(),
2606
+ did_doc: zod.z.any().optional(),
2607
+ message: zod.z.string().optional(),
2608
+ scope: zod.z.array(ZeroKnowledgeProofRequest)
2609
+ }),
2610
+ from: zod.z.string(),
2611
+ to: zod.z.string().optional()
2612
+ });
2613
+ // Response
2614
+ var ProofData = zod.z.object({
2615
+ pi_a: zod.z.array(zod.z.string()),
2616
+ pi_b: zod.z.array(zod.z.array(zod.z.string())),
2617
+ pi_c: zod.z.array(zod.z.string()),
2618
+ protocol: zod.z.string(),
2619
+ curve: zod.z.string().optional()
2620
+ });
2621
+ var ZeroKnowledgeProofResponse = zod.z.object({
2622
+ id: zod.z.number(),
2623
+ circuitId: zod.z.string(),
2624
+ vp: zod.z.any().optional(),
2625
+ proof: ProofData,
2626
+ pub_signals: zod.z.array(zod.z.string())
2627
+ });
2628
+ var AuthorizationResponseMessage = zod.z.object({
2629
+ id: zod.z.string(),
2630
+ typ: MediaTypePID.optional(),
2631
+ type: zod.z.string(),
2632
+ thid: zod.z.string().optional(),
2633
+ body: zod.z.object({
2634
+ did_doc: zod.z.any().optional(),
2635
+ message: zod.z.string().optional(),
2636
+ scope: zod.z.array(ZeroKnowledgeProofResponse)
2637
+ }),
2638
+ from: zod.z.string().optional(),
2639
+ to: zod.z.string().optional()
2640
+ });
2641
+ // Polygon Wallet
2642
+ var CredentialQrCodeData = zod.z.object({
2643
+ id: zod.z.string(),
2644
+ typ: zod.z.string(),
2645
+ type: zod.z.string(),
2646
+ thid: zod.z.string(),
2647
+ body: zod.z.object({
2648
+ url: zod.z.string(),
2649
+ credentials: zod.z.unknown()
2650
+ }),
2651
+ from: zod.z.string(),
2652
+ to: zod.z.string()
2653
+ });
2654
+ var AuthQrCodeData = zod.z.object({
2655
+ id: zod.z.string(),
2656
+ typ: zod.z.string(),
2657
+ type: zod.z.string(),
2658
+ thid: zod.z.string(),
2659
+ body: zod.z.object({
2660
+ callbackUrl: zod.z.string(),
2661
+ reason: zod.z.string(),
2662
+ scope: zod.z.unknown()
2663
+ }),
2664
+ from: zod.z.string()
2665
+ });
2666
+ var QrCodeLinkWithSchemaType = zod.z.object({
2667
+ qrCodeLink: zod.z.string().nullish(),
2668
+ schemaType: zod.z.string().nullish()
2669
+ }).describe("Polygon ID Verifiable Credential Offer, to be consumed by the Polygon ID Wallet");
2670
+ function parseIden3Message(input) {
2671
+ var prefix = "request_uri=";
2672
+ var startIndex = input.indexOf(prefix);
2673
+ if (startIndex === -1) {
2674
+ throw new Error("Wrong request - request doesn't start with request_uri=");
2675
+ }
2676
+ return zod.z.string().url().parse(input.substring(startIndex + prefix.length));
2677
+ }
2678
+ function parseSessionIdFromUrl(urlString) {
2679
+ var url = new URL(urlString);
2680
+ var params = new URLSearchParams(url.search);
2681
+ var sessionId = params.get("sessionID");
2682
+ if (!sessionId) {
2683
+ throw new Error("No Session Id found in callback url");
2684
+ }
2685
+ return sessionId;
2686
+ }
2687
+
2420
2688
  var ScenarioAuthorizationData = zod.z.object({
2421
2689
  executionId: UuidString,
2422
2690
  sessionId: UuidString,
@@ -2428,15 +2696,11 @@ var ScenarioAuthorizationData = zod.z.object({
2428
2696
  requestMessage: AuthorizationRequestMessage,
2429
2697
  responseMessage: AuthorizationResponseMessage.nullish(),
2430
2698
  verificationError: zod.z.string().nullish(),
2431
- query: QueryConfigSimplified,
2699
+ query: QueryConfigSimplified.array(),
2432
2700
  workflowSessionId: UuidString.optional()
2433
2701
  });
2434
- var SdkVerificationResponseSchema = zod.z.object({
2435
- customerId: zod.z.string(),
2436
- scenarioExecutionId: zod.z.string(),
2437
- status: RuleResultStatus,
2438
- results: zod.z.array(ScenarioExecutionResponse)
2439
- });
2702
+ // v1 sdk
2703
+ var SdkVerificationResponseSchema = SdkVerificationOutput;
2440
2704
  var CloseScreenNotification = zod.z.object({
2441
2705
  type: zod.z.literal("closeScreen"),
2442
2706
  identifier: zod.z.string(),
@@ -2537,260 +2801,6 @@ var HostResponseMessage = zod.z.union([InitialDataResponse, SignatureResponse, T
2537
2801
  * Exported types
2538
2802
  */
2539
2803
 
2540
- var StoragePrefix = "storage";
2541
- var IdentityPrefix = "identity";
2542
- var EmailPrefix = "email";
2543
- var WalletPrefix = "wallet";
2544
- var AppPrefix = "app";
2545
- var ChallengePrefix = "challenge";
2546
- var TestPrefix = "test";
2547
- var CustomerScreeningPrefix = "cstscr";
2548
- var TagPrefix = "tag";
2549
-
2550
- // TMS
2551
- var TransactionPrefix = "tx";
2552
- var TransactionReviewPrefix = "txrev";
2553
- var TransactionPartiesPrefix = "txpar";
2554
- var TransactionInfosPrefix = "txi";
2555
- var TransactionExtractedInfosPrefix = "txei";
2556
- var TransactionMethodsPrefix = "txm";
2557
- var TransactionMethodExtractedInfosPrefix = "txmei";
2558
- var InstitutionPrefix = "ins";
2559
- var InstitutionExtractedInfosPrefix = "insei";
2560
-
2561
- // ---
2562
-
2563
- // TMS
2564
-
2565
- // ---
2566
-
2567
- // TMS
2568
-
2569
- var createBrandedSchemaId = function createBrandedSchemaId(brand) {
2570
- return zod.z.custom(function (val) {
2571
- if (typeof val !== "string") return false;
2572
- return val.startsWith(brand);
2573
- }, {
2574
- message: "Invalid ".concat(brand, " id")
2575
- });
2576
- };
2577
-
2578
- // ---
2579
-
2580
- var StorageId = createBrandedSchemaId("".concat(StoragePrefix, "_"));
2581
- var IdentityId = createBrandedSchemaId("".concat(IdentityPrefix, "_"));
2582
- var EmailId = createBrandedSchemaId("".concat(EmailPrefix, "_"));
2583
- var WalletId = createBrandedSchemaId("".concat(WalletPrefix, "_"));
2584
- var AppId = createBrandedSchemaId("".concat(AppPrefix, "_"));
2585
- var ChallengeId = createBrandedSchemaId("".concat(ChallengePrefix, "_"));
2586
- var TestId = createBrandedSchemaId("".concat(TestPrefix, "_"));
2587
- var CustomerScreeningId = createBrandedSchemaId("".concat(CustomerScreeningPrefix, "_"));
2588
- var TagId = createBrandedSchemaId("".concat(TagPrefix, "_"));
2589
-
2590
- // TMS
2591
- var TransactionId = createBrandedSchemaId("".concat(TransactionPrefix, "_"));
2592
- var TransactionReviewId = createBrandedSchemaId("".concat(TransactionReviewPrefix, "_"));
2593
- var TransactionPartiesId = createBrandedSchemaId("".concat(TransactionPartiesPrefix, "_"));
2594
- var TransactionInfosId = createBrandedSchemaId("".concat(TransactionInfosPrefix, "_"));
2595
- var TransactionExtractedInfosId = createBrandedSchemaId("".concat(TransactionExtractedInfosPrefix, "_"));
2596
- var TransactionMethodsId = createBrandedSchemaId("".concat(TransactionMethodsPrefix, "_"));
2597
- var TransactionMethodExtractedInfosId = createBrandedSchemaId("".concat(TransactionMethodExtractedInfosPrefix, "_"));
2598
- var InstitutionId = createBrandedSchemaId("".concat(InstitutionPrefix, "_"));
2599
- var InstitutionExtractedInfosId = createBrandedSchemaId("".concat(InstitutionExtractedInfosPrefix, "_"));
2600
- var generateId = function generateId(type) {
2601
- return "".concat(type, "_").concat(nanoid.nanoid(12));
2602
- };
2603
-
2604
- var FLOW_TYPES = ["web2", "web3"];
2605
- var FlowType = zod.z["enum"](FLOW_TYPES).describe("The flow type of the user");
2606
- var VerificationModes = ["full_verification", "sandbox"];
2607
- var VerificationMode = zod.z["enum"](VerificationModes).describe("The verification mode of the project");
2608
- var IDENTITY_DOCUMENT_COUNTRY_LIST_OPTIONS = ["allowedCountryIdentityDocuments", "excludedCountryIdentityDocuments"];
2609
- var IdentityDocumentCountryListOption = zod.z["enum"](IDENTITY_DOCUMENT_COUNTRY_LIST_OPTIONS);
2610
- var IDENTITY_DOCUMENT_OPTIONS = ["PASSPORT", "ID_CARD", "DRIVING_LICENSE"];
2611
- var IdentityDocumentOptionsType = zod.z["enum"](IDENTITY_DOCUMENT_OPTIONS);
2612
- var PERSONAL_INFORMATION_FIELDS = ["EMAIL", "PHONE", "TWITTER", "DISCORD", "TELEGRAM"];
2613
- var PersonalInformationFieldsIdentityDocuments = zod.z["enum"](PERSONAL_INFORMATION_FIELDS);
2614
- var Identifier = zod.z.union([zod.z.literal("verification"), zod.z.literal("management")]);
2615
-
2616
- /**
2617
- * Represents the additional data that can be attached to a customer
2618
- */
2619
-
2620
- var AdditionalCustomerInformationParams = zod.z.object({
2621
- email: zod.z.string().email().optional(),
2622
- phone: zod.z.string().min(4).optional(),
2623
- wallet: zod.z.object({
2624
- address: BlockchainAddress,
2625
- namespace: BlockchainNamespace
2626
- }).optional()
2627
- });
2628
- var OrganizationId = zod.z.string();
2629
- var WorkspaceId = zod.z.string();
2630
- var WorkflowId = UuidString;
2631
- var IdentityWidgetAccessToken = zod.z.object({
2632
- sub: BlockchainAddress,
2633
- blockchainNamespace: BlockchainNamespace,
2634
- exp: zod.z.number(),
2635
- projectId: zod.z.string(),
2636
- organizationId: OrganizationId,
2637
- customerId: UuidString,
2638
- workspaceId: WorkspaceId,
2639
- // cmsProjectId
2640
- workflowId: WorkflowId.optional(),
2641
- ipAddress: zod.z.string().optional(),
2642
- timestamp: zod.z.number(),
2643
- storeSharedVC: zod.z["boolean"]().nullish(),
2644
- verificationMode: VerificationMode,
2645
- hosts: zod.z.array(zod.z.string())
2646
- });
2647
-
2648
- // represents an id of a consumer in the external system of our client
2649
- // as it's an external id, it can be any string
2650
- var ExternalCustomerId = zod.z.string();
2651
- var IdentityAppV2BaseJWT = zod.z.object({
2652
- sub: IdentityId,
2653
- // @todo: this is named "flow type" here, but it's named "protocol" in the dashboard selection
2654
- flowType: zod.z.union([zod.z.literal(FlowType.Values.web3), zod.z.literal(FlowType.Values.web2)]),
2655
- exp: zod.z.number(),
2656
- customerId: UuidString,
2657
- verificationMode: VerificationMode,
2658
- organizationId: OrganizationId,
2659
- workspaceId: WorkspaceId,
2660
- workflowId: WorkflowId,
2661
- ipAddress: zod.z.string().optional(),
2662
- timestamp: zod.z.number(),
2663
- iat: zod.z.number(),
2664
- hosts: zod.z.array(zod.z.string())
2665
- });
2666
- var IdentityAppV2Web3JWT = IdentityAppV2BaseJWT.extend({
2667
- flowType: zod.z.literal(FlowType.Values.web3),
2668
- blockchainAddress: BlockchainAddress,
2669
- blockchainNamespace: BlockchainNamespace
2670
- });
2671
- var IdentityAppV2Web2JWT = IdentityAppV2BaseJWT.extend({
2672
- flowType: zod.z.literal(FlowType.Values.web2),
2673
- /**
2674
- * @deprecated Fetch the additional user information from the services instead of relying on this field
2675
- * We only have this field in web2 mode because most of the services are relying on the blockchain address to be present in the JWT
2676
- */
2677
- deprecated_additionalUserInformation: AdditionalCustomerInformationParams.optional()
2678
- });
2679
- var IdentityWidgetAccessToken_NEW = zod.z.union([IdentityAppV2Web3JWT, IdentityAppV2Web2JWT]);
2680
- var IdentityWidgetSessionToken = zod.z.union([IdentityWidgetAccessToken, IdentityWidgetAccessToken_NEW]);
2681
-
2682
- /**
2683
- * The parameters required to create a new configuration in web2 mode.
2684
- */
2685
-
2686
- var Web2CreateSessionParams = zod.z.object({
2687
- workflowId: WorkflowId,
2688
- // required in web2 because we don't have the wallet address
2689
- externalCustomerId: ExternalCustomerId,
2690
- additionalInformation: AdditionalCustomerInformationParams.optional()
2691
- });
2692
-
2693
- // these are attributes are marked optional to be better presented by openapi.
2694
- // this is hopefully fixed in the refined version of the schema
2695
- var ChallengeQueryOperators = zod.z.object({
2696
- GREATER_THAN: zod.z.optional(zod.z.number()),
2697
- LESS_THAN: zod.z.optional(zod.z.number()),
2698
- EQUAL_TO: zod.z.optional(zod.z.union([zod.z.string(), zod.z.number(), zod.z.array(zod.z.never()), zod.z.array(zod.z.number()), zod.z.array(zod.z.string())])),
2699
- NOT_EQUAL_TO: zod.z.optional(zod.z.union([zod.z.string(), zod.z.number(), zod.z.array(zod.z.never()), zod.z.array(zod.z.number()), zod.z.array(zod.z.string())])),
2700
- LESS_THAN_OR_EQUAL_TO: zod.z.optional(zod.z.number()),
2701
- GREATER_THAN_OR_EQUAL_TO: zod.z.optional(zod.z.number()),
2702
- IN: zod.z.optional(zod.z.union([zod.z.string(), zod.z.array(zod.z.number()), zod.z.array(zod.z.string())])),
2703
- NOT_IN: zod.z.optional(zod.z.union([zod.z.string(), zod.z.array(zod.z.number()), zod.z.array(zod.z.string())]))
2704
- }).refine(function (data) {
2705
- // make sure tht if an operator is defined, the value is also defined
2706
- for (var operator in data) {
2707
- var value = data[operator];
2708
- if (value === undefined) {
2709
- return false;
2710
- }
2711
- }
2712
- // make sure that only one operator is defined at a time
2713
- var operators = Object.keys(data);
2714
- if (operators.length > 1) {
2715
- return false;
2716
- }
2717
- return true;
2718
- });
2719
- var ChallengeQueryOperator = zod.z["enum"](["GREATER_THAN", "LESS_THAN", "EQUAL_TO", "NOT_EQUAL_TO", "LESS_THAN_OR_EQUAL_TO", "GREATER_THAN_OR_EQUAL_TO", "IN", "NOT_IN"]);
2720
- var OperatorToChallengeQueryOperator = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Operator["enum"].$noop, ChallengeQueryOperator["enum"].EQUAL_TO), Operator["enum"].$eq, ChallengeQueryOperator["enum"].EQUAL_TO), Operator["enum"].$lt, ChallengeQueryOperator["enum"].LESS_THAN), Operator["enum"].$lte, ChallengeQueryOperator["enum"].LESS_THAN_OR_EQUAL_TO), Operator["enum"].$gt, ChallengeQueryOperator["enum"].GREATER_THAN), Operator["enum"].$gte, ChallengeQueryOperator["enum"].GREATER_THAN_OR_EQUAL_TO), Operator["enum"].$in, ChallengeQueryOperator["enum"].IN), Operator["enum"].$nin, ChallengeQueryOperator["enum"].NOT_IN), Operator["enum"].$ne, ChallengeQueryOperator["enum"].NOT_EQUAL_TO);
2721
- var ChallengeQueryOperatorToOperator = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ChallengeQueryOperator["enum"].EQUAL_TO, Operator["enum"].$eq), ChallengeQueryOperator["enum"].LESS_THAN, Operator["enum"].$lt), ChallengeQueryOperator["enum"].LESS_THAN_OR_EQUAL_TO, Operator["enum"].$lte), ChallengeQueryOperator["enum"].GREATER_THAN, Operator["enum"].$gt), ChallengeQueryOperator["enum"].GREATER_THAN_OR_EQUAL_TO, Operator["enum"].$gte), ChallengeQueryOperator["enum"].IN, Operator["enum"].$in), ChallengeQueryOperator["enum"].NOT_IN, Operator["enum"].$nin), ChallengeQueryOperator["enum"].NOT_EQUAL_TO, Operator["enum"].$ne);
2722
- var ChallengeQuerySchema = zod.z.object({
2723
- id: zod.z.string().optional(),
2724
- query: QueryConfig
2725
- });
2726
- var ExecuteChallengeQueryInput = zod.z.object({
2727
- externalCustomerId: ExternalCustomerId.nullish(),
2728
- address: BlockchainAddress.nullish(),
2729
- credentials: zod.z.array(GenericVerifiableCredentialSchema).min(1),
2730
- challengeQuery: QueryConfig
2731
- });
2732
- var ExecuteChallengeQueryConfig = zod.z.object({
2733
- input: ExecuteChallengeQueryInput,
2734
- executionId: zod.z.string(),
2735
- sessionId: zod.z.string().nullish(),
2736
- cmsObjectId: zod.z.string(),
2737
- cmsScenarioId: zod.z.string().optional()
2738
- });
2739
- var OpaChallengeQueryResponse = zod.z.object({
2740
- result: zod.z.object({
2741
- is_valid: zod.z["boolean"](),
2742
- reasons: zod.z.array(zod.z.string())
2743
- })
2744
- });
2745
- var ExecuteChallengeQueryResponse = OpaChallengeQueryResponse.extend({
2746
- executionId: zod.z.string()
2747
- });
2748
- var OPAChallengeQuery = zod.z.record(ChallengeQueryOperators).refine(function (data) {
2749
- // we are not validating the dotPath, only the operators
2750
- for (var dotPath in data) {
2751
- var operatorsData = data[dotPath];
2752
- if (operatorsData === undefined) {
2753
- return false;
2754
- }
2755
- // if the operator is not a valid operator, operatorsData will be {}
2756
- var operators = Object.keys(operatorsData);
2757
- if (operators.length === 0) {
2758
- return false;
2759
- }
2760
- }
2761
- return true;
2762
- }, {
2763
- message: "Invalid operator found."
2764
- });
2765
- var OnChainRuleResult = zod.z.object({
2766
- result: zod.z.object({
2767
- is_valid: zod.z["boolean"](),
2768
- txHash: TxHash,
2769
- scenarioVerifierAddress: AddressSchema,
2770
- reasons: zod.z.array(zod.z.string())
2771
- })
2772
- });
2773
- var OffChainZKPRuleResult = zod.z.object({
2774
- result: zod.z.object({
2775
- is_valid: zod.z["boolean"](),
2776
- query: QueryConfigSimplified,
2777
- reasons: zod.z.array(zod.z.string())
2778
- })
2779
- });
2780
- var SdkVerificationOutput = zod.z.object({
2781
- customerId: zod.z.string(),
2782
- scenarioExecutionId: zod.z.string(),
2783
- status: RuleResultStatus,
2784
- results: zod.z.array(ScenarioExecutionResponse)
2785
- });
2786
- var VerificationSessionStatuses = ["IN_PROGRESS", "COMPLETED", "NOT_STARTED"];
2787
- var VerificationSessionStatus = zod.z["enum"](VerificationSessionStatuses);
2788
- var VerificationOutput = zod.z.object({
2789
- id: UuidString.nullable(),
2790
- verificationResult: SdkVerificationOutput.nullable(),
2791
- status: VerificationSessionStatus
2792
- });
2793
-
2794
2804
  var ComplianceImplementationStepsInput = zod.z.object({
2795
2805
  identityChecks: zod.z["boolean"]().nullish(),
2796
2806
  configureIdentity: zod.z["boolean"]().nullish(),
@@ -3338,6 +3348,8 @@ exports.ALPHA_2_COUNTRIES = ALPHA_2_COUNTRIES;
3338
3348
  exports.ARRAY_OPERATORS = ARRAY_OPERATORS;
3339
3349
  exports.AUTHORIZATION_REQUEST_MESSAGE_TYPES = AUTHORIZATION_REQUEST_MESSAGE_TYPES;
3340
3350
  exports.AVAILABLE_FLOWS = AVAILABLE_FLOWS;
3351
+ exports.ActionId = ActionId;
3352
+ exports.ActionPrefix = ActionPrefix;
3341
3353
  exports.AdditionalCustomerInformationParams = AdditionalCustomerInformationParams;
3342
3354
  exports.AddressSchema = AddressSchema;
3343
3355
  exports.AllCredentialAttributes = AllCredentialAttributes;
@@ -3372,6 +3384,7 @@ exports.BlockchainId = BlockchainId;
3372
3384
  exports.BlockchainNamespace = BlockchainNamespace;
3373
3385
  exports.BlockchainSignature = BlockchainSignature;
3374
3386
  exports.BooleanOperator = BooleanOperator;
3387
+ exports.CHALLENGE_QUERY_OPERATORS = CHALLENGE_QUERY_OPERATORS;
3375
3388
  exports.CIRCUIT_IDS = CIRCUIT_IDS;
3376
3389
  exports.COSMOS_CHAIN_NAMES = COSMOS_CHAIN_NAMES;
3377
3390
  exports.COSMOS_CHAIN_NAMES_LIST = COSMOS_CHAIN_NAMES_LIST;
@@ -3404,6 +3417,7 @@ exports.CredentialQrCodeData = CredentialQrCodeData;
3404
3417
  exports.CredentialSchemas = CredentialSchemas;
3405
3418
  exports.CredentialType = CredentialType;
3406
3419
  exports.CredentialTypes = CredentialTypes;
3420
+ exports.CustomerId = CustomerId;
3407
3421
  exports.CustomerOnboardingLevel = CustomerOnboardingLevel;
3408
3422
  exports.CustomerOnboardingLevels = CustomerOnboardingLevels;
3409
3423
  exports.CustomerScreeningId = CustomerScreeningId;
@@ -3500,8 +3514,11 @@ exports.KycCompletionData = KycCompletionData;
3500
3514
  exports.KycCompletionNotification = KycCompletionNotification;
3501
3515
  exports.KycOnboardingLevel = KycOnboardingLevel;
3502
3516
  exports.KycOnboardingLevels = KycOnboardingLevels;
3517
+ exports.ListId = ListId;
3518
+ exports.ListPrefix = ListPrefix;
3503
3519
  exports.MediaType = MediaType;
3504
3520
  exports.MediaTypePID = MediaTypePID;
3521
+ exports.MemberId = MemberId;
3505
3522
  exports.NEXERA_ACTIVE_STARKNET_CHAIN_VALUES = NEXERA_ACTIVE_STARKNET_CHAIN_VALUES;
3506
3523
  exports.NEXERA_CHAIN_VALUES = NEXERA_CHAIN_VALUES;
3507
3524
  exports.NEXERA_COSMOS_CHAINS = NEXERA_COSMOS_CHAINS;
@@ -3525,11 +3542,11 @@ exports.OLD_IDInformationCredentialSubjectSchema = OLD_IDInformationCredentialSu
3525
3542
  exports.OLD_ProofOfResidenceCredentialSubjectSchema = OLD_ProofOfResidenceCredentialSubjectSchema;
3526
3543
  exports.OLD_SelfieImageCredentialSubjectSchema = OLD_SelfieImageCredentialSubjectSchema;
3527
3544
  exports.OPAChallengeQuery = OPAChallengeQuery;
3545
+ exports.OPERATORS = OPERATORS;
3528
3546
  exports.OcvSdkInitialized = OcvSdkInitialized;
3529
3547
  exports.OffChainScenarioExecutionData = OffChainScenarioExecutionData;
3530
3548
  exports.OffChainZKP = OffChainZKP;
3531
3549
  exports.OffChainZKPRuleResult = OffChainZKPRuleResult;
3532
- exports.OnChainRuleResult = OnChainRuleResult;
3533
3550
  exports.OnChainScenarioExecutionData = OnChainScenarioExecutionData;
3534
3551
  exports.OnChainZKP = OnChainZKP;
3535
3552
  exports.OnChainZKPFromNexeraID = OnChainZKPFromNexeraID;
@@ -3566,6 +3583,8 @@ exports.QueryConfigSimplifiedParsed = QueryConfigSimplifiedParsed;
3566
3583
  exports.QueryConfiguration = QueryConfiguration;
3567
3584
  exports.QueryCredentialType = QueryCredentialType;
3568
3585
  exports.QueryCredentialTypes = QueryCredentialTypes;
3586
+ exports.QueryId = QueryId;
3587
+ exports.QueryPrefix = QueryPrefix;
3569
3588
  exports.QueryType = QueryType;
3570
3589
  exports.RequiredDataRowSchema = RequiredDataRowSchema;
3571
3590
  exports.RequiredVerificationData = RequiredVerificationData;
@@ -3584,6 +3603,8 @@ exports.ScenarioAuthorizationStatus = ScenarioAuthorizationStatus;
3584
3603
  exports.ScenarioExecutionData = ScenarioExecutionData;
3585
3604
  exports.ScenarioExecutionNotification = ScenarioExecutionNotification;
3586
3605
  exports.ScenarioExecutionResponse = ScenarioExecutionResponse;
3606
+ exports.ScenarioId = ScenarioId;
3607
+ exports.ScenarioPrefix = ScenarioPrefix;
3587
3608
  exports.ScenarioStatus = ScenarioStatus;
3588
3609
  exports.ScenarioStatuses = ScenarioStatuses;
3589
3610
  exports.ScenarioType = ScenarioType;