mango-cms 0.1.25 → 0.2.1

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.
@@ -59,7 +59,6 @@
59
59
  import Swal from 'sweetalert2'
60
60
  import { validateEmail } from '../../helpers/email'
61
61
  import { getUser } from '../../helpers/user'
62
- import Mango from '../../helpers/mango'
63
62
 
64
63
  // Function for setting cookies
65
64
  let setCookie = function (cname, cvalue) {
@@ -101,7 +100,7 @@ export default {
101
100
  validateEmail,
102
101
  async login() {
103
102
  this.processing = true
104
- let member = (await Mango.login({ email: this.user.email, password: this.user.password }))
103
+ let member = (await this.$mango.login({ email: this.user.email, password: this.user.password }))
105
104
 
106
105
  if (member?.memberId) {
107
106
  if (member.roles?.includes('admin')) member.admin = true
@@ -149,7 +148,7 @@ export default {
149
148
  title: `${this.user.firstName} ${this.user.lastName || ''}`.trim()
150
149
  }
151
150
 
152
- let response = await Mango.members.save(data)
151
+ let response = await this.$mango.members.save(data)
153
152
  if (!response.id) {
154
153
  Swal.fire('Account Exists', response, 'info')
155
154
  } else {
@@ -79,7 +79,6 @@
79
79
  </template>
80
80
 
81
81
  <script>
82
- import Mango from '../../helpers/mango'
83
82
  import Login from '../layout/login.vue'
84
83
 
85
84
  export default {
@@ -106,9 +105,9 @@ export default {
106
105
  }
107
106
  },
108
107
  async created() {
109
- this.online = await Mango.online()
108
+ this.online = await this.$mango.online()
110
109
  this.checker = setInterval(async () => {
111
- this.online = await Mango.online()
110
+ this.online = await this.$mango.online()
112
111
  }, 500);
113
112
  },
114
113
  beforeDestroy() {
@@ -4,7 +4,7 @@ import collections from '@collections'
4
4
  import { algoliaAppId, algoliaSearchKey, algoliaIndex, port, domain } from '@settings'
5
5
  import axios from "axios";
6
6
  import { ref } from 'vue'
7
- import algoliasearch from 'algoliasearch/lite'
7
+ import algoliasearch from 'algoliasearch/dist/algoliasearch-lite.esm.browser'
8
8
 
9
9
  let endpoints = {
10
10
  authors: ['get'],
@@ -1,5 +1,5 @@
1
1
  import { ref } from 'vue'
2
- import Mango from './mango'
2
+ import { mango } from 'mango-cms'
3
3
 
4
4
  const getUser = async (user) => {
5
5
 
@@ -23,7 +23,7 @@ const getUser = async (user) => {
23
23
 
24
24
  if (!userId) return {}
25
25
 
26
- user.value = await Mango.member(userId, { depthLimit: 0 }).then(r => user.value = r)
26
+ user.value = await mango.member(userId, { depthLimit: 0 }).then(r => user.value = r)
27
27
 
28
28
  return user.value
29
29
 
@@ -84,17 +84,15 @@ axios.defaults.headers.common['Authorization'] = Authorization
84
84
 
85
85
  app.provide('store', store)
86
86
  app.provide('axios', axios)
87
-
88
87
  app.provide('mode', import.meta.env.MODE)
89
88
 
90
-
91
89
  /*
92
90
 
93
91
  Global Components
94
92
 
95
93
  */
96
94
 
97
- import Mango from './helpers/Mango.vue'
95
+ import { Mango, mango } from 'mango-cms'
98
96
  import Spinner from './components/layout/spinner.vue'
99
97
  import Modal from './components/layout/modal.vue'
100
98
 
@@ -103,6 +101,8 @@ app.component('Spinner', Spinner)
103
101
  app.component('Modal', Modal)
104
102
  // app.component('resource', defineAsyncComponent(Layouter.vue')))
105
103
 
104
+ app.config.globalProperties.$mango = mango
105
+
106
106
  /*
107
107
 
108
108
  Route Guard
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "mango-cms",
3
- "version": "0.1.25",
3
+ "version": "0.2.1",
4
4
  "main": "./index.js",
5
5
  "exports": {
6
- ".": "./index.js"
6
+ ".": "./index.js",
7
+ "./package.json": "./package.json"
7
8
  },
8
9
  "files": [
9
10
  "index.js",
@@ -13,7 +14,7 @@
13
14
  "!default/node_modules/**"
14
15
  ],
15
16
  "author": "Colton Neifert",
16
- "license": "ISC",
17
+ "license": "Commercial",
17
18
  "bin": {
18
19
  "mango": "./cli.js"
19
20
  },