@cocreate/organizations 1.19.1 → 1.20.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.
@@ -41,30 +41,4 @@ jobs:
41
41
  outputs:
42
42
  new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
43
43
  new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
44
- upload:
45
- runs-on: ubuntu-latest
46
- needs: release
47
- if: needs.release.outputs.new_release_published == 'true'
48
- env:
49
- VERSION: "${{ needs.release.outputs.new_release_version }}"
50
- steps:
51
- - name: Checkout
52
- uses: actions/checkout@v3
53
- - name: Setup Node.js
54
- uses: actions/setup-node@v3
55
- with:
56
- node-version: 16
57
- - name: Set npm registry auth
58
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
59
- - name: Install dependencies
60
- run: yarn install
61
- - name: Build
62
- run: yarn build
63
- - name: Set Environment Variables
64
- run: |
65
- echo "organization_id=${{ secrets.COCREATE_ORGANIZATION_ID }}" >> $GITHUB_ENV
66
- echo "key=${{ secrets.COCREATE_KEY }}" >> $GITHUB_ENV
67
- echo "host=${{ secrets.COCREATE_HOST }}" >> $GITHUB_ENV
68
- - name: CoCreate Upload
69
- run: coc upload
70
44
 
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [1.20.0](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.19.2...v1.20.0) (2023-09-19)
2
+
3
+
4
+ ### Features
5
+
6
+ * bump dependencies for there latest features ([ff4380e](https://github.com/CoCreate-app/CoCreate-organizations/commit/ff4380e59aea018c44ff00310c60b24551c65d31))
7
+
8
+ ## [1.19.2](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.19.1...v1.19.2) (2023-09-19)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * conflict with config.key and apikey ([5f2c3d9](https://github.com/CoCreate-app/CoCreate-organizations/commit/5f2c3d9b553ff5ca7dac356ea96957396c5d081d))
14
+
1
15
  ## [1.19.1](https://github.com/CoCreate-app/CoCreate-organizations/compare/v1.19.0...v1.19.1) (2023-09-18)
2
16
 
3
17
 
@@ -1,24 +1,24 @@
1
- module.exports = {
2
- "organization_id": "",
3
- "key": "",
4
- "host": "",
5
- "sources": [
6
- {
7
- "array": "files",
8
- "object": {
9
- "_id": "60207e303c260207bf49cab8",
10
- "name": "index.html",
11
- "path": "/docs/organizations",
12
- "pathname": "/docs/organizations/index.html",
13
- "src": "{{./docs/index.html}}",
14
- "host": [
15
- "*",
16
- "general.cocreate.app"
17
- ],
18
- "directory": "organizations",
19
- "content-type": "{{content-type}}",
20
- "public": "true"
21
- }
22
- }
23
- ]
24
- }
1
+ module.exports = {
2
+ "organization_id": "",
3
+ "key": "",
4
+ "host": "",
5
+ "sources": [
6
+ {
7
+ "array": "files",
8
+ "object": {
9
+ "_id": "60207e303c260207bf49cab8",
10
+ "name": "index.html",
11
+ "path": "/docs/organizations",
12
+ "pathname": "/docs/organizations/index.html",
13
+ "src": "{{./docs/index.html}}",
14
+ "host": [
15
+ "*",
16
+ "general.cocreate.app"
17
+ ],
18
+ "directory": "organizations",
19
+ "content-type": "{{content-type}}",
20
+ "public": "true"
21
+ }
22
+ }
23
+ ]
24
+ };
package/docs/index.html CHANGED
@@ -351,7 +351,6 @@
351
351
  </button>
352
352
  </main>
353
353
 
354
- <script src="./apikey.js"></script>
355
354
  <script src="https://CoCreate.app/dist/CoCreate.js"></script>
356
355
  </body>
357
356
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/organizations",
3
- "version": "1.19.1",
3
+ "version": "1.20.0",
4
4
  "description": "A simple organizations component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "organizations",
@@ -58,8 +58,8 @@
58
58
  "webpack-log": "^3.0.1"
59
59
  },
60
60
  "dependencies": {
61
- "@cocreate/actions": "^1.11.1",
62
- "@cocreate/crud-client": "^1.25.0",
63
- "@cocreate/elements": "^1.21.0"
61
+ "@cocreate/actions": "^1.11.2",
62
+ "@cocreate/crud-client": "^1.25.1",
63
+ "@cocreate/elements": "^1.21.1"
64
64
  }
65
65
  }
package/src/client.js CHANGED
@@ -5,11 +5,11 @@ import Elements from '@cocreate/elements';
5
5
 
6
6
  async function generateDB(organization = { object: {} }, user = { object: {} }) {
7
7
  const organization_id = organization.object._id || Crud.ObjectId();
8
- const defaultKey = organization.object.key || uuid.generate();
8
+ const apikey = organization.object.key || uuid.generate();
9
9
  const user_id = user.object._id || Crud.ObjectId();
10
10
 
11
- let apiKey = await Crud.send({ method: 'create.object', database: organization_id, array: 'keys', organization_id })
12
- if (apiKey && apiKey.object && apiKey.object[0])
11
+ let hasApiKey = await Crud.send({ method: 'read.object', database: organization_id, array: 'keys', organization_id })
12
+ if (hasApiKey && hasApiKey.object && hasApiKey.object[0])
13
13
  return
14
14
 
15
15
  try {
@@ -43,7 +43,7 @@ async function generateDB(organization = { object: {} }, user = { object: {} })
43
43
  object: {
44
44
  _id: Crud.ObjectId(),
45
45
  type: "key",
46
- key: defaultKey,
46
+ key: apikey,
47
47
  actions: {
48
48
  signIn: true,
49
49
  signUp: true
@@ -90,7 +90,7 @@ async function generateDB(organization = { object: {} }, user = { object: {} })
90
90
  };
91
91
  Crud.send(userKey);
92
92
 
93
- return { organization: organization.object, key: key.object, user: user.object, role: role.object, userKey: userKey.object }
93
+ return { organization: organization.object, apikey, user: user.object, role: role.object, userKey: userKey.object }
94
94
 
95
95
  } catch (error) {
96
96
  return false