@lorikeetai/node-sdk 0.1.0-beta.4 → 0.2.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/CHANGELOG.md +40 -0
- package/README.md +11 -11
- package/_shims/MultipartBody.js.map +1 -1
- package/_shims/MultipartBody.mjs.map +1 -1
- package/_shims/auto/runtime-bun.d.ts.map +1 -1
- package/_shims/auto/runtime-bun.js.map +1 -1
- package/_shims/auto/runtime-node.d.ts.map +1 -1
- package/_shims/auto/runtime-node.js.map +1 -1
- package/_shims/auto/runtime.d.ts.map +1 -1
- package/_shims/auto/runtime.js.map +1 -1
- package/_shims/auto/types-node.d.ts.map +1 -1
- package/_shims/auto/types-node.js.map +1 -1
- package/_shims/auto/types.d.ts +52 -52
- package/_shims/bun-runtime.d.ts.map +1 -1
- package/_shims/bun-runtime.js.map +1 -1
- package/_shims/bun-runtime.mjs.map +1 -1
- package/_shims/index.d.ts +36 -36
- package/_shims/index.js +5 -5
- package/_shims/index.mjs +4 -4
- package/_shims/node-runtime.d.ts.map +1 -1
- package/_shims/node-runtime.js.map +1 -1
- package/_shims/node-runtime.mjs.map +1 -1
- package/_shims/node-types.d.ts +27 -27
- package/_shims/registry.d.ts.map +1 -1
- package/_shims/registry.js.map +1 -1
- package/_shims/registry.mjs.map +1 -1
- package/_shims/web-runtime.d.ts.map +1 -1
- package/_shims/web-runtime.js.map +1 -1
- package/_shims/web-runtime.mjs.map +1 -1
- package/_shims/web-types.d.ts +52 -52
- package/core.d.ts.map +1 -1
- package/core.js +0 -1
- package/core.js.map +1 -1
- package/core.mjs +0 -1
- package/core.mjs.map +1 -1
- package/error.d.ts.map +1 -1
- package/error.js.map +1 -1
- package/error.mjs.map +1 -1
- package/index.d.mts +3 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -0
- package/index.js.map +1 -1
- package/index.mjs +3 -0
- package/index.mjs.map +1 -1
- package/lib/generate-signature.js.map +1 -1
- package/lib/generate-signature.mjs.map +1 -1
- package/package.json +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/conversation/chat.d.ts +9 -5
- package/resources/conversation/chat.d.ts.map +1 -1
- package/resources/conversation/chat.js +3 -3
- package/resources/conversation/chat.js.map +1 -1
- package/resources/conversation/chat.mjs +3 -3
- package/resources/conversation/chat.mjs.map +1 -1
- package/resources/conversation/conversation.d.ts.map +1 -1
- package/resources/conversation/conversation.js.map +1 -1
- package/resources/conversation/conversation.mjs.map +1 -1
- package/resources/conversation/email.d.ts +6 -2
- package/resources/conversation/email.d.ts.map +1 -1
- package/resources/conversation/email.js +1 -1
- package/resources/conversation/email.js.map +1 -1
- package/resources/conversation/email.mjs +1 -1
- package/resources/conversation/email.mjs.map +1 -1
- package/resources/conversation/index.d.ts.map +1 -1
- package/resources/conversation/index.js.map +1 -1
- package/resources/customer.d.ts +61 -0
- package/resources/customer.d.ts.map +1 -0
- package/resources/customer.js +12 -0
- package/resources/customer.js.map +1 -0
- package/resources/customer.mjs +8 -0
- package/resources/customer.mjs.map +1 -0
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/ingest.d.ts.map +1 -1
- package/resources/ingest.js.map +1 -1
- package/resources/ingest.mjs.map +1 -1
- package/resources/token.d.ts.map +1 -1
- package/resources/token.js.map +1 -1
- package/resources/token.mjs.map +1 -1
- package/shims/node.d.ts.map +1 -1
- package/shims/node.js.map +1 -1
- package/shims/node.mjs.map +1 -1
- package/shims/web.d.ts.map +1 -1
- package/shims/web.js.map +1 -1
- package/shims/web.mjs.map +1 -1
- package/src/_shims/MultipartBody.ts +1 -1
- package/src/_shims/auto/runtime-bun.ts +1 -1
- package/src/_shims/auto/runtime-node.ts +1 -1
- package/src/_shims/auto/runtime.ts +1 -1
- package/src/_shims/auto/types-node.ts +1 -1
- package/src/_shims/auto/types.d.ts +52 -52
- package/src/_shims/bun-runtime.ts +6 -6
- package/src/_shims/index.d.ts +36 -36
- package/src/_shims/index.js +5 -5
- package/src/_shims/index.mjs +4 -4
- package/src/_shims/node-runtime.ts +32 -32
- package/src/_shims/node-types.d.ts +27 -27
- package/src/_shims/registry.ts +44 -44
- package/src/_shims/web-runtime.ts +16 -16
- package/src/_shims/web-types.d.ts +52 -52
- package/src/core.ts +372 -372
- package/src/error.ts +37 -37
- package/src/index.ts +74 -65
- package/src/lib/generate-signature.ts +3 -3
- package/src/resource.ts +3 -3
- package/src/resources/conversation/chat.ts +23 -18
- package/src/resources/conversation/conversation.ts +11 -11
- package/src/resources/conversation/email.ts +12 -7
- package/src/resources/conversation/index.ts +3 -3
- package/src/resources/customer.ts +81 -0
- package/src/resources/index.ts +4 -3
- package/src/resources/ingest.ts +7 -7
- package/src/resources/token.ts +9 -9
- package/src/shims/node.ts +24 -24
- package/src/shims/web.ts +24 -24
- package/src/uploads.ts +72 -72
- package/src/version.ts +1 -1
- package/uploads.d.ts.map +1 -1
- package/uploads.js.map +1 -1
- package/uploads.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
3
|
*/
|
|
4
|
-
import { MultipartBody } from './MultipartBody'
|
|
5
|
-
import { type RequestOptions } from '../core'
|
|
6
|
-
import { type Shims } from './registry'
|
|
4
|
+
import { MultipartBody } from './MultipartBody';
|
|
5
|
+
import { type RequestOptions } from '../core';
|
|
6
|
+
import { type Shims } from './registry';
|
|
7
7
|
|
|
8
8
|
export function getRuntime({ manuallyImported }: { manuallyImported?: boolean } = {}): Shims {
|
|
9
9
|
const recommendation =
|
|
@@ -12,24 +12,24 @@ export function getRuntime({ manuallyImported }: { manuallyImported?: boolean }
|
|
|
12
12
|
: `Add one of these imports before your first \`import … from '@lorikeetai/node-sdk'\`:
|
|
13
13
|
- \`import '@lorikeetai/node-sdk/shims/node'\` (if you're running on Node)
|
|
14
14
|
- \`import '@lorikeetai/node-sdk/shims/web'\` (otherwise)
|
|
15
|
-
|
|
15
|
+
`;
|
|
16
16
|
|
|
17
|
-
let _fetch, _Request, _Response, _Headers
|
|
17
|
+
let _fetch, _Request, _Response, _Headers;
|
|
18
18
|
try {
|
|
19
19
|
// @ts-ignore
|
|
20
|
-
_fetch = fetch
|
|
20
|
+
_fetch = fetch;
|
|
21
21
|
// @ts-ignore
|
|
22
|
-
_Request = Request
|
|
22
|
+
_Request = Request;
|
|
23
23
|
// @ts-ignore
|
|
24
|
-
_Response = Response
|
|
24
|
+
_Response = Response;
|
|
25
25
|
// @ts-ignore
|
|
26
|
-
_Headers = Headers
|
|
26
|
+
_Headers = Headers;
|
|
27
27
|
} catch (error) {
|
|
28
28
|
throw new Error(
|
|
29
29
|
`this environment is missing the following Web Fetch API type: ${
|
|
30
30
|
(error as any).message
|
|
31
31
|
}. ${recommendation}`,
|
|
32
|
-
)
|
|
32
|
+
);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
return {
|
|
@@ -46,7 +46,7 @@ export function getRuntime({ manuallyImported }: { manuallyImported?: boolean }
|
|
|
46
46
|
constructor() {
|
|
47
47
|
throw new Error(
|
|
48
48
|
`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${recommendation}`,
|
|
49
|
-
)
|
|
49
|
+
);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
),
|
|
@@ -56,7 +56,7 @@ export function getRuntime({ manuallyImported }: { manuallyImported?: boolean }
|
|
|
56
56
|
constructor() {
|
|
57
57
|
throw new Error(
|
|
58
58
|
`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${recommendation}`,
|
|
59
|
-
)
|
|
59
|
+
);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
),
|
|
@@ -68,7 +68,7 @@ export function getRuntime({ manuallyImported }: { manuallyImported?: boolean }
|
|
|
68
68
|
constructor() {
|
|
69
69
|
throw new Error(
|
|
70
70
|
`file uploads aren't supported in this environment yet as 'File' is undefined. ${recommendation}`,
|
|
71
|
-
)
|
|
71
|
+
);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
),
|
|
@@ -80,7 +80,7 @@ export function getRuntime({ manuallyImported }: { manuallyImported?: boolean }
|
|
|
80
80
|
constructor() {
|
|
81
81
|
throw new Error(
|
|
82
82
|
`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${recommendation}`,
|
|
83
|
-
)
|
|
83
|
+
);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
),
|
|
@@ -96,8 +96,8 @@ export function getRuntime({ manuallyImported }: { manuallyImported?: boolean }
|
|
|
96
96
|
fileFromPath: () => {
|
|
97
97
|
throw new Error(
|
|
98
98
|
'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/optechai/node-sdk#file-uploads',
|
|
99
|
-
)
|
|
99
|
+
);
|
|
100
100
|
},
|
|
101
101
|
isFsReadStream: (value: any) => false,
|
|
102
|
-
}
|
|
102
|
+
};
|
|
103
103
|
}
|
|
@@ -1,83 +1,83 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
3
|
*/
|
|
4
|
-
export type Agent = any
|
|
4
|
+
export type Agent = any;
|
|
5
5
|
|
|
6
|
-
declare const _fetch: typeof fetch
|
|
7
|
-
export { _fetch as fetch }
|
|
6
|
+
declare const _fetch: typeof fetch;
|
|
7
|
+
export { _fetch as fetch };
|
|
8
8
|
|
|
9
|
-
type _Request = Request
|
|
10
|
-
export { _Request as Request }
|
|
9
|
+
type _Request = Request;
|
|
10
|
+
export { _Request as Request };
|
|
11
11
|
|
|
12
|
-
type _RequestInfo = RequestInfo
|
|
13
|
-
export { type _RequestInfo as RequestInfo }
|
|
12
|
+
type _RequestInfo = RequestInfo;
|
|
13
|
+
export { type _RequestInfo as RequestInfo };
|
|
14
14
|
|
|
15
|
-
type _RequestInit = RequestInit
|
|
16
|
-
export { type _RequestInit as RequestInit }
|
|
15
|
+
type _RequestInit = RequestInit;
|
|
16
|
+
export { type _RequestInit as RequestInit };
|
|
17
17
|
|
|
18
|
-
type _Response = Response
|
|
19
|
-
export { _Response as Response }
|
|
18
|
+
type _Response = Response;
|
|
19
|
+
export { _Response as Response };
|
|
20
20
|
|
|
21
|
-
type _ResponseInit = ResponseInit
|
|
22
|
-
export { type _ResponseInit as ResponseInit }
|
|
21
|
+
type _ResponseInit = ResponseInit;
|
|
22
|
+
export { type _ResponseInit as ResponseInit };
|
|
23
23
|
|
|
24
|
-
type _ResponseType = ResponseType
|
|
25
|
-
export { type _ResponseType as ResponseType }
|
|
24
|
+
type _ResponseType = ResponseType;
|
|
25
|
+
export { type _ResponseType as ResponseType };
|
|
26
26
|
|
|
27
|
-
type _BodyInit = BodyInit
|
|
28
|
-
export { type _BodyInit as BodyInit }
|
|
27
|
+
type _BodyInit = BodyInit;
|
|
28
|
+
export { type _BodyInit as BodyInit };
|
|
29
29
|
|
|
30
|
-
type _Headers = Headers
|
|
31
|
-
export { _Headers as Headers }
|
|
30
|
+
type _Headers = Headers;
|
|
31
|
+
export { _Headers as Headers };
|
|
32
32
|
|
|
33
|
-
type _HeadersInit = HeadersInit
|
|
34
|
-
export { type _HeadersInit as HeadersInit }
|
|
33
|
+
type _HeadersInit = HeadersInit;
|
|
34
|
+
export { type _HeadersInit as HeadersInit };
|
|
35
35
|
|
|
36
|
-
type EndingType = 'native' | 'transparent'
|
|
36
|
+
type EndingType = 'native' | 'transparent';
|
|
37
37
|
|
|
38
38
|
export interface BlobPropertyBag {
|
|
39
|
-
endings?: EndingType
|
|
40
|
-
type?: string
|
|
39
|
+
endings?: EndingType;
|
|
40
|
+
type?: string;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export interface FilePropertyBag extends BlobPropertyBag {
|
|
44
|
-
lastModified?: number
|
|
44
|
+
lastModified?: number;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'
|
|
47
|
+
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
|
48
48
|
|
|
49
|
-
type _FormData = FormData
|
|
50
|
-
declare const _FormData: typeof FormData
|
|
51
|
-
export { _FormData as FormData }
|
|
49
|
+
type _FormData = FormData;
|
|
50
|
+
declare const _FormData: typeof FormData;
|
|
51
|
+
export { _FormData as FormData };
|
|
52
52
|
|
|
53
|
-
type _File = File
|
|
54
|
-
declare const _File: typeof File
|
|
55
|
-
export { _File as File }
|
|
53
|
+
type _File = File;
|
|
54
|
+
declare const _File: typeof File;
|
|
55
|
+
export { _File as File };
|
|
56
56
|
|
|
57
|
-
type _Blob = Blob
|
|
58
|
-
declare const _Blob: typeof Blob
|
|
59
|
-
export { _Blob as Blob }
|
|
57
|
+
type _Blob = Blob;
|
|
58
|
+
declare const _Blob: typeof Blob;
|
|
59
|
+
export { _Blob as Blob };
|
|
60
60
|
|
|
61
61
|
export declare class Readable {
|
|
62
|
-
readable: boolean
|
|
63
|
-
readonly readableEnded: boolean
|
|
64
|
-
readonly readableFlowing: boolean | null
|
|
65
|
-
readonly readableHighWaterMark: number
|
|
66
|
-
readonly readableLength: number
|
|
67
|
-
readonly readableObjectMode: boolean
|
|
68
|
-
destroyed: boolean
|
|
69
|
-
read(size?: number): any
|
|
70
|
-
pause(): this
|
|
71
|
-
resume(): this
|
|
72
|
-
isPaused(): boolean
|
|
73
|
-
destroy(error?: Error): this
|
|
74
|
-
[Symbol.asyncIterator](): AsyncIterableIterator<any
|
|
62
|
+
readable: boolean;
|
|
63
|
+
readonly readableEnded: boolean;
|
|
64
|
+
readonly readableFlowing: boolean | null;
|
|
65
|
+
readonly readableHighWaterMark: number;
|
|
66
|
+
readonly readableLength: number;
|
|
67
|
+
readonly readableObjectMode: boolean;
|
|
68
|
+
destroyed: boolean;
|
|
69
|
+
read(size?: number): any;
|
|
70
|
+
pause(): this;
|
|
71
|
+
resume(): this;
|
|
72
|
+
isPaused(): boolean;
|
|
73
|
+
destroy(error?: Error): this;
|
|
74
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<any>;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
export declare class FsReadStream extends Readable {
|
|
78
|
-
path: {} // node type is string | Buffer
|
|
78
|
+
path: {}; // node type is string | Buffer
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
type _ReadableStream<R = any> = ReadableStream<R
|
|
82
|
-
declare const _ReadableStream: typeof ReadableStream
|
|
83
|
-
export { _ReadableStream as ReadableStream }
|
|
81
|
+
type _ReadableStream<R = any> = ReadableStream<R>;
|
|
82
|
+
declare const _ReadableStream: typeof ReadableStream;
|
|
83
|
+
export { _ReadableStream as ReadableStream };
|