mirror of https://gitee.com/bigwinds/arangodb
foxx -> foxx/legacy
This commit is contained in:
parent
0cfa0ed953
commit
54fb1a73d8
|
@ -27,12 +27,12 @@
|
|||
/// @author Copyright 2013, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
exports.Controller = require('@arangodb/foxx/controller').Controller;
|
||||
exports.Model = require('@arangodb/foxx/model').Model;
|
||||
exports.Repository = require('@arangodb/foxx/repository').Repository;
|
||||
exports.Controller = require('@arangodb/foxx/legacy/controller').Controller;
|
||||
exports.Model = require('@arangodb/foxx/legacy/model').Model;
|
||||
exports.Repository = require('@arangodb/foxx/legacy/repository').Repository;
|
||||
exports.createQuery = require('@arangodb/foxx/legacy/query').createQuery;
|
||||
exports.toJSONSchema = require('@arangodb/foxx/legacy/schema').toJSONSchema;
|
||||
exports.queues = require('@arangodb/foxx/queues');
|
||||
exports.createQuery = require('@arangodb/foxx/query').createQuery;
|
||||
exports.toJSONSchema = require('@arangodb/foxx/schema').toJSONSchema;
|
||||
|
||||
const manager = require('@arangodb/foxx/manager');
|
||||
|
||||
|
|
|
@ -27,11 +27,11 @@
|
|||
/// @author Copyright 2013, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const RequestContext = require('@arangodb/foxx/request_context');
|
||||
const BaseMiddleware = require('@arangodb/foxx/base_middleware').BaseMiddleware;
|
||||
const RequestContext = require('@arangodb/foxx/legacy/request_context');
|
||||
const BaseMiddleware = require('@arangodb/foxx/legacy/base_middleware').BaseMiddleware;
|
||||
const _ = require('lodash');
|
||||
const is = require('@arangodb/is');
|
||||
const internal = require('@arangodb/foxx/internals');
|
||||
const internal = require('@arangodb/foxx/legacy/internals');
|
||||
const swagger = require('@arangodb/foxx/swagger');
|
||||
|
||||
|
||||
|
@ -41,7 +41,7 @@ var authControllerProps = {
|
|||
/// @brief Get the users of this controller
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
getUsers() {
|
||||
const foxxAuthentication = require('@arangodb/foxx/authentication');
|
||||
const foxxAuthentication = require('@arangodb/foxx/legacy/authentication');
|
||||
return new foxxAuthentication.Users(this.applicationContext);
|
||||
},
|
||||
|
||||
|
@ -57,7 +57,7 @@ var authControllerProps = {
|
|||
/// @brief was docuBlock JSF_foxx_controller_login
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
login(route, opts) {
|
||||
var authentication = require('@arangodb/foxx/authentication');
|
||||
var authentication = require('@arangodb/foxx/legacy/authentication');
|
||||
return this.post(route, authentication.createStandardLoginHandler(this.getAuth(), this.getUsers(), opts));
|
||||
},
|
||||
|
||||
|
@ -65,7 +65,7 @@ var authControllerProps = {
|
|||
/// @brief was docuBlock JSF_foxx_controller_logout
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
logout(route, opts) {
|
||||
var authentication = require('@arangodb/foxx/authentication');
|
||||
var authentication = require('@arangodb/foxx/legacy/authentication');
|
||||
return this.post(route, authentication.createStandardLogoutHandler(this.getAuth(), opts));
|
||||
},
|
||||
|
||||
|
@ -73,7 +73,7 @@ var authControllerProps = {
|
|||
/// @brief was docuBlock JSF_foxx_controller_register
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
register(route, opts) {
|
||||
var authentication = require('@arangodb/foxx/authentication');
|
||||
var authentication = require('@arangodb/foxx/legacy/authentication');
|
||||
return this.post(
|
||||
route,
|
||||
authentication.createStandardRegistrationHandler(this.getAuth(), this.getUsers(), opts)
|
||||
|
@ -84,7 +84,7 @@ var authControllerProps = {
|
|||
/// @brief was docuBlock JSF_foxx_controller_changePassword
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
changePassword(route, opts) {
|
||||
var authentication = require('@arangodb/foxx/authentication');
|
||||
var authentication = require('@arangodb/foxx/legacy/authentication');
|
||||
return this.post(route, authentication.createStandardChangePasswordHandler(this.getUsers(), opts));
|
||||
}
|
||||
};
|
||||
|
@ -110,7 +110,7 @@ var sessionControllerProps = {
|
|||
if (!method || typeof this[method] !== 'function') {
|
||||
method = 'post';
|
||||
}
|
||||
var sessions = require('@arangodb/foxx/sessions');
|
||||
var sessions = require('@arangodb/foxx/legacy/sessions');
|
||||
return this[method](route, sessions.createDestroySessionHandler(this.getSessions(), opts));
|
||||
}
|
||||
};
|
||||
|
@ -347,7 +347,7 @@ class Controller {
|
|||
/// @brief was docuBlock JSF_foxx_controller_activateAuthentication
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
activateAuthentication(opts) {
|
||||
var authentication = require('@arangodb/foxx/authentication');
|
||||
var authentication = require('@arangodb/foxx/legacy/authentication');
|
||||
_.extend(this, authControllerProps);
|
||||
|
||||
this.auth = authentication.createAuthObject(this.applicationContext, opts);
|
||||
|
@ -360,7 +360,7 @@ class Controller {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
activateSessions(opts) {
|
||||
var sessions = require('@arangodb/foxx/sessions');
|
||||
var sessions = require('@arangodb/foxx/legacy/sessions');
|
||||
_.extend(this, sessionControllerProps);
|
||||
|
||||
this.sessions = new sessions.Sessions(opts);
|
|
@ -30,7 +30,7 @@
|
|||
const _ = require('lodash');
|
||||
const joi = require('joi');
|
||||
const is = require('@arangodb/is');
|
||||
const toJSONSchema = require('@arangodb/foxx/schema').toJSONSchema;
|
||||
const toJSONSchema = require('@arangodb/foxx/legacy/schema').toJSONSchema;
|
||||
const extend = require('@arangodb/extend').extend;
|
||||
const EventEmitter = require('events').EventEmitter;
|
||||
const metadataSchema = {
|
|
@ -27,7 +27,7 @@
|
|||
/// @author Copyright 2013, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const Model = require('@arangodb/foxx/model').Model;
|
||||
const Model = require('@arangodb/foxx/legacy/model').Model;
|
||||
const _ = require('lodash');
|
||||
const extend = require('@arangodb/extend').extend;
|
||||
const EventEmitter = require('events').EventEmitter;
|
|
@ -28,14 +28,14 @@
|
|||
/// @author Copyright 2013, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const SwaggerDocs = require('@arangodb/foxx/swaggerDocs').Docs;
|
||||
const SwaggerDocs = require('@arangodb/foxx/legacy/swaggerDocs').Docs;
|
||||
const joi = require('joi');
|
||||
const _ = require('lodash');
|
||||
const internal = require('@arangodb/foxx/internals');
|
||||
const toJSONSchema = require('@arangodb/foxx/schema').toJSONSchema;
|
||||
const internal = require('@arangodb/foxx/legacy/internals');
|
||||
const toJSONSchema = require('@arangodb/foxx/legacy/schema').toJSONSchema;
|
||||
const is = require('@arangodb/is');
|
||||
const UnprocessableEntity = require('http-errors').UnprocessableEntity;
|
||||
const UnauthorizedError = require('@arangodb/foxx/authentication').UnauthorizedError;
|
||||
const UnauthorizedError = require('@arangodb/foxx/legacy/authentication').UnauthorizedError;
|
||||
|
||||
function createBodyParamExtractor(rootElement, paramName, allowInvalid) {
|
||||
var extractElement;
|
|
@ -44,7 +44,7 @@ function toJSONSchema(id, schema) {
|
|||
if (
|
||||
typeof schema.toJSONSchema === 'function' &&
|
||||
schema.toJSONSchema !== toJSONSchema &&
|
||||
schema.toJSONSchema !== require('@arangodb/foxx/model').Model.toJSONSchema
|
||||
schema.toJSONSchema !== require('@arangodb/foxx/legacy/model').Model.toJSONSchema
|
||||
) {
|
||||
// allow overriding toJSONSchema.
|
||||
return schema.toJSONSchema(id);
|
|
@ -36,7 +36,7 @@ function BaseMiddlewareSpec () {
|
|||
|
||||
return {
|
||||
setUp: function () {
|
||||
baseMiddleware = require("@arangodb/foxx/base_middleware").BaseMiddleware().functionRepresentation;
|
||||
baseMiddleware = require("@arangodb/foxx/legacy/base_middleware").BaseMiddleware().functionRepresentation;
|
||||
request = {};
|
||||
response = {};
|
||||
options = {};
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
var sinon = require('sinon');
|
||||
var expect = require('expect.js');
|
||||
var FoxxRepository = require("@arangodb/foxx/repository").Repository;
|
||||
var Model = require("@arangodb/foxx/model").Model;
|
||||
var FoxxRepository = require("@arangodb/foxx/legacy/repository").Repository;
|
||||
var Model = require("@arangodb/foxx/legacy/model").Model;
|
||||
|
||||
describe('Model Events', function () {
|
||||
var collection, instance, repository;
|
|
@ -38,7 +38,7 @@ function ModelSpec () {
|
|||
|
||||
return {
|
||||
setUp: function () {
|
||||
FoxxModel = require('@arangodb/foxx/model').Model;
|
||||
FoxxModel = require('@arangodb/foxx/legacy/model').Model;
|
||||
},
|
||||
|
||||
testWithInitialData: function () {
|
||||
|
@ -317,7 +317,7 @@ function ModelDBSpec () {
|
|||
|
||||
return {
|
||||
setUp: function () {
|
||||
FoxxModel = require('@arangodb/foxx/model').Model;
|
||||
FoxxModel = require('@arangodb/foxx/legacy/model').Model;
|
||||
|
||||
cn = "UnitTestsFoxxModel";
|
||||
db._drop(cn);
|
||||
|
@ -422,8 +422,8 @@ function ModelAnnotationSpec () {
|
|||
|
||||
return {
|
||||
setUp: function () {
|
||||
FoxxModel = require('@arangodb/foxx/model').Model;
|
||||
toJSONSchema = require('@arangodb/foxx/schema').toJSONSchema;
|
||||
FoxxModel = require('@arangodb/foxx/legacy/model').Model;
|
||||
toJSONSchema = require('@arangodb/foxx/legacy/schema').toJSONSchema;
|
||||
},
|
||||
|
||||
testGetEmptyJSONSchema: function () {
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
const expect = require('chai').expect;
|
||||
const sinon = require('sinon');
|
||||
const createQuery = require('@arangodb/foxx/query').createQuery;
|
||||
const createQuery = require('@arangodb/foxx/legacy/query').createQuery;
|
||||
const arangodb = require('@arangodb');
|
||||
const db = arangodb.db;
|
||||
const ArangoError = arangodb.ArangoError;
|
|
@ -30,8 +30,8 @@
|
|||
|
||||
const expect = require('chai').expect;
|
||||
const sinon = require('sinon');
|
||||
const FoxxRepository = require('@arangodb/foxx/repository').Repository;
|
||||
const FoxxModel = require('@arangodb/foxx/model').Model;
|
||||
const FoxxRepository = require('@arangodb/foxx/legacy/repository').Repository;
|
||||
const FoxxModel = require('@arangodb/foxx/legacy/model').Model;
|
||||
|
||||
describe('Repository Events', function () {
|
||||
let collection, Model;
|
|
@ -30,8 +30,8 @@
|
|||
|
||||
const expect = require('chai').expect;
|
||||
const sinon = require('sinon');
|
||||
const FoxxRepository = require('@arangodb/foxx/repository').Repository;
|
||||
const Model = require('@arangodb/foxx/model').Model;
|
||||
const FoxxRepository = require('@arangodb/foxx/legacy/repository').Repository;
|
||||
const Model = require('@arangodb/foxx/legacy/model').Model;
|
||||
|
||||
describe('Model Events', function () {
|
||||
let collection, instance, repository;
|
|
@ -31,8 +31,8 @@
|
|||
|
||||
const expect = require('chai').expect;
|
||||
const sinon = require('sinon');
|
||||
const FoxxRepository = require('@arangodb/foxx/repository').Repository;
|
||||
const FoxxModel = require('@arangodb/foxx/model').Model;
|
||||
const FoxxRepository = require('@arangodb/foxx/legacy/repository').Repository;
|
||||
const FoxxModel = require('@arangodb/foxx/legacy/model').Model;
|
||||
|
||||
describe('Repository', function () {
|
||||
const prefix = 'myApp';
|
|
@ -42,7 +42,7 @@ function TemplateMiddlewareSpec () {
|
|||
response = {};
|
||||
options = {};
|
||||
next = function () {};
|
||||
TemplateMiddleware = require("@arangodb/foxx/template_middleware").TemplateMiddleware;
|
||||
TemplateMiddleware = require("@arangodb/foxx/legacy/template_middleware").TemplateMiddleware;
|
||||
db._drop("templateTest");
|
||||
templateCollection = db._create("templateTest");
|
||||
},
|
|
@ -35,7 +35,7 @@ var stub,
|
|||
FunctionStub,
|
||||
mockConstructor,
|
||||
joi = require("joi"),
|
||||
transformRoute = require("@arangodb/foxx/routing").__test_transformControllerToRoute,
|
||||
transformRoute = require("@arangodb/foxx/legacy/routing").__test_transformControllerToRoute,
|
||||
_ = require("lodash");
|
||||
|
||||
// Sorry for Yak Shaving. But I can't take it anymore.
|
||||
|
|
Loading…
Reference in New Issue