@qikdev/sdk 0.1.170 → 0.1.181

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.
@@ -126,7 +126,8 @@ export default function (qik) {
126
126
 
127
127
  ///////////////////////////////////////////////////
128
128
 
129
- const scopeGlossaryCache = qik.cache.get("user:scope:glossary");
129
+ const scopeGlossary = {};
130
+
130
131
  let inflightScopeGlossaryRequest;
131
132
 
132
133
  /**
@@ -146,9 +147,7 @@ export default function (qik) {
146
147
  service.scopeGlossary = async function (options) {
147
148
  options = options || {};
148
149
 
149
- // Check if we already have the scope glossary cached
150
- let cached = scopeGlossaryCache.get("scopes");
151
- var reload = options.refresh || options.reload || !cached;
150
+ var reload = options.refresh || options.reload || !scopeGlossary.data;
152
151
 
153
152
  if (reload) {
154
153
  if (!inflightScopeGlossaryRequest) {
@@ -162,19 +161,15 @@ export default function (qik) {
162
161
  }
163
162
 
164
163
  const { data } = await inflightScopeGlossaryRequest;
165
-
166
- // Cache it for later
167
- scopeGlossaryCache.set("scopes", data);
168
- cached = data;
169
- qik.dispatch("glossary:scope", data);
164
+ scopeGlossary.data = data;
170
165
  }
171
166
 
172
167
  if (options.hash) {
173
- var result = qik.utils.hash(cached, "_id");
168
+ var result = qik.utils.hash(scopeGlossary.data, "_id");
174
169
  return result;
175
170
  }
176
171
 
177
- return cached;
172
+ return scopeGlossary.data;
178
173
  };
179
174
 
180
175
  ///////////////////////////////////////////////////
@@ -612,7 +607,7 @@ export default function (qik) {
612
607
  * @param {Object} options.page Page configuration
613
608
  * @param {Number} options.page.size Page size
614
609
  * @param {Number} options.page.index Page index
615
- * @param {Object} options.filter How to filter the results. Additional documentation can be found here: https://rest.docs.qik.dev/#filter-syntax
610
+ * @param {Object} options.filter How to filter the results
616
611
  * @example
617
612
  *
618
613
  *
@@ -79,6 +79,7 @@ export default function(options) {
79
79
  //Other options
80
80
  // domain:'',
81
81
  version,
82
+ global:{},
82
83
  })
83
84
 
84
85
 
@@ -23,37 +23,19 @@ export default function(qik) {
23
23
  * @param {String} type The type or definition of the item we want to generate the url for
24
24
  * @param {(Object|String)} id The id or object with an _id property that we want to generate the url for
25
25
  * @param {Object} params Additional parameters and options for the url
26
- * @param {Object} options Configuration options
27
- * @param {String} options.filename Provide an optional filename for the url
28
- * @param {Boolean} options.withoutToken Don't append an access token to the url
29
26
  * @example
30
27
  * const url = sdk.files.downloadUrl('image', '61eca4746971e75c1fc670cf', {w:100, h:100});
31
28
  * // https://api.qik.dev/image/61eca4746971e75c1fc670cf?w=100&h=100&download=true
32
29
  *
33
30
  * const url = sdk.files.downloadUrl('image', {_id:'61eca4746971e75c1fc670cf'...}, {f:'png'});
34
31
  * // https://api.qik.dev/image/61eca4746971e75c1fc670cf?w=100&h=100&download=true
35
- *
36
- * const url = sdk.files.downloadUrl('image', '61eca4746971e75c1fc670cf', {w:100, h:100}, {filename:'image.jpg'});
37
- * // https://api.qik.dev/image/61eca4746971e75c1fc670cf/image.jpg?w=100&h=100&download=true
38
32
  */
39
33
  service.downloadUrl = function(type, id, params, options) {
40
34
  options = options || {}
41
- if (!('file' in options)) {
42
- // Default to file api for nuxt rendering
43
- options.file = true;
44
- }
45
-
46
- params = params || {};
35
+ params = params || {}
47
36
  params.download = true;
48
37
  id = qik.utils.id(id);
49
-
50
- let url = `/${type}/${id}`;
51
-
52
- if(options.filename) {
53
- url = `${url}/${options.filename}`;
54
- }
55
-
56
- return qik.api.generateEndpointURL(url, params, options);
38
+ return qik.api.generateEndpointURL(`/${type}/${id}`, params, options);
57
39
  }
58
40
 
59
41
  /**
@@ -63,36 +45,18 @@ export default function(qik) {
63
45
  * @param {String} type The type or definition of the item we want to generate the url for
64
46
  * @param {(Object|String)} id The id or object with an _id property that we want to generate the url for
65
47
  * @param {Object} params Additional parameters and options for the url
66
- * @param {Object} options Configuration options
67
- * @param {String} options.filename Provide an optional filename for the url
68
- * @param {Boolean} options.withoutToken Don't append an access token to the url
69
48
  * @example
70
49
  * const url = sdk.files.mediaUrl('image', '61eca4746971e75c1fc670cf', {w:100, h:100});
71
50
  * // https://api.qik.dev/image/61eca4746971e75c1fc670cf?w=100&h=100&download=true
72
51
  *
73
- * const url = sdk.files.mediaUrl('image', '61eca4746971e75c1fc670cf', {w:100, h:100}, {filename:'image.jpg'});
74
- * // https://api.qik.dev/image/61eca4746971e75c1fc670cf/image.jpg?w=100&h=100&download=true
75
- *
76
52
  * const url = sdk.files.mediaUrl('image', {_id:'61eca4746971e75c1fc670cf'...}, {f:'png'});
77
53
  * // https://api.qik.dev/image/61eca4746971e75c1fc670cf?w=100&h=100&download=true
78
54
  */
79
55
  service.mediaUrl = function(type, id, params, options) {
80
56
  options = options || {}
81
- if (!('file' in options)) {
82
- // Default to file api for nuxt rendering
83
- options.file = true;
84
- }
85
-
86
- params = params || {};
57
+ params = params || {}
87
58
  id = qik.utils.id(id);
88
-
89
- let url = `/${type}/${id}`;
90
-
91
- if(options.filename) {
92
- url = `${url}/${options.filename}`;
93
- }
94
-
95
- return qik.api.generateEndpointURL(url, params, options);
59
+ return qik.api.generateEndpointURL(`/${type}/${id}`, params, options);
96
60
  }
97
61
 
98
62
  ///////////////////////