@great-detail/support-sdk 0.4.3 → 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 (96) hide show
  1. package/dist/{chunk-4WR77KQ5.js → chunk-23BXD6T5.js} +1 -1
  2. package/dist/{chunk-SEZCGFWP.js → chunk-F67NJYPP.js} +1 -1
  3. package/dist/cli/index.cjs +1 -1
  4. package/dist/cli/index.js +1 -1
  5. package/dist/cli.cjs +1 -1
  6. package/dist/cli.js +1 -1
  7. package/dist/index.cjs +1 -1
  8. package/dist/index.js +1 -1
  9. package/package.json +2 -3
  10. package/src/Action/ListActions.ts +0 -40
  11. package/src/Action/index.ts +0 -10
  12. package/src/Authentication/KeyAuthentication.ts +0 -50
  13. package/src/Authentication/PublicAuthentication.ts +0 -32
  14. package/src/Authentication/TokenAuthentication.ts +0 -41
  15. package/src/Authentication/index.ts +0 -13
  16. package/src/Boilerplate/CreateBoilerplateCategoryBoilerplate.ts +0 -55
  17. package/src/Boilerplate/GetBoilerplate.ts +0 -41
  18. package/src/Boilerplate/ListBoilerplateCategoryBoilerplates.ts +0 -41
  19. package/src/Boilerplate/ListBoilerplates.ts +0 -37
  20. package/src/Boilerplate/UpdateBoilerplate.ts +0 -53
  21. package/src/Boilerplate/index.ts +0 -14
  22. package/src/BoilerplateCategory/CreateBoilerplateCategory.ts +0 -52
  23. package/src/BoilerplateCategory/GetBoilerplateCategory.ts +0 -40
  24. package/src/BoilerplateCategory/ListBoilerplateCategories.ts +0 -39
  25. package/src/BoilerplateCategory/UpdateBoilerplateCategory.ts +0 -52
  26. package/src/BoilerplateCategory/index.ts +0 -13
  27. package/src/Channel/ListChannels.ts +0 -53
  28. package/src/Channel/index.ts +0 -10
  29. package/src/Client/index.ts +0 -206
  30. package/src/Contact/ContactVCF/GetContactVCF.ts +0 -45
  31. package/src/Contact/CreateContact.ts +0 -51
  32. package/src/Contact/GetContact.ts +0 -41
  33. package/src/Contact/ListContacts.ts +0 -37
  34. package/src/Contact/ListLabelContacts.ts +0 -41
  35. package/src/Contact/UpdateContact.ts +0 -54
  36. package/src/Contact/index.ts +0 -14
  37. package/src/Conversation/CreateConversation.ts +0 -58
  38. package/src/Conversation/GetConversation.ts +0 -45
  39. package/src/Conversation/ListContactConversations.ts +0 -45
  40. package/src/Conversation/ListConversations.ts +0 -41
  41. package/src/Conversation/ListLabelConversations.ts +0 -45
  42. package/src/Conversation/UpdateConversation.ts +0 -64
  43. package/src/Conversation/index.ts +0 -15
  44. package/src/Error/AuthError.ts +0 -12
  45. package/src/Error/AuthenticationError.ts +0 -16
  46. package/src/Error/AuthorizationError.ts +0 -16
  47. package/src/Error/LogicError.ts +0 -20
  48. package/src/Error/NetworkError.ts +0 -12
  49. package/src/Error/SupportError.ts +0 -10
  50. package/src/Error/ValidationError.ts +0 -16
  51. package/src/Error/index.ts +0 -20
  52. package/src/Label/CreateLabel.ts +0 -49
  53. package/src/Label/DeleteLabel.ts +0 -31
  54. package/src/Label/GetLabel.ts +0 -40
  55. package/src/Label/ListLabels.ts +0 -36
  56. package/src/Label/UpdateLabel.ts +0 -52
  57. package/src/Label/index.ts +0 -14
  58. package/src/Message/ListConversationMessages.ts +0 -49
  59. package/src/Message/ListMessages.ts +0 -45
  60. package/src/Message/index.ts +0 -11
  61. package/src/Model/Correction/CreateCorrectionModel.ts +0 -44
  62. package/src/Model/GetModel.ts +0 -39
  63. package/src/Model/ListModels.ts +0 -35
  64. package/src/Model/Response/CreateResponseModel.ts +0 -53
  65. package/src/Model/index.ts +0 -15
  66. package/src/Note/CreateContactNote.ts +0 -49
  67. package/src/Note/CreateConversationNote.ts +0 -49
  68. package/src/Note/GetNote.ts +0 -38
  69. package/src/Note/ListContactNotes.ts +0 -38
  70. package/src/Note/ListConversationNotes.ts +0 -38
  71. package/src/Note/UpdateNote.ts +0 -49
  72. package/src/Note/index.ts +0 -15
  73. package/src/NotificationSubscription/CreateContactNotificationSubscription.ts +0 -57
  74. package/src/NotificationSubscription/index.ts +0 -10
  75. package/src/Request/RequestFilterable.ts +0 -16
  76. package/src/Request/RequestStandardHeaders.ts +0 -32
  77. package/src/Source/GetSource.ts +0 -40
  78. package/src/Source/ListSources.ts +0 -36
  79. package/src/Source/index.ts +0 -11
  80. package/src/Transport/FetchTransport.ts +0 -100
  81. package/src/Transport/index.ts +0 -18
  82. package/src/Webhook/index.ts +0 -55
  83. package/src/__tests__/Client/Client.test.ts +0 -38
  84. package/src/cli/actions.ts +0 -31
  85. package/src/cli/channels.ts +0 -31
  86. package/src/cli/contacts.ts +0 -45
  87. package/src/cli/conversations.ts +0 -48
  88. package/src/cli/index.ts +0 -46
  89. package/src/cli/labels.ts +0 -62
  90. package/src/cli/messages.ts +0 -31
  91. package/src/cli/models.ts +0 -45
  92. package/src/cli/sources.ts +0 -45
  93. package/src/cli.ts +0 -13
  94. package/src/constants/environment.ts +0 -36
  95. package/src/constants/index.ts +0 -31
  96. package/src/index.ts +0 -39
@@ -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 { TOKEN_ENV_VAR } from "../constants/environment.js";
11
- import Authentication from "./index.js";
12
-
13
- export interface Options {
14
- token?: string;
15
- }
16
-
17
- export default class TokenAuthentication implements Authentication {
18
- #token: string;
19
-
20
- constructor({ token = process.env[TOKEN_ENV_VAR] }: Options = {}) {
21
- if (!token) {
22
- throw new Error(
23
- "Access Token option must be specified when using Token Authentication",
24
- );
25
- }
26
-
27
- this.#token = token;
28
- }
29
-
30
- public async filter() {
31
- return {
32
- headers: this.getHeaders(),
33
- };
34
- }
35
-
36
- public getHeaders() {
37
- return {
38
- Authorization: `Bearer ${this.#token}`,
39
- };
40
- }
41
- }
@@ -1,13 +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 RequestFilterable from "../Request/RequestFilterable.js";
11
-
12
- type Authentication = RequestFilterable;
13
- export default Authentication;
@@ -1,55 +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 CreateBoilerplateCategoryBoilerplate.SCHEMA>;
16
- request?: RequestInit;
17
- }
18
-
19
- export type CreateBoilerplateCategoryBoilerplateResponse = {
20
- boilerplate: {
21
- id: string;
22
- title: string;
23
- content: string;
24
- account: string;
25
- createdAt: string;
26
- updatedAt: string;
27
- };
28
- };
29
-
30
- export default class CreateBoilerplateCategoryBoilerplate {
31
- public static SCHEMA = z.object({
32
- title: z.string(),
33
- content: z.string(),
34
- account: z.string(),
35
- });
36
-
37
- constructor(protected _transport: FetchTransport) {}
38
-
39
- public async send({ id, body, request = {} }: Options) {
40
- return this._transport.send<CreateBoilerplateCategoryBoilerplateResponse>(
41
- "v1/boilerplate-categories/" + encodeURIComponent(id) + "/boilerplates",
42
- {
43
- ...request,
44
- method: "POST",
45
- headers: {
46
- ...request.headers,
47
- "Content-Type": "application/json",
48
- },
49
- body: JSON.stringify(
50
- CreateBoilerplateCategoryBoilerplate.SCHEMA.parse(body),
51
- ),
52
- },
53
- );
54
- }
55
- }
@@ -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
- id: string;
14
- request?: RequestInit;
15
- }
16
-
17
- export type GetBoilerplateResponse = {
18
- boilerplate: {
19
- id: string;
20
- title: string;
21
- content: string;
22
- account: string;
23
- boilerplateCategory: string;
24
- createdAt: string;
25
- updatedAt: string;
26
- };
27
- };
28
-
29
- export default class GetBoilerplate {
30
- constructor(protected _transport: FetchTransport) {}
31
-
32
- public async send({ id, request = {} }: Options) {
33
- return this._transport.send<GetBoilerplateResponse>(
34
- "v1/boilerplates/" + encodeURIComponent(id),
35
- {
36
- ...request,
37
- method: "GET",
38
- },
39
- );
40
- }
41
- }
@@ -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
- id: string;
14
- request?: RequestInit;
15
- }
16
-
17
- export default class ListBoilerplateCategoryBoilerplates {
18
- constructor(protected _transport: FetchTransport) {}
19
-
20
- public async send({ id, request = {} }: Options) {
21
- return this._transport.send<ListBoilerplateCategoryBoilerplatesResponse>(
22
- "v1/boilerplate-categories/" + encodeURIComponent(id) + "/boilerplates",
23
- {
24
- ...request,
25
- method: "GET",
26
- },
27
- );
28
- }
29
- }
30
-
31
- export type ListBoilerplateCategoryBoilerplatesResponse = {
32
- boilerplates: {
33
- id: string;
34
- title: string;
35
- content: string;
36
- account: string;
37
- boilerplateCategory: string;
38
- createdAt: string;
39
- updatedAt: string;
40
- }[];
41
- };
@@ -1,37 +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 ListBoilerplatesResponse = {
17
- boilerplates: {
18
- id: string;
19
- title: string;
20
- content: string;
21
- account: string;
22
- boilerplateCategory: string;
23
- createdAt: string;
24
- updatedAt: string;
25
- }[];
26
- };
27
-
28
- export default class ListBoilerplates {
29
- constructor(protected _transport: FetchTransport) {}
30
-
31
- public async send({ request = {} }: Options = {}) {
32
- return this._transport.send<ListBoilerplatesResponse>("v1/boilerplates", {
33
- ...request,
34
- method: "GET",
35
- });
36
- }
37
- }
@@ -1,53 +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 UpdateBoilerplate.SCHEMA>;
16
- request?: RequestInit;
17
- }
18
-
19
- export type UpdateBoilerplateResponse = {
20
- boilerplate: {
21
- id: string;
22
- title: string;
23
- content: string;
24
- account: string;
25
- boilerplateCategory: string;
26
- createdAt: string;
27
- updatedAt: string;
28
- };
29
- };
30
-
31
- export default class UpdateBoilerplate {
32
- public static SCHEMA = z.object({
33
- title: z.string().optional(),
34
- content: z.string().optional(),
35
- });
36
-
37
- constructor(protected _transport: FetchTransport) {}
38
-
39
- public async send({ id, body, request = {} }: Options) {
40
- return this._transport.send<UpdateBoilerplateResponse>(
41
- "v1/boilerplates/" + encodeURIComponent(id),
42
- {
43
- ...request,
44
- method: "PATCH",
45
- headers: {
46
- ...request.headers,
47
- "Content-Type": "application/json",
48
- },
49
- body: JSON.stringify(UpdateBoilerplate.SCHEMA.parse(body)),
50
- },
51
- );
52
- }
53
- }
@@ -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 CreateBoilerplateCategoryBoilerplateResponse } from "./CreateBoilerplateCategoryBoilerplate.js";
11
- export { type ListBoilerplateCategoryBoilerplatesResponse } from "./ListBoilerplateCategoryBoilerplates.js";
12
- export { type GetBoilerplateResponse } from "./GetBoilerplate.js";
13
- export { type ListBoilerplatesResponse } from "./ListBoilerplates.js";
14
- export { type UpdateBoilerplateResponse } from "./UpdateBoilerplate.js";
@@ -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
- body: z.infer<typeof CreateBoilerplateCategory.SCHEMA>;
15
- request?: RequestInit;
16
- }
17
-
18
- export type CreateBoilerplateCategoryResponse = {
19
- boilerplateCategory: {
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 CreateBoilerplateCategory {
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<CreateBoilerplateCategoryResponse>(
40
- "v1/boilerplate-categories",
41
- {
42
- ...request,
43
- method: "POST",
44
- headers: {
45
- ...request.headers,
46
- "Content-Type": "application/json",
47
- },
48
- body: JSON.stringify(CreateBoilerplateCategory.SCHEMA.parse(body)),
49
- },
50
- );
51
- }
52
- }
@@ -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 GetBoilerplateCategoryResponse = {
18
- boilerplateCategory: {
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 GetBoilerplateCategory {
29
- constructor(protected _transport: FetchTransport) {}
30
-
31
- public async send({ id, request = {} }: Options) {
32
- return this._transport.send<GetBoilerplateCategoryResponse>(
33
- "v1/boilerplate-categories/" + encodeURIComponent(id),
34
- {
35
- ...request,
36
- method: "GET",
37
- },
38
- );
39
- }
40
- }
@@ -1,39 +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 ListBoilerplateCategoriesResponse = {
17
- boilerplateCategories: {
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 ListBoilerplateCategories {
28
- constructor(protected _transport: FetchTransport) {}
29
-
30
- public async send({ request = {} }: Options = {}) {
31
- return this._transport.send<ListBoilerplateCategoriesResponse>(
32
- "v1/boilerplate-categories",
33
- {
34
- ...request,
35
- method: "GET",
36
- },
37
- );
38
- }
39
- }
@@ -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 UpdateBoilerplateCategory.SCHEMA>;
16
- request?: RequestInit;
17
- }
18
-
19
- export type UpdateBoilerplateCategoryResponse = {
20
- boilerplateCategory: {
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 UpdateBoilerplateCategory {
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<UpdateBoilerplateCategoryResponse>(
40
- "v1/boilerplate-categories/" + encodeURIComponent(id),
41
- {
42
- ...request,
43
- method: "PATCH",
44
- headers: {
45
- ...request.headers,
46
- "Content-Type": "application/json",
47
- },
48
- body: JSON.stringify(UpdateBoilerplateCategory.SCHEMA.parse(body)),
49
- },
50
- );
51
- }
52
- }
@@ -1,13 +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 CreateBoilerplateCategoryResponse } from "./CreateBoilerplateCategory.js";
11
- export { type GetBoilerplateCategoryResponse } from "./GetBoilerplateCategory.js";
12
- export { type ListBoilerplateCategoriesResponse } from "./ListBoilerplateCategories.js";
13
- export { type UpdateBoilerplateCategoryResponse } from "./UpdateBoilerplateCategory.js";
@@ -1,53 +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 ListChannelsResponse = {
17
- channels: ({
18
- id: string;
19
- name?: string;
20
- channelStatus: "ActiveChannelStatus" | "PotentialChannelStatus";
21
- account: string;
22
- createdAt: string;
23
- updatedAt?: string;
24
- } & (
25
- | {
26
- source: "meta-whatsapp";
27
- metaWhatsapp: {
28
- id: string;
29
- whatsappAccountID: string;
30
- whatsappPhoneNumberID: string;
31
- accessToken: string;
32
- };
33
- }
34
- | {
35
- source: "twilio-sendgrid";
36
- twilioSendgrid: {
37
- id: string;
38
- apiKey: string;
39
- };
40
- }
41
- ))[];
42
- };
43
-
44
- export default class ListChannels {
45
- constructor(protected _transport: FetchTransport) {}
46
-
47
- public async send({ request = {} }: Options = {}) {
48
- return this._transport.send<ListChannelsResponse>("v1/channels", {
49
- ...request,
50
- method: "GET",
51
- });
52
- }
53
- }
@@ -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 { type ListChannelsResponse } from "./ListChannels.js";