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

feat(ever-api): adding support for multiple databases #705

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
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
86 changes: 43 additions & 43 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ aliases:
sudo npm install --quiet node-gyp -g
sudo npm install cordova -g
sudo npm install ionic -g
sudo npm config set python /usr/bin/python
sudo npm config set python /usr/bin/python
- &install-chrome
name: Install Chrome
command: |
Expand All @@ -40,8 +40,8 @@ defaults: &defaults
# we define default work dir, however almost every job redefine it
working_directory: /tmp/workspace
environment:
JVM_OPTS: -Xmx3200m
ANDROID_HOME: /usr/local/android-sdk-linux
JVM_OPTS: -Xmx3200m
ANDROID_HOME: /usr/local/android-sdk-linux

jobs:
build-monorepo-root:
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
steps:
- checkout
- run: *install-deps
- run:
- run:
name: Install Yarn
command: sudo npm install -g yarn --force
- run: *install-gradle
Expand All @@ -178,27 +178,27 @@ jobs:
command: cd carrier/mobile-ionic && yarn ionic cordova platform rm android
- run:
name: Add new android platform
command: |
cd carrier/mobile-ionic
yarn ionic cordova platform add [email protected] --noresources
ionic config set -g telemetry true
# echo y | android update sdk --no-ui --all --filter tools,platform-tools,extra-google-m2repository,extra-google-google_play_services,extra-android-support,extra-android-m2repository,android-25
# echo y | android update sdk --no-ui --all --filter build-tools-25.0.0
command: |
cd carrier/mobile-ionic
yarn ionic cordova platform add [email protected] --noresources
ionic config set -g telemetry true
# echo y | android update sdk --no-ui --all --filter tools,platform-tools,extra-google-m2repository,extra-google-google_play_services,extra-android-support,extra-android-m2repository,android-25
# echo y | android update sdk --no-ui --all --filter build-tools-25.0.0
- run:
name: Run Cordova Build for Android (Debug)
command: |
cd carrier/mobile-ionic
yarn cordova:build
mkdir -p /tmp/apk
cp -r platforms/android/app/build/outputs/apk/debug/app-debug.apk /tmp/apk/carrier.apk
command: |
cd carrier/mobile-ionic
yarn cordova:build
mkdir -p /tmp/apk
cp -r platforms/android/app/build/outputs/apk/debug/app-debug.apk /tmp/apk/carrier.apk
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-carrier-mobile-ionic-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- store_artifacts:
path: /tmp/apk
destination: apks
destination: apks
- persist_to_workspace:
root: /tmp/workspace/carrier/mobile-ionic
paths:
Expand All @@ -211,10 +211,10 @@ jobs:
steps:
- checkout
- run: *install-deps
- run:
- run:
name: Install Yarn
command: sudo npm install -g yarn --force
- run: *install-gradle
- run: *install-gradle
- run:
name: 'Pull Submodules'
command: |
Expand All @@ -238,19 +238,19 @@ jobs:
command: cd shop/mobile-ionic && yarn ionic cordova platform rm android
- run:
name: Add new android platform
command: |
cd shop/mobile-ionic
yarn ionic cordova platform add [email protected] --noresources
ionic config set -g telemetry true
# echo y | android update sdk --no-ui --all --filter tools,platform-tools,extra-google-m2repository,extra-google-google_play_services,extra-android-support,extra-android-m2repository,android-25
# echo y | android update sdk --no-ui --all --filter build-tools-25.0.0
command: |
cd shop/mobile-ionic
yarn ionic cordova platform add [email protected] --noresources
ionic config set -g telemetry true
# echo y | android update sdk --no-ui --all --filter tools,platform-tools,extra-google-m2repository,extra-google-google_play_services,extra-android-support,extra-android-m2repository,android-25
# echo y | android update sdk --no-ui --all --filter build-tools-25.0.0
- run:
name: Run Cordova Build for Android (Debug)
command: |
cd shop/mobile-ionic
yarn cordova:build
mkdir -p /tmp/apk
cp -r platforms/android/app/build/outputs/apk/debug/app-debug.apk /tmp/apk/shop.apk
command: |
cd shop/mobile-ionic
yarn cordova:build
mkdir -p /tmp/apk
cp -r platforms/android/app/build/outputs/apk/debug/app-debug.apk /tmp/apk/shop.apk
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-shop-mobile-ionic-{{ checksum "yarn.lock" }}
Expand Down Expand Up @@ -304,15 +304,15 @@ jobs:
steps:
- checkout
- run: *install-deps
- run:
- run:
name: Install Yarn
command: sudo npm install -g yarn --force
- run: *install-gradle
- run:
name: 'Pull Submodules'
command: |
git submodule init
git submodule update --remote
git submodule update --remote
- restore_cache:
name: Restore Yarn Package Cache
keys:
Expand All @@ -331,19 +331,19 @@ jobs:
command: cd merchant/tablet-ionic && yarn ionic cordova platform rm android
- run:
name: Add new android platform
command: |
cd merchant/tablet-ionic
yarn ionic cordova platform add [email protected] --noresources
ionic config set -g telemetry true
# echo y | android update sdk --no-ui --all --filter tools,platform-tools,extra-google-m2repository,extra-google-google_play_services,extra-android-support,extra-android-m2repository,android-25
# echo y | android update sdk --no-ui --all --filter build-tools-25.0.0
command: |
cd merchant/tablet-ionic
yarn ionic cordova platform add [email protected] --noresources
ionic config set -g telemetry true
# echo y | android update sdk --no-ui --all --filter tools,platform-tools,extra-google-m2repository,extra-google-google_play_services,extra-android-support,extra-android-m2repository,android-25
# echo y | android update sdk --no-ui --all --filter build-tools-25.0.0
- run:
name: Run Cordova Build for Android (Debug)
command: |
cd merchant/tablet-ionic
yarn cordova:build
mkdir -p /tmp/apk
cp -r platforms/android/app/build/outputs/apk/debug/app-debug.apk /tmp/apk/merchant.apk
command: |
cd merchant/tablet-ionic
yarn cordova:build
mkdir -p /tmp/apk
cp -r platforms/android/app/build/outputs/apk/debug/app-debug.apk /tmp/apk/merchant.apk
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-merchant-tablet-ionic-{{ checksum "yarn.lock" }}
Expand All @@ -364,7 +364,7 @@ jobs:
steps:
- run: *install-deps
- run: *install-yarn
- run: *install-chrome
- run: *install-chrome
- attach_workspace:
at: /tmp/workspace/carrier/mobile-ionic
- run:
Expand Down
13 changes: 7 additions & 6 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,22 @@ You should have received a copy of the relevant GNU Licenses along with this pro

We suggest to check a great overview about different open-source licenses at <https://choosealicense.com/licenses>.
For example, for AGPL v3 (strongest copyleft license we use) conditions can be summarized as following:
- making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license.
- Copyright and license notices must be preserved
- Contributors provide an express grant of patent rights.
- When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available.

- making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license.
- Copyright and license notices must be preserved
- Contributors provide an express grant of patent rights.
- When a modified version is used to provide a service over a network, the complete source code of the modified version must be made available.

Feel free to [Contact Us](https://github.com/ever-co/ever#contact-us) for an additional information about used open-source licenses!

### _Ever Platform Small Business_ License

Ever® Platform Small Business™ License can be purchased by businesses with annual revenues do not exceed $1 million.
Ever® Platform Small Business™ License can be purchased by businesses with annual revenues do not exceed \$1 million.
For more information, please contact <mailto:[email protected]>.

### _Ever Platform Enterprise_ License

Ever® Platform Enterprise™ License can be purchased by businesses with more than $1 million in annual revenue.
Ever® Platform Enterprise™ License can be purchased by businesses with more than \$1 million in annual revenue.
For more information, please contact <mailto:[email protected]>.

## Credits
Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#### *** If you are running IT Company, check our new project [Gauzy](https://github.com/ever-co/gauzy) ***
#### **_ If you are running IT Company, check our new project [Gauzy](https://github.com/ever-co/gauzy) _**

[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/ever)
[![Gitter](https://badges.gitter.im/JoinChat.svg)](https://gitter.im/ever-co/ever?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Expand Down Expand Up @@ -155,12 +155,12 @@ See relevant section in our [documentation](https://github.com/ever-co/ever/wiki

Finally, each project from Ever Platform could start by single command from this list:

* Run API server `yarn run:server`
* Run Admin Website `yarn run:admin` and open http://localhost:4200
* Run Shopping Mobile App `yarn run:shopmobile` and open http://localhost:4201
* Run Merchant Ionic Tablet App `yarn run:merchant` and open http://localhost:4202
* Run Carrier Mobile app `yarn run:carrier` and open http://localhost:4203
* Run Shopping Website `yarn run:shopweb` and open http://localhost:3000
- Run API server `yarn run:server`
- Run Admin Website `yarn run:admin` and open http://localhost:4200
- Run Shopping Mobile App `yarn run:shopmobile` and open http://localhost:4201
- Run Merchant Ionic Tablet App `yarn run:merchant` and open http://localhost:4202
- Run Carrier Mobile app `yarn run:carrier` and open http://localhost:4203
- Run Shopping Website `yarn run:shopweb` and open http://localhost:3000

Note 1: during development you can run server with `yarn run:server:dev` to enable watch on TS files changes

Expand Down Expand Up @@ -237,9 +237,10 @@ In a production setup, all client-side to server-side (backend, APIs) communicat
## License

This software is available under following licenses:
- [Ever® Platform Community™ Edition](https://github.com/ever-co/ever/blob/master/LICENSE.md#ever-platform-community-edition-license)
- [Ever® Platform Small Business™](https://github.com/ever-co/ever/blob/master/LICENSE.md#ever-platform-small-business-license)
- [Ever® Platform Enterprise™](https://github.com/ever-co/ever/blob/master/LICENSE.md#ever-platform-enterprise-license)

- [Ever® Platform Community™ Edition](https://github.com/ever-co/ever/blob/master/LICENSE.md#ever-platform-community-edition-license)
- [Ever® Platform Small Business™](https://github.com/ever-co/ever/blob/master/LICENSE.md#ever-platform-small-business-license)
- [Ever® Platform Enterprise™](https://github.com/ever-co/ever/blob/master/LICENSE.md#ever-platform-enterprise-license)

#### The default Ever® Platform™ license, without a valid Ever® Platform Enterprise™ or Ever® Platform Small Business™ License agreement, is the Ever® Platform Community™ Edition License.

Expand Down Expand Up @@ -267,4 +268,4 @@ All other brand and product names are trademarks, registered trademarks or servi
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fever-co%2Fever.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fever-co%2Fever?ref=badge_shield)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io)

#### *** If you are running IT Company, check our new project [Gauzy](https://github.com/ever-co/gauzy) ***
#### **_ If you are running IT Company, check our new project [Gauzy](https://github.com/ever-co/gauzy) _**
21 changes: 11 additions & 10 deletions backend/api/src/@pyro/db-server/db-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,18 @@ export abstract class DBService<T extends DBObject<any, any>>
if (lastValue == null) {
throw new Error(".remove(objectId) error - Object don't exist");
} else {
this.existence.next({
id: objectId,
value: null,
lastValue,
type: ExistenceEventType.Removed
});
const callId = uuid();

this.log.info(
{ callId, objectId, lastValue },
'.remove(objectId) removed object'
);
this.log.info({ callId }, '.removeAll() called!');

try {
await this.Model.remove({}).exec();
} catch (err) {
this.log.error({ callId, err }, '.removeAll() thrown error!');
throw err;
}

this.log.info({ callId }, '.removeAll() removed all!');
}
}

Expand Down
Loading