@great-detail/support-sdk 0.1.5 → 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.
Files changed (63) hide show
  1. package/dist/chunk-IXJNWCJL.js +1 -0
  2. package/dist/{chunk-PTKKI5PQ.js → chunk-SRYAEALQ.js} +1 -1
  3. package/dist/cli/index.cjs +1 -1
  4. package/dist/cli/index.d.cts +1 -1
  5. package/dist/cli/index.d.ts +1 -1
  6. package/dist/cli/index.js +1 -1
  7. package/dist/cli.cjs +1 -1
  8. package/dist/cli.js +1 -1
  9. package/dist/{index-Dm8jdpkD.d.cts → index-Dj17QRj0.d.cts} +141 -111
  10. package/dist/{index-Dm8jdpkD.d.ts → index-Dj17QRj0.d.ts} +141 -111
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.d.cts +63 -6
  13. package/dist/index.d.ts +63 -6
  14. package/dist/index.js +1 -1
  15. package/package.json +2 -1
  16. package/src/Action/ListActions.ts +8 -12
  17. package/src/Authentication/KeyAuthentication.ts +10 -11
  18. package/src/Authentication/PublicAuthentication.ts +8 -2
  19. package/src/Authentication/TokenAuthentication.ts +9 -7
  20. package/src/Channel/ListChannels.ts +8 -12
  21. package/src/Client/index.ts +6 -5
  22. package/src/Contact/ContactVCF/GetContactVCF.ts +24 -5
  23. package/src/Contact/CreateContact.ts +12 -16
  24. package/src/Contact/GetContact.ts +8 -12
  25. package/src/Contact/ListContacts.ts +8 -12
  26. package/src/Contact/ListLabelContacts.ts +8 -12
  27. package/src/Contact/UpdateContact.ts +12 -16
  28. package/src/Conversation/GetConversation.ts +8 -12
  29. package/src/Conversation/ListConversations.ts +8 -12
  30. package/src/Conversation/ListLabelConversations.ts +8 -12
  31. package/src/Conversation/UpdateConversation.ts +12 -16
  32. package/src/Error/AuthError.ts +12 -0
  33. package/src/Error/AuthenticationError.ts +16 -0
  34. package/src/Error/AuthorizationError.ts +16 -0
  35. package/src/Error/LogicError.ts +20 -0
  36. package/src/Error/NetworkError.ts +12 -0
  37. package/src/Error/SupportError.ts +10 -0
  38. package/src/Error/ValidationError.ts +16 -0
  39. package/src/Error/index.ts +11 -0
  40. package/src/Label/CreateLabel.ts +12 -16
  41. package/src/Label/DeleteLabel.ts +8 -12
  42. package/src/Label/GetLabel.ts +8 -12
  43. package/src/Label/ListLabels.ts +8 -12
  44. package/src/Label/UpdateLabel.ts +12 -16
  45. package/src/Message/ListConversationMessages.ts +8 -12
  46. package/src/Message/ListMessages.ts +8 -12
  47. package/src/Model/Correction/CreateCorrectionModel.ts +12 -16
  48. package/src/Model/GetModel.ts +8 -12
  49. package/src/Model/ListModels.ts +8 -12
  50. package/src/Model/Response/CreateResponseModel.ts +12 -16
  51. package/src/Request/RequestFilterable.ts +5 -1
  52. package/src/Request/RequestStandardHeaders.ts +6 -6
  53. package/src/Source/GetSource.ts +8 -12
  54. package/src/Source/ListSources.ts +8 -12
  55. package/src/Transport/FetchTransport.ts +112 -0
  56. package/src/Transport/index.ts +2 -44
  57. package/src/__tests__/Client/Client.test.ts +38 -0
  58. package/src/constants/environment.ts +36 -0
  59. package/src/constants/index.ts +0 -21
  60. package/src/index.ts +4 -4
  61. package/dist/chunk-2LKRKCHH.js +0 -1
  62. package/src/__tests__/Authentication/KeyAuthentication.test.ts +0 -79
  63. package/src/__tests__/Authentication/TokenAuthentication.test.ts +0 -79
@@ -7,26 +7,22 @@
7
7
  * @see https://greatdetail.com
8
8
  */
9
9
 
10
- import Transport, { SendOptions } from "../Transport/index.js";
10
+ import FetchTransport from "../Transport/FetchTransport.js";
11
11
 
12
- export interface Options extends SendOptions {
12
+ export interface Options {
13
13
  id: string;
14
14
  request?: RequestInit;
15
15
  }
16
16
 
17
17
  export default class GetConversation {
18
- constructor(protected _transport: Transport) {}
18
+ constructor(protected _transport: FetchTransport) {}
19
19
 
20
- public async send({ id, request = {}, ...options }: Options) {
20
+ public async send({ id, request = {} }: Options) {
21
21
  return this._transport
22
- .send(
23
- "v1/conversations/" + encodeURIComponent(id),
24
- {
25
- ...request,
26
- method: "GET",
27
- },
28
- options,
29
- )
22
+ .send("v1/conversations/" + encodeURIComponent(id), {
23
+ ...request,
24
+ method: "GET",
25
+ })
30
26
  .then((response) => new GetConversationResponse(response));
31
27
  }
32
28
  }
@@ -7,25 +7,21 @@
7
7
  * @see https://greatdetail.com
8
8
  */
9
9
 
10
- import Transport, { SendOptions } from "../Transport/index.js";
10
+ import FetchTransport from "../Transport/FetchTransport.js";
11
11
 
12
- export interface Options extends SendOptions {
12
+ export interface Options {
13
13
  request?: RequestInit;
14
14
  }
15
15
 
16
16
  export default class ListConversations {
17
- constructor(protected _transport: Transport) {}
17
+ constructor(protected _transport: FetchTransport) {}
18
18
 
19
- public async send({ request = {}, ...options }: Options = {}) {
19
+ public async send({ request = {} }: Options = {}) {
20
20
  return this._transport
21
- .send(
22
- "v1/conversations",
23
- {
24
- ...request,
25
- method: "GET",
26
- },
27
- options,
28
- )
21
+ .send("v1/conversations", {
22
+ ...request,
23
+ method: "GET",
24
+ })
29
25
  .then((response) => new ListConversationsResponse(response));
30
26
  }
31
27
  }
@@ -7,26 +7,22 @@
7
7
  * @see https://greatdetail.com
8
8
  */
9
9
 
10
- import Transport, { SendOptions } from "../Transport/index.js";
10
+ import FetchTransport from "../Transport/FetchTransport.js";
11
11
 
12
- export interface Options extends SendOptions {
12
+ export interface Options {
13
13
  id: string;
14
14
  request?: RequestInit;
15
15
  }
16
16
 
17
17
  export default class ListLabelConversations {
18
- constructor(protected _transport: Transport) {}
18
+ constructor(protected _transport: FetchTransport) {}
19
19
 
20
- public async send({ id, request = {}, ...options }: Options) {
20
+ public async send({ id, request = {} }: Options) {
21
21
  return this._transport
22
- .send(
23
- "v1/labels/" + encodeURIComponent(id) + "/conversations",
24
- {
25
- ...request,
26
- method: "GET",
27
- },
28
- options,
29
- )
22
+ .send("v1/labels/" + encodeURIComponent(id) + "/conversations", {
23
+ ...request,
24
+ method: "GET",
25
+ })
30
26
  .then((response) => new ListLabelConversationsResponse(response));
31
27
  }
32
28
  }
@@ -8,9 +8,9 @@
8
8
  */
9
9
 
10
10
  import { z } from "zod";
11
- import Transport, { SendOptions } from "../Transport/index.js";
11
+ import FetchTransport from "../Transport/FetchTransport.js";
12
12
 
13
- export interface Options extends SendOptions {
13
+ export interface Options {
14
14
  id: string;
15
15
  body: z.infer<typeof UpdateConversation.SCHEMA>;
16
16
  request?: RequestInit;
@@ -21,23 +21,19 @@ export default class UpdateConversation {
21
21
  hasEnded: z.boolean(),
22
22
  });
23
23
 
24
- constructor(protected _transport: Transport) {}
24
+ constructor(protected _transport: FetchTransport) {}
25
25
 
26
- public async send({ id, body, request = {}, ...options }: Options) {
26
+ public async send({ id, body, request = {} }: Options) {
27
27
  return this._transport
28
- .send(
29
- "v1/conversations/" + encodeURIComponent(id),
30
- {
31
- ...request,
32
- method: "POST",
33
- headers: {
34
- ...request.headers,
35
- "Content-Type": "application/json",
36
- },
37
- body: JSON.stringify(UpdateConversation.SCHEMA.parse(body)),
28
+ .send("v1/conversations/" + encodeURIComponent(id), {
29
+ ...request,
30
+ method: "POST",
31
+ headers: {
32
+ ...request.headers,
33
+ "Content-Type": "application/json",
38
34
  },
39
- options,
40
- )
35
+ body: JSON.stringify(UpdateConversation.SCHEMA.parse(body)),
36
+ })
41
37
  .then((response) => new UpdateConversationResponse(response));
42
38
  }
43
39
  }
@@ -0,0 +1,12 @@
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 {}
@@ -0,0 +1,16 @@
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
+ }
@@ -0,0 +1,16 @@
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
+ }
@@ -0,0 +1,20 @@
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
+ }
@@ -0,0 +1,12 @@
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 {}
@@ -0,0 +1,10 @@
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 {}
@@ -0,0 +1,16 @@
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
+ }
@@ -0,0 +1,11 @@
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
+ export { default as NetworkError } from "./NetworkError.js";
@@ -8,9 +8,9 @@
8
8
  */
9
9
 
10
10
  import { z } from "zod";
11
- import Transport, { SendOptions } from "../Transport/index.js";
11
+ import FetchTransport from "../Transport/FetchTransport.js";
12
12
 
13
- export interface Options extends SendOptions {
13
+ export interface Options {
14
14
  body: z.infer<typeof CreateLabel.SCHEMA>;
15
15
  request?: RequestInit;
16
16
  }
@@ -22,23 +22,19 @@ export default class CreateLabel {
22
22
  account: z.string(),
23
23
  });
24
24
 
25
- constructor(protected _transport: Transport) {}
25
+ constructor(protected _transport: FetchTransport) {}
26
26
 
27
- public async send({ body, request = {}, ...options }: Options) {
27
+ public async send({ body, request = {} }: Options) {
28
28
  return this._transport
29
- .send(
30
- "v1/labels",
31
- {
32
- ...request,
33
- method: "POST",
34
- headers: {
35
- ...request.headers,
36
- "Content-Type": "application/json",
37
- },
38
- body: JSON.stringify(CreateLabel.SCHEMA.parse(body)),
29
+ .send("v1/labels", {
30
+ ...request,
31
+ method: "POST",
32
+ headers: {
33
+ ...request.headers,
34
+ "Content-Type": "application/json",
39
35
  },
40
- options,
41
- )
36
+ body: JSON.stringify(CreateLabel.SCHEMA.parse(body)),
37
+ })
42
38
  .then((response) => new CreateLabelResponse(response));
43
39
  }
44
40
  }
@@ -7,26 +7,22 @@
7
7
  * @see https://greatdetail.com
8
8
  */
9
9
 
10
- import Transport, { SendOptions } from "../Transport/index.js";
10
+ import FetchTransport from "../Transport/FetchTransport.js";
11
11
 
12
- export interface Options extends SendOptions {
12
+ export interface Options {
13
13
  id: string;
14
14
  request?: RequestInit;
15
15
  }
16
16
 
17
17
  export default class DeleteLabel {
18
- constructor(protected _transport: Transport) {}
18
+ constructor(protected _transport: FetchTransport) {}
19
19
 
20
- public async send({ id, request = {}, ...options }: Options) {
20
+ public async send({ id, request = {} }: Options) {
21
21
  return this._transport
22
- .send(
23
- "v1/labels/" + encodeURIComponent(id),
24
- {
25
- ...request,
26
- method: "DELETE",
27
- },
28
- options,
29
- )
22
+ .send("v1/labels/" + encodeURIComponent(id), {
23
+ ...request,
24
+ method: "DELETE",
25
+ })
30
26
  .then((response) => new DeleteLabelResponse(response));
31
27
  }
32
28
  }
@@ -7,26 +7,22 @@
7
7
  * @see https://greatdetail.com
8
8
  */
9
9
 
10
- import Transport, { SendOptions } from "../Transport/index.js";
10
+ import FetchTransport from "../Transport/FetchTransport.js";
11
11
 
12
- export interface Options extends SendOptions {
12
+ export interface Options {
13
13
  id: string;
14
14
  request?: RequestInit;
15
15
  }
16
16
 
17
17
  export default class GetLabel {
18
- constructor(protected _transport: Transport) {}
18
+ constructor(protected _transport: FetchTransport) {}
19
19
 
20
- public async send({ id, request = {}, ...options }: Options) {
20
+ public async send({ id, request = {} }: Options) {
21
21
  return this._transport
22
- .send(
23
- "v1/labels/" + encodeURIComponent(id),
24
- {
25
- ...request,
26
- method: "GET",
27
- },
28
- options,
29
- )
22
+ .send("v1/labels/" + encodeURIComponent(id), {
23
+ ...request,
24
+ method: "GET",
25
+ })
30
26
  .then((response) => new GetLabelResponse(response));
31
27
  }
32
28
  }
@@ -7,25 +7,21 @@
7
7
  * @see https://greatdetail.com
8
8
  */
9
9
 
10
- import Transport, { SendOptions } from "../Transport/index.js";
10
+ import FetchTransport from "../Transport/FetchTransport.js";
11
11
 
12
- export interface Options extends SendOptions {
12
+ export interface Options {
13
13
  request?: RequestInit;
14
14
  }
15
15
 
16
16
  export default class ListLabels {
17
- constructor(protected _transport: Transport) {}
17
+ constructor(protected _transport: FetchTransport) {}
18
18
 
19
- public async send({ request = {}, ...options }: Options = {}) {
19
+ public async send({ request = {} }: Options = {}) {
20
20
  return this._transport
21
- .send(
22
- "v1/labels",
23
- {
24
- ...request,
25
- method: "GET",
26
- },
27
- options,
28
- )
21
+ .send("v1/labels", {
22
+ ...request,
23
+ method: "GET",
24
+ })
29
25
  .then((response) => new ListLabelsResponse(response));
30
26
  }
31
27
  }
@@ -8,9 +8,9 @@
8
8
  */
9
9
 
10
10
  import { z } from "zod";
11
- import Transport, { SendOptions } from "../Transport/index.js";
11
+ import FetchTransport from "../Transport/FetchTransport.js";
12
12
 
13
- export interface Options extends SendOptions {
13
+ export interface Options {
14
14
  id: string;
15
15
  body: z.infer<typeof UpdateLabel.SCHEMA>;
16
16
  request?: RequestInit;
@@ -22,23 +22,19 @@ export default class UpdateLabel {
22
22
  description: z.string().optional(),
23
23
  });
24
24
 
25
- constructor(protected _transport: Transport) {}
25
+ constructor(protected _transport: FetchTransport) {}
26
26
 
27
- public async send({ id, body, request = {}, ...options }: Options) {
27
+ public async send({ id, body, request = {} }: Options) {
28
28
  return this._transport
29
- .send(
30
- "v1/labels/" + encodeURIComponent(id),
31
- {
32
- ...request,
33
- method: "PATCH",
34
- headers: {
35
- ...request.headers,
36
- "Content-Type": "application/json",
37
- },
38
- body: JSON.stringify(UpdateLabel.SCHEMA.parse(body)),
29
+ .send("v1/labels/" + encodeURIComponent(id), {
30
+ ...request,
31
+ method: "PATCH",
32
+ headers: {
33
+ ...request.headers,
34
+ "Content-Type": "application/json",
39
35
  },
40
- options,
41
- )
36
+ body: JSON.stringify(UpdateLabel.SCHEMA.parse(body)),
37
+ })
42
38
  .then((response) => new UpdateLabelResponse(response));
43
39
  }
44
40
  }
@@ -7,26 +7,22 @@
7
7
  * @see https://greatdetail.com
8
8
  */
9
9
 
10
- import Transport, { SendOptions } from "../Transport/index.js";
10
+ import FetchTransport from "../Transport/FetchTransport.js";
11
11
 
12
- export interface Options extends SendOptions {
12
+ export interface Options {
13
13
  id: string;
14
14
  request?: RequestInit;
15
15
  }
16
16
 
17
17
  export default class ListConversationMessages {
18
- constructor(protected _transport: Transport) {}
18
+ constructor(protected _transport: FetchTransport) {}
19
19
 
20
- public async send({ id, request = {}, ...options }: Options) {
20
+ public async send({ id, request = {} }: Options) {
21
21
  return this._transport
22
- .send(
23
- "v1/conversations/" + encodeURIComponent(id) + "/messages",
24
- {
25
- ...request,
26
- method: "GET",
27
- },
28
- options,
29
- )
22
+ .send("v1/conversations/" + encodeURIComponent(id) + "/messages", {
23
+ ...request,
24
+ method: "GET",
25
+ })
30
26
  .then((response) => new ListConversationMessagesResponse(response));
31
27
  }
32
28
  }
@@ -7,25 +7,21 @@
7
7
  * @see https://greatdetail.com
8
8
  */
9
9
 
10
- import Transport, { SendOptions } from "../Transport/index.js";
10
+ import FetchTransport from "../Transport/FetchTransport.js";
11
11
 
12
- export interface Options extends SendOptions {
12
+ export interface Options {
13
13
  request?: RequestInit;
14
14
  }
15
15
 
16
16
  export default class ListMessages {
17
- constructor(protected _transport: Transport) {}
17
+ constructor(protected _transport: FetchTransport) {}
18
18
 
19
- public async send({ request = {}, ...options }: Options = {}) {
19
+ public async send({ request = {} }: Options = {}) {
20
20
  return this._transport
21
- .send(
22
- "v1/messages",
23
- {
24
- ...request,
25
- method: "GET",
26
- },
27
- options,
28
- )
21
+ .send("v1/messages", {
22
+ ...request,
23
+ method: "GET",
24
+ })
29
25
  .then((response) => new ListMessagesResponse(response));
30
26
  }
31
27
  }
@@ -8,9 +8,9 @@
8
8
  */
9
9
 
10
10
  import { z } from "zod";
11
- import Transport, { SendOptions } from "../../Transport/index.js";
11
+ import FetchTransport from "../../Transport/FetchTransport.js";
12
12
 
13
- export interface Options extends SendOptions {
13
+ export interface Options {
14
14
  id: string;
15
15
  body: z.infer<typeof CreateCorrectionModel.SCHEMA>;
16
16
  request?: RequestInit;
@@ -23,23 +23,19 @@ export default class CreateCorrectionModel {
23
23
  correction: z.string().max(65_536),
24
24
  });
25
25
 
26
- constructor(protected _transport: Transport) {}
26
+ constructor(protected _transport: FetchTransport) {}
27
27
 
28
- public async send({ id, body, request = {}, ...options }: Options) {
28
+ public async send({ id, body, request = {} }: Options) {
29
29
  return this._transport
30
- .send(
31
- "v1/models/" + encodeURIComponent(id) + "/correction",
32
- {
33
- ...request,
34
- method: "POST",
35
- headers: {
36
- ...request.headers,
37
- "Content-Type": "application/json",
38
- },
39
- body: JSON.stringify(CreateCorrectionModel.SCHEMA.parse(body)),
30
+ .send("v1/models/" + encodeURIComponent(id) + "/correction", {
31
+ ...request,
32
+ method: "POST",
33
+ headers: {
34
+ ...request.headers,
35
+ "Content-Type": "application/json",
40
36
  },
41
- options,
42
- )
37
+ body: JSON.stringify(CreateCorrectionModel.SCHEMA.parse(body)),
38
+ })
43
39
  .then((response) => new CreateCorrectionModelResponse(response));
44
40
  }
45
41
  }
@@ -7,26 +7,22 @@
7
7
  * @see https://greatdetail.com
8
8
  */
9
9
 
10
- import Transport, { SendOptions } from "../Transport/index.js";
10
+ import FetchTransport from "../Transport/FetchTransport.js";
11
11
 
12
- export interface Options extends SendOptions {
12
+ export interface Options {
13
13
  id: string;
14
14
  request?: RequestInit;
15
15
  }
16
16
 
17
17
  export default class GetModel {
18
- constructor(protected _transport: Transport) {}
18
+ constructor(protected _transport: FetchTransport) {}
19
19
 
20
- public async send({ id, request = {}, ...options }: Options) {
20
+ public async send({ id, request = {} }: Options) {
21
21
  return this._transport
22
- .send(
23
- "v1/models/" + encodeURIComponent(id),
24
- {
25
- ...request,
26
- method: "GET",
27
- },
28
- options,
29
- )
22
+ .send("v1/models/" + encodeURIComponent(id), {
23
+ ...request,
24
+ method: "GET",
25
+ })
30
26
  .then((response) => new GetModelResponse(response));
31
27
  }
32
28
  }
@@ -7,25 +7,21 @@
7
7
  * @see https://greatdetail.com
8
8
  */
9
9
 
10
- import Transport, { SendOptions } from "../Transport/index.js";
10
+ import FetchTransport from "../Transport/FetchTransport.js";
11
11
 
12
- export interface Options extends SendOptions {
12
+ export interface Options {
13
13
  request?: RequestInit;
14
14
  }
15
15
 
16
16
  export default class ListModels {
17
- constructor(protected _transport: Transport) {}
17
+ constructor(protected _transport: FetchTransport) {}
18
18
 
19
- public async send({ request = {}, ...options }: Options = {}) {
19
+ public async send({ request = {} }: Options = {}) {
20
20
  return this._transport
21
- .send(
22
- "v1/models",
23
- {
24
- ...request,
25
- method: "GET",
26
- },
27
- options,
28
- )
21
+ .send("v1/models", {
22
+ ...request,
23
+ method: "GET",
24
+ })
29
25
  .then((response) => new ListModelsResponse(response));
30
26
  }
31
27
  }