@unifiedsoftware/react-plugin-remote 1.0.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/README.md +90 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +587 -0
- package/dist/index.d.ts +587 -0
- package/dist/index.js +1 -0
- package/package.json +28 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { HttpAdapter, HttpRequest, HttpResponse } from '@unifiedsoftware/http-client';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Plugin System SDK Core - Types
|
|
6
|
+
*
|
|
7
|
+
* Generic interfaces for plugin system.
|
|
8
|
+
* These types are project-agnostic and can be reused in any project.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Host Context - Generic interface
|
|
13
|
+
* @template TContext - Project-specific context (e.g., MailingContext, etc.)
|
|
14
|
+
*/
|
|
15
|
+
interface HostContext<TContext = any> {
|
|
16
|
+
readonly version: string;
|
|
17
|
+
readonly environment: 'development' | 'production';
|
|
18
|
+
readonly capabilities: HostCapabilities;
|
|
19
|
+
readonly context: TContext;
|
|
20
|
+
}
|
|
21
|
+
interface HostCapabilities {
|
|
22
|
+
readonly navigation: NavigationAPI;
|
|
23
|
+
readonly modal: ModalAPI;
|
|
24
|
+
readonly notification: NotificationAPI;
|
|
25
|
+
readonly storage: StorageAPI;
|
|
26
|
+
readonly api: ApiAPI;
|
|
27
|
+
readonly events: EventAPI;
|
|
28
|
+
}
|
|
29
|
+
interface NavigationAPI {
|
|
30
|
+
navigate(path: string, options?: NavigateOptions): void;
|
|
31
|
+
back(): void;
|
|
32
|
+
forward?(): void;
|
|
33
|
+
replace?(path: string): void;
|
|
34
|
+
openExternal(url: string): void;
|
|
35
|
+
}
|
|
36
|
+
interface NavigateOptions {
|
|
37
|
+
readonly replace?: boolean;
|
|
38
|
+
readonly state?: any;
|
|
39
|
+
}
|
|
40
|
+
interface ModalAPI {
|
|
41
|
+
open<T = any>(config: ModalConfig): Promise<T>;
|
|
42
|
+
close(id?: string, result?: any): void;
|
|
43
|
+
confirm(message: string, options?: ConfirmOptions): Promise<boolean>;
|
|
44
|
+
alert(message: string, options?: AlertOptions): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
interface ModalConfig {
|
|
47
|
+
readonly id?: string;
|
|
48
|
+
readonly title: string;
|
|
49
|
+
readonly content: React.ReactNode | string;
|
|
50
|
+
readonly width?: number | string;
|
|
51
|
+
readonly height?: number | string;
|
|
52
|
+
readonly actions?: readonly ModalAction[];
|
|
53
|
+
readonly closable?: boolean;
|
|
54
|
+
readonly onClose?: () => void;
|
|
55
|
+
}
|
|
56
|
+
interface ModalAction {
|
|
57
|
+
readonly label: string;
|
|
58
|
+
readonly onClick: () => any | Promise<any>;
|
|
59
|
+
readonly primary?: boolean;
|
|
60
|
+
readonly disabled?: boolean;
|
|
61
|
+
}
|
|
62
|
+
interface ConfirmOptions {
|
|
63
|
+
readonly title?: string;
|
|
64
|
+
readonly okText?: string;
|
|
65
|
+
readonly cancelText?: string;
|
|
66
|
+
}
|
|
67
|
+
interface AlertOptions {
|
|
68
|
+
readonly title?: string;
|
|
69
|
+
readonly okText?: string;
|
|
70
|
+
}
|
|
71
|
+
interface NotificationAPI {
|
|
72
|
+
success(message: string, options?: NotificationOptions): void;
|
|
73
|
+
error(message: string, options?: NotificationOptions): void;
|
|
74
|
+
warning(message: string, options?: NotificationOptions): void;
|
|
75
|
+
info(message: string, options?: NotificationOptions): void;
|
|
76
|
+
}
|
|
77
|
+
interface NotificationOptions {
|
|
78
|
+
readonly duration?: number;
|
|
79
|
+
readonly title?: string;
|
|
80
|
+
readonly closable?: boolean;
|
|
81
|
+
readonly onClose?: () => void;
|
|
82
|
+
}
|
|
83
|
+
interface StorageAPI {
|
|
84
|
+
get<T = any>(key: string): Promise<T | null>;
|
|
85
|
+
set<T = any>(key: string, value: T): Promise<void>;
|
|
86
|
+
remove(key: string): Promise<void>;
|
|
87
|
+
clear(): Promise<void>;
|
|
88
|
+
keys?(): Promise<string[]>;
|
|
89
|
+
}
|
|
90
|
+
interface ApiAPI {
|
|
91
|
+
request<T = any>(config: ApiRequestConfig): Promise<T>;
|
|
92
|
+
graphql<T = any>(config: GraphQLRequestConfig): Promise<GraphQLResponse<T>>;
|
|
93
|
+
getAuthToken(): Promise<string>;
|
|
94
|
+
}
|
|
95
|
+
interface ApiRequestConfig {
|
|
96
|
+
readonly pluginId: string;
|
|
97
|
+
readonly apiName?: string;
|
|
98
|
+
readonly endpoint: string;
|
|
99
|
+
readonly method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
100
|
+
readonly params?: Record<string, any>;
|
|
101
|
+
readonly data?: any;
|
|
102
|
+
readonly headers?: Record<string, string>;
|
|
103
|
+
}
|
|
104
|
+
interface GraphQLRequestConfig {
|
|
105
|
+
readonly pluginId: string;
|
|
106
|
+
readonly apiName?: string;
|
|
107
|
+
readonly query: string;
|
|
108
|
+
readonly variables?: Record<string, any>;
|
|
109
|
+
readonly operationName?: string;
|
|
110
|
+
readonly headers?: Record<string, string>;
|
|
111
|
+
}
|
|
112
|
+
interface GraphQLResponse<T = any> {
|
|
113
|
+
readonly data?: T;
|
|
114
|
+
readonly errors?: readonly GraphQLError[];
|
|
115
|
+
readonly extensions?: Record<string, any>;
|
|
116
|
+
}
|
|
117
|
+
interface GraphQLError {
|
|
118
|
+
readonly message: string;
|
|
119
|
+
readonly locations?: readonly {
|
|
120
|
+
line: number;
|
|
121
|
+
column: number;
|
|
122
|
+
}[];
|
|
123
|
+
readonly path?: readonly (string | number)[];
|
|
124
|
+
readonly extensions?: Record<string, any>;
|
|
125
|
+
}
|
|
126
|
+
interface EventAPI {
|
|
127
|
+
on(event: string, handler: EventHandler): () => void;
|
|
128
|
+
once?(event: string, handler: EventHandler): () => void;
|
|
129
|
+
emit(event: string, data?: any): void;
|
|
130
|
+
off?(event: string, handler?: EventHandler): void;
|
|
131
|
+
}
|
|
132
|
+
type EventHandler = (data?: any) => void;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Plugin Manifest Types
|
|
136
|
+
*
|
|
137
|
+
* Generic manifest structure for plugins
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
declare enum PluginType {
|
|
141
|
+
INTERNAL = "internal",
|
|
142
|
+
MICROFRONTEND = "microfrontend",
|
|
143
|
+
IFRAME = "iframe"
|
|
144
|
+
}
|
|
145
|
+
declare enum ExtensionPoint {
|
|
146
|
+
}
|
|
147
|
+
interface PluginManifest {
|
|
148
|
+
readonly id: string;
|
|
149
|
+
readonly name: string;
|
|
150
|
+
readonly version: string;
|
|
151
|
+
readonly description?: string;
|
|
152
|
+
readonly author?: string;
|
|
153
|
+
readonly homepage?: string;
|
|
154
|
+
readonly icon?: string;
|
|
155
|
+
readonly type: PluginType | 'internal' | 'microfrontend' | 'iframe';
|
|
156
|
+
readonly remote?: {
|
|
157
|
+
readonly url: string;
|
|
158
|
+
readonly scope: string;
|
|
159
|
+
readonly module: string;
|
|
160
|
+
};
|
|
161
|
+
readonly capabilities: readonly string[];
|
|
162
|
+
readonly extensionPoints: readonly string[];
|
|
163
|
+
readonly dependencies?: {
|
|
164
|
+
readonly host?: string;
|
|
165
|
+
readonly plugins?: Record<string, string>;
|
|
166
|
+
};
|
|
167
|
+
readonly config?: Record<string, any>;
|
|
168
|
+
readonly api?: PluginApiConfig;
|
|
169
|
+
readonly apis?: Record<string, PluginApiConfig>;
|
|
170
|
+
}
|
|
171
|
+
interface PluginApiConfig {
|
|
172
|
+
readonly strategy?: 'proxy' | 'direct' | 'bff';
|
|
173
|
+
readonly baseUrl?: string;
|
|
174
|
+
readonly auth?: 'inherit' | 'custom' | 'none';
|
|
175
|
+
readonly allowedEndpoints?: Record<string, EndpointConfig>;
|
|
176
|
+
readonly endpoints?: Record<string, EndpointConfig>;
|
|
177
|
+
readonly corsOrigins?: readonly string[];
|
|
178
|
+
readonly bffUrl?: string;
|
|
179
|
+
readonly graphql?: GraphQLApiConfig;
|
|
180
|
+
}
|
|
181
|
+
interface EndpointConfig {
|
|
182
|
+
readonly path: string;
|
|
183
|
+
readonly method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
184
|
+
readonly methods?: readonly ('GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH')[];
|
|
185
|
+
readonly rateLimit?: number;
|
|
186
|
+
readonly cache?: {
|
|
187
|
+
readonly ttl: number;
|
|
188
|
+
readonly key?: string;
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
interface GraphQLApiConfig {
|
|
192
|
+
readonly url: string;
|
|
193
|
+
readonly auth?: 'inherit' | 'custom' | 'none';
|
|
194
|
+
readonly schema?: string;
|
|
195
|
+
readonly operations?: Record<string, GraphQLOperation>;
|
|
196
|
+
readonly subscriptions?: {
|
|
197
|
+
readonly url?: string;
|
|
198
|
+
readonly protocol?: 'ws' | 'graphql-ws';
|
|
199
|
+
};
|
|
200
|
+
readonly headers?: Record<string, string>;
|
|
201
|
+
readonly rateLimit?: number;
|
|
202
|
+
readonly cache?: {
|
|
203
|
+
readonly ttl: number;
|
|
204
|
+
readonly enabled: boolean;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
interface GraphQLOperation {
|
|
208
|
+
readonly query: string;
|
|
209
|
+
readonly type: 'query' | 'mutation' | 'subscription';
|
|
210
|
+
readonly variables?: Record<string, any>;
|
|
211
|
+
readonly cache?: boolean;
|
|
212
|
+
}
|
|
213
|
+
interface Plugin<TContext = any> {
|
|
214
|
+
readonly manifest: PluginManifest;
|
|
215
|
+
initialize?(context: HostContext<TContext>): Promise<void>;
|
|
216
|
+
activate?(context: HostContext<TContext>): Promise<void>;
|
|
217
|
+
deactivate?(): Promise<void>;
|
|
218
|
+
dispose?(): Promise<void>;
|
|
219
|
+
components?: Partial<Record<string, React.ComponentType<any>>>;
|
|
220
|
+
}
|
|
221
|
+
interface PluginDefinition<TContext = any> {
|
|
222
|
+
readonly manifest: PluginManifest;
|
|
223
|
+
initialize?(context: HostContext<TContext>): Promise<void>;
|
|
224
|
+
activate?(context: HostContext<TContext>): Promise<void>;
|
|
225
|
+
deactivate?(): Promise<void>;
|
|
226
|
+
dispose?(): Promise<void>;
|
|
227
|
+
components?: Partial<Record<string, React.ComponentType<any>>>;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Plugin SDK Helpers
|
|
232
|
+
*
|
|
233
|
+
* Utility functions for defining plugins and manifests
|
|
234
|
+
*/
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Define a plugin with type safety
|
|
238
|
+
*/
|
|
239
|
+
declare function definePlugin<TContext = any>(definition: PluginDefinition<TContext>): () => Plugin<TContext>;
|
|
240
|
+
/**
|
|
241
|
+
* Define a manifest with type safety
|
|
242
|
+
*/
|
|
243
|
+
declare function defineManifest(manifest: PluginManifest): PluginManifest;
|
|
244
|
+
/**
|
|
245
|
+
* Define API endpoints with type safety
|
|
246
|
+
*/
|
|
247
|
+
declare function defineEndpoints<T extends Record<string, EndpointConfig>>(endpoints: T): T;
|
|
248
|
+
/**
|
|
249
|
+
* Define API configuration with type safety
|
|
250
|
+
*/
|
|
251
|
+
declare function defineApiConfig<T extends Record<string, PluginApiConfig>>(apis: T): T;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Plugin API Client Generator
|
|
255
|
+
*
|
|
256
|
+
* Creates a type-safe API client based on plugin manifest
|
|
257
|
+
* Similar to Redux Toolkit Query but for plugin APIs
|
|
258
|
+
*/
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Infer parameter types from path template
|
|
262
|
+
* Example: "/api/contacts/{id}" -> { id: string }
|
|
263
|
+
*/
|
|
264
|
+
type ExtractPathParams<T extends string> = T extends `${infer _Start}/{${infer Param}}/${infer Rest}` ? {
|
|
265
|
+
[K in Param | keyof ExtractPathParams<`/${Rest}`>]: string;
|
|
266
|
+
} : T extends `${infer _Start}/{${infer Param}}` ? {
|
|
267
|
+
[K in Param]: string;
|
|
268
|
+
} : {};
|
|
269
|
+
/**
|
|
270
|
+
* Infer request config from endpoint
|
|
271
|
+
*/
|
|
272
|
+
type EndpointRequestConfig<TEndpoint extends EndpointConfig> = {
|
|
273
|
+
params?: ExtractPathParams<TEndpoint['path']> extends Record<string, never> ? Record<string, any> : ExtractPathParams<TEndpoint['path']>;
|
|
274
|
+
data?: TEndpoint['method'] extends 'POST' | 'PUT' | 'PATCH' ? any : never;
|
|
275
|
+
headers?: Record<string, string>;
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* Create endpoint function type
|
|
279
|
+
*/
|
|
280
|
+
type EndpointFunction<TEndpoint extends EndpointConfig> = <TResponse = any>(config?: EndpointRequestConfig<TEndpoint>) => Promise<TResponse>;
|
|
281
|
+
/**
|
|
282
|
+
* Create API client type from endpoints definition
|
|
283
|
+
*/
|
|
284
|
+
type ApiClientFromEndpoints<TEndpoints extends Record<string, EndpointConfig>> = {
|
|
285
|
+
[K in keyof TEndpoints]: EndpointFunction<TEndpoints[K]>;
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* Create multi-API client type from manifest apis definition
|
|
289
|
+
*/
|
|
290
|
+
type PluginApiClient<TManifest extends PluginManifest> = TManifest['apis'] extends Record<string, PluginApiConfig> ? {
|
|
291
|
+
[ApiName in keyof TManifest['apis']]: TManifest['apis'][ApiName]['endpoints'] extends Record<string, EndpointConfig> ? ApiClientFromEndpoints<TManifest['apis'][ApiName]['endpoints']> : Record<string, never>;
|
|
292
|
+
} : {};
|
|
293
|
+
/**
|
|
294
|
+
* Create a type-safe API client from plugin manifest
|
|
295
|
+
*
|
|
296
|
+
* @example
|
|
297
|
+
* ```ts
|
|
298
|
+
* const api = createPluginApi(manifest, hostContext.capabilities.api);
|
|
299
|
+
*
|
|
300
|
+
* // Type-safe API calls
|
|
301
|
+
* const contact = await api.crm.getContact({ params: { id: '123' } });
|
|
302
|
+
* const lead = await api.crm.createLead({ data: { name: 'John' } });
|
|
303
|
+
* ```
|
|
304
|
+
*/
|
|
305
|
+
declare function createPluginApi<TManifest extends PluginManifest>(manifest: TManifest, apiCapability: ApiAPI): PluginApiClient<TManifest>;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* React Hooks for Plugin API
|
|
309
|
+
*
|
|
310
|
+
* Provides reactive data fetching hooks similar to React Query / RTK Query
|
|
311
|
+
*/
|
|
312
|
+
|
|
313
|
+
interface UseApiQueryOptions {
|
|
314
|
+
/** Auto-fetch on mount (default: true) */
|
|
315
|
+
enabled?: boolean;
|
|
316
|
+
/** Refetch interval in ms */
|
|
317
|
+
refetchInterval?: number;
|
|
318
|
+
/** Cache time in ms */
|
|
319
|
+
cacheTime?: number;
|
|
320
|
+
/** Callback on success */
|
|
321
|
+
onSuccess?: (data: any) => void;
|
|
322
|
+
/** Callback on error */
|
|
323
|
+
onError?: (error: Error) => void;
|
|
324
|
+
}
|
|
325
|
+
interface UseApiQueryResult<TData = any> {
|
|
326
|
+
data: TData | null;
|
|
327
|
+
loading: boolean;
|
|
328
|
+
error: Error | null;
|
|
329
|
+
refetch: () => Promise<void>;
|
|
330
|
+
isSuccess: boolean;
|
|
331
|
+
isError: boolean;
|
|
332
|
+
}
|
|
333
|
+
interface UseApiMutationResult<TData = any, TVariables = any> {
|
|
334
|
+
data: TData | null;
|
|
335
|
+
loading: boolean;
|
|
336
|
+
error: Error | null;
|
|
337
|
+
mutate: (variables: TVariables) => Promise<TData>;
|
|
338
|
+
reset: () => void;
|
|
339
|
+
isSuccess: boolean;
|
|
340
|
+
isError: boolean;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Hook for data fetching with automatic state management
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* ```tsx
|
|
347
|
+
* const { data, loading, error, refetch } = useApiQuery(
|
|
348
|
+
* context,
|
|
349
|
+
* 'crm-integration',
|
|
350
|
+
* 'crm',
|
|
351
|
+
* 'getContact',
|
|
352
|
+
* { params: { id: contactId } }
|
|
353
|
+
* );
|
|
354
|
+
*
|
|
355
|
+
* if (loading) return <div>Loading...</div>;
|
|
356
|
+
* if (error) return <div>Error: {error.message}</div>;
|
|
357
|
+
* return <div>{data.name}</div>;
|
|
358
|
+
* ```
|
|
359
|
+
*/
|
|
360
|
+
declare function useApiQuery<TData = any>(context: HostContext, pluginId: string, apiName: string, endpoint: string, config?: {
|
|
361
|
+
params?: Record<string, any>;
|
|
362
|
+
data?: any;
|
|
363
|
+
headers?: Record<string, string>;
|
|
364
|
+
}, options?: UseApiQueryOptions): UseApiQueryResult<TData>;
|
|
365
|
+
/**
|
|
366
|
+
* Hook for mutations (POST, PUT, DELETE) with automatic state management
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* ```tsx
|
|
370
|
+
* const { mutate, loading, error } = useApiMutation(
|
|
371
|
+
* context,
|
|
372
|
+
* 'crm-integration',
|
|
373
|
+
* 'crm',
|
|
374
|
+
* 'createLead',
|
|
375
|
+
* 'POST'
|
|
376
|
+
* );
|
|
377
|
+
*
|
|
378
|
+
* const handleSubmit = async () => {
|
|
379
|
+
* try {
|
|
380
|
+
* const result = await mutate({
|
|
381
|
+
* data: { name: 'John Doe', email: 'john@example.com' }
|
|
382
|
+
* });
|
|
383
|
+
* console.log('Lead created:', result);
|
|
384
|
+
* } catch (err) {
|
|
385
|
+
* console.error('Failed:', err);
|
|
386
|
+
* }
|
|
387
|
+
* };
|
|
388
|
+
* ```
|
|
389
|
+
*/
|
|
390
|
+
declare function useApiMutation<TData = any, TVariables = any>(context: HostContext, pluginId: string, apiName: string, endpoint: string, method?: 'POST' | 'PUT' | 'DELETE' | 'PATCH', options?: {
|
|
391
|
+
onSuccess?: (data: TData, variables: TVariables) => void;
|
|
392
|
+
onError?: (error: Error, variables: TVariables) => void;
|
|
393
|
+
}): UseApiMutationResult<TData, TVariables>;
|
|
394
|
+
/**
|
|
395
|
+
* Infer hook types from endpoint config
|
|
396
|
+
*/
|
|
397
|
+
type HookFromEndpoint<TEndpoint> = TEndpoint extends {
|
|
398
|
+
readonly method: 'GET';
|
|
399
|
+
} ? (config?: any, options?: UseApiQueryOptions) => UseApiQueryResult : TEndpoint extends {
|
|
400
|
+
readonly method: 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
401
|
+
} ? (options?: any) => UseApiMutationResult : (config?: any, options?: UseApiQueryOptions) => UseApiQueryResult;
|
|
402
|
+
/**
|
|
403
|
+
* Create hook name from endpoint name
|
|
404
|
+
*/
|
|
405
|
+
type HookName<T extends string> = `use${Capitalize<T>}`;
|
|
406
|
+
/**
|
|
407
|
+
* Create hooks object from endpoints
|
|
408
|
+
*/
|
|
409
|
+
type HooksFromEndpoints<TEndpoints> = {
|
|
410
|
+
[K in keyof TEndpoints as HookName<K & string>]: HookFromEndpoint<TEndpoints[K]>;
|
|
411
|
+
};
|
|
412
|
+
/**
|
|
413
|
+
* Create hooks type from manifest
|
|
414
|
+
*/
|
|
415
|
+
type PluginApiHooks<TManifest extends PluginManifest> = TManifest['apis'] extends Record<string, any> ? {
|
|
416
|
+
[ApiName in keyof TManifest['apis']]: TManifest['apis'][ApiName] extends {
|
|
417
|
+
readonly endpoints: infer TEndpoints;
|
|
418
|
+
} ? HooksFromEndpoints<TEndpoints> : Record<string, never>;
|
|
419
|
+
} : Record<string, never>;
|
|
420
|
+
/**
|
|
421
|
+
* Create typed hooks from manifest
|
|
422
|
+
*
|
|
423
|
+
* @example
|
|
424
|
+
* ```tsx
|
|
425
|
+
* // In plugin setup:
|
|
426
|
+
* const api = createPluginApi(manifest, capabilities.api);
|
|
427
|
+
* const hooks = createPluginApiHooks(context, manifest.id, manifest);
|
|
428
|
+
*
|
|
429
|
+
* // In components:
|
|
430
|
+
* const { data, loading } = hooks.crm.useGetContact({ params: { id: '123' } });
|
|
431
|
+
* const { mutate } = hooks.crm.useCreateLead();
|
|
432
|
+
* ```
|
|
433
|
+
*/
|
|
434
|
+
declare function createPluginApiHooks<TManifest extends PluginManifest>(context: HostContext, pluginId: string, manifest: TManifest): PluginApiHooks<TManifest>;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* GraphQL Client Generator
|
|
438
|
+
*
|
|
439
|
+
* Creates a type-safe GraphQL client based on plugin manifest
|
|
440
|
+
* Provides simple query/mutation/subscription methods
|
|
441
|
+
*/
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Extract operation types from GraphQL API config
|
|
445
|
+
*/
|
|
446
|
+
type GraphQLOperations<TConfig extends GraphQLApiConfig> = TConfig['operations'] extends Record<string, any> ? TConfig['operations'] : Record<string, never>;
|
|
447
|
+
/**
|
|
448
|
+
* Create GraphQL client type from operations
|
|
449
|
+
*/
|
|
450
|
+
type GraphQLClientFromOperations<TOperations extends Record<string, any>> = {
|
|
451
|
+
query<TData = any>(operation: keyof TOperations, variables?: Record<string, any>): Promise<TData>;
|
|
452
|
+
mutate<TData = any>(operation: keyof TOperations, variables?: Record<string, any>): Promise<TData>;
|
|
453
|
+
subscribe?<TData = any>(operation: keyof TOperations, variables?: Record<string, any>, callback?: (data: TData) => void): () => void;
|
|
454
|
+
};
|
|
455
|
+
/**
|
|
456
|
+
* Create multi-API GraphQL client type from manifest
|
|
457
|
+
*/
|
|
458
|
+
type PluginGraphQLClient<TManifest extends PluginManifest> = TManifest['apis'] extends Record<string, any> ? {
|
|
459
|
+
[ApiName in keyof TManifest['apis']]: TManifest['apis'][ApiName]['graphql'] extends GraphQLApiConfig ? GraphQLClientFromOperations<GraphQLOperations<TManifest['apis'][ApiName]['graphql']>> : never;
|
|
460
|
+
} : {};
|
|
461
|
+
/**
|
|
462
|
+
* Create a type-safe GraphQL client from plugin manifest
|
|
463
|
+
*
|
|
464
|
+
* @example
|
|
465
|
+
* ```ts
|
|
466
|
+
* const graphql = createGraphQLClient(manifest, hostContext.capabilities.api);
|
|
467
|
+
*
|
|
468
|
+
* // Type-safe GraphQL calls
|
|
469
|
+
* const user = await graphql.githubApi.query('getUser', { login: 'octocat' });
|
|
470
|
+
* const created = await graphql.githubApi.mutate('createIssue', { title: 'Bug' });
|
|
471
|
+
* ```
|
|
472
|
+
*/
|
|
473
|
+
declare function createGraphQLClient<TManifest extends PluginManifest>(manifest: TManifest, apiCapability: ApiAPI): PluginGraphQLClient<TManifest>;
|
|
474
|
+
/**
|
|
475
|
+
* Helper to create a raw GraphQL request (without predefined operations)
|
|
476
|
+
* Useful for dynamic queries or when operations are not defined in manifest
|
|
477
|
+
*/
|
|
478
|
+
declare function createRawGraphQLClient(pluginId: string, apiName: string, apiCapability: ApiAPI): {
|
|
479
|
+
query<TData = any>(query: string, variables?: Record<string, any>, operationName?: string): Promise<TData>;
|
|
480
|
+
mutate<TData = any>(mutation: string, variables?: Record<string, any>, operationName?: string): Promise<TData>;
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* GraphQL React Hooks
|
|
485
|
+
*
|
|
486
|
+
* Provides React hooks for GraphQL queries, mutations, and subscriptions
|
|
487
|
+
* Similar to Apollo Client or React Query but integrated with our plugin system
|
|
488
|
+
*/
|
|
489
|
+
|
|
490
|
+
interface UseQueryOptions<TData = any> {
|
|
491
|
+
enabled?: boolean;
|
|
492
|
+
refetchOnMount?: boolean;
|
|
493
|
+
refetchInterval?: number;
|
|
494
|
+
onSuccess?: (data: TData) => void;
|
|
495
|
+
onError?: (error: Error) => void;
|
|
496
|
+
cacheTime?: number;
|
|
497
|
+
}
|
|
498
|
+
interface UseQueryResult<TData = any> {
|
|
499
|
+
data: TData | undefined;
|
|
500
|
+
loading: boolean;
|
|
501
|
+
error: Error | undefined;
|
|
502
|
+
refetch: () => Promise<void>;
|
|
503
|
+
}
|
|
504
|
+
interface UseMutationOptions<TData = any, TVariables = any> {
|
|
505
|
+
onSuccess?: (data: TData, variables: TVariables) => void;
|
|
506
|
+
onError?: (error: Error, variables: TVariables) => void;
|
|
507
|
+
}
|
|
508
|
+
interface UseMutationResult<TData = any, TVariables = any> {
|
|
509
|
+
mutate: (variables: TVariables) => Promise<TData>;
|
|
510
|
+
data: TData | undefined;
|
|
511
|
+
loading: boolean;
|
|
512
|
+
error: Error | undefined;
|
|
513
|
+
reset: () => void;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Hook for GraphQL queries with automatic caching and refetching
|
|
517
|
+
*
|
|
518
|
+
* @example
|
|
519
|
+
* ```tsx
|
|
520
|
+
* const { data, loading, error, refetch } = useGraphQLQuery(
|
|
521
|
+
* context.capabilities.api,
|
|
522
|
+
* {
|
|
523
|
+
* pluginId: 'my-plugin',
|
|
524
|
+
* apiName: 'githubApi',
|
|
525
|
+
* query: GET_USER_QUERY,
|
|
526
|
+
* variables: { login: 'octocat' }
|
|
527
|
+
* },
|
|
528
|
+
* {
|
|
529
|
+
* enabled: true,
|
|
530
|
+
* onSuccess: (data) => console.log('User loaded:', data)
|
|
531
|
+
* }
|
|
532
|
+
* );
|
|
533
|
+
* ```
|
|
534
|
+
*/
|
|
535
|
+
declare function useGraphQLQuery<TData = any>(apiCapability: ApiAPI, config: GraphQLRequestConfig, options?: UseQueryOptions<TData>): UseQueryResult<TData>;
|
|
536
|
+
/**
|
|
537
|
+
* Hook for GraphQL mutations
|
|
538
|
+
*
|
|
539
|
+
* @example
|
|
540
|
+
* ```tsx
|
|
541
|
+
* const { mutate, loading, error } = useGraphQLMutation(
|
|
542
|
+
* context.capabilities.api,
|
|
543
|
+
* {
|
|
544
|
+
* pluginId: 'my-plugin',
|
|
545
|
+
* apiName: 'githubApi',
|
|
546
|
+
* query: CREATE_ISSUE_MUTATION
|
|
547
|
+
* },
|
|
548
|
+
* {
|
|
549
|
+
* onSuccess: (data) => console.log('Issue created:', data)
|
|
550
|
+
* }
|
|
551
|
+
* );
|
|
552
|
+
*
|
|
553
|
+
* // Later
|
|
554
|
+
* await mutate({ title: 'Bug', body: 'Description' });
|
|
555
|
+
* ```
|
|
556
|
+
*/
|
|
557
|
+
declare function useGraphQLMutation<TData = any, TVariables = any>(apiCapability: ApiAPI, config: Omit<GraphQLRequestConfig, 'variables'>, options?: UseMutationOptions<TData, TVariables>): UseMutationResult<TData, TVariables>;
|
|
558
|
+
/**
|
|
559
|
+
* Hook for GraphQL subscriptions (placeholder for future implementation)
|
|
560
|
+
*
|
|
561
|
+
* @example
|
|
562
|
+
* ```tsx
|
|
563
|
+
* const { data, loading, error } = useGraphQLSubscription(
|
|
564
|
+
* context.capabilities.api,
|
|
565
|
+
* {
|
|
566
|
+
* pluginId: 'my-plugin',
|
|
567
|
+
* apiName: 'githubApi',
|
|
568
|
+
* query: ISSUE_UPDATES_SUBSCRIPTION,
|
|
569
|
+
* variables: { repoId: '123' }
|
|
570
|
+
* }
|
|
571
|
+
* );
|
|
572
|
+
* ```
|
|
573
|
+
*/
|
|
574
|
+
declare function useGraphQLSubscription<TData = any>(apiCapability: ApiAPI, config: GraphQLRequestConfig, options?: UseQueryOptions<TData>): UseQueryResult<TData>;
|
|
575
|
+
|
|
576
|
+
declare class PluginHostAdapter implements HttpAdapter {
|
|
577
|
+
private context;
|
|
578
|
+
private pluginId;
|
|
579
|
+
constructor(context: HostContext, pluginId: string);
|
|
580
|
+
request<T>(config: HttpRequest): Promise<HttpResponse<T>>;
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Create a fetch adapter instance
|
|
584
|
+
*/
|
|
585
|
+
declare function createPluginHostAdapter(context: HostContext, pluginId: string): PluginHostAdapter;
|
|
586
|
+
|
|
587
|
+
export { type AlertOptions, type ApiAPI, type ApiRequestConfig, type ConfirmOptions, type EndpointConfig, type EventAPI, type EventHandler, ExtensionPoint, type GraphQLApiConfig, type GraphQLError, type GraphQLOperation, type GraphQLRequestConfig, type GraphQLResponse, type HostCapabilities, type HostContext, type ModalAPI, type ModalAction, type ModalConfig, type NavigateOptions, type NavigationAPI, type NotificationAPI, type NotificationOptions, type Plugin, type PluginApiClient, type PluginApiConfig, type PluginApiHooks, type PluginDefinition, type PluginGraphQLClient, PluginHostAdapter, type PluginManifest, PluginType, type StorageAPI, type UseApiMutationResult, type UseApiQueryOptions, type UseApiQueryResult, type UseMutationOptions, type UseMutationResult, type UseQueryOptions, type UseQueryResult, createGraphQLClient, createPluginApi, createPluginApiHooks, createPluginHostAdapter, createRawGraphQLClient, defineApiConfig, defineEndpoints, defineManifest, definePlugin, useApiMutation, useApiQuery, useGraphQLMutation, useGraphQLQuery, useGraphQLSubscription };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a1_0x50ab2e=a1_0xc7b5;(function(_0xe04305,_0x9ed226){const _0x537876=a1_0xc7b5,_0x542402=_0xe04305();while(!![]){try{const _0x584ab3=parseInt(_0x537876(0x1e5))/0x1+parseInt(_0x537876(0x231))/0x2*(parseInt(_0x537876(0x1dd))/0x3)+parseInt(_0x537876(0x1fe))/0x4+-parseInt(_0x537876(0x23b))/0x5+-parseInt(_0x537876(0x1f8))/0x6+-parseInt(_0x537876(0x226))/0x7*(-parseInt(_0x537876(0x1c5))/0x8)+parseInt(_0x537876(0x1f9))/0x9*(-parseInt(_0x537876(0x1e7))/0xa);if(_0x584ab3===_0x9ed226)break;else _0x542402['push'](_0x542402['shift']());}catch(_0x54cfe5){_0x542402['push'](_0x542402['shift']());}}}(a1_0x4b2c,0xaa9ae));const a1_0x586c50=(function(){let _0x1de53f=!![];return function(_0x119391,_0x2f329d){const _0x2c9af1=_0x1de53f?function(){const _0x173753=a1_0xc7b5;if(_0x2f329d){const _0x274d57=_0x2f329d[_0x173753(0x260)](_0x119391,arguments);return _0x2f329d=null,_0x274d57;}}:function(){};return _0x1de53f=![],_0x2c9af1;};}()),a1_0x4f4dc9=a1_0x586c50(this,function(){const _0x1bbeb6=a1_0xc7b5,_0xb9e488={'wfypT':'(((.+)+)+)+$'};return a1_0x4f4dc9[_0x1bbeb6(0x1ef)]()[_0x1bbeb6(0x1ce)]('(((.+)+)+)+$')[_0x1bbeb6(0x1ef)]()[_0x1bbeb6(0x1dc)](a1_0x4f4dc9)['search'](_0xb9e488[_0x1bbeb6(0x1d4)]);});a1_0x4f4dc9();const a1_0x396606=(function(){let _0x20a573=!![];return function(_0x739c6e,_0x12496a){const _0x528305=_0x20a573?function(){const _0x29cd19=a1_0xc7b5;if(_0x12496a){const _0x3a573e=_0x12496a[_0x29cd19(0x260)](_0x739c6e,arguments);return _0x12496a=null,_0x3a573e;}}:function(){};return _0x20a573=![],_0x528305;};}());function a1_0xc7b5(_0x50950a,_0xbde1cd){_0x50950a=_0x50950a-0x1c5;const _0x27005c=a1_0x4b2c();let _0x1ea3e5=_0x27005c[_0x50950a];return _0x1ea3e5;}(function(){const _0x222742=a1_0xc7b5,_0x2a6814={'XjftZ':function(_0x4ee555,_0x525b66){return _0x4ee555(_0x525b66);},'BDnTV':'init','Emske':function(_0x23c016,_0x4edb62){return _0x23c016+_0x4edb62;},'EpSWt':function(_0x17d059,_0x155fe6){return _0x17d059+_0x155fe6;},'fbPQV':_0x222742(0x21b),'frWfG':function(_0x128596,_0x28f94b,_0x1df342){return _0x128596(_0x28f94b,_0x1df342);}};_0x2a6814[_0x222742(0x1da)](a1_0x396606,this,function(){const _0x81b82f=_0x222742,_0x4b149b=new RegExp('function\x20*\x5c(\x20*\x5c)'),_0x1a5fc5=new RegExp(_0x81b82f(0x224),'i'),_0x537361=_0x2a6814[_0x81b82f(0x1e9)](a1_0x486b6a,_0x2a6814[_0x81b82f(0x22d)]);!_0x4b149b[_0x81b82f(0x21e)](_0x2a6814[_0x81b82f(0x21d)](_0x537361,_0x81b82f(0x1d0)))||!_0x1a5fc5['test'](_0x2a6814[_0x81b82f(0x227)](_0x537361,_0x2a6814[_0x81b82f(0x1d9)]))?_0x2a6814[_0x81b82f(0x1e9)](_0x537361,'0'):a1_0x486b6a();})();}());const a1_0x3f25a5=(function(){let _0x3923cb=!![];return function(_0x4adaaa,_0x1ed089){const _0x322fb6=_0x3923cb?function(){const _0x5da83c=a1_0xc7b5;if(_0x1ed089){const _0xcfd779=_0x1ed089[_0x5da83c(0x260)](_0x4adaaa,arguments);return _0x1ed089=null,_0xcfd779;}}:function(){};return _0x3923cb=![],_0x322fb6;};}()),a1_0x1ea3e5=a1_0x3f25a5(this,function(){const _0x233efe=a1_0xc7b5,_0xea9a11={'AGGtr':function(_0x1a9a80,_0x363f4f){return _0x1a9a80(_0x363f4f);},'ClnIc':function(_0x16b670,_0x1fbb68){return _0x16b670+_0x1fbb68;},'lezbc':function(_0x532dd3,_0x3ba5d6){return _0x532dd3+_0x3ba5d6;},'ylciQ':'{}.constructor(\x22return\x20this\x22)(\x20)','tUkOI':function(_0x50d035){return _0x50d035();},'qcYyF':_0x233efe(0x24e),'IjMBs':_0x233efe(0x1fd),'QPmOX':_0x233efe(0x1f2)};let _0x16693f;try{const _0xf5ce4e=_0xea9a11[_0x233efe(0x217)](Function,_0xea9a11['ClnIc'](_0xea9a11[_0x233efe(0x202)]('return\x20(function()\x20',_0xea9a11['ylciQ']),');'));_0x16693f=_0xea9a11[_0x233efe(0x230)](_0xf5ce4e);}catch(_0xd34be7){_0x16693f=window;}const _0x54f001=_0x16693f[_0x233efe(0x25c)]=_0x16693f[_0x233efe(0x25c)]||{},_0x4356f0=[_0x233efe(0x1ea),_0xea9a11[_0x233efe(0x233)],_0xea9a11['IjMBs'],_0x233efe(0x25e),_0xea9a11[_0x233efe(0x1d8)],'table','trace'];for(let _0x234ee1=0x0;_0x234ee1<_0x4356f0[_0x233efe(0x21a)];_0x234ee1++){const _0x458d06=a1_0x3f25a5[_0x233efe(0x1dc)][_0x233efe(0x252)]['bind'](a1_0x3f25a5),_0xb7fb40=_0x4356f0[_0x234ee1],_0x3d382a=_0x54f001[_0xb7fb40]||_0x458d06;_0x458d06['__proto__']=a1_0x3f25a5['bind'](a1_0x3f25a5),_0x458d06[_0x233efe(0x1ef)]=_0x3d382a[_0x233efe(0x1ef)][_0x233efe(0x213)](_0x3d382a),_0x54f001[_0xb7fb40]=_0x458d06;}});a1_0x1ea3e5();import{useState,useRef,useCallback,useEffect}from'react';var w=(_0x58733d=>(_0x58733d[a1_0x50ab2e(0x255)]=a1_0x50ab2e(0x1db),_0x58733d['MICROFRONTEND']=a1_0x50ab2e(0x1fb),_0x58733d[a1_0x50ab2e(0x25b)]=a1_0x50ab2e(0x1c6),_0x58733d))(w||{}),O=(_0x200bdd=>_0x200bdd)(O||{});function H(_0x670dcd){const _0x4f4484=a1_0x50ab2e;return()=>({'manifest':_0x670dcd[_0x4f4484(0x1d3)],'initialize':_0x670dcd[_0x4f4484(0x221)],'activate':_0x670dcd[_0x4f4484(0x23e)],'deactivate':_0x670dcd[_0x4f4484(0x21f)],'dispose':_0x670dcd[_0x4f4484(0x243)],'components':_0x670dcd[_0x4f4484(0x24b)]});}function S(_0x392ce2){return _0x392ce2;}function U(_0x32ad8b){return _0x32ad8b;}function k(_0x1e4003){return _0x1e4003;}function V(_0x92a6e7,_0x17d00e){const _0x6087bb=a1_0x50ab2e,_0x594749={'KjhGZ':_0x6087bb(0x1ec),'kmpnc':function(_0x1122c5,_0x5201c0){return _0x1122c5>_0x5201c0;}};let _0x8b2bce=_0x92a6e7['id'],_0xc36b08=_0x92a6e7[_0x6087bb(0x203)]||{},_0x11e845={};for(let [_0xa6bbd,_0x2e5f37]of Object[_0x6087bb(0x1e2)](_0xc36b08)){let _0x259083=_0x2e5f37[_0x6087bb(0x244)]||_0x2e5f37['allowedEndpoints']||{};_0x11e845[_0xa6bbd]={};for(let [_0x259646,_0x1d4fe8]of Object[_0x6087bb(0x1e2)](_0x259083))_0x11e845[_0xa6bbd][_0x259646]=async(_0x13f4d3={})=>{const _0x1154ea=_0x6087bb;let {params:_0x3751d6={},data:_0x16dc2c,headers:_0x2d19a4}=_0x13f4d3,_0x6949c8=_0x1d4fe8[_0x1154ea(0x200)],_0x2c7a5b={},_0x5e467a=/{([^}]+)}/g,_0x284ec5;for(;(_0x284ec5=_0x5e467a[_0x1154ea(0x1c7)](_0x1d4fe8[_0x1154ea(0x200)]))!==null;){let _0x2aa5e7=_0x284ec5[0x1];_0x3751d6[_0x2aa5e7]&&(_0x2c7a5b[_0x2aa5e7]=_0x3751d6[_0x2aa5e7],_0x6949c8=_0x6949c8[_0x1154ea(0x1d2)]('{'+_0x2aa5e7+'}',_0x3751d6[_0x2aa5e7]));}let _0x54b0d4={..._0x3751d6};for(let _0x3be7b2 of Object[_0x1154ea(0x1ee)](_0x2c7a5b))delete _0x54b0d4[_0x3be7b2];let _0x454fc2=_0x1d4fe8['method']||_0x1d4fe8[_0x1154ea(0x219)]&&_0x1d4fe8['methods'][0x0]||_0x594749[_0x1154ea(0x1e4)];return _0x17d00e[_0x1154ea(0x24d)]({'pluginId':_0x8b2bce,'apiName':_0xa6bbd,'endpoint':_0x259646,'method':_0x454fc2,'params':_0x594749[_0x1154ea(0x256)](Object['keys'](_0x54b0d4)[_0x1154ea(0x21a)],0x0)?_0x54b0d4:void 0x0,'data':_0x16dc2c,'headers':_0x2d19a4});};}return _0x11e845;}function q(_0x401080,_0x49e52d,_0x519dcc,_0x34e9aa,_0x102a8a,_0x29aaaf){const _0x5563be=a1_0x50ab2e,_0x4a0afd={'qXFRq':function(_0x631c2a,_0x5294d4){return _0x631c2a(_0x5294d4);},'yxyZN':function(_0x2cb25e,_0x3914bb){return _0x2cb25e(_0x3914bb);},'TwLzb':'GET','XVxwi':function(_0x214fa6,_0x44de97){return _0x214fa6(_0x44de97);},'CRddJ':function(_0x1329b4,_0xfed6e5){return _0x1329b4 instanceof _0xfed6e5;},'lvvrm':function(_0x18ae3c){return _0x18ae3c();},'QhaQE':function(_0x4445ad,_0x2cf3ff){return _0x4445ad(_0x2cf3ff);},'ZMhIt':function(_0x2df01a,_0x29ac03){return _0x2df01a&&_0x29ac03;},'wByfv':function(_0x2004eb,_0x4cd0de,_0x1dd59d){return _0x2004eb(_0x4cd0de,_0x1dd59d);},'yfYAW':function(_0x319178,_0x260b86){return _0x319178(_0x260b86);},'SbHvT':function(_0x3293a8,_0x55d969){return _0x3293a8!==_0x55d969;},'CtDaE':function(_0x35603a,_0x3d3811){return _0x35603a&&_0x3d3811;}};let [_0x468cb0,_0x23a49d]=_0x4a0afd['yfYAW'](useState,null),[_0x4847dc,_0x4334b4]=_0x4a0afd['qXFRq'](useState,![]),[_0x2a09b0,_0x122c71]=_0x4a0afd[_0x5563be(0x1de)](useState,null),_0x350ce6=_0x4a0afd[_0x5563be(0x214)](_0x29aaaf?.[_0x5563be(0x1ed)],![]),_0x3917ef=_0x29aaaf?.['refetchInterval'],_0x2ec727=_0x4a0afd[_0x5563be(0x249)](useRef,null),_0x2730a5=useCallback(async()=>{const _0x1bdc03=_0x5563be;if(_0x350ce6){_0x4a0afd[_0x1bdc03(0x216)](_0x4334b4,!![]),_0x4a0afd[_0x1bdc03(0x249)](_0x122c71,null);try{let _0x2a0090=await _0x401080['capabilities'][_0x1bdc03(0x232)][_0x1bdc03(0x24d)]({'pluginId':_0x49e52d,'apiName':_0x519dcc,'endpoint':_0x34e9aa,'method':_0x4a0afd[_0x1bdc03(0x1f5)],..._0x102a8a});_0x4a0afd['yxyZN'](_0x23a49d,_0x2a0090),_0x4a0afd[_0x1bdc03(0x1de)](_0x4334b4,!0x1),_0x29aaaf?.[_0x1bdc03(0x210)]&&_0x29aaaf[_0x1bdc03(0x210)](_0x2a0090);}catch(_0x2551a0){let _0x264d1f=_0x4a0afd[_0x1bdc03(0x23a)](_0x2551a0,Error)?_0x2551a0:new Error(_0x4a0afd[_0x1bdc03(0x1de)](String,_0x2551a0));_0x4a0afd[_0x1bdc03(0x1de)](_0x122c71,_0x264d1f),_0x4334b4(![]),_0x29aaaf?.[_0x1bdc03(0x23d)]&&_0x29aaaf['onError'](_0x264d1f);}}},[_0x49e52d,_0x519dcc,_0x34e9aa,_0x350ce6,JSON[_0x5563be(0x24a)](_0x102a8a)]);return _0x4a0afd[_0x5563be(0x245)](useEffect,()=>{const _0x28cf73=_0x5563be;_0x350ce6&&_0x4a0afd[_0x28cf73(0x208)](_0x2730a5);},[_0x2730a5,_0x350ce6]),_0x4a0afd[_0x5563be(0x245)](useEffect,()=>{const _0x45c018=_0x5563be;if(_0x4a0afd['ZMhIt'](_0x3917ef,_0x350ce6))return _0x2ec727[_0x45c018(0x220)]=_0x4a0afd['wByfv'](setInterval,_0x2730a5,_0x3917ef),()=>{const _0x12f7f7=_0x45c018;_0x2ec727[_0x12f7f7(0x220)]&&_0x4a0afd[_0x12f7f7(0x1e1)](clearInterval,_0x2ec727[_0x12f7f7(0x220)]);};},[_0x3917ef,_0x2730a5,_0x350ce6]),{'data':_0x468cb0,'loading':_0x4847dc,'error':_0x2a09b0,'refetch':_0x2730a5,'isSuccess':_0x4a0afd[_0x5563be(0x223)](!_0x4847dc,!_0x2a09b0)&&_0x468cb0!==null,'isError':!_0x4847dc&&_0x4a0afd[_0x5563be(0x214)](_0x2a09b0,null)};}function L(_0x223253,_0x195bb3,_0x2f38d1,_0x408c72,_0x9896be=a1_0x50ab2e(0x201),_0x446de1){const _0x48f741=a1_0x50ab2e,_0x1d3cc0={'DPwIC':function(_0x15133c,_0x1e3a8f){return _0x15133c(_0x1e3a8f);},'AkDec':function(_0x16fcf4,_0x146261){return _0x16fcf4(_0x146261);},'fBkjn':function(_0x43e1dd,_0x3a0d73){return _0x43e1dd(_0x3a0d73);},'rSGly':function(_0x5666eb,_0x4ba4a1){return _0x5666eb(_0x4ba4a1);},'OZDfK':function(_0x4a3c86,_0x43719c,_0x472c03){return _0x4a3c86(_0x43719c,_0x472c03);},'UgIkn':function(_0x27702e,_0x10c635,_0x5af223){return _0x27702e(_0x10c635,_0x5af223);},'Irurn':function(_0x4a9d70,_0x2e6277){return _0x4a9d70!==_0x2e6277;}};let [_0x16fa35,_0x5a0f90]=_0x1d3cc0[_0x48f741(0x1e8)](useState,null),[_0x53ae15,_0x12d07b]=useState(![]),[_0x4f69a6,_0x33b163]=_0x1d3cc0[_0x48f741(0x20c)](useState,null),_0x4b3b81=_0x1d3cc0[_0x48f741(0x1cd)](useCallback,async _0x3e8781=>{const _0xef9e1f=_0x48f741;_0x12d07b(!![]),_0x1d3cc0['DPwIC'](_0x33b163,null);try{let _0x521122=await _0x223253[_0xef9e1f(0x229)]['api'][_0xef9e1f(0x24d)]({'pluginId':_0x195bb3,'apiName':_0x2f38d1,'endpoint':_0x408c72,'method':_0x9896be,..._0x3e8781});return _0x5a0f90(_0x521122),_0x1d3cc0[_0xef9e1f(0x1d5)](_0x12d07b,!0x1),_0x446de1?.[_0xef9e1f(0x210)]&&_0x446de1[_0xef9e1f(0x210)](_0x521122,_0x3e8781),_0x521122;}catch(_0x41610d){let _0x27b7aa=_0x41610d instanceof Error?_0x41610d:new Error(String(_0x41610d));throw _0x1d3cc0[_0xef9e1f(0x20b)](_0x33b163,_0x27b7aa),_0x1d3cc0['fBkjn'](_0x12d07b,![]),_0x446de1?.['onError']&&_0x446de1[_0xef9e1f(0x23d)](_0x27b7aa,_0x3e8781),_0x27b7aa;}},[_0x195bb3,_0x2f38d1,_0x408c72,_0x9896be,_0x446de1]),_0x118ec1=_0x1d3cc0[_0x48f741(0x238)](useCallback,()=>{const _0x46d48b=_0x48f741;_0x5a0f90(null),_0x1d3cc0[_0x46d48b(0x20c)](_0x33b163,null),_0x12d07b(![]);},[]);return{'data':_0x16fa35,'loading':_0x53ae15,'error':_0x4f69a6,'mutate':_0x4b3b81,'reset':_0x118ec1,'isSuccess':!_0x53ae15&&!_0x4f69a6&&_0x16fa35!==null,'isError':!_0x53ae15&&_0x1d3cc0[_0x48f741(0x20f)](_0x4f69a6,null)};}function F(_0x3c8f79,_0x24a440,_0x1df90e){const _0x747b54=a1_0x50ab2e,_0x456941={'DNFJd':function(_0x46072a,_0x4fab64){return _0x46072a===_0x4fab64;}};let _0x2e9b02=_0x1df90e['apis']||{},_0x2a0edd={};for(let [_0x42dc19,_0x185093]of Object[_0x747b54(0x1e2)](_0x2e9b02)){_0x2a0edd[_0x42dc19]={};let _0x224150=_0x185093[_0x747b54(0x244)]||_0x185093['allowedEndpoints']||{};for(let [_0x2ccf5b,_0x39a78b]of Object[_0x747b54(0x1e2)](_0x224150)){let _0x2b9bb7=_0x39a78b[_0x747b54(0x1d6)]||_0x39a78b[_0x747b54(0x219)]&&_0x39a78b[_0x747b54(0x219)][0x0]||_0x747b54(0x1ec),_0x4d1ae5=_0x747b54(0x242)+_0x2ccf5b['charAt'](0x0)['toUpperCase']()+_0x2ccf5b[_0x747b54(0x1cf)](0x1);_0x456941[_0x747b54(0x22b)](_0x2b9bb7,'GET')?_0x2a0edd[_0x42dc19][_0x4d1ae5]=(_0x3975b4,_0x56cf0c)=>q(_0x3c8f79,_0x24a440,_0x42dc19,_0x2ccf5b,_0x3975b4,_0x56cf0c):_0x2a0edd[_0x42dc19][_0x4d1ae5]=_0x5af7e5=>L(_0x3c8f79,_0x24a440,_0x42dc19,_0x2ccf5b,_0x2b9bb7,_0x5af7e5);}}return _0x2a0edd;}function K(_0x538d57,_0x44ea72){const _0x4467c5=a1_0x50ab2e,_0x3487b0={'lFRmN':function(_0x5d8a0f,_0x483cff){return _0x5d8a0f!==_0x483cff;},'lTRET':function(_0x4ea5b2,_0x366093){return _0x4ea5b2>_0x366093;},'zSLNl':function(_0x13ae4d,_0x288903){return _0x13ae4d!==_0x288903;},'cJsqe':_0x4467c5(0x247)};let _0x68d04c=_0x538d57['id'],_0x4bed32=_0x538d57['apis']||{},_0x1f8fa7={};for(let [_0x46d5ca,_0x25f1c9]of Object[_0x4467c5(0x1e2)](_0x4bed32)){if(!_0x25f1c9[_0x4467c5(0x240)])continue;let _0x326ee3=_0x25f1c9[_0x4467c5(0x240)],_0x4ef421=_0x326ee3[_0x4467c5(0x1f0)]||{};_0x1f8fa7[_0x46d5ca]={'query':async(_0x119480,_0x2454ae)=>{const _0x1de7c3=_0x4467c5;let _0x1ecafc=_0x4ef421[_0x119480];if(!_0x1ecafc)throw new Error('GraphQL\x20operation\x20\x27'+_0x119480+'\x27\x20not\x20found\x20in\x20manifest');if(_0x3487b0[_0x1de7c3(0x22c)](_0x1ecafc[_0x1de7c3(0x24f)],_0x1de7c3(0x1f3)))throw new Error(_0x1de7c3(0x253)+_0x119480+_0x1de7c3(0x1f6));let _0x362438=await _0x44ea72[_0x1de7c3(0x240)]({'pluginId':_0x68d04c,'apiName':_0x46d5ca,'query':_0x1ecafc[_0x1de7c3(0x1f3)],'variables':_0x2454ae||_0x1ecafc['variables']||{},'operationName':_0x119480,'headers':_0x326ee3['headers']});if(_0x362438['errors']&&_0x3487b0['lTRET'](_0x362438[_0x1de7c3(0x257)][_0x1de7c3(0x21a)],0x0))throw new Error(_0x362438[_0x1de7c3(0x257)][0x0][_0x1de7c3(0x211)]);return _0x362438[_0x1de7c3(0x1d7)];},'mutate':async(_0x74e733,_0x4a291a)=>{const _0x5b24eb=_0x4467c5;let _0x2cc285=_0x4ef421[_0x74e733];if(!_0x2cc285)throw new Error('GraphQL\x20operation\x20\x27'+_0x74e733+_0x5b24eb(0x1f1));if(_0x3487b0[_0x5b24eb(0x1e0)](_0x2cc285[_0x5b24eb(0x24f)],_0x3487b0[_0x5b24eb(0x1f7)]))throw new Error(_0x5b24eb(0x253)+_0x74e733+_0x5b24eb(0x1cc));let _0x1c2957=await _0x44ea72[_0x5b24eb(0x240)]({'pluginId':_0x68d04c,'apiName':_0x46d5ca,'query':_0x2cc285[_0x5b24eb(0x1f3)],'variables':_0x4a291a||_0x2cc285[_0x5b24eb(0x23f)]||{},'operationName':_0x74e733,'headers':_0x326ee3[_0x5b24eb(0x241)]});if(_0x1c2957[_0x5b24eb(0x257)]&&_0x3487b0['lTRET'](_0x1c2957[_0x5b24eb(0x257)][_0x5b24eb(0x21a)],0x0))throw new Error(_0x1c2957[_0x5b24eb(0x257)][0x0][_0x5b24eb(0x211)]);return _0x1c2957[_0x5b24eb(0x1d7)];},'subscribe':(_0x5025fd,_0x111ad5,_0x3e7726)=>(console[_0x4467c5(0x24e)](_0x4467c5(0x25d)),()=>{})};}return _0x1f8fa7;}function z(_0x2c9afe,_0x9e5314,_0x418523){const _0x1c5290={'ASkWt':function(_0x1df351,_0x5598b4){return _0x1df351||_0x5598b4;},'qAqge':function(_0x201be7,_0x37de9e){return _0x201be7>_0x37de9e;},'Drpjl':function(_0x3e73de,_0x5c5c37){return _0x3e73de>_0x5c5c37;}};return{async 'query'(_0x347215,_0x541e76,_0xb5fa59){const _0x11c590=a1_0xc7b5;let _0x4f0421=await _0x418523[_0x11c590(0x240)]({'pluginId':_0x2c9afe,'apiName':_0x9e5314,'query':_0x347215,'variables':_0x1c5290['ASkWt'](_0x541e76,{}),'operationName':_0xb5fa59});if(_0x4f0421[_0x11c590(0x257)]&&_0x1c5290[_0x11c590(0x259)](_0x4f0421[_0x11c590(0x257)][_0x11c590(0x21a)],0x0))throw new Error(_0x4f0421[_0x11c590(0x257)][0x0][_0x11c590(0x211)]);return _0x4f0421[_0x11c590(0x1d7)];},async 'mutate'(_0x15528b,_0x4a1bd6,_0x3b1f27){const _0x5b68ba=a1_0xc7b5;let _0x3fd62a=await _0x418523[_0x5b68ba(0x240)]({'pluginId':_0x2c9afe,'apiName':_0x9e5314,'query':_0x15528b,'variables':_0x4a1bd6||{},'operationName':_0x3b1f27});if(_0x3fd62a[_0x5b68ba(0x257)]&&_0x1c5290[_0x5b68ba(0x239)](_0x3fd62a[_0x5b68ba(0x257)][_0x5b68ba(0x21a)],0x0))throw new Error(_0x3fd62a[_0x5b68ba(0x257)][0x0]['message']);return _0x3fd62a[_0x5b68ba(0x1d7)];}};}function a1_0x4b2c(){const _0x3cf34e=['wfypT','DPwIC','method','data','QPmOX','fbPQV','frWfG','internal','constructor','129459aynlvY','XVxwi','xkrig','zSLNl','QhaQE','entries','FIjfE','KjhGZ','459619ATUGcC','gmzje','150160xqKtUZ','fBkjn','XjftZ','log','Subscriptions\x20not\x20yet\x20implemented','GET','enabled','keys','toString','operations','\x27\x20not\x20found\x20in\x20manifest','exception','query','WCwlG','TwLzb','\x27\x20is\x20not\x20a\x20query','cJsqe','793884qeVbAJ','162gCQknb','stateObject','microfrontend','vPrke','info','4791160daDGcY','split','path','POST','lezbc','apis','pop','xHThp','OKmYd','ObjOptional','lvvrm','qBKXd','ukaXZ','AkDec','rSGly','vqOvy','lXJZk','Irurn','onSuccess','message','LOagi','bind','SbHvT','now','qXFRq','AGGtr','SmheF','methods','length','input','IrnkB','Emske','test','deactivate','current','initialize','xyXtQ','CtDaE','\x5c+\x5c+\x20*(?:[a-zA-Z_$][0-9a-zA-Z_$]*)','FlXXj','7zZfzBY','EpSWt','NDFBh','capabilities','TpTLV','DNFJd','lFRmN','BDnTV','timestamp','pluginId','tUkOI','2ZWfgac','api','qcYyF','call','while\x20(true)\x20{}','action','GggpM','UgIkn','Drpjl','CRddJ','6295695JrJcKm','context','onError','activate','variables','graphql','headers','use','dispose','endpoints','wByfv','counter','mutation','DbYJJ','yxyZN','stringify','components','gger','request','warn','type','bmAcb','rOZvR','prototype','Operation\x20\x27','NpfRm','INTERNAL','kmpnc','errors','clNyA','qAqge','debu','IFRAME','console','GraphQL\x20subscriptions\x20not\x20yet\x20implemented','error','GNOuH','apply','5279816xxdBva','iframe','exec','whmkH','Assob','udAzh','rGtrC','\x27\x20is\x20not\x20a\x20mutation','OZDfK','search','slice','chain','TlaIT','replace','manifest'];a1_0x4b2c=function(){return _0x3cf34e;};return a1_0x4b2c();}function B(_0x4113f4,_0x58cee2,_0xd7a608={}){const _0x322724=a1_0x50ab2e,_0x8bb5b1={'GggpM':function(_0x321f7b,_0x456ae9){return _0x321f7b(_0x456ae9);},'Assob':function(_0x2ddd13,_0x2a992b){return _0x2ddd13(_0x2a992b);},'dLzdf':function(_0x5f4826,_0x3ad8b9){return _0x5f4826(_0x3ad8b9);},'bmAcb':function(_0x31714c,_0x58d730){return _0x31714c(_0x58d730);},'SmheF':function(_0x271e17,_0x51e32e){return _0x271e17?.(_0x51e32e);},'zyUjb':function(_0x100408,_0x19ab4d){return _0x100408 instanceof _0x19ab4d;},'FlXXj':function(_0x389e09,_0x533b05){return _0x389e09(_0x533b05);},'rGtrC':function(_0x5c8a4d){return _0x5c8a4d();},'rOZvR':function(_0x436450,_0x5cb8e4){return _0x436450||_0x5cb8e4;},'udAzh':function(_0x179165,_0x48b3e6,_0x4d91c9){return _0x179165(_0x48b3e6,_0x4d91c9);},'qBKXd':function(_0x38746b,_0x3af2fd){return _0x38746b*_0x3af2fd;},'FIjfE':function(_0x4a33f3,_0x47c5d9,_0x51fefe){return _0x4a33f3(_0x47c5d9,_0x51fefe);}};let {enabled:_0x248ef4=!![],refetchOnMount:_0x44b7da=!![],refetchInterval:_0x5f2a72,onSuccess:_0x5af2a6,onError:_0x2177db,cacheTime:_0x25cd31=_0x8bb5b1[_0x322724(0x209)](0x12c,0x3e8)}=_0xd7a608,[_0x5f5255,_0x531874]=useState(void 0x0),[_0x4ed778,_0x2ffd7c]=_0x8bb5b1[_0x322724(0x218)](useState,_0x248ef4),[_0x2ddae8,_0x5a34ef]=_0x8bb5b1[_0x322724(0x225)](useState,void 0x0),_0x100d48=_0x8bb5b1['GggpM'](useRef,!![]),_0x387ce1=_0x8bb5b1['SmheF'](useRef,null),_0x5b9474=_0x8bb5b1[_0x322724(0x1ca)](useCallback,async()=>{const _0x3c9dd5=_0x322724;if(_0x248ef4){if(_0x387ce1[_0x3c9dd5(0x220)]&&Date[_0x3c9dd5(0x215)]()-_0x387ce1[_0x3c9dd5(0x220)][_0x3c9dd5(0x22e)]<_0x25cd31){_0x531874(_0x387ce1[_0x3c9dd5(0x220)][_0x3c9dd5(0x1d7)]),_0x8bb5b1[_0x3c9dd5(0x237)](_0x2ffd7c,![]);return;}_0x2ffd7c(!![]),_0x8bb5b1[_0x3c9dd5(0x1c9)](_0x5a34ef,void 0x0);try{let _0x276fc6=await _0x4113f4[_0x3c9dd5(0x240)](_0x58cee2);if(!_0x100d48[_0x3c9dd5(0x220)])return;if(_0x276fc6[_0x3c9dd5(0x257)]&&_0x276fc6[_0x3c9dd5(0x257)][_0x3c9dd5(0x21a)]>0x0){let _0x423ab5=new Error(_0x276fc6[_0x3c9dd5(0x257)][0x0][_0x3c9dd5(0x211)]);_0x8bb5b1['dLzdf'](_0x5a34ef,_0x423ab5),_0x8bb5b1[_0x3c9dd5(0x1c9)](_0x2177db,_0x423ab5);}else _0x276fc6[_0x3c9dd5(0x1d7)]&&(_0x8bb5b1[_0x3c9dd5(0x250)](_0x531874,_0x276fc6[_0x3c9dd5(0x1d7)]),_0x387ce1[_0x3c9dd5(0x220)]={'data':_0x276fc6[_0x3c9dd5(0x1d7)],'timestamp':Date[_0x3c9dd5(0x215)]()},_0x8bb5b1['SmheF'](_0x5af2a6,_0x276fc6['data']));}catch(_0x303c89){if(!_0x100d48[_0x3c9dd5(0x220)])return;let _0x2d06c8=_0x8bb5b1['zyUjb'](_0x303c89,Error)?_0x303c89:new Error(_0x8bb5b1[_0x3c9dd5(0x237)](String,_0x303c89));_0x5a34ef(_0x2d06c8),_0x8bb5b1[_0x3c9dd5(0x218)](_0x2177db,_0x2d06c8);}finally{_0x100d48[_0x3c9dd5(0x220)]&&_0x8bb5b1['FlXXj'](_0x2ffd7c,![]);}}},[_0x4113f4,_0x58cee2,_0x248ef4,_0x25cd31,_0x5af2a6,_0x2177db]);return _0x8bb5b1['udAzh'](useEffect,()=>{const _0x18b79d=_0x322724;_0x44b7da&&_0x8bb5b1[_0x18b79d(0x1cb)](_0x5b9474);},[_0x5b9474,_0x44b7da]),_0x8bb5b1[_0x322724(0x1ca)](useEffect,()=>{const _0x10e2b9=_0x322724;if(_0x8bb5b1[_0x10e2b9(0x251)](!_0x5f2a72,!_0x248ef4))return;let _0x5a6604=_0x8bb5b1['udAzh'](setInterval,()=>{_0x5b9474();},_0x5f2a72);return()=>clearInterval(_0x5a6604);},[_0x5f2a72,_0x248ef4,_0x5b9474]),_0x8bb5b1[_0x322724(0x1e3)](useEffect,()=>()=>{_0x100d48['current']=![];},[]),{'data':_0x5f5255,'loading':_0x4ed778,'error':_0x2ddae8,'refetch':_0x5b9474};}function W(_0x5cc10a,_0x1d229b,_0x4d0a2c={}){const _0x2214ce=a1_0x50ab2e,_0x51b090={'xyXtQ':function(_0x26c2d1,_0x1203b2){return _0x26c2d1(_0x1203b2);},'QSVak':'Component\x20unmounted','ukaXZ':function(_0x9a0781,_0x4b881e){return _0x9a0781>_0x4b881e;},'TlaIT':function(_0x5464bd,_0x513aba,_0x514ca1){return _0x5464bd?.(_0x513aba,_0x514ca1);},'vqOvy':function(_0x497cc3,_0x1f2bd7,_0x2c629c){return _0x497cc3?.(_0x1f2bd7,_0x2c629c);},'xkrig':function(_0xd5888b,_0x404a8c){return _0xd5888b instanceof _0x404a8c;},'GXhVp':function(_0x3d8c0e,_0x5afbb5){return _0x3d8c0e(_0x5afbb5);},'OKmYd':function(_0x12d345,_0x366bb6){return _0x12d345(_0x366bb6);},'DbYJJ':function(_0x3baaff,_0x28593a){return _0x3baaff(_0x28593a);},'whmkH':function(_0x2a7742,_0x45d262){return _0x2a7742(_0x45d262);},'GyEOp':function(_0x4bae9b,_0x22326f,_0x584ae3){return _0x4bae9b(_0x22326f,_0x584ae3);}};let {onSuccess:_0x1212c8,onError:_0x505ed6}=_0x4d0a2c,[_0x594aab,_0x4f9072]=useState(void 0x0),[_0x2ef31f,_0x5ab7ff]=_0x51b090['GXhVp'](useState,![]),[_0x246bc4,_0x991050]=useState(void 0x0),_0x32d30c=_0x51b090[_0x2214ce(0x1c8)](useRef,!![]);_0x51b090[_0x2214ce(0x1d1)](useEffect,()=>()=>{const _0x1157fb=_0x2214ce;_0x32d30c[_0x1157fb(0x220)]=![];},[]);let _0x23b9ee=_0x51b090[_0x2214ce(0x20d)](useCallback,async _0xaa3b00=>{const _0x5b92a3=_0x2214ce;_0x5ab7ff(!![]),_0x51b090[_0x5b92a3(0x222)](_0x991050,void 0x0);try{let _0xf86911=await _0x5cc10a[_0x5b92a3(0x240)]({..._0x1d229b,'variables':_0xaa3b00});if(!_0x32d30c['current'])throw new Error(_0x51b090['QSVak']);if(_0xf86911[_0x5b92a3(0x257)]&&_0x51b090[_0x5b92a3(0x20a)](_0xf86911[_0x5b92a3(0x257)][_0x5b92a3(0x21a)],0x0)){let _0x39528d=new Error(_0xf86911['errors'][0x0][_0x5b92a3(0x211)]);throw _0x51b090[_0x5b92a3(0x222)](_0x991050,_0x39528d),_0x51b090['TlaIT'](_0x505ed6,_0x39528d,_0xaa3b00),_0x39528d;}if(_0xf86911[_0x5b92a3(0x1d7)])return _0x51b090[_0x5b92a3(0x222)](_0x4f9072,_0xf86911[_0x5b92a3(0x1d7)]),_0x51b090[_0x5b92a3(0x20d)](_0x1212c8,_0xf86911[_0x5b92a3(0x1d7)],_0xaa3b00),_0xf86911[_0x5b92a3(0x1d7)];throw new Error('No\x20data\x20returned\x20from\x20mutation');}catch(_0x58e1b0){if(!_0x32d30c[_0x5b92a3(0x220)])throw _0x58e1b0;let _0x35e96c=_0x51b090[_0x5b92a3(0x1df)](_0x58e1b0,Error)?_0x58e1b0:new Error(_0x51b090['GXhVp'](String,_0x58e1b0));throw _0x991050(_0x35e96c),_0x505ed6?.(_0x35e96c,_0xaa3b00),_0x35e96c;}finally{_0x32d30c[_0x5b92a3(0x220)]&&_0x51b090['OKmYd'](_0x5ab7ff,![]);}},[_0x5cc10a,_0x1d229b,_0x1212c8,_0x505ed6]),_0x44c95e=_0x51b090['GyEOp'](useCallback,()=>{const _0x15467e=_0x2214ce;_0x51b090[_0x15467e(0x248)](_0x4f9072,void 0x0),_0x51b090[_0x15467e(0x206)](_0x991050,void 0x0),_0x5ab7ff(![]);},[]);return{'mutate':_0x23b9ee,'data':_0x594aab,'loading':_0x2ef31f,'error':_0x246bc4,'reset':_0x44c95e};}function X(_0x3bd202,_0x52c12b,_0x2b76c3={}){const _0x586793=a1_0x50ab2e,_0x37aa90={'GNOuH':_0x586793(0x25d),'OKGnw':_0x586793(0x1eb)};return console[_0x586793(0x24e)](_0x37aa90[_0x586793(0x25f)]),{'data':void 0x0,'loading':![],'error':new Error(_0x37aa90['OKGnw']),'refetch':async()=>{}};}var v=class{constructor(_0x6380a5,_0x2990ce){const _0x3e9c24=a1_0x50ab2e;this[_0x3e9c24(0x23c)]=_0x6380a5,this[_0x3e9c24(0x22f)]=_0x2990ce;}async[a1_0x50ab2e(0x24d)](_0x527afe){const _0x1fb08f=a1_0x50ab2e,_0x404f75={'WCwlG':'Plugin\x20API\x20Request\x20Failed'};let {url:_0x5b95d3,method:_0x40a618,headers:_0x55266b,body:_0x3da0e2,params:_0x14fbe2}=_0x527afe,_0x562ace=_0x5b95d3[_0x1fb08f(0x1ff)]('/')[_0x1fb08f(0x204)]()?.['split']('?')[0x0]??'';try{return{'data':(await this[_0x1fb08f(0x23c)][_0x1fb08f(0x229)][_0x1fb08f(0x232)][_0x1fb08f(0x24d)]({'pluginId':this[_0x1fb08f(0x22f)],'endpoint':_0x562ace,'method':_0x40a618,'data':_0x3da0e2,'params':_0x14fbe2,'headers':_0x55266b}))[_0x1fb08f(0x207)],'status':0xc8,'statusText':'OK','headers':{}};}catch(_0x526821){throw{'message':_0x526821['message']||_0x404f75[_0x1fb08f(0x1f4)],'status':_0x526821['status']||0x1f4,'details':_0x526821};}}};function Z(_0x431bbc,_0x47b138){return new v(_0x431bbc,_0x47b138);}export{O as ExtensionPoint,v as PluginHostAdapter,w as PluginType,K as createGraphQLClient,V as createPluginApi,F as createPluginApiHooks,Z as createPluginHostAdapter,z as createRawGraphQLClient,k as defineApiConfig,U as defineEndpoints,S as defineManifest,H as definePlugin,L as useApiMutation,q as useApiQuery,W as useGraphQLMutation,B as useGraphQLQuery,X as useGraphQLSubscription};function a1_0x486b6a(_0x4b2b68){const _0xf55c5d=a1_0x50ab2e,_0x292cb7={'mTktl':function(_0x57f2c9,_0x47ecd){return _0x57f2c9===_0x47ecd;},'LOagi':'string','wpcob':_0xf55c5d(0x235),'xHThp':_0xf55c5d(0x246),'gmzje':function(_0x33d64c,_0x752266){return _0x33d64c!==_0x752266;},'EDVqQ':'length','NpfRm':function(_0x4b18bc,_0x596b4b){return _0x4b18bc===_0x596b4b;},'lXJZk':function(_0x4aa9d2,_0x52a0ab){return _0x4aa9d2%_0x52a0ab;},'clNyA':function(_0x540b24,_0x41d1bd){return _0x540b24+_0x41d1bd;},'vPrke':_0xf55c5d(0x25a),'NDFBh':_0xf55c5d(0x236),'WyDlh':_0xf55c5d(0x24c),'TpTLV':_0xf55c5d(0x1fa),'IrnkB':function(_0x4ad72c,_0x1d372d){return _0x4ad72c(_0x1d372d);}};function _0x485c5d(_0x4579bb){const _0x5d9fd6=_0xf55c5d;if(_0x292cb7['mTktl'](typeof _0x4579bb,_0x292cb7[_0x5d9fd6(0x212)]))return function(_0x239df0){}[_0x5d9fd6(0x1dc)](_0x292cb7['wpcob'])[_0x5d9fd6(0x260)](_0x292cb7[_0x5d9fd6(0x205)]);else _0x292cb7[_0x5d9fd6(0x1e6)]((''+_0x4579bb/_0x4579bb)[_0x292cb7['EDVqQ']],0x1)||_0x292cb7[_0x5d9fd6(0x254)](_0x292cb7[_0x5d9fd6(0x20e)](_0x4579bb,0x14),0x0)?function(){return!![];}[_0x5d9fd6(0x1dc)](_0x292cb7['clNyA'](_0x292cb7[_0x5d9fd6(0x1fc)],'gger'))[_0x5d9fd6(0x234)](_0x292cb7[_0x5d9fd6(0x228)]):function(){return![];}['constructor'](_0x292cb7[_0x5d9fd6(0x258)](_0x292cb7['vPrke'],_0x292cb7['WyDlh']))['apply'](_0x292cb7[_0x5d9fd6(0x22a)]);_0x292cb7[_0x5d9fd6(0x21c)](_0x485c5d,++_0x4579bb);}try{if(_0x4b2b68)return _0x485c5d;else _0x292cb7[_0xf55c5d(0x21c)](_0x485c5d,0x0);}catch(_0x3ba7b9){}}
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@unifiedsoftware/react-plugin-remote",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"@types/react": "^18.0.0",
|
|
23
|
+
"@types/react-dom": "^18.0.0",
|
|
24
|
+
"react": "^18.0.0",
|
|
25
|
+
"react-dom": "^18.0.0"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT"
|
|
28
|
+
}
|