@cocreate/crud-server 1.22.3 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/automated.yml +38 -11
- package/CHANGELOG.md +19 -0
- package/CoCreate.config.js +3 -5
- package/package.json +8 -4
- package/src/index.js +13 -3
|
@@ -42,15 +42,42 @@ jobs:
|
|
|
42
42
|
new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
|
|
43
43
|
new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
upload:
|
|
46
|
+
runs-on: ubuntu-latest
|
|
47
|
+
|
|
48
|
+
steps:
|
|
49
|
+
- name: Checkout
|
|
50
|
+
uses: actions/checkout@v3
|
|
51
|
+
|
|
52
|
+
- name: Setup Node.js
|
|
53
|
+
uses: actions/setup-node@v3
|
|
54
|
+
with:
|
|
55
|
+
node-version: 16
|
|
56
|
+
|
|
57
|
+
- name: Get Environment Variables
|
|
58
|
+
run: |
|
|
59
|
+
echo "organization_id=${{ secrets.COCREATE_ORGANIZATION_ID }}" >> $GITHUB_ENV
|
|
60
|
+
echo "key=${{ secrets.COCREATE_KEY }}" >> $GITHUB_ENV
|
|
61
|
+
echo "host=${{ secrets.COCREATE_HOST }}" >> $GITHUB_ENV
|
|
62
|
+
|
|
63
|
+
- name: Install @cocreate/cli
|
|
64
|
+
run: npm install -g @cocreate/cli
|
|
65
|
+
|
|
66
|
+
- name: CoCreate CLI Upload
|
|
67
|
+
run: coc upload
|
|
54
68
|
|
|
55
|
-
|
|
56
|
-
|
|
69
|
+
# docs:
|
|
70
|
+
# runs-on: ubuntu-latest
|
|
71
|
+
# steps:
|
|
72
|
+
# - name: Checkout
|
|
73
|
+
# uses: actions/checkout@v3
|
|
74
|
+
# - name: setup nodejs
|
|
75
|
+
# uses: actions/setup-node@v3
|
|
76
|
+
# with:
|
|
77
|
+
# node-version: 16
|
|
78
|
+
# - name: update documentation
|
|
79
|
+
# uses: CoCreate-app/CoCreate-docs@master
|
|
80
|
+
# env:
|
|
81
|
+
# organization_id: ${{ secrets.COCREATE_ORGANIZATION_ID }}
|
|
82
|
+
# key: ${{ secrets.COCREATE_KEY }}
|
|
83
|
+
# host: ${{ secrets.COCREATE_HOST }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [1.23.0](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.22.4...v1.23.0) (2023-06-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Update dependencies versions for [@cocreate](https://github.com/cocreate) libraries ([37bc497](https://github.com/CoCreate-app/CoCreate-crud-server/commit/37bc49757ecf2204b7b2fe6ff3910fd6bc3ad42f))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add CLI prompts for "organization_id" and "db" string ([e665b47](https://github.com/CoCreate-app/CoCreate-crud-server/commit/e665b47ccdefb39499510c76101fbf6f62eac5ef))
|
|
12
|
+
|
|
13
|
+
## [1.22.4](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.22.3...v1.22.4) (2023-06-04)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* Refactor CoCreate.config.js to remove hard-coded credentials ([04dd637](https://github.com/CoCreate-app/CoCreate-crud-server/commit/04dd637505bb4b6d167f94d12f5fc475ebff2cb1))
|
|
19
|
+
|
|
1
20
|
## [1.22.3](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.22.2...v1.22.3) (2023-06-04)
|
|
2
21
|
|
|
3
22
|
|
package/CoCreate.config.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"host": "general.cocreate.app"
|
|
6
|
-
},
|
|
2
|
+
"organization_id": "",
|
|
3
|
+
"key": "",
|
|
4
|
+
"host": "",
|
|
7
5
|
"sources": [
|
|
8
6
|
{
|
|
9
7
|
"collection": "files",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/crud-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.0",
|
|
4
4
|
"description": "CoCreate-crud-server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cocreate-crud",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"scripts": {
|
|
27
27
|
"demo": "PORT=5000 node demo/server.js",
|
|
28
28
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
29
|
-
"docs": "node ./node_modules/@cocreate/docs/src/index.js"
|
|
29
|
+
"docs": "node ./node_modules/@cocreate/docs/src/index.js",
|
|
30
|
+
"postinstall": "node ./node_modules/@cocreate/cli/check-coc.js"
|
|
30
31
|
},
|
|
31
32
|
"main": "./src/index",
|
|
32
33
|
"repository": {
|
|
@@ -39,9 +40,12 @@
|
|
|
39
40
|
"url": "https://github.com/CoCreate-app/CoCreate-crud-server/issues"
|
|
40
41
|
},
|
|
41
42
|
"homepage": "https://cocreate.app/docs/CoCreate-crud-server",
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@cocreate/cli": "^1.29.3"
|
|
45
|
+
},
|
|
42
46
|
"dependencies": {
|
|
43
|
-
"@cocreate/docs": "^1.
|
|
44
|
-
"@cocreate/utils": "^1.21.
|
|
47
|
+
"@cocreate/docs": "^1.8.13",
|
|
48
|
+
"@cocreate/utils": "^1.21.3",
|
|
45
49
|
"csvtojson": "^2.0.10",
|
|
46
50
|
"json-2-csv": "^3.10.3"
|
|
47
51
|
}
|
package/src/index.js
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const { ObjectId, searchData, sortData } = require("@cocreate/utils");
|
|
4
|
+
const { config } = require('@cocreate/cli')
|
|
4
5
|
|
|
5
6
|
class CoCreateCrudServer {
|
|
6
|
-
constructor(wsManager, databases
|
|
7
|
+
constructor(wsManager, databases) {
|
|
7
8
|
this.wsManager = wsManager
|
|
8
9
|
this.databases = databases
|
|
9
|
-
this.db = db
|
|
10
10
|
this.ObjectId = ObjectId
|
|
11
11
|
this.dbUrls = new Map();
|
|
12
|
+
config([
|
|
13
|
+
{
|
|
14
|
+
key: 'organization_id',
|
|
15
|
+
prompt: 'Enter your organization_id: ',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
key: 'db',
|
|
19
|
+
prompt: 'Enter your db object as json.string: ',
|
|
20
|
+
}
|
|
21
|
+
])//
|
|
12
22
|
this.init();
|
|
13
23
|
}
|
|
14
24
|
|
|
@@ -106,7 +116,7 @@ class CoCreateCrudServer {
|
|
|
106
116
|
|
|
107
117
|
if (!dbUrl) {
|
|
108
118
|
if (data.organization_id === process.env.organization_id) {
|
|
109
|
-
dbUrl =
|
|
119
|
+
dbUrl = process.env.db
|
|
110
120
|
this.dbUrls.set(data.organization_id, dbUrl)
|
|
111
121
|
} else {
|
|
112
122
|
let organization = await this.readDocument({
|