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