@caruuto/caruuto-js 0.3.4 → 0.3.5
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/lib/filters.js +6 -0
- package/lib/helpers.js +10 -0
- package/lib/terminators.js +1 -0
- package/package.json +1 -1
- package/x.js +9 -6
package/lib/filters.js
CHANGED
package/lib/helpers.js
CHANGED
|
@@ -51,6 +51,8 @@ module.exports = function (CaruutoClient) {
|
|
|
51
51
|
(typeof this.mediaBucket === 'string' ? '/' + this.mediaBucket : '')
|
|
52
52
|
} else if (this.collection) {
|
|
53
53
|
url += '/' + options.version + '/' + this.collection
|
|
54
|
+
} else if (this.searchPhrase) {
|
|
55
|
+
url += '/' + options.version
|
|
54
56
|
} else {
|
|
55
57
|
url +=
|
|
56
58
|
'/' +
|
|
@@ -93,6 +95,10 @@ module.exports = function (CaruutoClient) {
|
|
|
93
95
|
url += '/' + options.id
|
|
94
96
|
}
|
|
95
97
|
|
|
98
|
+
if (this.searchPhrase) {
|
|
99
|
+
url += '/search'
|
|
100
|
+
}
|
|
101
|
+
|
|
96
102
|
if (options.useParams) {
|
|
97
103
|
const params = {}
|
|
98
104
|
|
|
@@ -124,6 +130,10 @@ module.exports = function (CaruutoClient) {
|
|
|
124
130
|
params.sort = JSON.stringify(this.sort)
|
|
125
131
|
}
|
|
126
132
|
|
|
133
|
+
if (this.searchPhrase) {
|
|
134
|
+
params.phrase = this.searchPhrase
|
|
135
|
+
}
|
|
136
|
+
|
|
127
137
|
const paramsStr = querystring.stringify(params, {
|
|
128
138
|
encode: false
|
|
129
139
|
})
|
package/lib/terminators.js
CHANGED
package/package.json
CHANGED
package/x.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
const { createClient } = require('./index')
|
|
2
2
|
|
|
3
3
|
;(async () => {
|
|
4
|
-
const x = createClient('https://localcaruuto.com/api', '
|
|
4
|
+
const x = createClient('https://localcaruuto.com/api', '12345678900987654321')
|
|
5
5
|
|
|
6
6
|
// const signedUrl = await x.inMedia('radical').getSignedUrl('test.jpg')
|
|
7
7
|
|
|
8
8
|
// console.log(signedUrl)
|
|
9
9
|
|
|
10
|
-
const y = await x.insertDataPoint({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})
|
|
10
|
+
// const y = await x.insertDataPoint({
|
|
11
|
+
// memberId: '0bcdd373-fbb6-4998-b0ed-57c842709acc',
|
|
12
|
+
// optionId: '10',
|
|
13
|
+
// questionId: 'f373b0a2-9c87-41f1-af49-f643da8f836c'
|
|
14
|
+
// })
|
|
15
|
+
|
|
16
|
+
x.search({ phrase: 'grower' })
|
|
17
|
+
const y = await x.find()
|
|
15
18
|
console.log('y :>> ', y)
|
|
16
19
|
})()
|