@botpress/client 0.48.2 → 1.0.0
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/bundle.cjs +13 -13
- package/dist/bundle.cjs.map +4 -4
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +15852 -1284
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +4 -4
- package/package.json +1 -2
- package/readme.md +1 -1
- package/.turbo/turbo-build.log +0 -29
- package/.turbo/turbo-generate.log +0 -9
- package/build.ts +0 -58
- package/e2e/consts.ts +0 -2
- package/e2e/node.ts +0 -25
- package/openapi.ts +0 -5
- package/tsconfig.build.json +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Botpress Client",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"qs": "^6.11.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@botpress/api": "0.83.1",
|
|
32
31
|
"@types/qs": "^6.9.7",
|
|
33
32
|
"esbuild": "^0.16.12",
|
|
34
33
|
"lodash": "^4.17.21",
|
package/readme.md
CHANGED
|
@@ -13,7 +13,7 @@ pnpm add @botpress/client # for pnpm
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
|
-
import { Client } from '@botpress/client'
|
|
16
|
+
import { Client, ClientInputs, ClientOutputs } from '@botpress/client'
|
|
17
17
|
|
|
18
18
|
// 0. Type definitions for each operation's IO
|
|
19
19
|
type GetBotInput = ClientInputs['getBot']
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @botpress/client@0.48.2 build /home/runner/work/botpress/botpress/packages/client
|
|
3
|
-
> pnpm build:type && pnpm build:node && pnpm build:browser && pnpm build:bundle
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
> @botpress/client@0.48.2 build:type /home/runner/work/botpress/botpress/packages/client
|
|
7
|
-
> tsup --tsconfig tsconfig.build.json ./src/index.ts --dts-resolve --dts-only
|
|
8
|
-
|
|
9
|
-
CLI Building entry: ./src/index.ts
|
|
10
|
-
CLI Using tsconfig: tsconfig.build.json
|
|
11
|
-
CLI tsup v8.0.2
|
|
12
|
-
DTS Build start
|
|
13
|
-
DTS ⚡️ Build success in 4239ms
|
|
14
|
-
DTS dist/index.d.ts 510.06 KB
|
|
15
|
-
|
|
16
|
-
> @botpress/client@0.48.2 build:node /home/runner/work/botpress/botpress/packages/client
|
|
17
|
-
> ts-node -T ./build.ts --node
|
|
18
|
-
|
|
19
|
-
Done
|
|
20
|
-
|
|
21
|
-
> @botpress/client@0.48.2 build:browser /home/runner/work/botpress/botpress/packages/client
|
|
22
|
-
> ts-node -T ./build.ts --browser
|
|
23
|
-
|
|
24
|
-
Done
|
|
25
|
-
|
|
26
|
-
> @botpress/client@0.48.2 build:bundle /home/runner/work/botpress/botpress/packages/client
|
|
27
|
-
> ts-node -T ./build.ts --bundle
|
|
28
|
-
|
|
29
|
-
Done
|
package/build.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import esbuild from 'esbuild'
|
|
2
|
-
|
|
3
|
-
const common: esbuild.BuildOptions = {
|
|
4
|
-
bundle: true,
|
|
5
|
-
minify: true,
|
|
6
|
-
sourcemap: true,
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const buildNode = () =>
|
|
10
|
-
esbuild.build({
|
|
11
|
-
...common,
|
|
12
|
-
platform: 'node',
|
|
13
|
-
format: 'cjs',
|
|
14
|
-
external: ['axios', 'browser-or-node'],
|
|
15
|
-
outfile: 'dist/index.cjs',
|
|
16
|
-
entryPoints: ['src/index.ts'],
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
const buildBrowser = () =>
|
|
20
|
-
esbuild.build({
|
|
21
|
-
...common,
|
|
22
|
-
platform: 'browser',
|
|
23
|
-
format: 'esm',
|
|
24
|
-
external: ['crypto', 'axios', 'browser-or-node'],
|
|
25
|
-
outfile: 'dist/index.mjs',
|
|
26
|
-
entryPoints: ['src/index.ts'],
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
const buildBundle = () =>
|
|
30
|
-
esbuild.build({
|
|
31
|
-
...common,
|
|
32
|
-
platform: 'node',
|
|
33
|
-
outfile: 'dist/bundle.cjs',
|
|
34
|
-
entryPoints: ['src/index.ts'],
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
const main = async (argv: string[]) => {
|
|
38
|
-
if (argv.includes('--node')) {
|
|
39
|
-
return buildNode()
|
|
40
|
-
}
|
|
41
|
-
if (argv.includes('--browser')) {
|
|
42
|
-
return buildBrowser()
|
|
43
|
-
}
|
|
44
|
-
if (argv.includes('--bundle')) {
|
|
45
|
-
return buildBundle()
|
|
46
|
-
}
|
|
47
|
-
throw new Error('Please specify --node, --browser, or --bundle')
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
void main(process.argv.slice(2))
|
|
51
|
-
.then(() => {
|
|
52
|
-
console.info('Done')
|
|
53
|
-
process.exit(0)
|
|
54
|
-
})
|
|
55
|
-
.catch((error) => {
|
|
56
|
-
console.error(error)
|
|
57
|
-
process.exit(1)
|
|
58
|
-
})
|
package/e2e/consts.ts
DELETED
package/e2e/node.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Client, errorFrom } from '../src'
|
|
2
|
-
|
|
3
|
-
const main = async () => {
|
|
4
|
-
const client = new Client()
|
|
5
|
-
await client
|
|
6
|
-
.getAccount({})
|
|
7
|
-
.then(() => {
|
|
8
|
-
throw new Error('Expected to reject')
|
|
9
|
-
})
|
|
10
|
-
.catch((err) => {
|
|
11
|
-
if (errorFrom(err).type !== 'Unauthorized') {
|
|
12
|
-
throw Error()
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
void main()
|
|
18
|
-
.then(() => {
|
|
19
|
-
console.error('Node Done')
|
|
20
|
-
process.exit(0)
|
|
21
|
-
})
|
|
22
|
-
.catch((err) => {
|
|
23
|
-
console.error(err)
|
|
24
|
-
process.exit(1)
|
|
25
|
-
})
|
package/openapi.ts
DELETED