@podium/client 5.0.19 → 5.0.21

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/client.d.ts DELETED
@@ -1,140 +0,0 @@
1
- import MetricsClient from '@metrics/client';
2
- import { HttpIncoming, AssetJs, AssetCss } from '@podium/utils';
3
- import { IncomingHttpHeaders, OutgoingHttpHeaders } from 'http';
4
- import { Agent as HttpAgent } from 'http';
5
- import { Agent as HttpsAgent } from 'https';
6
-
7
- declare class PodiumClient {
8
- constructor(options?: PodiumClient.PodiumClientOptions);
9
-
10
- readonly metrics: MetricsClient;
11
- readonly state:
12
- | 'instantiated'
13
- | 'initializing'
14
- | 'unstable'
15
- | 'stable'
16
- | 'unhealthy';
17
-
18
- register(
19
- options: PodiumClient.RegisterOptions,
20
- ): PodiumClient.PodiumClientResource;
21
-
22
- /**
23
- * Refreshes the manifests of all registered resources. Does so by calling the
24
- * `.refresh()` method on all resources under the hood.
25
- */
26
- refreshManifests(): Promise<void>;
27
- /**
28
- * This method will refresh a resource by reading its manifest and fallback
29
- * if defined in the manifest. The method will not call the URI to the content
30
- * of a component.
31
- */
32
- refresh(): Promise<number>;
33
-
34
- js(): Array<AssetJs>;
35
- css(): Array<AssetCss>;
36
- /**
37
- * @returns An array of all loaded manifests ready to be used by `.load()`
38
- */
39
- dump(): PodiumClient.PodletManifest[];
40
- /**
41
- * Loads an Array of manifests (provided by `.dump()`) into the proxy. If any of
42
- * the items in the loaded Array contains a key which is already in the cache, the
43
- * entry in the cache will be overwritten.
44
- *
45
- * If any of the entries in the loaded Array are not compatible with the format
46
- * which `.dump()` exports, they will not be inserted into the cache.
47
- *
48
- * @returns An Array with the keys which were inserted into the cache.
49
- */
50
- load(manifests: PodiumClient.PodletManifest[]): string[];
51
- }
52
-
53
- declare namespace PodiumClient {
54
- export type PodletManifest = {
55
- name: string;
56
- version: string;
57
- content: string;
58
- fallback?: string;
59
- proxy?: Record<string, string>;
60
- assets?: {
61
- js?: string[];
62
- css?: string[];
63
- };
64
- css?: string[];
65
- js?: string[];
66
- };
67
-
68
- type AbsLogger = {
69
- trace: LogFunction;
70
- debug: LogFunction;
71
- info: LogFunction;
72
- warn: LogFunction;
73
- error: LogFunction;
74
- fatal: LogFunction;
75
- };
76
-
77
- type LogFunction = (...args: any) => void;
78
-
79
- export type PodiumClientOptions = {
80
- name?: string;
81
- logger?: AbsLogger | Console;
82
- retries?: number;
83
- timeout?: number;
84
- maxAge?: number;
85
- rejectUnauthorized?: boolean;
86
- resolveThreshold?: number;
87
- resolveMax?: number;
88
- httpAgent?: HttpAgent;
89
- httpsAgent?: HttpsAgent;
90
- };
91
- export interface PodiumClientResourceOptions {
92
- pathname?: string;
93
- headers?: OutgoingHttpHeaders;
94
- query?: any;
95
- }
96
-
97
- export interface PodiumClientResponse {
98
- readonly redirect: PodiumRedirect;
99
- readonly content: string;
100
- readonly headers: IncomingHttpHeaders;
101
- readonly js: Array<AssetJs>;
102
- readonly css: Array<AssetCss>;
103
- }
104
-
105
- export class PodiumClientResource {
106
- readonly name: string;
107
-
108
- readonly uri: string;
109
-
110
- fetch(
111
- incoming: HttpIncoming,
112
- options?: PodiumClientResourceOptions,
113
- ): Promise<PodiumClientResponse>;
114
-
115
- stream(
116
- incoming: HttpIncoming,
117
- options?: PodiumClientResourceOptions,
118
- ): ReadableStream<PodiumClientResponse>;
119
-
120
- refresh(): Promise<boolean>;
121
- }
122
-
123
- export interface RegisterOptions {
124
- uri: string;
125
- name: string;
126
- retries?: number;
127
- timeout?: number;
128
- throwable?: boolean;
129
- redirectable?: boolean;
130
- resolveJs?: boolean;
131
- resolveCss?: boolean;
132
- }
133
-
134
- export interface PodiumRedirect {
135
- readonly statusCode: number;
136
- readonly location: string;
137
- }
138
- }
139
-
140
- export default PodiumClient;
package/dist/package.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }