@mittwald/api-models 0.1.0-alpha.1 → 4.10.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.
- package/LICENSE +21 -0
- package/README.md +107 -10
- package/dist/esm/app/AppInstallation/AppInstallation.js +43 -0
- package/dist/esm/app/AppInstallation/behaviors/api.js +21 -0
- package/dist/esm/app/AppInstallation/behaviors/index.js +2 -0
- package/dist/esm/app/AppInstallation/behaviors/types.js +1 -0
- package/dist/esm/app/AppInstallation/index.js +2 -0
- package/dist/esm/app/AppInstallation/types.js +1 -0
- package/dist/esm/app/index.js +1 -0
- package/dist/esm/base/DataModel.js +7 -0
- package/dist/esm/base/ReferenceModel.js +9 -0
- package/dist/esm/base/assertObjectFound.js +9 -0
- package/dist/esm/base/index.js +1 -0
- package/dist/esm/base/types.js +1 -0
- package/dist/esm/config/behaviors/api.js +40 -0
- package/dist/esm/config/behaviors/index.js +1 -0
- package/dist/esm/config/config.js +9 -0
- package/dist/esm/config/index.js +1 -0
- package/dist/esm/customer/Customer/Customer.js +43 -0
- package/dist/esm/customer/Customer/behaviors/api.js +20 -0
- package/dist/esm/customer/Customer/behaviors/index.js +2 -0
- package/dist/esm/customer/Customer/behaviors/types.js +1 -0
- package/dist/esm/customer/Customer/index.js +2 -0
- package/dist/esm/customer/Customer/types.js +1 -0
- package/dist/esm/customer/index.js +1 -0
- package/dist/esm/domain/Ingress/Ingress.js +56 -0
- package/dist/esm/domain/Ingress/behaviors/api.js +23 -0
- package/dist/esm/domain/Ingress/behaviors/index.js +2 -0
- package/dist/esm/domain/Ingress/behaviors/types.js +1 -0
- package/dist/esm/domain/Ingress/index.js +2 -0
- package/dist/esm/domain/Ingress/types.js +1 -0
- package/dist/esm/domain/IngressPath/IngressPath.js +15 -0
- package/dist/esm/domain/IngressPath/IngressPath.test.js +16 -0
- package/dist/esm/domain/IngressPath/index.js +2 -0
- package/dist/esm/domain/IngressPath/types.js +1 -0
- package/dist/esm/domain/IngressTarget/IngressTarget.js +51 -0
- package/dist/esm/domain/IngressTarget/IngressTarget.test-types.js +13 -0
- package/dist/esm/domain/IngressTarget/index.js +2 -0
- package/dist/esm/domain/IngressTarget/types.js +1 -0
- package/dist/esm/domain/index.js +1 -0
- package/dist/esm/errors/ObjectNotFoundError.js +7 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/lib/deepFreeze.js +3 -0
- package/dist/esm/lib/provideReact.js +5 -0
- package/dist/esm/lib/types.js +1 -0
- package/dist/esm/project/Project/Project.js +69 -0
- package/dist/esm/project/Project/behaviors/api.js +51 -0
- package/dist/esm/project/Project/behaviors/inMem.js +23 -0
- package/dist/esm/project/Project/behaviors/index.js +3 -0
- package/dist/esm/project/Project/behaviors/types.js +1 -0
- package/dist/esm/project/Project/index.js +2 -0
- package/dist/esm/project/Project/types.js +1 -0
- package/dist/esm/project/index.js +1 -0
- package/dist/esm/react/MittwaldApiModelProvider.js +12 -0
- package/dist/esm/react/index.js +3 -0
- package/dist/esm/react/reactUsePromise.js +17 -0
- package/dist/esm/react.js +1 -0
- package/dist/esm/server/Server/Server.js +47 -0
- package/dist/esm/server/Server/behaviors/api.js +19 -0
- package/dist/esm/server/Server/behaviors/index.js +2 -0
- package/dist/esm/server/Server/behaviors/types.js +1 -0
- package/dist/esm/server/Server/index.js +1 -0
- package/dist/esm/server/Server/types.js +1 -0
- package/dist/esm/server/index.js +1 -0
- package/dist/types/app/AppInstallation/AppInstallation.d.ts +109 -0
- package/dist/types/app/AppInstallation/behaviors/api.d.ts +3 -0
- package/dist/types/app/AppInstallation/behaviors/index.d.ts +2 -0
- package/dist/types/app/AppInstallation/behaviors/types.d.ts +5 -0
- package/dist/types/app/AppInstallation/index.d.ts +2 -0
- package/dist/types/app/AppInstallation/types.d.ts +4 -0
- package/dist/types/app/index.d.ts +1 -0
- package/dist/types/base/DataModel.d.ts +5 -0
- package/dist/types/base/ReferenceModel.d.ts +5 -0
- package/dist/types/base/assertObjectFound.d.ts +3 -0
- package/dist/types/base/index.d.ts +1 -0
- package/dist/types/base/types.d.ts +2 -0
- package/dist/types/config/behaviors/api.d.ts +12 -0
- package/dist/types/config/behaviors/index.d.ts +1 -0
- package/dist/types/config/config.d.ts +16 -0
- package/dist/types/config/index.d.ts +1 -0
- package/dist/types/customer/Customer/Customer.d.ts +113 -0
- package/dist/types/customer/Customer/behaviors/api.d.ts +3 -0
- package/dist/types/customer/Customer/behaviors/index.d.ts +2 -0
- package/dist/types/customer/Customer/behaviors/types.d.ts +5 -0
- package/dist/types/customer/Customer/index.d.ts +2 -0
- package/dist/types/customer/Customer/types.d.ts +4 -0
- package/dist/types/customer/index.d.ts +1 -0
- package/dist/types/domain/Ingress/Ingress.d.ts +102 -0
- package/dist/types/domain/Ingress/behaviors/api.d.ts +3 -0
- package/dist/types/domain/Ingress/behaviors/index.d.ts +2 -0
- package/dist/types/domain/Ingress/behaviors/types.d.ts +5 -0
- package/dist/types/domain/Ingress/index.d.ts +2 -0
- package/dist/types/domain/Ingress/types.d.ts +6 -0
- package/dist/types/domain/IngressPath/IngressPath.d.ts +11 -0
- package/dist/types/domain/IngressPath/IngressPath.test.d.ts +1 -0
- package/dist/types/domain/IngressPath/index.d.ts +2 -0
- package/dist/types/domain/IngressPath/types.d.ts +2 -0
- package/dist/types/domain/IngressTarget/IngressTarget.d.ts +29 -0
- package/dist/types/domain/IngressTarget/IngressTarget.test-types.d.ts +1 -0
- package/dist/types/domain/IngressTarget/index.d.ts +2 -0
- package/dist/types/domain/IngressTarget/types.d.ts +6 -0
- package/dist/types/domain/index.d.ts +1 -0
- package/dist/types/errors/ObjectNotFoundError.d.ts +3 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/lib/deepFreeze.d.ts +5 -0
- package/dist/types/lib/provideReact.d.ts +11 -0
- package/dist/types/lib/types.d.ts +2 -0
- package/dist/types/project/Project/Project.d.ts +230 -0
- package/dist/types/project/Project/behaviors/api.d.ts +3 -0
- package/dist/types/project/Project/behaviors/inMem.d.ts +3 -0
- package/dist/types/project/Project/behaviors/index.d.ts +3 -0
- package/dist/types/project/Project/behaviors/types.d.ts +11 -0
- package/dist/types/project/Project/index.d.ts +2 -0
- package/dist/types/project/Project/types.d.ts +4 -0
- package/dist/types/project/index.d.ts +1 -0
- package/dist/types/react/MittwaldApiModelProvider.d.ts +2 -0
- package/dist/types/react/index.d.ts +4 -0
- package/dist/types/react/reactUsePromise.d.ts +1 -0
- package/dist/types/react.d.ts +1 -0
- package/dist/types/server/Server/Server.d.ts +72 -0
- package/dist/types/server/Server/behaviors/api.d.ts +3 -0
- package/dist/types/server/Server/behaviors/index.d.ts +2 -0
- package/dist/types/server/Server/behaviors/types.d.ts +5 -0
- package/dist/types/server/Server/index.d.ts +1 -0
- package/dist/types/server/Server/types.d.ts +4 -0
- package/dist/types/server/index.d.ts +1 -0
- package/package.json +24 -30
- package/dist/index.d.mts +0 -16601
- package/dist/index.d.ts +0 -16601
- package/dist/index.mjs +0 -704
- package/dist/index.mjs.map +0 -1
- package/dist/react.d.mts +0 -17
- package/dist/react.d.ts +0 -17
- package/dist/react.mjs +0 -17
- package/dist/react.mjs.map +0 -1
- package/dist/shared/api-models.54184fa2.mjs +0 -25
- package/dist/shared/api-models.54184fa2.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Customer/index.js";
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { DataModel } from "../../base/DataModel.js";
|
|
2
|
+
import { ReferenceModel } from "../../base/ReferenceModel.js";
|
|
3
|
+
import { IngressListItemData, IngressData, IngressListQuery } from "./types.js";
|
|
4
|
+
import { IngressPath } from "../IngressPath/IngressPath.js";
|
|
5
|
+
export declare class Ingress extends ReferenceModel {
|
|
6
|
+
static ofId(id: string): Ingress;
|
|
7
|
+
static ofHostname(hostname: string): Ingress;
|
|
8
|
+
static list: ((query?: IngressListQuery | undefined) => Promise<IngressListItem[]>) & {
|
|
9
|
+
asResource: (query?: IngressListQuery | undefined) => import("@mittwald/react-use-promise").AsyncResource<IngressListItem[]>;
|
|
10
|
+
use: (query?: IngressListQuery | undefined) => IngressListItem[];
|
|
11
|
+
};
|
|
12
|
+
static find: ((id: string) => Promise<IngressDetailed | undefined>) & {
|
|
13
|
+
asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<IngressDetailed | undefined>;
|
|
14
|
+
use: (id: string) => IngressDetailed | undefined;
|
|
15
|
+
};
|
|
16
|
+
static get: ((id: string) => Promise<IngressDetailed>) & {
|
|
17
|
+
asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<IngressDetailed>;
|
|
18
|
+
use: (id: string) => IngressDetailed;
|
|
19
|
+
};
|
|
20
|
+
getDetailed: (() => Promise<IngressDetailed>) & {
|
|
21
|
+
asResource: () => import("@mittwald/react-use-promise").AsyncResource<IngressDetailed>;
|
|
22
|
+
use: () => IngressDetailed;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
declare const IngressCommon_base: import("polytype").Polytype.ClusteredConstructor<[{
|
|
26
|
+
new (data: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressIngress | {
|
|
27
|
+
dnsValidationErrors: ("ERROR_UNSPECIFIED" | "ERROR_QUAD_A" | "ERROR_NO_A_RECORD" | "ERROR_ACME_CERTIFICATE_REQUEST_DEADLINE_EXCEEDED")[];
|
|
28
|
+
hostname: string;
|
|
29
|
+
id: string;
|
|
30
|
+
ips: {
|
|
31
|
+
v4: string[];
|
|
32
|
+
};
|
|
33
|
+
isDefault: boolean;
|
|
34
|
+
isDomain?: boolean | undefined;
|
|
35
|
+
isEnabled: boolean;
|
|
36
|
+
ownership: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressOwnership;
|
|
37
|
+
paths: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressPath[];
|
|
38
|
+
projectId: string;
|
|
39
|
+
tls: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressTlsAcme | import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressTlsCertificate;
|
|
40
|
+
}): DataModel<import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressIngress | {
|
|
41
|
+
dnsValidationErrors: ("ERROR_UNSPECIFIED" | "ERROR_QUAD_A" | "ERROR_NO_A_RECORD" | "ERROR_ACME_CERTIFICATE_REQUEST_DEADLINE_EXCEEDED")[];
|
|
42
|
+
hostname: string;
|
|
43
|
+
id: string;
|
|
44
|
+
ips: {
|
|
45
|
+
v4: string[];
|
|
46
|
+
};
|
|
47
|
+
isDefault: boolean;
|
|
48
|
+
isDomain?: boolean | undefined;
|
|
49
|
+
isEnabled: boolean;
|
|
50
|
+
ownership: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressOwnership;
|
|
51
|
+
paths: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressPath[];
|
|
52
|
+
projectId: string;
|
|
53
|
+
tls: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressTlsAcme | import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressTlsCertificate;
|
|
54
|
+
}>;
|
|
55
|
+
}, typeof Ingress]>;
|
|
56
|
+
export declare class IngressCommon extends IngressCommon_base {
|
|
57
|
+
readonly baseUrl: string;
|
|
58
|
+
readonly paths: ReadonlyArray<IngressPath>;
|
|
59
|
+
readonly defaultPath: IngressPath;
|
|
60
|
+
constructor(data: IngressListItemData | IngressData);
|
|
61
|
+
}
|
|
62
|
+
declare const IngressDetailed_base: import("polytype").Polytype.ClusteredConstructor<[typeof IngressCommon, {
|
|
63
|
+
new (data: {
|
|
64
|
+
dnsValidationErrors: ("ERROR_UNSPECIFIED" | "ERROR_QUAD_A" | "ERROR_NO_A_RECORD" | "ERROR_ACME_CERTIFICATE_REQUEST_DEADLINE_EXCEEDED")[];
|
|
65
|
+
hostname: string;
|
|
66
|
+
id: string;
|
|
67
|
+
ips: {
|
|
68
|
+
v4: string[];
|
|
69
|
+
};
|
|
70
|
+
isDefault: boolean;
|
|
71
|
+
isDomain?: boolean | undefined;
|
|
72
|
+
isEnabled: boolean;
|
|
73
|
+
ownership: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressOwnership;
|
|
74
|
+
paths: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressPath[];
|
|
75
|
+
projectId: string;
|
|
76
|
+
tls: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressTlsAcme | import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressTlsCertificate;
|
|
77
|
+
}): DataModel<{
|
|
78
|
+
dnsValidationErrors: ("ERROR_UNSPECIFIED" | "ERROR_QUAD_A" | "ERROR_NO_A_RECORD" | "ERROR_ACME_CERTIFICATE_REQUEST_DEADLINE_EXCEEDED")[];
|
|
79
|
+
hostname: string;
|
|
80
|
+
id: string;
|
|
81
|
+
ips: {
|
|
82
|
+
v4: string[];
|
|
83
|
+
};
|
|
84
|
+
isDefault: boolean;
|
|
85
|
+
isDomain?: boolean | undefined;
|
|
86
|
+
isEnabled: boolean;
|
|
87
|
+
ownership: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressOwnership;
|
|
88
|
+
paths: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressPath[];
|
|
89
|
+
projectId: string;
|
|
90
|
+
tls: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressTlsAcme | import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressTlsCertificate;
|
|
91
|
+
}>;
|
|
92
|
+
}]>;
|
|
93
|
+
export declare class IngressDetailed extends IngressDetailed_base {
|
|
94
|
+
constructor(data: IngressData);
|
|
95
|
+
}
|
|
96
|
+
declare const IngressListItem_base: import("polytype").Polytype.ClusteredConstructor<[typeof IngressCommon, {
|
|
97
|
+
new (data: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressIngress): DataModel<import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressIngress>;
|
|
98
|
+
}]>;
|
|
99
|
+
export declare class IngressListItem extends IngressListItem_base {
|
|
100
|
+
constructor(data: IngressListItemData);
|
|
101
|
+
}
|
|
102
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MittwaldAPIV2 } from "@mittwald/api-client";
|
|
2
|
+
export interface IngressListQuery {
|
|
3
|
+
projectId?: string;
|
|
4
|
+
}
|
|
5
|
+
export type IngressData = MittwaldAPIV2.Operations.IngressGetIngress.ResponseData;
|
|
6
|
+
export type IngressListItemData = MittwaldAPIV2.Operations.IngressListIngresses.ResponseData[number];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DataModel } from "../../base/DataModel.js";
|
|
2
|
+
import { IngressPathData } from "./types.js";
|
|
3
|
+
import { IngressCommon, Ingress } from "../Ingress/index.js";
|
|
4
|
+
import { IngressTarget } from "../IngressTarget/IngressTarget.js";
|
|
5
|
+
export declare class IngressPath extends DataModel<IngressPathData> {
|
|
6
|
+
readonly ingress: Ingress;
|
|
7
|
+
readonly path: string;
|
|
8
|
+
readonly url: URL;
|
|
9
|
+
readonly target: IngressTarget;
|
|
10
|
+
constructor(ingress: IngressCommon, data: IngressPathData);
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DataModel } from "../../base/DataModel.js";
|
|
2
|
+
import { IngressUndefinedTargetData, IngressDirectoryTargetData, IngressAppInstallationTargetData, IngressRedirectTargetData, IngressTargetData } from "./types.js";
|
|
3
|
+
import { IngressPath } from "../IngressPath/IngressPath.js";
|
|
4
|
+
import { AppInstallation } from "../../app/AppInstallation/index.js";
|
|
5
|
+
declare abstract class IngressTargetBase<T extends IngressTargetData> extends DataModel<T> {
|
|
6
|
+
readonly path: IngressPath;
|
|
7
|
+
constructor(path: IngressPath, data: T);
|
|
8
|
+
}
|
|
9
|
+
export declare class IngressRedirectTarget extends IngressTargetBase<IngressRedirectTargetData> {
|
|
10
|
+
readonly type = "redirect";
|
|
11
|
+
readonly url: URL;
|
|
12
|
+
constructor(path: IngressPath, data: IngressRedirectTargetData);
|
|
13
|
+
}
|
|
14
|
+
export declare class IngressDirectoryTarget extends IngressTargetBase<IngressDirectoryTargetData> {
|
|
15
|
+
readonly type = "directory";
|
|
16
|
+
readonly directory: string;
|
|
17
|
+
constructor(path: IngressPath, data: IngressDirectoryTargetData);
|
|
18
|
+
}
|
|
19
|
+
export declare class IngressAppInstallationTarget extends IngressTargetBase<IngressAppInstallationTargetData> {
|
|
20
|
+
readonly type = "appInstallation";
|
|
21
|
+
readonly appInstallation: AppInstallation;
|
|
22
|
+
constructor(path: IngressPath, data: IngressAppInstallationTargetData);
|
|
23
|
+
}
|
|
24
|
+
export declare class IngressUndefinedTarget extends IngressTargetBase<IngressUndefinedTargetData> {
|
|
25
|
+
readonly type = "undefined";
|
|
26
|
+
}
|
|
27
|
+
export type IngressTarget = IngressRedirectTarget | IngressDirectoryTarget | IngressAppInstallationTarget | IngressUndefinedTarget;
|
|
28
|
+
export declare const ingressTargetFactory: (path: IngressPath, data: IngressTargetData) => IngressTarget;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MittwaldAPIV2 } from "@mittwald/api-client";
|
|
2
|
+
export type IngressRedirectTargetData = MittwaldAPIV2.Components.Schemas.IngressTargetUrl;
|
|
3
|
+
export type IngressDirectoryTargetData = MittwaldAPIV2.Components.Schemas.IngressTargetDirectory;
|
|
4
|
+
export type IngressAppInstallationTargetData = MittwaldAPIV2.Components.Schemas.IngressTargetInstallation;
|
|
5
|
+
export type IngressUndefinedTargetData = MittwaldAPIV2.Components.Schemas.IngressTargetUseDefaultPage;
|
|
6
|
+
export type IngressTargetData = IngressRedirectTargetData | IngressDirectoryTargetData | IngressAppInstallationTargetData | IngressUndefinedTargetData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Ingress/index.js";
|
|
@@ -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,11 @@
|
|
|
1
|
+
import { AsyncResource } from "../react/reactUsePromise.js";
|
|
2
|
+
type FnParameters = unknown[];
|
|
3
|
+
type AsyncFn<TResult, TParams extends FnParameters> = (...args: TParams) => Promise<TResult>;
|
|
4
|
+
export declare const provideReact: <TValue, TParams extends FnParameters>(loader: AsyncFn<TValue, TParams>) => AsyncResourceVariant<TValue, TParams>;
|
|
5
|
+
export type AsyncResourceVariant<TValue, TParams extends FnParameters> = TParams extends null ? AsyncFn<TValue, TParams> & {
|
|
6
|
+
asResource: () => AsyncResource<TValue>;
|
|
7
|
+
} : AsyncFn<TValue, TParams> & {
|
|
8
|
+
asResource: (...params: TParams) => AsyncResource<TValue>;
|
|
9
|
+
use: (...params: TParams) => TValue;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { ProjectListItemData, ProjectData } from "./types.js";
|
|
2
|
+
import { DataModel } from "../../base/DataModel.js";
|
|
3
|
+
import { Server } from "../../server/index.js";
|
|
4
|
+
import { Customer } from "../../customer/Customer/Customer.js";
|
|
5
|
+
import { ReferenceModel } from "../../base/ReferenceModel.js";
|
|
6
|
+
import { IngressListItem } from "../../domain/index.js";
|
|
7
|
+
export declare class Project extends ReferenceModel {
|
|
8
|
+
static ofId(id: string): Project;
|
|
9
|
+
static find: ((id: string) => Promise<ProjectDetailed | undefined>) & {
|
|
10
|
+
asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<ProjectDetailed | undefined>;
|
|
11
|
+
use: (id: string) => ProjectDetailed | undefined;
|
|
12
|
+
};
|
|
13
|
+
static get: ((id: string) => Promise<ProjectDetailed>) & {
|
|
14
|
+
asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<ProjectDetailed>;
|
|
15
|
+
use: (id: string) => ProjectDetailed;
|
|
16
|
+
};
|
|
17
|
+
static list: ((query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Projects.Get.Parameters.Query | undefined) => Promise<readonly ProjectListItem[]>) & {
|
|
18
|
+
asResource: (query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Projects.Get.Parameters.Query | undefined) => import("@mittwald/react-use-promise").AsyncResource<readonly ProjectListItem[]>;
|
|
19
|
+
use: (query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Projects.Get.Parameters.Query | undefined) => readonly ProjectListItem[];
|
|
20
|
+
};
|
|
21
|
+
static create(serverId: string, description: string): Promise<Project>;
|
|
22
|
+
getDetailed: (() => Promise<ProjectDetailed>) & {
|
|
23
|
+
asResource: () => import("@mittwald/react-use-promise").AsyncResource<ProjectDetailed>;
|
|
24
|
+
use: () => ProjectDetailed;
|
|
25
|
+
};
|
|
26
|
+
listIngresses: (() => Promise<IngressListItem[]>) & {
|
|
27
|
+
asResource: () => import("@mittwald/react-use-promise").AsyncResource<IngressListItem[]>;
|
|
28
|
+
use: () => IngressListItem[];
|
|
29
|
+
};
|
|
30
|
+
getDefaultIngress: (() => Promise<IngressListItem>) & {
|
|
31
|
+
asResource: () => import("@mittwald/react-use-promise").AsyncResource<IngressListItem>;
|
|
32
|
+
use: () => IngressListItem;
|
|
33
|
+
};
|
|
34
|
+
updateDescription(description: string): Promise<void>;
|
|
35
|
+
leave(): Promise<void>;
|
|
36
|
+
delete(): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
declare const ProjectCommon_base: import("polytype").Polytype.ClusteredConstructor<[{
|
|
39
|
+
new (data: {
|
|
40
|
+
clusterDomain?: string | undefined;
|
|
41
|
+
clusterID?: string | undefined;
|
|
42
|
+
createdAt: string;
|
|
43
|
+
customerId: string;
|
|
44
|
+
description: string;
|
|
45
|
+
directories: {
|
|
46
|
+
[k: string]: string;
|
|
47
|
+
};
|
|
48
|
+
disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason | undefined;
|
|
49
|
+
disabledAt?: string | undefined;
|
|
50
|
+
enabled: boolean;
|
|
51
|
+
id: string;
|
|
52
|
+
imageRefId?: string | undefined;
|
|
53
|
+
isReady: boolean;
|
|
54
|
+
projectHostingId?: string | undefined;
|
|
55
|
+
readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
|
|
56
|
+
serverId?: string | undefined;
|
|
57
|
+
serverShortId?: string | undefined;
|
|
58
|
+
shortId: string;
|
|
59
|
+
spec?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectHardwareSpec | import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectVisitorSpec | undefined;
|
|
60
|
+
statisticsBaseDomain?: string | undefined;
|
|
61
|
+
status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
|
|
62
|
+
statusSetAt: string;
|
|
63
|
+
} | {
|
|
64
|
+
createdAt: string;
|
|
65
|
+
customerId: string;
|
|
66
|
+
customerMeta: {
|
|
67
|
+
id: string;
|
|
68
|
+
};
|
|
69
|
+
description: string;
|
|
70
|
+
disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason | undefined;
|
|
71
|
+
disabledAt?: string | undefined;
|
|
72
|
+
enabled: boolean;
|
|
73
|
+
id: string;
|
|
74
|
+
imageRefId?: string | undefined;
|
|
75
|
+
isReady: boolean;
|
|
76
|
+
projectHostingId?: string | undefined;
|
|
77
|
+
readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
|
|
78
|
+
serverId?: string | undefined;
|
|
79
|
+
shortId: string;
|
|
80
|
+
status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
|
|
81
|
+
statusSetAt: string;
|
|
82
|
+
}): DataModel<{
|
|
83
|
+
clusterDomain?: string | undefined;
|
|
84
|
+
clusterID?: string | undefined;
|
|
85
|
+
createdAt: string;
|
|
86
|
+
customerId: string;
|
|
87
|
+
description: string;
|
|
88
|
+
directories: {
|
|
89
|
+
[k: string]: string;
|
|
90
|
+
};
|
|
91
|
+
disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason | undefined;
|
|
92
|
+
disabledAt?: string | undefined;
|
|
93
|
+
enabled: boolean;
|
|
94
|
+
id: string;
|
|
95
|
+
imageRefId?: string | undefined;
|
|
96
|
+
isReady: boolean;
|
|
97
|
+
projectHostingId?: string | undefined;
|
|
98
|
+
readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
|
|
99
|
+
serverId?: string | undefined;
|
|
100
|
+
serverShortId?: string | undefined;
|
|
101
|
+
shortId: string;
|
|
102
|
+
spec?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectHardwareSpec | import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectVisitorSpec | undefined;
|
|
103
|
+
statisticsBaseDomain?: string | undefined;
|
|
104
|
+
status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
|
|
105
|
+
statusSetAt: string;
|
|
106
|
+
} | {
|
|
107
|
+
createdAt: string;
|
|
108
|
+
customerId: string;
|
|
109
|
+
customerMeta: {
|
|
110
|
+
id: string;
|
|
111
|
+
};
|
|
112
|
+
description: string;
|
|
113
|
+
disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason | undefined;
|
|
114
|
+
disabledAt?: string | undefined;
|
|
115
|
+
enabled: boolean;
|
|
116
|
+
id: string;
|
|
117
|
+
imageRefId?: string | undefined;
|
|
118
|
+
isReady: boolean;
|
|
119
|
+
projectHostingId?: string | undefined;
|
|
120
|
+
readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
|
|
121
|
+
serverId?: string | undefined;
|
|
122
|
+
shortId: string;
|
|
123
|
+
status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
|
|
124
|
+
statusSetAt: string;
|
|
125
|
+
}>;
|
|
126
|
+
}, typeof Project]>;
|
|
127
|
+
declare class ProjectCommon extends ProjectCommon_base {
|
|
128
|
+
readonly server: Server | undefined;
|
|
129
|
+
readonly customer: Customer;
|
|
130
|
+
constructor(data: ProjectListItemData | ProjectData);
|
|
131
|
+
}
|
|
132
|
+
declare const ProjectDetailed_base: import("polytype").Polytype.ClusteredConstructor<[typeof ProjectCommon, {
|
|
133
|
+
new (data: {
|
|
134
|
+
clusterDomain?: string | undefined;
|
|
135
|
+
clusterID?: string | undefined;
|
|
136
|
+
createdAt: string;
|
|
137
|
+
customerId: string;
|
|
138
|
+
description: string;
|
|
139
|
+
directories: {
|
|
140
|
+
[k: string]: string;
|
|
141
|
+
};
|
|
142
|
+
disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason | undefined;
|
|
143
|
+
disabledAt?: string | undefined;
|
|
144
|
+
enabled: boolean;
|
|
145
|
+
id: string;
|
|
146
|
+
imageRefId?: string | undefined;
|
|
147
|
+
isReady: boolean;
|
|
148
|
+
projectHostingId?: string | undefined;
|
|
149
|
+
readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
|
|
150
|
+
serverId?: string | undefined;
|
|
151
|
+
serverShortId?: string | undefined;
|
|
152
|
+
shortId: string;
|
|
153
|
+
spec?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectHardwareSpec | import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectVisitorSpec | undefined;
|
|
154
|
+
statisticsBaseDomain?: string | undefined;
|
|
155
|
+
status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
|
|
156
|
+
statusSetAt: string;
|
|
157
|
+
}): DataModel<{
|
|
158
|
+
clusterDomain?: string | undefined;
|
|
159
|
+
clusterID?: string | undefined;
|
|
160
|
+
createdAt: string;
|
|
161
|
+
customerId: string;
|
|
162
|
+
description: string;
|
|
163
|
+
directories: {
|
|
164
|
+
[k: string]: string;
|
|
165
|
+
};
|
|
166
|
+
disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason | undefined;
|
|
167
|
+
disabledAt?: string | undefined;
|
|
168
|
+
enabled: boolean;
|
|
169
|
+
id: string;
|
|
170
|
+
imageRefId?: string | undefined;
|
|
171
|
+
isReady: boolean;
|
|
172
|
+
projectHostingId?: string | undefined;
|
|
173
|
+
readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
|
|
174
|
+
serverId?: string | undefined;
|
|
175
|
+
serverShortId?: string | undefined;
|
|
176
|
+
shortId: string;
|
|
177
|
+
spec?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectHardwareSpec | import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectVisitorSpec | undefined;
|
|
178
|
+
statisticsBaseDomain?: string | undefined;
|
|
179
|
+
status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
|
|
180
|
+
statusSetAt: string;
|
|
181
|
+
}>;
|
|
182
|
+
}]>;
|
|
183
|
+
export declare class ProjectDetailed extends ProjectDetailed_base {
|
|
184
|
+
constructor(data: ProjectData);
|
|
185
|
+
}
|
|
186
|
+
declare const ProjectListItem_base: import("polytype").Polytype.ClusteredConstructor<[typeof ProjectCommon, {
|
|
187
|
+
new (data: {
|
|
188
|
+
createdAt: string;
|
|
189
|
+
customerId: string;
|
|
190
|
+
customerMeta: {
|
|
191
|
+
id: string;
|
|
192
|
+
};
|
|
193
|
+
description: string;
|
|
194
|
+
disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason | undefined;
|
|
195
|
+
disabledAt?: string | undefined;
|
|
196
|
+
enabled: boolean;
|
|
197
|
+
id: string;
|
|
198
|
+
imageRefId?: string | undefined;
|
|
199
|
+
isReady: boolean;
|
|
200
|
+
projectHostingId?: string | undefined;
|
|
201
|
+
readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
|
|
202
|
+
serverId?: string | undefined;
|
|
203
|
+
shortId: string;
|
|
204
|
+
status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
|
|
205
|
+
statusSetAt: string;
|
|
206
|
+
}): DataModel<{
|
|
207
|
+
createdAt: string;
|
|
208
|
+
customerId: string;
|
|
209
|
+
customerMeta: {
|
|
210
|
+
id: string;
|
|
211
|
+
};
|
|
212
|
+
description: string;
|
|
213
|
+
disableReason?: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDisableReason | undefined;
|
|
214
|
+
disabledAt?: string | undefined;
|
|
215
|
+
enabled: boolean;
|
|
216
|
+
id: string;
|
|
217
|
+
imageRefId?: string | undefined;
|
|
218
|
+
isReady: boolean;
|
|
219
|
+
projectHostingId?: string | undefined;
|
|
220
|
+
readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedProjectReadinessStatus;
|
|
221
|
+
serverId?: string | undefined;
|
|
222
|
+
shortId: string;
|
|
223
|
+
status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectProjectStatus;
|
|
224
|
+
statusSetAt: string;
|
|
225
|
+
}>;
|
|
226
|
+
}]>;
|
|
227
|
+
export declare class ProjectListItem extends ProjectListItem_base {
|
|
228
|
+
constructor(data: ProjectListItemData);
|
|
229
|
+
}
|
|
230
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ProjectListItemData, ProjectData, ProjectListQuery } from "../types.js";
|
|
2
|
+
export interface ProjectBehaviors {
|
|
3
|
+
find: (id: string) => Promise<ProjectData | undefined>;
|
|
4
|
+
list: (query?: ProjectListQuery) => Promise<ProjectListItemData[]>;
|
|
5
|
+
create: (serverId: string, description: string) => Promise<{
|
|
6
|
+
id: string;
|
|
7
|
+
}>;
|
|
8
|
+
leave: (projectId: string) => Promise<void>;
|
|
9
|
+
delete: (projectId: string) => Promise<void>;
|
|
10
|
+
updateDescription: (projectId: string, description: string) => Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MittwaldAPIV2 } from "@mittwald/api-client";
|
|
2
|
+
export type ProjectListQuery = MittwaldAPIV2.Paths.V2Projects.Get.Parameters.Query;
|
|
3
|
+
export type ProjectData = MittwaldAPIV2.Operations.ProjectGetProject.ResponseData;
|
|
4
|
+
export type ProjectListItemData = MittwaldAPIV2.Operations.ProjectListProjects.ResponseData[number];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Project/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { AsyncResource, getAsyncResource, } from "@mittwald/react-use-promise";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./react/index.js";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ReferenceModel } from "../../base/ReferenceModel.js";
|
|
2
|
+
import { ServerListItemData, ServerData } from "./types.js";
|
|
3
|
+
import { DataModel } from "../../base/DataModel.js";
|
|
4
|
+
import { Project } from "../../project/index.js";
|
|
5
|
+
import { ParamsExceptFirst } from "../../lib/types.js";
|
|
6
|
+
export declare class Server extends ReferenceModel {
|
|
7
|
+
static find: ((id: string) => Promise<Server | undefined>) & {
|
|
8
|
+
asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<Server | undefined>;
|
|
9
|
+
use: (id: string) => Server | undefined;
|
|
10
|
+
};
|
|
11
|
+
static get: ((id: string) => Promise<Server>) & {
|
|
12
|
+
asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<Server>;
|
|
13
|
+
use: (id: string) => Server;
|
|
14
|
+
};
|
|
15
|
+
static list: ((query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Servers.Get.Parameters.Query | undefined) => Promise<ServerListItem[]>) & {
|
|
16
|
+
asResource: (query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Servers.Get.Parameters.Query | undefined) => import("@mittwald/react-use-promise").AsyncResource<ServerListItem[]>;
|
|
17
|
+
use: (query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Servers.Get.Parameters.Query | undefined) => ServerListItem[];
|
|
18
|
+
};
|
|
19
|
+
static ofId(id: string): Server;
|
|
20
|
+
createProject(...parameters: ParamsExceptFirst<typeof Project.create>): ReturnType<typeof Project.create>;
|
|
21
|
+
listProjects: ((query?: Omit<import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Projects.Get.Parameters.Query | undefined, "serverId"> | undefined) => Promise<readonly import("../../project/index.js").ProjectListItem[]>) & {
|
|
22
|
+
asResource: (query?: Omit<import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Projects.Get.Parameters.Query | undefined, "serverId"> | undefined) => import("@mittwald/react-use-promise").AsyncResource<readonly import("../../project/index.js").ProjectListItem[]>;
|
|
23
|
+
use: (query?: Omit<import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Projects.Get.Parameters.Query | undefined, "serverId"> | undefined) => readonly import("../../project/index.js").ProjectListItem[];
|
|
24
|
+
};
|
|
25
|
+
getDetailed: (() => Promise<ServerDetailed>) & {
|
|
26
|
+
asResource: () => import("@mittwald/react-use-promise").AsyncResource<ServerDetailed>;
|
|
27
|
+
use: () => ServerDetailed;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
declare const ServerCommon_base: import("polytype").Polytype.ClusteredConstructor<[{
|
|
31
|
+
new (data: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServer | {
|
|
32
|
+
clusterName: string;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
customerId: string;
|
|
35
|
+
description: string;
|
|
36
|
+
disabledReason?: "suspended" | undefined;
|
|
37
|
+
id: string;
|
|
38
|
+
imageRefId?: string | undefined;
|
|
39
|
+
isReady: boolean;
|
|
40
|
+
machineType: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectMachineType;
|
|
41
|
+
readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedServerReadinessStatus;
|
|
42
|
+
shortId: string;
|
|
43
|
+
statisticsBaseDomain?: string | undefined;
|
|
44
|
+
status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServerStatus;
|
|
45
|
+
storage: string;
|
|
46
|
+
}): DataModel<import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServer | {
|
|
47
|
+
clusterName: string;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
customerId: string;
|
|
50
|
+
description: string;
|
|
51
|
+
disabledReason?: "suspended" | undefined;
|
|
52
|
+
id: string;
|
|
53
|
+
imageRefId?: string | undefined;
|
|
54
|
+
isReady: boolean;
|
|
55
|
+
machineType: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectMachineType;
|
|
56
|
+
readiness: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectDeprecatedServerReadinessStatus;
|
|
57
|
+
shortId: string;
|
|
58
|
+
statisticsBaseDomain?: string | undefined;
|
|
59
|
+
status: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServerStatus;
|
|
60
|
+
storage: string;
|
|
61
|
+
}>;
|
|
62
|
+
}, typeof Server]>;
|
|
63
|
+
declare class ServerCommon extends ServerCommon_base {
|
|
64
|
+
constructor(data: ServerListItemData | ServerData);
|
|
65
|
+
}
|
|
66
|
+
declare const ServerListItem_base: import("polytype").Polytype.ClusteredConstructor<[typeof ServerCommon, typeof DataModel<ServerListItemData>]>;
|
|
67
|
+
export declare class ServerListItem extends ServerListItem_base {
|
|
68
|
+
}
|
|
69
|
+
declare const ServerDetailed_base: import("polytype").Polytype.ClusteredConstructor<[typeof ServerCommon, typeof DataModel<ServerData>]>;
|
|
70
|
+
export declare class ServerDetailed extends ServerDetailed_base {
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Server.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { MittwaldAPIV2 } from "@mittwald/api-client";
|
|
2
|
+
export type ServerListQuery = MittwaldAPIV2.Paths.V2Servers.Get.Parameters.Query;
|
|
3
|
+
export type ServerData = MittwaldAPIV2.Operations.ProjectGetServer.ResponseData;
|
|
4
|
+
export type ServerListItemData = MittwaldAPIV2.Operations.ProjectListServers.ResponseData[number];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Server/index.js";
|