@interweave/interweave
Advanced tools
Comparing version
@@ -1,6 +0,6 @@ | ||
import { type Schema, type KeyConfiguration, type Request, type Error, type SchemaKeys, type Permissions, type PermissionValue, type Users } from "./interfaces"; | ||
import { type Schema, type KeyConfiguration, type Request, type Error, type SchemaKeys, type Permissions, type PermissionValue, type Users, type DataSource } from "./interfaces"; | ||
import { validate, type ExternalValidateOptions as ValidateOptions, type ErrorsReturnObject } from "./validate"; | ||
import { validateSchema } from "./validateSchema"; | ||
import { buildInterface } from "./sync"; | ||
export { type Schema, type KeyConfiguration, type Request, type Error, type SchemaKeys, type Permissions, type PermissionValue, type Users, type ValidateOptions, type ErrorsReturnObject, }; | ||
export { type Schema, type KeyConfiguration, type Request, type Error, type SchemaKeys, type Permissions, type PermissionValue, type Users, type DataSource, type ValidateOptions, type ErrorsReturnObject, }; | ||
export { buildInterface, validate, validateSchema }; |
@@ -143,3 +143,3 @@ export interface Error { | ||
*/ | ||
data: any[] | Request; | ||
data: DataSource; | ||
/** | ||
@@ -200,2 +200,36 @@ * The unique identifier per entry | ||
default_error?: string; | ||
/** | ||
* If the url accepts a parameter | ||
*/ | ||
parameters?: { | ||
/** | ||
* Keys _not_ specified in the URL will be appended as query parameters | ||
* for example, a key of location will be appended as ?location=value | ||
*/ | ||
[key: string]: { | ||
schema: { | ||
type: "string" | "number" | "boolean"; | ||
is_optional?: boolean; | ||
is_array?: boolean; | ||
enum?: string[] | number[]; | ||
default_value?: any; | ||
}; | ||
options?: { | ||
/** | ||
* The source of the data | ||
*/ | ||
data: DataSource; | ||
/** | ||
* The unique identifier per entry | ||
* Useful if the data is an array of objects | ||
*/ | ||
value_path?: string; | ||
/** | ||
* The label to display in a dropdown | ||
* Useful if the data is an array of objects | ||
*/ | ||
label_path?: string; | ||
}; | ||
}; | ||
}; | ||
} | ||
@@ -243,2 +277,3 @@ export interface SchemaKeys { | ||
export type Permissions = PermissionValue[]; | ||
export type DataSource = Request | any[]; | ||
export {}; |
@@ -140,2 +140,7 @@ "use strict"; | ||
}, | ||
access: { | ||
privacy: "InviteRestricted", | ||
default_permissions: ["All"], | ||
users: [{ email: "mfcbone2@gmail.com" }], | ||
}, | ||
}; | ||
@@ -142,0 +147,0 @@ // This can be executed at build time |
{ | ||
"name": "@interweave/interweave", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -10,2 +10,3 @@ import { | ||
type Users, | ||
type DataSource, | ||
} from "./interfaces"; | ||
@@ -30,2 +31,3 @@ import { | ||
type Users, | ||
type DataSource, | ||
// From validate() | ||
@@ -32,0 +34,0 @@ type ValidateOptions, |
@@ -160,3 +160,3 @@ export interface Error { | ||
*/ | ||
data: any[] | Request; | ||
data: DataSource; | ||
/** | ||
@@ -218,3 +218,2 @@ * The unique identifier per entry | ||
error_path?: string; | ||
/** | ||
@@ -224,2 +223,37 @@ * If the request fails and error_path is empty, use this as the message | ||
default_error?: string; | ||
/** | ||
* If the url accepts a parameter | ||
*/ | ||
parameters?: { | ||
/** | ||
* Keys _not_ specified in the URL will be appended as query parameters | ||
* for example, a key of location will be appended as ?location=value | ||
*/ | ||
[key: string]: { | ||
schema: { | ||
type: "string" | "number" | "boolean"; | ||
is_optional?: boolean; | ||
is_array?: boolean; | ||
enum?: string[] | number[]; | ||
default_value?: any; | ||
}; | ||
options?: { | ||
/** | ||
* The source of the data | ||
*/ | ||
data: DataSource; | ||
/** | ||
* The unique identifier per entry | ||
* Useful if the data is an array of objects | ||
*/ | ||
value_path?: string; | ||
/** | ||
* The label to display in a dropdown | ||
* Useful if the data is an array of objects | ||
*/ | ||
label_path?: string; | ||
}; | ||
}; | ||
}; | ||
} | ||
@@ -274,1 +308,3 @@ | ||
export type Permissions = PermissionValue[]; | ||
export type DataSource = Request | any[]; |
88797
2.47%2498
3.18%