@platform-mesh/portal-ui-lib 0.73.0 → 0.74.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/assets/platform-mesh-portal-ui-wc.js +285 -275
- package/fesm2022/platform-mesh-portal-ui-lib-models.mjs +8 -14
- package/fesm2022/platform-mesh-portal-ui-lib-models.mjs.map +1 -1
- package/fesm2022/platform-mesh-portal-ui-lib-portal-options.mjs +1945 -1448
- package/fesm2022/platform-mesh-portal-ui-lib-portal-options.mjs.map +1 -1
- package/fesm2022/platform-mesh-portal-ui-lib-services.mjs +985 -970
- package/fesm2022/platform-mesh-portal-ui-lib-services.mjs.map +1 -1
- package/fesm2022/platform-mesh-portal-ui-lib-utils.mjs +180 -264
- package/fesm2022/platform-mesh-portal-ui-lib-utils.mjs.map +1 -1
- package/fesm2022/platform-mesh-portal-ui-lib.mjs +2 -9
- package/fesm2022/platform-mesh-portal-ui-lib.mjs.map +1 -1
- package/package.json +4 -4
- package/types/platform-mesh-portal-ui-lib-models.d.ts +177 -187
- package/types/platform-mesh-portal-ui-lib-portal-options.d.ts +117 -129
- package/types/platform-mesh-portal-ui-lib-services.d.ts +239 -254
- package/types/platform-mesh-portal-ui-lib-utils.d.ts +38 -51
- package/types/platform-mesh-portal-ui-lib.d.ts +1 -3
|
@@ -1,259 +1,244 @@
|
|
|
1
|
-
import { NodeContext } from
|
|
2
|
-
import {
|
|
3
|
-
import { Apollo } from
|
|
4
|
-
import * as i0 from
|
|
5
|
-
import { Observable } from
|
|
6
|
-
import { GenericResource } from
|
|
7
|
-
import { VariableOptions } from
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
1
|
+
import { NodeContext } from "@openmfp/portal-ui-lib";
|
|
2
|
+
import { AccountInfo, ButtonSettings, DownloadKubeconfigFromSecretRefButtonSettings, LogicalCluster, PermissionsDefinition, PlatformMeshFieldDefinition, Resource, ResourceDefinition, ResourceListResult, ResourceOperationType, ResourcePagination, ResourceSubscriptionResult } from "@platform-mesh/portal-ui-lib/models";
|
|
3
|
+
import { Apollo } from "apollo-angular";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import { Observable } from "rxjs";
|
|
6
|
+
import { GenericResource } from "@openmfp/ngx";
|
|
7
|
+
import { VariableOptions } from "gql-query-builder";
|
|
8
|
+
export interface ResourceNodeContext extends Partial<NodeContext> {
|
|
9
|
+
resourceDefinition?: ResourceDefinition;
|
|
10
|
+
organization?: string;
|
|
11
|
+
accountPath?: string;
|
|
12
|
+
entityName?: string;
|
|
13
|
+
resourceId?: string;
|
|
14
|
+
accountId?: string;
|
|
15
|
+
kcpCA?: string;
|
|
16
|
+
namespaceId?: string;
|
|
17
|
+
namespaces?: string[];
|
|
18
|
+
portalPermissions?: {
|
|
19
|
+
[key: string]: string[];
|
|
20
|
+
};
|
|
21
|
+
portalContext: {
|
|
22
|
+
crdGatewayApiUrl: string;
|
|
23
|
+
openSearchApiUrl?: string;
|
|
24
|
+
kcpWorkspaceUrl?: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export declare class ApolloFactory {
|
|
28
|
+
private httpLink;
|
|
29
|
+
private gatewayService;
|
|
30
|
+
private authService;
|
|
31
|
+
private luigiCoreService;
|
|
32
|
+
readonly apollo: (nodeContext: ResourceNodeContext, readFromParentKcpPath?: boolean) => Apollo;
|
|
33
|
+
/**
|
|
34
|
+
* The token must be resolved per request, never captured at client
|
|
35
|
+
* creation: a client built before the shell delivers the token would
|
|
36
|
+
* otherwise send "Bearer undefined" for its whole lifetime (silent 401s,
|
|
37
|
+
* empty views until a hard reload). Prefer live sources over the node
|
|
38
|
+
* context, which is a mount-time snapshot: in web-component bundles the
|
|
39
|
+
* injected AuthService belongs to a separate injector that never runs a
|
|
40
|
+
* refresh, so the shell's Luigi auth store is the only value that tracks
|
|
41
|
+
* the boot refresh and later scheduled refreshes.
|
|
42
|
+
*/
|
|
43
|
+
private resolveToken;
|
|
44
|
+
private resolveLuigiStoreToken;
|
|
45
|
+
/**
|
|
46
|
+
* Retries an operation exactly once when the gateway answers 401. The
|
|
47
|
+
* Authorization header is rebuilt by the context link on the retry, so a
|
|
48
|
+
* request that raced ahead of token delivery (or whose token expired in
|
|
49
|
+
* flight) heals itself instead of leaving the view empty until a manual
|
|
50
|
+
* reload. 401 means the request was rejected before execution, so this
|
|
51
|
+
* is safe for mutations too.
|
|
52
|
+
*/
|
|
53
|
+
private createAuthRetryLink;
|
|
54
|
+
private createApolloOptions;
|
|
55
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ApolloFactory, never>;
|
|
56
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
57
|
+
}
|
|
58
|
+
export declare class GatewayService {
|
|
59
|
+
private luigiCoreService;
|
|
60
|
+
getGatewayUrl(nodeContext: ResourceNodeContext, readFromParentKcpPath?: boolean): string;
|
|
61
|
+
updateCrdGatewayUrlWithEntityPath(kcpPath: string): void;
|
|
62
|
+
resolveKcpPath(nodeContext: ResourceNodeContext, readFromParentKcpPath?: boolean): string;
|
|
63
|
+
private extractKcpPath;
|
|
64
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GatewayService, never>;
|
|
65
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
66
|
+
}
|
|
67
|
+
export interface InstanceCheck {
|
|
68
|
+
resource: string;
|
|
69
|
+
group: string;
|
|
70
|
+
namespace?: string;
|
|
71
|
+
name: string;
|
|
72
|
+
actions: string[];
|
|
73
|
+
}
|
|
74
|
+
export interface ResourceCheckRequest {
|
|
75
|
+
organization: string;
|
|
76
|
+
accountPath?: string;
|
|
77
|
+
checks: InstanceCheck[];
|
|
78
|
+
}
|
|
79
|
+
export interface InstancePermissionResponse {
|
|
80
|
+
resource: string;
|
|
81
|
+
namespace?: string;
|
|
82
|
+
name?: string;
|
|
83
|
+
actions: string[];
|
|
84
|
+
}
|
|
85
|
+
export declare class InstancePermissionsService {
|
|
86
|
+
private httpClient;
|
|
87
|
+
private luigiCoreService;
|
|
88
|
+
private requestChecks;
|
|
89
|
+
checkInstance(nodeContext: ResourceNodeContext, permissionsDefinition: PermissionsDefinition, instance: {
|
|
90
|
+
name: string;
|
|
74
91
|
namespace?: string;
|
|
92
|
+
}): Observable<InstancePermissionResponse[]>;
|
|
93
|
+
checkInstances(nodeContext: ResourceNodeContext, permissionsDefinition: PermissionsDefinition, instances: {
|
|
75
94
|
name: string;
|
|
76
|
-
actions: string[];
|
|
77
|
-
}
|
|
78
|
-
interface ResourceCheckRequest {
|
|
79
|
-
organization: string;
|
|
80
|
-
accountPath?: string;
|
|
81
|
-
checks: InstanceCheck[];
|
|
82
|
-
}
|
|
83
|
-
interface InstancePermissionResponse {
|
|
84
|
-
resource: string;
|
|
85
95
|
namespace?: string;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
interface ReadResourcesPagination {
|
|
141
|
-
limit?: number;
|
|
142
|
-
/** Unified pagination cursor — maps to `continue` for ResourceService and `cursor` for OpenSearch. */
|
|
143
|
-
cursor?: string;
|
|
144
|
-
/** 1-based page number for page-based (pager) pagination. */
|
|
145
|
-
page?: number;
|
|
146
|
-
}
|
|
147
|
-
interface ReadResourcesResult {
|
|
148
|
-
items: GenericResource[];
|
|
149
|
-
nextCursor?: string;
|
|
150
|
-
remainingItemCount?: number;
|
|
151
|
-
resourceVersion?: string;
|
|
152
|
-
}
|
|
153
|
-
interface ReadResourcesSubscriptionResult {
|
|
154
|
-
type: ResourceOperationType;
|
|
155
|
-
object: GenericResource;
|
|
96
|
+
}[]): Observable<InstancePermissionResponse[]>;
|
|
97
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InstancePermissionsService, never>;
|
|
98
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
99
|
+
}
|
|
100
|
+
export interface KubeconfigDownload {
|
|
101
|
+
contents: string;
|
|
102
|
+
filename: string;
|
|
103
|
+
}
|
|
104
|
+
export declare function isDownloadKubeconfigButtonSettings(buttonSettings: ButtonSettings | undefined): buttonSettings is DownloadKubeconfigFromSecretRefButtonSettings;
|
|
105
|
+
export declare class KubeconfigSecretService {
|
|
106
|
+
private resourceService;
|
|
107
|
+
/**
|
|
108
|
+
* Fields the detail-view query has to read so the action can resolve its
|
|
109
|
+
* Secret reference from the loaded resource.
|
|
110
|
+
*/
|
|
111
|
+
secretReferenceQueryFields(buttonSettings: ButtonSettings | undefined): PlatformMeshFieldDefinition[];
|
|
112
|
+
isSecretReferenceAvailable(buttonSettings: ButtonSettings | undefined, resource: Resource | undefined, context: ResourceNodeContext): boolean;
|
|
113
|
+
readKubeconfig(buttonSettings: ButtonSettings, resource: Resource | undefined, context: ResourceNodeContext): Observable<KubeconfigDownload>;
|
|
114
|
+
private resolveSecretReference;
|
|
115
|
+
private namespaceOf;
|
|
116
|
+
private readString;
|
|
117
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<KubeconfigSecretService, never>;
|
|
118
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
119
|
+
}
|
|
120
|
+
export interface ReadResourcesParams {
|
|
121
|
+
/** Free-text query — used by the OpenSearch implementation; ignored by ResourceService. */
|
|
122
|
+
q?: string;
|
|
123
|
+
/** OpenSearch exact-match filter; ignored by ResourceService. */
|
|
124
|
+
filter?: string;
|
|
125
|
+
/** Plural resource name for OpenSearch; defaults to `resourceDefinition.entityCollection`. */
|
|
126
|
+
resource?: string;
|
|
127
|
+
/** GraphQL fields or a raw query string — used by ResourceService; ignored by OpenSearch. */
|
|
128
|
+
fields?: any[] | string;
|
|
129
|
+
/** GraphQL operation name — used by ResourceService; ignored by OpenSearch. */
|
|
130
|
+
operation?: string;
|
|
131
|
+
/** ResourceService-only flag controlling which Apollo client to use. */
|
|
132
|
+
readFromParentKcpPath?: boolean;
|
|
133
|
+
}
|
|
134
|
+
export interface ReadResourcesPagination {
|
|
135
|
+
limit?: number;
|
|
136
|
+
/** Unified pagination cursor — maps to `continue` for ResourceService and `cursor` for OpenSearch. */
|
|
137
|
+
cursor?: string;
|
|
138
|
+
/** 1-based page number for page-based (pager) pagination. */
|
|
139
|
+
page?: number;
|
|
140
|
+
}
|
|
141
|
+
export interface ReadResourcesResult {
|
|
142
|
+
items: GenericResource[];
|
|
143
|
+
nextCursor?: string;
|
|
144
|
+
remainingItemCount?: number;
|
|
145
|
+
resourceVersion?: string;
|
|
146
|
+
}
|
|
147
|
+
export interface ReadResourcesSubscriptionResult {
|
|
148
|
+
type: ResourceOperationType;
|
|
149
|
+
object: GenericResource;
|
|
156
150
|
}
|
|
157
151
|
/** Provider-agnostic read API for resource lists. Implementations can be backed by the GraphQL gateway (ResourceService) */
|
|
158
|
-
interface ReadResources {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
private pendingCheck?;
|
|
252
|
-
isOrganizationReady(): Promise<boolean>;
|
|
253
|
-
private readOrganizationReady;
|
|
254
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<OrganizationReadyService, never>;
|
|
255
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
export { AccountInfoService, ApolloFactory, ErrorHandlerService, GatewayService, InstancePermissionsService, KubeconfigSecretService, LogicalClusterService, NamespaceService, OrganizationReadyService, ResourceService, isDownloadKubeconfigButtonSettings };
|
|
259
|
-
export type { InstanceCheck, InstancePermissionResponse, KubeconfigDownload, ListOptions, ReadResources, ReadResourcesPagination, ReadResourcesParams, ReadResourcesResult, ReadResourcesSubscriptionResult, ResourceCheckRequest, ResourceNodeContext, ResourceRequestParams };
|
|
152
|
+
export interface ReadResources {
|
|
153
|
+
list(nodeContext: ResourceNodeContext, pagination: ReadResourcesPagination, params: ReadResourcesParams): Observable<ReadResourcesResult>;
|
|
154
|
+
subscribe(nodeContext: ResourceNodeContext, params: ReadResourcesParams & {
|
|
155
|
+
resourceVersion?: string;
|
|
156
|
+
}): Observable<ReadResourcesSubscriptionResult | undefined>;
|
|
157
|
+
}
|
|
158
|
+
export interface ResourceRequestParams {
|
|
159
|
+
entity: string;
|
|
160
|
+
version: string;
|
|
161
|
+
apiGroup?: string;
|
|
162
|
+
}
|
|
163
|
+
export interface ListOptions {
|
|
164
|
+
readFromParentKcpPath?: boolean;
|
|
165
|
+
pagination?: ResourcePagination;
|
|
166
|
+
variables?: VariableOptions;
|
|
167
|
+
}
|
|
168
|
+
export declare class ResourceService {
|
|
169
|
+
private apolloFactory;
|
|
170
|
+
private luigiCoreService;
|
|
171
|
+
read(resourceId: string, params: ResourceRequestParams, fieldsOrRawQuery: any[] | string, nodeContext: ResourceNodeContext, readFromParentKcpPath?: boolean): Observable<Resource>;
|
|
172
|
+
private resolveReadQuery;
|
|
173
|
+
list(operation: string, fieldsOrRawQuery: any[] | string, nodeContext: ResourceNodeContext, options?: ListOptions): Observable<ResourceListResult | any>;
|
|
174
|
+
private getResourceReadyStatus;
|
|
175
|
+
private listWithFields;
|
|
176
|
+
private getResourceId;
|
|
177
|
+
isAvailable(item: Resource, availableWhenNotReady?: boolean): boolean;
|
|
178
|
+
getAccessibleName(item: Resource): string | undefined;
|
|
179
|
+
private listWithRawQuery;
|
|
180
|
+
resourceChangeSubscription(operation: string, fields: any[], nodeContext: ResourceNodeContext, resourceVersion: string, readFromParentKcpPath: boolean): Observable<ResourceSubscriptionResult | undefined>;
|
|
181
|
+
delete(resource: Resource, resourceDefinition: ResourceDefinition, nodeContext: ResourceNodeContext, readFromParentKcpPath?: boolean): Observable<Apollo.MutateResult<void>>;
|
|
182
|
+
create(resource: Resource, resourceDefinition: ResourceDefinition, nodeContext: ResourceNodeContext): Observable<Apollo.MutateResult<unknown>>;
|
|
183
|
+
update(resource: Resource, resourceDefinition: ResourceDefinition, nodeContext: ResourceNodeContext, readFromParentKcpPath?: boolean, fields?: any[]): Observable<unknown>;
|
|
184
|
+
/**
|
|
185
|
+
* Reads the `__typename` of the query type that holds the resource, e.g.
|
|
186
|
+
* `{ network_api_foo_bar { v1alpha1 { __typename } } }`, and derives the
|
|
187
|
+
* mutation input type name from it. The gateway generates the schema, so
|
|
188
|
+
* its type names are the only source of truth.
|
|
189
|
+
*/
|
|
190
|
+
private readInputTypeName;
|
|
191
|
+
getNamespace(nodeContext: ResourceNodeContext, resource?: Resource): string | undefined;
|
|
192
|
+
private normalizeGqlBuilderVariables;
|
|
193
|
+
private calcQueryOptions;
|
|
194
|
+
private parseGQLQuery;
|
|
195
|
+
/**
|
|
196
|
+
* Returns a {@link ReadResources}-shaped adapter over this service so that
|
|
197
|
+
* consumers can swap implementations behind a feature toggle without depending
|
|
198
|
+
* on the GraphQL-specific signatures of `list` / `resourceChangeSubscription`.
|
|
199
|
+
*/
|
|
200
|
+
asReadResources(): ReadResources;
|
|
201
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ResourceService, never>;
|
|
202
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
203
|
+
}
|
|
204
|
+
export declare class AccountInfoService {
|
|
205
|
+
private apolloFactory;
|
|
206
|
+
private gatewayService;
|
|
207
|
+
private readCache;
|
|
208
|
+
read(nodeContext: ResourceNodeContext): Observable<AccountInfo>;
|
|
209
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AccountInfoService, never>;
|
|
210
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
211
|
+
}
|
|
212
|
+
export declare class LogicalClusterService {
|
|
213
|
+
private apolloFactory;
|
|
214
|
+
read(nodeContext: ResourceNodeContext): Observable<LogicalCluster>;
|
|
215
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LogicalClusterService, never>;
|
|
216
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
217
|
+
}
|
|
218
|
+
export declare class NamespaceService {
|
|
219
|
+
private resourceService;
|
|
220
|
+
list(nodeContext: ResourceNodeContext): Observable<string[]>;
|
|
221
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NamespaceService, never>;
|
|
222
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
223
|
+
}
|
|
224
|
+
export declare class ErrorHandlerService {
|
|
225
|
+
private luigiCoreService;
|
|
226
|
+
handleError(error: any, msg?: string): void;
|
|
227
|
+
errorCode(error: any): number;
|
|
228
|
+
navigateToErrorPageIfForbidden(code: number | undefined): boolean;
|
|
229
|
+
private isUnauthorizedAccess;
|
|
230
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ErrorHandlerService, never>;
|
|
231
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
232
|
+
}
|
|
233
|
+
export declare class OrganizationReadyService {
|
|
234
|
+
private configService;
|
|
235
|
+
private envConfigService;
|
|
236
|
+
private logicalClusterService;
|
|
237
|
+
private authService;
|
|
238
|
+
private isReady;
|
|
239
|
+
private pendingCheck?;
|
|
240
|
+
isOrganizationReady(): Promise<boolean>;
|
|
241
|
+
private readOrganizationReady;
|
|
242
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OrganizationReadyService, never>;
|
|
243
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
244
|
+
}
|
|
@@ -1,44 +1,34 @@
|
|
|
1
|
-
import { PlatformMeshFieldDefinition,
|
|
2
|
-
import { NodeContext } from
|
|
3
|
-
|
|
1
|
+
import { InstancePermission, PlatformMeshFieldDefinition, PropertyField, Resource, ResourceSubscriptionResult } from "@platform-mesh/portal-ui-lib/models";
|
|
2
|
+
import { NodeContext } from "@openmfp/portal-ui-lib";
|
|
4
3
|
/**
|
|
5
4
|
* Builds the input type name of a mutation from the `__typename` of the query
|
|
6
5
|
* type that holds the resource (e.g. `NetworkAPIFooBarV1alpha1Query`). The
|
|
7
6
|
* gateway names the input type `<prefix><Kind>_Input` with the same prefix,
|
|
8
7
|
* so the UI does not need its own copy of the gateway's naming rule.
|
|
9
8
|
*/
|
|
10
|
-
declare function buildGraphQLInputTypeName(queryTypeName: string | undefined, entity: string): string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
version?: string | undefined;
|
|
9
|
+
export declare function buildGraphQLInputTypeName(queryTypeName: string | undefined, entity: string): string;
|
|
10
|
+
export declare function buildResourcePath(input: {
|
|
11
|
+
apiGroup?: string | undefined;
|
|
12
|
+
entity: string;
|
|
13
|
+
version?: string | undefined;
|
|
16
14
|
}, separator?: string): string;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
forRead?: boolean;
|
|
15
|
+
export type GenerateGraphQLFieldsOptions = {
|
|
16
|
+
/** Omit fields marked writeOnly (for queries/mutation return selections). */
|
|
17
|
+
forRead?: boolean;
|
|
21
18
|
};
|
|
22
19
|
/** Builds GraphQL field selections for reads, omitting write-only secrets. */
|
|
23
|
-
declare const generateGraphQLReadFields: (uiFields: readonly PlatformMeshFieldDefinition[]) => any[];
|
|
24
|
-
declare const generateGraphQLFields: (uiFields: readonly PlatformMeshFieldDefinition[], options?: GenerateGraphQLFieldsOptions) => any[];
|
|
25
|
-
|
|
26
|
-
declare const
|
|
27
|
-
|
|
28
|
-
declare
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
declare function isNamespacedResource(nodeContext: Partial<NodeContext>): boolean;
|
|
33
|
-
|
|
34
|
-
interface MergeListWithSubscriptionResultOptions<T> {
|
|
35
|
-
getItemKey: (item: T) => string | undefined;
|
|
36
|
-
mapSubscriptionObjectToItem: (object: Resource) => T;
|
|
20
|
+
export declare const generateGraphQLReadFields: (uiFields: readonly PlatformMeshFieldDefinition[]) => any[];
|
|
21
|
+
export declare const generateGraphQLFields: (uiFields: readonly PlatformMeshFieldDefinition[], options?: GenerateGraphQLFieldsOptions) => any[];
|
|
22
|
+
export declare const getValueByPath: <T extends object, R = unknown>(obj: T, path: string) => R | undefined;
|
|
23
|
+
export declare const permissionKey: (instance: Partial<Omit<InstancePermission, "actions">>) => string;
|
|
24
|
+
export declare const isLocalSetup: () => boolean;
|
|
25
|
+
export declare function isNamespacedResource(nodeContext: Partial<NodeContext>): boolean;
|
|
26
|
+
export interface MergeListWithSubscriptionResultOptions<T> {
|
|
27
|
+
getItemKey: (item: T) => string | undefined;
|
|
28
|
+
mapSubscriptionObjectToItem: (object: Resource) => T;
|
|
37
29
|
}
|
|
38
|
-
declare function mergeListWithSubscriptionResult<T>(items: T[], subscriptionResult: ResourceSubscriptionResult | undefined, options: MergeListWithSubscriptionResultOptions<T>): T[];
|
|
39
|
-
|
|
40
|
-
declare const parseRawGqlQueryToFields: (s: string) => any[];
|
|
41
|
-
|
|
30
|
+
export declare function mergeListWithSubscriptionResult<T>(items: T[], subscriptionResult: ResourceSubscriptionResult | undefined, options: MergeListWithSubscriptionResultOptions<T>): T[];
|
|
31
|
+
export declare const parseRawGqlQueryToFields: (s: string) => any[];
|
|
42
32
|
/**
|
|
43
33
|
* Tier-1 resource-level permission check (fail-open).
|
|
44
34
|
*
|
|
@@ -47,26 +37,23 @@ declare const parseRawGqlQueryToFields: (s: string) => any[];
|
|
|
47
37
|
* portalPermissions → we don't gate). Returns false ONLY when permissions
|
|
48
38
|
* WERE fetched for the resource and the verb is absent.
|
|
49
39
|
*/
|
|
50
|
-
declare const resourceActionAllowed: (portalPermissions: {
|
|
51
|
-
|
|
40
|
+
export declare const resourceActionAllowed: (portalPermissions: {
|
|
41
|
+
[key: string]: string[];
|
|
52
42
|
} | undefined, resource: string | undefined, verb: string) => boolean;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
propertyField?: PropertyField;
|
|
43
|
+
export declare const getResourceValueByJsonPath: <T>(resource: T, field: {
|
|
44
|
+
jsonPathExpression?: string;
|
|
45
|
+
property?: string | string[];
|
|
46
|
+
propertyField?: PropertyField;
|
|
58
47
|
}) => any;
|
|
59
|
-
declare const encodeBase64: (str: string) => string;
|
|
60
|
-
declare const decodeBase64: (base64: string) => string;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
48
|
+
export declare const encodeBase64: (str: string) => string;
|
|
49
|
+
export declare const decodeBase64: (base64: string) => string;
|
|
50
|
+
export declare function stripTypename<T>(value: T): T;
|
|
51
|
+
export interface ViewUrlPlaceholderSources {
|
|
52
|
+
context?: Record<string, unknown>;
|
|
53
|
+
nodeParams?: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
export declare const resolveViewUrlPlaceholders: (viewUrl: string, sources: ViewUrlPlaceholderSources) => string | undefined;
|
|
56
|
+
export declare function deletePropertyByPath<T extends Record<string, unknown>>(object: T, path: string): T;
|
|
66
57
|
/** Flattens nested `propertyCollection` trees into a list of leaf field definitions. */
|
|
67
|
-
declare function flattenFieldTree(fields: readonly PlatformMeshFieldDefinition[] | undefined): PlatformMeshFieldDefinition[];
|
|
68
|
-
|
|
69
|
-
declare function setPropertyByPath<T extends Record<string, any>>(object: T, path: string, value: unknown): T;
|
|
70
|
-
|
|
71
|
-
export { buildGraphQLInputTypeName, buildResourcePath, decodeBase64, deletePropertyByPath, encodeBase64, flattenFieldTree, generateGraphQLFields, generateGraphQLReadFields, getResourceValueByJsonPath, getValueByPath, isLocalSetup, isNamespacedResource, mergeListWithSubscriptionResult, parseRawGqlQueryToFields, permissionKey, resourceActionAllowed, setPropertyByPath, stripTypename };
|
|
72
|
-
export type { GenerateGraphQLFieldsOptions, MergeListWithSubscriptionResultOptions };
|
|
58
|
+
export declare function flattenFieldTree(fields: readonly PlatformMeshFieldDefinition[] | undefined): PlatformMeshFieldDefinition[];
|
|
59
|
+
export declare function setPropertyByPath<T extends Record<string, any>>(object: T, path: string, value: unknown): T;
|