@lorikeetai/node-sdk 0.1.0 → 0.3.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.
Files changed (131) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +11 -11
  3. package/_shims/MultipartBody.js.map +1 -1
  4. package/_shims/MultipartBody.mjs.map +1 -1
  5. package/_shims/auto/runtime-bun.d.ts.map +1 -1
  6. package/_shims/auto/runtime-bun.js.map +1 -1
  7. package/_shims/auto/runtime-node.d.ts.map +1 -1
  8. package/_shims/auto/runtime-node.js.map +1 -1
  9. package/_shims/auto/runtime.d.ts.map +1 -1
  10. package/_shims/auto/runtime.js.map +1 -1
  11. package/_shims/auto/types-node.d.ts.map +1 -1
  12. package/_shims/auto/types-node.js.map +1 -1
  13. package/_shims/auto/types.d.ts +52 -52
  14. package/_shims/bun-runtime.d.ts.map +1 -1
  15. package/_shims/bun-runtime.js.map +1 -1
  16. package/_shims/bun-runtime.mjs.map +1 -1
  17. package/_shims/index.d.ts +36 -36
  18. package/_shims/index.js +5 -5
  19. package/_shims/index.mjs +4 -4
  20. package/_shims/node-runtime.d.ts.map +1 -1
  21. package/_shims/node-runtime.js.map +1 -1
  22. package/_shims/node-runtime.mjs.map +1 -1
  23. package/_shims/node-types.d.ts +27 -27
  24. package/_shims/registry.d.ts.map +1 -1
  25. package/_shims/registry.js.map +1 -1
  26. package/_shims/registry.mjs.map +1 -1
  27. package/_shims/web-runtime.d.ts.map +1 -1
  28. package/_shims/web-runtime.js.map +1 -1
  29. package/_shims/web-runtime.mjs.map +1 -1
  30. package/_shims/web-types.d.ts +52 -52
  31. package/core.d.ts.map +1 -1
  32. package/core.js +0 -1
  33. package/core.js.map +1 -1
  34. package/core.mjs +0 -1
  35. package/core.mjs.map +1 -1
  36. package/error.d.ts.map +1 -1
  37. package/error.js.map +1 -1
  38. package/error.mjs.map +1 -1
  39. package/index.d.mts +2 -5
  40. package/index.d.ts +2 -5
  41. package/index.d.ts.map +1 -1
  42. package/index.js +0 -3
  43. package/index.js.map +1 -1
  44. package/index.mjs +1 -4
  45. package/index.mjs.map +1 -1
  46. package/lib/generate-signature.js.map +1 -1
  47. package/lib/generate-signature.mjs.map +1 -1
  48. package/package.json +1 -1
  49. package/resource.d.ts.map +1 -1
  50. package/resource.js.map +1 -1
  51. package/resource.mjs.map +1 -1
  52. package/resources/conversation/chat.d.ts +58 -6
  53. package/resources/conversation/chat.d.ts.map +1 -1
  54. package/resources/conversation/chat.js.map +1 -1
  55. package/resources/conversation/chat.mjs.map +1 -1
  56. package/resources/conversation/conversation.d.ts.map +1 -1
  57. package/resources/conversation/conversation.js.map +1 -1
  58. package/resources/conversation/conversation.mjs.map +1 -1
  59. package/resources/conversation/email.d.ts.map +1 -1
  60. package/resources/conversation/email.js.map +1 -1
  61. package/resources/conversation/email.mjs.map +1 -1
  62. package/resources/conversation/index.d.ts.map +1 -1
  63. package/resources/conversation/index.js.map +1 -1
  64. package/resources/customer.d.ts +21 -1
  65. package/resources/customer.d.ts.map +1 -1
  66. package/resources/customer.js +7 -0
  67. package/resources/customer.js.map +1 -1
  68. package/resources/customer.mjs +7 -0
  69. package/resources/customer.mjs.map +1 -1
  70. package/resources/index.d.ts +1 -2
  71. package/resources/index.d.ts.map +1 -1
  72. package/resources/index.js +1 -3
  73. package/resources/index.js.map +1 -1
  74. package/resources/index.mjs +1 -2
  75. package/resources/index.mjs.map +1 -1
  76. package/resources/ingest.d.ts.map +1 -1
  77. package/resources/ingest.js.map +1 -1
  78. package/resources/ingest.mjs.map +1 -1
  79. package/shims/node.d.ts.map +1 -1
  80. package/shims/node.js.map +1 -1
  81. package/shims/node.mjs.map +1 -1
  82. package/shims/web.d.ts.map +1 -1
  83. package/shims/web.js.map +1 -1
  84. package/shims/web.mjs.map +1 -1
  85. package/src/_shims/MultipartBody.ts +1 -1
  86. package/src/_shims/auto/runtime-bun.ts +1 -1
  87. package/src/_shims/auto/runtime-node.ts +1 -1
  88. package/src/_shims/auto/runtime.ts +1 -1
  89. package/src/_shims/auto/types-node.ts +1 -1
  90. package/src/_shims/auto/types.d.ts +52 -52
  91. package/src/_shims/bun-runtime.ts +6 -6
  92. package/src/_shims/index.d.ts +36 -36
  93. package/src/_shims/index.js +5 -5
  94. package/src/_shims/index.mjs +4 -4
  95. package/src/_shims/node-runtime.ts +32 -32
  96. package/src/_shims/node-types.d.ts +27 -27
  97. package/src/_shims/registry.ts +44 -44
  98. package/src/_shims/web-runtime.ts +16 -16
  99. package/src/_shims/web-types.d.ts +52 -52
  100. package/src/core.ts +372 -372
  101. package/src/error.ts +37 -37
  102. package/src/index.ts +73 -74
  103. package/src/lib/generate-signature.ts +3 -3
  104. package/src/resource.ts +3 -3
  105. package/src/resources/conversation/chat.ts +85 -23
  106. package/src/resources/conversation/conversation.ts +11 -11
  107. package/src/resources/conversation/email.ts +8 -8
  108. package/src/resources/conversation/index.ts +3 -3
  109. package/src/resources/customer.ts +34 -0
  110. package/src/resources/index.ts +9 -4
  111. package/src/resources/ingest.ts +7 -7
  112. package/src/shims/node.ts +24 -24
  113. package/src/shims/web.ts +24 -24
  114. package/src/uploads.ts +72 -72
  115. package/src/version.ts +1 -1
  116. package/uploads.d.ts.map +1 -1
  117. package/uploads.js.map +1 -1
  118. package/uploads.mjs.map +1 -1
  119. package/version.d.ts +1 -1
  120. package/version.d.ts.map +1 -1
  121. package/version.js +1 -1
  122. package/version.js.map +1 -1
  123. package/version.mjs +1 -1
  124. package/version.mjs.map +1 -1
  125. package/resources/token.d.ts +0 -28
  126. package/resources/token.d.ts.map +0 -1
  127. package/resources/token.js +0 -16
  128. package/resources/token.js.map +0 -1
  129. package/resources/token.mjs +0 -12
  130. package/resources/token.mjs.map +0 -1
  131. package/src/resources/token.ts +0 -42
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../resource'
4
- import * as ChatAPI from './chat'
3
+ import { APIResource } from '../../resource';
4
+ import * as ChatAPI from './chat';
5
5
  import {
6
6
  Chat,
7
7
  ChatGenerateParams,
@@ -10,24 +10,24 @@ import {
10
10
  ChatGetResponse,
11
11
  ChatStartParams,
12
12
  ChatStartResponse,
13
- } from './chat'
14
- import * as EmailAPI from './email'
15
- import { Email, EmailStartParams, EmailStartResponse } from './email'
13
+ } from './chat';
14
+ import * as EmailAPI from './email';
15
+ import { Email, EmailStartParams, EmailStartResponse } from './email';
16
16
 
17
17
  export class Conversation extends APIResource {
18
- email: EmailAPI.Email = new EmailAPI.Email(this._client)
19
- chat: ChatAPI.Chat = new ChatAPI.Chat(this._client)
18
+ email: EmailAPI.Email = new EmailAPI.Email(this._client);
19
+ chat: ChatAPI.Chat = new ChatAPI.Chat(this._client);
20
20
  }
21
21
 
22
- Conversation.Email = Email
23
- Conversation.Chat = Chat
22
+ Conversation.Email = Email;
23
+ Conversation.Chat = Chat;
24
24
 
25
25
  export declare namespace Conversation {
26
26
  export {
27
27
  Email as Email,
28
28
  type EmailStartResponse as EmailStartResponse,
29
29
  type EmailStartParams as EmailStartParams,
30
- }
30
+ };
31
31
 
32
32
  export {
33
33
  Chat as Chat,
@@ -37,5 +37,5 @@ export declare namespace Conversation {
37
37
  type ChatGenerateParams as ChatGenerateParams,
38
38
  type ChatGetParams as ChatGetParams,
39
39
  type ChatStartParams as ChatStartParams,
40
- }
40
+ };
41
41
  }
@@ -1,11 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../../resource'
4
- import * as Core from '../../core'
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
5
 
6
6
  export class Email extends APIResource {
7
7
  start(body: EmailStartParams, options?: Core.RequestOptions): Core.APIPromise<EmailStartResponse> {
8
- return this._client.post('/v1/conversation/email/create', { body, ...options })
8
+ return this._client.post('/v1/conversation/email/create', { body, ...options });
9
9
  }
10
10
  }
11
11
 
@@ -13,26 +13,26 @@ export interface EmailStartResponse {
13
13
  /**
14
14
  * The ID of the conversation
15
15
  */
16
- conversationId: unknown
16
+ conversationId: unknown;
17
17
 
18
18
  /**
19
19
  * The timestamp of the when the conversation was created in our system.
20
20
  */
21
- createdAt: string
21
+ createdAt: string;
22
22
  }
23
23
 
24
24
  export interface EmailStartParams {
25
25
  /**
26
26
  * The ID of the customer. If omitted, a new customer will be created.
27
27
  */
28
- customerId: unknown
28
+ customerId: unknown;
29
29
 
30
30
  /**
31
31
  * The timestamp of the when the conversation was created in our system.
32
32
  */
33
- subject?: string
33
+ subject?: string;
34
34
  }
35
35
 
36
36
  export declare namespace Email {
37
- export { type EmailStartResponse as EmailStartResponse, type EmailStartParams as EmailStartParams }
37
+ export { type EmailStartResponse as EmailStartResponse, type EmailStartParams as EmailStartParams };
38
38
  }
@@ -8,6 +8,6 @@ export {
8
8
  type ChatGenerateParams,
9
9
  type ChatGetParams,
10
10
  type ChatStartParams,
11
- } from './chat'
12
- export { Conversation } from './conversation'
13
- export { Email, type EmailStartResponse, type EmailStartParams } from './email'
11
+ } from './chat';
12
+ export { Conversation } from './conversation';
13
+ export { Email, type EmailStartResponse, type EmailStartParams } from './email';
@@ -7,6 +7,14 @@ export class Customer extends APIResource {
7
7
  create(body: CustomerCreateParams, options?: Core.RequestOptions): Core.APIPromise<CustomerCreateResponse> {
8
8
  return this._client.post('/v1/customer', { body, ...options });
9
9
  }
10
+
11
+ token(body: CustomerTokenParams, options?: Core.RequestOptions): Core.APIPromise<string> {
12
+ return this._client.post('/v1/customer/token', {
13
+ body,
14
+ ...options,
15
+ headers: { Accept: 'application/json', ...options?.headers },
16
+ });
17
+ }
10
18
  }
11
19
 
12
20
  export interface CustomerCreateResponse {
@@ -46,6 +54,8 @@ export interface CustomerCreateResponse {
46
54
  displayName?: string;
47
55
  }
48
56
 
57
+ export type CustomerTokenResponse = string;
58
+
49
59
  export interface CustomerCreateParams {
50
60
  /**
51
61
  * The email of the customer
@@ -73,9 +83,33 @@ export interface CustomerCreateParams {
73
83
  displayName?: string;
74
84
  }
75
85
 
86
+ export interface CustomerTokenParams {
87
+ /**
88
+ * The email of the user.
89
+ */
90
+ email: string;
91
+
92
+ /**
93
+ * The first name of the user.
94
+ */
95
+ firstName: string;
96
+
97
+ /**
98
+ * The last name of the user.
99
+ */
100
+ lastName: string;
101
+
102
+ /**
103
+ * The unique identifier of the user in your ticketing system.
104
+ */
105
+ remoteId: string;
106
+ }
107
+
76
108
  export declare namespace Customer {
77
109
  export {
78
110
  type CustomerCreateResponse as CustomerCreateResponse,
111
+ type CustomerTokenResponse as CustomerTokenResponse,
79
112
  type CustomerCreateParams as CustomerCreateParams,
113
+ type CustomerTokenParams as CustomerTokenParams,
80
114
  };
81
115
  }
@@ -1,6 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export { Conversation } from './conversation/conversation'
4
- export { Customer, type CustomerCreateResponse, type CustomerCreateParams } from './customer'
5
- export { Ingest, type IngestTestParams } from './ingest'
6
- export { Token, type TokenCreateResponse, type TokenCreateParams } from './token'
3
+ export { Conversation } from './conversation/conversation';
4
+ export {
5
+ Customer,
6
+ type CustomerCreateResponse,
7
+ type CustomerTokenResponse,
8
+ type CustomerCreateParams,
9
+ type CustomerTokenParams,
10
+ } from './customer';
11
+ export { Ingest, type IngestTestParams } from './ingest';
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { APIResource } from '../resource'
4
- import * as Core from '../core'
3
+ import { APIResource } from '../resource';
4
+ import * as Core from '../core';
5
5
 
6
6
  export class Ingest extends APIResource {
7
7
  test(toolId: unknown, body: IngestTestParams, options?: Core.RequestOptions): Core.APIPromise<void> {
@@ -9,14 +9,14 @@ export class Ingest extends APIResource {
9
9
  body,
10
10
  ...options,
11
11
  headers: { Accept: '*/*', ...options?.headers },
12
- })
12
+ });
13
13
  }
14
14
 
15
15
  validate(options?: Core.RequestOptions): Core.APIPromise<void> {
16
16
  return this._client.post('/ingest/validate', {
17
17
  ...options,
18
18
  headers: { Accept: '*/*', ...options?.headers },
19
- })
19
+ });
20
20
  }
21
21
  }
22
22
 
@@ -24,14 +24,14 @@ export interface IngestTestParams {
24
24
  /**
25
25
  * The data to simulate a test response for.
26
26
  */
27
- inputs: unknown
27
+ inputs: unknown;
28
28
 
29
29
  /**
30
30
  * The subscriber id to simulate a test response for.
31
31
  */
32
- subscriberId: string
32
+ subscriberId: string;
33
33
  }
34
34
 
35
35
  export declare namespace Ingest {
36
- export { type IngestTestParams as IngestTestParams }
36
+ export { type IngestTestParams as IngestTestParams };
37
37
  }
package/src/shims/node.ts CHANGED
@@ -1,50 +1,50 @@
1
1
  // @ts-ignore
2
- import * as types from '../_shims/node-types'
3
- import { setShims } from '../_shims/registry'
4
- import { getRuntime } from '../_shims/node-runtime'
5
- setShims(getRuntime())
2
+ import * as types from '../_shims/node-types';
3
+ import { setShims } from '../_shims/registry';
4
+ import { getRuntime } from '../_shims/node-runtime';
5
+ setShims(getRuntime());
6
6
 
7
7
  declare module '../_shims/manual-types' {
8
8
  export namespace manual {
9
9
  // @ts-ignore
10
- export type Agent = types.Agent
10
+ export type Agent = types.Agent;
11
11
  // @ts-ignore
12
- export import fetch = types.fetch
12
+ export import fetch = types.fetch;
13
13
  // @ts-ignore
14
- export type Request = types.Request
14
+ export type Request = types.Request;
15
15
  // @ts-ignore
16
- export type RequestInfo = types.RequestInfo
16
+ export type RequestInfo = types.RequestInfo;
17
17
  // @ts-ignore
18
- export type RequestInit = types.RequestInit
18
+ export type RequestInit = types.RequestInit;
19
19
  // @ts-ignore
20
- export type Response = types.Response
20
+ export type Response = types.Response;
21
21
  // @ts-ignore
22
- export type ResponseInit = types.ResponseInit
22
+ export type ResponseInit = types.ResponseInit;
23
23
  // @ts-ignore
24
- export type ResponseType = types.ResponseType
24
+ export type ResponseType = types.ResponseType;
25
25
  // @ts-ignore
26
- export type BodyInit = types.BodyInit
26
+ export type BodyInit = types.BodyInit;
27
27
  // @ts-ignore
28
- export type Headers = types.Headers
28
+ export type Headers = types.Headers;
29
29
  // @ts-ignore
30
- export type HeadersInit = types.HeadersInit
30
+ export type HeadersInit = types.HeadersInit;
31
31
  // @ts-ignore
32
- export type BlobPropertyBag = types.BlobPropertyBag
32
+ export type BlobPropertyBag = types.BlobPropertyBag;
33
33
  // @ts-ignore
34
- export type FilePropertyBag = types.FilePropertyBag
34
+ export type FilePropertyBag = types.FilePropertyBag;
35
35
  // @ts-ignore
36
- export type FileFromPathOptions = types.FileFromPathOptions
36
+ export type FileFromPathOptions = types.FileFromPathOptions;
37
37
  // @ts-ignore
38
- export import FormData = types.FormData
38
+ export import FormData = types.FormData;
39
39
  // @ts-ignore
40
- export import File = types.File
40
+ export import File = types.File;
41
41
  // @ts-ignore
42
- export import Blob = types.Blob
42
+ export import Blob = types.Blob;
43
43
  // @ts-ignore
44
- export type Readable = types.Readable
44
+ export type Readable = types.Readable;
45
45
  // @ts-ignore
46
- export type FsReadStream = types.FsReadStream
46
+ export type FsReadStream = types.FsReadStream;
47
47
  // @ts-ignore
48
- export import ReadableStream = types.ReadableStream
48
+ export import ReadableStream = types.ReadableStream;
49
49
  }
50
50
  }
package/src/shims/web.ts CHANGED
@@ -1,50 +1,50 @@
1
1
  // @ts-ignore
2
- import * as types from '../_shims/web-types'
3
- import { setShims } from '../_shims/registry'
4
- import { getRuntime } from '../_shims/web-runtime'
5
- setShims(getRuntime({ manuallyImported: true }))
2
+ import * as types from '../_shims/web-types';
3
+ import { setShims } from '../_shims/registry';
4
+ import { getRuntime } from '../_shims/web-runtime';
5
+ setShims(getRuntime({ manuallyImported: true }));
6
6
 
7
7
  declare module '../_shims/manual-types' {
8
8
  export namespace manual {
9
9
  // @ts-ignore
10
- export type Agent = types.Agent
10
+ export type Agent = types.Agent;
11
11
  // @ts-ignore
12
- export import fetch = types.fetch
12
+ export import fetch = types.fetch;
13
13
  // @ts-ignore
14
- export type Request = types.Request
14
+ export type Request = types.Request;
15
15
  // @ts-ignore
16
- export type RequestInfo = types.RequestInfo
16
+ export type RequestInfo = types.RequestInfo;
17
17
  // @ts-ignore
18
- export type RequestInit = types.RequestInit
18
+ export type RequestInit = types.RequestInit;
19
19
  // @ts-ignore
20
- export type Response = types.Response
20
+ export type Response = types.Response;
21
21
  // @ts-ignore
22
- export type ResponseInit = types.ResponseInit
22
+ export type ResponseInit = types.ResponseInit;
23
23
  // @ts-ignore
24
- export type ResponseType = types.ResponseType
24
+ export type ResponseType = types.ResponseType;
25
25
  // @ts-ignore
26
- export type BodyInit = types.BodyInit
26
+ export type BodyInit = types.BodyInit;
27
27
  // @ts-ignore
28
- export type Headers = types.Headers
28
+ export type Headers = types.Headers;
29
29
  // @ts-ignore
30
- export type HeadersInit = types.HeadersInit
30
+ export type HeadersInit = types.HeadersInit;
31
31
  // @ts-ignore
32
- export type BlobPropertyBag = types.BlobPropertyBag
32
+ export type BlobPropertyBag = types.BlobPropertyBag;
33
33
  // @ts-ignore
34
- export type FilePropertyBag = types.FilePropertyBag
34
+ export type FilePropertyBag = types.FilePropertyBag;
35
35
  // @ts-ignore
36
- export type FileFromPathOptions = types.FileFromPathOptions
36
+ export type FileFromPathOptions = types.FileFromPathOptions;
37
37
  // @ts-ignore
38
- export import FormData = types.FormData
38
+ export import FormData = types.FormData;
39
39
  // @ts-ignore
40
- export import File = types.File
40
+ export import File = types.File;
41
41
  // @ts-ignore
42
- export import Blob = types.Blob
42
+ export import Blob = types.Blob;
43
43
  // @ts-ignore
44
- export type Readable = types.Readable
44
+ export type Readable = types.Readable;
45
45
  // @ts-ignore
46
- export type FsReadStream = types.FsReadStream
46
+ export type FsReadStream = types.FsReadStream;
47
47
  // @ts-ignore
48
- export import ReadableStream = types.ReadableStream
48
+ export import ReadableStream = types.ReadableStream;
49
49
  }
50
50
  }