Used for mixins
@AuthenticatorPlugin decorates AuthAuthentication plugin classes. These classes should
										have the following shape:
										`
										@AuthenticatorPlugin()
									export class AuthAudience {
constructor(private handlers: Handler[]) { }
  authenticate(req: Request, res: Response, next: NextFunction) {
									// do auth checks here. Throw if
									}
									}
								`
When a string is provided, this sets the IDbOptions.field.
Used by the framework to reflect on the @Db properties defined.
Decorates properties in an @Model class to describe how a property will be marshaled to json
									(Model.toJson) and from json (Model.fromJson).
You can apply multiple @Json decorators to a property with different contexts. If the same context
								is applied more than once, the latter wins.
import {Model, Json} from '@sakuraapi/api';
@Model()
class User {
   @Json('fn')
   firstName: string = 'John';
   
   @Json('ln')
   lastName: string = 'Adams';
}
								This will cause user.toJson() to return:
{
   "fn":"John",
   "ln":"Adams"
}
								And User.fromJson(json) will map the json object back to an instantiated User.
sets IJsonOptions.field when a string is passed.
Sets the context under which this @Json applies (see IJsonOptions.context)
Returns a function that is used internally by the framework.
Decorator applied to classes that represent models for SakuraApi.
@Model()
class User {
   firstName: string = '';
   lastName: string = '';
}
								@Model injects functions that are used by SakuraApi, but can also be used by the
								integrator. Injected functions include:
@Routable's instance of SakuraApi that was injected during SakuraApi construction@Routable's SakuraApi config (this is a shortcut to sapi.config)Injected functions can be changed to point to a custom function references without breaking SakuraApi. They're mapped for the integrators convenience. If the integrator wants to actually change the underlying behavior that SakuraApi uses, then the new function should be assigned to the appropriate symbol (modelSymbols).
Decorates a Model property and signals SakuraApi to not include that property when generating a json representation of the model.
You can include multiple @Private decorators to a property with different contexts.
@Model() class User { @Private() password: string = ''; }
Sets the context under which this @Json applies (see IJsonOptions.context)
Decorator applied to classes that represent routing logic for SakuraApi.
import sapi from '../index'; // your app's reference to its instance of SakuraApi @Routable({ baseUrl: 'users' }) class User { @Route({ path: ':id'. method: 'get' }) getUser(req, res) { res.status(OK).json(someModel.toJson()); } }
The above example creates a routable class called User that has one route, users/:id, which responds to GET
								requests.
Injection of properties and other stuff of interest: Static:
Decorator applied to methods within an @Routable decorated class that designates that method as a route handler.
By default, a route that isn't provided a [[RoutableMethodOptions.method]] option, will default to GET. The
								[[RoutableMethodOptions.path]] defaults to ''.
See Routable for an example of how to use @Route.
Integrators should extend their Injectables with this Mixin to get type checking
class SuperChicken extends SapiInjectableMixin() {
}
								See SapiModelMixin for more information.
Integrators should extend their Models with this Mixin to get type checking.
class SuperChicken extends SapiModelMixins() {
}
								If your class inherits from a base class, you can:
class SuperChicken extends SapiModelMixins(BaseClass) {
}
								You can override an injected method like this:
class SuperChicken extends SapiModelMixins(BaseClass) {
}
(SuperChicken as any).getById(id:string | ObjectID, project?:any) => Promise {
...
}
(SuperChicken as any).prototype.remove(filter: any | null, options?: CommonOptions) => Promise {
...
}
  
								Just remember to stick to the interface in case SakuraAPI is calling the method being overriden internally.
Integrators should extend their Models with this Mixin to get type checking.
class SuperChicken extends SapiRoutableMixin() {
}
									See SapiModelMixin for more details.
See: insertOne
The optional context to use for things like @BeforeSave or @BeforeCreate
See: insertOneWriteOpCallback.
Decrypts a value like .fromJson would. Use this when dealing with a single encrypted value like an Id
									that originates from a .toJson object that is being passed back as a query string parameter.
Throws DecryptError if the cipher text provided is invalid.
the encrypted value
they secret key
the unencrypted value
Encrypts a value like toJson. Use this when you need to take a single value and send it back to the client
									so that you don't have to use .toJson.
the value to encrypt
they secret key
the encrypted value
The document returned from the Db.
An optional IFromDbOptions object
Returns an instantiated object which is an instance of the Model's class. Returns null
							if the json parameter is null, undefined or not an object.
Returns an array of instantiated objects which are instances of the Model's class. Returns
							null if the jsons parameter is null, undefined, or not an Array.
The json object to be unmarshaled into an @Model object.
The optional context to use for marshalling a model from JSON. See IJsonOptions.context.
any Returns an instantiated Model from the provided json. Returns null if the json parameter is null,
							undefined, or not an object.
The json object to be transformed.
The optional context to use for marshalling a model from JSON. See IJsonOptions.context.
json object with fields mapped from json fields to db fields.
Returns a Promise that resolves with an array of instantiated Model objects based on the documents returned from the database using MongoDB's find method. Returns an empty array if no matches are found in the database.
By default, when you provide the optional model property to IRoutableOptions in the Routable parameters,
										SakuraApi creates a route for GET {modelName}/ that returns an array of documents for that model or
									for GET baseUrl/ if Routable has a baseUrl defined.
You can constrain the results by providing one or more of the following query string parameters:
where and fields must be valid json strings.
For example:
								http://localhost/someModelName?where={"fn":"John", "ln":"Doe"}&fields={fn:0, ln:1}&limit=1&skip=0
This would return all documents where fn is 'John' and ln is 'Doe'. It would further limit the resulting fields
								to just fn and it would only return 1 result, after skipping 0 of the results.
The field names for where and fields are the @Json mapped names, so as to not expose internal names to the
									client. You cannot include fields that are marked @Db(private:true) since these will not be marshalled
								to json for the results.
fields follows the same rules as (MongoDB field
								projection)[https://docs.mongodb.com/manual/reference/glossary/#term-projection]
where queries are stripped of any $where fields. Giving the client the direct ability to define $where
								queries is a bad idea. If you want to do this, you'll have to implement your own route handler.
The id of the document in the database.
The fields to project (all if not supplied).
MongoDB Collation Document.
Returns a Promise that resolves with an instantiated Model object. Returns null if the record is not found in the Db.
A MongoDb query.
The fields to project (all if not supplied).
MongoDB Collation Document.
the document's id in the database.
The fields to project (all if not supplied).
MongoDB Collation Document.
Used internally by the Dependency Injection System.
A MongoDb query.
The fields to project (all if nto supplied).
MongoDB Collation Document.
Returns a Promise that resolves with an instantiated Model object. Returns null if the record is not found in the Db.
By default, when you provide the optional model property to IRoutableOptions in the Routable parameters,
										SakuraApi creates a route for GET {modelName}/:id that returns an either that document as a model or null if
									nothing is found.
You an constrain the results by providing a fields query string parameter.
fields follows the same rules as (MongoDB field
								projection)[https://docs.mongodb.com/manual/reference/glossary/#term-projection]
Takes a JSON parsable query string that is either an IProjection object, or a projection array.
Array projections follow these formatting rules:
['-id']['-id', '-name']['-subDocument.firstName'] or ['-subDocument.name.firstName']['id'] (remember, this follows the rules of an IProjection (see toJson)['id', 'name']['subDocument.firstName'] or ['subDocument.name.firstName']MongoDB CommonOptions
A MongoDB query.
MongoDB CommonOptions
CommonOptions
Expects properties to already be mapped to db field names. Limits the update to just the fields included in the changeset. For example a changeset of:
{
    firstName: "George"
}
											would cause only the firstName field to be updated. If the changeSet parameter is not provided,
										save will assume the entire Model is the changeset (obeying the various decorators like Db).
									The MongoDB ReplaceOneOptions. If you want to set this, but not the set, then pass null into set.
The optional context to use for things like @BeforeSave or @BeforeCreate
The change set. For example:
{
    firstName: "George"
}
											This change set would cause only the firstName field to be updated. If the set parameter is not provided,
										toDb will assume the entire Model is the change set (obeying the various decorators like Db).
										Nested objects are supported. Each property that is an object (except for ObjectID properties) needs to have its
											own class declared. The properties classes that represent sub-documents, obey the @Db and @Json decorator
										rules.
The optional context to use for marshalling a model from JSON. See IJsonOptions.context.
returns a JSON representation of the Model on which .toJson was called
See JavaScript's standard JSON.stringify.
See JavaScript's standard JSON.stringify.
For internal use. Do not rely on this - it can change at any time.
The symbols used by Reflect to store @Db() metadata for use by @[[Module]].
A collection of symbols used internally by Model.
The symbols used by Routable decorated objects
Generated using TypeDoc
Used by [[Authenticator]]