@reventlessdev/reventless-spec 3.0.0-alpha.133 → 3.0.0-alpha.135

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 (97) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/package.json +4 -3
  3. package/run-check-lifecycle.mjs +2 -1
  4. package/run-prepare-accounts.mjs +3 -0
  5. package/src/AnsiStyle.res +0 -1
  6. package/src/LogPrefix.res +4 -13
  7. package/src/components/AutomationSlice.res +1 -5
  8. package/src/components/CapabilityManifest.res +6 -3
  9. package/src/components/CapabilityManifest.res.mjs +13 -2
  10. package/src/components/DcbDecode.res +6 -2
  11. package/src/components/DcbScopeInference.res +16 -12
  12. package/src/components/DcbTag.res +74 -46
  13. package/src/components/DcbValidation.res +114 -89
  14. package/src/components/DisplayName.res +4 -2
  15. package/src/components/ExtensionPoint.res +0 -1
  16. package/src/components/FieldDefault.res +2 -4
  17. package/src/components/InboundTranslationSlice.res +0 -2
  18. package/src/components/OutboundTranslationSlice.res +10 -8
  19. package/src/components/Owner.res +4 -4
  20. package/src/components/Plugin.res +10 -4
  21. package/src/components/ReadModel.res +0 -1
  22. package/src/components/Reference.res +2 -8
  23. package/src/components/Sensitive.res +4 -4
  24. package/src/components/StateAnnotations.res +4 -2
  25. package/src/components/StateChangeSlice.res +0 -2
  26. package/src/components/StateViewSlice.res +0 -2
  27. package/src/components/TaggedUnion.res +1 -2
  28. package/src/components/Task.res +0 -1
  29. package/src/components/TraitCertificate.res +2 -2
  30. package/src/components/TraitManifest.res +1 -1
  31. package/src/generator/CertifyTrait.res +2 -4
  32. package/src/generator/Codegen.res +77 -68
  33. package/src/generator/Discovery.res +29 -12
  34. package/src/generator/GraftTrait.res +17 -9
  35. package/src/generator/Pairing.res +39 -13
  36. package/src/generator/PlatformCodegen.res +14 -11
  37. package/src/generator/PlatformCodegen.res.mjs +5 -0
  38. package/src/generator/PlatformManifests.res +1 -3
  39. package/src/generator/PluginGenerator.res +0 -1
  40. package/src/generator/TraitManifestCli.res +7 -7
  41. package/src/lifecycle/CheckLifecycleModel.res +206 -148
  42. package/src/lifecycle/CheckLifecycleModel.res.mjs +23 -5
  43. package/src/semantic/Bytes.res +0 -1
  44. package/src/semantic/CalendarDate.res +2 -2
  45. package/src/semantic/Capabilities.res +21 -6
  46. package/src/semantic/Capabilities.res.mjs +18 -12
  47. package/src/semantic/CapabilityNeed.res +16 -5
  48. package/src/semantic/CapabilityNeed.res.mjs +9 -4
  49. package/src/semantic/CaptionedImage.res +0 -1
  50. package/src/semantic/Color.res +0 -1
  51. package/src/semantic/Currency.res +189 -170
  52. package/src/semantic/DateRange.res +3 -4
  53. package/src/semantic/DateTime.res +5 -5
  54. package/src/semantic/Duration.res +2 -2
  55. package/src/semantic/Email.res +0 -1
  56. package/src/semantic/FileRef.res +2 -2
  57. package/src/semantic/GeoPoint.res +17 -21
  58. package/src/semantic/Geocoding.res +8 -9
  59. package/src/semantic/Geolocation.res +6 -9
  60. package/src/semantic/IdentityProvider.res +127 -0
  61. package/src/semantic/IdentityProvider.res.mjs +65 -0
  62. package/src/semantic/ImageRef.res +2 -2
  63. package/src/semantic/MemberRef.res +0 -1
  64. package/src/semantic/Messaging.res +141 -21
  65. package/src/semantic/Messaging.res.mjs +51 -8
  66. package/src/semantic/Money.res +23 -20
  67. package/src/semantic/Offload.res +6 -4
  68. package/src/semantic/Percent.res +3 -3
  69. package/src/semantic/Phone.res +0 -1
  70. package/src/semantic/RowImage.res +4 -3
  71. package/src/semantic/Secrets.res +76 -0
  72. package/src/semantic/Secrets.res.mjs +49 -0
  73. package/src/semantic/Semantic.res +8 -11
  74. package/src/semantic/StorageRef.res +17 -17
  75. package/src/semantic/Template.res +5 -7
  76. package/src/semantic/UploadableFile.res +0 -1
  77. package/src/semantic/UploadableImage.res +0 -1
  78. package/src/semantic/Url.res +3 -3
  79. package/src/types/AccountsManifest.res +281 -0
  80. package/src/types/AccountsManifest.res.mjs +311 -0
  81. package/src/types/AdminGroup.res +27 -0
  82. package/src/types/AdminGroup.res.mjs +9 -0
  83. package/src/types/Authorization.res +1 -2
  84. package/src/types/Handler.res +0 -1
  85. package/src/types/Identity.res +1 -3
  86. package/src/types/Lifecycle.res +7 -6
  87. package/src/types/Message.res +6 -4
  88. package/src/types/OwnerScope.res +28 -3
  89. package/src/types/OwnerScope.res.mjs +12 -0
  90. package/src/types/PrepareAccounts.res +119 -0
  91. package/src/types/PrepareAccounts.res.mjs +148 -0
  92. package/src/types/Projection.res +9 -2
  93. package/src/types/StoredEvent.res +2 -4
  94. package/src/types/Transition.res +8 -4
  95. package/src/util/Util_Password.res +60 -0
  96. package/src/util/Util_Password.res.mjs +53 -0
  97. package/src/util/Util_Sury.res +1 -4
@@ -27,6 +27,15 @@ type t = {
27
27
  /** Send a message to a person, and say which channels this deployment can
28
28
  attempt at all. See `Messaging.provider`. */
29
29
  messaging: Messaging.provider,
30
+ /** Make, group and unmake principals, and say which of those this
31
+ deployment's provider can do at all. Administrative only — authenticating
32
+ one is `Auth_Adapter.Provider`'s. See `IdentityProvider.t`. */
33
+ identityProvider: IdentityProvider.t,
34
+ /** Unguessable material and a one-way function over it. Injected rather than
35
+ imported so a test can pin the secret a flow is about to use — a suite
36
+ cannot assert what a flow does with a value it cannot predict. See
37
+ `Secrets.t`. */
38
+ secrets: Secrets.t,
30
39
  }
31
40
 
32
41
  /**
@@ -50,10 +59,16 @@ let none: t = {
50
59
  // `UnsupportedChannel` because a caller that got this far is looking at a
51
60
  // deployment gap, not at a fact about the recipient, and abandoning the message
52
61
  // would record the second.
53
- messaging: {
54
- channels: [],
55
- send: async (~recipient as _, ~message as _) => Error(
56
- Unavailable("no messaging provider is configured for this platform"),
57
- ),
58
- },
62
+ messaging: Messaging.makeProvider(~emailAndSms=[], ~pushServices=[], ~send=async (
63
+ ~recipient as _,
64
+ ~message as _,
65
+ ) => Error(Unavailable("no messaging provider is configured for this platform"))),
66
+ identityProvider: IdentityProvider.unavailable(
67
+ ~reason="no identity provider is configured for this platform",
68
+ ),
69
+ // Refusing rather than falling back to a weak source. Every runtime has a
70
+ // cryptographic one, so a platform reaching this arm has skipped wiring rather
71
+ // than declined to provision — and a guessable token would be accepted
72
+ // everywhere while looking exactly like a real one.
73
+ secrets: Secrets.unavailable(~reason="no secret source is configured for this platform"),
59
74
  }
@@ -1,5 +1,8 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
+ import * as Secrets$Reventless from "./Secrets.res.mjs";
4
+ import * as Messaging$Reventless from "./Messaging.res.mjs";
5
+ import * as IdentityProvider$Reventless from "./IdentityProvider.res.mjs";
3
6
 
4
7
  async function none_geocode(param) {
5
8
  return {
@@ -11,23 +14,26 @@ async function none_geocode(param) {
11
14
  };
12
15
  }
13
16
 
14
- let none_messaging = {
15
- channels: [],
16
- send: async (param, param$1) => ({
17
- TAG: "Error",
18
- _0: {
19
- TAG: "Unavailable",
20
- _0: "no messaging provider is configured for this platform"
21
- }
22
- })
23
- };
17
+ let none_messaging = Messaging$Reventless.makeProvider([], [], async (param, param$1) => ({
18
+ TAG: "Error",
19
+ _0: {
20
+ TAG: "Unavailable",
21
+ _0: "no messaging provider is configured for this platform"
22
+ }
23
+ }));
24
+
25
+ let none_identityProvider = IdentityProvider$Reventless.unavailable("no identity provider is configured for this platform");
26
+
27
+ let none_secrets = Secrets$Reventless.unavailable("no secret source is configured for this platform");
24
28
 
25
29
  let none = {
26
30
  geocode: none_geocode,
27
- messaging: none_messaging
31
+ messaging: none_messaging,
32
+ identityProvider: none_identityProvider,
33
+ secrets: none_secrets
28
34
  };
29
35
 
30
36
  export {
31
37
  none,
32
38
  }
33
- /* No side effect */
39
+ /* none Not a pure module */
@@ -18,12 +18,22 @@ rather than a string a README repeats.
18
18
  */
19
19
  type t =
20
20
  | Geocoding
21
- | /** Sending a message to a person, reached through `Capabilities.messaging`.
21
+ /** Sending a message to a person, reached through `Capabilities.messaging`.
22
22
  One need however many channels the platform provisions — which channels
23
23
  those are is a runtime answer the provider publishes, not a second
24
24
  declaration, because a plugin that named `Sms` would fail a deploy it
25
25
  could have run on email. */
26
- Messaging
26
+ | Messaging
27
+ /** Making, grouping and unmaking principals, reached through
28
+ `Capabilities.identityProvider`. No payload, for the reason `Geocoding`
29
+ has none: one identity provider per deployment is a real answer, and a
30
+ deployment wanting a second pool is the `{alternatives, min}` question
31
+ `Messaging` already answers by publishing what it provisioned.
32
+
33
+ Not authentication. Token issuance and session handling are
34
+ `Auth_Adapter.Provider`'s, read at a different time — two seams over one
35
+ provider, the way this type and `Capabilities.t` are already two. */
36
+ | IdentityProvider
27
37
 
28
38
  /** The spelling carried in `pluginStructure` and in `capabilities.json`.
29
39
  Persisted structures hold strings, not enum members, so a plugin built
@@ -32,6 +42,7 @@ let toString = (need: t): string =>
32
42
  switch need {
33
43
  | Geocoding => "Geocoding"
34
44
  | Messaging => "Messaging"
45
+ | IdentityProvider => "IdentityProvider"
35
46
  }
36
47
 
37
48
  /** The inverse, for readers of a persisted structure or a committed manifest.
@@ -41,6 +52,7 @@ let fromString = (name: string): option<t> =>
41
52
  switch name {
42
53
  | "Geocoding" => Some(Geocoding)
43
54
  | "Messaging" => Some(Messaging)
55
+ | "IdentityProvider" => Some(IdentityProvider)
44
56
  | _ => None
45
57
  }
46
58
 
@@ -62,7 +74,7 @@ unprovisioned capability it never named degrades exactly as it always has, which
62
74
  is the modelled outcome for a deployment that simply does not have one.
63
75
  */
64
76
  let unmet = (~declared: array<(string, string)>, ~provisioned: array<t>): array<unmet> =>
65
- declared->Array.filterMap((((capability, component))) =>
77
+ declared->Array.filterMap(((capability, component)) =>
66
78
  switch fromString(capability) {
67
79
  | Some(need) if !(provisioned->Array.includes(need)) => Some({need, component})
68
80
  | _ => None
@@ -77,5 +89,4 @@ let unmetMessage = (unmet: array<unmet>): string =>
77
89
  ->Array.map(u => `${toString(u.need)} (${u.component})`)
78
90
  ->Array.join(", ")}.\n` ++
79
91
  ` Provision them in the platform stack and redeploy the platform first.\n` ++
80
- ` Without it every call answers Unavailable, the slice exhausts its retries, and a ` ++
81
- `permanent verdict is recorded against data that is fine — no error anywhere.`
92
+ ` Without it every call answers Unavailable, the slice exhausts its retries, and a ` ++ `permanent verdict is recorded against data that is fine — no error anywhere.`
@@ -3,10 +3,13 @@
3
3
  import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
4
4
 
5
5
  function toString(need) {
6
- if (need === "Geocoding") {
7
- return "Geocoding";
8
- } else {
9
- return "Messaging";
6
+ switch (need) {
7
+ case "Geocoding" :
8
+ return "Geocoding";
9
+ case "Messaging" :
10
+ return "Messaging";
11
+ case "IdentityProvider" :
12
+ return "IdentityProvider";
10
13
  }
11
14
  }
12
15
 
@@ -14,6 +17,8 @@ function fromString(name) {
14
17
  switch (name) {
15
18
  case "Geocoding" :
16
19
  return "Geocoding";
20
+ case "IdentityProvider" :
21
+ return "IdentityProvider";
17
22
  case "Messaging" :
18
23
  return "Messaging";
19
24
  default:
@@ -59,7 +59,6 @@ value depicts, not in how a reference to it is written. It would carry no
59
59
  }
60
60
  ```
61
61
  */
62
-
63
62
  /** The record itself. No `@schema`: the derived schema would have to name a
64
63
  store, and the store is the host field's — so `forField` is the only way to
65
64
  a schema, and a field the ppx did not reach fails to compile rather than
@@ -26,7 +26,6 @@ full triplet, and the triplet with alpha. Case is not significant.
26
26
  })
27
27
  ```
28
28
  */
29
-
30
29
  /** The colour's representation. Transparent `string`; see `Email.t`. */
31
30
  type t = string
32
31
 
@@ -47,182 +47,201 @@ a checked type in the domain.
47
47
  */
48
48
  @schema
49
49
  type t =
50
- | /** Australian Dollar */ AUD
51
- | /** Canadian Dollar */ CAD
52
- | /** Swiss Franc */ CHF
53
- | /** Yuan Renminbi */ CNY
54
- | /** Euro */ EUR
55
- | /** Pound Sterling */ GBP
56
- | /** Yen */ JPY
57
- | /** Norwegian Krone */ NOK
58
- | /** Swedish Krona */ SEK
59
- | /** US Dollar */ USD
50
+ /** Australian Dollar */
51
+ | AUD
52
+ /** Canadian Dollar */
53
+ | CAD
54
+ /** Swiss Franc */
55
+ | CHF
56
+ /** Yuan Renminbi */
57
+ | CNY
58
+ /** Euro */
59
+ | EUR
60
+ /** Pound Sterling */
61
+ | GBP
62
+ /** Yen */
63
+ | JPY
64
+ /** Norwegian Krone */
65
+ | NOK
66
+ /** Swedish Krona */
67
+ | SEK
68
+ /** US Dollar */
69
+ | USD
60
70
 
61
- // ── Dormant ─────────────────────────────────────────────────────────────
62
- // The rest of ISO 4217, kept for the day one of them is needed. Uncomment
63
- // the code here and in the other three blocks — or add it to `active` in
64
- // scripts/GenerateCurrency.res and regenerate — to admit it.
65
- // | /** UAE Dirham */ AED
66
- // | /** Afghani */ AFN
67
- // | /** Lek */ ALL
68
- // | /** Armenian Dram */ AMD
69
- // | /** Kwanza */ AOA
70
- // | /** Argentine Peso */ ARS
71
- // | /** Aruban Florin */ AWG
72
- // | /** Azerbaijan Manat */ AZN
73
- // | /** Convertible Mark */ BAM
74
- // | /** Barbados Dollar */ BBD
75
- // | /** Taka */ BDT
76
- // | /** Bahraini Dinar */ BHD
77
- // | /** Burundi Franc */ BIF
78
- // | /** Bermudian Dollar */ BMD
79
- // | /** Brunei Dollar */ BND
80
- // | /** Boliviano */ BOB
81
- // | /** BOV */ BOV
82
- // | /** Brazilian Real */ BRL
83
- // | /** Bahamian Dollar */ BSD
84
- // | /** Ngultrum */ BTN
85
- // | /** Pula */ BWP
86
- // | /** Belarusian Ruble */ BYN
87
- // | /** Belize Dollar */ BZD
88
- // | /** Congolese Franc */ CDF
89
- // | /** CHE */ CHE
90
- // | /** CHW */ CHW
91
- // | /** CLF */ CLF
92
- // | /** Chilean Peso */ CLP
93
- // | /** Colombian Peso */ COP
94
- // | /** COU */ COU
95
- // | /** Costa Rican Colon */ CRC
96
- // | /** Cuban Peso */ CUP
97
- // | /** Cabo Verde Escudo */ CVE
98
- // | /** Czech Koruna */ CZK
99
- // | /** Djibouti Franc */ DJF
100
- // | /** Danish Krone */ DKK
101
- // | /** Dominican Peso */ DOP
102
- // | /** Algerian Dinar */ DZD
103
- // | /** Egyptian Pound */ EGP
104
- // | /** Nakfa */ ERN
105
- // | /** Ethiopian Birr */ ETB
106
- // | /** Fiji Dollar */ FJD
107
- // | /** Falkland Islands Pound */ FKP
108
- // | /** Lari */ GEL
109
- // | /** Ghana Cedi */ GHS
110
- // | /** Gibraltar Pound */ GIP
111
- // | /** Dalasi */ GMD
112
- // | /** Guinean Franc */ GNF
113
- // | /** Quetzal */ GTQ
114
- // | /** Guyana Dollar */ GYD
115
- // | /** Hong Kong Dollar */ HKD
116
- // | /** Lempira */ HNL
117
- // | /** Gourde */ HTG
118
- // | /** Forint */ HUF
119
- // | /** Rupiah */ IDR
120
- // | /** New Israeli Sheqel */ ILS
121
- // | /** Indian Rupee */ INR
122
- // | /** Iraqi Dinar */ IQD
123
- // | /** Iranian Rial */ IRR
124
- // | /** Iceland Krona */ ISK
125
- // | /** Jamaican Dollar */ JMD
126
- // | /** Jordanian Dinar */ JOD
127
- // | /** Kenyan Shilling */ KES
128
- // | /** Som */ KGS
129
- // | /** Riel */ KHR
130
- // | /** Comorian Franc */ KMF
131
- // | /** North Korean Won */ KPW
132
- // | /** Won */ KRW
133
- // | /** Kuwaiti Dinar */ KWD
134
- // | /** Cayman Islands Dollar */ KYD
135
- // | /** Tenge */ KZT
136
- // | /** Lao Kip */ LAK
137
- // | /** Lebanese Pound */ LBP
138
- // | /** Sri Lanka Rupee */ LKR
139
- // | /** Liberian Dollar */ LRD
140
- // | /** Loti */ LSL
141
- // | /** Libyan Dinar */ LYD
142
- // | /** Moroccan Dirham */ MAD
143
- // | /** Moldovan Leu */ MDL
144
- // | /** Malagasy Ariary */ MGA
145
- // | /** Denar */ MKD
146
- // | /** Kyat */ MMK
147
- // | /** Tugrik */ MNT
148
- // | /** Pataca */ MOP
149
- // | /** Ouguiya */ MRU
150
- // | /** Mauritius Rupee */ MUR
151
- // | /** Rufiyaa */ MVR
152
- // | /** Malawi Kwacha */ MWK
153
- // | /** Mexican Peso */ MXN
154
- // | /** MXV */ MXV
155
- // | /** Malaysian Ringgit */ MYR
156
- // | /** Mozambique Metical */ MZN
157
- // | /** Namibia Dollar */ NAD
158
- // | /** Naira */ NGN
159
- // | /** Cordoba Oro */ NIO
160
- // | /** Nepalese Rupee */ NPR
161
- // | /** New Zealand Dollar */ NZD
162
- // | /** Rial Omani */ OMR
163
- // | /** Balboa */ PAB
164
- // | /** Sol */ PEN
165
- // | /** Kina */ PGK
166
- // | /** Philippine Peso */ PHP
167
- // | /** Pakistan Rupee */ PKR
168
- // | /** Zloty */ PLN
169
- // | /** Guarani */ PYG
170
- // | /** Qatari Rial */ QAR
171
- // | /** Romanian Leu */ RON
172
- // | /** Serbian Dinar */ RSD
173
- // | /** Russian Ruble */ RUB
174
- // | /** Rwanda Franc */ RWF
175
- // | /** Saudi Riyal */ SAR
176
- // | /** Solomon Islands Dollar */ SBD
177
- // | /** Seychelles Rupee */ SCR
178
- // | /** Sudanese Pound */ SDG
179
- // | /** Singapore Dollar */ SGD
180
- // | /** Saint Helena Pound */ SHP
181
- // | /** Leone */ SLE
182
- // | /** Somali Shilling */ SOS
183
- // | /** Surinam Dollar */ SRD
184
- // | /** South Sudanese Pound */ SSP
185
- // | /** Dobra */ STN
186
- // | /** El Salvador Colon */ SVC
187
- // | /** Syrian Pound */ SYP
188
- // | /** Lilangeni */ SZL
189
- // | /** Baht */ THB
190
- // | /** Somoni */ TJS
191
- // | /** Turkmenistan New Manat */ TMT
192
- // | /** Tunisian Dinar */ TND
193
- // | /** Pa’anga */ TOP
194
- // | /** Turkish Lira */ TRY
195
- // | /** Trinidad and Tobago Dollar */ TTD
196
- // | /** New Taiwan Dollar */ TWD
197
- // | /** Tanzanian Shilling */ TZS
198
- // | /** Hryvnia */ UAH
199
- // | /** Uganda Shilling */ UGX
200
- // | /** USN */ USN
201
- // | /** UYI */ UYI
202
- // | /** Peso Uruguayo */ UYU
203
- // | /** Unidad Previsional */ UYW
204
- // | /** Uzbekistan Sum */ UZS
205
- // | /** Bolívar Soberano */ VED
206
- // | /** Bolívar Soberano */ VES
207
- // | /** Dong */ VND
208
- // | /** Vatu */ VUV
209
- // | /** Tala */ WST
210
- // | /** Arab Accounting Dinar */ XAD
211
- // | /** CFA Franc BEAC */ XAF
212
- // | /** East Caribbean Dollar */ XCD
213
- // | /** Caribbean Guilder */ XCG
214
- // | /** CFA Franc BCEAO */ XOF
215
- // | /** CFP Franc */ XPF
216
- // | /** Yemeni Rial */ YER
217
- // | /** Rand */ ZAR
218
- // | /** Zambian Kwacha */ ZMW
219
- // | /** Zimbabwe Gold */ ZWG
71
+ // ── Dormant ─────────────────────────────────────────────────────────────
72
+ // The rest of ISO 4217, kept for the day one of them is needed. Uncomment
73
+ // the code here and in the other three blocks — or add it to `active` in
74
+ // scripts/GenerateCurrency.res and regenerate — to admit it.
75
+ // | /** UAE Dirham */ AED
76
+ // | /** Afghani */ AFN
77
+ // | /** Lek */ ALL
78
+ // | /** Armenian Dram */ AMD
79
+ // | /** Kwanza */ AOA
80
+ // | /** Argentine Peso */ ARS
81
+ // | /** Aruban Florin */ AWG
82
+ // | /** Azerbaijan Manat */ AZN
83
+ // | /** Convertible Mark */ BAM
84
+ // | /** Barbados Dollar */ BBD
85
+ // | /** Taka */ BDT
86
+ // | /** Bahraini Dinar */ BHD
87
+ // | /** Burundi Franc */ BIF
88
+ // | /** Bermudian Dollar */ BMD
89
+ // | /** Brunei Dollar */ BND
90
+ // | /** Boliviano */ BOB
91
+ // | /** BOV */ BOV
92
+ // | /** Brazilian Real */ BRL
93
+ // | /** Bahamian Dollar */ BSD
94
+ // | /** Ngultrum */ BTN
95
+ // | /** Pula */ BWP
96
+ // | /** Belarusian Ruble */ BYN
97
+ // | /** Belize Dollar */ BZD
98
+ // | /** Congolese Franc */ CDF
99
+ // | /** CHE */ CHE
100
+ // | /** CHW */ CHW
101
+ // | /** CLF */ CLF
102
+ // | /** Chilean Peso */ CLP
103
+ // | /** Colombian Peso */ COP
104
+ // | /** COU */ COU
105
+ // | /** Costa Rican Colon */ CRC
106
+ // | /** Cuban Peso */ CUP
107
+ // | /** Cabo Verde Escudo */ CVE
108
+ // | /** Czech Koruna */ CZK
109
+ // | /** Djibouti Franc */ DJF
110
+ // | /** Danish Krone */ DKK
111
+ // | /** Dominican Peso */ DOP
112
+ // | /** Algerian Dinar */ DZD
113
+ // | /** Egyptian Pound */ EGP
114
+ // | /** Nakfa */ ERN
115
+ // | /** Ethiopian Birr */ ETB
116
+ // | /** Fiji Dollar */ FJD
117
+ // | /** Falkland Islands Pound */ FKP
118
+ // | /** Lari */ GEL
119
+ // | /** Ghana Cedi */ GHS
120
+ // | /** Gibraltar Pound */ GIP
121
+ // | /** Dalasi */ GMD
122
+ // | /** Guinean Franc */ GNF
123
+ // | /** Quetzal */ GTQ
124
+ // | /** Guyana Dollar */ GYD
125
+ // | /** Hong Kong Dollar */ HKD
126
+ // | /** Lempira */ HNL
127
+ // | /** Gourde */ HTG
128
+ // | /** Forint */ HUF
129
+ // | /** Rupiah */ IDR
130
+ // | /** New Israeli Sheqel */ ILS
131
+ // | /** Indian Rupee */ INR
132
+ // | /** Iraqi Dinar */ IQD
133
+ // | /** Iranian Rial */ IRR
134
+ // | /** Iceland Krona */ ISK
135
+ // | /** Jamaican Dollar */ JMD
136
+ // | /** Jordanian Dinar */ JOD
137
+ // | /** Kenyan Shilling */ KES
138
+ // | /** Som */ KGS
139
+ // | /** Riel */ KHR
140
+ // | /** Comorian Franc */ KMF
141
+ // | /** North Korean Won */ KPW
142
+ // | /** Won */ KRW
143
+ // | /** Kuwaiti Dinar */ KWD
144
+ // | /** Cayman Islands Dollar */ KYD
145
+ // | /** Tenge */ KZT
146
+ // | /** Lao Kip */ LAK
147
+ // | /** Lebanese Pound */ LBP
148
+ // | /** Sri Lanka Rupee */ LKR
149
+ // | /** Liberian Dollar */ LRD
150
+ // | /** Loti */ LSL
151
+ // | /** Libyan Dinar */ LYD
152
+ // | /** Moroccan Dirham */ MAD
153
+ // | /** Moldovan Leu */ MDL
154
+ // | /** Malagasy Ariary */ MGA
155
+ // | /** Denar */ MKD
156
+ // | /** Kyat */ MMK
157
+ // | /** Tugrik */ MNT
158
+ // | /** Pataca */ MOP
159
+ // | /** Ouguiya */ MRU
160
+ // | /** Mauritius Rupee */ MUR
161
+ // | /** Rufiyaa */ MVR
162
+ // | /** Malawi Kwacha */ MWK
163
+ // | /** Mexican Peso */ MXN
164
+ // | /** MXV */ MXV
165
+ // | /** Malaysian Ringgit */ MYR
166
+ // | /** Mozambique Metical */ MZN
167
+ // | /** Namibia Dollar */ NAD
168
+ // | /** Naira */ NGN
169
+ // | /** Cordoba Oro */ NIO
170
+ // | /** Nepalese Rupee */ NPR
171
+ // | /** New Zealand Dollar */ NZD
172
+ // | /** Rial Omani */ OMR
173
+ // | /** Balboa */ PAB
174
+ // | /** Sol */ PEN
175
+ // | /** Kina */ PGK
176
+ // | /** Philippine Peso */ PHP
177
+ // | /** Pakistan Rupee */ PKR
178
+ // | /** Zloty */ PLN
179
+ // | /** Guarani */ PYG
180
+ // | /** Qatari Rial */ QAR
181
+ // | /** Romanian Leu */ RON
182
+ // | /** Serbian Dinar */ RSD
183
+ // | /** Russian Ruble */ RUB
184
+ // | /** Rwanda Franc */ RWF
185
+ // | /** Saudi Riyal */ SAR
186
+ // | /** Solomon Islands Dollar */ SBD
187
+ // | /** Seychelles Rupee */ SCR
188
+ // | /** Sudanese Pound */ SDG
189
+ // | /** Singapore Dollar */ SGD
190
+ // | /** Saint Helena Pound */ SHP
191
+ // | /** Leone */ SLE
192
+ // | /** Somali Shilling */ SOS
193
+ // | /** Surinam Dollar */ SRD
194
+ // | /** South Sudanese Pound */ SSP
195
+ // | /** Dobra */ STN
196
+ // | /** El Salvador Colon */ SVC
197
+ // | /** Syrian Pound */ SYP
198
+ // | /** Lilangeni */ SZL
199
+ // | /** Baht */ THB
200
+ // | /** Somoni */ TJS
201
+ // | /** Turkmenistan New Manat */ TMT
202
+ // | /** Tunisian Dinar */ TND
203
+ // | /** Pa’anga */ TOP
204
+ // | /** Turkish Lira */ TRY
205
+ // | /** Trinidad and Tobago Dollar */ TTD
206
+ // | /** New Taiwan Dollar */ TWD
207
+ // | /** Tanzanian Shilling */ TZS
208
+ // | /** Hryvnia */ UAH
209
+ // | /** Uganda Shilling */ UGX
210
+ // | /** USN */ USN
211
+ // | /** UYI */ UYI
212
+ // | /** Peso Uruguayo */ UYU
213
+ // | /** Unidad Previsional */ UYW
214
+ // | /** Uzbekistan Sum */ UZS
215
+ // | /** Bolívar Soberano */ VED
216
+ // | /** Bolívar Soberano */ VES
217
+ // | /** Dong */ VND
218
+ // | /** Vatu */ VUV
219
+ // | /** Tala */ WST
220
+ // | /** Arab Accounting Dinar */ XAD
221
+ // | /** CFA Franc BEAC */ XAF
222
+ // | /** East Caribbean Dollar */ XCD
223
+ // | /** Caribbean Guilder */ XCG
224
+ // | /** CFA Franc BCEAO */ XOF
225
+ // | /** CFP Franc */ XPF
226
+ // | /** Yemeni Rial */ YER
227
+ // | /** Rand */ ZAR
228
+ // | /** Zambian Kwacha */ ZMW
229
+ // | /** Zimbabwe Gold */ ZWG
220
230
 
221
231
  /** Every currency the type admits, in code order. `fromString` is derived from
222
232
  this, so a code that parses and a code that exists are the same set by
223
233
  construction. */
224
234
  let all: array<t> = [
225
- AUD, CAD, CHF, CNY, EUR, GBP, JPY, NOK, SEK, USD,
235
+ AUD,
236
+ CAD,
237
+ CHF,
238
+ CNY,
239
+ EUR,
240
+ GBP,
241
+ JPY,
242
+ NOK,
243
+ SEK,
244
+ USD,
226
245
  // AED, AFN, ALL, AMD, AOA, ARS, AWG, AZN, BAM, BBD, BDT, BHD, BIF, BMD, BND, BOB, BOV, BRL,
227
246
  // BSD, BTN, BWP, BYN, BZD, CDF, CHE, CHW, CLF, CLP, COP, COU, CRC, CUP, CVE, CZK, DJF, DKK,
228
247
  // DOP, DZD, EGP, ERN, ETB, FJD, FKP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HTG, HUF,
@@ -66,7 +66,6 @@ projection rebuild. It costs a log something only if it *collapses* an existing
66
66
  `start*`/`end*` pair, which rewrites the wire shape the way `Money` rewrote
67
67
  `price: float`. That collapse belongs to whoever builds the upcaster.
68
68
  */
69
-
70
69
  @schema
71
70
  type t = {
72
71
  /** The instant the range opens, inclusive. */
@@ -83,7 +82,8 @@ type t = {
83
82
  Shadows the schema sury-ppx derived from the type above: the derived one is
84
83
  the shape, and this adds the marker the shape cannot carry. The ordering rule
85
84
  is deliberately *not* refined in here — see the module doc. */
86
- let schema: S.t<t> = schema->Semantic.mark(~id=Semantic.Id.dateRange)
85
+ let schema: S.t<t> =
86
+ schema->Semantic.mark(~id=Semantic.Id.dateRange)
87
87
 
88
88
  /** An instant as milliseconds since the epoch. `DateTime`'s, so end-exclusivity
89
89
  and the ordering rule are expressed against the same single parse the type
@@ -101,8 +101,7 @@ that both parse, the earlier one second.
101
101
  let validate = (range: t): result<t, string> =>
102
102
  millis(range.start) > millis(range.end_)
103
103
  ? Error(
104
- `a range ends before it starts: ${range.start} is after ${range.end_}. ` ++
105
- `A range is [start, end) — the start is the earlier instant.`,
104
+ `a range ends before it starts: ${range.start} is after ${range.end_}. ` ++ `A range is [start, end) — the start is the earlier instant.`,
106
105
  )
107
106
  : Ok(range)
108
107
 
@@ -38,7 +38,6 @@ type state = {
38
38
  }
39
39
  ```
40
40
  */
41
-
42
41
  /** The instant's representation. Transparent `string`: the marker refines an
43
42
  existing field rather than replacing it, so nothing stored changes, and
44
43
  `placedAt: meta.time` keeps compiling. */
@@ -55,18 +54,19 @@ let grammar: S.t<string> = S.isoDateTime
55
54
  let fromString = (raw: string): result<t, string> =>
56
55
  switch raw->S.parseOrThrow(~to=grammar) {
57
56
  | value => Ok(value)
58
- | exception _ =>
59
- Error(`expected a UTC ISO-8601 instant, got ${Semantic.showString(raw)}`)
57
+ | exception _ => Error(`expected a UTC ISO-8601 instant, got ${Semantic.showString(raw)}`)
60
58
  }
61
59
 
62
60
  /** The sury schema for an instant field. Use with `@s.matches(Reventless.DateTime.schema)`,
63
61
  or write the field's type as `Reventless.DateTime.t` and let sury-ppx resolve it. */
64
- let schema: S.t<t> = S.string->Semantic.refined(~id=Semantic.Id.dateTime, ~check=fromString)
62
+ let schema: S.t<t> =
63
+ S.string->Semantic.refined(~id=Semantic.Id.dateTime, ~check=fromString)
65
64
 
66
65
  /** A sury string schema annotated as an instant, without the grammar.
67
66
 
68
67
  @deprecated Use `schema`, which carries the same marker and checks the value. */
69
- let string: S.t<string> = S.string->Semantic.mark(~id=Semantic.Id.dateTime)
68
+ let string: S.t<string> =
69
+ S.string->Semantic.mark(~id=Semantic.Id.dateTime)
70
70
 
71
71
  /** Whether a field schema carries the date-time marker. */
72
72
  let isDateTime = (fieldSchema: S.t<unknown>) => fieldSchema->Semantic.has(~id=Semantic.Id.dateTime)
@@ -14,7 +14,6 @@ wire. `int` is safe here — int32 seconds is 68 years.
14
14
  }
15
15
  ```
16
16
  */
17
-
18
17
  /** The duration's representation, in seconds. Transparent `int`. */
19
18
  type t = int
20
19
 
@@ -31,7 +30,8 @@ let fromInt = (raw: int): result<t, string> =>
31
30
 
32
31
  /** The sury schema for a duration field, in seconds.
33
32
  Use with `@s.matches(Reventless.Duration.schema)`. */
34
- let schema: S.t<t> = S.int->Semantic.refined(~id=Semantic.Id.duration, ~check=fromInt)
33
+ let schema: S.t<t> =
34
+ S.int->Semantic.refined(~id=Semantic.Id.duration, ~check=fromInt)
35
35
 
36
36
  let scales = [(86400, "d"), (3600, "h"), (60, "m"), (1, "s")]
37
37
 
@@ -28,7 +28,6 @@ check can honestly do.
28
28
  })
29
29
  ```
30
30
  */
31
-
32
31
  /** The address's representation. Transparent `string`: the marker refines an
33
32
  existing field rather than replacing it, so nothing stored changes. */
34
33
  type t = string