@great-detail/support-sdk 0.4.4 → 0.4.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.
Files changed (88) hide show
  1. package/package.json +2 -3
  2. package/src/Action/ListActions.ts +0 -40
  3. package/src/Action/index.ts +0 -10
  4. package/src/Authentication/KeyAuthentication.ts +0 -50
  5. package/src/Authentication/PublicAuthentication.ts +0 -32
  6. package/src/Authentication/TokenAuthentication.ts +0 -41
  7. package/src/Authentication/index.ts +0 -13
  8. package/src/Boilerplate/CreateBoilerplateCategoryBoilerplate.ts +0 -55
  9. package/src/Boilerplate/GetBoilerplate.ts +0 -41
  10. package/src/Boilerplate/ListBoilerplateCategoryBoilerplates.ts +0 -41
  11. package/src/Boilerplate/ListBoilerplates.ts +0 -37
  12. package/src/Boilerplate/UpdateBoilerplate.ts +0 -53
  13. package/src/Boilerplate/index.ts +0 -14
  14. package/src/BoilerplateCategory/CreateBoilerplateCategory.ts +0 -52
  15. package/src/BoilerplateCategory/GetBoilerplateCategory.ts +0 -40
  16. package/src/BoilerplateCategory/ListBoilerplateCategories.ts +0 -39
  17. package/src/BoilerplateCategory/UpdateBoilerplateCategory.ts +0 -52
  18. package/src/BoilerplateCategory/index.ts +0 -13
  19. package/src/Channel/ListChannels.ts +0 -53
  20. package/src/Channel/index.ts +0 -10
  21. package/src/Client/index.ts +0 -206
  22. package/src/Contact/ContactVCF/GetContactVCF.ts +0 -45
  23. package/src/Contact/CreateContact.ts +0 -51
  24. package/src/Contact/GetContact.ts +0 -41
  25. package/src/Contact/ListContacts.ts +0 -37
  26. package/src/Contact/ListLabelContacts.ts +0 -41
  27. package/src/Contact/UpdateContact.ts +0 -54
  28. package/src/Contact/index.ts +0 -14
  29. package/src/Conversation/CreateConversation.ts +0 -58
  30. package/src/Conversation/GetConversation.ts +0 -45
  31. package/src/Conversation/ListContactConversations.ts +0 -45
  32. package/src/Conversation/ListConversations.ts +0 -41
  33. package/src/Conversation/ListLabelConversations.ts +0 -45
  34. package/src/Conversation/UpdateConversation.ts +0 -64
  35. package/src/Conversation/index.ts +0 -15
  36. package/src/Error/AuthError.ts +0 -12
  37. package/src/Error/AuthenticationError.ts +0 -16
  38. package/src/Error/AuthorizationError.ts +0 -16
  39. package/src/Error/LogicError.ts +0 -20
  40. package/src/Error/NetworkError.ts +0 -12
  41. package/src/Error/SupportError.ts +0 -10
  42. package/src/Error/ValidationError.ts +0 -16
  43. package/src/Error/index.ts +0 -20
  44. package/src/Label/CreateLabel.ts +0 -49
  45. package/src/Label/DeleteLabel.ts +0 -31
  46. package/src/Label/GetLabel.ts +0 -40
  47. package/src/Label/ListLabels.ts +0 -36
  48. package/src/Label/UpdateLabel.ts +0 -52
  49. package/src/Label/index.ts +0 -14
  50. package/src/Message/ListConversationMessages.ts +0 -49
  51. package/src/Message/ListMessages.ts +0 -45
  52. package/src/Message/index.ts +0 -11
  53. package/src/Model/Correction/CreateCorrectionModel.ts +0 -44
  54. package/src/Model/GetModel.ts +0 -39
  55. package/src/Model/ListModels.ts +0 -35
  56. package/src/Model/Response/CreateResponseModel.ts +0 -53
  57. package/src/Model/index.ts +0 -15
  58. package/src/Note/CreateContactNote.ts +0 -49
  59. package/src/Note/CreateConversationNote.ts +0 -49
  60. package/src/Note/GetNote.ts +0 -38
  61. package/src/Note/ListContactNotes.ts +0 -38
  62. package/src/Note/ListConversationNotes.ts +0 -38
  63. package/src/Note/UpdateNote.ts +0 -49
  64. package/src/Note/index.ts +0 -15
  65. package/src/NotificationSubscription/CreateContactNotificationSubscription.ts +0 -57
  66. package/src/NotificationSubscription/index.ts +0 -10
  67. package/src/Request/RequestFilterable.ts +0 -16
  68. package/src/Request/RequestStandardHeaders.ts +0 -32
  69. package/src/Source/GetSource.ts +0 -40
  70. package/src/Source/ListSources.ts +0 -36
  71. package/src/Source/index.ts +0 -11
  72. package/src/Transport/FetchTransport.ts +0 -100
  73. package/src/Transport/index.ts +0 -18
  74. package/src/Webhook/index.ts +0 -55
  75. package/src/__tests__/Client/Client.test.ts +0 -38
  76. package/src/cli/actions.ts +0 -31
  77. package/src/cli/channels.ts +0 -31
  78. package/src/cli/contacts.ts +0 -45
  79. package/src/cli/conversations.ts +0 -48
  80. package/src/cli/index.ts +0 -46
  81. package/src/cli/labels.ts +0 -62
  82. package/src/cli/messages.ts +0 -31
  83. package/src/cli/models.ts +0 -45
  84. package/src/cli/sources.ts +0 -45
  85. package/src/cli.ts +0 -13
  86. package/src/constants/environment.ts +0 -36
  87. package/src/constants/index.ts +0 -31
  88. package/src/index.ts +0 -39
@@ -1,45 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import FetchTransport from "../Transport/FetchTransport.js";
11
-
12
- export interface Options {
13
- id: string;
14
- request?: RequestInit;
15
- }
16
-
17
- export type ListContactConversationsResponse = {
18
- conversations: {
19
- id: string;
20
- name?: string;
21
- hasEnded: boolean;
22
- conversationStatus:
23
- | "AwaitingContactConversationStatus"
24
- | "AwaitingAgentConversationStatus"
25
- | "ResolvedConversationStatus"
26
- | "ClosedConversationStatus";
27
- accountChannel: string;
28
- createdAt: string;
29
- updatedAt: string;
30
- }[];
31
- };
32
-
33
- export default class ListContactConversations {
34
- constructor(protected _transport: FetchTransport) {}
35
-
36
- public async send({ id, request = {} }: Options) {
37
- return this._transport.send<ListContactConversationsResponse>(
38
- "v1/contacts/" + encodeURIComponent(id) + "/conversations",
39
- {
40
- ...request,
41
- method: "GET",
42
- },
43
- );
44
- }
45
- }
@@ -1,41 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import FetchTransport from "../Transport/FetchTransport.js";
11
-
12
- export interface Options {
13
- request?: RequestInit;
14
- }
15
-
16
- export type ListConversationsResponse = {
17
- conversations: {
18
- id: string;
19
- name?: string;
20
- hasEnded: boolean;
21
- conversationStatus:
22
- | "AwaitingContactConversationStatus"
23
- | "AwaitingAgentConversationStatus"
24
- | "ResolvedConversationStatus"
25
- | "ClosedConversationStatus";
26
- accountChannel: string;
27
- createdAt: string;
28
- updatedAt: string;
29
- }[];
30
- };
31
-
32
- export default class ListConversations {
33
- constructor(protected _transport: FetchTransport) {}
34
-
35
- public async send({ request = {} }: Options = {}) {
36
- return this._transport.send<ListConversationsResponse>("v1/conversations", {
37
- ...request,
38
- method: "GET",
39
- });
40
- }
41
- }
@@ -1,45 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import FetchTransport from "../Transport/FetchTransport.js";
11
-
12
- export interface Options {
13
- id: string;
14
- request?: RequestInit;
15
- }
16
-
17
- export type ListLabelConversationsResponse = {
18
- conversations: {
19
- id: string;
20
- name?: string;
21
- hasEnded: boolean;
22
- conversationStatus:
23
- | "AwaitingContactConversationStatus"
24
- | "AwaitingAgentConversationStatus"
25
- | "ResolvedConversationStatus"
26
- | "ClosedConversationStatus";
27
- accountChannel: string;
28
- createdAt: string;
29
- updatedAt: string;
30
- }[];
31
- };
32
-
33
- export default class ListLabelConversations {
34
- constructor(protected _transport: FetchTransport) {}
35
-
36
- public async send({ id, request = {} }: Options) {
37
- return this._transport.send<ListLabelConversationsResponse>(
38
- "v1/labels/" + encodeURIComponent(id) + "/conversations",
39
- {
40
- ...request,
41
- method: "GET",
42
- },
43
- );
44
- }
45
- }
@@ -1,64 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import { z } from "zod";
11
- import FetchTransport from "../Transport/FetchTransport.js";
12
-
13
- export interface Options {
14
- id: string;
15
- body: z.infer<typeof UpdateConversation.SCHEMA>;
16
- request?: RequestInit;
17
- }
18
-
19
- export type UpdateConversationResponse = {
20
- conversation: {
21
- id: string;
22
- name?: string;
23
- hasEnded: boolean;
24
- conversationStatus:
25
- | "AwaitingContactConversationStatus"
26
- | "AwaitingAgentConversationStatus"
27
- | "ResolvedConversationStatus"
28
- | "ClosedConversationStatus";
29
- accountChannel: string;
30
- createdAt: string;
31
- updatedAt: string;
32
- };
33
- };
34
-
35
- export default class UpdateConversation {
36
- public static SCHEMA = z.object({
37
- conversationStatus: z
38
- .enum([
39
- "AwaitingContactConversationStatus",
40
- "AwaitingAgentConversationStatus",
41
- "ResolvedConversationStatus",
42
- "ClosedConversationStatus",
43
- ])
44
- .optional(),
45
- hasEnded: z.boolean().optional(),
46
- });
47
-
48
- constructor(protected _transport: FetchTransport) {}
49
-
50
- public async send({ id, body, request = {} }: Options) {
51
- return this._transport.send<UpdateConversationResponse>(
52
- "v1/conversations/" + encodeURIComponent(id),
53
- {
54
- ...request,
55
- method: "PATCH",
56
- headers: {
57
- ...request.headers,
58
- "Content-Type": "application/json",
59
- },
60
- body: JSON.stringify(UpdateConversation.SCHEMA.parse(body)),
61
- },
62
- );
63
- }
64
- }
@@ -1,15 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- export { type GetConversationResponse } from "./GetConversation.js";
11
- export { type ListConversationsResponse } from "./ListConversations.js";
12
- export { type ListLabelConversationsResponse } from "./ListLabelConversations.js";
13
- export { type UpdateConversationResponse } from "./UpdateConversation.js";
14
- export { type ListContactConversationsResponse } from "./ListContactConversations.js";
15
- export { type CreateConversationResponse } from "./CreateConversation.js";
@@ -1,12 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import SupportError from "./SupportError.js";
11
-
12
- export default class AuthError extends SupportError {}
@@ -1,16 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import AuthError from "./AuthError.js";
11
-
12
- export default class AuthenticationError extends AuthError {
13
- public static unauthenticated() {
14
- return new this("An unauthenticated request occurred");
15
- }
16
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import AuthError from "./AuthError.js";
11
-
12
- export default class AuthorizationError extends AuthError {
13
- public static forbidden() {
14
- return new this("A forbidden request occurred");
15
- }
16
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import SupportError from "./SupportError.js";
11
-
12
- export default class LogicError extends SupportError {
13
- public static notFound(url: string) {
14
- return new this(`Record not found for request: ${url}`);
15
- }
16
-
17
- public static forbiddenMethod(method: string, url: string) {
18
- return new this(`Forbidden method for request: ${method} ${url}`);
19
- }
20
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import SupportError from "./SupportError.js";
11
-
12
- export default class NetworkError extends SupportError {}
@@ -1,10 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- export default class SupportError extends Error {}
@@ -1,16 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import SupportError from "./SupportError.js";
11
-
12
- export default class ValidationError extends SupportError {
13
- public static badRequest() {
14
- return new this(`Bad request`);
15
- }
16
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- export { default as SupportError } from "./SupportError.js";
11
-
12
- export { default as NetworkError } from "./NetworkError.js";
13
-
14
- export { default as AuthError } from "./AuthError.js";
15
- export { default as AuthenticationError } from "./AuthenticationError.js";
16
- export { default as AuthorizationError } from "./AuthorizationError.js";
17
-
18
- export { default as ValidationError } from "./ValidationError.js";
19
-
20
- export { default as LogicError } from "./LogicError.js";
@@ -1,49 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import { z } from "zod";
11
- import FetchTransport from "../Transport/FetchTransport.js";
12
-
13
- export interface Options {
14
- body: z.infer<typeof CreateLabel.SCHEMA>;
15
- request?: RequestInit;
16
- }
17
-
18
- export type CreateLabelResponse = {
19
- label: {
20
- id: string;
21
- title: string;
22
- description?: string;
23
- account: string;
24
- createdAt: string;
25
- updatedAt?: string;
26
- };
27
- };
28
-
29
- export default class CreateLabel {
30
- public static SCHEMA = z.object({
31
- title: z.string(),
32
- description: z.string().optional(),
33
- account: z.string(),
34
- });
35
-
36
- constructor(protected _transport: FetchTransport) {}
37
-
38
- public async send({ body, request = {} }: Options) {
39
- return this._transport.send<CreateLabelResponse>("v1/labels", {
40
- ...request,
41
- method: "POST",
42
- headers: {
43
- ...request.headers,
44
- "Content-Type": "application/json",
45
- },
46
- body: JSON.stringify(CreateLabel.SCHEMA.parse(body)),
47
- });
48
- }
49
- }
@@ -1,31 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import FetchTransport from "../Transport/FetchTransport.js";
11
-
12
- export interface Options {
13
- id: string;
14
- request?: RequestInit;
15
- }
16
-
17
- export type DeleteLabelResponse = Record<string, never>;
18
-
19
- export default class DeleteLabel {
20
- constructor(protected _transport: FetchTransport) {}
21
-
22
- public async send({ id, request = {} }: Options) {
23
- return this._transport.send<DeleteLabelResponse>(
24
- "v1/labels/" + encodeURIComponent(id),
25
- {
26
- ...request,
27
- method: "DELETE",
28
- },
29
- );
30
- }
31
- }
@@ -1,40 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import FetchTransport from "../Transport/FetchTransport.js";
11
-
12
- export interface Options {
13
- id: string;
14
- request?: RequestInit;
15
- }
16
-
17
- export type GetLabelResponse = {
18
- label: {
19
- id: string;
20
- title: string;
21
- description?: string;
22
- account: string;
23
- createdAt: string;
24
- updatedAt?: string;
25
- };
26
- };
27
-
28
- export default class GetLabel {
29
- constructor(protected _transport: FetchTransport) {}
30
-
31
- public async send({ id, request = {} }: Options) {
32
- return this._transport.send<GetLabelResponse>(
33
- "v1/labels/" + encodeURIComponent(id),
34
- {
35
- ...request,
36
- method: "GET",
37
- },
38
- );
39
- }
40
- }
@@ -1,36 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import FetchTransport from "../Transport/FetchTransport.js";
11
-
12
- export interface Options {
13
- request?: RequestInit;
14
- }
15
-
16
- export type ListLabelsResponse = {
17
- labels: {
18
- id: string;
19
- title: string;
20
- description?: string;
21
- account: string;
22
- createdAt: string;
23
- updatedAt?: string;
24
- }[];
25
- };
26
-
27
- export default class ListLabels {
28
- constructor(protected _transport: FetchTransport) {}
29
-
30
- public async send({ request = {} }: Options = {}) {
31
- return this._transport.send<ListLabelsResponse>("v1/labels", {
32
- ...request,
33
- method: "GET",
34
- });
35
- }
36
- }
@@ -1,52 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import { z } from "zod";
11
- import FetchTransport from "../Transport/FetchTransport.js";
12
-
13
- export interface Options {
14
- id: string;
15
- body: z.infer<typeof UpdateLabel.SCHEMA>;
16
- request?: RequestInit;
17
- }
18
-
19
- export type UpdateLabelResponse = {
20
- label: {
21
- id: string;
22
- title: string;
23
- description?: string;
24
- account: string;
25
- createdAt: string;
26
- updatedAt?: string;
27
- };
28
- };
29
-
30
- export default class UpdateLabel {
31
- public static SCHEMA = z.object({
32
- title: z.string().optional(),
33
- description: z.string().optional(),
34
- });
35
-
36
- constructor(protected _transport: FetchTransport) {}
37
-
38
- public async send({ id, body, request = {} }: Options) {
39
- return this._transport.send<UpdateLabelResponse>(
40
- "v1/labels/" + encodeURIComponent(id),
41
- {
42
- ...request,
43
- method: "PATCH",
44
- headers: {
45
- ...request.headers,
46
- "Content-Type": "application/json",
47
- },
48
- body: JSON.stringify(UpdateLabel.SCHEMA.parse(body)),
49
- },
50
- );
51
- }
52
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- export { type CreateLabelResponse } from "./CreateLabel.js";
11
- export { type DeleteLabelResponse } from "./DeleteLabel.js";
12
- export { type GetLabelResponse } from "./GetLabel.js";
13
- export { type ListLabelsResponse } from "./ListLabels.js";
14
- export { type UpdateLabelResponse } from "./UpdateLabel.js";
@@ -1,49 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import FetchTransport from "../Transport/FetchTransport.js";
11
-
12
- export interface Options {
13
- id: string;
14
- request?: RequestInit;
15
- }
16
-
17
- export type ListConversationMessagesResponse = {
18
- messages: {
19
- id: string;
20
- role: "user" | "assistant";
21
- messageStatus: string;
22
- externalIdentifier?: string;
23
- conversation: string;
24
- contact: string;
25
- messageEvents: {
26
- id: string;
27
- messageEventType: string;
28
- triggeredAt: string;
29
- createdAt: string;
30
- updatedAt?: string;
31
- }[];
32
- createdAt: string;
33
- updatedAt: string;
34
- }[];
35
- };
36
-
37
- export default class ListConversationMessages {
38
- constructor(protected _transport: FetchTransport) {}
39
-
40
- public async send({ id, request = {} }: Options) {
41
- return this._transport.send<ListConversationMessagesResponse>(
42
- "v1/conversations/" + encodeURIComponent(id) + "/messages",
43
- {
44
- ...request,
45
- method: "GET",
46
- },
47
- );
48
- }
49
- }
@@ -1,45 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- import FetchTransport from "../Transport/FetchTransport.js";
11
-
12
- export interface Options {
13
- request?: RequestInit;
14
- }
15
-
16
- export type ListMessagesResponse = {
17
- messages: {
18
- id: string;
19
- role: "user" | "assistant";
20
- messageStatus: string;
21
- externalIdentifier?: string;
22
- conversation: string;
23
- contact: string;
24
- messageEvents: {
25
- id: string;
26
- messageEventType: string;
27
- triggeredAt: string;
28
- createdAt: string;
29
- updatedAt?: string;
30
- }[];
31
- createdAt: string;
32
- updatedAt: string;
33
- }[];
34
- };
35
-
36
- export default class ListMessages {
37
- constructor(protected _transport: FetchTransport) {}
38
-
39
- public async send({ request = {} }: Options = {}) {
40
- return this._transport.send<ListMessagesResponse>("v1/messages", {
41
- ...request,
42
- method: "GET",
43
- });
44
- }
45
- }
@@ -1,11 +0,0 @@
1
- /**
2
- * Great Detail Support System.
3
- *
4
- * @copyright 2024 Great Detail Ltd
5
- * @author Great Detail Ltd <info@greatdetail.com>
6
- * @author Dom Webber <dom.webber@greatdetail.com>
7
- * @see https://greatdetail.com
8
- */
9
-
10
- export { type ListConversationMessagesResponse } from "./ListConversationMessages.js";
11
- export { type ListMessagesResponse } from "./ListMessages.js";