@cocreate/users 1.25.3 → 1.27.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,23 @@
1
+ # [1.27.0](https://github.com/CoCreate-app/CoCreate-users/compare/v1.26.0...v1.27.0) (2023-10-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * socket.config items moved to socket ([2e09599](https://github.com/CoCreate-app/CoCreate-users/commit/2e0959976f83dae168d88533a71628a0d1edea76))
7
+ * update wsManager.broadcast to wsManager.send() ([1f0132b](https://github.com/CoCreate-app/CoCreate-users/commit/1f0132b9ef0710831bd354332f35334fe4fbf29a))
8
+
9
+
10
+ ### Features
11
+
12
+ * sawait ocket.organization_id() ([177a173](https://github.com/CoCreate-app/CoCreate-users/commit/177a173f27e8e4bf09c1c1aa72c015b73622b733))
13
+
14
+ # [1.26.0](https://github.com/CoCreate-app/CoCreate-users/compare/v1.25.3...v1.26.0) (2023-09-19)
15
+
16
+
17
+ ### Features
18
+
19
+ * Update CoCreate dependencies to their latest versions ([ee4b913](https://github.com/CoCreate-app/CoCreate-users/commit/ee4b91376df1d4548487df1bfbbaeb7960aca7a2))
20
+
1
21
  ## [1.25.3](https://github.com/CoCreate-app/CoCreate-users/compare/v1.25.2...v1.25.3) (2023-09-18)
2
22
 
3
23
 
@@ -1,24 +1,24 @@
1
- module.exports = {
2
- "organization_id": "",
3
- "key": "",
4
- "host": "",
5
- "sources": [
6
- {
7
- "array": "files",
8
- "object": {
9
- "_id": "6012f7af86c0ba24512cca2e",
10
- "name": "index.html",
11
- "path": "/docs/users",
12
- "pathname": "/docs/users/index.html",
13
- "src": "{{./docs/index.html}}",
14
- "host": [
15
- "*",
16
- "general.cocreate.app"
17
- ],
18
- "directory": "users",
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": "6012f7af86c0ba24512cca2e",
10
+ "name": "index.html",
11
+ "path": "/docs/users",
12
+ "pathname": "/docs/users/index.html",
13
+ "src": "{{./docs/index.html}}",
14
+ "host": [
15
+ "*",
16
+ "general.cocreate.app"
17
+ ],
18
+ "directory": "users",
19
+ "content-type": "{{content-type}}",
20
+ "public": "true"
21
+ }
22
+ }
23
+ ]
24
+ };
package/docs/index.html CHANGED
@@ -365,7 +365,6 @@
365
365
  </button>
366
366
  </main>
367
367
 
368
- <script src="./apikey.js"></script>
369
368
  <script src="https://CoCreate.app/dist/CoCreate.js"></script>
370
369
  </body>
371
370
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/users",
3
- "version": "1.25.3",
3
+ "version": "1.27.0",
4
4
  "description": "A simple users component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "users",
@@ -58,11 +58,11 @@
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/element-prototype": "^1.11.1",
64
- "@cocreate/elements": "^1.21.0",
65
- "@cocreate/local-storage": "^1.10.1",
66
- "@cocreate/render": "^1.27.2"
61
+ "@cocreate/actions": "^1.11.2",
62
+ "@cocreate/crud-client": "^1.27.0",
63
+ "@cocreate/element-prototype": "^1.11.2",
64
+ "@cocreate/elements": "^1.22.0",
65
+ "@cocreate/local-storage": "^1.10.2",
66
+ "@cocreate/render": "^1.28.0"
67
67
  }
68
68
  }
package/src/client.js CHANGED
@@ -8,6 +8,10 @@ import './index.css';
8
8
  import localStorage from '@cocreate/local-storage';
9
9
 
10
10
  const CoCreateUser = {
11
+ organization_id: async () => {
12
+ return await Crud.socket.organization_id()
13
+ },
14
+
11
15
  init: function () {
12
16
  this.initSocket();
13
17
  this.initSession();
@@ -22,7 +26,6 @@ const CoCreateUser = {
22
26
  let formEl = btn.closest("form");
23
27
  if (!formEl) return;
24
28
 
25
- let organization_id = Crud.socket.config.organization_id;
26
29
  let array = formEl.getAttribute('array')
27
30
  if (!array) {
28
31
  for (let el of formEl) {
@@ -128,11 +131,10 @@ const CoCreateUser = {
128
131
 
129
132
  signInResponse: function (data) {
130
133
  let { success, status, message, user_id, token } = data;
131
-
132
134
  if (success) {
133
- localStorage.setItem('organization_id', Crud.socket.config.organization_id);
134
- localStorage.setItem("key", Crud.socket.config.key);
135
- localStorage.setItem("host", Crud.socket.config.host);
135
+ localStorage.setItem('organization_id', organization_id);
136
+ localStorage.setItem("key", Crud.socket.key);
137
+ localStorage.setItem("host", Crud.socket.host);
136
138
  localStorage.setItem('user_id', user_id);
137
139
  localStorage.setItem("token", token);
138
140
  // document.cookie = `token=${token};path=/`;
@@ -192,7 +194,7 @@ const CoCreateUser = {
192
194
  },
193
195
 
194
196
  redirect: (data) => {
195
- if (data.user_id && data.user_id !== Crud.socket.config.user_id)
197
+ if (data.user_id && data.user_id !== Crud.socket.user_id)
196
198
  return
197
199
  if (!data.user_id && data.clientId !== Crud.socket.clientId)
198
200
  return
package/src/server.js CHANGED
@@ -20,13 +20,13 @@ class CoCreateUser {
20
20
  if (data.user) {
21
21
  data.user.method = 'create.object'
22
22
  const response = await this.crud.send(data.user)
23
- this.wsManager.broadcast(response);
23
+ this.wsManager.send(response);
24
24
  }
25
25
 
26
26
  if (data.userKey) {
27
27
  data.userKey.method = 'create.object'
28
28
  const response = await this.crud.send(data.userKey)
29
- this.wsManager.broadcast(response);
29
+ this.wsManager.send(response);
30
30
  }
31
31
 
32
32
  self.wsManager.send(data);
@@ -86,7 +86,7 @@ class CoCreateUser {
86
86
  }
87
87
  }
88
88
  self.wsManager.send(response)
89
- self.wsManager.broadcast({
89
+ self.wsManager.send({
90
90
  method: 'updateUserStatus',
91
91
  user_id: response.user_id,
92
92
  userStatus: response.userStatus,
@@ -116,11 +116,11 @@ class CoCreateUser {
116
116
 
117
117
  data.method = 'update.object'
118
118
  this.crud.send(data).then((data) => {
119
- self.wsManager.broadcast({
119
+ self.wsManager.send({
120
120
  method: 'updateUserStatus',
121
121
  user_id: data.user_id,
122
122
  userStatus: data.userStatus,
123
- organization_id: data.organization_id || socket.config.organization_id
123
+ organization_id: data.organization_id || socket.organization_id
124
124
  })
125
125
 
126
126
  })