@miso.ai/server-sdk 0.6.3-beta.8 → 0.6.3
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/cli/get.js +23 -0
- package/cli/index.js +3 -0
- package/package.json +3 -3
- package/src/logger/index.js +1 -1
- package/src/normalize/index.js +1 -1
- package/src/stream/status.js +2 -1
- package/src/version.js +1 -1
package/cli/get.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MisoClient } from '../src/index.js';
|
|
2
|
+
|
|
3
|
+
const build = yargs => yargs;
|
|
4
|
+
|
|
5
|
+
const run = type => async ({
|
|
6
|
+
key,
|
|
7
|
+
server,
|
|
8
|
+
id,
|
|
9
|
+
debug,
|
|
10
|
+
}) => {
|
|
11
|
+
const client = new MisoClient({ key, server });
|
|
12
|
+
const entity = await client.api[type].get(id);
|
|
13
|
+
console.log(JSON.stringify(entity));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default function(type) {
|
|
17
|
+
return {
|
|
18
|
+
command: 'get [id]',
|
|
19
|
+
description: `Get ${type}`,
|
|
20
|
+
builder: build,
|
|
21
|
+
handler: run(type),
|
|
22
|
+
};
|
|
23
|
+
}
|
package/cli/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import del from './delete.js';
|
|
|
6
6
|
import ids from './ids.js';
|
|
7
7
|
import transform from './transform.js';
|
|
8
8
|
import status from './status.js';
|
|
9
|
+
import get from './get.js';
|
|
9
10
|
|
|
10
11
|
const interactions = {
|
|
11
12
|
command: 'interactions',
|
|
@@ -23,6 +24,7 @@ const products = {
|
|
|
23
24
|
.command(upload('products'))
|
|
24
25
|
.command(del('products'))
|
|
25
26
|
.command(ids('products'))
|
|
27
|
+
.command(get('products'))
|
|
26
28
|
.command(status('products')),
|
|
27
29
|
};
|
|
28
30
|
|
|
@@ -34,6 +36,7 @@ const users = {
|
|
|
34
36
|
.command(upload('users'))
|
|
35
37
|
.command(del('users'))
|
|
36
38
|
.command(ids('users'))
|
|
39
|
+
.command(get('users'))
|
|
37
40
|
.command(status('users')),
|
|
38
41
|
};
|
|
39
42
|
|
package/package.json
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"simonpai <simon.pai@askmiso.com>"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@miso.ai/server-commons": "0.6.3
|
|
20
|
-
"axios": "^
|
|
19
|
+
"@miso.ai/server-commons": "0.6.3",
|
|
20
|
+
"axios": "^1.6.2",
|
|
21
21
|
"dotenv": "^16.0.1",
|
|
22
22
|
"split2": "^4.1.0",
|
|
23
23
|
"yargs": "^17.5.1"
|
|
24
24
|
},
|
|
25
|
-
"version": "0.6.3
|
|
25
|
+
"version": "0.6.3"
|
|
26
26
|
}
|
package/src/logger/index.js
CHANGED
package/src/normalize/index.js
CHANGED
package/src/stream/status.js
CHANGED
|
@@ -10,7 +10,7 @@ export default class StatusStream extends Transform {
|
|
|
10
10
|
this._type = type;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
async _transform(task_id, _) {
|
|
13
|
+
async _transform(task_id, _, next) {
|
|
14
14
|
try {
|
|
15
15
|
this.push({
|
|
16
16
|
task_id,
|
|
@@ -23,6 +23,7 @@ export default class StatusStream extends Transform {
|
|
|
23
23
|
error: summarizeError(err),
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
+
next();
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
}
|
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '0.6.3
|
|
1
|
+
export default '0.6.3';
|