@reventlessdev/reventless-spec 3.0.0-alpha.92 → 3.0.0-alpha.93
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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/semantic/StorageRef.res +40 -0
- package/src/semantic/StorageRef.res.mjs +25 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 3.0.0-alpha.93 (2026-08-02)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **aws,core,spec,seed-aws:** expire uploads nobody committed a reference to ([f63e84c](https://github.com/ReventlessDev/reventless-core/commit/f63e84c1a11cc350b799a6f69a2e7427cf1ea6e9))
|
|
11
|
+
|
|
12
|
+
|
|
6
13
|
# 3.0.0-alpha.92 (2026-08-01)
|
|
7
14
|
|
|
8
15
|
* feat(aws,core,spec)!: qualify store prefixes by plugin and refuse name collisions ([da39405](https://github.com/ReventlessDev/reventless-core/commit/da394059d9f8f981bf7adc79e2c1ce2b429e0267))
|
package/package.json
CHANGED
|
@@ -122,3 +122,43 @@ let getStore = (schema: S.t<'a>): option<Semantic.storeTarget> =>
|
|
|
122
122
|
| Some({payload: StoredIn(target)}) => Some(target)
|
|
123
123
|
| _ => None
|
|
124
124
|
}
|
|
125
|
+
|
|
126
|
+
/** How many refs one field holds. */
|
|
127
|
+
type arity =
|
|
128
|
+
| /** A `string` field: one ref. */ Single
|
|
129
|
+
| /** An `array<string>` field: zero or more refs. */ Multiple
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
The store a *field* declares, looking through an array wrapper, with the arity
|
|
133
|
+
that tells a reader how to get at the value.
|
|
134
|
+
|
|
135
|
+
`getStore` asks about a schema; this asks about a field, and those differ for
|
|
136
|
+
`@storageRef("s") urls: array<string>` — the ppx attaches the marker to the
|
|
137
|
+
element type, because `@s.matches` requires the schema's type to match what it
|
|
138
|
+
is attached to, so the array itself carries no marker and `getStore` on it
|
|
139
|
+
answers `None`.
|
|
140
|
+
|
|
141
|
+
Every reader of a *field* wants this one. Reading `getStore` directly is what
|
|
142
|
+
made a multi-valued store declaration invisible: the store went unprovisioned,
|
|
143
|
+
which is the same silence as not having written the annotation at all.
|
|
144
|
+
*/
|
|
145
|
+
let getFieldStore = (schema: S.t<'a>): option<(Semantic.storeTarget, arity)> =>
|
|
146
|
+
switch getStore(schema) {
|
|
147
|
+
| Some(target) => Some(target, Single)
|
|
148
|
+
| None =>
|
|
149
|
+
switch schema->(Obj.magic: S.t<'a> => S.t<unknown>) {
|
|
150
|
+
| Array({items, additionalItems}) =>
|
|
151
|
+
// sury keeps a homogeneous `S.array` element schema in `additionalItems`
|
|
152
|
+
// and a tuple's positional schemas in `items`; read both so the marker is
|
|
153
|
+
// found wherever the element sits.
|
|
154
|
+
switch items->Array.get(0) {
|
|
155
|
+
| Some({schema: itemSchema}) => getStore(itemSchema)
|
|
156
|
+
| None =>
|
|
157
|
+
switch additionalItems {
|
|
158
|
+
| Schema(itemSchema) => getStore(itemSchema)
|
|
159
|
+
| _ => None
|
|
160
|
+
}
|
|
161
|
+
}->Option.map(target => (target, Multiple))
|
|
162
|
+
| _ => None
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
3
|
import * as S from "sury/src/S.res.mjs";
|
|
4
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
4
5
|
import * as Semantic$Reventless from "./Semantic.res.mjs";
|
|
5
6
|
|
|
6
7
|
function segmentIsSafe(segment) {
|
|
@@ -76,10 +77,34 @@ function getStore(schema) {
|
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
79
|
|
|
80
|
+
function getFieldStore(schema) {
|
|
81
|
+
let target = getStore(schema);
|
|
82
|
+
if (target !== undefined) {
|
|
83
|
+
return [
|
|
84
|
+
target,
|
|
85
|
+
"Single"
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
if (schema.type !== "array") {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
let additionalItems = schema.additionalItems;
|
|
92
|
+
let match = schema.items[0];
|
|
93
|
+
let tmp;
|
|
94
|
+
tmp = match !== undefined ? getStore(match.schema) : (
|
|
95
|
+
additionalItems === "strip" || additionalItems === "strict" ? undefined : getStore(additionalItems)
|
|
96
|
+
);
|
|
97
|
+
return Stdlib_Option.map(tmp, target => [
|
|
98
|
+
target,
|
|
99
|
+
"Multiple"
|
|
100
|
+
]);
|
|
101
|
+
}
|
|
102
|
+
|
|
79
103
|
export {
|
|
80
104
|
segmentIsSafe,
|
|
81
105
|
fromString,
|
|
82
106
|
forStore,
|
|
83
107
|
getStore,
|
|
108
|
+
getFieldStore,
|
|
84
109
|
}
|
|
85
110
|
/* S Not a pure module */
|