@yongdall/web 0.1.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/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@yongdall/web",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "./index.mjs",
6
+ "exports": {
7
+ ".": "./index.mjs",
8
+ "./boot": "./boot.mts",
9
+ "./plugin": "./plugin.mjs"
10
+ },
11
+ "dependencies": {
12
+ "@yongdall/common": "^0.1.0"
13
+ },
14
+ "devDependencies": {
15
+ "@neeloong/form": "^0.22.0",
16
+ "@yongdall/types": "^0.1.0",
17
+ "dot-request": "^0.5.4",
18
+ "signal-polyfill": "^0.2.2"
19
+ },
20
+ "peerDependencies": {
21
+ "@neeloong/form": "^0.22.0",
22
+ "@yongdall/types": "^0.1.0",
23
+ "dot-request": "^0.5.4",
24
+ "signal-polyfill": "^0.2.2"
25
+ }
26
+ }
package/plugin.d.mts ADDED
@@ -0,0 +1,188 @@
1
+ import * as dot_request0 from "dot-request";
2
+
3
+ //#region packages/web/plugin.d.mts
4
+ declare const pluginId: string;
5
+ /** @deprecated */
6
+ /** @type {(url: string) => Promise<any>} */
7
+ declare const importPluginStyle: (url: string) => Promise<any>;
8
+ /** @deprecated */
9
+ /** @type {(url: string) => Promise<HTMLLinkElement>} */
10
+ declare const importPluginWidget: (url: string) => Promise<HTMLLinkElement>;
11
+ /** @deprecated */
12
+ declare const pluginRequest: {
13
+ build(): any;
14
+ method(method: string, path?: string): any;
15
+ readonly version: string;
16
+ buildResult(response: Promise<Response>): Result;
17
+ clone<T extends dot_request0.default>(target: T): T;
18
+ clone(): any;
19
+ get(path?: string | undefined): any;
20
+ get(template: TemplateStringsArray, ...substitutions: any[]): any;
21
+ post(path?: string | undefined): any;
22
+ post(template: TemplateStringsArray, ...substitutions: any[]): any;
23
+ put(path?: string | undefined): any;
24
+ put(template: TemplateStringsArray, ...substitutions: any[]): any;
25
+ delete(path?: string | undefined): any;
26
+ delete(template: TemplateStringsArray, ...substitutions: any[]): any;
27
+ head(path?: string | undefined): any;
28
+ head(template: TemplateStringsArray, ...substitutions: any[]): any;
29
+ path(path: string): any;
30
+ path(template: TemplateStringsArray, ...substitutions: any[]): any;
31
+ prefix(prefix?: string | undefined): any;
32
+ prefix(template: TemplateStringsArray, ...substitutions: any[]): any;
33
+ suffix(suffix?: string | undefined): any;
34
+ suffix(template: TemplateStringsArray, ...substitutions: any[]): any;
35
+ append(...path: string[]): any;
36
+ append(template: TemplateStringsArray, ...substitutions: any[]): any;
37
+ header(headers: () => Record<string, HeaderValue> | null): HeaderValue | (() => HeaderValue);
38
+ header(name: string): HeaderValue | (() => HeaderValue);
39
+ header(name: string, value: HeaderValue | (() => HeaderValue)): any;
40
+ header(headers: Record<string, HeaderValue | (() => HeaderValue)>): any;
41
+ redirect(redirect: boolean | "error"): any;
42
+ redirect(): boolean | "error";
43
+ timeout(ms: number): any;
44
+ timeout(): number;
45
+ credentials(credentials: RequestCredentials | null): any;
46
+ credentials(): RequestCredentials | null;
47
+ mode(mode: RequestMode | "" | null): any;
48
+ mode(): RequestMode | "";
49
+ cache(cache: RequestCache | null): any;
50
+ cache(): RequestCache | null;
51
+ referrer(referrer: string): any;
52
+ referrer(): string;
53
+ referrerPolicy(rp: ReferrerPolicy | null): any;
54
+ referrerPolicy(): ReferrerPolicy | null;
55
+ integrity(integrity: string): any;
56
+ integrity(): string;
57
+ keepalive(keep: boolean): any;
58
+ keepalive(): boolean;
59
+ context<V>(name: string | symbol): V;
60
+ context(name: string | symbol, value: any): any;
61
+ context(context: Record<string, any>): any;
62
+ params(params?: Record<string, string | number> | undefined): any;
63
+ query(query?: Record<string, any> | undefined): any;
64
+ search(search?: string | undefined): any;
65
+ data(data?: Record<string, any> | undefined): any;
66
+ body(body?: BodyData, type?: string | undefined): any;
67
+ body(body?: object | Record<string, any>): any;
68
+ form(form?: FormData | object | Record<string, any>): any;
69
+ signal(signal?: Signal): any;
70
+ signalHandler(handler?: boolean | SignalHandler | undefined): any;
71
+ uploadProgress(up: ProgressListener): any;
72
+ stringifyJSON(fn?: ((value: any) => string) | null | undefined): any;
73
+ downloadProgress(dp: ProgressListener | null): any;
74
+ errorHandler(eh: ErrorHandler | null): any;
75
+ parseJSON(fn: ((value: string) => any) | null): any;
76
+ create(): Request;
77
+ fetch(fetch: Fetch): any;
78
+ fetch(): Result;
79
+ ok(error?: ErrorHandler | null | undefined): Result;
80
+ text(): Promise<string>;
81
+ blob(): Promise<Blob>;
82
+ arrayBuffer(): Promise<ArrayBuffer>;
83
+ formData(): Promise<FormData>;
84
+ json<T>(reviver?: ((this: any, key: string, value: any) => any) | undefined): Promise<T>;
85
+ searchParams(): Promise<URLSearchParams>;
86
+ stream(): Promise<ReadableStream<Uint8Array> | null>;
87
+ result<T>(): Promise<T | null>;
88
+ done<T = void>(value: T): Promise<T>;
89
+ done(): Promise<void>;
90
+ then<TResult1 = Response, TResult2 = never>(fulfilled?: ((value: Response) => TResult1 | PromiseLike<TResult1>) | null | undefined, rejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
91
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<Response | TResult>;
92
+ finally(onfinally: (() => void) | null): Promise<Response>;
93
+ "__#private@#private": any;
94
+ };
95
+ declare const Plugin: {
96
+ importStyle(url: string): Promise<HTMLLinkElement>;
97
+ import(url: string): Promise<any>;
98
+ request: {
99
+ build(): any;
100
+ method(method: string, path?: string): any;
101
+ get version(): string;
102
+ buildResult(response: Promise<Response>): Result;
103
+ clone<T extends dot_request0.default>(target: T): T;
104
+ clone(): any;
105
+ get(path?: string | undefined): any;
106
+ get(template: TemplateStringsArray, ...substitutions: any[]): any;
107
+ post(path?: string | undefined): any;
108
+ post(template: TemplateStringsArray, ...substitutions: any[]): any;
109
+ put(path?: string | undefined): any;
110
+ put(template: TemplateStringsArray, ...substitutions: any[]): any;
111
+ delete(path?: string | undefined): any;
112
+ delete(template: TemplateStringsArray, ...substitutions: any[]): any;
113
+ head(path?: string | undefined): any;
114
+ head(template: TemplateStringsArray, ...substitutions: any[]): any;
115
+ path(path: string): any;
116
+ path(template: TemplateStringsArray, ...substitutions: any[]): any;
117
+ prefix(prefix?: string | undefined): any;
118
+ prefix(template: TemplateStringsArray, ...substitutions: any[]): any;
119
+ suffix(suffix?: string | undefined): any;
120
+ suffix(template: TemplateStringsArray, ...substitutions: any[]): any;
121
+ append(...path: string[]): any;
122
+ append(template: TemplateStringsArray, ...substitutions: any[]): any;
123
+ header(headers: () => Record<string, HeaderValue> | null): HeaderValue | (() => HeaderValue);
124
+ header(name: string): HeaderValue | (() => HeaderValue);
125
+ header(name: string, value: HeaderValue | (() => HeaderValue)): any;
126
+ header(headers: Record<string, HeaderValue | (() => HeaderValue)>): any;
127
+ redirect(redirect: boolean | "error"): any;
128
+ redirect(): boolean | "error";
129
+ timeout(ms: number): any;
130
+ timeout(): number;
131
+ credentials(credentials: RequestCredentials | null): any;
132
+ credentials(): RequestCredentials | null;
133
+ mode(mode: RequestMode | "" | null): any;
134
+ mode(): RequestMode | "";
135
+ cache(cache: RequestCache | null): any;
136
+ cache(): RequestCache | null;
137
+ referrer(referrer: string): any;
138
+ referrer(): string;
139
+ referrerPolicy(rp: ReferrerPolicy | null): any;
140
+ referrerPolicy(): ReferrerPolicy | null;
141
+ integrity(integrity: string): any;
142
+ integrity(): string;
143
+ keepalive(keep: boolean): any;
144
+ keepalive(): boolean;
145
+ context<V>(name: string | symbol): V;
146
+ context(name: string | symbol, value: any): any;
147
+ context(context: Record<string, any>): any;
148
+ params(params?: Record<string, string | number> | undefined): any;
149
+ query(query?: Record<string, any> | undefined): any;
150
+ search(search?: string | undefined): any;
151
+ data(data?: Record<string, any> | undefined): any;
152
+ body(body?: BodyData, type?: string | undefined): any;
153
+ body(body?: object | Record<string, any>): any;
154
+ form(form?: FormData | object | Record<string, any>): any;
155
+ signal(signal?: Signal): any;
156
+ signalHandler(handler?: boolean | SignalHandler | undefined): any;
157
+ uploadProgress(up: ProgressListener): any;
158
+ stringifyJSON(fn?: ((value: any) => string) | null | undefined): any;
159
+ downloadProgress(dp: ProgressListener | null): any;
160
+ errorHandler(eh: ErrorHandler | null): any;
161
+ parseJSON(fn: ((value: string) => any) | null): any;
162
+ create(): Request;
163
+ fetch(fetch: Fetch): any;
164
+ fetch(): Result;
165
+ ok(error?: ErrorHandler | null | undefined): Result;
166
+ text(): Promise<string>;
167
+ blob(): Promise<Blob>;
168
+ arrayBuffer(): Promise<ArrayBuffer>;
169
+ formData(): Promise<FormData>;
170
+ json<T>(reviver?: ((this: any, key: string, value: any) => any) | undefined): Promise<T>;
171
+ searchParams(): Promise<URLSearchParams>;
172
+ stream(): Promise<ReadableStream<Uint8Array> | null>;
173
+ result<T>(): Promise<T | null>;
174
+ done<T = void>(value: T): Promise<T>;
175
+ done(): Promise<void>;
176
+ then<TResult1 = Response, TResult2 = never>(fulfilled?: ((value: Response) => TResult1 | PromiseLike<TResult1>) | null | undefined, rejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
177
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<Response | TResult>;
178
+ finally(onfinally: (() => void) | null): Promise<Response>;
179
+ "__#private@#private": any;
180
+ };
181
+ user: {
182
+ readonly session: Record<string, any> | null;
183
+ readonly target: Record<string, any> | null;
184
+ readonly current: Record<string, any> | null;
185
+ };
186
+ };
187
+ //#endregion
188
+ export { Plugin as default, importPluginStyle, importPluginWidget, pluginId, pluginRequest };
package/plugin.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import{buildPlugin as e}from"@yongdall/web";const t=new URL(import.meta.url),n=decodeURIComponent(t.search.substring(1).split(`&`).find(e=>e.startsWith(`plugin=`)&&e.length>7)?.substring(7)||``),r=e(n);var i=r;const a=e=>r.importStyle(e),o=e=>r.import(e),s=r.request;export{i as default,a as importPluginStyle,o as importPluginWidget,n as pluginId,s as pluginRequest};
2
+ //# sourceMappingURL=plugin.mjs.map
package/plugin.mjs.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.mjs","names":[],"sources":["../../packages/web/plugin.mjs"],"sourcesContent":["import { buildPlugin } from '@yongdall/web';\nconst url = new URL(import.meta.url)\nconst paramKey = `plugin=`\nexport const pluginId = decodeURIComponent(url.search.substring(1).split('&')\n\t.find(v => v.startsWith(paramKey) && v.length > paramKey.length)\n\t?.substring(paramKey.length) || '')\n\nconst Plugin = buildPlugin(pluginId);\n\nexport default Plugin;\n/** @deprecated */\n/** @type {(url: string) => Promise<any>} */\nexport const importPluginStyle = url => Plugin.importStyle(url);\n/** @deprecated */\n/** @type {(url: string) => Promise<HTMLLinkElement>} */\nexport const importPluginWidget = url => Plugin.import(url);\n/** @deprecated */\nexport const pluginRequest = Plugin.request;\n"],"mappings":"4CACA,MAAM,EAAM,IAAI,IAAI,OAAO,KAAK,IAAI,CAEvB,EAAW,mBAAmB,EAAI,OAAO,UAAU,EAAE,CAAC,MAAM,IAAI,CAC3E,KAAK,GAAK,EAAE,WAAW,UAAS,EAAI,EAAE,OAAS,EAAgB,EAC9D,UAAU,EAAgB,EAAI,GAAG,CAE9B,EAAS,EAAY,EAAS,CAEpC,IAAA,EAAe,EAGf,MAAa,EAAoB,GAAO,EAAO,YAAY,EAAI,CAGlD,EAAqB,GAAO,EAAO,OAAO,EAAI,CAE9C,EAAgB,EAAO"}