Type Definitions
AnyModelType
Properties
-
$stashku
Modeling.Configuration
<optional>
Source
BooleanByRequestMethod
Defines the boolean value used for a specific request method. If a specific method is undefined
the
all
property value will be used as a fallback.
Properties
-
all
Boolean
<optional>
The default value to use if an explicit request method is not specified on this object.
-
get
Boolean
<optional>
The value to use explicitly for GET requests.
-
post
Boolean
<optional>
The value to use explicitly for POST requests.
-
put
Boolean
<optional>
The value to use explicitly for PUT requests.
-
patch
Boolean
<optional>
The value to use explicitly for PATCH requests.
-
delete
Boolean
<optional>
The value to use explicitly for DELETE requests.
-
options
Boolean
<optional>
The value to use explicitly for OPTIONS requests.
Source
Configuration
The StashKu resource (name) that contains objects like this model.
Defines the resource name used for a model on specific request actions. If a specific action is undefined
the
all
property value will be used, otherwise the target resource will not be set automatically for the model under
a request of the undefined
action.
Properties
-
resource
String
|Modeling.StringByRequestMethod
The resource name of the model.
-
slug
String
|Modeling.StringByRequestMethod
<optional>
An optionally stored, singular, lower-kebab-case slugified representation of this model's name.
-
name
String
|Modeling.StringByRequestMethod
<optional>
An optionally stored, singular, PascalCase version of this model's name.
-
validations
Object.<String, (Array.<Modeling.ValidationCallback>|Modeling.ValidationCallback)>
<optional>
A validation object with keys optionally mapped to model properties.
-
plural
Object
<optional>
An optionally stored, plural form of the model's slug and name.
Source
PropertyDefinition
Properties
-
target
String
The target resource property/column/field for this model's property.
-
type
String
<optional>
The JavaScript type intended for the property value.
-
default
*
<optional>
The default value for this models property. This is used when a model type is generated and set in the model constructor.
-
omit
Boolean
|Modeling.BooleanByRequestMethod
|Modeling.PropertyOmitCallback
<optional>
false
If
true
, the property is ignored (not included) from processing in a request. If the value isnull
and the model instance value isnull
orundefined
, then it is omitted from being processed in the request. -
pk
Boolean
<optional>
false
Indicates the property is a primary-key identifier for the model.
-
transform
Modeling.PropertyTransformCallback
<optional>
A callback that allows for values to be transformed whenever objects are turned into a model, or the model is "unmodeled" into a regular object.
-
precision
Number
<optional>
The maximum amount of number places, including decimals that may be used. This property is not used by StashKu directly, but may be leveraged by certain engines.
-
radix
Number
<optional>
The number of decimal places. This property is not used by StashKu directly, but may be leveraged by certain engines.
-
charLength
Number
<optional>
The maximum amount of storable characters. This property is not used by StashKu directly, but may be leveraged by certain engines.
Source
PropertyOmitCallback(property, value, model, method, step) → {Boolean}
Parameters
-
property
String
The name of the property being ommitted.
-
value
*
The value of the property being ommitted.
-
model
*
The source object being modeled or unmodeled.
-
method
String
The method of the request being processed, either: "get", "post", "put", "patch", "delete", or "options".
-
step
String
Either "model" or "unmodel", depending on whether the transformation is occuring during modelling or unmodelling.
Returns
-
Boolean
Source
PropertyTransformCallback(property, value, model, method, step)
Parameters
-
property
String
The name of the property being transformed.
-
value
*
The value of the property being transformed.
-
model
*
The source object being modeled or unmodeled.
-
method
String
The method of the request being processed, either: "get", "post", "put", "patch", "delete", or "options".
-
step
String
Either "model" or "unmodel", depending on whether the transformation is occuring during modelling or unmodelling.
Source
StringByRequestMethod
Defines the string value used for a specific request method. If a specific method is undefined
the
all
property value will be used as a fallback.
Properties
-
all
String
<optional>
The default value to use if an explicit request method is not specified on this object.
-
get
String
<optional>
The value to use explicitly for GET requests.
-
post
String
<optional>
The value to use explicitly for POST requests.
-
put
String
<optional>
The value to use explicitly for PUT requests.
-
patch
String
<optional>
The value to use explicitly for PATCH requests.
-
delete
String
<optional>
The value to use explicitly for DELETE requests.
-
options
String
<optional>
The value to use explicitly for OPTIONS requests.
Source
Properties
-
model
AnyModelType
-
key
String
-
value
*
ValidationCallback() → {String}
Properties
-
model
AnyModelType
-
key
String
-
value
*
Returns
-
String