@interweave/interweave
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -215,2 +215,25 @@ export interface Error { | ||
}; | ||
interface?: { | ||
form?: { | ||
/** | ||
* User-friendly name for the key | ||
* Will render on the form and the table's column | ||
*/ | ||
label?: string; | ||
/** | ||
* Placeholder text to render on the element | ||
*/ | ||
placeholder?: string; | ||
/** | ||
* Whether to hide this element from the interface | ||
* Hiding the element in the form will skip its validation client-side | ||
* Useful for fields that get set server-side like `id` | ||
*/ | ||
hidden?: boolean; | ||
/** | ||
* Whether a user can interact with this element or not | ||
*/ | ||
disabled?: boolean; | ||
}; | ||
}; | ||
options?: { | ||
@@ -217,0 +240,0 @@ /** |
@@ -146,2 +146,111 @@ "use strict"; | ||
}; | ||
const withParams = { | ||
keys: { | ||
id: { | ||
schema: { | ||
type: "string", | ||
}, | ||
interface: { | ||
form: { | ||
hidden: true, | ||
}, | ||
table: { | ||
hidden: true, | ||
}, | ||
}, | ||
}, | ||
title: { | ||
schema: { | ||
type: "string", | ||
}, | ||
validation: { | ||
min_length: 10, | ||
max_length: 15, | ||
}, | ||
}, | ||
description: { | ||
schema: { | ||
type: "string", | ||
}, | ||
validation: { | ||
is_email: true, | ||
}, | ||
}, | ||
price: { | ||
schema: { | ||
type: "number", | ||
}, | ||
}, | ||
discountPercentage: { | ||
schema: { | ||
type: "number", | ||
}, | ||
}, | ||
rating: { | ||
schema: { | ||
type: "number", | ||
}, | ||
}, | ||
stock: { | ||
schema: { | ||
type: "number", | ||
}, | ||
}, | ||
brand: { | ||
schema: { | ||
type: "string", | ||
is_optional: true, | ||
}, | ||
}, | ||
category: { | ||
schema: { | ||
type: "string", | ||
enum: [ | ||
"smartphones", | ||
"laptops", | ||
"fragrances", | ||
"skincare", | ||
"groceries", | ||
"home-decoration", | ||
], | ||
default_value: "fragrances", | ||
}, | ||
}, | ||
thumbnail: { | ||
schema: { | ||
type: "string", | ||
}, | ||
}, | ||
images: { | ||
schema: { | ||
type: "string", | ||
is_array: true, | ||
}, | ||
}, | ||
}, | ||
requests: { | ||
get: { | ||
http_method: "GET", | ||
uri: "https://dummyjson.com/{subcategory}/search", | ||
data_path: "products", | ||
parameters: { | ||
subcategory: { | ||
schema: { | ||
type: "string", | ||
}, | ||
}, | ||
q: { | ||
schema: { | ||
type: "string", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
access: { | ||
privacy: "InviteRestricted", | ||
default_permissions: ["All"], | ||
users: [{ email: "mfcbone2@gmail.com" }], | ||
}, | ||
}; | ||
// This can be executed at build time | ||
@@ -157,3 +266,3 @@ // const x = validateSchema(newOne); | ||
}; | ||
(0, fs_1.writeFile)((0, path_1.join)(__dirname, "../hm.json"), JSON.stringify(newObj), (err) => { | ||
(0, fs_1.writeFile)((0, path_1.join)(__dirname, "../hm.json"), JSON.stringify(withParams), (err) => { | ||
if (err) { | ||
@@ -160,0 +269,0 @@ console.log(err); |
{ | ||
"name": "@interweave/interweave", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -238,2 +238,26 @@ export interface Error { | ||
interface?: { | ||
form?: { | ||
/** | ||
* User-friendly name for the key | ||
* Will render on the form and the table's column | ||
*/ | ||
label?: string; | ||
/** | ||
* Placeholder text to render on the element | ||
*/ | ||
placeholder?: string; | ||
/** | ||
* Whether to hide this element from the interface | ||
* Hiding the element in the form will skip its validation client-side | ||
* Useful for fields that get set server-side like `id` | ||
*/ | ||
hidden?: boolean; | ||
/** | ||
* Whether a user can interact with this element or not | ||
*/ | ||
disabled?: boolean; | ||
}; | ||
}; | ||
options?: { | ||
@@ -240,0 +264,0 @@ /** |
92856
2653