@mittwald/api-models 4.58.1 → 4.58.2

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.
@@ -3,7 +3,7 @@ import { classes } from "polytype";
3
3
  import { DataModel } from "../../base/DataModel.js";
4
4
  import assertObjectFound from "../../base/assertObjectFound.js";
5
5
  import { ReferenceModel } from "../../base/ReferenceModel.js";
6
- import { provideReact } from "../../lib/provideReact.js";
6
+ import { provideReact, } from "../../react/provideReact.js";
7
7
  import { ListQueryModel } from "../../base/ListQueryModel.js";
8
8
  import { ListDataModel } from "../../base/ListDataModel.js";
9
9
  import { Project } from "../../project/index.js";
@@ -3,7 +3,7 @@ import { classes } from "polytype";
3
3
  import { DataModel } from "../../base/DataModel.js";
4
4
  import assertObjectFound from "../../base/assertObjectFound.js";
5
5
  import { ReferenceModel } from "../../base/ReferenceModel.js";
6
- import { provideReact } from "../../lib/provideReact.js";
6
+ import { provideReact, } from "../../react/provideReact.js";
7
7
  import { ListQueryModel } from "../../base/ListQueryModel.js";
8
8
  import { ListDataModel } from "../../base/ListDataModel.js";
9
9
  import { ServerListQuery } from "../../server/index.js";
@@ -3,7 +3,7 @@ import { classes } from "polytype";
3
3
  import { DataModel } from "../../base/DataModel.js";
4
4
  import assertObjectFound from "../../base/assertObjectFound.js";
5
5
  import { ReferenceModel } from "../../base/ReferenceModel.js";
6
- import { provideReact } from "../../lib/provideReact.js";
6
+ import { provideReact, } from "../../react/provideReact.js";
7
7
  import { IngressPath } from "../IngressPath/IngressPath.js";
8
8
  import { ListQueryModel } from "../../base/ListQueryModel.js";
9
9
  import { ListDataModel } from "../../base/ListDataModel.js";
@@ -3,7 +3,7 @@ import { classes } from "polytype";
3
3
  import { DataModel } from "../../base/DataModel.js";
4
4
  import assertObjectFound from "../../base/assertObjectFound.js";
5
5
  import { Server } from "../../server/index.js";
6
- import { provideReact, } from "../../lib/provideReact.js";
6
+ import { provideReact, } from "../../react/provideReact.js";
7
7
  import { Customer } from "../../customer/Customer/Customer.js";
8
8
  import { ReferenceModel } from "../../base/ReferenceModel.js";
9
9
  import { Ingress, IngressListItem, IngressListQuery, } from "../../domain/index.js";
@@ -1,3 +1,3 @@
1
1
  export * from "./MittwaldApiModelProvider.js";
2
2
  export * from "./reactUsePromise.js";
3
- export { provideReact } from "../lib/provideReact.js";
3
+ export { provideReact } from "./provideReact.js";
@@ -1,4 +1,4 @@
1
- import { reactUsePromise } from "../react/reactUsePromise.js";
1
+ import { reactUsePromise } from "./reactUsePromise.js";
2
2
  export const provideReact = (loader, dependencies) => {
3
3
  const getAsyncResource = (params) => reactUsePromise.getAsyncResource(loader, params, {
4
4
  // "stringify" dependencies to be used as loaderId
@@ -4,7 +4,7 @@ import { classes } from "polytype";
4
4
  import { DataModel } from "../../base/DataModel.js";
5
5
  import assertObjectFound from "../../base/assertObjectFound.js";
6
6
  import { Project, ProjectListQuery } from "../../project/index.js";
7
- import { provideReact } from "../../lib/provideReact.js";
7
+ import { provideReact, } from "../../react/provideReact.js";
8
8
  import { ListQueryModel } from "../../base/ListQueryModel.js";
9
9
  import { ListDataModel } from "../../base/ListDataModel.js";
10
10
  export class Server extends ReferenceModel {
@@ -1,28 +1,19 @@
1
1
  import { DataModel } from "../../base/DataModel.js";
2
2
  import { ReferenceModel } from "../../base/ReferenceModel.js";
3
- import type { AsyncResourceVariant } from "../../lib/provideReact.js";
3
+ import { AsyncResourceVariant } from "../../react/provideReact.js";
4
4
  import { AppInstallationData, AppInstallationListItemData, AppInstallationListQueryData } from "./types.js";
5
5
  import { ListQueryModel } from "../../base/ListQueryModel.js";
6
6
  import { ListDataModel } from "../../base/ListDataModel.js";
7
7
  import { Project } from "../../project/index.js";
8
8
  export declare class AppInstallation extends ReferenceModel {
9
- static find: ((id: string) => Promise<AppInstallationDetailed | undefined>) & {
10
- asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<AppInstallationDetailed | undefined>;
11
- use: (id: string) => AppInstallationDetailed | undefined;
12
- };
13
- static get: ((id: string) => Promise<AppInstallationDetailed>) & {
14
- asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<AppInstallationDetailed>;
15
- use: (id: string) => AppInstallationDetailed;
16
- };
9
+ static find: AsyncResourceVariant<(id: string) => Promise<AppInstallationDetailed | undefined>>;
10
+ static get: AsyncResourceVariant<(id: string) => Promise<AppInstallationDetailed>>;
17
11
  static ofId(id: string): AppInstallation;
18
12
  query(project: Project, query?: AppInstallationListQueryData): AppInstallationListQuery;
19
13
  /** @deprecated: use query() or project.appInstallations */
20
- static list: ((projectId: string, query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2ProjectsProjectIdAppInstallations.Get.Parameters.Query | undefined) => Promise<readonly AppInstallationListItem[]>) & {
21
- asResource: (projectId: string, query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2ProjectsProjectIdAppInstallations.Get.Parameters.Query | undefined) => import("@mittwald/react-use-promise").AsyncResource<readonly AppInstallationListItem[]>;
22
- use: (projectId: string, query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2ProjectsProjectIdAppInstallations.Get.Parameters.Query | undefined) => readonly AppInstallationListItem[];
23
- };
24
- getDetailed: AsyncResourceVariant<AppInstallationDetailed, []>;
25
- findDetailed: AsyncResourceVariant<AppInstallationDetailed | undefined, []>;
14
+ static list: AsyncResourceVariant<(projectId: string, query?: AppInstallationListQueryData) => Promise<Readonly<Array<AppInstallationListItem>>>>;
15
+ getDetailed: AsyncResourceVariant<() => Promise<AppInstallationDetailed>>;
16
+ findDetailed: AsyncResourceVariant<() => Promise<AppInstallationDetailed | undefined>>;
26
17
  }
27
18
  declare const AppInstallationCommon_base: import("polytype").Polytype.ClusteredConstructor<[{
28
19
  new (data: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.AppAppInstallation | {
@@ -114,18 +105,9 @@ export declare class AppInstallationListQuery extends ListQueryModel<AppInstalla
114
105
  readonly project: Project;
115
106
  constructor(project: Project, query?: AppInstallationListQueryData);
116
107
  refine(query: AppInstallationListQueryData): AppInstallationListQuery;
117
- execute: (() => Promise<AppInstallationList>) & {
118
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<AppInstallationList>;
119
- use: () => AppInstallationList;
120
- };
121
- getTotalCount: (() => Promise<number>) & {
122
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<number>;
123
- use: () => number;
124
- };
125
- findOneAndOnly: (() => Promise<AppInstallationListItem | undefined>) & {
126
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<AppInstallationListItem | undefined>;
127
- use: () => AppInstallationListItem | undefined;
128
- };
108
+ execute: AsyncResourceVariant<() => Promise<AppInstallationList>>;
109
+ getTotalCount: AsyncResourceVariant<() => Promise<number>>;
110
+ findOneAndOnly: AsyncResourceVariant<() => Promise<AppInstallationListItem | undefined>>;
129
111
  }
130
112
  declare const AppInstallationList_base: import("polytype").Polytype.ClusteredConstructor<[typeof AppInstallationListQuery, {
131
113
  new (items: AppInstallationListItem[], totalCount: number): ListDataModel<AppInstallationListItem>;
@@ -1,7 +1,7 @@
1
1
  import { DataModel } from "../../base/DataModel.js";
2
2
  import { ReferenceModel } from "../../base/ReferenceModel.js";
3
- import { AsyncResourceVariant } from "../../lib/provideReact.js";
4
- import { CustomerListItemData, CustomerData, CustomerListQueryData, CustomerUpdateRequestData } from "./types.js";
3
+ import { AsyncResourceVariant } from "../../react/provideReact.js";
4
+ import { CustomerData, CustomerListItemData, CustomerListQueryData, CustomerUpdateRequestData } from "./types.js";
5
5
  import { ListQueryModel } from "../../base/ListQueryModel.js";
6
6
  import { ListDataModel } from "../../base/ListDataModel.js";
7
7
  import { ServerListQuery } from "../../server/index.js";
@@ -11,22 +11,13 @@ export declare class Customer extends ReferenceModel {
11
11
  readonly projects: ProjectListQuery;
12
12
  constructor(id: string);
13
13
  static ofId(id: string): Customer;
14
- static find: ((id: string) => Promise<CustomerDetailed | undefined>) & {
15
- asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<CustomerDetailed | undefined>;
16
- use: (id: string) => CustomerDetailed | undefined;
17
- };
14
+ static find: AsyncResourceVariant<(id: string) => Promise<CustomerDetailed | undefined>>;
18
15
  static query(query?: CustomerListQueryData): CustomerListQuery;
19
16
  /** @deprecated Use query() */
20
- static list: ((query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Customers.Get.Parameters.Query | undefined) => Promise<readonly CustomerListItem[]>) & {
21
- asResource: (query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Customers.Get.Parameters.Query | undefined) => import("@mittwald/react-use-promise").AsyncResource<readonly CustomerListItem[]>;
22
- use: (query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Customers.Get.Parameters.Query | undefined) => readonly CustomerListItem[];
23
- };
24
- static get: ((id: string) => Promise<CustomerDetailed>) & {
25
- asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<CustomerDetailed>;
26
- use: (id: string) => CustomerDetailed;
27
- };
28
- getDetailed: AsyncResourceVariant<CustomerDetailed, []>;
29
- findDetailed: AsyncResourceVariant<CustomerDetailed | undefined, []>;
17
+ static list: AsyncResourceVariant<(query?: CustomerListQueryData) => Promise<Readonly<Array<CustomerListItem>>>>;
18
+ static get: AsyncResourceVariant<(id: string) => Promise<CustomerDetailed>>;
19
+ getDetailed: AsyncResourceVariant<() => Promise<CustomerDetailed>>;
20
+ findDetailed: AsyncResourceVariant<() => Promise<CustomerDetailed | undefined>>;
30
21
  update(data: CustomerUpdateRequestData): Promise<void>;
31
22
  }
32
23
  declare const CustomerCommon_base: import("polytype").Polytype.ClusteredConstructor<[{
@@ -122,18 +113,9 @@ export declare class CustomerListItem extends CustomerListItem_base {
122
113
  export declare class CustomerListQuery extends ListQueryModel<CustomerListQueryData> {
123
114
  constructor(query?: CustomerListQueryData);
124
115
  refine(query: CustomerListQueryData): CustomerListQuery;
125
- execute: (() => Promise<CustomerList>) & {
126
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<CustomerList>;
127
- use: () => CustomerList;
128
- };
129
- getTotalCount: (() => Promise<number>) & {
130
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<number>;
131
- use: () => number;
132
- };
133
- findOneAndOnly: (() => Promise<CustomerListItem | undefined>) & {
134
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<CustomerListItem | undefined>;
135
- use: () => CustomerListItem | undefined;
136
- };
116
+ execute: AsyncResourceVariant<() => Promise<CustomerList>>;
117
+ getTotalCount: AsyncResourceVariant<() => Promise<number>>;
118
+ findOneAndOnly: AsyncResourceVariant<() => Promise<CustomerListItem | undefined>>;
137
119
  }
138
120
  declare const CustomerList_base: import("polytype").Polytype.ClusteredConstructor<[typeof CustomerListQuery, {
139
121
  new (items: CustomerListItem[], totalCount: number): ListDataModel<CustomerListItem>;
@@ -1,7 +1,7 @@
1
1
  import { DataModel } from "../../base/DataModel.js";
2
2
  import { ReferenceModel } from "../../base/ReferenceModel.js";
3
- import type { AsyncResourceVariant } from "../../lib/provideReact.js";
4
- import { IngressData, IngressListItemData, IngressListQueryModelData } from "./types.js";
3
+ import { AsyncResourceVariant } from "../../react/provideReact.js";
4
+ import { IngressData, IngressListItemData, IngressListQueryData, IngressListQueryModelData } from "./types.js";
5
5
  import { IngressPath } from "../IngressPath/IngressPath.js";
6
6
  import { ListQueryModel } from "../../base/ListQueryModel.js";
7
7
  import { ListDataModel } from "../../base/ListDataModel.js";
@@ -9,20 +9,11 @@ export declare class Ingress extends ReferenceModel {
9
9
  static ofId(id: string): Ingress;
10
10
  static ofHostname(hostname: string): Ingress;
11
11
  /** @deprecated: use query() or project.ingresses */
12
- static list: ((query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Ingresses.Get.Parameters.Query | undefined) => Promise<readonly IngressListItem[]>) & {
13
- asResource: (query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Ingresses.Get.Parameters.Query | undefined) => import("@mittwald/react-use-promise").AsyncResource<readonly IngressListItem[]>;
14
- use: (query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Ingresses.Get.Parameters.Query | undefined) => readonly IngressListItem[];
15
- };
16
- static find: ((id: string) => Promise<IngressDetailed | undefined>) & {
17
- asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<IngressDetailed | undefined>;
18
- use: (id: string) => IngressDetailed | undefined;
19
- };
20
- static get: ((id: string) => Promise<IngressDetailed>) & {
21
- asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<IngressDetailed>;
22
- use: (id: string) => IngressDetailed;
23
- };
24
- getDetailed: AsyncResourceVariant<IngressDetailed, []>;
25
- findDetailed: AsyncResourceVariant<IngressDetailed | undefined, []>;
12
+ static list: AsyncResourceVariant<(query?: IngressListQueryData) => Promise<Readonly<Array<IngressListItem>>>>;
13
+ static find: AsyncResourceVariant<(id: string) => Promise<IngressDetailed | undefined>>;
14
+ static get: AsyncResourceVariant<(id: string) => Promise<IngressDetailed>>;
15
+ getDetailed: AsyncResourceVariant<() => Promise<IngressDetailed>>;
16
+ findDetailed: AsyncResourceVariant<() => Promise<IngressDetailed | undefined>>;
26
17
  }
27
18
  declare const IngressCommon_base: import("polytype").Polytype.ClusteredConstructor<[{
28
19
  new (data: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.IngressIngress | {
@@ -104,18 +95,9 @@ export declare class IngressListItem extends IngressListItem_base {
104
95
  export declare class IngressListQuery extends ListQueryModel<IngressListQueryModelData> {
105
96
  constructor(query?: IngressListQueryModelData);
106
97
  refine(query?: IngressListQueryModelData): IngressListQuery;
107
- execute: (() => Promise<IngressList>) & {
108
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<IngressList>;
109
- use: () => IngressList;
110
- };
111
- getTotalCount: (() => Promise<number>) & {
112
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<number>;
113
- use: () => number;
114
- };
115
- findOneAndOnly: (() => Promise<IngressListItem | undefined>) & {
116
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<IngressListItem | undefined>;
117
- use: () => IngressListItem | undefined;
118
- };
98
+ execute: AsyncResourceVariant<() => Promise<IngressList>>;
99
+ getTotalCount: AsyncResourceVariant<() => Promise<number>>;
100
+ findOneAndOnly: AsyncResourceVariant<() => Promise<IngressListItem | undefined>>;
119
101
  }
120
102
  declare const IngressList_base: import("polytype").Polytype.ClusteredConstructor<[typeof IngressListQuery, {
121
103
  new (items: IngressListItem[], totalCount: number): ListDataModel<IngressListItem>;
@@ -1,7 +1,7 @@
1
- import { ProjectData, ProjectListItemData, ProjectListQueryModelData } from "./types.js";
1
+ import { ProjectData, ProjectListItemData, ProjectListQueryData, ProjectListQueryModelData } from "./types.js";
2
2
  import { DataModel } from "../../base/DataModel.js";
3
3
  import { Server } from "../../server/index.js";
4
- import { type AsyncResourceVariant } from "../../lib/provideReact.js";
4
+ import { AsyncResourceVariant } from "../../react/provideReact.js";
5
5
  import { Customer } from "../../customer/Customer/Customer.js";
6
6
  import { ReferenceModel } from "../../base/ReferenceModel.js";
7
7
  import { IngressListItem, IngressListQuery } from "../../domain/index.js";
@@ -13,26 +13,17 @@ export declare class Project extends ReferenceModel {
13
13
  readonly appInstallations: AppInstallationListQuery;
14
14
  constructor(id: string);
15
15
  static ofId(id: string): Project;
16
- static find: ((id: string) => Promise<ProjectDetailed | undefined>) & {
17
- asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<ProjectDetailed | undefined>;
18
- use: (id: string) => ProjectDetailed | undefined;
19
- };
20
- static get: ((id: string) => Promise<ProjectDetailed>) & {
21
- asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<ProjectDetailed>;
22
- use: (id: string) => ProjectDetailed;
23
- };
16
+ static find: AsyncResourceVariant<(id: string) => Promise<ProjectDetailed | undefined>>;
17
+ static get: AsyncResourceVariant<(id: string) => Promise<ProjectDetailed>>;
24
18
  query(query?: ProjectListQueryModelData): ProjectListQuery;
25
19
  /** @deprecated: use query(), Customer.projects or Server.projects */
26
- static list: ((query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Projects.Get.Parameters.Query | undefined) => Promise<readonly ProjectListItem[]>) & {
27
- asResource: (query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Projects.Get.Parameters.Query | undefined) => import("@mittwald/react-use-promise").AsyncResource<readonly ProjectListItem[]>;
28
- use: (query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Projects.Get.Parameters.Query | undefined) => readonly ProjectListItem[];
29
- };
20
+ static list: AsyncResourceVariant<(query?: ProjectListQueryData) => Promise<Readonly<Array<ProjectListItem>>>>;
30
21
  static create(serverId: string, description: string): Promise<Project>;
31
- getDetailed: AsyncResourceVariant<ProjectDetailed, []>;
32
- findDetailed: AsyncResourceVariant<ProjectDetailed | undefined, []>;
22
+ getDetailed: AsyncResourceVariant<() => Promise<ProjectDetailed>>;
23
+ findDetailed: AsyncResourceVariant<() => Promise<ProjectDetailed | undefined>>;
33
24
  /** @deprecated: use ingresses property */
34
- listIngresses: AsyncResourceVariant<IngressListItem[], []>;
35
- getDefaultIngress: AsyncResourceVariant<IngressListItem, []>;
25
+ listIngresses: AsyncResourceVariant<() => Promise<readonly IngressListItem[]>>;
26
+ getDefaultIngress: AsyncResourceVariant<() => Promise<IngressListItem>>;
36
27
  updateDescription(description: string): Promise<void>;
37
28
  leave(): Promise<void>;
38
29
  delete(): Promise<void>;
@@ -252,18 +243,9 @@ export declare class ProjectListItem extends ProjectListItem_base {
252
243
  export declare class ProjectListQuery extends ListQueryModel<ProjectListQueryModelData> {
253
244
  constructor(query?: ProjectListQueryModelData);
254
245
  refine(query: ProjectListQueryModelData): ProjectListQuery;
255
- execute: (() => Promise<ProjectList>) & {
256
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<ProjectList>;
257
- use: () => ProjectList;
258
- };
259
- getTotalCount: (() => Promise<number>) & {
260
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<number>;
261
- use: () => number;
262
- };
263
- findOneAndOnly: (() => Promise<ProjectListItem | undefined>) & {
264
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<ProjectListItem | undefined>;
265
- use: () => ProjectListItem | undefined;
266
- };
246
+ execute: AsyncResourceVariant<() => Promise<ProjectList>>;
247
+ getTotalCount: AsyncResourceVariant<() => Promise<number>>;
248
+ findOneAndOnly: AsyncResourceVariant<() => Promise<ProjectListItem | undefined>>;
267
249
  }
268
250
  declare const ProjectList_base: import("polytype").Polytype.ClusteredConstructor<[typeof ProjectListQuery, {
269
251
  new (items: ProjectListItem[], totalCount: number): ListDataModel<ProjectListItem>;
@@ -1,4 +1,4 @@
1
1
  export * from "./MittwaldApiModelProvider.js";
2
2
  export * from "./reactUsePromise.js";
3
- export { type AsyncResourceVariant } from "../lib/provideReact.js";
4
- export { provideReact } from "../lib/provideReact.js";
3
+ export { type AsyncResourceVariant } from "./provideReact.js";
4
+ export { provideReact } from "./provideReact.js";
@@ -0,0 +1,9 @@
1
+ import { AsyncResource } from "./reactUsePromise.js";
2
+ import { AsyncReturnType } from "type-fest";
3
+ type AsyncFn = (...args: any[]) => Promise<unknown>;
4
+ export declare const provideReact: <T extends AsyncFn>(loader: T, dependencies?: string[]) => AsyncResourceVariant<T>;
5
+ export type AsyncResourceVariant<T extends AsyncFn> = T & {
6
+ asResource: (...params: Parameters<T>) => AsyncResource<ReturnType<T>>;
7
+ use: (...params: Parameters<T>) => AsyncReturnType<T>;
8
+ };
9
+ export {};
@@ -2,36 +2,24 @@ import { ReferenceModel } from "../../base/ReferenceModel.js";
2
2
  import { ServerData, ServerListItemData, ServerListQueryData, ServerListQueryModelData } from "./types.js";
3
3
  import { DataModel } from "../../base/DataModel.js";
4
4
  import { Project, ProjectListQuery } from "../../project/index.js";
5
- import { ParamsExceptFirst } from "../../lib/types.js";
6
- import { AsyncResourceVariant } from "../../lib/provideReact.js";
5
+ import { FirstParameter, ParamsExceptFirst } from "../../lib/types.js";
6
+ import { AsyncResourceVariant } from "../../react/provideReact.js";
7
7
  import { ListQueryModel } from "../../base/ListQueryModel.js";
8
8
  import { ListDataModel } from "../../base/ListDataModel.js";
9
9
  export declare class Server extends ReferenceModel {
10
10
  readonly projects: ProjectListQuery;
11
11
  constructor(id: string);
12
12
  static ofId(id: string): Server;
13
- static find: ((id: string) => Promise<ServerDetailed | undefined>) & {
14
- asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<ServerDetailed | undefined>;
15
- use: (id: string) => ServerDetailed | undefined;
16
- };
17
- static get: ((id: string) => Promise<ServerDetailed>) & {
18
- asResource: (id: string) => import("@mittwald/react-use-promise").AsyncResource<ServerDetailed>;
19
- use: (id: string) => ServerDetailed;
20
- };
13
+ static find: AsyncResourceVariant<(id: string) => Promise<ServerDetailed | undefined>>;
14
+ static get: AsyncResourceVariant<(id: string) => Promise<ServerDetailed>>;
21
15
  static query(query?: ServerListQueryModelData): ServerListQuery;
22
16
  /** @deprecated: use query() or customer.servers */
23
- static list: ((query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Servers.Get.Parameters.Query | undefined) => Promise<readonly ServerListItem[]>) & {
24
- asResource: (query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Servers.Get.Parameters.Query | undefined) => import("@mittwald/react-use-promise").AsyncResource<readonly ServerListItem[]>;
25
- use: (query?: import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Servers.Get.Parameters.Query | undefined) => readonly ServerListItem[];
26
- };
17
+ static list: AsyncResourceVariant<(query?: ServerListQueryData) => Promise<Readonly<ServerListItem[]>>>;
27
18
  createProject(...parameters: ParamsExceptFirst<typeof Project.create>): ReturnType<typeof Project.create>;
28
19
  /** @deprecated Use Server.projects property */
29
- listProjects: ((query?: Omit<import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Projects.Get.Parameters.Query | undefined, "serverId"> | undefined) => Promise<readonly import("../../project/index.js").ProjectListItem[]>) & {
30
- 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[]>;
31
- use: (query?: Omit<import("@mittwald/api-client").MittwaldAPIV2.Paths.V2Projects.Get.Parameters.Query | undefined, "serverId"> | undefined) => readonly import("../../project/index.js").ProjectListItem[];
32
- };
33
- getDetailed: AsyncResourceVariant<ServerDetailed, []>;
34
- findDetailed: AsyncResourceVariant<ServerDetailed | undefined, []>;
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>>;
35
23
  }
36
24
  declare const ServerCommon_base: import("polytype").Polytype.ClusteredConstructor<[{
37
25
  new (data: import("@mittwald/api-client").MittwaldAPIV2.Components.Schemas.ProjectServer | {
@@ -114,18 +102,9 @@ export declare class ServerListItem extends ServerListItem_base {
114
102
  export declare class ServerListQuery extends ListQueryModel<ServerListQueryModelData> {
115
103
  constructor(query?: ServerListQueryModelData);
116
104
  refine(query: ServerListQueryModelData): ServerListQuery;
117
- execute: (() => Promise<ServerList>) & {
118
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<ServerList>;
119
- use: () => ServerList;
120
- };
121
- getTotalCount: (() => Promise<number>) & {
122
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<number>;
123
- use: () => number;
124
- };
125
- findOneAndOnly: (() => Promise<ServerListItem | undefined>) & {
126
- asResource: () => import("@mittwald/react-use-promise").AsyncResource<ServerListItem | undefined>;
127
- use: () => ServerListItem | undefined;
128
- };
105
+ execute: AsyncResourceVariant<() => Promise<ServerList>>;
106
+ getTotalCount: AsyncResourceVariant<() => Promise<number>>;
107
+ findOneAndOnly: AsyncResourceVariant<() => Promise<ServerListItem | undefined>>;
129
108
  }
130
109
  declare const ServerList_base: import("polytype").Polytype.ClusteredConstructor<[typeof ServerListQuery, {
131
110
  new (items: ServerListItem[], totalCount: number): ListDataModel<ServerListItem>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/api-models",
3
- "version": "4.58.1",
3
+ "version": "4.58.2",
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",
@@ -74,5 +74,5 @@
74
74
  "optional": true
75
75
  }
76
76
  },
77
- "gitHead": "df0b8fa85d0a03da0dbab27569adc4db65fd84f2"
77
+ "gitHead": "9bb2a7dd33f2200b8458deac8b4fa889dce9ab3c"
78
78
  }
@@ -1,11 +0,0 @@
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>, dependencies?: string[]) => 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 {};