@lowdefy/build 0.0.0-experimental-20260113081624 → 0.0.0-experimental-20260113090459
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/dist/build/buildJs/buildJs.js +1 -1
- package/dist/build/writeRequests.js +11 -2
- package/dist/defaultTypesMap.js +498 -498
- package/dist/index.js +0 -1
- package/package.json +39 -39
|
@@ -12,9 +12,18 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import { serializer } from '@lowdefy/helpers';
|
|
15
|
+
*/ import { serializer, type } from '@lowdefy/helpers';
|
|
16
|
+
import formatConfigError from '../utils/formatConfigError.js';
|
|
16
17
|
async function writeRequestsOnPage({ page, context }) {
|
|
17
|
-
|
|
18
|
+
const requests = page.requests ?? [];
|
|
19
|
+
if (!type.isArray(requests)) {
|
|
20
|
+
throw new Error(formatConfigError({
|
|
21
|
+
message: `Page requests must be an array. Received ${JSON.stringify(requests)}.`,
|
|
22
|
+
configKey: page['~k'],
|
|
23
|
+
context
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
return Promise.all(requests.map(async (request)=>{
|
|
18
27
|
await context.writeBuildArtifact(`pages/${page.pageId}/requests/${request.requestId}.json`, serializer.serializeToString(request ?? {}));
|
|
19
28
|
delete request.properties;
|
|
20
29
|
delete request.type;
|