@reventlessdev/reventless-registration 1.0.0-alpha.20 → 1.0.0-alpha.22
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/package.json +5 -5
- package/src/Registration/InboundTranslation/CompleteRegistration.res +2 -2
- package/src/Registration/InboundTranslation/CompleteRegistration.res.mjs +2 -2
- package/src/Registration/InboundTranslation/CompleteRegistration_Translation.res +1 -1
- package/src/Registration/InboundTranslation/CompleteRegistration_Translation.res.mjs +1 -1
- package/src/Registration/InboundTranslation/SignUp.res +3 -3
- package/src/Registration/InboundTranslation/SignUp.res.mjs +4 -3
- package/src/Registration/InboundTranslation/SignUp_Translation.res +5 -5
- package/src/Registration/InboundTranslation/SignUp_Translation.res.mjs +4 -4
- package/src/Registration/OutboundTranslation/CreateRegisteredPrincipal.res +5 -5
- package/src/Registration/OutboundTranslation/CreateRegisteredPrincipal.res.mjs +5 -5
- package/src/Registration/OutboundTranslation/CreateRegisteredPrincipal_Translation.res +8 -8
- package/src/Registration/OutboundTranslation/CreateRegisteredPrincipal_Translation.res.mjs +12 -12
- package/src/Registration/OutboundTranslation/SendRegistrationChallenge.res +12 -12
- package/src/Registration/OutboundTranslation/SendRegistrationChallenge.res.mjs +11 -11
- package/src/Registration/OutboundTranslation/SendRegistrationChallenge_Translation.res +18 -18
- package/src/Registration/OutboundTranslation/SendRegistrationChallenge_Translation.res.mjs +30 -30
- package/src/Registration/StateChange/Registrations.res +44 -44
- package/src/Registration/StateChange/Registrations.res.mjs +42 -42
- package/src/Registration/StateChange/Registrations_Decision.res +34 -34
- package/src/Registration/StateChange/Registrations_Decision.res.mjs +33 -33
|
@@ -9,58 +9,58 @@ import * as RegistrationChallenge$ReventlessRegistration from "../../Registratio
|
|
|
9
9
|
function collect(event, param) {
|
|
10
10
|
switch (event.TAG) {
|
|
11
11
|
case "RegistrationRequested" :
|
|
12
|
-
let address = event.address;
|
|
13
12
|
let email = event.email;
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
let emailId = event.emailId;
|
|
14
|
+
if (typeof email !== "object") {
|
|
15
|
+
if (email === "Erased") {
|
|
16
16
|
return [];
|
|
17
17
|
} else {
|
|
18
18
|
return [];
|
|
19
19
|
}
|
|
20
20
|
} else {
|
|
21
21
|
return [[
|
|
22
|
-
|
|
22
|
+
emailId + `:` + event.requestedAt,
|
|
23
23
|
{
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
emailId: emailId,
|
|
25
|
+
email: email._0,
|
|
26
26
|
alreadyRegistered: false
|
|
27
27
|
}
|
|
28
28
|
]];
|
|
29
29
|
}
|
|
30
30
|
case "RegistrationAttemptedOnTakenAddress" :
|
|
31
|
-
let address$1 = event.address;
|
|
32
31
|
let email$1 = event.email;
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
let emailId$1 = event.emailId;
|
|
33
|
+
if (typeof email$1 !== "object") {
|
|
34
|
+
if (email$1 === "Erased") {
|
|
35
35
|
return [];
|
|
36
36
|
} else {
|
|
37
37
|
return [];
|
|
38
38
|
}
|
|
39
39
|
} else {
|
|
40
40
|
return [[
|
|
41
|
-
|
|
41
|
+
emailId$1 + `:taken:` + event.attemptedAt,
|
|
42
42
|
{
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
emailId: emailId$1,
|
|
44
|
+
email: email$1._0,
|
|
45
45
|
alreadyRegistered: true
|
|
46
46
|
}
|
|
47
47
|
]];
|
|
48
48
|
}
|
|
49
49
|
case "RegistrationInvited" :
|
|
50
|
-
let address$2 = event.address;
|
|
51
50
|
let email$2 = event.email;
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
let emailId$2 = event.emailId;
|
|
52
|
+
if (typeof email$2 !== "object") {
|
|
53
|
+
if (email$2 === "Erased") {
|
|
54
54
|
return [];
|
|
55
55
|
} else {
|
|
56
56
|
return [];
|
|
57
57
|
}
|
|
58
58
|
} else {
|
|
59
59
|
return [[
|
|
60
|
-
|
|
60
|
+
emailId$2 + `:invited:` + event.invitedAt,
|
|
61
61
|
{
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
emailId: emailId$2,
|
|
63
|
+
email: email$2._0,
|
|
64
64
|
alreadyRegistered: false,
|
|
65
65
|
invited: true,
|
|
66
66
|
roles: event.roles
|
|
@@ -68,20 +68,20 @@ function collect(event, param) {
|
|
|
68
68
|
]];
|
|
69
69
|
}
|
|
70
70
|
case "RegistrationChallengeReissued" :
|
|
71
|
-
let address$3 = event.address;
|
|
72
71
|
let email$3 = event.email;
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
let emailId$3 = event.emailId;
|
|
73
|
+
if (typeof email$3 !== "object") {
|
|
74
|
+
if (email$3 === "Erased") {
|
|
75
75
|
return [];
|
|
76
76
|
} else {
|
|
77
77
|
return [];
|
|
78
78
|
}
|
|
79
79
|
} else {
|
|
80
80
|
return [[
|
|
81
|
-
|
|
81
|
+
emailId$3 + `:reissued:` + event.reissuedAt,
|
|
82
82
|
{
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
emailId: emailId$3,
|
|
84
|
+
email: email$3._0,
|
|
85
85
|
alreadyRegistered: false,
|
|
86
86
|
invited: Stdlib_Option.isSome(event.invitedBy)
|
|
87
87
|
}
|
|
@@ -112,10 +112,10 @@ function invitationBody(token, roles) {
|
|
|
112
112
|
|
|
113
113
|
let noticeBody = "Someone asked to register an account with this address, which already has one. If it was you, sign in instead. If it was not, there is nothing to do: no account was changed.";
|
|
114
114
|
|
|
115
|
-
function send(capabilities,
|
|
115
|
+
function send(capabilities, email, subject, body) {
|
|
116
116
|
return capabilities.messaging.send({
|
|
117
117
|
TAG: "ToEmail",
|
|
118
|
-
_0:
|
|
118
|
+
_0: email
|
|
119
119
|
}, {
|
|
120
120
|
subject: subject,
|
|
121
121
|
body: body
|
|
@@ -124,7 +124,7 @@ function send(capabilities, address, subject, body) {
|
|
|
124
124
|
|
|
125
125
|
async function translate(_id, item, capabilities) {
|
|
126
126
|
if (item.alreadyRegistered) {
|
|
127
|
-
let failure = await send(capabilities, item.
|
|
127
|
+
let failure = await send(capabilities, item.email, "Someone tried to register with your address", noticeBody);
|
|
128
128
|
if (failure.TAG === "Ok") {
|
|
129
129
|
return {
|
|
130
130
|
TAG: "Ok",
|
|
@@ -154,15 +154,15 @@ async function translate(_id, item, capabilities) {
|
|
|
154
154
|
_0: `cannot hash a secret: ` + proofHash._0._0
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
-
let failure$1 = await send(capabilities, item.
|
|
157
|
+
let failure$1 = await send(capabilities, item.email, invited ? "You are invited to create an account" : "Finish your registration", invited ? invitationBody(token$1, item.roles) : challengeBody(token$1));
|
|
158
158
|
if (failure$1.TAG === "Ok") {
|
|
159
159
|
return {
|
|
160
160
|
TAG: "Ok",
|
|
161
161
|
_0: [
|
|
162
|
-
item.
|
|
162
|
+
item.emailId,
|
|
163
163
|
{
|
|
164
164
|
TAG: "IssueRegistrationChallenge",
|
|
165
|
-
|
|
165
|
+
emailId: ContactAddressId$ReventlessRegistration.makeFromString(item.emailId),
|
|
166
166
|
proofHash: proofHash._0,
|
|
167
167
|
issuedAt: new Date().toISOString()
|
|
168
168
|
}
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
// translations in this chapter: they stamp the time a request arrived, and they
|
|
16
16
|
// hash a presented proof so its plaintext never reaches this slice or the log.
|
|
17
17
|
//
|
|
18
|
-
// **The address is not the key.** `
|
|
18
|
+
// **The address is not the key.** `emailId` is the address's keyed fingerprint
|
|
19
19
|
// (`ContactAddressId`), which is what tags and partitions the ledger; an index key
|
|
20
|
-
// cannot be erased. The address itself rides in `
|
|
20
|
+
// cannot be erased. The address itself rides in `email`, on the events that must
|
|
21
21
|
// reach the person and on the commands that start a claim, so it lives only where
|
|
22
22
|
// a payload field can be encrypted or erased.
|
|
23
23
|
//
|
|
@@ -40,45 +40,45 @@ type consumedEvent =
|
|
|
40
40
|
role: @s.matches(Reventless.DcbTag.mark(Reventless.Role.nameSchema)) Reventless.Role.name,
|
|
41
41
|
})
|
|
42
42
|
| RegistrationRequested({
|
|
43
|
-
|
|
44
|
-
@pii({subject: "
|
|
43
|
+
emailId: ContactAddressId.t,
|
|
44
|
+
@pii({subject: "emailId"}) email: Reventless.Email.t,
|
|
45
45
|
roles: array<string>,
|
|
46
46
|
requestedAt: Reventless.DateTime.t,
|
|
47
47
|
})
|
|
48
|
-
| RegistrationExpired({
|
|
48
|
+
| RegistrationExpired({emailId: ContactAddressId.t})
|
|
49
49
|
| RegistrationInvited({
|
|
50
|
-
|
|
51
|
-
@pii({subject: "
|
|
50
|
+
emailId: ContactAddressId.t,
|
|
51
|
+
@pii({subject: "emailId"}) email: Reventless.Email.t,
|
|
52
52
|
roles: array<string>,
|
|
53
53
|
invitedBy: string,
|
|
54
54
|
invitedAt: Reventless.DateTime.t,
|
|
55
55
|
})
|
|
56
56
|
| RegistrationChallengeReissued({
|
|
57
|
-
|
|
58
|
-
@pii({subject: "
|
|
57
|
+
emailId: ContactAddressId.t,
|
|
58
|
+
@pii({subject: "emailId"}) email: Reventless.Email.t,
|
|
59
59
|
reissuedAt: Reventless.DateTime.t,
|
|
60
60
|
invitedBy?: string,
|
|
61
61
|
})
|
|
62
|
-
| RegistrationWithdrawn({
|
|
62
|
+
| RegistrationWithdrawn({emailId: ContactAddressId.t, withdrawnAt: Reventless.DateTime.t})
|
|
63
63
|
| RegistrationAttemptedOnTakenAddress({
|
|
64
|
-
|
|
65
|
-
@pii({subject: "
|
|
64
|
+
emailId: ContactAddressId.t,
|
|
65
|
+
@pii({subject: "emailId"}) email: Reventless.Email.t,
|
|
66
66
|
attemptedAt: Reventless.DateTime.t,
|
|
67
67
|
})
|
|
68
68
|
| RegistrationChallengeIssued({
|
|
69
|
-
|
|
69
|
+
emailId: ContactAddressId.t,
|
|
70
70
|
proofHash: string,
|
|
71
71
|
issuedAt: Reventless.DateTime.t,
|
|
72
72
|
})
|
|
73
73
|
| RegistrationProofAccepted({
|
|
74
|
-
|
|
75
|
-
@pii({subject: "
|
|
74
|
+
emailId: ContactAddressId.t,
|
|
75
|
+
@pii({subject: "emailId"}) email: Reventless.Email.t,
|
|
76
76
|
roles: array<string>,
|
|
77
77
|
proofHash: string,
|
|
78
78
|
})
|
|
79
|
-
| RegistrationProofRefused({
|
|
80
|
-
| RegistrationCompleted({
|
|
81
|
-
| RegistrationReleased({
|
|
79
|
+
| RegistrationProofRefused({emailId: ContactAddressId.t, reason: string})
|
|
80
|
+
| RegistrationCompleted({emailId: ContactAddressId.t})
|
|
81
|
+
| RegistrationReleased({emailId: ContactAddressId.t, releasedAt: Reventless.DateTime.t})
|
|
82
82
|
|
|
83
83
|
// `Register` names the role asked for, and the policy is read by it. The
|
|
84
84
|
// registration records the roles it grants as
|
|
@@ -93,31 +93,31 @@ type consumedEvent =
|
|
|
93
93
|
type command =
|
|
94
94
|
| @noApi
|
|
95
95
|
Register({
|
|
96
|
-
|
|
97
|
-
@pii({subject: "
|
|
96
|
+
emailId: ContactAddressId.t,
|
|
97
|
+
@pii({subject: "emailId"}) email: Reventless.Email.t,
|
|
98
98
|
role: @s.matches(Reventless.DcbTag.mark(Reventless.Role.nameSchema)) Reventless.Role.name,
|
|
99
99
|
requestedAt: Reventless.DateTime.t,
|
|
100
100
|
})
|
|
101
101
|
| @noApi
|
|
102
102
|
IssueRegistrationChallenge({
|
|
103
|
-
|
|
103
|
+
emailId: ContactAddressId.t,
|
|
104
104
|
proofHash: string,
|
|
105
105
|
issuedAt: Reventless.DateTime.t,
|
|
106
106
|
})
|
|
107
107
|
| @noApi
|
|
108
108
|
SubmitRegistrationProof({
|
|
109
|
-
|
|
109
|
+
emailId: ContactAddressId.t,
|
|
110
110
|
proofHash: string,
|
|
111
111
|
presentedAt: Reventless.DateTime.t,
|
|
112
112
|
})
|
|
113
|
-
| @noApi RecordRegistrationCompleted({
|
|
113
|
+
| @noApi RecordRegistrationCompleted({emailId: ContactAddressId.t})
|
|
114
114
|
// A signed-in inviter claims the address for someone else, as the roles the
|
|
115
115
|
// app declares by invitation. No door here reaches it: a plugin that provides
|
|
116
116
|
// invitations marks its door `Invite` and checks the inviter before relaying.
|
|
117
117
|
| @noApi
|
|
118
118
|
Invite({
|
|
119
|
-
|
|
120
|
-
@pii({subject: "
|
|
119
|
+
emailId: ContactAddressId.t,
|
|
120
|
+
@pii({subject: "emailId"}) email: Reventless.Email.t,
|
|
121
121
|
roles: array<Reventless.Role.name>,
|
|
122
122
|
invitedBy: string,
|
|
123
123
|
requestedAt: Reventless.DateTime.t,
|
|
@@ -126,14 +126,14 @@ type command =
|
|
|
126
126
|
// lost, or its attempts spent. Held to one per resend cooldown.
|
|
127
127
|
| @noApi
|
|
128
128
|
ReissueRegistrationChallenge({
|
|
129
|
-
|
|
129
|
+
emailId: ContactAddressId.t,
|
|
130
130
|
requestedAt: Reventless.DateTime.t,
|
|
131
131
|
})
|
|
132
132
|
// Releases an address a registration holds and nobody has proved yet.
|
|
133
|
-
| @noApi WithdrawRegistration({
|
|
133
|
+
| @noApi WithdrawRegistration({emailId: ContactAddressId.t, withdrawnAt: Reventless.DateTime.t})
|
|
134
134
|
// Releases the address of an account that was erased, so its person may
|
|
135
135
|
// register again. Only the erasure workflow sends it, after the account is gone.
|
|
136
|
-
| @noApi ReleaseRegistration({
|
|
136
|
+
| @noApi ReleaseRegistration({emailId: ContactAddressId.t, releasedAt: Reventless.DateTime.t})
|
|
137
137
|
|
|
138
138
|
// Every outcome of a command relayed for an anonymous caller is a recorded fact
|
|
139
139
|
// or a quiet no-op, never an error: an error is the one answer a caller could
|
|
@@ -147,42 +147,42 @@ type error =
|
|
|
147
147
|
@schema
|
|
148
148
|
type event =
|
|
149
149
|
| RegistrationRequested({
|
|
150
|
-
|
|
151
|
-
@pii({subject: "
|
|
150
|
+
emailId: ContactAddressId.t,
|
|
151
|
+
@pii({subject: "emailId"}) email: Reventless.Email.t,
|
|
152
152
|
roles: array<string>,
|
|
153
153
|
requestedAt: Reventless.DateTime.t,
|
|
154
154
|
})
|
|
155
|
-
| RegistrationExpired({
|
|
155
|
+
| RegistrationExpired({emailId: ContactAddressId.t})
|
|
156
156
|
| RegistrationInvited({
|
|
157
|
-
|
|
158
|
-
@pii({subject: "
|
|
157
|
+
emailId: ContactAddressId.t,
|
|
158
|
+
@pii({subject: "emailId"}) email: Reventless.Email.t,
|
|
159
159
|
roles: array<string>,
|
|
160
160
|
invitedBy: string,
|
|
161
161
|
invitedAt: Reventless.DateTime.t,
|
|
162
162
|
})
|
|
163
163
|
| RegistrationChallengeReissued({
|
|
164
|
-
|
|
165
|
-
@pii({subject: "
|
|
164
|
+
emailId: ContactAddressId.t,
|
|
165
|
+
@pii({subject: "emailId"}) email: Reventless.Email.t,
|
|
166
166
|
reissuedAt: Reventless.DateTime.t,
|
|
167
167
|
invitedBy?: string,
|
|
168
168
|
})
|
|
169
|
-
| RegistrationWithdrawn({
|
|
169
|
+
| RegistrationWithdrawn({emailId: ContactAddressId.t, withdrawnAt: Reventless.DateTime.t})
|
|
170
170
|
| RegistrationAttemptedOnTakenAddress({
|
|
171
|
-
|
|
172
|
-
@pii({subject: "
|
|
171
|
+
emailId: ContactAddressId.t,
|
|
172
|
+
@pii({subject: "emailId"}) email: Reventless.Email.t,
|
|
173
173
|
attemptedAt: Reventless.DateTime.t,
|
|
174
174
|
})
|
|
175
175
|
| RegistrationChallengeIssued({
|
|
176
|
-
|
|
176
|
+
emailId: ContactAddressId.t,
|
|
177
177
|
proofHash: string,
|
|
178
178
|
issuedAt: Reventless.DateTime.t,
|
|
179
179
|
})
|
|
180
180
|
| RegistrationProofAccepted({
|
|
181
|
-
|
|
182
|
-
@pii({subject: "
|
|
181
|
+
emailId: ContactAddressId.t,
|
|
182
|
+
@pii({subject: "emailId"}) email: Reventless.Email.t,
|
|
183
183
|
roles: array<string>,
|
|
184
184
|
proofHash: string,
|
|
185
185
|
})
|
|
186
|
-
| RegistrationProofRefused({
|
|
187
|
-
| RegistrationCompleted({
|
|
188
|
-
| RegistrationReleased({
|
|
186
|
+
| RegistrationProofRefused({emailId: ContactAddressId.t, reason: string})
|
|
187
|
+
| RegistrationCompleted({emailId: ContactAddressId.t})
|
|
188
|
+
| RegistrationReleased({emailId: ContactAddressId.t, releasedAt: Reventless.DateTime.t})
|
|
@@ -21,66 +21,66 @@ let consumedEventSchema = Sury.union([
|
|
|
21
21
|
})),
|
|
22
22
|
Sury.$schema(s => ({
|
|
23
23
|
TAG: "RegistrationRequested",
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
25
|
+
email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
|
|
26
26
|
roles: s.m(Sury.array(Sury.string)),
|
|
27
27
|
requestedAt: s.m(DateTime$Reventless.schema)
|
|
28
28
|
})),
|
|
29
29
|
Sury.$schema(s => ({
|
|
30
30
|
TAG: "RegistrationExpired",
|
|
31
|
-
|
|
31
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
|
|
32
32
|
})),
|
|
33
33
|
Sury.$schema(s => ({
|
|
34
34
|
TAG: "RegistrationInvited",
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
36
|
+
email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
|
|
37
37
|
roles: s.m(Sury.array(Sury.string)),
|
|
38
38
|
invitedBy: s.m(Sury.string),
|
|
39
39
|
invitedAt: s.m(DateTime$Reventless.schema)
|
|
40
40
|
})),
|
|
41
41
|
Sury.$schema(s => ({
|
|
42
42
|
TAG: "RegistrationChallengeReissued",
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
44
|
+
email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
|
|
45
45
|
reissuedAt: s.m(DateTime$Reventless.schema),
|
|
46
46
|
invitedBy: s.m(Sury.$option(Sury.string))
|
|
47
47
|
})),
|
|
48
48
|
Sury.$schema(s => ({
|
|
49
49
|
TAG: "RegistrationWithdrawn",
|
|
50
|
-
|
|
50
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
51
51
|
withdrawnAt: s.m(DateTime$Reventless.schema)
|
|
52
52
|
})),
|
|
53
53
|
Sury.$schema(s => ({
|
|
54
54
|
TAG: "RegistrationAttemptedOnTakenAddress",
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
56
|
+
email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
|
|
57
57
|
attemptedAt: s.m(DateTime$Reventless.schema)
|
|
58
58
|
})),
|
|
59
59
|
Sury.$schema(s => ({
|
|
60
60
|
TAG: "RegistrationChallengeIssued",
|
|
61
|
-
|
|
61
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
62
62
|
proofHash: s.m(Sury.string),
|
|
63
63
|
issuedAt: s.m(DateTime$Reventless.schema)
|
|
64
64
|
})),
|
|
65
65
|
Sury.$schema(s => ({
|
|
66
66
|
TAG: "RegistrationProofAccepted",
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
68
|
+
email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
|
|
69
69
|
roles: s.m(Sury.array(Sury.string)),
|
|
70
70
|
proofHash: s.m(Sury.string)
|
|
71
71
|
})),
|
|
72
72
|
Sury.$schema(s => ({
|
|
73
73
|
TAG: "RegistrationProofRefused",
|
|
74
|
-
|
|
74
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
75
75
|
reason: s.m(Sury.string)
|
|
76
76
|
})),
|
|
77
77
|
Sury.$schema(s => ({
|
|
78
78
|
TAG: "RegistrationCompleted",
|
|
79
|
-
|
|
79
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
|
|
80
80
|
})),
|
|
81
81
|
Sury.$schema(s => ({
|
|
82
82
|
TAG: "RegistrationReleased",
|
|
83
|
-
|
|
83
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
84
84
|
releasedAt: s.m(DateTime$Reventless.schema)
|
|
85
85
|
}))
|
|
86
86
|
]);
|
|
@@ -88,48 +88,48 @@ let consumedEventSchema = Sury.union([
|
|
|
88
88
|
let commandSchema = Sury.union([
|
|
89
89
|
Sury.$schema(s => ({
|
|
90
90
|
TAG: "Register",
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
92
|
+
email: s.m(Pii$Reventless.mark("emailId", undefined, Email$Reventless.schema)),
|
|
93
93
|
role: s.m(DcbTag$Reventless.mark(Role$Reventless.nameSchema)),
|
|
94
94
|
requestedAt: s.m(DateTime$Reventless.schema)
|
|
95
95
|
})),
|
|
96
96
|
Sury.$schema(s => ({
|
|
97
97
|
TAG: "IssueRegistrationChallenge",
|
|
98
|
-
|
|
98
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
99
99
|
proofHash: s.m(Sury.string),
|
|
100
100
|
issuedAt: s.m(DateTime$Reventless.schema)
|
|
101
101
|
})),
|
|
102
102
|
Sury.$schema(s => ({
|
|
103
103
|
TAG: "SubmitRegistrationProof",
|
|
104
|
-
|
|
104
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
105
105
|
proofHash: s.m(Sury.string),
|
|
106
106
|
presentedAt: s.m(DateTime$Reventless.schema)
|
|
107
107
|
})),
|
|
108
108
|
Sury.$schema(s => ({
|
|
109
109
|
TAG: "RecordRegistrationCompleted",
|
|
110
|
-
|
|
110
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
|
|
111
111
|
})),
|
|
112
112
|
Sury.$schema(s => ({
|
|
113
113
|
TAG: "Invite",
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
115
|
+
email: s.m(Pii$Reventless.mark("emailId", undefined, Email$Reventless.schema)),
|
|
116
116
|
roles: s.m(Sury.array(Role$Reventless.nameSchema)),
|
|
117
117
|
invitedBy: s.m(Sury.string),
|
|
118
118
|
requestedAt: s.m(DateTime$Reventless.schema)
|
|
119
119
|
})),
|
|
120
120
|
Sury.$schema(s => ({
|
|
121
121
|
TAG: "ReissueRegistrationChallenge",
|
|
122
|
-
|
|
122
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
123
123
|
requestedAt: s.m(DateTime$Reventless.schema)
|
|
124
124
|
})),
|
|
125
125
|
Sury.$schema(s => ({
|
|
126
126
|
TAG: "WithdrawRegistration",
|
|
127
|
-
|
|
127
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
128
128
|
withdrawnAt: s.m(DateTime$Reventless.schema)
|
|
129
129
|
})),
|
|
130
130
|
Sury.$schema(s => ({
|
|
131
131
|
TAG: "ReleaseRegistration",
|
|
132
|
-
|
|
132
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
133
133
|
releasedAt: s.m(DateTime$Reventless.schema)
|
|
134
134
|
}))
|
|
135
135
|
]);
|
|
@@ -145,66 +145,66 @@ let errorSchema = Sury.union([
|
|
|
145
145
|
let eventSchema = Sury.union([
|
|
146
146
|
Sury.$schema(s => ({
|
|
147
147
|
TAG: "RegistrationRequested",
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
149
|
+
email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
|
|
150
150
|
roles: s.m(Sury.array(Sury.string)),
|
|
151
151
|
requestedAt: s.m(DateTime$Reventless.schema)
|
|
152
152
|
})),
|
|
153
153
|
Sury.$schema(s => ({
|
|
154
154
|
TAG: "RegistrationExpired",
|
|
155
|
-
|
|
155
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
|
|
156
156
|
})),
|
|
157
157
|
Sury.$schema(s => ({
|
|
158
158
|
TAG: "RegistrationInvited",
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
160
|
+
email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
|
|
161
161
|
roles: s.m(Sury.array(Sury.string)),
|
|
162
162
|
invitedBy: s.m(Sury.string),
|
|
163
163
|
invitedAt: s.m(DateTime$Reventless.schema)
|
|
164
164
|
})),
|
|
165
165
|
Sury.$schema(s => ({
|
|
166
166
|
TAG: "RegistrationChallengeReissued",
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
168
|
+
email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
|
|
169
169
|
reissuedAt: s.m(DateTime$Reventless.schema),
|
|
170
170
|
invitedBy: s.m(Sury.$option(Sury.string))
|
|
171
171
|
})),
|
|
172
172
|
Sury.$schema(s => ({
|
|
173
173
|
TAG: "RegistrationWithdrawn",
|
|
174
|
-
|
|
174
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
175
175
|
withdrawnAt: s.m(DateTime$Reventless.schema)
|
|
176
176
|
})),
|
|
177
177
|
Sury.$schema(s => ({
|
|
178
178
|
TAG: "RegistrationAttemptedOnTakenAddress",
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
180
|
+
email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
|
|
181
181
|
attemptedAt: s.m(DateTime$Reventless.schema)
|
|
182
182
|
})),
|
|
183
183
|
Sury.$schema(s => ({
|
|
184
184
|
TAG: "RegistrationChallengeIssued",
|
|
185
|
-
|
|
185
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
186
186
|
proofHash: s.m(Sury.string),
|
|
187
187
|
issuedAt: s.m(DateTime$Reventless.schema)
|
|
188
188
|
})),
|
|
189
189
|
Sury.$schema(s => ({
|
|
190
190
|
TAG: "RegistrationProofAccepted",
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
192
|
+
email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
|
|
193
193
|
roles: s.m(Sury.array(Sury.string)),
|
|
194
194
|
proofHash: s.m(Sury.string)
|
|
195
195
|
})),
|
|
196
196
|
Sury.$schema(s => ({
|
|
197
197
|
TAG: "RegistrationProofRefused",
|
|
198
|
-
|
|
198
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
199
199
|
reason: s.m(Sury.string)
|
|
200
200
|
})),
|
|
201
201
|
Sury.$schema(s => ({
|
|
202
202
|
TAG: "RegistrationCompleted",
|
|
203
|
-
|
|
203
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
|
|
204
204
|
})),
|
|
205
205
|
Sury.$schema(s => ({
|
|
206
206
|
TAG: "RegistrationReleased",
|
|
207
|
-
|
|
207
|
+
emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
|
|
208
208
|
releasedAt: s.m(DateTime$Reventless.schema)
|
|
209
209
|
}))
|
|
210
210
|
]);
|