@nexeraid/identity-schemas 1.12.22-dev → 1.12.23-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/chainalysis.schema-9e5926b9.esm.js +2316 -0
- package/dist/chainalysis.schema-a9079d73.cjs.prod.js +2582 -0
- package/dist/chainalysis.schema-ab6cda47.cjs.dev.js +2582 -0
- package/dist/declarations/src/index.d.ts +4 -4
- package/dist/declarations/src/index.d.ts.map +1 -1
- package/dist/declarations/src/providers/big/BIGBitRankVerifiedScore.schema.d.ts +1735 -0
- package/dist/declarations/src/providers/big/BIGBitRankVerifiedScore.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/chainalysis/chainalysis.schema.d.ts +759 -0
- package/dist/declarations/src/providers/chainalysis/chainalysis.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/comply-advantage/comply-advantage.schema.d.ts +5735 -0
- package/dist/declarations/src/providers/comply-advantage/comply-advantage.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/customers.schema.d.ts +92 -0
- package/dist/declarations/src/providers/customers.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/index.d.ts +16 -0
- package/dist/declarations/src/providers/index.d.ts.map +1 -0
- package/dist/declarations/src/providers/ipquality/ipquality.schema.d.ts +1582 -0
- package/dist/declarations/src/providers/ipquality/ipquality.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/kyb-sessions.schema.d.ts +307 -0
- package/dist/declarations/src/providers/kyb-sessions.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/kyc-sessions.schema.d.ts +969 -0
- package/dist/declarations/src/providers/kyc-sessions.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/merkle-science/merkle-science.schema.d.ts +604 -0
- package/dist/declarations/src/providers/merkle-science/merkle-science.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/provider.schema.d.ts +10861 -0
- package/dist/declarations/src/providers/provider.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/scorechain/scorechain.schema.d.ts +3991 -0
- package/dist/declarations/src/providers/scorechain/scorechain.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/sumsub/sumsub-applicant.schema.d.ts +6460 -0
- package/dist/declarations/src/providers/sumsub/sumsub-applicant.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/sumsub/sumsub-reject.schema.d.ts +12 -0
- package/dist/declarations/src/providers/sumsub/sumsub-reject.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/sumsub/sumsub-webhooks.schema.d.ts +187 -0
- package/dist/declarations/src/providers/sumsub/sumsub-webhooks.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/sumsub/sumsub.schema.d.ts +314 -0
- package/dist/declarations/src/providers/sumsub/sumsub.schema.d.ts.map +1 -0
- package/dist/declarations/src/providers/synaps/synaps.schema.d.ts +4071 -0
- package/dist/declarations/src/providers/synaps/synaps.schema.d.ts.map +1 -0
- package/dist/declarations/src/webhooks/alert.schema.d.ts +98 -0
- package/dist/declarations/src/webhooks/alert.schema.d.ts.map +1 -0
- package/dist/declarations/src/webhooks/alert.webhooks.schema.d.ts +43 -0
- package/dist/declarations/src/webhooks/alert.webhooks.schema.d.ts.map +1 -0
- package/dist/declarations/src/webhooks/customer.webhooks.schema.d.ts +479 -0
- package/dist/declarations/src/webhooks/customer.webhooks.schema.d.ts.map +1 -0
- package/dist/declarations/src/webhooks/index.d.ts +7 -0
- package/dist/declarations/src/webhooks/index.d.ts.map +1 -0
- package/dist/declarations/src/webhooks/scenario-webhook.schema.d.ts +195 -0
- package/dist/declarations/src/webhooks/scenario-webhook.schema.d.ts.map +1 -0
- package/dist/declarations/src/webhooks/send-verification-flow-webhook.schema.d.ts +12605 -0
- package/dist/declarations/src/webhooks/send-verification-flow-webhook.schema.d.ts.map +1 -0
- package/dist/declarations/src/webhooks/svix.webhooks.schema.d.ts +53321 -0
- package/dist/declarations/src/webhooks/svix.webhooks.schema.d.ts.map +1 -0
- package/dist/{frontend-utilities.schema-c327466a.cjs.prod.js → frontend-utilities.schema-9951d168.cjs.prod.js} +1 -1
- package/dist/{frontend-utilities.schema-1699cc67.esm.js → frontend-utilities.schema-c150e92a.esm.js} +1 -1
- package/dist/{frontend-utilities.schema-9b6dbb5e.cjs.dev.js → frontend-utilities.schema-c3ccca7b.cjs.dev.js} +1 -1
- package/dist/{identity-api.schema-6c0e3df3.cjs.prod.js → identity-api.schema-181d93d3.cjs.prod.js} +1266 -1271
- package/dist/{identity-api.schema-b7ca0eb2.esm.js → identity-api.schema-2df73bbd.esm.js} +1265 -1272
- package/dist/{identity-api.schema-5be99363.cjs.dev.js → identity-api.schema-8832ddec.cjs.dev.js} +1266 -1271
- package/dist/nexeraid-identity-schemas.cjs.dev.js +2 -2
- package/dist/nexeraid-identity-schemas.cjs.prod.js +2 -2
- package/dist/nexeraid-identity-schemas.esm.js +3 -3
- package/dist/package.json +15 -3
- package/identity/dist/nexeraid-identity-schemas-identity.cjs.dev.js +1 -1
- package/identity/dist/nexeraid-identity-schemas-identity.cjs.prod.js +1 -1
- package/identity/dist/nexeraid-identity-schemas-identity.esm.js +1 -1
- package/package.json +15 -3
- package/providers/dist/nexeraid-identity-schemas-providers.cjs.d.ts +2 -0
- package/providers/dist/nexeraid-identity-schemas-providers.cjs.dev.js +276 -0
- package/providers/dist/nexeraid-identity-schemas-providers.cjs.js +7 -0
- package/providers/dist/nexeraid-identity-schemas-providers.cjs.prod.js +276 -0
- package/providers/dist/nexeraid-identity-schemas-providers.esm.js +4 -0
- package/providers/package.json +4 -0
- package/verifiable-credentials/dist/nexeraid-identity-schemas-verifiable-credentials.cjs.dev.js +2 -2
- package/verifiable-credentials/dist/nexeraid-identity-schemas-verifiable-credentials.cjs.prod.js +2 -2
- package/verifiable-credentials/dist/nexeraid-identity-schemas-verifiable-credentials.esm.js +2 -2
- package/webhooks/dist/nexeraid-identity-schemas-webhooks.cjs.d.ts +2 -0
- package/webhooks/dist/nexeraid-identity-schemas-webhooks.cjs.dev.js +662 -0
- package/webhooks/dist/nexeraid-identity-schemas-webhooks.cjs.js +7 -0
- package/webhooks/dist/nexeraid-identity-schemas-webhooks.cjs.prod.js +662 -0
- package/webhooks/dist/nexeraid-identity-schemas-webhooks.esm.js +580 -0
- package/webhooks/package.json +4 -0
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ae as UuidString, dy as ExternalCustomerId, aq as RiskScoreType, as as CustomerType, ay as CustomerOnboardingLevel, aA as CustomerStatus, ai as ISO3CountryCode, a2 as BlockchainAddress, bC as RuleResultStatus, dR as GenericVerifiableCredentialSchema, d_ as _toArray, dZ as _toConsumableArray, ad as EnvironmentSchema } from '../../dist/identity-api.schema-2df73bbd.esm.js';
|
|
3
|
+
import { M as MergedProviders, S as ScoringAnalysisResponse, B as BitRankVerifiedResponse, a as MerkleAddressResponse, I as IpQualityServiceAnalysisResponse, C as ComplyAdvantageSearchResponse } from '../../dist/chainalysis.schema-9e5926b9.esm.js';
|
|
4
|
+
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
5
|
+
import 'nanoid';
|
|
6
|
+
|
|
7
|
+
// Alert Statuses
|
|
8
|
+
var AlertStatuses = ["Open", "Under Investigation", "Pending", "Closed", "Escalated"];
|
|
9
|
+
var AlertStatus = z["enum"](AlertStatuses);
|
|
10
|
+
// Alert Types
|
|
11
|
+
var AlertTypes = ["AML Screening", "IP Screening", "Email Screening", "KYC Drop-off", "Onchain Monitoring", "Fraud", "Transaction Monitoring", "Duplicate"];
|
|
12
|
+
var AlertType = z["enum"](AlertTypes);
|
|
13
|
+
// Alert Severities
|
|
14
|
+
var AlertSeverities = ["Low", "Medium", "High"];
|
|
15
|
+
var AlertSeverity = z["enum"](AlertSeverities);
|
|
16
|
+
// Alert Categories
|
|
17
|
+
var AlertCategories = ["Onboarding", "Ongoing monitoring"];
|
|
18
|
+
var AlertCategory = z["enum"](AlertCategories);
|
|
19
|
+
var ALERT_CHART_TYPES = ["total", "new", "opened", "closed", "inProgress", "unassigned", "escalated", "overdue", "avgClosureTime", "ageOfOldest", "alertTrendsOverTime", "alertsByType", "ageOfOpenAlerts", "alertsPerOfficer", "alertsSeverity"];
|
|
20
|
+
var AlertChartType = z["enum"](ALERT_CHART_TYPES);
|
|
21
|
+
var ALERT_TABLE_COLUMNS = ["selected", "createdAt", "overdue", "id", "severity", "type", "description", "assignedTo", "country", "status"];
|
|
22
|
+
var AlertTableColumn = z["enum"](ALERT_TABLE_COLUMNS);
|
|
23
|
+
var UserInfoForDuplicate = z.object({
|
|
24
|
+
customerId: UuidString,
|
|
25
|
+
customerInfo: z.string().nullish(),
|
|
26
|
+
profilePicture: z.string().nullish(),
|
|
27
|
+
idDocumentUrl: z.string().nullish()
|
|
28
|
+
});
|
|
29
|
+
var DuplicateData = z.object({
|
|
30
|
+
original: UserInfoForDuplicate,
|
|
31
|
+
duplicate: UserInfoForDuplicate
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
var AlertWebhookPayload = z.object({
|
|
35
|
+
id: UuidString,
|
|
36
|
+
severity: AlertSeverity,
|
|
37
|
+
category: AlertCategory,
|
|
38
|
+
type: AlertType,
|
|
39
|
+
status: AlertStatus,
|
|
40
|
+
customerId: UuidString,
|
|
41
|
+
externalUserId: ExternalCustomerId.nullish(),
|
|
42
|
+
cmsProjectId: z.string().optional(),
|
|
43
|
+
createdAt: z.coerce.date(),
|
|
44
|
+
updatedAt: z.coerce.date(),
|
|
45
|
+
deletedBy: z.string().nullish(),
|
|
46
|
+
deletedAt: z.coerce.date().nullish()
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
var CustomerWebhookPayload = z.object({
|
|
50
|
+
cmsProjectId: z.string(),
|
|
51
|
+
customerId: UuidString,
|
|
52
|
+
externalClientId: ExternalCustomerId.nullish(),
|
|
53
|
+
createdBy: z.string(),
|
|
54
|
+
updatedBy: z.string(),
|
|
55
|
+
id: z.string(),
|
|
56
|
+
riskScore: RiskScoreType.nullish(),
|
|
57
|
+
type: CustomerType.nullish(),
|
|
58
|
+
onboardingLevel: CustomerOnboardingLevel.nullish(),
|
|
59
|
+
status: CustomerStatus.nullish(),
|
|
60
|
+
createdAt: z.coerce.date(),
|
|
61
|
+
updatedAt: z.coerce.date().nullish(),
|
|
62
|
+
reason: z.string().nullish(),
|
|
63
|
+
deletedBy: z.string().nullish(),
|
|
64
|
+
deletedAt: z.coerce.date().nullish()
|
|
65
|
+
});
|
|
66
|
+
var CUSTOMER_TOPICS = ["CUSTOMER_CREATED", "CUSTOMER_UPDATED", "CUSTOMER_DELETED", "CUSTOMER_STATUS_CHANGED", "CUSTOMER_RISK_LEVEL_CHANGED", "CUSTOMER_COUNTRY"];
|
|
67
|
+
var CustomerTopics = z["enum"](CUSTOMER_TOPICS);
|
|
68
|
+
var CustomerEvents = {
|
|
69
|
+
CUSTOMER_CREATED: z.object({
|
|
70
|
+
topic: z.literal("CUSTOMER_CREATED"),
|
|
71
|
+
subject: z.string().describe("Customer ID"),
|
|
72
|
+
// CUSTOMER ID
|
|
73
|
+
data: CustomerWebhookPayload
|
|
74
|
+
}),
|
|
75
|
+
CUSTOMER_UPDATED: z.object({
|
|
76
|
+
topic: z.literal("CUSTOMER_UPDATED"),
|
|
77
|
+
subject: z.string().describe("Customer ID"),
|
|
78
|
+
// CUSTOMER ID
|
|
79
|
+
data: CustomerWebhookPayload
|
|
80
|
+
}),
|
|
81
|
+
CUSTOMER_DELETED: z.object({
|
|
82
|
+
topic: z.literal("CUSTOMER_DELETED"),
|
|
83
|
+
subject: z.string().describe("Customer ID"),
|
|
84
|
+
// CUSTOMER ID
|
|
85
|
+
data: CustomerWebhookPayload
|
|
86
|
+
}),
|
|
87
|
+
CUSTOMER_STATUS_CHANGED: z.object({
|
|
88
|
+
topic: z.literal("CUSTOMER_STATUS_CHANGED"),
|
|
89
|
+
subject: z.string().describe("Project ID"),
|
|
90
|
+
// CMS PROJECT ID
|
|
91
|
+
data: z.object({
|
|
92
|
+
cmsProjectId: z.string(),
|
|
93
|
+
customerId: UuidString,
|
|
94
|
+
externalClientId: ExternalCustomerId.optional(),
|
|
95
|
+
fromStatus: CustomerStatus.optional(),
|
|
96
|
+
toStatus: CustomerStatus
|
|
97
|
+
// do we need updatedBy?
|
|
98
|
+
})
|
|
99
|
+
}),
|
|
100
|
+
CUSTOMER_RISK_LEVEL_CHANGED: z.object({
|
|
101
|
+
topic: z.literal("CUSTOMER_RISK_LEVEL_CHANGED"),
|
|
102
|
+
subject: z.string().describe("Project ID"),
|
|
103
|
+
// CMS PROJECT ID
|
|
104
|
+
data: z.object({
|
|
105
|
+
cmsProjectId: z.string(),
|
|
106
|
+
customerId: UuidString,
|
|
107
|
+
externalCustomerId: ExternalCustomerId.optional(),
|
|
108
|
+
fromRiskLevel: RiskScoreType.optional(),
|
|
109
|
+
toRiskLevel: RiskScoreType,
|
|
110
|
+
riskNumber: z.number().optional() // risk number is calculated based on toRiskLevel automatically when event is parsed with zod parse
|
|
111
|
+
}).transform(function (data) {
|
|
112
|
+
// assign riskNumber based on toRiskLevel (0 - 100)
|
|
113
|
+
switch (data.toRiskLevel) {
|
|
114
|
+
case "No risk":
|
|
115
|
+
data.riskNumber = 0;
|
|
116
|
+
break;
|
|
117
|
+
case "Low":
|
|
118
|
+
data.riskNumber = 25;
|
|
119
|
+
break;
|
|
120
|
+
case "Medium":
|
|
121
|
+
data.riskNumber = 50;
|
|
122
|
+
break;
|
|
123
|
+
case "High":
|
|
124
|
+
data.riskNumber = 100;
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
return data;
|
|
128
|
+
})
|
|
129
|
+
}),
|
|
130
|
+
CUSTOMER_COUNTRY: z.object({
|
|
131
|
+
topic: z.literal("CUSTOMER_COUNTRY"),
|
|
132
|
+
subject: z.string().describe("Project ID"),
|
|
133
|
+
// CMS PROJECT ID
|
|
134
|
+
data: z.object({
|
|
135
|
+
cmsProjectId: z.string(),
|
|
136
|
+
customerId: UuidString,
|
|
137
|
+
externalCustomerId: ExternalCustomerId.optional(),
|
|
138
|
+
country: ISO3CountryCode
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
var ScenarioWebhookPayloadSchema = z.object({
|
|
144
|
+
customerId: z.string(),
|
|
145
|
+
externalCustomerId: ExternalCustomerId.nullish(),
|
|
146
|
+
address: BlockchainAddress.nullish(),
|
|
147
|
+
result: RuleResultStatus,
|
|
148
|
+
executionId: z.string(),
|
|
149
|
+
scenarios: z.object({
|
|
150
|
+
scenarioId: z.string(),
|
|
151
|
+
result: z.object({
|
|
152
|
+
objectId: z.string(),
|
|
153
|
+
result: z.object({
|
|
154
|
+
// TODO maybe start using OpaChallengeQueryResponse
|
|
155
|
+
is_valid: z["boolean"](),
|
|
156
|
+
reasons: z.array(z.unknown())
|
|
157
|
+
})
|
|
158
|
+
}).array()
|
|
159
|
+
}).array(),
|
|
160
|
+
data: GenericVerifiableCredentialSchema.array()
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
var VerificationFlowResult = z.union([z.object({
|
|
164
|
+
type: z["enum"]([MergedProviders["enum"].integratedScorechain, MergedProviders["enum"].scorechain]),
|
|
165
|
+
data: ScoringAnalysisResponse
|
|
166
|
+
}), z.object({
|
|
167
|
+
type: z["enum"]([MergedProviders["enum"].big]),
|
|
168
|
+
data: BitRankVerifiedResponse
|
|
169
|
+
}), z.object({
|
|
170
|
+
type: z["enum"]([MergedProviders["enum"].merkleScience]),
|
|
171
|
+
data: MerkleAddressResponse
|
|
172
|
+
}), z.object({
|
|
173
|
+
type: z["enum"]([MergedProviders["enum"].integratedIpqualityscore, MergedProviders["enum"].ipQualityScore]),
|
|
174
|
+
data: IpQualityServiceAnalysisResponse
|
|
175
|
+
}), z.object({
|
|
176
|
+
type: z["enum"]([MergedProviders["enum"].integratedComplyAdvantage, MergedProviders["enum"].complyAdvantage]),
|
|
177
|
+
data: ComplyAdvantageSearchResponse
|
|
178
|
+
})]);
|
|
179
|
+
var VerificationFlowChecksWebhookPayload = z.object({
|
|
180
|
+
executionId: z.string(),
|
|
181
|
+
customerId: z.string(),
|
|
182
|
+
externalCustomerId: ExternalCustomerId.optional(),
|
|
183
|
+
address: z.string().nullish(),
|
|
184
|
+
result: z.array(VerificationFlowResult)
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
var WebhookEventTypes = ["send.scenario", "send.verification.flow", "customer.created", "customer.updated", "customer.deleted", "alert.created", "alert.updated", "alert.deleted"];
|
|
188
|
+
var WebhookEventType = z["enum"](WebhookEventTypes);
|
|
189
|
+
var WebhookEventTypesForm = ["webhooks.sendScenario", "webhooks.sendVerificationFlow", "webhooks.customerCreated", "webhooks.customerUpdated", "webhooks.customerDeleted", "webhooks.alertCreated", "webhooks.alertUpdated", "webhooks.alertDeleted"];
|
|
190
|
+
var WebhookEventTypeForm = z["enum"](WebhookEventTypesForm);
|
|
191
|
+
var AttemptsStatus = {
|
|
192
|
+
Success: 0,
|
|
193
|
+
Pending: 1,
|
|
194
|
+
Fail: 2,
|
|
195
|
+
Sending: 3
|
|
196
|
+
};
|
|
197
|
+
var _ref = Object.keys(AttemptsStatus),
|
|
198
|
+
_ref2 = _toArray(_ref),
|
|
199
|
+
firstKey = _ref2[0],
|
|
200
|
+
othersKeys = _ref2.slice(1);
|
|
201
|
+
var AttemptsStatusKeys = [firstKey].concat(_toConsumableArray(othersKeys));
|
|
202
|
+
var AttemptsStatusKey = z["enum"](AttemptsStatusKeys);
|
|
203
|
+
var AttemptsStatusCodes = ["0", "100", "200", "300", "400", "500"];
|
|
204
|
+
var AttemptsStatusCode = z["enum"](AttemptsStatusCodes);
|
|
205
|
+
/**
|
|
206
|
+
*
|
|
207
|
+
* Schemas
|
|
208
|
+
*
|
|
209
|
+
*/
|
|
210
|
+
var NexeraEventTypes = z.union([z.object({
|
|
211
|
+
name: z.literal("send.scenario"),
|
|
212
|
+
description: z.string(),
|
|
213
|
+
archived: z["boolean"](),
|
|
214
|
+
schemas: z.record(z.unknown())
|
|
215
|
+
}), z.object({
|
|
216
|
+
name: z.literal("send.verification.flow"),
|
|
217
|
+
description: z.string(),
|
|
218
|
+
archived: z["boolean"](),
|
|
219
|
+
schemas: z.record(z.unknown())
|
|
220
|
+
}), z.object({
|
|
221
|
+
name: z.literal("customer.created"),
|
|
222
|
+
description: z.string(),
|
|
223
|
+
archived: z["boolean"](),
|
|
224
|
+
schemas: z.record(z.unknown())
|
|
225
|
+
}), z.object({
|
|
226
|
+
name: z.literal("customer.updated"),
|
|
227
|
+
description: z.string(),
|
|
228
|
+
archived: z["boolean"](),
|
|
229
|
+
schemas: z.record(z.unknown())
|
|
230
|
+
}), z.object({
|
|
231
|
+
name: z.literal("customer.deleted"),
|
|
232
|
+
description: z.string(),
|
|
233
|
+
archived: z["boolean"](),
|
|
234
|
+
schemas: z.record(z.unknown())
|
|
235
|
+
}), z.object({
|
|
236
|
+
name: z.literal("alert.created"),
|
|
237
|
+
description: z.string(),
|
|
238
|
+
archived: z["boolean"](),
|
|
239
|
+
schemas: z.record(z.unknown())
|
|
240
|
+
}), z.object({
|
|
241
|
+
name: z.literal("alert.updated"),
|
|
242
|
+
description: z.string(),
|
|
243
|
+
archived: z["boolean"](),
|
|
244
|
+
schemas: z.record(z.unknown())
|
|
245
|
+
}), z.object({
|
|
246
|
+
name: z.literal("alert.deleted"),
|
|
247
|
+
description: z.string(),
|
|
248
|
+
archived: z["boolean"](),
|
|
249
|
+
schemas: z.record(z.unknown())
|
|
250
|
+
})]);
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
*
|
|
254
|
+
* Payload definitions
|
|
255
|
+
*
|
|
256
|
+
*/
|
|
257
|
+
var SendScenarioPayload = z.object({
|
|
258
|
+
eventType: z.literal("send.scenario"),
|
|
259
|
+
payload: ScenarioWebhookPayloadSchema
|
|
260
|
+
});
|
|
261
|
+
var SendVerificationFlowPayload = z.object({
|
|
262
|
+
eventType: z.literal("send.verification.flow"),
|
|
263
|
+
payload: VerificationFlowChecksWebhookPayload
|
|
264
|
+
});
|
|
265
|
+
var CustomerCreatedPayload = z.object({
|
|
266
|
+
eventType: z.literal("customer.created"),
|
|
267
|
+
payload: CustomerWebhookPayload
|
|
268
|
+
});
|
|
269
|
+
var CustomerUpdatedPayload = z.object({
|
|
270
|
+
eventType: z.literal("customer.updated"),
|
|
271
|
+
payload: CustomerWebhookPayload
|
|
272
|
+
});
|
|
273
|
+
var CustomerDeletedPayload = z.object({
|
|
274
|
+
eventType: z.literal("customer.deleted"),
|
|
275
|
+
payload: CustomerWebhookPayload
|
|
276
|
+
});
|
|
277
|
+
var AlertCreatedPayload = z.object({
|
|
278
|
+
eventType: z.literal("alert.created"),
|
|
279
|
+
payload: AlertWebhookPayload
|
|
280
|
+
});
|
|
281
|
+
var AlertUpdatedPayload = z.object({
|
|
282
|
+
eventType: z.literal("alert.updated"),
|
|
283
|
+
payload: AlertWebhookPayload
|
|
284
|
+
});
|
|
285
|
+
var AlertDeletedPayload = z.object({
|
|
286
|
+
eventType: z.literal("alert.deleted"),
|
|
287
|
+
payload: AlertWebhookPayload
|
|
288
|
+
});
|
|
289
|
+
var AllNexeraEventTypes = z.array(NexeraEventTypes);
|
|
290
|
+
var NexeraSvixEnvironmentConfig = z.object({
|
|
291
|
+
env: EnvironmentSchema
|
|
292
|
+
});
|
|
293
|
+
var EndpointHandlingForm = z.object({
|
|
294
|
+
endpointURL: z.string().min(1, {
|
|
295
|
+
message: "Webhook Endpoint URL is required!"
|
|
296
|
+
}).url({
|
|
297
|
+
message: "Provided URL is not valid"
|
|
298
|
+
}),
|
|
299
|
+
name: z.string().min(1, {
|
|
300
|
+
message: "Webhook name is required!"
|
|
301
|
+
}),
|
|
302
|
+
webhooks: z.object({
|
|
303
|
+
sendScenario: z["boolean"]().optional(),
|
|
304
|
+
sendVerificationFlow: z["boolean"]().optional(),
|
|
305
|
+
customerCreated: z["boolean"]().optional(),
|
|
306
|
+
customerUpdated: z["boolean"]().optional(),
|
|
307
|
+
customerDeleted: z["boolean"]().optional(),
|
|
308
|
+
alertCreated: z["boolean"]().optional(),
|
|
309
|
+
alertUpdated: z["boolean"]().optional(),
|
|
310
|
+
alertDeleted: z["boolean"]().optional()
|
|
311
|
+
}).optional()
|
|
312
|
+
});
|
|
313
|
+
var WebhookCheckboxInformation = z.object({
|
|
314
|
+
name: WebhookEventTypeForm,
|
|
315
|
+
label: z.string(),
|
|
316
|
+
description: z.string()
|
|
317
|
+
});
|
|
318
|
+
var EndpointCheckboxsCollapsiblesSchema = z.object({
|
|
319
|
+
title: z.string(),
|
|
320
|
+
icon: z.any(),
|
|
321
|
+
description: z.string(),
|
|
322
|
+
webhooks: z.array(WebhookCheckboxInformation)
|
|
323
|
+
});
|
|
324
|
+
var EndpointOut = z.object({
|
|
325
|
+
disabled: z["boolean"]().optional(),
|
|
326
|
+
id: z.string(),
|
|
327
|
+
description: z.string(),
|
|
328
|
+
url: z.string(),
|
|
329
|
+
filterTypes: z.array(z.string()).nullish().optional(),
|
|
330
|
+
createdAt: z.coerce.date(),
|
|
331
|
+
channel: z.array(z.string()).optional(),
|
|
332
|
+
metadata: z.record(z.string()),
|
|
333
|
+
rateLimit: z.number().nullish().optional(),
|
|
334
|
+
// We are using the uid
|
|
335
|
+
uid: z.string().nullish().optional(),
|
|
336
|
+
version: z.number(),
|
|
337
|
+
updatedAt: z.coerce.date()
|
|
338
|
+
});
|
|
339
|
+
var MessageDataOut = z.object({
|
|
340
|
+
id: z.string(),
|
|
341
|
+
eventType: WebhookEventType,
|
|
342
|
+
timestamp: z.coerce.date(),
|
|
343
|
+
payload: z.union([SendScenarioPayload, SendVerificationFlowPayload, CustomerCreatedPayload, CustomerUpdatedPayload, CustomerDeletedPayload, AlertCreatedPayload, AlertUpdatedPayload, AlertDeletedPayload])
|
|
344
|
+
});
|
|
345
|
+
var AttemptDataOut = z.object({
|
|
346
|
+
id: z.string(),
|
|
347
|
+
url: z.string(),
|
|
348
|
+
responseStatusCode: z.number(),
|
|
349
|
+
status: z.number(),
|
|
350
|
+
triggerType: z.coerce.string(),
|
|
351
|
+
msgId: z.string(),
|
|
352
|
+
endpointId: z.string(),
|
|
353
|
+
timestamp: z.coerce.date()
|
|
354
|
+
});
|
|
355
|
+
var MessageDataOutExtended = MessageDataOut.extend({
|
|
356
|
+
status: z.number(),
|
|
357
|
+
url: z.string(),
|
|
358
|
+
attempts: z.array(AttemptDataOut)
|
|
359
|
+
});
|
|
360
|
+
var EventType = z.object({
|
|
361
|
+
archived: z["boolean"]().optional(),
|
|
362
|
+
createdAt: z.coerce.date(),
|
|
363
|
+
description: z.string(),
|
|
364
|
+
featureFlag: z.string().optional(),
|
|
365
|
+
name: z.string(),
|
|
366
|
+
schemas: z.record(z.unknown()).optional(),
|
|
367
|
+
updatedAt: z.coerce.date()
|
|
368
|
+
});
|
|
369
|
+
var ListEventTypeOutput = z.object({
|
|
370
|
+
data: z.array(EventType),
|
|
371
|
+
done: z["boolean"](),
|
|
372
|
+
iterator: z.string().optional(),
|
|
373
|
+
prevIterator: z.string().optional()
|
|
374
|
+
});
|
|
375
|
+
var CreateEndpointInput = z.object({
|
|
376
|
+
projectId: z.string(),
|
|
377
|
+
name: z.string(),
|
|
378
|
+
eventTypes: z.array(WebhookEventType),
|
|
379
|
+
url: z.string()
|
|
380
|
+
});
|
|
381
|
+
var CreateEndpointOutput = EndpointOut.optional();
|
|
382
|
+
var ListEndpointsInput = z.object({
|
|
383
|
+
projectId: z.string()
|
|
384
|
+
});
|
|
385
|
+
var ListResponseEndpointOut = z.object({
|
|
386
|
+
endpoints: z.array(EndpointOut)
|
|
387
|
+
});
|
|
388
|
+
var UpdateEndpointInput = z.object({
|
|
389
|
+
projectId: z.string(),
|
|
390
|
+
endpointId: z.string(),
|
|
391
|
+
url: z.string(),
|
|
392
|
+
name: z.string(),
|
|
393
|
+
eventTypes: z.array(WebhookEventType).optional(),
|
|
394
|
+
disabled: z["boolean"]().optional()
|
|
395
|
+
});
|
|
396
|
+
var UpdateEndpointOutput = EndpointOut.optional();
|
|
397
|
+
var DeleteEndpointInput = z.object({
|
|
398
|
+
projectId: z.string(),
|
|
399
|
+
endpointId: z.string()
|
|
400
|
+
});
|
|
401
|
+
var DeleteEndpointOutput = z["boolean"]();
|
|
402
|
+
var GetEndpointSecretInput = z.object({
|
|
403
|
+
projectId: z.string(),
|
|
404
|
+
endpointId: z.string()
|
|
405
|
+
});
|
|
406
|
+
var GetEndpointSecretOutput = z.object({
|
|
407
|
+
key: z.string()
|
|
408
|
+
}).optional();
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
*
|
|
412
|
+
* Send Messages Types
|
|
413
|
+
*
|
|
414
|
+
*/
|
|
415
|
+
var SendMessageForSendScenarioInput = z.object({
|
|
416
|
+
projectId: z.string(),
|
|
417
|
+
payload: SendScenarioPayload
|
|
418
|
+
});
|
|
419
|
+
var SendMessageForSendVerificationFlowInput = z.object({
|
|
420
|
+
projectId: z.string(),
|
|
421
|
+
payload: SendVerificationFlowPayload
|
|
422
|
+
});
|
|
423
|
+
var SendMessageForCustomerCreatedInput = z.object({
|
|
424
|
+
projectId: z.string(),
|
|
425
|
+
payload: CustomerCreatedPayload
|
|
426
|
+
});
|
|
427
|
+
var SendMessageForCustomerUpdatedInput = z.object({
|
|
428
|
+
projectId: z.string(),
|
|
429
|
+
payload: CustomerUpdatedPayload
|
|
430
|
+
});
|
|
431
|
+
var SendMessageForCustomerDeletedInput = z.object({
|
|
432
|
+
projectId: z.string(),
|
|
433
|
+
payload: CustomerDeletedPayload
|
|
434
|
+
});
|
|
435
|
+
var SendMessageForAlertCreatedInput = z.object({
|
|
436
|
+
projectId: z.string(),
|
|
437
|
+
payload: AlertCreatedPayload
|
|
438
|
+
});
|
|
439
|
+
var SendMessageForAlertUpdatedInput = z.object({
|
|
440
|
+
projectId: z.string(),
|
|
441
|
+
payload: AlertUpdatedPayload
|
|
442
|
+
});
|
|
443
|
+
var SendMessageForAlertDeletedInput = z.object({
|
|
444
|
+
projectId: z.string(),
|
|
445
|
+
payload: AlertDeletedPayload
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
*
|
|
450
|
+
*
|
|
451
|
+
*
|
|
452
|
+
*/
|
|
453
|
+
var ListMessagesInput = z.object({
|
|
454
|
+
projectId: z.string(),
|
|
455
|
+
eventType: WebhookEventType.optional()
|
|
456
|
+
});
|
|
457
|
+
var GetMessagesInput = z.object({
|
|
458
|
+
projectId: z.string(),
|
|
459
|
+
messageId: z.string()
|
|
460
|
+
});
|
|
461
|
+
var ListMessagesOutput = z.object({
|
|
462
|
+
messages: z.array(MessageDataOut)
|
|
463
|
+
});
|
|
464
|
+
var ListAttemptsByMessageInput = z.object({
|
|
465
|
+
projectId: z.string(),
|
|
466
|
+
messageId: z.string()
|
|
467
|
+
});
|
|
468
|
+
var ListAttemptsByEndpointInput = z.object({
|
|
469
|
+
projectId: z.string(),
|
|
470
|
+
endpointId: z.string(),
|
|
471
|
+
eventType: WebhookEventType.optional(),
|
|
472
|
+
status: AttemptsStatusKey.optional(),
|
|
473
|
+
statusCode: AttemptsStatusCode.optional()
|
|
474
|
+
});
|
|
475
|
+
var ListAttemptsByMessageOutput = z.object({
|
|
476
|
+
attempts: z.array(AttemptDataOut)
|
|
477
|
+
});
|
|
478
|
+
var ConnectionHandlingWorkspaceInput = z.object({
|
|
479
|
+
projectId: z.string()
|
|
480
|
+
});
|
|
481
|
+
var ConnectionHandlingWorkspaceOutput = z["boolean"]();
|
|
482
|
+
var SendExampleMessageInput = z.object({
|
|
483
|
+
projectId: z.string(),
|
|
484
|
+
endpointId: z.string(),
|
|
485
|
+
eventType: WebhookEventType
|
|
486
|
+
});
|
|
487
|
+
var ResendWebhookInput = z.object({
|
|
488
|
+
projectId: z.string(),
|
|
489
|
+
endpointId: z.string(),
|
|
490
|
+
messageId: z.string()
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
*
|
|
495
|
+
* Types
|
|
496
|
+
*
|
|
497
|
+
*/
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
*
|
|
501
|
+
* Send Messages Types
|
|
502
|
+
*
|
|
503
|
+
*/
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
*
|
|
507
|
+
*
|
|
508
|
+
*
|
|
509
|
+
*/
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
*
|
|
513
|
+
* Payload types
|
|
514
|
+
*
|
|
515
|
+
*/
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
*
|
|
519
|
+
* Constants definitions
|
|
520
|
+
*
|
|
521
|
+
*/
|
|
522
|
+
var NexeraWebhookEvents = [{
|
|
523
|
+
name: "send.scenario",
|
|
524
|
+
description: "Send Scenario Webhook",
|
|
525
|
+
archived: false,
|
|
526
|
+
schemas: {
|
|
527
|
+
1: zodToJsonSchema(SendScenarioPayload)
|
|
528
|
+
}
|
|
529
|
+
}, {
|
|
530
|
+
name: "send.verification.flow",
|
|
531
|
+
description: "Send Verification Flow Webhook",
|
|
532
|
+
archived: false,
|
|
533
|
+
schemas: {
|
|
534
|
+
1: zodToJsonSchema(SendVerificationFlowPayload)
|
|
535
|
+
}
|
|
536
|
+
}, {
|
|
537
|
+
name: "customer.created",
|
|
538
|
+
description: "Customer Created Webhook",
|
|
539
|
+
archived: false,
|
|
540
|
+
schemas: {
|
|
541
|
+
1: zodToJsonSchema(CustomerCreatedPayload)
|
|
542
|
+
}
|
|
543
|
+
}, {
|
|
544
|
+
name: "customer.updated",
|
|
545
|
+
description: "Customer Updated Webhook",
|
|
546
|
+
archived: false,
|
|
547
|
+
schemas: {
|
|
548
|
+
1: zodToJsonSchema(CustomerUpdatedPayload)
|
|
549
|
+
}
|
|
550
|
+
}, {
|
|
551
|
+
name: "customer.deleted",
|
|
552
|
+
description: "Customer Deleted Webhook",
|
|
553
|
+
archived: false,
|
|
554
|
+
schemas: {
|
|
555
|
+
1: zodToJsonSchema(CustomerDeletedPayload)
|
|
556
|
+
}
|
|
557
|
+
}, {
|
|
558
|
+
name: "alert.created",
|
|
559
|
+
description: "Alert Created Webhook",
|
|
560
|
+
archived: false,
|
|
561
|
+
schemas: {
|
|
562
|
+
1: zodToJsonSchema(AlertCreatedPayload)
|
|
563
|
+
}
|
|
564
|
+
}, {
|
|
565
|
+
name: "alert.updated",
|
|
566
|
+
description: "Alert Updated Webhook",
|
|
567
|
+
archived: false,
|
|
568
|
+
schemas: {
|
|
569
|
+
1: zodToJsonSchema(AlertUpdatedPayload)
|
|
570
|
+
}
|
|
571
|
+
}, {
|
|
572
|
+
name: "alert.deleted",
|
|
573
|
+
description: "Alert Deleted Webhook",
|
|
574
|
+
archived: false,
|
|
575
|
+
schemas: {
|
|
576
|
+
1: zodToJsonSchema(AlertDeletedPayload)
|
|
577
|
+
}
|
|
578
|
+
}];
|
|
579
|
+
|
|
580
|
+
export { ALERT_CHART_TYPES, ALERT_TABLE_COLUMNS, AlertCategories, AlertCategory, AlertChartType, AlertCreatedPayload, AlertDeletedPayload, AlertSeverities, AlertSeverity, AlertStatus, AlertStatuses, AlertTableColumn, AlertType, AlertTypes, AlertUpdatedPayload, AlertWebhookPayload, AllNexeraEventTypes, AttemptDataOut, AttemptsStatus, AttemptsStatusCode, AttemptsStatusCodes, AttemptsStatusKey, AttemptsStatusKeys, CUSTOMER_TOPICS, ConnectionHandlingWorkspaceInput, ConnectionHandlingWorkspaceOutput, CreateEndpointInput, CreateEndpointOutput, CustomerCreatedPayload, CustomerDeletedPayload, CustomerEvents, CustomerTopics, CustomerUpdatedPayload, CustomerWebhookPayload, DeleteEndpointInput, DeleteEndpointOutput, DuplicateData, EndpointCheckboxsCollapsiblesSchema, EndpointHandlingForm, EndpointOut, EventType, GetEndpointSecretInput, GetEndpointSecretOutput, GetMessagesInput, ListAttemptsByEndpointInput, ListAttemptsByMessageInput, ListAttemptsByMessageOutput, ListEndpointsInput, ListEventTypeOutput, ListMessagesInput, ListMessagesOutput, ListResponseEndpointOut, MessageDataOut, MessageDataOutExtended, NexeraSvixEnvironmentConfig, NexeraWebhookEvents, ResendWebhookInput, ScenarioWebhookPayloadSchema, SendExampleMessageInput, SendMessageForAlertCreatedInput, SendMessageForAlertDeletedInput, SendMessageForAlertUpdatedInput, SendMessageForCustomerCreatedInput, SendMessageForCustomerDeletedInput, SendMessageForCustomerUpdatedInput, SendMessageForSendScenarioInput, SendMessageForSendVerificationFlowInput, SendScenarioPayload, SendVerificationFlowPayload, UpdateEndpointInput, UpdateEndpointOutput, UserInfoForDuplicate, VerificationFlowChecksWebhookPayload, VerificationFlowResult, WebhookCheckboxInformation, WebhookEventType, WebhookEventTypeForm, WebhookEventTypes, WebhookEventTypesForm };
|