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

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 (79) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +2 -2
  3. package/src/AnsiStyle.res +0 -1
  4. package/src/LogPrefix.res +4 -13
  5. package/src/components/AutomationSlice.res +1 -5
  6. package/src/components/CapabilityManifest.res +2 -3
  7. package/src/components/DcbDecode.res +6 -2
  8. package/src/components/DcbScopeInference.res +16 -12
  9. package/src/components/DcbTag.res +74 -46
  10. package/src/components/DcbValidation.res +114 -89
  11. package/src/components/DisplayName.res +4 -2
  12. package/src/components/ExtensionPoint.res +0 -1
  13. package/src/components/FieldDefault.res +2 -4
  14. package/src/components/InboundTranslationSlice.res +0 -2
  15. package/src/components/OutboundTranslationSlice.res +10 -8
  16. package/src/components/Owner.res +4 -4
  17. package/src/components/Plugin.res +10 -4
  18. package/src/components/ReadModel.res +0 -1
  19. package/src/components/Reference.res +2 -8
  20. package/src/components/Sensitive.res +4 -4
  21. package/src/components/StateAnnotations.res +4 -2
  22. package/src/components/StateChangeSlice.res +0 -2
  23. package/src/components/StateViewSlice.res +0 -2
  24. package/src/components/TaggedUnion.res +1 -2
  25. package/src/components/Task.res +0 -1
  26. package/src/components/TraitCertificate.res +2 -2
  27. package/src/components/TraitManifest.res +1 -1
  28. package/src/generator/CertifyTrait.res +2 -4
  29. package/src/generator/Codegen.res +77 -68
  30. package/src/generator/Discovery.res +29 -12
  31. package/src/generator/GraftTrait.res +17 -9
  32. package/src/generator/Pairing.res +39 -13
  33. package/src/generator/PlatformCodegen.res +13 -11
  34. package/src/generator/PlatformManifests.res +1 -3
  35. package/src/generator/PluginGenerator.res +0 -1
  36. package/src/generator/TraitManifestCli.res +7 -7
  37. package/src/lifecycle/CheckLifecycleModel.res +173 -145
  38. package/src/lifecycle/CheckLifecycleModel.res.mjs +17 -2
  39. package/src/semantic/Bytes.res +0 -1
  40. package/src/semantic/CalendarDate.res +2 -2
  41. package/src/semantic/Capabilities.res +4 -6
  42. package/src/semantic/Capabilities.res.mjs +9 -11
  43. package/src/semantic/CapabilityNeed.res +4 -5
  44. package/src/semantic/CaptionedImage.res +0 -1
  45. package/src/semantic/Color.res +0 -1
  46. package/src/semantic/Currency.res +189 -170
  47. package/src/semantic/DateRange.res +3 -4
  48. package/src/semantic/DateTime.res +5 -5
  49. package/src/semantic/Duration.res +2 -2
  50. package/src/semantic/Email.res +0 -1
  51. package/src/semantic/FileRef.res +2 -2
  52. package/src/semantic/GeoPoint.res +17 -21
  53. package/src/semantic/Geocoding.res +8 -9
  54. package/src/semantic/Geolocation.res +6 -9
  55. package/src/semantic/ImageRef.res +2 -2
  56. package/src/semantic/MemberRef.res +0 -1
  57. package/src/semantic/Messaging.res +141 -21
  58. package/src/semantic/Messaging.res.mjs +51 -8
  59. package/src/semantic/Money.res +23 -20
  60. package/src/semantic/Offload.res +6 -4
  61. package/src/semantic/Percent.res +3 -3
  62. package/src/semantic/Phone.res +0 -1
  63. package/src/semantic/RowImage.res +4 -3
  64. package/src/semantic/Semantic.res +8 -11
  65. package/src/semantic/StorageRef.res +17 -17
  66. package/src/semantic/Template.res +5 -7
  67. package/src/semantic/UploadableFile.res +0 -1
  68. package/src/semantic/UploadableImage.res +0 -1
  69. package/src/semantic/Url.res +3 -3
  70. package/src/types/Authorization.res +1 -2
  71. package/src/types/Handler.res +0 -1
  72. package/src/types/Identity.res +1 -3
  73. package/src/types/Lifecycle.res +7 -6
  74. package/src/types/Message.res +6 -4
  75. package/src/types/OwnerScope.res +1 -3
  76. package/src/types/Projection.res +9 -2
  77. package/src/types/StoredEvent.res +2 -4
  78. package/src/types/Transition.res +8 -4
  79. package/src/util/Util_Sury.res +1 -4
@@ -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
@@ -14,7 +14,6 @@ the pair exists and what the grammar refuses.
14
14
  })
15
15
  ```
16
16
  */
17
-
18
17
  /** Transparent `string`; see `Email.t`. */
19
18
  type t = string
20
19
 
@@ -25,4 +24,5 @@ let fromString = (raw: string): result<t, string> => Media_Ref.check(~what="file
25
24
 
26
25
  /** The sury schema for a file-reference field.
27
26
  Use with `@s.matches(Reventless.FileRef.schema)`. */
28
- let schema: S.t<t> = S.string->Semantic.refined(~id=Semantic.Id.fileRef, ~check=fromString)
27
+ let schema: S.t<t> =
28
+ S.string->Semantic.refined(~id=Semantic.Id.fileRef, ~check=fromString)
@@ -64,7 +64,6 @@ type has, and it is the one most existing coordinate fields are on. It costs a
64
64
  log something only if it *collapses* two flattened scalar fields back into one,
65
65
  which rewrites that shape.
66
66
  */
67
-
68
67
  /**
69
68
  Validate a latitude, saying why when it is out of range.
70
69
 
@@ -76,8 +75,9 @@ let validateLat = (raw: float): result<float, string> =>
76
75
  Error(`a latitude must be a finite number of degrees, got ${Float.toString(raw)}`)
77
76
  } else if raw < -90.0 || raw > 90.0 {
78
77
  Error(
79
- `a latitude runs from -90 to 90 degrees, got ${Float.toString(raw)}. ` ++
80
- `A value beyond ±90 is usually a longitude in the latitude's place.`,
78
+ `a latitude runs from -90 to 90 degrees, got ${Float.toString(
79
+ raw,
80
+ )}. ` ++ `A value beyond ±90 is usually a longitude in the latitude's place.`,
81
81
  )
82
82
  } else {
83
83
  Ok(raw)
@@ -99,25 +99,20 @@ let validateLng = (raw: float): result<float, string> =>
99
99
  11-alpha miscompiles a refinement wrapping a *record* schema. Refining the
100
100
  field is both the honest placement and the one that works. */
101
101
  let latSchema: S.t<float> =
102
- S.float->S.refine(
103
- raw =>
104
- switch validateLat(raw) {
105
- | Ok(_) => true
106
- | Error(_) => false
107
- },
108
- ~error="expected a latitude in -90…90",
109
- )
102
+ S.float->S.refine(raw =>
103
+ switch validateLat(raw) {
104
+ | Ok(_) => true
105
+ | Error(_) => false
106
+ }
107
+ , ~error="expected a latitude in -90…90")
110
108
 
111
109
  /** The longitude's own schema, for the same reason. */
112
- let lngSchema: S.t<float> =
113
- S.float->S.refine(
114
- raw =>
115
- switch validateLng(raw) {
116
- | Ok(_) => true
117
- | Error(_) => false
118
- },
119
- ~error="expected a longitude in -180…180",
120
- )
110
+ let lngSchema: S.t<float> = S.float->S.refine(raw =>
111
+ switch validateLng(raw) {
112
+ | Ok(_) => true
113
+ | Error(_) => false
114
+ }
115
+ , ~error="expected a longitude in -180…180")
121
116
 
122
117
  @schema
123
118
  type t = {
@@ -131,7 +126,8 @@ type t = {
131
126
 
132
127
  Shadows the schema sury-ppx derived from the type above: the derived one is
133
128
  the shape, and this adds the marker the shape cannot carry. */
134
- let schema: S.t<t> = schema->Semantic.mark(~id=Semantic.Id.geoPoint)
129
+ let schema: S.t<t> =
130
+ schema->Semantic.mark(~id=Semantic.Id.geoPoint)
135
131
 
136
132
  /** Build a validated point. Both coordinates are checked, and the message names
137
133
  which one is wrong — the common mistake is a swapped pair, where the
@@ -5,7 +5,6 @@ The transport is provider-specific and lives with its provider. What is here is
5
5
  provider-neutral: the shape of an answer, the two ways a lookup fails, and the
6
6
  confidence rule — decided once, so no transport invents its own.
7
7
  */
8
-
9
8
  /** One candidate a geocoder returned. */
10
9
  type candidate = {
11
10
  /** The provider's canonical rendering of the address it matched. */
@@ -19,10 +18,10 @@ type candidate = {
19
18
  /** Why a lookup produced no usable point. Two constructors because the retry
20
19
  decision turns on the distinction: an outage must not become a verdict. */
21
20
  type failure =
22
- | /** The provider could not be reached, or refused the call. Retry. */
23
- Unavailable(string)
24
- | /** The provider answered, and had nothing for this text. Do not retry. */
25
- NoMatch
21
+ /** The provider could not be reached, or refused the call. Retry. */
22
+ | Unavailable(string)
23
+ /** The provider answered, and had nothing for this text. Do not retry. */
24
+ | NoMatch
26
25
 
27
26
  /**
28
27
  The port a caller reaches a geocoder through, so swapping the implementation is a
@@ -51,11 +50,11 @@ let defaultAmbiguityMargin = 0.01
51
50
  type assessment =
52
51
  | Confident(candidate)
53
52
  | NoCandidates
54
- | /** Unscored is not a low score, and must not read as a high one. */
55
- Unscored(candidate)
53
+ /** Unscored is not a low score, and must not read as a high one. */
54
+ | Unscored(candidate)
56
55
  | LowRelevance({top: candidate, score: float, floor: float})
57
- | /** Several matches about equally well. */
58
- Ambiguous({top: candidate, runnerUp: candidate, margin: float})
56
+ /** Several matches about equally well. */
57
+ | Ambiguous({top: candidate, runnerUp: candidate, margin: float})
59
58
 
60
59
  /** The confidence rule, stated once. Everything else here derives from it. */
61
60
  let assess = (
@@ -5,14 +5,13 @@ Three arms rather than `option<GeoPoint.t>`, whose `None` means both "has not ru
5
5
  and "ran and failed". Emitted as a GraphQL union (see `Reventless.TaggedUnion`).
6
6
  Replacing a point/status/note trio with it is wire-breaking.
7
7
  */
8
-
9
8
  @schema
10
9
  type t =
11
- | /** `requestedFor` is the address asked about, so a stale answer is detectable. */
12
- Pending({requestedFor: string})
10
+ /** `requestedFor` is the address asked about, so a stale answer is detectable. */
11
+ | Pending({requestedFor: string})
13
12
  | Located({point: GeoPoint.t})
14
- | /** Answered, with nothing storable unattended. A verdict for a human. */
15
- Unresolvable({reason: string})
13
+ /** Answered, with nothing storable unattended. A verdict for a human. */
14
+ | Unresolvable({reason: string})
16
15
 
17
16
  /** Adds the two markers the shape cannot carry: the semantic, and the union name
18
17
  the SDL and the `__typename` stamp share. */
@@ -59,8 +58,7 @@ let ofSearch = (
59
58
  | Unscored(top) =>
60
59
  Some(
61
60
  Unresolvable({
62
- reason: `the geocoder returned "${top.label}" for "${requestedFor}" without scoring it, ` ++
63
- `and an unscored answer cannot be accepted unattended`,
61
+ reason: `the geocoder returned "${top.label}" for "${requestedFor}" without scoring it, ` ++ `and an unscored answer cannot be accepted unattended`,
64
62
  }),
65
63
  )
66
64
  | LowRelevance({top, score, floor}) =>
@@ -73,8 +71,7 @@ let ofSearch = (
73
71
  | Ambiguous({top, runnerUp}) =>
74
72
  Some(
75
73
  Unresolvable({
76
- reason: `"${requestedFor}" matched "${top.label}" and "${runnerUp.label}" ` ++
77
- `about equally well`,
74
+ reason: `"${requestedFor}" matched "${top.label}" and "${runnerUp.label}" ` ++ `about equally well`,
78
75
  }),
79
76
  )
80
77
  }
@@ -30,7 +30,6 @@ a field that declares no store.
30
30
  })
31
31
  ```
32
32
  */
33
-
34
33
  /** Transparent `string`; see `Email.t`. */
35
34
  type t = string
36
35
 
@@ -48,4 +47,5 @@ let fromString = (raw: string): result<t, string> => Media_Ref.check(~what="imag
48
47
 
49
48
  /** The sury schema for an image-reference field.
50
49
  Use with `@s.matches(Reventless.ImageRef.schema)`. */
51
- let schema: S.t<t> = S.string->Semantic.refined(~id=Semantic.Id.imageRef, ~check=fromString)
50
+ let schema: S.t<t> =
51
+ S.string->Semantic.refined(~id=Semantic.Id.imageRef, ~check=fromString)
@@ -55,7 +55,6 @@ declares one there today: a view that carried a scalar *and* the set it was
55
55
  drawn from needed a marker saying the two were one thing, and a view whose
56
56
  primary is simply the first member has no second field to reconcile.
57
57
  */
58
-
59
58
  /** Transparent `string`, as every ref-shaped semantic here is: the marker
60
59
  refines an existing field rather than replacing it, so nothing stored
61
60
  changes when a field adopts it. */