@vansite/ts-sharetribe-flex-sdk 3.0.12 → 3.1.1

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 (59) hide show
  1. package/README.md +105 -121
  2. package/dist/endpoints/integrationApi/FileAttachments.d.ts +30 -0
  3. package/dist/endpoints/integrationApi/Files.d.ts +29 -0
  4. package/dist/endpoints/integrationApi/Messages.d.ts +33 -0
  5. package/dist/endpoints/integrationApi/Users.d.ts +17 -1
  6. package/dist/endpoints/integrationApi/index.d.ts +6 -0
  7. package/dist/endpoints/marketplace/FileDownloads.d.ts +32 -0
  8. package/dist/endpoints/marketplace/FileUploads.d.ts +34 -0
  9. package/dist/endpoints/marketplace/Files.d.ts +32 -0
  10. package/dist/endpoints/marketplace/OwnFileDownloads.d.ts +30 -0
  11. package/dist/endpoints/marketplace/OwnFiles.d.ts +49 -0
  12. package/dist/endpoints/marketplace/index.d.ts +10 -0
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.LICENSE.txt +12 -0
  15. package/dist/index.js.map +1 -1
  16. package/dist/index.mjs +1 -1
  17. package/dist/index.mjs.LICENSE.txt +12 -0
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/index.umd.js +1 -1
  20. package/dist/index.umd.js.LICENSE.txt +12 -0
  21. package/dist/index.umd.js.map +1 -1
  22. package/dist/integrationSdk.d.ts +21 -0
  23. package/dist/sdk.d.ts +30 -0
  24. package/dist/types/endpoints/integrationApi/FileAttachments.d.ts +31 -0
  25. package/dist/types/endpoints/integrationApi/FileAttachments.d.ts.map +1 -0
  26. package/dist/types/endpoints/integrationApi/Files.d.ts +30 -0
  27. package/dist/types/endpoints/integrationApi/Files.d.ts.map +1 -0
  28. package/dist/types/endpoints/integrationApi/Messages.d.ts +34 -0
  29. package/dist/types/endpoints/integrationApi/Messages.d.ts.map +1 -0
  30. package/dist/types/endpoints/integrationApi/Users.d.ts +17 -1
  31. package/dist/types/endpoints/integrationApi/Users.d.ts.map +1 -1
  32. package/dist/types/endpoints/integrationApi/index.d.ts +6 -0
  33. package/dist/types/endpoints/integrationApi/index.d.ts.map +1 -1
  34. package/dist/types/endpoints/marketplace/FileDownloads.d.ts +33 -0
  35. package/dist/types/endpoints/marketplace/FileDownloads.d.ts.map +1 -0
  36. package/dist/types/endpoints/marketplace/FileUploads.d.ts +35 -0
  37. package/dist/types/endpoints/marketplace/FileUploads.d.ts.map +1 -0
  38. package/dist/types/endpoints/marketplace/Files.d.ts +33 -0
  39. package/dist/types/endpoints/marketplace/Files.d.ts.map +1 -0
  40. package/dist/types/endpoints/marketplace/OwnFileDownloads.d.ts +31 -0
  41. package/dist/types/endpoints/marketplace/OwnFileDownloads.d.ts.map +1 -0
  42. package/dist/types/endpoints/marketplace/OwnFiles.d.ts +50 -0
  43. package/dist/types/endpoints/marketplace/OwnFiles.d.ts.map +1 -0
  44. package/dist/types/endpoints/marketplace/index.d.ts +10 -0
  45. package/dist/types/endpoints/marketplace/index.d.ts.map +1 -1
  46. package/dist/types/integration/files.d.ts +66 -0
  47. package/dist/types/integrationSdk.d.ts +21 -0
  48. package/dist/types/integrationSdk.d.ts.map +1 -1
  49. package/dist/types/marketplace/files.d.ts +162 -0
  50. package/dist/types/marketplace/user.d.ts +11 -3
  51. package/dist/types/sdk.d.ts +30 -0
  52. package/dist/types/sdk.d.ts.map +1 -1
  53. package/dist/types/types/integration/files.d.ts +67 -0
  54. package/dist/types/types/integration/files.d.ts.map +1 -0
  55. package/dist/types/types/marketplace/files.d.ts +163 -0
  56. package/dist/types/types/marketplace/files.d.ts.map +1 -0
  57. package/dist/types/types/marketplace/user.d.ts +11 -3
  58. package/dist/types/types/marketplace/user.d.ts.map +1 -1
  59. package/package.json +1 -1
@@ -4,9 +4,12 @@ import IntegrationApi from "./endpoints/integrationApi";
4
4
  import AuthenticationApi from "./endpoints/auth";
5
5
  import AvailabilityExceptions from "./endpoints/integrationApi/AvailabilityExceptions";
6
6
  import Events from "./endpoints/integrationApi/Events";
7
+ import FileAttachments from "./endpoints/integrationApi/FileAttachments";
8
+ import Files from "./endpoints/integrationApi/Files";
7
9
  import Images from "./endpoints/integrationApi/Images";
8
10
  import Listings from "./endpoints/integrationApi/Listings";
9
11
  import Marketplace from "./endpoints/integrationApi/Marketplace";
12
+ import Messages from "./endpoints/integrationApi/Messages";
10
13
  import Stock from "./endpoints/integrationApi/Stock";
11
14
  import StockAdjustments from "./endpoints/integrationApi/StockAdjustments";
12
15
  import StockReservations from "./endpoints/integrationApi/StockReservations";
@@ -60,6 +63,18 @@ declare class IntegrationSdk {
60
63
  * @type {Events}
61
64
  */
62
65
  events: Events;
66
+ /**
67
+ * Endpoint for querying file attachments.
68
+ *
69
+ * @type {FileAttachments}
70
+ */
71
+ fileAttachments: FileAttachments;
72
+ /**
73
+ * Endpoint for querying files.
74
+ *
75
+ * @type {Files}
76
+ */
77
+ files: Files;
63
78
  /**
64
79
  * Endpoint for handling image-related operations.
65
80
  *
@@ -78,6 +93,12 @@ declare class IntegrationSdk {
78
93
  * @type {Marketplace}
79
94
  */
80
95
  marketplace: Marketplace;
96
+ /**
97
+ * Endpoint for querying messages.
98
+ *
99
+ * @type {Messages}
100
+ */
101
+ messages: Messages;
81
102
  /**
82
103
  * Endpoint for managing stock.
83
104
  *
package/dist/sdk.d.ts CHANGED
@@ -6,6 +6,11 @@ import Listings from "./endpoints/marketplace/Listings";
6
6
  import AvailabilityExceptions from "./endpoints/marketplace/AvailabilityExceptions";
7
7
  import Bookings from "./endpoints/marketplace/Bookings";
8
8
  import CurrentUser from "./endpoints/marketplace/CurrentUser";
9
+ import Files from "./endpoints/marketplace/Files";
10
+ import OwnFiles from "./endpoints/marketplace/OwnFiles";
11
+ import FileUploads from "./endpoints/marketplace/FileUploads";
12
+ import FileDownloads from "./endpoints/marketplace/FileDownloads";
13
+ import OwnFileDownloads from "./endpoints/marketplace/OwnFileDownloads";
9
14
  import Images from "./endpoints/marketplace/Images";
10
15
  import Marketplace from "./endpoints/marketplace/Marketplace";
11
16
  import Messages from "./endpoints/marketplace/Messages";
@@ -76,6 +81,31 @@ declare class SharetribeSdk {
76
81
  * @type {CurrentUser}
77
82
  */
78
83
  currentUser: CurrentUser;
84
+ /**
85
+ * Endpoint for reading shared files.
86
+ * @type {Files}
87
+ */
88
+ files: Files;
89
+ /**
90
+ * Endpoint for managing the current user's own files.
91
+ * @type {OwnFiles}
92
+ */
93
+ ownFiles: OwnFiles;
94
+ /**
95
+ * Endpoint for obtaining signed upload URLs.
96
+ * @type {FileUploads}
97
+ */
98
+ fileUploads: FileUploads;
99
+ /**
100
+ * Endpoint for obtaining signed download URLs for shared files.
101
+ * @type {FileDownloads}
102
+ */
103
+ fileDownloads: FileDownloads;
104
+ /**
105
+ * Endpoint for obtaining signed download URLs for own files.
106
+ * @type {OwnFileDownloads}
107
+ */
108
+ ownFileDownloads: OwnFileDownloads;
79
109
  /**
80
110
  * Endpoint for handling images.
81
111
  * @type {Images}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @fileoverview Client for querying file attachments in the Sharetribe
3
+ * Integration API.
4
+ *
5
+ * @see https://www.sharetribe.com/api-reference/integration.html#file-attachments
6
+ */
7
+ import type { AxiosResponse } from "axios";
8
+ import IntegrationApi from "./index";
9
+ import { FileAttachmentsQueryParameter, FileAttachmentsQueryResponse } from "../../types";
10
+ /**
11
+ * File Attachments API client (privileged)
12
+ */
13
+ declare class FileAttachments {
14
+ readonly authRequired = true;
15
+ private readonly axios;
16
+ private readonly endpoint;
17
+ private readonly headers;
18
+ constructor(api: IntegrationApi);
19
+ /**
20
+ * Query file attachments in the marketplace.
21
+ *
22
+ * @param {FileAttachmentsQueryParameter} params
23
+ * @returns {Promise<AxiosResponse<FileAttachmentsQueryResponse>>}
24
+ *
25
+ * @example
26
+ * const { data } = await sdk.fileAttachments.query({ transactionId: "tx-abc123" });
27
+ */
28
+ query(params: FileAttachmentsQueryParameter): Promise<AxiosResponse<FileAttachmentsQueryResponse>>;
29
+ }
30
+ export default FileAttachments;
31
+ //# sourceMappingURL=FileAttachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileAttachments.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/FileAttachments.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,cAAM,eAAe;IACnB,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;OAQG;IACG,KAAK,CACT,MAAM,EAAE,6BAA6B,GACpC,OAAO,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC;CAMxD;AAED,eAAe,eAAe,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @fileoverview Client for querying files in the Sharetribe Integration API.
3
+ *
4
+ * @see https://www.sharetribe.com/api-reference/integration.html#files
5
+ */
6
+ import type { AxiosResponse } from "axios";
7
+ import IntegrationApi from "./index";
8
+ import { FilesQueryParameter, FilesQueryResponse } from "../../types";
9
+ /**
10
+ * Files API client (privileged)
11
+ */
12
+ declare class Files {
13
+ readonly authRequired = true;
14
+ private readonly axios;
15
+ private readonly endpoint;
16
+ private readonly headers;
17
+ constructor(api: IntegrationApi);
18
+ /**
19
+ * Query files in the marketplace.
20
+ *
21
+ * @param {FilesQueryParameter} params
22
+ * @returns {Promise<AxiosResponse<FilesQueryResponse>>}
23
+ *
24
+ * @example
25
+ * const { data } = await sdk.files.query({ transactionId: "tx-abc123" });
26
+ */
27
+ query(params: FilesQueryParameter): Promise<AxiosResponse<FilesQueryResponse>>;
28
+ }
29
+ export default Files;
30
+ //# sourceMappingURL=Files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Files.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Files.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,aAAa,CAAC;AAEpE;;GAEG;AACH,cAAM,KAAK;IACT,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;OAQG;IACG,KAAK,CACT,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;CAM9C;AAED,eAAe,KAAK,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @fileoverview Client for querying messages in the Sharetribe Integration API.
3
+ *
4
+ * Read-only: lists messages within a transaction. Reuses the Marketplace
5
+ * message types since the resource shape is identical.
6
+ *
7
+ * @see https://www.sharetribe.com/api-reference/integration.html#messages
8
+ */
9
+ import type { AxiosResponse } from "axios";
10
+ import IntegrationApi from "./index";
11
+ import { MessagesQueryParameter, MessagesResponse } from "../../types";
12
+ /**
13
+ * Messages API client (privileged)
14
+ */
15
+ declare class Messages {
16
+ readonly authRequired = true;
17
+ private readonly axios;
18
+ private readonly endpoint;
19
+ private readonly headers;
20
+ constructor(api: IntegrationApi);
21
+ /**
22
+ * Query messages in a transaction.
23
+ *
24
+ * @template P
25
+ * @param {P & MessagesQueryParameter} params - Requires `transactionId`
26
+ * @returns {Promise<AxiosResponse<MessagesResponse<"query", P>>>}
27
+ *
28
+ * @example
29
+ * const { data } = await sdk.messages.query({ transactionId: "tx-abc123" });
30
+ */
31
+ query<P extends MessagesQueryParameter>(params: P): Promise<AxiosResponse<MessagesResponse<"query", P>>>;
32
+ }
33
+ export default Messages;
34
+ //# sourceMappingURL=Messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Messages.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Messages.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,sBAAsB,EAAE,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAErE;;GAEG;AACH,cAAM,QAAQ;IACZ,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;OASG;IACG,KAAK,CAAC,CAAC,SAAS,sBAAsB,EAC1C,MAAM,EAAE,CAAC,GACR,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;CAMxD;AAED,eAAe,QAAQ,CAAC"}
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import type { AxiosResponse } from "axios";
10
10
  import IntegrationApi from "./index";
11
- import { ExtraParameter, UsersApproveParameter, UsersQueryParameter, UsersResponse, UsersShowParameter, UsersUpdatePermissionsParameter, UsersUpdateProfileParameter } from "../../types";
11
+ import { ExtraParameter, UsersApproveParameter, UsersQueryParameter, UsersResponse, UsersShowParameter, UsersUpdatePermissionsParameter, UsersUpdateProfileParameter, UsersVerifyEmailParameter } from "../../types";
12
12
  /**
13
13
  * Users API client (privileged)
14
14
  */
@@ -70,6 +70,22 @@ declare class Users {
70
70
  * @returns {Promise<AxiosResponse<UsersResponse<"updatePermissions", P, EP>>>}
71
71
  */
72
72
  updatePermissions<P extends UsersUpdatePermissionsParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<UsersResponse<"updatePermissions", P, EP>>>;
73
+ /**
74
+ * Verify a user's email address.
75
+ *
76
+ * `email` must match the user's current `email` or `pendingEmail`
77
+ * (case-insensitive).
78
+ *
79
+ * @template P
80
+ * @template EP
81
+ * @param {P & UsersVerifyEmailParameter} params - `id` and `email`
82
+ * @param {EP} [extraParams]
83
+ * @returns {Promise<AxiosResponse<UsersResponse<"verifyEmail", P, EP>>>}
84
+ *
85
+ * @example
86
+ * await sdk.users.verifyEmail({ id: "user-abc123", email: "john@example.com" });
87
+ */
88
+ verifyEmail<P extends UsersVerifyEmailParameter, EP extends ExtraParameter | undefined = undefined>(params: P, extraParams?: EP): Promise<AxiosResponse<UsersResponse<"verifyEmail", P, EP>>>;
73
89
  }
74
90
  export default Users;
75
91
  //# sourceMappingURL=Users.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Users.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/Users.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,+BAA+B,EAC/B,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,cAAM,KAAK;IACT,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;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AE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAQ1D;;;;;;;;OAQG;IACG,iBAAiB,CACrB,CAAC,SAAS,+BAA+B,EACzC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,mBAAmB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAQpE;;;;;;;;;;;;;;OAcG;IACG,WAAW,CACf,CAAC,SAAS,yBAAyB,EACnC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAEjD,MAAM,EAAE,CAAC,EACT,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CAO/D;AAED,eAAe,KAAK,CAAC"}
@@ -23,9 +23,12 @@ import type { AxiosInstance } from "axios";
23
23
  import IntegrationSdk from "../../integrationSdk";
24
24
  import AvailabilityExceptions from "./AvailabilityExceptions";
25
25
  import Events from "./Events";
26
+ import FileAttachments from "./FileAttachments";
27
+ import Files from "./Files";
26
28
  import Images from "./Images";
27
29
  import Listings from "./Listings";
28
30
  import Marketplace from "./Marketplace";
31
+ import Messages from "./Messages";
29
32
  import Stock from "./Stock";
30
33
  import StockAdjustments from "./StockAdjustments";
31
34
  import StockReservations from "./StockReservations";
@@ -45,9 +48,12 @@ declare class IntegrationApi {
45
48
  readonly authRequired = true;
46
49
  readonly availabilityExceptions: AvailabilityExceptions;
47
50
  readonly events: Events;
51
+ readonly fileAttachments: FileAttachments;
52
+ readonly files: Files;
48
53
  readonly images: Images;
49
54
  readonly listings: Listings;
50
55
  readonly marketplace: Marketplace;
56
+ readonly messages: Messages;
51
57
  readonly stock: Stock;
52
58
  readonly stockAdjustments: StockAdjustments;
53
59
  readonly stockReservations: StockReservations;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/integrationApi/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAElD,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B;;GAEG;AACH,cAAM,cAAc;IAClB,uCAAuC;IACvC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAE9B,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEzC,4CAA4C;IAC5C,QAAQ,CAAC,YAAY,QAAQ;IAG7B,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IACxD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,KAAK,CA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YAAY,QAAQ;IAG7B,QAAQ,CAAC,sBAAsB,EAAE,sBAAsB,CAAC;IACxD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;gBAEV,GAAG,EAAE,cAAc;CAsBhC;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @fileoverview Client for obtaining signed download URLs for shared files in
3
+ * the Sharetribe Marketplace API.
4
+ *
5
+ * Resolves a file attachment to a short-lived signed download URL.
6
+ *
7
+ * @see https://www.sharetribe.com/api-reference/marketplace.html#file-downloads
8
+ */
9
+ import type { AxiosResponse } from "axios";
10
+ import MarketplaceApi from "./index";
11
+ import { FileDownloadsCreateParameter, FileDownloadsCreateResponse } from "../../types";
12
+ /**
13
+ * File Downloads API client
14
+ */
15
+ declare class FileDownloads {
16
+ readonly authRequired = true;
17
+ private readonly axios;
18
+ private readonly endpoint;
19
+ private readonly headers;
20
+ constructor(api: MarketplaceApi);
21
+ /**
22
+ * Obtain a signed download URL for a file accessed via a file attachment.
23
+ *
24
+ * @param {FileDownloadsCreateParameter} params - Requires `fileAttachmentId`
25
+ * @returns {Promise<AxiosResponse<FileDownloadsCreateResponse>>}
26
+ *
27
+ * @example
28
+ * const { data } = await sdk.fileDownloads.create({ fileAttachmentId: "fa-abc123" });
29
+ */
30
+ create(params: FileDownloadsCreateParameter): Promise<AxiosResponse<FileDownloadsCreateResponse>>;
31
+ }
32
+ export default FileDownloads;
33
+ //# sourceMappingURL=FileDownloads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileDownloads.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/FileDownloads.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,4BAA4B,EAAE,2BAA2B,EAAC,MAAM,aAAa,CAAC;AAEtF;;GAEG;AACH,cAAM,aAAa;IACjB,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;OAQG;IACG,MAAM,CACV,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,aAAa,CAAC,2BAA2B,CAAC,CAAC;CAOvD;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @fileoverview Client for obtaining signed upload URLs in the Sharetribe
3
+ * Marketplace API.
4
+ *
5
+ * Returns a short-lived signed URL; the file bytes are then PUT directly to
6
+ * that URL (outside the Sharetribe API) using the returned headers.
7
+ *
8
+ * @see https://www.sharetribe.com/api-reference/marketplace.html#file-uploads
9
+ */
10
+ import type { AxiosResponse } from "axios";
11
+ import MarketplaceApi from "./index";
12
+ import { FileUploadsCreateParameter, FileUploadsCreateResponse } from "../../types";
13
+ /**
14
+ * File Uploads API client
15
+ */
16
+ declare class FileUploads {
17
+ readonly authRequired = true;
18
+ private readonly axios;
19
+ private readonly endpoint;
20
+ private readonly headers;
21
+ constructor(api: MarketplaceApi);
22
+ /**
23
+ * Obtain a signed URL to upload the bytes of an own file.
24
+ *
25
+ * @param {FileUploadsCreateParameter} params - Requires `fileId`
26
+ * @returns {Promise<AxiosResponse<FileUploadsCreateResponse>>}
27
+ *
28
+ * @example
29
+ * const { data } = await sdk.fileUploads.create({ fileId: "file-abc123" });
30
+ * // PUT the bytes to data.data.attributes.url with attributes.headers
31
+ */
32
+ create(params: FileUploadsCreateParameter): Promise<AxiosResponse<FileUploadsCreateResponse>>;
33
+ }
34
+ export default FileUploads;
35
+ //# sourceMappingURL=FileUploads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileUploads.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/FileUploads.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,0BAA0B,EAAE,yBAAyB,EAAC,MAAM,aAAa,CAAC;AAElF;;GAEG;AACH,cAAM,WAAW;IACf,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;;OASG;IACG,MAAM,CACV,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC;CAOrD;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @fileoverview Client for reading shared files in the Sharetribe Marketplace API.
3
+ *
4
+ * Files are accessed through a file attachment (e.g. an attachment shared in a
5
+ * transaction message), not by the file's own id.
6
+ *
7
+ * @see https://www.sharetribe.com/api-reference/marketplace.html#files
8
+ */
9
+ import type { AxiosResponse } from "axios";
10
+ import MarketplaceApi from "./index";
11
+ import { FilesShowParameter, FilesShowResponse } from "../../types";
12
+ /**
13
+ * Files API client
14
+ */
15
+ declare class Files {
16
+ readonly authRequired = true;
17
+ private readonly axios;
18
+ private readonly endpoint;
19
+ private readonly headers;
20
+ constructor(api: MarketplaceApi);
21
+ /**
22
+ * Fetch a file the current user can access via a file attachment.
23
+ *
24
+ * @param {FilesShowParameter} params - Requires `fileAttachmentId`
25
+ * @returns {Promise<AxiosResponse<FilesShowResponse>>}
26
+ *
27
+ * @example
28
+ * const { data } = await sdk.files.show({ fileAttachmentId: "fa-abc123" });
29
+ */
30
+ show(params: FilesShowParameter): Promise<AxiosResponse<FilesShowResponse>>;
31
+ }
32
+ export default Files;
33
+ //# sourceMappingURL=Files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Files.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/Files.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EAAC,kBAAkB,EAAE,iBAAiB,EAAC,MAAM,aAAa,CAAC;AAElE;;GAEG;AACH,cAAM,KAAK;IACT,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;OAQG;IACG,IAAI,CACR,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;CAM7C;AAED,eAAe,KAAK,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @fileoverview Client for obtaining signed download URLs for the current
3
+ * user's own files in the Sharetribe Marketplace API.
4
+ *
5
+ * @see https://www.sharetribe.com/api-reference/marketplace.html#own-file-downloads
6
+ */
7
+ import type { AxiosResponse } from "axios";
8
+ import MarketplaceApi from "./index";
9
+ import { OwnFileDownloadsCreateParameter, OwnFileDownloadsCreateResponse } from "../../types";
10
+ /**
11
+ * Own File Downloads API client
12
+ */
13
+ declare class OwnFileDownloads {
14
+ readonly authRequired = true;
15
+ private readonly axios;
16
+ private readonly endpoint;
17
+ private readonly headers;
18
+ constructor(api: MarketplaceApi);
19
+ /**
20
+ * Obtain a signed download URL for one of the current user's own files.
21
+ *
22
+ * @param {OwnFileDownloadsCreateParameter} params - Requires `fileId`
23
+ * @returns {Promise<AxiosResponse<OwnFileDownloadsCreateResponse>>}
24
+ *
25
+ * @example
26
+ * const { data } = await sdk.ownFileDownloads.create({ fileId: "file-abc123" });
27
+ */
28
+ create(params: OwnFileDownloadsCreateParameter): Promise<AxiosResponse<OwnFileDownloadsCreateResponse>>;
29
+ }
30
+ export default OwnFileDownloads;
31
+ //# sourceMappingURL=OwnFileDownloads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OwnFileDownloads.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/OwnFileDownloads.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,cAAM,gBAAgB;IACpB,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;OAQG;IACG,MAAM,CACV,MAAM,EAAE,+BAA+B,GACtC,OAAO,CAAC,aAAa,CAAC,8BAA8B,CAAC,CAAC;CAO1D;AAED,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @fileoverview Client for managing the current user's own files in the
3
+ * Sharetribe Marketplace API.
4
+ *
5
+ * Creating an own file only registers its metadata; the bytes are uploaded
6
+ * afterwards via `sdk.fileUploads.create`.
7
+ *
8
+ * @see https://www.sharetribe.com/api-reference/marketplace.html#own-files
9
+ */
10
+ import type { AxiosResponse } from "axios";
11
+ import MarketplaceApi from "./index";
12
+ import { ExtraParameter, OwnFilesCreateParameter, OwnFilesCreateResponse, OwnFilesShowParameter, OwnFilesShowResponse } from "../../types";
13
+ /**
14
+ * Own Files API client
15
+ */
16
+ declare class OwnFiles {
17
+ readonly authRequired = true;
18
+ private readonly axios;
19
+ private readonly endpoint;
20
+ private readonly headers;
21
+ constructor(api: MarketplaceApi);
22
+ /**
23
+ * Fetch one of the current user's own files by id.
24
+ *
25
+ * @param {OwnFilesShowParameter} params - Requires `id`
26
+ * @returns {Promise<AxiosResponse<OwnFilesShowResponse>>}
27
+ *
28
+ * @example
29
+ * const { data } = await sdk.ownFiles.show({ id: "file-abc123" });
30
+ */
31
+ show(params: OwnFilesShowParameter): Promise<AxiosResponse<OwnFilesShowResponse>>;
32
+ /**
33
+ * Register a new own file. Returns the file resource, after which the bytes
34
+ * are uploaded via `sdk.fileUploads.create({ fileId })`.
35
+ *
36
+ * @template EP
37
+ * @param {OwnFilesCreateParameter} params - `name`, `mimeType`, `size`
38
+ * @param {EP} [extraParams] - Optional extra parameters (e.g. `expand: true`)
39
+ * @returns {Promise<AxiosResponse<OwnFilesCreateResponse<EP>>>}
40
+ *
41
+ * @example
42
+ * const { data } = await sdk.ownFiles.create(
43
+ * { name: "invoice.pdf", mimeType: "application/pdf", size: 12345 },
44
+ * { expand: true }
45
+ * );
46
+ */
47
+ create<EP extends ExtraParameter | undefined = undefined>(params: OwnFilesCreateParameter, extraParams?: EP): Promise<AxiosResponse<OwnFilesCreateResponse<EP>>>;
48
+ }
49
+ export default OwnFiles;
50
+ //# sourceMappingURL=OwnFiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OwnFiles.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/OwnFiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAC,MAAM,OAAO,CAAC;AACxD,OAAO,cAAc,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,cAAM,QAAQ;IACZ,SAAgB,YAAY,QAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAgB;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyB;gBAErC,GAAG,EAAE,cAAc;IAM/B;;;;;;;;OAQG;IACG,IAAI,CACR,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAO/C;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,EAAE,SAAS,cAAc,GAAG,SAAS,GAAG,SAAS,EAC5D,MAAM,EAAE,uBAAuB,EAC/B,WAAW,CAAC,EAAE,EAAE,GACf,OAAO,CAAC,aAAa,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC,CAAC;CAOtD;AAED,eAAe,QAAQ,CAAC"}
@@ -24,10 +24,15 @@ import SharetribeSdk from "../../sdk";
24
24
  import AvailabilityExceptions from "./AvailabilityExceptions";
25
25
  import Bookings from "./Bookings";
26
26
  import CurrentUser from "./CurrentUser";
27
+ import FileDownloads from "./FileDownloads";
28
+ import FileUploads from "./FileUploads";
29
+ import Files from "./Files";
27
30
  import Images from "./Images";
28
31
  import Listings from "./Listings";
29
32
  import Marketplace from "./Marketplace";
30
33
  import Messages from "./Messages";
34
+ import OwnFileDownloads from "./OwnFileDownloads";
35
+ import OwnFiles from "./OwnFiles";
31
36
  import OwnListings from "./OwnListings";
32
37
  import PasswordReset from "./PasswordReset";
33
38
  import ProcessTransitions from "./ProcessTransitions";
@@ -58,10 +63,15 @@ declare class MarketplaceApi {
58
63
  readonly availabilityExceptions: AvailabilityExceptions;
59
64
  readonly bookings: Bookings;
60
65
  readonly currentUser: CurrentUser;
66
+ readonly fileDownloads: FileDownloads;
67
+ readonly fileUploads: FileUploads;
68
+ readonly files: Files;
61
69
  readonly images: Images;
62
70
  readonly listings: Listings;
63
71
  readonly marketplace: Marketplace;
64
72
  readonly messages: Messages;
73
+ readonly ownFileDownloads: OwnFileDownloads;
74
+ readonly ownFiles: OwnFiles;
65
75
  readonly ownListings: OwnListings;
66
76
  readonly passwordReset: PasswordReset;
67
77
  readonly processTransitions: ProcessTransitions;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/endpoints/marketplace/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,aAAa,MAAM,WAAW,CAAC;AAEtC,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAC9D,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,WAA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AAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAChD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAChD,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAChD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;gBAEV,GAAG,EAAE,aAAa;CAoC/B;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * @fileoverview Type definitions for the file endpoints in the Sharetribe
3
+ * Integration API: files/query and file_attachments/query.
4
+ *
5
+ * @see https://www.sharetribe.com/api-reference/integration.html#files
6
+ */
7
+ import { ApiMeta, ApiParameter, UUID } from "../sharetribe";
8
+ import { File } from "../marketplace/files";
9
+ import { User } from "../marketplace/user";
10
+ import { Marketplace } from "../marketplace/marketplace";
11
+ import { Message } from "../marketplace/messages";
12
+ /**
13
+ * Scope controls who can access a file attachment. Only `public` is currently
14
+ * documented by the API.
15
+ */
16
+ export type FileAttachmentScope = "public";
17
+ /**
18
+ * Links a file to a resource (e.g. a transaction message).
19
+ */
20
+ export interface FileAttachment {
21
+ id: UUID;
22
+ type: "fileAttachment";
23
+ attributes: {
24
+ scope: FileAttachmentScope;
25
+ deleted: boolean;
26
+ };
27
+ relationships?: {
28
+ file: {
29
+ data: {
30
+ id: UUID;
31
+ type: "file";
32
+ } | null;
33
+ };
34
+ /** Only present when the file is attached to a message. */
35
+ message?: {
36
+ data: {
37
+ id: UUID;
38
+ type: "message";
39
+ } | null;
40
+ };
41
+ };
42
+ }
43
+ /**
44
+ * files/query — list files in the marketplace, filtered by owner.
45
+ */
46
+ export interface FilesQueryParameter extends ApiParameter {
47
+ ownerId?: UUID | string;
48
+ include?: ("owner" | "marketplace")[];
49
+ }
50
+ export type FilesQueryResponse = {
51
+ data: File[];
52
+ included?: (User | Marketplace)[];
53
+ meta: ApiMeta;
54
+ };
55
+ /**
56
+ * file_attachments/query — list file attachments, filtered by message.
57
+ */
58
+ export interface FileAttachmentsQueryParameter extends ApiParameter {
59
+ messageId?: UUID | string;
60
+ include?: ("file" | "message")[];
61
+ }
62
+ export type FileAttachmentsQueryResponse = {
63
+ data: FileAttachment[];
64
+ included?: (File | Message)[];
65
+ meta: ApiMeta;
66
+ };
@@ -4,9 +4,12 @@ import IntegrationApi from "./endpoints/integrationApi";
4
4
  import AuthenticationApi from "./endpoints/auth";
5
5
  import AvailabilityExceptions from "./endpoints/integrationApi/AvailabilityExceptions";
6
6
  import Events from "./endpoints/integrationApi/Events";
7
+ import FileAttachments from "./endpoints/integrationApi/FileAttachments";
8
+ import Files from "./endpoints/integrationApi/Files";
7
9
  import Images from "./endpoints/integrationApi/Images";
8
10
  import Listings from "./endpoints/integrationApi/Listings";
9
11
  import Marketplace from "./endpoints/integrationApi/Marketplace";
12
+ import Messages from "./endpoints/integrationApi/Messages";
10
13
  import Stock from "./endpoints/integrationApi/Stock";
11
14
  import StockAdjustments from "./endpoints/integrationApi/StockAdjustments";
12
15
  import StockReservations from "./endpoints/integrationApi/StockReservations";
@@ -60,6 +63,18 @@ declare class IntegrationSdk {
60
63
  * @type {Events}
61
64
  */
62
65
  events: Events;
66
+ /**
67
+ * Endpoint for querying file attachments.
68
+ *
69
+ * @type {FileAttachments}
70
+ */
71
+ fileAttachments: FileAttachments;
72
+ /**
73
+ * Endpoint for querying files.
74
+ *
75
+ * @type {Files}
76
+ */
77
+ files: Files;
63
78
  /**
64
79
  * Endpoint for handling image-related operations.
65
80
  *
@@ -78,6 +93,12 @@ declare class IntegrationSdk {
78
93
  * @type {Marketplace}
79
94
  */
80
95
  marketplace: Marketplace;
96
+ /**
97
+ * Endpoint for querying messages.
98
+ *
99
+ * @type {Messages}
100
+ */
101
+ messages: Messages;
81
102
  /**
82
103
  * Endpoint for managing stock.
83
104
  *