@qikdev/sdk 0.1.170 → 0.1.180

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.
@@ -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
  ///////////////////////