Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add select fields, add toObject #45

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,4 @@ dist

.DS_store

# build files
/lib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want to commit lib folder

# build files
12 changes: 12 additions & 0 deletions .idea/admin-bro-mongoose.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

138 changes: 138 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Database from './src/database';
import Resource from './src/resource';
export { Database, Resource };
12 changes: 12 additions & 0 deletions lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions lib/src/database.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { BaseDatabase } from 'admin-bro';
declare class Database extends BaseDatabase {
private readonly connection;
constructor(connection: any);
static isAdapterFor(connection: any): boolean;
resources(): any;
}
export default Database;
21 changes: 21 additions & 0 deletions lib/src/database.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/src/database.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions lib/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @module @admin-bro/mongoose
* @subcategory Adapters
* @section modules
* @load ./index.doc.md
*/
export { default as Resource } from './resource';
export { default as Database } from './database';
17 changes: 17 additions & 0 deletions lib/src/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/src/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions lib/src/property.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { BaseProperty } from 'admin-bro';
declare class Property extends BaseProperty {
mongoosePath: any;
/**
* Crates an object from mongoose schema path
*
* @param {SchemaString} path
* @param {String[]} path.enumValues
* @param {String} path.regExp
* @param {String} path.path
* @param {String} path.instance
* @param {Object[]} path.validators
* @param {Object[]} path.setters
* @param {Object[]} path.getters
* @param {Object} path.options
* @param {Object} path._index
* @param {number} position
*
* @private
*
* @example
*
* const schema = new mongoose.Schema({
* email: String,
* })
*
* property = new Property(schema.paths.email))
*/
constructor(path: any, position?: number);
instanceToType(mongooseInstance: any): "string" | "number" | "boolean" | "datetime" | "mixed" | "reference" | "float";
name(): any;
isEditable(): boolean;
reference(): any;
isVisible(): boolean;
isId(): boolean;
availableValues(): any;
isArray(): boolean;
subProperties(): Property[];
type(): "string" | "number" | "boolean" | "datetime" | "mixed" | "reference" | "float";
isSortable(): boolean;
isRequired(): boolean;
}
export default Property;
Loading