UNPKG

gpii-universal

Version:

Cross platform, core components of the GPII personalization infrastructure.

54 lines (46 loc) 1.69 kB
/*! Copyright 2017 OCAD university Licensed under the New BSD license. You may not use this file except in compliance with this License. You may obtain a copy of the License at https://github.com/GPII/universal/blob/master/LICENSE.txt */ "use strict"; var fluid = fluid || require("infusion"); var gpii = fluid.registerNamespace("gpii"); fluid.registerNamespace("gpii.dbOperation"); // The current version of schemas that document structures correspond with. gpii.dbOperation.schemaVersion = "0.2"; // All doc types used for saving different documents into CouchDB // See [GPII Data Model](https://wiki.gpii.net/w/Keys,_KeyTokens,_and_Preferences#Data_Model) // regarding accepted fields for each document type. gpii.dbOperation.docTypes = fluid.freezeRecursive({ gpiiKey: "gpiiKey", prefsSafe: "prefsSafe", clientCredential: "clientCredential", gpiiAppInstallationClient: "gpiiAppInstallationClient", gpiiAppInstallationAuthorization: "gpiiAppInstallationAuthorization" }); // All error details that the dbOperation module reports. gpii.dbOperation.errors = fluid.freezeRecursive({ missingInput: { message: "The input field \"%fieldName\" was undefined", statusCode: 400, isError: true }, missingDoc: { message: "A record of type \"%docType\" was not found", statusCode: 400, isError: true }, mismatchedDocType: { message: "The document type must be \"%docType\" instead of the selected document type \"%selectedDocType\"", statusCode: 400, isError: true }, unauthorized: { message: "Unauthorized", statusCode: 401, isError: true } });