@mittwald/api-models 4.242.3 → 4.244.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 (179) hide show
  1. package/dist/esm/app/AppInstallation/AppInstallation.js +89 -0
  2. package/dist/esm/app/AppInstallation/behaviors/api.js +24 -0
  3. package/dist/esm/app/AppInstallation/behaviors/index.js +2 -0
  4. package/dist/esm/app/AppInstallation/behaviors/types.js +1 -0
  5. package/dist/esm/app/AppInstallation/index.js +2 -0
  6. package/dist/esm/app/AppInstallation/types.js +1 -0
  7. package/dist/esm/app/index.js +1 -0
  8. package/dist/esm/article/Article/Article.js +79 -0
  9. package/dist/esm/article/Article/behaviors/api.js +22 -0
  10. package/dist/esm/article/Article/behaviors/index.js +2 -0
  11. package/dist/esm/article/Article/behaviors/types.js +1 -0
  12. package/dist/esm/article/Article/index.js +2 -0
  13. package/dist/esm/article/Article/types.js +1 -0
  14. package/dist/esm/article/index.js +1 -0
  15. package/dist/esm/base/DataModel.js +7 -0
  16. package/dist/esm/base/ListDataModel.js +8 -0
  17. package/dist/esm/base/ListQueryModel.js +11 -0
  18. package/dist/esm/base/Money.js +5 -0
  19. package/dist/esm/base/ReferenceModel.js +9 -0
  20. package/dist/esm/base/assertObjectFound.js +9 -0
  21. package/dist/esm/base/index.js +6 -0
  22. package/dist/esm/base/types.js +1 -0
  23. package/dist/esm/config/behaviors/api.js +49 -0
  24. package/dist/esm/config/behaviors/index.js +1 -0
  25. package/dist/esm/config/config.js +13 -0
  26. package/dist/esm/config/index.js +1 -0
  27. package/dist/esm/contract/Contract/Contract.js +78 -0
  28. package/dist/esm/contract/Contract/behaviors/api.js +20 -0
  29. package/dist/esm/contract/Contract/behaviors/index.js +2 -0
  30. package/dist/esm/contract/Contract/behaviors/types.js +1 -0
  31. package/dist/esm/contract/Contract/index.js +2 -0
  32. package/dist/esm/contract/Contract/types.js +1 -0
  33. package/dist/esm/contract/ContractItem/ContractItem.js +31 -0
  34. package/dist/esm/contract/ContractItem/behaviors/api.js +13 -0
  35. package/dist/esm/contract/ContractItem/behaviors/index.js +2 -0
  36. package/dist/esm/contract/ContractItem/behaviors/types.js +1 -0
  37. package/dist/esm/contract/ContractItem/index.js +2 -0
  38. package/dist/esm/contract/ContractItem/types.js +1 -0
  39. package/dist/esm/contract/index.js +2 -0
  40. package/dist/esm/customer/Customer/Customer.js +96 -0
  41. package/dist/esm/customer/Customer/behaviors/api.js +30 -0
  42. package/dist/esm/customer/Customer/behaviors/index.js +2 -0
  43. package/dist/esm/customer/Customer/behaviors/types.js +1 -0
  44. package/dist/esm/customer/Customer/index.js +2 -0
  45. package/dist/esm/customer/Customer/types.js +1 -0
  46. package/dist/esm/customer/index.js +1 -0
  47. package/dist/esm/domain/Ingress/Ingress.js +106 -0
  48. package/dist/esm/domain/Ingress/behaviors/api.js +25 -0
  49. package/dist/esm/domain/Ingress/behaviors/index.js +2 -0
  50. package/dist/esm/domain/Ingress/behaviors/types.js +1 -0
  51. package/dist/esm/domain/Ingress/index.js +2 -0
  52. package/dist/esm/domain/Ingress/types.js +1 -0
  53. package/dist/esm/domain/IngressPath/IngressPath.js +15 -0
  54. package/dist/esm/domain/IngressPath/IngressPath.test.js +16 -0
  55. package/dist/esm/domain/IngressPath/index.js +2 -0
  56. package/dist/esm/domain/IngressPath/types.js +1 -0
  57. package/dist/esm/domain/IngressTarget/IngressTarget.js +40 -0
  58. package/dist/esm/domain/IngressTarget/IngressTarget.test-types.js +10 -0
  59. package/dist/esm/domain/IngressTarget/index.js +2 -0
  60. package/dist/esm/domain/IngressTarget/types.js +1 -0
  61. package/dist/esm/domain/index.js +1 -0
  62. package/dist/esm/errors/ObjectNotFoundError.js +7 -0
  63. package/dist/esm/index.js +7 -0
  64. package/dist/esm/lib/deepFreeze.js +4 -0
  65. package/dist/esm/lib/joinedId.js +1 -0
  66. package/dist/esm/lib/types.js +1 -0
  67. package/dist/esm/project/Project/Project.js +121 -0
  68. package/dist/esm/project/Project/behaviors/api.js +58 -0
  69. package/dist/esm/project/Project/behaviors/inMem.js +27 -0
  70. package/dist/esm/project/Project/behaviors/index.js +3 -0
  71. package/dist/esm/project/Project/behaviors/types.js +1 -0
  72. package/dist/esm/project/Project/index.js +2 -0
  73. package/dist/esm/project/Project/types.js +1 -0
  74. package/dist/esm/project/index.js +1 -0
  75. package/dist/esm/react/MittwaldApiModelProvider.js +12 -0
  76. package/dist/esm/react/asyncResourceInvalidation.js +29 -0
  77. package/dist/esm/react/index.js +4 -0
  78. package/dist/esm/react/provideReact.js +27 -0
  79. package/dist/esm/react/provideReact.test-types.js +21 -0
  80. package/dist/esm/react/reactProvisionContext.js +2 -0
  81. package/dist/esm/react/reactUsePromise.js +17 -0
  82. package/dist/esm/react.js +1 -0
  83. package/dist/esm/server/Server/Server.js +102 -0
  84. package/dist/esm/server/Server/behaviors/api.js +22 -0
  85. package/dist/esm/server/Server/behaviors/index.js +2 -0
  86. package/dist/esm/server/Server/behaviors/types.js +1 -0
  87. package/dist/esm/server/Server/index.js +1 -0
  88. package/dist/esm/server/Server/types.js +1 -0
  89. package/dist/esm/server/index.js +1 -0
  90. package/dist/types/app/AppInstallation/AppInstallation.d.ts +138 -0
  91. package/dist/types/app/AppInstallation/behaviors/api.d.ts +3 -0
  92. package/dist/types/app/AppInstallation/behaviors/index.d.ts +2 -0
  93. package/dist/types/app/AppInstallation/behaviors/types.d.ts +6 -0
  94. package/dist/types/app/AppInstallation/index.d.ts +2 -0
  95. package/dist/types/app/AppInstallation/types.d.ts +4 -0
  96. package/dist/types/app/index.d.ts +1 -0
  97. package/dist/types/article/Article/Article.d.ts +133 -0
  98. package/dist/types/article/Article/behaviors/api.d.ts +3 -0
  99. package/dist/types/article/Article/behaviors/index.d.ts +2 -0
  100. package/dist/types/article/Article/behaviors/types.d.ts +6 -0
  101. package/dist/types/article/Article/index.d.ts +2 -0
  102. package/dist/types/article/Article/types.d.ts +5 -0
  103. package/dist/types/article/index.d.ts +1 -0
  104. package/dist/types/base/DataModel.d.ts +5 -0
  105. package/dist/types/base/ListDataModel.d.ts +5 -0
  106. package/dist/types/base/ListQueryModel.d.ts +9 -0
  107. package/dist/types/base/Money.d.ts +3 -0
  108. package/dist/types/base/ReferenceModel.d.ts +5 -0
  109. package/dist/types/base/assertObjectFound.d.ts +3 -0
  110. package/dist/types/base/index.d.ts +6 -0
  111. package/dist/types/base/types.d.ts +6 -0
  112. package/dist/types/config/behaviors/api.d.ts +12 -0
  113. package/dist/types/config/behaviors/index.d.ts +1 -0
  114. package/dist/types/config/config.d.ts +23 -0
  115. package/dist/types/config/index.d.ts +1 -0
  116. package/dist/types/contract/Contract/Contract.d.ts +68 -0
  117. package/dist/types/contract/Contract/behaviors/api.d.ts +3 -0
  118. package/dist/types/contract/Contract/behaviors/index.d.ts +2 -0
  119. package/dist/types/contract/Contract/behaviors/types.d.ts +9 -0
  120. package/dist/types/contract/Contract/index.d.ts +2 -0
  121. package/dist/types/contract/Contract/types.d.ts +8 -0
  122. package/dist/types/contract/ContractItem/ContractItem.d.ts +64 -0
  123. package/dist/types/contract/ContractItem/behaviors/api.d.ts +3 -0
  124. package/dist/types/contract/ContractItem/behaviors/index.d.ts +2 -0
  125. package/dist/types/contract/ContractItem/behaviors/types.d.ts +4 -0
  126. package/dist/types/contract/ContractItem/index.d.ts +2 -0
  127. package/dist/types/contract/ContractItem/types.d.ts +2 -0
  128. package/dist/types/contract/index.d.ts +2 -0
  129. package/dist/types/customer/Customer/Customer.d.ts +138 -0
  130. package/dist/types/customer/Customer/behaviors/api.d.ts +3 -0
  131. package/dist/types/customer/Customer/behaviors/index.d.ts +2 -0
  132. package/dist/types/customer/Customer/behaviors/types.d.ts +7 -0
  133. package/dist/types/customer/Customer/index.d.ts +2 -0
  134. package/dist/types/customer/Customer/types.d.ts +5 -0
  135. package/dist/types/customer/index.d.ts +1 -0
  136. package/dist/types/domain/Ingress/Ingress.d.ts +109 -0
  137. package/dist/types/domain/Ingress/behaviors/api.d.ts +3 -0
  138. package/dist/types/domain/Ingress/behaviors/index.d.ts +2 -0
  139. package/dist/types/domain/Ingress/behaviors/types.d.ts +6 -0
  140. package/dist/types/domain/Ingress/index.d.ts +2 -0
  141. package/dist/types/domain/Ingress/types.d.ts +8 -0
  142. package/dist/types/domain/IngressPath/IngressPath.d.ts +11 -0
  143. package/dist/types/domain/IngressPath/IngressPath.test.d.ts +1 -0
  144. package/dist/types/domain/IngressPath/index.d.ts +2 -0
  145. package/dist/types/domain/IngressPath/types.d.ts +2 -0
  146. package/dist/types/domain/IngressTarget/IngressTarget.d.ts +24 -0
  147. package/dist/types/domain/IngressTarget/IngressTarget.test-types.d.ts +1 -0
  148. package/dist/types/domain/IngressTarget/index.d.ts +2 -0
  149. package/dist/types/domain/IngressTarget/types.d.ts +6 -0
  150. package/dist/types/domain/index.d.ts +1 -0
  151. package/dist/types/errors/ObjectNotFoundError.d.ts +3 -0
  152. package/dist/types/index.d.ts +7 -0
  153. package/dist/types/lib/deepFreeze.d.ts +5 -0
  154. package/dist/types/lib/joinedId.d.ts +1 -0
  155. package/dist/types/lib/types.d.ts +2 -0
  156. package/dist/types/project/Project/Project.d.ts +292 -0
  157. package/dist/types/project/Project/behaviors/api.d.ts +3 -0
  158. package/dist/types/project/Project/behaviors/inMem.d.ts +3 -0
  159. package/dist/types/project/Project/behaviors/index.d.ts +3 -0
  160. package/dist/types/project/Project/behaviors/types.d.ts +12 -0
  161. package/dist/types/project/Project/index.d.ts +2 -0
  162. package/dist/types/project/Project/types.d.ts +10 -0
  163. package/dist/types/project/index.d.ts +1 -0
  164. package/dist/types/react/MittwaldApiModelProvider.d.ts +6 -0
  165. package/dist/types/react/asyncResourceInvalidation.d.ts +4 -0
  166. package/dist/types/react/index.d.ts +5 -0
  167. package/dist/types/react/provideReact.d.ts +12 -0
  168. package/dist/types/react/provideReact.test-types.d.ts +1 -0
  169. package/dist/types/react/reactProvisionContext.d.ts +3 -0
  170. package/dist/types/react/reactUsePromise.d.ts +2 -0
  171. package/dist/types/react.d.ts +1 -0
  172. package/dist/types/server/Server/Server.d.ts +115 -0
  173. package/dist/types/server/Server/behaviors/api.d.ts +3 -0
  174. package/dist/types/server/Server/behaviors/index.d.ts +2 -0
  175. package/dist/types/server/Server/behaviors/types.d.ts +6 -0
  176. package/dist/types/server/Server/index.d.ts +1 -0
  177. package/dist/types/server/Server/types.d.ts +8 -0
  178. package/dist/types/server/index.d.ts +1 -0
  179. package/package.json +3 -3
@@ -0,0 +1,3 @@
1
+ export default class ObjectNotFoundError extends Error {
2
+ constructor(type: string, refName: string);
3
+ }
@@ -0,0 +1,7 @@
1
+ export { MittwaldAPIV2Client } from "@mittwald/api-client";
2
+ export * from "./config/index.js";
3
+ export * from "./project/index.js";
4
+ export * from "./server/index.js";
5
+ export * from "./domain/index.js";
6
+ export * from "./customer/index.js";
7
+ export * from "./base/index.js";
@@ -0,0 +1,5 @@
1
+ import type { ReadonlyDeep } from "type-fest";
2
+ export type { ReadonlyDeep } from "type-fest";
3
+ type DeepFreeze = <T>(subject: T) => ReadonlyDeep<T>;
4
+ declare const deepFreeze: DeepFreeze;
5
+ export default deepFreeze;
@@ -0,0 +1 @@
1
+ export declare const joinedId: (...parts: Array<number | string>) => string;
@@ -0,0 +1,2 @@
1
+ export type ParamsExceptFirst<T extends (...args: any[]) => unknown> = T extends (ignoredFirst: never, ...args: infer P) => unknown ? P : never;
2
+ export type FirstParameter<T extends (...args: any[]) => unknown> = T extends (first: infer P, ...args: any[]) => unknown ? P : never;
@@ -0,0 +1,292 @@
1
+ import { ProjectData, ProjectListItemData, ProjectListQueryData, ProjectListQueryModelData } from "./types.js";
2
+ import { DataModel } from "../../base/DataModel.js";
3
+ import { Server } from "../../server/index.js";
4
+ import { AsyncResourceVariant } from "../../react/provideReact.js";
5
+ import { Customer } from "../../customer/Customer/Customer.js";
6
+ import { ReferenceModel } from "../../base/ReferenceModel.js";
7
+ import { IngressListItem, IngressListQuery } from "../../domain/index.js";
8
+ import { ListQueryModel } from "../../base/ListQueryModel.js";
9
+ import { ListDataModel } from "../../base/ListDataModel.js";
10
+ import { AppInstallationListQuery } from "../../app/index.js";
11
+ export declare class Project extends ReferenceModel {
12
+ readonly ingresses: IngressListQuery;
13
+ readonly appInstallations: AppInstallationListQuery;
14
+ constructor(id: string);
15
+ static ofId(id: string): Project;
16
+ static find: AsyncResourceVariant<(id: string) => Promise<ProjectDetailed | undefined>>;
17
+ static get: AsyncResourceVariant<(id: string) => Promise<ProjectDetailed>>;
18
+ static query(query?: ProjectListQueryModelData): ProjectListQuery;
19
+ /** @deprecated: use query(), Customer.projects or Server.projects */
20
+ static list: AsyncResourceVariant<(query?: ProjectListQueryData) => Promise<Readonly<Array<ProjectListItem>>>>;
21
+ static create(serverId: string, description: string): Promise<Project>;
22
+ getDetailed: AsyncResourceVariant<() => Promise<ProjectDetailed>>;
23
+ findDetailed: AsyncResourceVariant<() => Promise<ProjectDetailed | undefined>>;
24
+ /** @deprecated: use ingresses property */
25
+ listIngresses: AsyncResourceVariant<() => Promise<readonly IngressListItem[]>>;
26
+ getDefaultIngress: AsyncResourceVariant<() => Promise<IngressListItem>>;
27
+ updateDescription(description: string): Promise<void>;
28
+ leave(): Promise<void>;
29
+ delete(): Promise<void>;
30
+ }
31
+ declare const ProjectCommon_base: import("polytype").Polytype.ClusteredConstructor<[{
32
+ new (data: {
33
+ backupStorageUsageInBytes: number;
34
+ backupStorageUsageInBytesSetAt: string;
35
+ createdAt: string;
36
+ customerId: string;
37
+ customerMeta: {
38
+ id: string;
39
+ };
40
+ description: string;
41
+ disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason;
42
+ disabledAt?: string;
43
+ enabled: boolean;
44
+ features?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[];
45
+ id: string;
46
+ imageRefId?: string;
47
+ isReady: boolean;
48
+ projectHostingId?: string;
49
+ readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
50
+ serverId?: string;
51
+ shortId: string;
52
+ status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
53
+ statusSetAt: string;
54
+ supportedFeatures: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[];
55
+ webStorageUsageInBytes: number;
56
+ webStorageUsageInBytesSetAt: string;
57
+ } | {
58
+ backupStorageUsageInBytes: number;
59
+ backupStorageUsageInBytesSetAt: string;
60
+ clusterDomain?: string | undefined;
61
+ clusterID?: string | undefined;
62
+ clusterId?: string | undefined;
63
+ createdAt: string;
64
+ customerId: string;
65
+ deletionRequested?: boolean | undefined;
66
+ description: string;
67
+ directories: {
68
+ [k: string]: string;
69
+ };
70
+ disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason | undefined;
71
+ disabledAt?: string | undefined;
72
+ enabled: boolean;
73
+ features?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[] | undefined;
74
+ id: string;
75
+ imageRefId?: string | undefined;
76
+ isReady: boolean;
77
+ projectHostingId?: string | undefined;
78
+ readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
79
+ serverId?: string | undefined;
80
+ serverShortId?: string | undefined;
81
+ shortId: string;
82
+ spec?: (import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectVisitorSpec | import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectHardwareSpec) | undefined;
83
+ statisticsBaseDomain?: string | undefined;
84
+ status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
85
+ statusSetAt: string;
86
+ supportedFeatures: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[];
87
+ webStorageUsageInBytes: number;
88
+ webStorageUsageInBytesSetAt: string;
89
+ }): DataModel<{
90
+ backupStorageUsageInBytes: number;
91
+ backupStorageUsageInBytesSetAt: string;
92
+ createdAt: string;
93
+ customerId: string;
94
+ customerMeta: {
95
+ id: string;
96
+ };
97
+ description: string;
98
+ disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason;
99
+ disabledAt?: string;
100
+ enabled: boolean;
101
+ features?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[];
102
+ id: string;
103
+ imageRefId?: string;
104
+ isReady: boolean;
105
+ projectHostingId?: string;
106
+ readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
107
+ serverId?: string;
108
+ shortId: string;
109
+ status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
110
+ statusSetAt: string;
111
+ supportedFeatures: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[];
112
+ webStorageUsageInBytes: number;
113
+ webStorageUsageInBytesSetAt: string;
114
+ } | {
115
+ backupStorageUsageInBytes: number;
116
+ backupStorageUsageInBytesSetAt: string;
117
+ clusterDomain?: string | undefined;
118
+ clusterID?: string | undefined;
119
+ clusterId?: string | undefined;
120
+ createdAt: string;
121
+ customerId: string;
122
+ deletionRequested?: boolean | undefined;
123
+ description: string;
124
+ directories: {
125
+ [k: string]: string;
126
+ };
127
+ disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason | undefined;
128
+ disabledAt?: string | undefined;
129
+ enabled: boolean;
130
+ features?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[] | undefined;
131
+ id: string;
132
+ imageRefId?: string | undefined;
133
+ isReady: boolean;
134
+ projectHostingId?: string | undefined;
135
+ readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
136
+ serverId?: string | undefined;
137
+ serverShortId?: string | undefined;
138
+ shortId: string;
139
+ spec?: (import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectVisitorSpec | import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectHardwareSpec) | undefined;
140
+ statisticsBaseDomain?: string | undefined;
141
+ status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
142
+ statusSetAt: string;
143
+ supportedFeatures: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[];
144
+ webStorageUsageInBytes: number;
145
+ webStorageUsageInBytesSetAt: string;
146
+ }>;
147
+ }, typeof Project]>;
148
+ declare class ProjectCommon extends ProjectCommon_base {
149
+ readonly server: Server | undefined;
150
+ readonly customer: Customer;
151
+ constructor(data: ProjectListItemData | ProjectData);
152
+ }
153
+ declare const ProjectDetailed_base: import("polytype").Polytype.ClusteredConstructor<[typeof ProjectCommon, {
154
+ new (data: {
155
+ backupStorageUsageInBytes: number;
156
+ backupStorageUsageInBytesSetAt: string;
157
+ clusterDomain?: string | undefined;
158
+ clusterID?: string | undefined;
159
+ clusterId?: string | undefined;
160
+ createdAt: string;
161
+ customerId: string;
162
+ deletionRequested?: boolean | undefined;
163
+ description: string;
164
+ directories: {
165
+ [k: string]: string;
166
+ };
167
+ disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason | undefined;
168
+ disabledAt?: string | undefined;
169
+ enabled: boolean;
170
+ features?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[] | undefined;
171
+ id: string;
172
+ imageRefId?: string | undefined;
173
+ isReady: boolean;
174
+ projectHostingId?: string | undefined;
175
+ readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
176
+ serverId?: string | undefined;
177
+ serverShortId?: string | undefined;
178
+ shortId: string;
179
+ spec?: (import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectVisitorSpec | import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectHardwareSpec) | undefined;
180
+ statisticsBaseDomain?: string | undefined;
181
+ status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
182
+ statusSetAt: string;
183
+ supportedFeatures: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[];
184
+ webStorageUsageInBytes: number;
185
+ webStorageUsageInBytesSetAt: string;
186
+ }): DataModel<{
187
+ backupStorageUsageInBytes: number;
188
+ backupStorageUsageInBytesSetAt: string;
189
+ clusterDomain?: string | undefined;
190
+ clusterID?: string | undefined;
191
+ clusterId?: string | undefined;
192
+ createdAt: string;
193
+ customerId: string;
194
+ deletionRequested?: boolean | undefined;
195
+ description: string;
196
+ directories: {
197
+ [k: string]: string;
198
+ };
199
+ disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason | undefined;
200
+ disabledAt?: string | undefined;
201
+ enabled: boolean;
202
+ features?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[] | undefined;
203
+ id: string;
204
+ imageRefId?: string | undefined;
205
+ isReady: boolean;
206
+ projectHostingId?: string | undefined;
207
+ readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
208
+ serverId?: string | undefined;
209
+ serverShortId?: string | undefined;
210
+ shortId: string;
211
+ spec?: (import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectVisitorSpec | import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectHardwareSpec) | undefined;
212
+ statisticsBaseDomain?: string | undefined;
213
+ status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
214
+ statusSetAt: string;
215
+ supportedFeatures: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[];
216
+ webStorageUsageInBytes: number;
217
+ webStorageUsageInBytesSetAt: string;
218
+ }>;
219
+ }]>;
220
+ export declare class ProjectDetailed extends ProjectDetailed_base {
221
+ constructor(data: ProjectData);
222
+ }
223
+ declare const ProjectListItem_base: import("polytype").Polytype.ClusteredConstructor<[typeof ProjectCommon, {
224
+ new (data: {
225
+ backupStorageUsageInBytes: number;
226
+ backupStorageUsageInBytesSetAt: string;
227
+ createdAt: string;
228
+ customerId: string;
229
+ customerMeta: {
230
+ id: string;
231
+ };
232
+ description: string;
233
+ disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason;
234
+ disabledAt?: string;
235
+ enabled: boolean;
236
+ features?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[];
237
+ id: string;
238
+ imageRefId?: string;
239
+ isReady: boolean;
240
+ projectHostingId?: string;
241
+ readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
242
+ serverId?: string;
243
+ shortId: string;
244
+ status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
245
+ statusSetAt: string;
246
+ supportedFeatures: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[];
247
+ webStorageUsageInBytes: number;
248
+ webStorageUsageInBytesSetAt: string;
249
+ }): DataModel<{
250
+ backupStorageUsageInBytes: number;
251
+ backupStorageUsageInBytesSetAt: string;
252
+ createdAt: string;
253
+ customerId: string;
254
+ customerMeta: {
255
+ id: string;
256
+ };
257
+ description: string;
258
+ disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason;
259
+ disabledAt?: string;
260
+ enabled: boolean;
261
+ features?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[];
262
+ id: string;
263
+ imageRefId?: string;
264
+ isReady: boolean;
265
+ projectHostingId?: string;
266
+ readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
267
+ serverId?: string;
268
+ shortId: string;
269
+ status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
270
+ statusSetAt: string;
271
+ supportedFeatures: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectFeature[];
272
+ webStorageUsageInBytes: number;
273
+ webStorageUsageInBytesSetAt: string;
274
+ }>;
275
+ }]>;
276
+ export declare class ProjectListItem extends ProjectListItem_base {
277
+ constructor(data: ProjectListItemData);
278
+ }
279
+ export declare class ProjectListQuery extends ListQueryModel<ProjectListQueryModelData> {
280
+ constructor(query?: ProjectListQueryModelData);
281
+ refine(query: ProjectListQueryModelData): ProjectListQuery;
282
+ execute: AsyncResourceVariant<() => Promise<ProjectList>>;
283
+ getTotalCount: AsyncResourceVariant<() => Promise<number>>;
284
+ findOneAndOnly: AsyncResourceVariant<() => Promise<ProjectListItem | undefined>>;
285
+ }
286
+ declare const ProjectList_base: import("polytype").Polytype.ClusteredConstructor<[typeof ProjectListQuery, {
287
+ new (items: ProjectListItem[], totalCount: number): ListDataModel<ProjectListItem>;
288
+ }]>;
289
+ export declare class ProjectList extends ProjectList_base {
290
+ constructor(query: ProjectListQueryModelData, projects: ProjectListItem[], totalCount: number);
291
+ }
292
+ export {};
@@ -0,0 +1,3 @@
1
+ import { ProjectBehaviors } from "./types.js";
2
+ import { MittwaldAPIV2Client } from "@mittwald/api-client";
3
+ export declare const apiProjectBehaviors: (client: MittwaldAPIV2Client) => ProjectBehaviors;
@@ -0,0 +1,3 @@
1
+ import { ProjectBehaviors } from "./types.js";
2
+ import { ProjectData } from "../types.js";
3
+ export declare const inMemProjectBehaviors: (store: Map<string, ProjectData>) => ProjectBehaviors;
@@ -0,0 +1,3 @@
1
+ export * from "./api.js";
2
+ export * from "./inMem.js";
3
+ export * from "./types.js";
@@ -0,0 +1,12 @@
1
+ import { ProjectListItemData, ProjectData, ProjectListQueryData } from "../types.js";
2
+ import { QueryResponseData } from "../../../base/index.js";
3
+ export interface ProjectBehaviors {
4
+ find: (id: string) => Promise<ProjectData | undefined>;
5
+ list: (query?: ProjectListQueryData) => Promise<QueryResponseData<ProjectListItemData>>;
6
+ create: (serverId: string, description: string) => Promise<{
7
+ id: string;
8
+ }>;
9
+ leave: (projectId: string) => Promise<void>;
10
+ delete: (projectId: string) => Promise<void>;
11
+ updateDescription: (projectId: string, description: string) => Promise<void>;
12
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./Project.js";
2
+ export * from "./types.js";
@@ -0,0 +1,10 @@
1
+ import { MittwaldAPIV2 } from "@mittwald/api-client";
2
+ import { Server } from "../../server/index.js";
3
+ import { Customer } from "../../customer/index.js";
4
+ export type ProjectListQueryData = MittwaldAPIV2.Paths.V2Projects.Get.Parameters.Query;
5
+ export type ProjectListQueryModelData = Omit<ProjectListQueryData, "serverId" | "customerId"> & {
6
+ server?: Server;
7
+ customer?: Customer;
8
+ };
9
+ export type ProjectData = MittwaldAPIV2.Operations.ProjectGetProject.ResponseData;
10
+ export type ProjectListItemData = MittwaldAPIV2.Operations.ProjectListProjects.ResponseData[number];
@@ -0,0 +1 @@
1
+ export * from "./Project/index.js";
@@ -0,0 +1,6 @@
1
+ import { FC, PropsWithChildren, ReactNode } from "react";
2
+ interface Props extends PropsWithChildren {
3
+ fallback?: ReactNode;
4
+ }
5
+ export declare const MittwaldApiModelProvider: FC<Props>;
6
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Commons } from "@mittwald/api-client";
2
+ export declare const refreshProvideReactCache: (tag: string) => void;
3
+ export declare const addTagToProvideReactCache: (tag: string) => void;
4
+ export declare const addUrlTagToProvideReactCache: Commons.RequestOptions["onBeforeRequest"];
@@ -0,0 +1,5 @@
1
+ export { refreshProvideReactCache, addTagToProvideReactCache, addUrlTagToProvideReactCache, } from "./asyncResourceInvalidation.js";
2
+ export * from "./MittwaldApiModelProvider.js";
3
+ export * from "./reactUsePromise.js";
4
+ export { type AsyncResourceVariant } from "./provideReact.js";
5
+ export { provideReact } from "./provideReact.js";
@@ -0,0 +1,12 @@
1
+ import { AsyncResource } from "./reactUsePromise.js";
2
+ import { AsyncReturnType } from "type-fest";
3
+ type AsyncFn = (...args: any[]) => Promise<unknown>;
4
+ type ReactProvisionDep = string | number;
5
+ type LazyReactProvisionDep = () => ReactProvisionDep;
6
+ type ReactProvisionDeps = Array<ReactProvisionDep | LazyReactProvisionDep>;
7
+ export declare const provideReact: <T extends AsyncFn>(loader: T, dependencies?: ReactProvisionDeps) => AsyncResourceVariant<T>;
8
+ export type AsyncResourceVariant<T extends AsyncFn> = T & {
9
+ asResource: (...params: Parameters<T>) => AsyncResource<AsyncReturnType<T>>;
10
+ use: (...params: Parameters<T>) => AsyncReturnType<T>;
11
+ };
12
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare const reactProvisionContext: import("context").CtxCascadeApi<{
2
+ id: string;
3
+ }>;
@@ -0,0 +1,2 @@
1
+ export type ReactUsePromiseModule = typeof import("@mittwald/react-use-promise");
2
+ export type { AsyncResource, getAsyncResource, } from "@mittwald/react-use-promise";
@@ -0,0 +1 @@
1
+ export * from "./react/index.js";
@@ -0,0 +1,115 @@
1
+ import { ReferenceModel } from "../../base/ReferenceModel.js";
2
+ import { ServerData, ServerListItemData, ServerListQueryData, ServerListQueryModelData } from "./types.js";
3
+ import { DataModel } from "../../base/DataModel.js";
4
+ import { Project, ProjectListQuery } from "../../project/index.js";
5
+ import { FirstParameter, ParamsExceptFirst } from "../../lib/types.js";
6
+ import { AsyncResourceVariant } from "../../react/provideReact.js";
7
+ import { ListQueryModel } from "../../base/ListQueryModel.js";
8
+ import { ListDataModel } from "../../base/ListDataModel.js";
9
+ export declare class Server extends ReferenceModel {
10
+ readonly projects: ProjectListQuery;
11
+ constructor(id: string);
12
+ static ofId(id: string): Server;
13
+ static find: AsyncResourceVariant<(id: string) => Promise<ServerDetailed | undefined>>;
14
+ static get: AsyncResourceVariant<(id: string) => Promise<ServerDetailed>>;
15
+ static query(query?: ServerListQueryModelData): ServerListQuery;
16
+ /** @deprecated: use query() or customer.servers */
17
+ static list: AsyncResourceVariant<(query?: ServerListQueryData) => Promise<Readonly<ServerListItem[]>>>;
18
+ createProject(...parameters: ParamsExceptFirst<typeof Project.create>): ReturnType<typeof Project.create>;
19
+ /** @deprecated Use Server.projects property */
20
+ listProjects: AsyncResourceVariant<(query?: Omit<FirstParameter<typeof Project.list>, "serverId">) => ReturnType<typeof Project.list>>;
21
+ getDetailed: AsyncResourceVariant<() => Promise<ServerDetailed>>;
22
+ findDetailed: AsyncResourceVariant<() => Promise<ServerDetailed | undefined>>;
23
+ }
24
+ declare const ServerCommon_base: import("polytype").Polytype.ClusteredConstructor<[{
25
+ new (data: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServer | {
26
+ clusterName: string;
27
+ createdAt: string;
28
+ customerId: string;
29
+ description: string;
30
+ disabledReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServerDisableReason | undefined;
31
+ id: string;
32
+ imageRefId?: string | undefined;
33
+ isReady: boolean;
34
+ machineType: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectMachineType;
35
+ readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedServerReadinessStatus;
36
+ shortId: string;
37
+ statisticsBaseDomain?: string | undefined;
38
+ status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServerStatus;
39
+ storage: string;
40
+ }): DataModel<import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServer | {
41
+ clusterName: string;
42
+ createdAt: string;
43
+ customerId: string;
44
+ description: string;
45
+ disabledReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServerDisableReason | undefined;
46
+ id: string;
47
+ imageRefId?: string | undefined;
48
+ isReady: boolean;
49
+ machineType: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectMachineType;
50
+ readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedServerReadinessStatus;
51
+ shortId: string;
52
+ statisticsBaseDomain?: string | undefined;
53
+ status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServerStatus;
54
+ storage: string;
55
+ }>;
56
+ }, typeof Server]>;
57
+ declare class ServerCommon extends ServerCommon_base {
58
+ constructor(data: ServerListItemData | ServerData);
59
+ }
60
+ declare const ServerDetailed_base: import("polytype").Polytype.ClusteredConstructor<[typeof ServerCommon, {
61
+ new (data: {
62
+ clusterName: string;
63
+ createdAt: string;
64
+ customerId: string;
65
+ description: string;
66
+ disabledReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServerDisableReason | undefined;
67
+ id: string;
68
+ imageRefId?: string | undefined;
69
+ isReady: boolean;
70
+ machineType: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectMachineType;
71
+ readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedServerReadinessStatus;
72
+ shortId: string;
73
+ statisticsBaseDomain?: string | undefined;
74
+ status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServerStatus;
75
+ storage: string;
76
+ }): DataModel<{
77
+ clusterName: string;
78
+ createdAt: string;
79
+ customerId: string;
80
+ description: string;
81
+ disabledReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServerDisableReason | undefined;
82
+ id: string;
83
+ imageRefId?: string | undefined;
84
+ isReady: boolean;
85
+ machineType: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectMachineType;
86
+ readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedServerReadinessStatus;
87
+ shortId: string;
88
+ statisticsBaseDomain?: string | undefined;
89
+ status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServerStatus;
90
+ storage: string;
91
+ }>;
92
+ }]>;
93
+ export declare class ServerDetailed extends ServerDetailed_base {
94
+ constructor(data: ServerData);
95
+ }
96
+ declare const ServerListItem_base: import("polytype").Polytype.ClusteredConstructor<[typeof ServerCommon, {
97
+ new (data: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServer): DataModel<import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServer>;
98
+ }]>;
99
+ export declare class ServerListItem extends ServerListItem_base {
100
+ constructor(data: ServerListItemData);
101
+ }
102
+ export declare class ServerListQuery extends ListQueryModel<ServerListQueryModelData> {
103
+ constructor(query?: ServerListQueryModelData);
104
+ refine(query: ServerListQueryModelData): ServerListQuery;
105
+ execute: AsyncResourceVariant<() => Promise<ServerList>>;
106
+ getTotalCount: AsyncResourceVariant<() => Promise<number>>;
107
+ findOneAndOnly: AsyncResourceVariant<() => Promise<ServerListItem | undefined>>;
108
+ }
109
+ declare const ServerList_base: import("polytype").Polytype.ClusteredConstructor<[typeof ServerListQuery, {
110
+ new (items: ServerListItem[], totalCount: number): ListDataModel<ServerListItem>;
111
+ }]>;
112
+ export declare class ServerList extends ServerList_base {
113
+ constructor(query: ServerListQueryData, servers: ServerListItem[], totalCount: number);
114
+ }
115
+ export {};
@@ -0,0 +1,3 @@
1
+ import { MittwaldAPIV2Client } from "@mittwald/api-client";
2
+ import { ServerBehaviors } from "./types.js";
3
+ export declare const apiServerBehaviors: (client: MittwaldAPIV2Client) => ServerBehaviors;
@@ -0,0 +1,2 @@
1
+ export * from "./api.js";
2
+ export * from "./types.js";
@@ -0,0 +1,6 @@
1
+ import { ServerListItemData, ServerData, ServerListQueryData } from "../types.js";
2
+ import { QueryResponseData } from "../../../base/index.js";
3
+ export interface ServerBehaviors {
4
+ find: (id: string) => Promise<ServerData | undefined>;
5
+ list: (query?: ServerListQueryData) => Promise<QueryResponseData<ServerListItemData>>;
6
+ }
@@ -0,0 +1 @@
1
+ export * from "./Server.js";
@@ -0,0 +1,8 @@
1
+ import { MittwaldAPIV2 } from "@mittwald/api-client";
2
+ import { Customer } from "../../customer/index.js";
3
+ export type ServerListQueryData = MittwaldAPIV2.Paths.V2Servers.Get.Parameters.Query;
4
+ export type ServerListQueryModelData = Omit<ServerListQueryData, "customerId"> & {
5
+ customer?: Customer;
6
+ };
7
+ export type ServerData = MittwaldAPIV2.Operations.ProjectGetServer.ResponseData;
8
+ export type ServerListItemData = MittwaldAPIV2.Operations.ProjectListServers.ResponseData[number];
@@ -0,0 +1 @@
1
+ export * from "./Server/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/api-models",
3
- "version": "4.242.3",
3
+ "version": "4.244.0",
4
4
  "author": "Mittwald CM Service GmbH & Co. KG <opensource@mittwald.de>",
5
5
  "type": "module",
6
6
  "description": "Collection of domain models for coherent interaction with the API",
@@ -39,7 +39,7 @@
39
39
  "test:unit": "node --experimental-vm-modules $(yarn bin jest)"
40
40
  },
41
41
  "dependencies": {
42
- "@mittwald/api-client": "^4.242.3",
42
+ "@mittwald/api-client": "^4.244.0",
43
43
  "another-deep-freeze": "1.0.0",
44
44
  "context": "^3.0.33",
45
45
  "dinero.js": "^1.9.1",
@@ -84,5 +84,5 @@
84
84
  "optional": true
85
85
  }
86
86
  },
87
- "gitHead": "be36a719ff623407718ceee05c2a13dddfdfdd9d"
87
+ "gitHead": "1088e07d560115000a33d9115a6c19088893a549"
88
88
  }