@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.
- package/dist/main.js +1 -1
- package/package.json +4 -13
- package/src/api/qik.access.js +715 -750
- package/src/api/qik.api.js +3 -3
- package/src/api/qik.auth.js +797 -740
- package/src/api/qik.content.js +731 -712
- package/src/api/qik.core.js +1 -0
- package/src/api/qik.files.js +4 -40
- package/src/api/qik.socket.js +293 -305
- package/src/api/qik.utils.js +1 -3
- package/src/version.js +1 -1
- package/.husky/pre-commit +0 -5
- package/dist/sdk.js +0 -2
- package/dist/sdk.js.LICENSE.txt +0 -8
- package/eslint.config.js +0 -6
- package/yarn-error.log +0 -3598
package/src/api/qik.core.js
CHANGED
package/src/api/qik.files.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
///////////////////////
|