@mittwald/api-client 3.1.55 → 3.1.57

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.
package/README.md CHANGED
@@ -182,8 +182,8 @@ const api = MittwaldAPIV2Client.newUnauthenticated();
182
182
  const apiReact = MittwaldAPIV2ClientReact.fromBaseClient(api);
183
183
 
184
184
  const ProjectsList = () => {
185
- // apiReact.project.listProjects() returns an AsyncResource that can be "watched"
186
- const projects = apiReact.project.listProjects().watch({
185
+ // apiReact.project.listProjects() returns an AsyncResource that can be "used"
186
+ const projects = apiReact.project.listProjects().use({
187
187
  autoRefresh: {
188
188
  seconds: 30,
189
189
  },
@@ -0,0 +1,355 @@
1
+ import { ApiCallAsyncResourceFactory } from "@mittwald/api-client-commons/react";
2
+ import * as descriptors from "./descriptors.js";
3
+ export * from "@mittwald/react-use-promise";
4
+ const buildAppApi = (baseClient) => ({
5
+ /** Get an App. */
6
+ getApp: new ApiCallAsyncResourceFactory(descriptors.appGetApp, baseClient.app.getApp).getApiResource,
7
+ /** Get an AppInstallation. */
8
+ getAppinstallation: new ApiCallAsyncResourceFactory(descriptors.appGetAppinstallation, baseClient.app.getAppinstallation).getApiResource,
9
+ /** Get an AppVersion. */
10
+ getAppversion: new ApiCallAsyncResourceFactory(descriptors.appGetAppversion, baseClient.app.getAppversion).getApiResource,
11
+ /** Get the installed `SystemSoftware' for a specific `AppInstallation`. */
12
+ getInstalledSystemsoftwareForAppinstallation: new ApiCallAsyncResourceFactory(descriptors.appGetInstalledSystemsoftwareForAppinstallation, baseClient.app.getInstalledSystemsoftwareForAppinstallation).getApiResource,
13
+ /** Get the missing requirements of an appInstallation for a specific target AppVersion. */
14
+ getMissingDependenciesForAppinstallation: new ApiCallAsyncResourceFactory(descriptors.appGetMissingDependenciesForAppinstallation, baseClient.app.getMissingDependenciesForAppinstallation).getApiResource,
15
+ /** Get a SystemSoftware. */
16
+ getSystemsoftware: new ApiCallAsyncResourceFactory(descriptors.appGetSystemsoftware, baseClient.app.getSystemsoftware).getApiResource,
17
+ /** Get a SystemSoftwareVersion. */
18
+ getSystemsoftwareversion: new ApiCallAsyncResourceFactory(descriptors.appGetSystemsoftwareversion, baseClient.app.getSystemsoftwareversion).getApiResource,
19
+ /** List AppInstallations belonging to a Project. */
20
+ listAppinstallations: new ApiCallAsyncResourceFactory(descriptors.appListAppinstallations, baseClient.app.listAppinstallations).getApiResource,
21
+ /** List Apps. */
22
+ listApps: new ApiCallAsyncResourceFactory(descriptors.appListApps, baseClient.app.listApps).getApiResource,
23
+ /** List AppVersions belonging to an App. */
24
+ listAppversions: new ApiCallAsyncResourceFactory(descriptors.appListAppversions, baseClient.app.listAppversions).getApiResource,
25
+ /** List SystemSoftwares. */
26
+ listSystemsoftwares: new ApiCallAsyncResourceFactory(descriptors.appListSystemsoftwares, baseClient.app.listSystemsoftwares).getApiResource,
27
+ /** List SystemSoftwareVersions belonging to a SystemSoftware. */
28
+ listSystemsoftwareversions: new ApiCallAsyncResourceFactory(descriptors.appListSystemsoftwareversions, baseClient.app.listSystemsoftwareversions).getApiResource,
29
+ /** List update candidates belonging to an AppVersion. */
30
+ listUpdateCandidatesForAppversion: new ApiCallAsyncResourceFactory(descriptors.appListUpdateCandidatesForAppversion, baseClient.app.listUpdateCandidatesForAppversion).getApiResource,
31
+ /** Get runtime status belonging to an AppInstallation. */
32
+ retrieveStatus: new ApiCallAsyncResourceFactory(descriptors.appRetrieveStatus, baseClient.app.retrieveStatus).getApiResource,
33
+ });
34
+ const buildArticleApi = (baseClient) => ({
35
+ /** Get an Article. */
36
+ getArticle: new ApiCallAsyncResourceFactory(descriptors.articleGetArticle, baseClient.article.getArticle).getApiResource,
37
+ /** List Articles. */
38
+ listArticles: new ApiCallAsyncResourceFactory(descriptors.articleListArticles, baseClient.article.listArticles).getApiResource,
39
+ });
40
+ const buildBackupApi = (baseClient) => ({
41
+ /** List BackupSchedules belonging to a Project. */
42
+ listProjectBackupSchedules: new ApiCallAsyncResourceFactory(descriptors.backupListProjectBackupSchedules, baseClient.backup.listProjectBackupSchedules).getApiResource,
43
+ /** List Backups belonging to a Project. */
44
+ listProjectBackups: new ApiCallAsyncResourceFactory(descriptors.backupListProjectBackups, baseClient.backup.listProjectBackups).getApiResource,
45
+ /** Get a ProjectBackupSchedule. */
46
+ getProjectBackupSchedule: new ApiCallAsyncResourceFactory(descriptors.backupGetProjectBackupSchedule, baseClient.backup.getProjectBackupSchedule).getApiResource,
47
+ /** Get a ProjectBackup. */
48
+ getProjectBackup: new ApiCallAsyncResourceFactory(descriptors.backupGetProjectBackup, baseClient.backup.getProjectBackup).getApiResource,
49
+ });
50
+ const buildContractApi = (baseClient) => ({
51
+ /** Return the BaseItem of the Contract with the given ID. */
52
+ getBaseItemOfContract: new ApiCallAsyncResourceFactory(descriptors.contractGetBaseItemOfContract, baseClient.contract.getBaseItemOfContract).getApiResource,
53
+ /** Return the Contract for the given Domain. */
54
+ getDetailOfContractByDomain: new ApiCallAsyncResourceFactory(descriptors.contractGetDetailOfContractByDomain, baseClient.contract.getDetailOfContractByDomain).getApiResource,
55
+ /** Return the Contract for the given Project. */
56
+ getDetailOfContractByProject: new ApiCallAsyncResourceFactory(descriptors.contractGetDetailOfContractByProject, baseClient.contract.getDetailOfContractByProject).getApiResource,
57
+ /** Return the Contract for the given Server. */
58
+ getDetailOfContractByServer: new ApiCallAsyncResourceFactory(descriptors.contractGetDetailOfContractByServer, baseClient.contract.getDetailOfContractByServer).getApiResource,
59
+ /** Get the ContractItem with the given ID. */
60
+ getDetailOfContractItem: new ApiCallAsyncResourceFactory(descriptors.contractGetDetailOfContractItem, baseClient.contract.getDetailOfContractItem).getApiResource,
61
+ /** Returns the Contract with the given ID. */
62
+ getDetailOfContract: new ApiCallAsyncResourceFactory(descriptors.contractGetDetailOfContract, baseClient.contract.getDetailOfContract).getApiResource,
63
+ /** Return the next TerminationDate for the ContractItem with the given ID. */
64
+ getNextTerminationDateForItem: new ApiCallAsyncResourceFactory(descriptors.contractGetNextTerminationDateForItem, baseClient.contract.getNextTerminationDateForItem).getApiResource,
65
+ /** Return a list of Contracts for the given Customer. */
66
+ listContracts: new ApiCallAsyncResourceFactory(descriptors.contractListContracts, baseClient.contract.listContracts).getApiResource,
67
+ /** Get details of an Invoice. */
68
+ invoiceDetail: new ApiCallAsyncResourceFactory(descriptors.invoiceDetail, baseClient.contract.invoiceDetail).getApiResource,
69
+ /** Get InvoiceSettings of a Customer. */
70
+ invoiceGetDetailOfInvoiceSettings: new ApiCallAsyncResourceFactory(descriptors.invoiceGetDetailOfInvoiceSettings, baseClient.contract.invoiceGetDetailOfInvoiceSettings).getApiResource,
71
+ /** Request an Access Token for the Invoice file. */
72
+ invoiceGetFileAccessToken: new ApiCallAsyncResourceFactory(descriptors.invoiceGetFileAccessToken, baseClient.contract.invoiceGetFileAccessToken).getApiResource,
73
+ /** List Invoices of a Customer. */
74
+ invoiceListCustomerInvoices: new ApiCallAsyncResourceFactory(descriptors.invoiceListCustomerInvoices, baseClient.contract.invoiceListCustomerInvoices).getApiResource,
75
+ /** Get Order for Customer. */
76
+ orderGetOrder: new ApiCallAsyncResourceFactory(descriptors.orderGetOrder, baseClient.contract.orderGetOrder).getApiResource,
77
+ /** Get list of Orders of a Customer. */
78
+ orderListCustomerOrders: new ApiCallAsyncResourceFactory(descriptors.orderListCustomerOrders, baseClient.contract.orderListCustomerOrders).getApiResource,
79
+ /** Get list of Orders of a Project. */
80
+ orderListProjectOrders: new ApiCallAsyncResourceFactory(descriptors.orderListProjectOrders, baseClient.contract.orderListProjectOrders).getApiResource,
81
+ });
82
+ const buildConversationApi = (baseClient) => ({
83
+ /** Get all conversation the authenticated user has created or has access to. */
84
+ listConversations: new ApiCallAsyncResourceFactory(descriptors.conversationListConversations, baseClient.conversation.listConversations).getApiResource,
85
+ /** Get all message of the conversation. */
86
+ listMessagesByConversation: new ApiCallAsyncResourceFactory(descriptors.conversationListMessagesByConversation, baseClient.conversation.listMessagesByConversation).getApiResource,
87
+ /** Get a specific conversation category. */
88
+ getCategory: new ApiCallAsyncResourceFactory(descriptors.conversationGetCategory, baseClient.conversation.getCategory).getApiResource,
89
+ /** Get members of a support conversation. */
90
+ getConversationMembers: new ApiCallAsyncResourceFactory(descriptors.conversationGetConversationMembers, baseClient.conversation.getConversationMembers).getApiResource,
91
+ /** Get a support conversation. */
92
+ getConversation: new ApiCallAsyncResourceFactory(descriptors.conversationGetConversation, baseClient.conversation.getConversation).getApiResource,
93
+ /** Request an access token for the File belonging to the Conversation. */
94
+ getFileAccessToken: new ApiCallAsyncResourceFactory(descriptors.conversationGetFileAccessToken, baseClient.conversation.getFileAccessToken).getApiResource,
95
+ /** Get all conversation categories. */
96
+ listCategories: new ApiCallAsyncResourceFactory(descriptors.conversationListCategories, baseClient.conversation.listCategories).getApiResource,
97
+ });
98
+ const buildCronjobApi = (baseClient) => ({
99
+ /** List Cronjobs belonging to a Project. */
100
+ listCronjobs: new ApiCallAsyncResourceFactory(descriptors.cronjobListCronjobs, baseClient.cronjob.listCronjobs).getApiResource,
101
+ /** List CronjobExecutions belonging to a Cronjob. */
102
+ listExecutions: new ApiCallAsyncResourceFactory(descriptors.cronjobListExecutions, baseClient.cronjob.listExecutions).getApiResource,
103
+ /** Get a Cronjob. */
104
+ getCronjob: new ApiCallAsyncResourceFactory(descriptors.cronjobGetCronjob, baseClient.cronjob.getCronjob).getApiResource,
105
+ /** Get a CronjobExecution. */
106
+ getExecution: new ApiCallAsyncResourceFactory(descriptors.cronjobGetExecution, baseClient.cronjob.getExecution).getApiResource,
107
+ });
108
+ const buildCustomerApi = (baseClient) => ({
109
+ /** Get all customer categories. */
110
+ listOfCustomerCategories: new ApiCallAsyncResourceFactory(descriptors.customerListOfCustomerCategories, baseClient.customer.listOfCustomerCategories).getApiResource,
111
+ /** Get all customer profiles the authenticated user has access to. */
112
+ listCustomers: new ApiCallAsyncResourceFactory(descriptors.customerListCustomers, baseClient.customer.listCustomers).getApiResource,
113
+ /** Get a customer category. */
114
+ getCustomerCategory: new ApiCallAsyncResourceFactory(descriptors.customerGetCustomerCategory, baseClient.customer.getCustomerCategory).getApiResource,
115
+ /** Get a CustomerInvite. */
116
+ getCustomerInvite: new ApiCallAsyncResourceFactory(descriptors.customerGetCustomerInvite, baseClient.customer.getCustomerInvite).getApiResource,
117
+ /** Get a CustomerMembership. */
118
+ getCustomerMembership: new ApiCallAsyncResourceFactory(descriptors.customerGetCustomerMembership, baseClient.customer.getCustomerMembership).getApiResource,
119
+ /** Get a customer profile. */
120
+ getCustomer: new ApiCallAsyncResourceFactory(descriptors.customerGetCustomer, baseClient.customer.getCustomer).getApiResource,
121
+ /** Get a CustomerInvite by token. */
122
+ getCustomerTokenInvite: new ApiCallAsyncResourceFactory(descriptors.customerGetCustomerTokenInvite, baseClient.customer.getCustomerTokenInvite).getApiResource,
123
+ /** Check if the customer profile has a valid contract partner configured. */
124
+ isCustomerLegallyCompetent: new ApiCallAsyncResourceFactory(descriptors.customerIsCustomerLegallyCompetent, baseClient.customer.isCustomerLegallyCompetent).getApiResource,
125
+ /** List CustomerInvites belonging to the executing user. */
126
+ listCustomerInvites: new ApiCallAsyncResourceFactory(descriptors.customerListCustomerInvites, baseClient.customer.listCustomerInvites).getApiResource,
127
+ /** List CustomerMemberships belonging to the executing user. */
128
+ listCustomerMemberships: new ApiCallAsyncResourceFactory(descriptors.customerListCustomerMemberships, baseClient.customer.listCustomerMemberships).getApiResource,
129
+ /** List Invites belonging to a Customer. */
130
+ listInvitesForCustomer: new ApiCallAsyncResourceFactory(descriptors.customerListInvitesForCustomer, baseClient.customer.listInvitesForCustomer).getApiResource,
131
+ /** List Memberships belonging to a Customer. */
132
+ listMembershipsForCustomer: new ApiCallAsyncResourceFactory(descriptors.customerListMembershipsForCustomer, baseClient.customer.listMembershipsForCustomer).getApiResource,
133
+ });
134
+ const buildDatabaseApi = (baseClient) => ({
135
+ /** List MySQLDatabases belonging to a Project. */
136
+ listMysqlDatabases: new ApiCallAsyncResourceFactory(descriptors.databaseListMysqlDatabases, baseClient.database.listMysqlDatabases).getApiResource,
137
+ /** List MySQLUsers belonging to a Database. */
138
+ listMysqlUsers: new ApiCallAsyncResourceFactory(descriptors.databaseListMysqlUsers, baseClient.database.listMysqlUsers).getApiResource,
139
+ /** List RedisDatabases belonging to a Project. */
140
+ listRedisDatabases: new ApiCallAsyncResourceFactory(descriptors.databaseListRedisDatabases, baseClient.database.listRedisDatabases).getApiResource,
141
+ /** Get a MySQLDatabase. */
142
+ getMysqlDatabase: new ApiCallAsyncResourceFactory(descriptors.databaseGetMysqlDatabase, baseClient.database.getMysqlDatabase).getApiResource,
143
+ /** Get a MySQLUser. */
144
+ getMysqlUser: new ApiCallAsyncResourceFactory(descriptors.databaseGetMysqlUser, baseClient.database.getMysqlUser).getApiResource,
145
+ /** Get a RedisDatabase. */
146
+ getRedisDatabase: new ApiCallAsyncResourceFactory(descriptors.databaseGetRedisDatabase, baseClient.database.getRedisDatabase).getApiResource,
147
+ /** Get a MySQLUser's PhpMyAdmin-URL. */
148
+ getMysqlUserPhpMyAdminUrl: new ApiCallAsyncResourceFactory(descriptors.databaseGetMysqlUserPhpMyAdminUrl, baseClient.database.getMysqlUserPhpMyAdminUrl).getApiResource,
149
+ /** List available MySQL character sets and collations, optionally filtered by a MySQLVersion. */
150
+ listMysqlCharsets: new ApiCallAsyncResourceFactory(descriptors.databaseListMysqlCharsets, baseClient.database.listMysqlCharsets).getApiResource,
151
+ /** List MySQLVersions. */
152
+ listMysqlVersions: new ApiCallAsyncResourceFactory(descriptors.databaseListMysqlVersions, baseClient.database.listMysqlVersions).getApiResource,
153
+ /** List RedisVersions. */
154
+ listRedisVersions: new ApiCallAsyncResourceFactory(descriptors.databaseListRedisVersions, baseClient.database.listRedisVersions).getApiResource,
155
+ });
156
+ const buildDomainApi = (baseClient) => ({
157
+ /** Get a DNSZone. */
158
+ dnsGetDnsZone: new ApiCallAsyncResourceFactory(descriptors.dnsGetDnsZone, baseClient.domain.dnsGetDnsZone).getApiResource,
159
+ /** List DNSZones belonging to a Project. */
160
+ dnsListDnsZones: new ApiCallAsyncResourceFactory(descriptors.dnsListDnsZones, baseClient.domain.dnsListDnsZones).getApiResource,
161
+ /** List Domains */
162
+ listDomains: new ApiCallAsyncResourceFactory(descriptors.domainListDomains, baseClient.domain.listDomains).getApiResource,
163
+ /** Get a Domain. */
164
+ getDomain: new ApiCallAsyncResourceFactory(descriptors.domainGetDomain, baseClient.domain.getDomain).getApiResource,
165
+ /** Get the latest screenshot's FileReference belonging to a Domain. */
166
+ getLatestScreenshot: new ApiCallAsyncResourceFactory(descriptors.domainGetLatestScreenshot, baseClient.domain.getLatestScreenshot).getApiResource,
167
+ /** List the contact schemas for a TLD. */
168
+ listTldContactSchemas: new ApiCallAsyncResourceFactory(descriptors.domainListTldContactSchemas, baseClient.domain.listTldContactSchemas).getApiResource,
169
+ /** List TLDs. */
170
+ listTlds: new ApiCallAsyncResourceFactory(descriptors.domainListTlds, baseClient.domain.listTlds).getApiResource,
171
+ /** List Ingresses. */
172
+ ingressListIngresses: new ApiCallAsyncResourceFactory(descriptors.ingressListIngresses, baseClient.domain.ingressListIngresses).getApiResource,
173
+ /** Get an Ingress. */
174
+ ingressGetIngress: new ApiCallAsyncResourceFactory(descriptors.ingressGetIngress, baseClient.domain.ingressGetIngress).getApiResource,
175
+ });
176
+ const buildFileApi = (baseClient) => ({
177
+ /** Get a File's meta. */
178
+ getFileMeta: new ApiCallAsyncResourceFactory(descriptors.fileGetFileMeta, baseClient.file.getFileMeta).getApiResource,
179
+ /** Get a FileUploadToken's rules. */
180
+ getFileUploadTokenRules: new ApiCallAsyncResourceFactory(descriptors.fileGetFileUploadTokenRules, baseClient.file.getFileUploadTokenRules).getApiResource,
181
+ /** Get a FileUploadType's rules. */
182
+ getFileUploadTypeRules: new ApiCallAsyncResourceFactory(descriptors.fileGetFileUploadTypeRules, baseClient.file.getFileUploadTypeRules).getApiResource,
183
+ /** Get a File. */
184
+ getFile: new ApiCallAsyncResourceFactory(descriptors.fileGetFile, baseClient.file.getFile).getApiResource,
185
+ });
186
+ const buildMailApi = (baseClient) => ({
187
+ /** List DeliveryBoxes belonging to a Project. */
188
+ listDeliveryBoxes: new ApiCallAsyncResourceFactory(descriptors.mailListDeliveryBoxes, baseClient.mail.listDeliveryBoxes).getApiResource,
189
+ /** List MailAddresses belonging to a Project. */
190
+ listMailAddresses: new ApiCallAsyncResourceFactory(descriptors.mailListMailAddresses, baseClient.mail.listMailAddresses).getApiResource,
191
+ /** Get a DeliveryBox. */
192
+ getDeliveryBox: new ApiCallAsyncResourceFactory(descriptors.mailGetDeliveryBox, baseClient.mail.getDeliveryBox).getApiResource,
193
+ /** Get a MailAddress. */
194
+ getMailAddress: new ApiCallAsyncResourceFactory(descriptors.mailGetMailAddress, baseClient.mail.getMailAddress).getApiResource,
195
+ /** List mail settings of a Project. */
196
+ listProjectMailSettings: new ApiCallAsyncResourceFactory(descriptors.mailListProjectMailSettings, baseClient.mail.listProjectMailSettings).getApiResource,
197
+ });
198
+ const buildNotificationApi = (baseClient) => ({
199
+ /** Getting the subscription status of the subscription. */
200
+ newsletterGetInfo: new ApiCallAsyncResourceFactory(descriptors.newsletterGetInfo, baseClient.notification.newsletterGetInfo).getApiResource,
201
+ /** Get the counts for unread notifications of the user. */
202
+ scountUnreadNotifications: new ApiCallAsyncResourceFactory(descriptors.notificationsCountUnreadNotifications, baseClient.notification.scountUnreadNotifications).getApiResource,
203
+ /** List all unread notifications. */
204
+ slistNotifications: new ApiCallAsyncResourceFactory(descriptors.notificationsListNotifications, baseClient.notification.slistNotifications).getApiResource,
205
+ });
206
+ const buildPageInsightsApi = (baseClient) => ({
207
+ /** Get detailed performance data for a given domain and path. */
208
+ pageinsightsGetPerformanceData: new ApiCallAsyncResourceFactory(descriptors.pageinsightsGetPerformanceData, baseClient.pageInsights.pageinsightsGetPerformanceData).getApiResource,
209
+ /** Get all data for a given strace. */
210
+ pageinsightsGetStraceData: new ApiCallAsyncResourceFactory(descriptors.pageinsightsGetStraceData, baseClient.pageInsights.pageinsightsGetStraceData).getApiResource,
211
+ /** List websites (specified as domain and path) from a project where performance data is available. */
212
+ pageinsightsListPerformanceDataForProject: new ApiCallAsyncResourceFactory(descriptors.pageinsightsListPerformanceDataForProject, baseClient.pageInsights.pageinsightsListPerformanceDataForProject).getApiResource,
213
+ });
214
+ const buildUserApi = (baseClient) => ({
215
+ /** Get a PasswordPolicy. */
216
+ passwordValidationGetPasswordPolicy: new ApiCallAsyncResourceFactory(descriptors.passwordValidationGetPasswordPolicy, baseClient.user.passwordValidationGetPasswordPolicy).getApiResource,
217
+ /** Get your verified Email-Address. */
218
+ getOwnEmail: new ApiCallAsyncResourceFactory(descriptors.userGetOwnEmail, baseClient.user.getOwnEmail).getApiResource,
219
+ /** Get your current multi factor auth status. */
220
+ getMfaStatus: new ApiCallAsyncResourceFactory(descriptors.userGetMfaStatus, baseClient.user.getMfaStatus).getApiResource,
221
+ /** List all of your ApiTokens. */
222
+ listApiTokens: new ApiCallAsyncResourceFactory(descriptors.userListApiTokens, baseClient.user.listApiTokens).getApiResource,
223
+ /** Get your stored ssh-keys. */
224
+ listSshKeys: new ApiCallAsyncResourceFactory(descriptors.userListSshKeys, baseClient.user.listSshKeys).getApiResource,
225
+ /** Get a specific ApiToken. */
226
+ getApiToken: new ApiCallAsyncResourceFactory(descriptors.userGetApiToken, baseClient.user.getApiToken).getApiResource,
227
+ /** Get a specific stored ssh-key. */
228
+ getSshKey: new ApiCallAsyncResourceFactory(descriptors.userGetSshKey, baseClient.user.getSshKey).getApiResource,
229
+ /** Get your account information. */
230
+ getOwnAccount: new ApiCallAsyncResourceFactory(descriptors.userGetOwnAccount, baseClient.user.getOwnAccount).getApiResource,
231
+ /** The timestamp of your latest password change. */
232
+ getPasswordUpdatedAt: new ApiCallAsyncResourceFactory(descriptors.userGetPasswordUpdatedAt, baseClient.user.getPasswordUpdatedAt).getApiResource,
233
+ /** Get personalized settings. */
234
+ getPersonalizedSettings: new ApiCallAsyncResourceFactory(descriptors.userGetPersonalizedSettings, baseClient.user.getPersonalizedSettings).getApiResource,
235
+ /** Get poll settings for the specified user. */
236
+ getPollStatus: new ApiCallAsyncResourceFactory(descriptors.userGetPollStatus, baseClient.user.getPollStatus).getApiResource,
237
+ /** Get a specific session. */
238
+ getSession: new ApiCallAsyncResourceFactory(descriptors.userGetSession, baseClient.user.getSession).getApiResource,
239
+ /** Get profile information for a user. */
240
+ getUser: new ApiCallAsyncResourceFactory(descriptors.userGetUser, baseClient.user.getUser).getApiResource,
241
+ /** Submitted feedback of the given user. */
242
+ listFeedback: new ApiCallAsyncResourceFactory(descriptors.userListFeedback, baseClient.user.listFeedback).getApiResource,
243
+ /** List all sessions. */
244
+ listSessions: new ApiCallAsyncResourceFactory(descriptors.userListSessions, baseClient.user.listSessions).getApiResource,
245
+ /** Obtain authorization from the resource owner. */
246
+ oauthGetAuthorization: new ApiCallAsyncResourceFactory(descriptors.userOauthGetAuthorization, baseClient.user.oauthGetAuthorization).getApiResource,
247
+ /** Request a support code. */
248
+ supportCodeRequest: new ApiCallAsyncResourceFactory(descriptors.userSupportCodeRequest, baseClient.user.supportCodeRequest).getApiResource,
249
+ });
250
+ const buildProjectApi = (baseClient) => ({
251
+ /** List Invites belonging to a Project. */
252
+ listInvitesForProject: new ApiCallAsyncResourceFactory(descriptors.projectListInvitesForProject, baseClient.project.listInvitesForProject).getApiResource,
253
+ /** Get a ProjectInvite. */
254
+ getProjectInvite: new ApiCallAsyncResourceFactory(descriptors.projectGetProjectInvite, baseClient.project.getProjectInvite).getApiResource,
255
+ /** Get a ProjectMembership */
256
+ getProjectMembership: new ApiCallAsyncResourceFactory(descriptors.projectGetProjectMembership, baseClient.project.getProjectMembership).getApiResource,
257
+ /** Get a Project. */
258
+ getProject: new ApiCallAsyncResourceFactory(descriptors.projectGetProject, baseClient.project.getProject).getApiResource,
259
+ /** Get a ProjectInvite by token. */
260
+ getProjectTokenInvite: new ApiCallAsyncResourceFactory(descriptors.projectGetProjectTokenInvite, baseClient.project.getProjectTokenInvite).getApiResource,
261
+ /** Get the executing user's membership in a Project. */
262
+ getSelfMembershipForProject: new ApiCallAsyncResourceFactory(descriptors.projectGetSelfMembershipForProject, baseClient.project.getSelfMembershipForProject).getApiResource,
263
+ /** Get a Server. */
264
+ getServer: new ApiCallAsyncResourceFactory(descriptors.projectGetServer, baseClient.project.getServer).getApiResource,
265
+ /** List Memberships belonging to a Project. */
266
+ listMembershipsForProject: new ApiCallAsyncResourceFactory(descriptors.projectListMembershipsForProject, baseClient.project.listMembershipsForProject).getApiResource,
267
+ /** List ProjectInvites belonging to the executing user. */
268
+ listProjectInvites: new ApiCallAsyncResourceFactory(descriptors.projectListProjectInvites, baseClient.project.listProjectInvites).getApiResource,
269
+ /** List ProjectMemberships belonging to the executing user. */
270
+ listProjectMemberships: new ApiCallAsyncResourceFactory(descriptors.projectListProjectMemberships, baseClient.project.listProjectMemberships).getApiResource,
271
+ /** List Projects belonging to the executing user. */
272
+ listProjects: new ApiCallAsyncResourceFactory(descriptors.projectListProjects, baseClient.project.listProjects).getApiResource,
273
+ /** List Servers belonging to the executing user. */
274
+ listServers: new ApiCallAsyncResourceFactory(descriptors.projectListServers, baseClient.project.listServers).getApiResource,
275
+ });
276
+ const buildProjectFileSystemApi = (baseClient) => ({
277
+ /** List directories belonging to a Project. */
278
+ getDirectories: new ApiCallAsyncResourceFactory(descriptors.projectFileSystemGetDirectories, baseClient.projectFileSystem.getDirectories).getApiResource,
279
+ /** Get a Project directory filesystem usage. */
280
+ getDiskUsage: new ApiCallAsyncResourceFactory(descriptors.projectFileSystemGetDiskUsage, baseClient.projectFileSystem.getDiskUsage).getApiResource,
281
+ /** Get a Project file's content. */
282
+ getFileContent: new ApiCallAsyncResourceFactory(descriptors.projectFileSystemGetFileContent, baseClient.projectFileSystem.getFileContent).getApiResource,
283
+ /** Get a Project's file/filesystem authorization token. */
284
+ getJwt: new ApiCallAsyncResourceFactory(descriptors.projectFileSystemGetJwt, baseClient.projectFileSystem.getJwt).getApiResource,
285
+ /** Get a Project file's information. */
286
+ listFiles: new ApiCallAsyncResourceFactory(descriptors.projectFileSystemListFiles, baseClient.projectFileSystem.listFiles).getApiResource,
287
+ });
288
+ const buildSshsftpUserApi = (baseClient) => ({
289
+ /** Get all SFTPUsers for a Project. */
290
+ sftpUserListSftpUsers: new ApiCallAsyncResourceFactory(descriptors.sftpUserListSftpUsers, baseClient.sshsftpUser.sftpUserListSftpUsers).getApiResource,
291
+ /** Get an SFTPUser. */
292
+ sftpUserGetSftpUser: new ApiCallAsyncResourceFactory(descriptors.sftpUserGetSftpUser, baseClient.sshsftpUser.sftpUserGetSftpUser).getApiResource,
293
+ /** Get all SSHUsers for a Project. */
294
+ sshUserListSshUsers: new ApiCallAsyncResourceFactory(descriptors.sshUserListSshUsers, baseClient.sshsftpUser.sshUserListSshUsers).getApiResource,
295
+ /** Get an SSHUser. */
296
+ sshUserGetSshUser: new ApiCallAsyncResourceFactory(descriptors.sshUserGetSshUser, baseClient.sshsftpUser.sshUserGetSshUser).getApiResource,
297
+ });
298
+ export class MittwaldAPIV2ClientReact {
299
+ /** The App API allows you to manage your apps within a project, and all the system softwares that are installed as dependencies. */
300
+ app;
301
+ /** The article API allows you to read article information. */
302
+ article;
303
+ /** The backup API allows you to manage your project backups. */
304
+ backup;
305
+ /** The contract API allows you to manage your contracts and orders */
306
+ contract;
307
+ /** The conversation API allows you to manage your support conversations. */
308
+ conversation;
309
+ /** The cronjob API allows you to manage cronjobs within a project. */
310
+ cronjob;
311
+ /** The customer API allows you to manage your own organizations and users. */
312
+ customer;
313
+ /** The database API allows you to manage your databases, like MySQL and Redis databases. */
314
+ database;
315
+ /** The domain API allows you to manage your domains, DNS records and ingress resources. */
316
+ domain;
317
+ /** The file API allows you to manage your files, for example for conversations attachments and avatar uploads. */
318
+ file;
319
+ /** The mail API allows you to manage your mail accounts. */
320
+ mail;
321
+ /** The notification API allows you to manage your notifications. */
322
+ notification;
323
+ /** The page insights API allows you to get page insights information. */
324
+ pageInsights;
325
+ /** The user API allows you to manage your own user and access information of other users that might be visible to you. */
326
+ user;
327
+ /** The project API allows you to manage your projects, and also any kinds of user memberships concerning these projects. */
328
+ project;
329
+ /** The filesystem API allows you to directly access the filesystem of your project. */
330
+ projectFileSystem;
331
+ /** The SSH/SFTP User API allows you to manage your SSH/SFTP users within a project. */
332
+ sshsftpUser;
333
+ constructor(baseClient) {
334
+ this.app = buildAppApi(baseClient);
335
+ this.article = buildArticleApi(baseClient);
336
+ this.backup = buildBackupApi(baseClient);
337
+ this.contract = buildContractApi(baseClient);
338
+ this.conversation = buildConversationApi(baseClient);
339
+ this.cronjob = buildCronjobApi(baseClient);
340
+ this.customer = buildCustomerApi(baseClient);
341
+ this.database = buildDatabaseApi(baseClient);
342
+ this.domain = buildDomainApi(baseClient);
343
+ this.file = buildFileApi(baseClient);
344
+ this.mail = buildMailApi(baseClient);
345
+ this.notification = buildNotificationApi(baseClient);
346
+ this.pageInsights = buildPageInsightsApi(baseClient);
347
+ this.user = buildUserApi(baseClient);
348
+ this.project = buildProjectApi(baseClient);
349
+ this.projectFileSystem = buildProjectFileSystemApi(baseClient);
350
+ this.sshsftpUser = buildSshsftpUserApi(baseClient);
351
+ }
352
+ static fromBaseClient(baseClient) {
353
+ return new MittwaldAPIV2ClientReact(baseClient);
354
+ }
355
+ }