@caruuto/caruuto-js 0.3.3 → 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/CHANGELOG.md +11 -0
- package/lib/filters.js +6 -0
- package/lib/helpers.js +10 -0
- package/lib/terminators.js +1 -0
- package/package.json +3 -2
- package/x.js +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
7
7
|
|
|
8
|
+
## 0.3.4 - 2024-05-08
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Added encoding package referenced by node-fetch to remove console warning:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
warn - ../caruuto-js/node_modules/node-fetch/lib/index.js
|
|
16
|
+
Module not found: Can't resolve 'encoding' in '../caruuto-js/node_modules/node-fetch/lib'
|
|
17
|
+
```
|
|
18
|
+
|
|
8
19
|
## 0.3.1 - 2024-01-16
|
|
9
20
|
|
|
10
21
|
### Fixed
|
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caruuto/caruuto-js",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "A high-level library for interacting with Caruuto",
|
|
5
5
|
"exports": "./index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
"author": "Jim Lambie <jim@27.works>",
|
|
11
11
|
"license": "GPL",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"cross-fetch": "^
|
|
13
|
+
"cross-fetch": "^4.0.0",
|
|
14
14
|
"debug": "^2.6.1",
|
|
15
|
+
"encoding": "^0.1.13",
|
|
15
16
|
"got": "^11.0.0",
|
|
16
17
|
"mocha": "^10.2.0",
|
|
17
18
|
"query-string": "5.0.1"
|
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
|
})()
|