@reventlessdev/reventless-registration 1.0.0-alpha.5 → 1.0.0-alpha.50

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 (48) hide show
  1. package/README.md +87 -2
  2. package/conformance/Registration/InboundTranslation/CompleteRegistration_Conformance_GWT.res +65 -0
  3. package/conformance/Registration/InboundTranslation/CompleteRegistration_Conformance_GWT.res.mjs +123 -0
  4. package/conformance/Registration/InboundTranslation/SignUp_Conformance_GWT.res +136 -0
  5. package/conformance/Registration/InboundTranslation/SignUp_Conformance_GWT.res.mjs +212 -0
  6. package/conformance/Registration/OutboundTranslation/CreateRegisteredPrincipal_Conformance_GWT.res +102 -0
  7. package/conformance/Registration/OutboundTranslation/CreateRegisteredPrincipal_Conformance_GWT.res.mjs +179 -0
  8. package/conformance/Registration/OutboundTranslation/SendRegistrationChallenge_Conformance_GWT.res +312 -0
  9. package/conformance/Registration/OutboundTranslation/SendRegistrationChallenge_Conformance_GWT.res.mjs +360 -0
  10. package/conformance/Registration/Registration_Conformance_Examples.res +58 -0
  11. package/conformance/Registration/Registration_Conformance_Examples.res.mjs +106 -0
  12. package/conformance/Registration/StateChange/RegistrationPolicy_Conformance_GWT.res +108 -0
  13. package/conformance/Registration/StateChange/RegistrationPolicy_Conformance_GWT.res.mjs +161 -0
  14. package/conformance/Registration/StateChange/RegistrationsByInvitation_Conformance_GWT.res +155 -0
  15. package/conformance/Registration/StateChange/RegistrationsByInvitation_Conformance_GWT.res.mjs +216 -0
  16. package/conformance/Registration/StateChange/Registrations_Conformance_GWT.res +469 -0
  17. package/conformance/Registration/StateChange/Registrations_Conformance_GWT.res.mjs +512 -0
  18. package/conformance/Registration/StateViewStream/RegistrationWindows_Conformance_GWT.res +33 -0
  19. package/conformance/Registration/StateViewStream/RegistrationWindows_Conformance_GWT.res.mjs +87 -0
  20. package/i18n/en.json +8 -0
  21. package/package.json +10 -6
  22. package/rescript.json +6 -1
  23. package/src/Registration/InboundTranslation/CompleteRegistration.res +2 -2
  24. package/src/Registration/InboundTranslation/CompleteRegistration.res.mjs +3 -3
  25. package/src/Registration/InboundTranslation/CompleteRegistration_Translation.res +1 -1
  26. package/src/Registration/InboundTranslation/CompleteRegistration_Translation.res.mjs +1 -1
  27. package/src/Registration/InboundTranslation/SignUp.res +19 -9
  28. package/src/Registration/InboundTranslation/SignUp.res.mjs +14 -7
  29. package/src/Registration/InboundTranslation/SignUp_Translation.res +32 -7
  30. package/src/Registration/InboundTranslation/SignUp_Translation.res.mjs +41 -8
  31. package/src/Registration/OutboundTranslation/CreateRegisteredPrincipal.res +5 -5
  32. package/src/Registration/OutboundTranslation/CreateRegisteredPrincipal.res.mjs +6 -5
  33. package/src/Registration/OutboundTranslation/CreateRegisteredPrincipal_Translation.res +10 -8
  34. package/src/Registration/OutboundTranslation/CreateRegisteredPrincipal_Translation.res.mjs +18 -10
  35. package/src/Registration/OutboundTranslation/SendRegistrationChallenge.res +24 -13
  36. package/src/Registration/OutboundTranslation/SendRegistrationChallenge.res.mjs +26 -16
  37. package/src/Registration/OutboundTranslation/SendRegistrationChallenge_Translation.res +115 -44
  38. package/src/Registration/OutboundTranslation/SendRegistrationChallenge_Translation.res.mjs +204 -66
  39. package/src/Registration/StateChange/RegistrationPolicy.res +3 -0
  40. package/src/Registration/StateChange/RegistrationPolicy.res.mjs +3 -0
  41. package/src/Registration/StateChange/RegistrationPolicy_Decision.res +6 -5
  42. package/src/Registration/StateChange/RegistrationPolicy_Decision.res.mjs +22 -15
  43. package/src/Registration/StateChange/Registrations.res +67 -41
  44. package/src/Registration/StateChange/Registrations.res.mjs +84 -51
  45. package/src/Registration/StateChange/Registrations_Decision.res +82 -39
  46. package/src/Registration/StateChange/Registrations_Decision.res.mjs +116 -58
  47. package/src/Registration/StateViewStream/RegistrationWindows.res +4 -0
  48. package/src/Registration/StateViewStream/RegistrationWindows.res.mjs +3 -3
@@ -1,14 +1,15 @@
1
1
  @@reventless.decision
2
2
 
3
- // Nothing recorded is open: a role reaches this slice only if the app declares
4
- // it self-service. Opening an open role with the same end, or closing a closed
5
- // one, changes nothing and records nothing.
3
+ // Nothing recorded is the deployment's starting state, which this slice does not
4
+ // know: from it, opening and closing both record. Opening an open role with the
5
+ // same end, or closing a closed one, changes nothing and records nothing.
6
6
 
7
7
  type state =
8
+ | Unset
8
9
  | Closed
9
10
  | Open(option<Reventless.DateTime.t>)
10
11
 
11
- let initialState = Open(None)
12
+ let initialState = Unset
12
13
 
13
14
  let evolve = (_state, event) =>
14
15
  switch event {
@@ -36,7 +37,7 @@ module Make = (App: Reventless.Admission.Declaration) => {
36
37
  | (Open(current), OpenRegistration({?until})) if current == until => Ok([])
37
38
  | (_, OpenRegistration({role, ?until})) => Ok([RegistrationOpened({role, ?until})])
38
39
  | (Closed, CloseRegistration(_)) => Ok([])
39
- | (Open(_), CloseRegistration({role})) => Ok([RegistrationClosed({role: role})])
40
+ | (Open(_) | Unset, CloseRegistration({role})) => Ok([RegistrationClosed({role: role})])
40
41
  }
41
42
  }
42
43
  }
@@ -4,11 +4,6 @@ import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.js
4
4
  import * as Admission$Reventless from "@reventlessdev/reventless-spec/src/types/Admission.res.mjs";
5
5
  import * as RegistrationPolicy$ReventlessRegistration from "./RegistrationPolicy.res.mjs";
6
6
 
7
- let initialState = {
8
- TAG: "Open",
9
- _0: undefined
10
- };
11
-
12
7
  function evolve(_state, event) {
13
8
  if (event.TAG === "RegistrationOpened") {
14
9
  return {
@@ -33,7 +28,7 @@ function Make(App) {
33
28
  };
34
29
  }
35
30
  if (typeof state !== "object") {
36
- if (command.TAG !== "OpenRegistration") {
31
+ if (state !== "Unset" && command.TAG !== "OpenRegistration") {
37
32
  return {
38
33
  TAG: "Ok",
39
34
  _0: []
@@ -56,19 +51,29 @@ function Make(App) {
56
51
  };
57
52
  }
58
53
  }
59
- return {
60
- TAG: "Ok",
61
- _0: [{
62
- TAG: "RegistrationOpened",
63
- role: command.role,
64
- until: command.until
65
- }]
66
- };
54
+ if (command.TAG === "OpenRegistration") {
55
+ return {
56
+ TAG: "Ok",
57
+ _0: [{
58
+ TAG: "RegistrationOpened",
59
+ role: command.role,
60
+ until: command.until
61
+ }]
62
+ };
63
+ } else {
64
+ return {
65
+ TAG: "Ok",
66
+ _0: [{
67
+ TAG: "RegistrationClosed",
68
+ role: command.role
69
+ }]
70
+ };
71
+ }
67
72
  };
68
73
  return {
69
74
  Spec: undefined,
70
75
  moduleUrl: RegistrationPolicy$ReventlessRegistration.moduleUrl,
71
- initialState: initialState,
76
+ initialState: "Unset",
72
77
  evolve: evolve,
73
78
  decide: decide
74
79
  };
@@ -76,6 +81,8 @@ function Make(App) {
76
81
 
77
82
  let Spec;
78
83
 
84
+ let initialState = "Unset";
85
+
79
86
  let moduleUrl = "@reventlessdev/reventless-registration/src/Registration/StateChange/RegistrationPolicy_Decision.res.mjs";
80
87
 
81
88
  export {
@@ -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.** `email` is the address's keyed fingerprint
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 `address`, on the events that must
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,44 +40,52 @@ type consumedEvent =
40
40
  role: @s.matches(Reventless.DcbTag.mark(Reventless.Role.nameSchema)) Reventless.Role.name,
41
41
  })
42
42
  | RegistrationRequested({
43
- email: ContactAddressId.t,
44
- address: Reventless.Email.t,
43
+ emailId: ContactAddressId.t,
44
+ @pii({subject: "emailId"}) email: Reventless.Email.t,
45
45
  roles: array<string>,
46
46
  requestedAt: Reventless.DateTime.t,
47
+ language?: string,
47
48
  })
48
- | RegistrationExpired({email: ContactAddressId.t})
49
+ | RegistrationExpired({emailId: ContactAddressId.t})
49
50
  | RegistrationInvited({
50
- email: ContactAddressId.t,
51
- address: Reventless.Email.t,
51
+ emailId: ContactAddressId.t,
52
+ @pii({subject: "emailId"}) email: Reventless.Email.t,
52
53
  roles: array<string>,
53
54
  invitedBy: string,
54
55
  invitedAt: Reventless.DateTime.t,
56
+ language?: string,
55
57
  })
56
58
  | RegistrationChallengeReissued({
57
- email: ContactAddressId.t,
58
- address: Reventless.Email.t,
59
+ emailId: ContactAddressId.t,
60
+ @pii({subject: "emailId"}) email: Reventless.Email.t,
59
61
  reissuedAt: Reventless.DateTime.t,
60
62
  invitedBy?: string,
63
+ language?: string,
61
64
  })
62
- | RegistrationWithdrawn({email: ContactAddressId.t, withdrawnAt: Reventless.DateTime.t})
65
+ | RegistrationWithdrawn({emailId: ContactAddressId.t, withdrawnAt: Reventless.DateTime.t})
63
66
  | RegistrationAttemptedOnTakenAddress({
64
- email: ContactAddressId.t,
65
- address: Reventless.Email.t,
67
+ emailId: ContactAddressId.t,
68
+ @pii({subject: "emailId"}) email: Reventless.Email.t,
66
69
  attemptedAt: Reventless.DateTime.t,
67
70
  })
68
71
  | RegistrationChallengeIssued({
69
- email: ContactAddressId.t,
72
+ emailId: ContactAddressId.t,
70
73
  proofHash: string,
71
74
  issuedAt: Reventless.DateTime.t,
75
+ /** The language the code went out in, and the key of the mail that carried it: what is
76
+ recorded of a sent mail, never its text. */
77
+ language?: string,
78
+ messageKey?: string,
72
79
  })
73
80
  | RegistrationProofAccepted({
74
- email: ContactAddressId.t,
75
- address: Reventless.Email.t,
81
+ emailId: ContactAddressId.t,
82
+ @pii({subject: "emailId"}) email: Reventless.Email.t,
76
83
  roles: array<string>,
77
84
  proofHash: string,
78
85
  })
79
- | RegistrationProofRefused({email: ContactAddressId.t, reason: string})
80
- | RegistrationCompleted({email: ContactAddressId.t})
86
+ | RegistrationProofRefused({emailId: ContactAddressId.t, reason: string})
87
+ | RegistrationCompleted({emailId: ContactAddressId.t})
88
+ | RegistrationReleased({emailId: ContactAddressId.t, releasedAt: Reventless.DateTime.t})
81
89
 
82
90
  // `Register` names the role asked for, and the policy is read by it. The
83
91
  // registration records the roles it grants as
@@ -92,44 +100,54 @@ type consumedEvent =
92
100
  type command =
93
101
  | @noApi
94
102
  Register({
95
- email: ContactAddressId.t,
96
- address: Reventless.Email.t,
103
+ emailId: ContactAddressId.t,
104
+ @pii({subject: "emailId"}) email: Reventless.Email.t,
97
105
  role: @s.matches(Reventless.DcbTag.mark(Reventless.Role.nameSchema)) Reventless.Role.name,
98
106
  requestedAt: Reventless.DateTime.t,
107
+ language?: string,
108
+ /** The deployment's starting state, stamped by the door: what the role is
109
+ while nobody has opened or closed it. */
110
+ initially?: @s.matches(Reventless.Admission.initiallySchema) Reventless.Admission.initially,
99
111
  })
100
112
  | @noApi
101
113
  IssueRegistrationChallenge({
102
- email: ContactAddressId.t,
114
+ emailId: ContactAddressId.t,
103
115
  proofHash: string,
104
116
  issuedAt: Reventless.DateTime.t,
117
+ language?: string,
118
+ messageKey?: string,
105
119
  })
106
120
  | @noApi
107
121
  SubmitRegistrationProof({
108
- email: ContactAddressId.t,
122
+ emailId: ContactAddressId.t,
109
123
  proofHash: string,
110
124
  presentedAt: Reventless.DateTime.t,
111
125
  })
112
- | @noApi RecordRegistrationCompleted({email: ContactAddressId.t})
126
+ | @noApi RecordRegistrationCompleted({emailId: ContactAddressId.t})
113
127
  // A signed-in inviter claims the address for someone else, as the roles the
114
128
  // app declares by invitation. No door here reaches it: a plugin that provides
115
129
  // invitations marks its door `Invite` and checks the inviter before relaying.
116
130
  | @noApi
117
131
  Invite({
118
- email: ContactAddressId.t,
119
- address: Reventless.Email.t,
132
+ emailId: ContactAddressId.t,
133
+ @pii({subject: "emailId"}) email: Reventless.Email.t,
120
134
  roles: array<Reventless.Role.name>,
121
135
  invitedBy: string,
122
136
  requestedAt: Reventless.DateTime.t,
137
+ language?: string,
123
138
  })
124
139
  // Voids the code a pending registration holds, so a new one is sent: a code
125
140
  // lost, or its attempts spent. Held to one per resend cooldown.
126
141
  | @noApi
127
142
  ReissueRegistrationChallenge({
128
- email: ContactAddressId.t,
143
+ emailId: ContactAddressId.t,
129
144
  requestedAt: Reventless.DateTime.t,
130
145
  })
131
146
  // Releases an address a registration holds and nobody has proved yet.
132
- | @noApi WithdrawRegistration({email: ContactAddressId.t, withdrawnAt: Reventless.DateTime.t})
147
+ | @noApi WithdrawRegistration({emailId: ContactAddressId.t, withdrawnAt: Reventless.DateTime.t})
148
+ // Releases the address of an account that was erased, so its person may
149
+ // register again. Only the erasure workflow sends it, after the account is gone.
150
+ | @noApi ReleaseRegistration({emailId: ContactAddressId.t, releasedAt: Reventless.DateTime.t})
133
151
 
134
152
  // Every outcome of a command relayed for an anonymous caller is a recorded fact
135
153
  // or a quiet no-op, never an error: an error is the one answer a caller could
@@ -143,41 +161,49 @@ type error =
143
161
  @schema
144
162
  type event =
145
163
  | RegistrationRequested({
146
- email: ContactAddressId.t,
147
- address: Reventless.Email.t,
164
+ emailId: ContactAddressId.t,
165
+ @pii({subject: "emailId"}) email: Reventless.Email.t,
148
166
  roles: array<string>,
149
167
  requestedAt: Reventless.DateTime.t,
168
+ language?: string,
150
169
  })
151
- | RegistrationExpired({email: ContactAddressId.t})
170
+ | RegistrationExpired({emailId: ContactAddressId.t})
152
171
  | RegistrationInvited({
153
- email: ContactAddressId.t,
154
- address: Reventless.Email.t,
172
+ emailId: ContactAddressId.t,
173
+ @pii({subject: "emailId"}) email: Reventless.Email.t,
155
174
  roles: array<string>,
156
175
  invitedBy: string,
157
176
  invitedAt: Reventless.DateTime.t,
177
+ language?: string,
158
178
  })
159
179
  | RegistrationChallengeReissued({
160
- email: ContactAddressId.t,
161
- address: Reventless.Email.t,
180
+ emailId: ContactAddressId.t,
181
+ @pii({subject: "emailId"}) email: Reventless.Email.t,
162
182
  reissuedAt: Reventless.DateTime.t,
163
183
  invitedBy?: string,
184
+ language?: string,
164
185
  })
165
- | RegistrationWithdrawn({email: ContactAddressId.t, withdrawnAt: Reventless.DateTime.t})
186
+ | RegistrationWithdrawn({emailId: ContactAddressId.t, withdrawnAt: Reventless.DateTime.t})
166
187
  | RegistrationAttemptedOnTakenAddress({
167
- email: ContactAddressId.t,
168
- address: Reventless.Email.t,
188
+ emailId: ContactAddressId.t,
189
+ @pii({subject: "emailId"}) email: Reventless.Email.t,
169
190
  attemptedAt: Reventless.DateTime.t,
170
191
  })
171
192
  | RegistrationChallengeIssued({
172
- email: ContactAddressId.t,
193
+ emailId: ContactAddressId.t,
173
194
  proofHash: string,
174
195
  issuedAt: Reventless.DateTime.t,
196
+ /** The language the code went out in, and the key of the mail that carried it: what is
197
+ recorded of a sent mail, never its text. */
198
+ language?: string,
199
+ messageKey?: string,
175
200
  })
176
201
  | RegistrationProofAccepted({
177
- email: ContactAddressId.t,
178
- address: Reventless.Email.t,
202
+ emailId: ContactAddressId.t,
203
+ @pii({subject: "emailId"}) email: Reventless.Email.t,
179
204
  roles: array<string>,
180
205
  proofHash: string,
181
206
  })
182
- | RegistrationProofRefused({email: ContactAddressId.t, reason: string})
183
- | RegistrationCompleted({email: ContactAddressId.t})
207
+ | RegistrationProofRefused({emailId: ContactAddressId.t, reason: string})
208
+ | RegistrationCompleted({emailId: ContactAddressId.t})
209
+ | RegistrationReleased({emailId: ContactAddressId.t, releasedAt: Reventless.DateTime.t})
@@ -1,11 +1,13 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as Sury from "sury";
4
+ import * as Pii$Reventless from "@reventlessdev/reventless-spec/src/components/Pii.res.mjs";
4
5
  import * as Role$Reventless from "@reventlessdev/reventless-spec/src/types/Role.res.mjs";
5
6
  import * as Email$Reventless from "@reventlessdev/reventless-spec/src/semantic/Email.res.mjs";
6
7
  import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
7
8
  import * as Api$ReventlessInfra from "@reventlessdev/reventless-infra/src/components/Api.res.mjs";
8
9
  import * as DateTime$Reventless from "@reventlessdev/reventless-spec/src/semantic/DateTime.res.mjs";
10
+ import * as Admission$Reventless from "@reventlessdev/reventless-spec/src/types/Admission.res.mjs";
9
11
  import * as ContactAddressId$ReventlessRegistration from "../ContactAddressId.res.mjs";
10
12
 
11
13
  let consumedEventSchema = Sury.union([
@@ -20,106 +22,126 @@ let consumedEventSchema = Sury.union([
20
22
  })),
21
23
  Sury.$schema(s => ({
22
24
  TAG: "RegistrationRequested",
23
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
24
- address: s.m(Email$Reventless.schema),
25
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
26
+ email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
25
27
  roles: s.m(Sury.array(Sury.string)),
26
- requestedAt: s.m(DateTime$Reventless.schema)
28
+ requestedAt: s.m(DateTime$Reventless.schema),
29
+ language: s.m(Sury.$option(Sury.string))
27
30
  })),
28
31
  Sury.$schema(s => ({
29
32
  TAG: "RegistrationExpired",
30
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
33
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
31
34
  })),
32
35
  Sury.$schema(s => ({
33
36
  TAG: "RegistrationInvited",
34
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
35
- address: s.m(Email$Reventless.schema),
37
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
38
+ email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
36
39
  roles: s.m(Sury.array(Sury.string)),
37
40
  invitedBy: s.m(Sury.string),
38
- invitedAt: s.m(DateTime$Reventless.schema)
41
+ invitedAt: s.m(DateTime$Reventless.schema),
42
+ language: s.m(Sury.$option(Sury.string))
39
43
  })),
40
44
  Sury.$schema(s => ({
41
45
  TAG: "RegistrationChallengeReissued",
42
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
43
- address: s.m(Email$Reventless.schema),
46
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
47
+ email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
44
48
  reissuedAt: s.m(DateTime$Reventless.schema),
45
- invitedBy: s.m(Sury.$option(Sury.string))
49
+ invitedBy: s.m(Sury.$option(Sury.string)),
50
+ language: s.m(Sury.$option(Sury.string))
46
51
  })),
47
52
  Sury.$schema(s => ({
48
53
  TAG: "RegistrationWithdrawn",
49
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
54
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
50
55
  withdrawnAt: s.m(DateTime$Reventless.schema)
51
56
  })),
52
57
  Sury.$schema(s => ({
53
58
  TAG: "RegistrationAttemptedOnTakenAddress",
54
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
55
- address: s.m(Email$Reventless.schema),
59
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
60
+ email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
56
61
  attemptedAt: s.m(DateTime$Reventless.schema)
57
62
  })),
58
63
  Sury.$schema(s => ({
59
64
  TAG: "RegistrationChallengeIssued",
60
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
65
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
61
66
  proofHash: s.m(Sury.string),
62
- issuedAt: s.m(DateTime$Reventless.schema)
67
+ issuedAt: s.m(DateTime$Reventless.schema),
68
+ language: s.m(Sury.$option(Sury.string)),
69
+ messageKey: s.m(Sury.$option(Sury.string))
63
70
  })),
64
71
  Sury.$schema(s => ({
65
72
  TAG: "RegistrationProofAccepted",
66
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
67
- address: s.m(Email$Reventless.schema),
73
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
74
+ email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
68
75
  roles: s.m(Sury.array(Sury.string)),
69
76
  proofHash: s.m(Sury.string)
70
77
  })),
71
78
  Sury.$schema(s => ({
72
79
  TAG: "RegistrationProofRefused",
73
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
80
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
74
81
  reason: s.m(Sury.string)
75
82
  })),
76
83
  Sury.$schema(s => ({
77
84
  TAG: "RegistrationCompleted",
78
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
85
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
86
+ })),
87
+ Sury.$schema(s => ({
88
+ TAG: "RegistrationReleased",
89
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
90
+ releasedAt: s.m(DateTime$Reventless.schema)
79
91
  }))
80
92
  ]);
81
93
 
82
94
  let commandSchema = Sury.union([
83
95
  Sury.$schema(s => ({
84
96
  TAG: "Register",
85
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
86
- address: s.m(Email$Reventless.schema),
97
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
98
+ email: s.m(Pii$Reventless.mark("emailId", undefined, Email$Reventless.schema)),
87
99
  role: s.m(DcbTag$Reventless.mark(Role$Reventless.nameSchema)),
88
- requestedAt: s.m(DateTime$Reventless.schema)
100
+ requestedAt: s.m(DateTime$Reventless.schema),
101
+ language: s.m(Sury.$option(Sury.string)),
102
+ initially: s.m(Sury.$option(Admission$Reventless.initiallySchema))
89
103
  })),
90
104
  Sury.$schema(s => ({
91
105
  TAG: "IssueRegistrationChallenge",
92
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
106
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
93
107
  proofHash: s.m(Sury.string),
94
- issuedAt: s.m(DateTime$Reventless.schema)
108
+ issuedAt: s.m(DateTime$Reventless.schema),
109
+ language: s.m(Sury.$option(Sury.string)),
110
+ messageKey: s.m(Sury.$option(Sury.string))
95
111
  })),
96
112
  Sury.$schema(s => ({
97
113
  TAG: "SubmitRegistrationProof",
98
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
114
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
99
115
  proofHash: s.m(Sury.string),
100
116
  presentedAt: s.m(DateTime$Reventless.schema)
101
117
  })),
102
118
  Sury.$schema(s => ({
103
119
  TAG: "RecordRegistrationCompleted",
104
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
120
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
105
121
  })),
106
122
  Sury.$schema(s => ({
107
123
  TAG: "Invite",
108
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
109
- address: s.m(Email$Reventless.schema),
124
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
125
+ email: s.m(Pii$Reventless.mark("emailId", undefined, Email$Reventless.schema)),
110
126
  roles: s.m(Sury.array(Role$Reventless.nameSchema)),
111
127
  invitedBy: s.m(Sury.string),
112
- requestedAt: s.m(DateTime$Reventless.schema)
128
+ requestedAt: s.m(DateTime$Reventless.schema),
129
+ language: s.m(Sury.$option(Sury.string))
113
130
  })),
114
131
  Sury.$schema(s => ({
115
132
  TAG: "ReissueRegistrationChallenge",
116
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
133
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
117
134
  requestedAt: s.m(DateTime$Reventless.schema)
118
135
  })),
119
136
  Sury.$schema(s => ({
120
137
  TAG: "WithdrawRegistration",
121
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
138
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
122
139
  withdrawnAt: s.m(DateTime$Reventless.schema)
140
+ })),
141
+ Sury.$schema(s => ({
142
+ TAG: "ReleaseRegistration",
143
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
144
+ releasedAt: s.m(DateTime$Reventless.schema)
123
145
  }))
124
146
  ]);
125
147
 
@@ -134,62 +156,72 @@ let errorSchema = Sury.union([
134
156
  let eventSchema = Sury.union([
135
157
  Sury.$schema(s => ({
136
158
  TAG: "RegistrationRequested",
137
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
138
- address: s.m(Email$Reventless.schema),
159
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
160
+ email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
139
161
  roles: s.m(Sury.array(Sury.string)),
140
- requestedAt: s.m(DateTime$Reventless.schema)
162
+ requestedAt: s.m(DateTime$Reventless.schema),
163
+ language: s.m(Sury.$option(Sury.string))
141
164
  })),
142
165
  Sury.$schema(s => ({
143
166
  TAG: "RegistrationExpired",
144
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
167
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
145
168
  })),
146
169
  Sury.$schema(s => ({
147
170
  TAG: "RegistrationInvited",
148
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
149
- address: s.m(Email$Reventless.schema),
171
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
172
+ email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
150
173
  roles: s.m(Sury.array(Sury.string)),
151
174
  invitedBy: s.m(Sury.string),
152
- invitedAt: s.m(DateTime$Reventless.schema)
175
+ invitedAt: s.m(DateTime$Reventless.schema),
176
+ language: s.m(Sury.$option(Sury.string))
153
177
  })),
154
178
  Sury.$schema(s => ({
155
179
  TAG: "RegistrationChallengeReissued",
156
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
157
- address: s.m(Email$Reventless.schema),
180
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
181
+ email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
158
182
  reissuedAt: s.m(DateTime$Reventless.schema),
159
- invitedBy: s.m(Sury.$option(Sury.string))
183
+ invitedBy: s.m(Sury.$option(Sury.string)),
184
+ language: s.m(Sury.$option(Sury.string))
160
185
  })),
161
186
  Sury.$schema(s => ({
162
187
  TAG: "RegistrationWithdrawn",
163
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
188
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
164
189
  withdrawnAt: s.m(DateTime$Reventless.schema)
165
190
  })),
166
191
  Sury.$schema(s => ({
167
192
  TAG: "RegistrationAttemptedOnTakenAddress",
168
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
169
- address: s.m(Email$Reventless.schema),
193
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
194
+ email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
170
195
  attemptedAt: s.m(DateTime$Reventless.schema)
171
196
  })),
172
197
  Sury.$schema(s => ({
173
198
  TAG: "RegistrationChallengeIssued",
174
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
199
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
175
200
  proofHash: s.m(Sury.string),
176
- issuedAt: s.m(DateTime$Reventless.schema)
201
+ issuedAt: s.m(DateTime$Reventless.schema),
202
+ language: s.m(Sury.$option(Sury.string)),
203
+ messageKey: s.m(Sury.$option(Sury.string))
177
204
  })),
178
205
  Sury.$schema(s => ({
179
206
  TAG: "RegistrationProofAccepted",
180
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
181
- address: s.m(Email$Reventless.schema),
207
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
208
+ email: s.m(Pii$Reventless.marked("emailId", undefined, Email$Reventless.schema)),
182
209
  roles: s.m(Sury.array(Sury.string)),
183
210
  proofHash: s.m(Sury.string)
184
211
  })),
185
212
  Sury.$schema(s => ({
186
213
  TAG: "RegistrationProofRefused",
187
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
214
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
188
215
  reason: s.m(Sury.string)
189
216
  })),
190
217
  Sury.$schema(s => ({
191
218
  TAG: "RegistrationCompleted",
192
- email: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
219
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema))
220
+ })),
221
+ Sury.$schema(s => ({
222
+ TAG: "RegistrationReleased",
223
+ emailId: s.m(DcbTag$Reventless.mark(ContactAddressId$ReventlessRegistration.schema)),
224
+ releasedAt: s.m(DateTime$Reventless.schema)
193
225
  }))
194
226
  ]);
195
227
 
@@ -200,7 +232,8 @@ let commandSchema$1 = Api$ReventlessInfra.markNoApiVariants(commandSchema, [
200
232
  "RecordRegistrationCompleted",
201
233
  "Invite",
202
234
  "ReissueRegistrationChallenge",
203
- "WithdrawRegistration"
235
+ "WithdrawRegistration",
236
+ "ReleaseRegistration"
204
237
  ]);
205
238
 
206
239
  function authorizationOf(param) {