@dooboostore/simple-boot-http-server-ssr 1.0.9 → 1.0.11
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/LICENSE.md +7 -0
- package/dist/cjs/SimpleBootHttpSSRFactory.d.ts.map +1 -0
- package/dist/cjs/SimpleBootHttpSSRFactory.js +33 -0
- package/dist/cjs/SimpleBootHttpSSRFactory.js.map +7 -0
- package/{SimpleBootHttpSSRServer.d.ts → dist/cjs/SimpleBootHttpSSRServer.d.ts} +2 -2
- package/dist/cjs/SimpleBootHttpSSRServer.d.ts.map +1 -0
- package/dist/cjs/SimpleBootHttpSSRServer.js +41 -0
- package/dist/cjs/SimpleBootHttpSSRServer.js.map +7 -0
- package/dist/cjs/codes/HttpHeaders.d.ts.map +1 -0
- package/dist/cjs/codes/HttpHeaders.js +41 -0
- package/dist/cjs/codes/HttpHeaders.js.map +7 -0
- package/dist/cjs/codes/Mimes.d.ts.map +1 -0
- package/dist/cjs/codes/Mimes.js +33 -0
- package/dist/cjs/codes/Mimes.js.map +7 -0
- package/dist/cjs/codes/index.d.ts +3 -0
- package/dist/cjs/codes/index.d.ts.map +1 -0
- package/dist/cjs/codes/index.js +24 -0
- package/dist/cjs/codes/index.js.map +7 -0
- package/dist/cjs/decorators/LoadAroundBefore.d.ts.map +1 -0
- package/dist/cjs/decorators/LoadAroundBefore.js +54 -0
- package/dist/cjs/decorators/LoadAroundBefore.js.map +7 -0
- package/dist/cjs/decorators/SaveAroundAfter.d.ts.map +1 -0
- package/dist/cjs/decorators/SaveAroundAfter.js +53 -0
- package/dist/cjs/decorators/SaveAroundAfter.js.map +7 -0
- package/dist/cjs/decorators/index.d.ts +3 -0
- package/dist/cjs/decorators/index.d.ts.map +1 -0
- package/dist/cjs/decorators/index.js +24 -0
- package/dist/cjs/decorators/index.js.map +7 -0
- package/dist/cjs/filters/IntentSchemeFilter.d.ts.map +1 -0
- package/dist/cjs/filters/IntentSchemeFilter.js +92 -0
- package/dist/cjs/filters/IntentSchemeFilter.js.map +7 -0
- package/{filters → dist/cjs/filters}/SSRFilter.d.ts +5 -0
- package/dist/cjs/filters/SSRFilter.d.ts.map +1 -0
- package/dist/cjs/filters/SSRFilter.js +204 -0
- package/dist/cjs/filters/SSRFilter.js.map +7 -0
- package/dist/cjs/filters/SSRWorker.d.ts.map +1 -0
- package/dist/cjs/filters/SSRWorker.js +85 -0
- package/dist/cjs/filters/SSRWorker.js.map +7 -0
- package/dist/cjs/filters/index.d.ts +4 -0
- package/dist/cjs/filters/index.d.ts.map +1 -0
- package/dist/cjs/filters/index.js +26 -0
- package/dist/cjs/filters/index.js.map +7 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +24 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/initializers/JsdomInitializer.d.ts.map +1 -0
- package/dist/cjs/initializers/JsdomInitializer.js +82 -0
- package/dist/cjs/initializers/JsdomInitializer.js.map +7 -0
- package/dist/cjs/initializers/index.d.ts +2 -0
- package/dist/cjs/initializers/index.d.ts.map +1 -0
- package/dist/cjs/initializers/index.js +22 -0
- package/dist/cjs/initializers/index.js.map +7 -0
- package/dist/cjs/option/HttpSSRServerOption.d.ts.map +1 -0
- package/dist/cjs/option/HttpSSRServerOption.js +30 -0
- package/dist/cjs/option/HttpSSRServerOption.js.map +7 -0
- package/dist/cjs/option/index.d.ts +2 -0
- package/dist/cjs/option/index.d.ts.map +1 -0
- package/dist/cjs/option/index.js +22 -0
- package/dist/cjs/option/index.js.map +7 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/proxy/IntentSchemeFrontProxy.d.ts.map +1 -0
- package/dist/cjs/proxy/IntentSchemeFrontProxy.js +87 -0
- package/dist/cjs/proxy/IntentSchemeFrontProxy.js.map +7 -0
- package/dist/cjs/proxy/IntentSchemeServerProxy.d.ts.map +1 -0
- package/dist/cjs/proxy/IntentSchemeServerProxy.js +67 -0
- package/dist/cjs/proxy/IntentSchemeServerProxy.js.map +7 -0
- package/{proxy → dist/cjs/proxy}/SymbolIntentApiServiceProxy.d.ts +1 -0
- package/dist/cjs/proxy/SymbolIntentApiServiceProxy.d.ts.map +1 -0
- package/dist/cjs/proxy/SymbolIntentApiServiceProxy.js +111 -0
- package/dist/cjs/proxy/SymbolIntentApiServiceProxy.js.map +7 -0
- package/dist/cjs/proxy/SymbolIntentApiServiceProxyBase.d.ts +13 -0
- package/dist/cjs/proxy/SymbolIntentApiServiceProxyBase.d.ts.map +1 -0
- package/dist/cjs/proxy/SymbolIntentApiServiceProxyBase.js +110 -0
- package/dist/cjs/proxy/SymbolIntentApiServiceProxyBase.js.map +7 -0
- package/dist/cjs/proxy/index.d.ts +5 -0
- package/dist/cjs/proxy/index.d.ts.map +1 -0
- package/dist/cjs/proxy/index.js +28 -0
- package/dist/cjs/proxy/index.js.map +7 -0
- package/dist/esm/SimpleBootHttpSSRFactory.d.ts +8 -0
- package/dist/esm/SimpleBootHttpSSRFactory.d.ts.map +1 -0
- package/dist/esm/SimpleBootHttpSSRFactory.js +10 -0
- package/dist/esm/SimpleBootHttpSSRFactory.js.map +7 -0
- package/dist/esm/SimpleBootHttpSSRServer.d.ts +9 -0
- package/dist/esm/SimpleBootHttpSSRServer.d.ts.map +1 -0
- package/dist/esm/SimpleBootHttpSSRServer.js +18 -0
- package/dist/esm/SimpleBootHttpSSRServer.js.map +7 -0
- package/dist/esm/codes/HttpHeaders.d.ts +45 -0
- package/dist/esm/codes/HttpHeaders.d.ts.map +1 -0
- package/dist/esm/codes/HttpHeaders.js +17 -0
- package/dist/esm/codes/HttpHeaders.js.map +7 -0
- package/dist/esm/codes/Mimes.d.ts +31 -0
- package/dist/esm/codes/Mimes.d.ts.map +1 -0
- package/dist/esm/codes/Mimes.js +10 -0
- package/dist/esm/codes/Mimes.js.map +7 -0
- package/dist/esm/codes/index.d.ts +3 -0
- package/dist/esm/codes/index.d.ts.map +1 -0
- package/dist/esm/codes/index.js +3 -0
- package/dist/esm/codes/index.js.map +7 -0
- package/dist/esm/decorators/LoadAroundBefore.d.ts +2 -0
- package/dist/esm/decorators/LoadAroundBefore.d.ts.map +1 -0
- package/dist/esm/decorators/LoadAroundBefore.js +31 -0
- package/dist/esm/decorators/LoadAroundBefore.js.map +7 -0
- package/dist/esm/decorators/SaveAroundAfter.d.ts +3 -0
- package/dist/esm/decorators/SaveAroundAfter.d.ts.map +1 -0
- package/dist/esm/decorators/SaveAroundAfter.js +29 -0
- package/dist/esm/decorators/SaveAroundAfter.js.map +7 -0
- package/dist/esm/decorators/index.d.ts +3 -0
- package/dist/esm/decorators/index.d.ts.map +1 -0
- package/dist/esm/decorators/index.js +3 -0
- package/dist/esm/decorators/index.js.map +7 -0
- package/dist/esm/filters/IntentSchemeFilter.d.ts +20 -0
- package/dist/esm/filters/IntentSchemeFilter.d.ts.map +1 -0
- package/dist/esm/filters/IntentSchemeFilter.js +69 -0
- package/dist/esm/filters/IntentSchemeFilter.js.map +7 -0
- package/dist/esm/filters/SSRFilter.d.ts +59 -0
- package/dist/esm/filters/SSRFilter.d.ts.map +1 -0
- package/dist/esm/filters/SSRFilter.js +181 -0
- package/dist/esm/filters/SSRFilter.js.map +7 -0
- package/dist/esm/filters/SSRWorker.d.ts +16 -0
- package/dist/esm/filters/SSRWorker.d.ts.map +1 -0
- package/dist/esm/filters/SSRWorker.js +62 -0
- package/dist/esm/filters/SSRWorker.js.map +7 -0
- package/dist/esm/filters/index.d.ts +4 -0
- package/dist/esm/filters/index.d.ts.map +1 -0
- package/dist/esm/filters/index.js +4 -0
- package/dist/esm/filters/index.js.map +7 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/initializers/JsdomInitializer.d.ts +11 -0
- package/dist/esm/initializers/JsdomInitializer.d.ts.map +1 -0
- package/dist/esm/initializers/JsdomInitializer.js +49 -0
- package/dist/esm/initializers/JsdomInitializer.js.map +7 -0
- package/dist/esm/initializers/index.d.ts +2 -0
- package/dist/esm/initializers/index.d.ts.map +1 -0
- package/dist/esm/initializers/index.js +2 -0
- package/dist/esm/initializers/index.js.map +7 -0
- package/dist/esm/option/HttpSSRServerOption.d.ts +4 -0
- package/dist/esm/option/HttpSSRServerOption.d.ts.map +1 -0
- package/dist/esm/option/HttpSSRServerOption.js +7 -0
- package/dist/esm/option/HttpSSRServerOption.js.map +7 -0
- package/dist/esm/option/index.d.ts +2 -0
- package/dist/esm/option/index.d.ts.map +1 -0
- package/dist/esm/option/index.js +2 -0
- package/dist/esm/option/index.js.map +7 -0
- package/dist/esm/proxy/IntentSchemeFrontProxy.d.ts +4 -0
- package/dist/esm/proxy/IntentSchemeFrontProxy.d.ts.map +1 -0
- package/dist/esm/proxy/IntentSchemeFrontProxy.js +64 -0
- package/dist/esm/proxy/IntentSchemeFrontProxy.js.map +7 -0
- package/dist/esm/proxy/IntentSchemeServerProxy.d.ts +4 -0
- package/dist/esm/proxy/IntentSchemeServerProxy.d.ts.map +1 -0
- package/dist/esm/proxy/IntentSchemeServerProxy.js +44 -0
- package/dist/esm/proxy/IntentSchemeServerProxy.js.map +7 -0
- package/dist/esm/proxy/SymbolIntentApiServiceProxy.d.ts +16 -0
- package/dist/esm/proxy/SymbolIntentApiServiceProxy.d.ts.map +1 -0
- package/dist/esm/proxy/SymbolIntentApiServiceProxy.js +88 -0
- package/dist/esm/proxy/SymbolIntentApiServiceProxy.js.map +7 -0
- package/dist/esm/proxy/SymbolIntentApiServiceProxyBase.d.ts +13 -0
- package/dist/esm/proxy/SymbolIntentApiServiceProxyBase.d.ts.map +1 -0
- package/dist/esm/proxy/SymbolIntentApiServiceProxyBase.js +87 -0
- package/dist/esm/proxy/SymbolIntentApiServiceProxyBase.js.map +7 -0
- package/dist/esm/proxy/index.d.ts +5 -0
- package/dist/esm/proxy/index.d.ts.map +1 -0
- package/dist/esm/proxy/index.js +5 -0
- package/dist/esm/proxy/index.js.map +7 -0
- package/dist/esm-bundle/dooboostore-simple-boot-http-server-ssr.esm.js +6 -0
- package/dist/esm-bundle/dooboostore-simple-boot-http-server-ssr.esm.js.map +7 -0
- package/dist/umd-bundle/dooboostore-simple-boot-http-server-ssr.umd.js +28 -0
- package/dist/umd-bundle/dooboostore-simple-boot-http-server-ssr.umd.js.map +7 -0
- package/package.json +60 -45
- package/SimpleBootHttpSSRFactory.js +0 -10
- package/SimpleBootHttpSSRServer.js +0 -12
- package/codes/HttpHeaders.js +0 -10
- package/codes/Mimes.js +0 -3
- package/decorators/LoadAroundBefore.js +0 -31
- package/decorators/SaveAroundAfter.js +0 -26
- package/filters/IntentSchemeFilter.js +0 -72
- package/filters/SSRFilter.js +0 -232
- package/filters/SSRWorker.js +0 -72
- package/initializers/JsdomInitializer.js +0 -63
- package/option/HttpSSRServerOption.js +0 -4
- package/proxy/IntentSchemeFrontProxy.js +0 -68
- package/proxy/IntentSchemeServerProxy.js +0 -39
- package/proxy/SymbolIntentApiServiceProxy.js +0 -67
- /package/{SimpleBootHttpSSRFactory.d.ts → dist/cjs/SimpleBootHttpSSRFactory.d.ts} +0 -0
- /package/{codes → dist/cjs/codes}/HttpHeaders.d.ts +0 -0
- /package/{codes → dist/cjs/codes}/Mimes.d.ts +0 -0
- /package/{decorators → dist/cjs/decorators}/LoadAroundBefore.d.ts +0 -0
- /package/{decorators → dist/cjs/decorators}/SaveAroundAfter.d.ts +0 -0
- /package/{filters → dist/cjs/filters}/IntentSchemeFilter.d.ts +0 -0
- /package/{filters → dist/cjs/filters}/SSRWorker.d.ts +0 -0
- /package/{initializers → dist/cjs/initializers}/JsdomInitializer.d.ts +0 -0
- /package/{option → dist/cjs/option}/HttpSSRServerOption.d.ts +0 -0
- /package/{proxy → dist/cjs/proxy}/IntentSchemeFrontProxy.d.ts +0 -0
- /package/{proxy → dist/cjs/proxy}/IntentSchemeServerProxy.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntentSchemeServerProxy.d.ts","sourceRoot":"","sources":["../../../src/proxy/IntentSchemeServerProxy.ts"],"names":[],"mappings":"AAEA,qBACa,uBAAwB,YAAW,YAAY,CAAC,GAAG,CAAC;IACxD,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG;CA8B3C"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __decorate = function(decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { getSim, Sim } from "@dooboostore/simple-boot/decorators/SimDecorator";
|
|
8
|
+
let IntentSchemeServerProxy = class IntentSchemeServerProxy2 {
|
|
9
|
+
get(target, prop) {
|
|
10
|
+
const t = target[prop];
|
|
11
|
+
if (typeof t === "function") {
|
|
12
|
+
return (...args) => {
|
|
13
|
+
const simstanceManager = target._SimpleBoot_simstanceManager;
|
|
14
|
+
const simOption = target._SimpleBoot_simOption;
|
|
15
|
+
const config = getSim(target);
|
|
16
|
+
const data = t.apply(target, args);
|
|
17
|
+
if (simstanceManager && simOption && config?.scheme && simOption.window) {
|
|
18
|
+
if (!simOption.window.server_side_data) {
|
|
19
|
+
simOption.window.server_side_data = {};
|
|
20
|
+
}
|
|
21
|
+
const key = config.scheme + "_" + prop;
|
|
22
|
+
if (data instanceof Promise) {
|
|
23
|
+
data.then((it) => {
|
|
24
|
+
simOption.window.server_side_data[key] = JSON.stringify(it);
|
|
25
|
+
return it;
|
|
26
|
+
});
|
|
27
|
+
} else {
|
|
28
|
+
simOption.window.server_side_data[key] = JSON.stringify(data);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return data;
|
|
32
|
+
};
|
|
33
|
+
} else {
|
|
34
|
+
return t;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
IntentSchemeServerProxy = __decorate([
|
|
39
|
+
Sim
|
|
40
|
+
], IntentSchemeServerProxy);
|
|
41
|
+
export {
|
|
42
|
+
IntentSchemeServerProxy
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=IntentSchemeServerProxy.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/proxy/IntentSchemeServerProxy.ts"],
|
|
4
|
+
"sourcesContent": ["import { getSim, Sim } from '@dooboostore/simple-boot/decorators/SimDecorator';\n\n@Sim\nexport class IntentSchemeServerProxy implements ProxyHandler<any> {\n public get(target: any, prop: string): any {\n const t = target[prop];\n if (typeof t === 'function') {\n return (...args: any[]) => {\n\n const simstanceManager = target._SimpleBoot_simstanceManager;\n const simOption = target._SimpleBoot_simOption;\n const config = getSim(target);\n const data = t.apply(target, args);\n if (simstanceManager && simOption && config?.scheme && simOption.window) {\n if (!simOption.window.server_side_data) {\n simOption.window.server_side_data = {};\n }\n const key = config.scheme + '_' + prop;\n if (data instanceof Promise) {\n data.then((it) => {\n simOption.window.server_side_data[key] = JSON.stringify(it);\n return it;\n });\n } else {\n simOption.window.server_side_data[key] = JSON.stringify(data);\n }\n }\n return data;\n }\n } else {\n return t;\n }\n }\n\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;AAAA,SAAS,QAAQ,WAAW;AAGrB,IAAM,0BAAN,MAAMA,yBAAuB;EAC3B,IAAI,QAAa,MAAY;AAClC,UAAM,IAAI,OAAO,IAAI;AACrB,QAAI,OAAO,MAAM,YAAY;AAC3B,aAAO,IAAI,SAAe;AAExB,cAAM,mBAAmB,OAAO;AAChC,cAAM,YAAY,OAAO;AACzB,cAAM,SAAS,OAAO,MAAM;AAC5B,cAAM,OAAO,EAAE,MAAM,QAAQ,IAAI;AACjC,YAAI,oBAAoB,aAAa,QAAQ,UAAU,UAAU,QAAQ;AACvE,cAAI,CAAC,UAAU,OAAO,kBAAkB;AACtC,sBAAU,OAAO,mBAAmB,CAAA;UACtC;AACA,gBAAM,MAAM,OAAO,SAAS,MAAM;AAClC,cAAI,gBAAgB,SAAS;AAC3B,iBAAK,KAAK,CAAC,OAAM;AACf,wBAAU,OAAO,iBAAiB,GAAG,IAAI,KAAK,UAAU,EAAE;AAC1D,qBAAO;YACT,CAAC;UACH,OAAO;AACL,sBAAU,OAAO,iBAAiB,GAAG,IAAI,KAAK,UAAU,IAAI;UAC9D;QACF;AACA,eAAO;MACT;IACF,OAAO;AACL,aAAO;IACT;EACF;;AA7BW,0BAAuB,WAAA;EADnC;GACY,uBAAuB;",
|
|
6
|
+
"names": ["IntentSchemeServerProxy"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ApiService } from '@dooboostore/simple-boot/fetch/ApiService';
|
|
2
|
+
export type Config<T = any> = {
|
|
3
|
+
method?: 'get' | 'post' | 'petch' | 'delete' | 'head';
|
|
4
|
+
multipartFormData?: boolean;
|
|
5
|
+
bypassTransform?: boolean;
|
|
6
|
+
transformText?: boolean;
|
|
7
|
+
headers?: HeadersInit;
|
|
8
|
+
body?: T;
|
|
9
|
+
};
|
|
10
|
+
export declare class SymbolIntentApiServiceProxy<T extends object> implements ProxyHandler<T> {
|
|
11
|
+
private apiService;
|
|
12
|
+
constructor(apiService: ApiService);
|
|
13
|
+
get(target: T, prop: string | symbol, receiver: any): any;
|
|
14
|
+
apply(target: T, thisArg: any, argArray: any[]): any;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=SymbolIntentApiServiceProxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SymbolIntentApiServiceProxy.d.ts","sourceRoot":"","sources":["../../../src/proxy/SymbolIntentApiServiceProxy.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,2CAA2C,CAAC;AAIvE,MAAM,MAAM,MAAM,CAAC,CAAC,GAAG,GAAG,IAAI;IAAE,MAAM,CAAC,EAAC,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAAE,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC;AAG1M,qBAAa,2BAA2B,CAAC,CAAC,SAAS,MAAM,CAAE,YAAW,YAAY,CAAC,CAAC,CAAC;IAGvE,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAG1C,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,GAAG;IAyGzD,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,GAAG;CASrD"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { getSim } from "@dooboostore/simple-boot/decorators/SimDecorator";
|
|
2
|
+
import { makeIntentHeaderBySymbol } from "../codes/HttpHeaders.js";
|
|
3
|
+
import { ConvertUtils } from "@dooboostore/core/convert/ConvertUtils";
|
|
4
|
+
import { ApiService } from "@dooboostore/simple-boot/fetch/ApiService";
|
|
5
|
+
const _ = ApiService;
|
|
6
|
+
class SymbolIntentApiServiceProxy {
|
|
7
|
+
constructor(apiService) {
|
|
8
|
+
this.apiService = apiService;
|
|
9
|
+
}
|
|
10
|
+
get(target, prop, receiver) {
|
|
11
|
+
const simConfig = getSim(target);
|
|
12
|
+
const apiService = this.apiService;
|
|
13
|
+
const value = Reflect.get(target, prop, receiver);
|
|
14
|
+
if (typeof value === "function" && simConfig?.symbol) {
|
|
15
|
+
return function(...args) {
|
|
16
|
+
const f = value;
|
|
17
|
+
const p = (userConfig) => {
|
|
18
|
+
const headers = { ...userConfig?.headers ?? {}, ...makeIntentHeaderBySymbol(simConfig.symbol) };
|
|
19
|
+
const method = userConfig?.method ?? "post";
|
|
20
|
+
if (method === "post" && userConfig?.multipartFormData) {
|
|
21
|
+
return apiService.post({
|
|
22
|
+
target: `/${String(prop)}`,
|
|
23
|
+
config: {
|
|
24
|
+
bypassTransform: userConfig?.bypassTransform,
|
|
25
|
+
transformText: userConfig?.transformText,
|
|
26
|
+
fetch: {
|
|
27
|
+
credentials: "include",
|
|
28
|
+
headers,
|
|
29
|
+
body: ConvertUtils.toFormData(userConfig?.body)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
} else if (method === "post") {
|
|
34
|
+
return apiService.postJson({
|
|
35
|
+
target: `/${String(prop)}`,
|
|
36
|
+
config: {
|
|
37
|
+
bypassTransform: userConfig?.bypassTransform,
|
|
38
|
+
transformText: userConfig?.transformText,
|
|
39
|
+
fetch: {
|
|
40
|
+
credentials: "include",
|
|
41
|
+
headers,
|
|
42
|
+
body: userConfig?.body
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
} else if (method === "petch") {
|
|
47
|
+
return apiService.patchJson({
|
|
48
|
+
target: `/${String(prop)}`,
|
|
49
|
+
config: {
|
|
50
|
+
bypassTransform: userConfig?.bypassTransform,
|
|
51
|
+
transformText: userConfig?.transformText,
|
|
52
|
+
fetch: {
|
|
53
|
+
credentials: "include",
|
|
54
|
+
headers,
|
|
55
|
+
body: userConfig?.body
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
} else {
|
|
60
|
+
return apiService[method]({
|
|
61
|
+
// return apiService.head({
|
|
62
|
+
target: { url: `/${String(prop)}`, searchParams: userConfig?.body },
|
|
63
|
+
config: {
|
|
64
|
+
bypassTransform: userConfig?.bypassTransform,
|
|
65
|
+
transformText: userConfig?.transformText,
|
|
66
|
+
fetch: {
|
|
67
|
+
credentials: "include",
|
|
68
|
+
headers
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
args.push(p);
|
|
75
|
+
return Reflect.apply(f, target, args);
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return Reflect.get(target, prop, receiver);
|
|
79
|
+
}
|
|
80
|
+
apply(target, thisArg, argArray) {
|
|
81
|
+
console.log("SymbolIntentApiServiceProxy apply");
|
|
82
|
+
return Reflect.apply(target, thisArg, argArray);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
SymbolIntentApiServiceProxy
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=SymbolIntentApiServiceProxy.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/proxy/SymbolIntentApiServiceProxy.ts"],
|
|
4
|
+
"sourcesContent": ["import { getSim, Sim } from '@dooboostore/simple-boot/decorators/SimDecorator';\nimport { makeIntentHeaderBySymbol } from '../codes/HttpHeaders';\nimport { ConvertUtils } from '@dooboostore/core/convert/ConvertUtils';\nimport { ApiService } from '@dooboostore/simple-boot/fetch/ApiService';\nimport { Inject } from '@dooboostore/simple-boot/decorators/inject/Inject';\n\n\nexport type Config<T = any> = { method?:'get' | 'post' | 'petch' | 'delete' | 'head', multipartFormData?: boolean, bypassTransform?: boolean; transformText?: boolean, headers?: HeadersInit, body?: T };\nconst _ = ApiService;\n// @Sim\nexport class SymbolIntentApiServiceProxy<T extends object> implements ProxyHandler<T> {\n\n\n constructor(private apiService: ApiService) {\n }\n\n get(target: T, prop: string | symbol, receiver: any): any {\n const simConfig = getSim(target)\n const apiService = this.apiService;\n const value = Reflect.get(target, prop, receiver);\n if (typeof value === 'function' && simConfig?.symbol) {\n return function (...args: any[]) {\n const f = value as Function;\n const p = (userConfig: Config) => {\n\n const headers = {...(userConfig?.headers ?? {}), ...makeIntentHeaderBySymbol(simConfig.symbol as Symbol)};\n const method = userConfig?.method ?? 'post';\n if(method === 'post' && userConfig?.multipartFormData) {\n return apiService.post({\n target: `/${String(prop)}`,\n config: {\n bypassTransform: userConfig?.bypassTransform,\n transformText: userConfig?.transformText,\n fetch: {\n credentials: 'include',\n headers: headers,\n body: ConvertUtils.toFormData(userConfig?.body)\n }\n }\n });\n } else if (method === 'post') {\n return apiService.postJson({\n target: `/${String(prop)}`,\n config: {\n bypassTransform: userConfig?.bypassTransform,\n transformText: userConfig?.transformText,\n fetch: {\n credentials: 'include',\n headers: headers,\n body: userConfig?.body\n }\n }\n });\n }else if (method === 'petch') {\n return apiService.patchJson({\n target: `/${String(prop)}`,\n config: {\n bypassTransform: userConfig?.bypassTransform,\n transformText: userConfig?.transformText,\n fetch: {\n credentials: 'include',\n headers: headers,\n body: userConfig?.body\n }\n }\n });\n } else {\n return apiService[method]({\n // return apiService.head({\n target: {url: `/${String(prop)}`, searchParams: userConfig?.body},\n config: {\n bypassTransform: userConfig?.bypassTransform,\n transformText: userConfig?.transformText,\n fetch: {\n credentials: 'include',\n headers: headers,\n }\n }\n });\n }\n\n\n\n\n // if (userConfig?.multipartFormData) {\n // return apiService.post({\n // target: `/${String(prop)}`,\n // config: {\n // bypassTransform: userConfig?.bypassTransform,\n // transformText: userConfig?.transformText,\n // fetch: {\n // credentials: 'include',\n // headers: headers,\n // body: ConvertUtils.toFormData(userConfig?.body)\n // }\n // }\n // });\n // } else {\n // return apiService.postJson({\n // target: `/${String(prop)}`,\n // config: {\n // bypassTransform: userConfig?.bypassTransform,\n // transformText: userConfig?.transformText,\n // fetch: {\n // credentials: 'include',\n // headers: headers,\n // body: userConfig?.body\n // }\n // }\n // });\n // }\n\n };\n args.push(p);\n return Reflect.apply(f, target, args);\n // return f.apply(target, args);\n }\n }\n return Reflect.get(target, prop, receiver);\n }\n\n apply(target: T, thisArg: any, argArray: any[]): any {\n console.log('SymbolIntentApiServiceProxy apply')\n // @ts-ignore\n return Reflect.apply(target, thisArg, argArray);\n }\n\n\n\n\n}"],
|
|
5
|
+
"mappings": "AAAA,SAAS,cAAmB;AAC5B,SAAS,gCAAgC;AACzC,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAK3B,MAAM,IAAI;AAEH,MAAM,4BAAyE;AAAA,EAGpF,YAAoB,YAAwB;AAAxB;AAAA,EACpB;AAAA,EAEA,IAAI,QAAW,MAAuB,UAAoB;AACxD,UAAM,YAAY,OAAO,MAAM;AAC/B,UAAM,aAAa,KAAK;AACxB,UAAM,QAAQ,QAAQ,IAAI,QAAQ,MAAM,QAAQ;AAChD,QAAI,OAAO,UAAU,cAAc,WAAW,QAAQ;AACpD,aAAO,YAAa,MAAa;AAC/B,cAAM,IAAI;AACV,cAAM,IAAI,CAAC,eAAuB;AAEhC,gBAAM,UAAU,EAAC,GAAI,YAAY,WAAW,CAAC,GAAI,GAAG,yBAAyB,UAAU,MAAgB,EAAC;AACxG,gBAAM,SAAS,YAAY,UAAU;AACrC,cAAG,WAAW,UAAU,YAAY,mBAAmB;AACrD,mBAAO,WAAW,KAAK;AAAA,cACrB,QAAQ,IAAI,OAAO,IAAI,CAAC;AAAA,cACxB,QAAQ;AAAA,gBACN,iBAAiB,YAAY;AAAA,gBAC7B,eAAe,YAAY;AAAA,gBAC3B,OAAO;AAAA,kBACL,aAAa;AAAA,kBACb;AAAA,kBACA,MAAM,aAAa,WAAW,YAAY,IAAI;AAAA,gBAChD;AAAA,cACF;AAAA,YACF,CAAC;AAAA,UACH,WAAW,WAAW,QAAQ;AAC5B,mBAAO,WAAW,SAAS;AAAA,cACzB,QAAQ,IAAI,OAAO,IAAI,CAAC;AAAA,cACxB,QAAQ;AAAA,gBACN,iBAAiB,YAAY;AAAA,gBAC7B,eAAe,YAAY;AAAA,gBAC3B,OAAO;AAAA,kBACL,aAAa;AAAA,kBACb;AAAA,kBACA,MAAM,YAAY;AAAA,gBACpB;AAAA,cACF;AAAA,YACF,CAAC;AAAA,UACH,WAAU,WAAW,SAAS;AAC5B,mBAAO,WAAW,UAAU;AAAA,cAC1B,QAAQ,IAAI,OAAO,IAAI,CAAC;AAAA,cACxB,QAAQ;AAAA,gBACN,iBAAiB,YAAY;AAAA,gBAC7B,eAAe,YAAY;AAAA,gBAC3B,OAAO;AAAA,kBACL,aAAa;AAAA,kBACb;AAAA,kBACA,MAAM,YAAY;AAAA,gBACpB;AAAA,cACF;AAAA,YACF,CAAC;AAAA,UACH,OAAO;AACL,mBAAO,WAAW,MAAM,EAAE;AAAA;AAAA,cAExB,QAAQ,EAAC,KAAK,IAAI,OAAO,IAAI,CAAC,IAAI,cAAc,YAAY,KAAI;AAAA,cAChE,QAAQ;AAAA,gBACN,iBAAiB,YAAY;AAAA,gBAC7B,eAAe,YAAY;AAAA,gBAC3B,OAAO;AAAA,kBACL,aAAa;AAAA,kBACb;AAAA,gBACF;AAAA,cACF;AAAA,YACF,CAAC;AAAA,UACH;AAAA,QAiCF;AACA,aAAK,KAAK,CAAC;AACX,eAAO,QAAQ,MAAM,GAAG,QAAQ,IAAI;AAAA,MAEtC;AAAA,IACF;AACA,WAAO,QAAQ,IAAI,QAAQ,MAAM,QAAQ;AAAA,EAC3C;AAAA,EAEA,MAAM,QAAW,SAAc,UAAsB;AACnD,YAAQ,IAAI,mCAAmC;AAE/C,WAAO,QAAQ,MAAM,QAAQ,SAAS,QAAQ;AAAA,EAChD;AAKF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApiService } from '@dooboostore/simple-boot/fetch/ApiService';
|
|
2
|
+
export type SymbolIntentApiServiceProxyBaseConfig<T = any> = {
|
|
3
|
+
method?: 'get' | 'post' | 'petch' | 'delete' | 'head';
|
|
4
|
+
multipartFormData?: boolean;
|
|
5
|
+
bypassTransform?: boolean;
|
|
6
|
+
transformText?: boolean;
|
|
7
|
+
headers?: HeadersInit;
|
|
8
|
+
body?: T;
|
|
9
|
+
};
|
|
10
|
+
export declare class SymbolIntentApiServiceProxyBase<T extends object = any> {
|
|
11
|
+
constructor(apiService: ApiService);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=SymbolIntentApiServiceProxyBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SymbolIntentApiServiceProxyBase.d.ts","sourceRoot":"","sources":["../../../src/proxy/SymbolIntentApiServiceProxyBase.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,2CAA2C,CAAC;AAGvE,MAAM,MAAM,qCAAqC,CAAC,CAAC,GAAG,GAAG,IAAI;IAAE,MAAM,CAAC,EAAC,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAAE,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,WAAW,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC;AAEzO,qBAAa,+BAA+B,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG;gBAG/D,UAAU,EAAE,UAAU;CAqFzB"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { getSim } from "@dooboostore/simple-boot/decorators/SimDecorator";
|
|
2
|
+
import { makeIntentHeaderBySymbol } from "../codes/HttpHeaders.js";
|
|
3
|
+
import { ConvertUtils } from "@dooboostore/core/convert/ConvertUtils";
|
|
4
|
+
class SymbolIntentApiServiceProxyBase {
|
|
5
|
+
// 생성자는 프록시될 대상 객체(target)와 의존성을 주입받습니다.
|
|
6
|
+
constructor(apiService) {
|
|
7
|
+
const handler = {
|
|
8
|
+
get(target, prop, receiver) {
|
|
9
|
+
const simConfig = getSim(target);
|
|
10
|
+
const value = Reflect.get(target, prop, receiver);
|
|
11
|
+
if (typeof value === "function" && simConfig?.symbol) {
|
|
12
|
+
return function(...args) {
|
|
13
|
+
const f = value;
|
|
14
|
+
const p = (userConfig) => {
|
|
15
|
+
const headers = { ...userConfig?.headers ?? {}, ...makeIntentHeaderBySymbol(simConfig.symbol) };
|
|
16
|
+
const method = userConfig?.method ?? "post";
|
|
17
|
+
if (method === "post" && userConfig?.multipartFormData) {
|
|
18
|
+
return apiService.post({
|
|
19
|
+
target: `/${String(prop)}`,
|
|
20
|
+
config: {
|
|
21
|
+
bypassTransform: userConfig?.bypassTransform,
|
|
22
|
+
transformText: userConfig?.transformText,
|
|
23
|
+
fetch: {
|
|
24
|
+
credentials: "include",
|
|
25
|
+
headers,
|
|
26
|
+
body: ConvertUtils.toFormData(userConfig?.body)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
} else if (method === "post") {
|
|
31
|
+
return apiService.postJson({
|
|
32
|
+
target: `/${String(prop)}`,
|
|
33
|
+
config: {
|
|
34
|
+
bypassTransform: userConfig?.bypassTransform,
|
|
35
|
+
transformText: userConfig?.transformText,
|
|
36
|
+
fetch: {
|
|
37
|
+
credentials: "include",
|
|
38
|
+
headers,
|
|
39
|
+
body: userConfig?.body
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
} else if (method === "petch") {
|
|
44
|
+
return apiService.patchJson({
|
|
45
|
+
target: `/${String(prop)}`,
|
|
46
|
+
config: {
|
|
47
|
+
bypassTransform: userConfig?.bypassTransform,
|
|
48
|
+
transformText: userConfig?.transformText,
|
|
49
|
+
fetch: {
|
|
50
|
+
credentials: "include",
|
|
51
|
+
headers,
|
|
52
|
+
body: userConfig?.body
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
} else {
|
|
57
|
+
return apiService[method]({
|
|
58
|
+
target: { url: `/${String(prop)}`, searchParams: userConfig?.body },
|
|
59
|
+
config: {
|
|
60
|
+
bypassTransform: userConfig?.bypassTransform,
|
|
61
|
+
transformText: userConfig?.transformText,
|
|
62
|
+
fetch: {
|
|
63
|
+
credentials: "include",
|
|
64
|
+
headers
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
args.push(p);
|
|
71
|
+
return Reflect.apply(f, target, args);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return Reflect.get(target, prop, receiver);
|
|
75
|
+
},
|
|
76
|
+
apply(target, thisArg, argArray) {
|
|
77
|
+
console.log("SymbolIntentApiServiceProxyBase apply (from handler)");
|
|
78
|
+
return Reflect.apply(target, thisArg, argArray);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
return new Proxy(this, handler);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
SymbolIntentApiServiceProxyBase
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=SymbolIntentApiServiceProxyBase.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/proxy/SymbolIntentApiServiceProxyBase.ts"],
|
|
4
|
+
"sourcesContent": ["import { getSim, Sim } from '@dooboostore/simple-boot/decorators/SimDecorator';\nimport { makeIntentHeaderBySymbol } from '../codes/HttpHeaders';\nimport { ConvertUtils } from '@dooboostore/core/convert/ConvertUtils';\nimport { ApiService } from '@dooboostore/simple-boot/fetch/ApiService';\n\n\nexport type SymbolIntentApiServiceProxyBaseConfig<T = any> = { method?:'get' | 'post' | 'petch' | 'delete' | 'head', multipartFormData?: boolean, bypassTransform?: boolean; transformText?: boolean, headers?: HeadersInit, body?: T };\n\nexport class SymbolIntentApiServiceProxyBase<T extends object = any> {\n // \uC0DD\uC131\uC790\uB294 \uD504\uB85D\uC2DC\uB420 \uB300\uC0C1 \uAC1D\uCCB4(target)\uC640 \uC758\uC874\uC131\uC744 \uC8FC\uC785\uBC1B\uC2B5\uB2C8\uB2E4.\n constructor(\n apiService: ApiService,\n ) {\n // ProxyHandler \uAC1D\uCCB4\uB97C \uC815\uC758\uD569\uB2C8\uB2E4.\n const handler: ProxyHandler<T> = {\n get(target: T, prop: string | symbol, receiver: any): any {\n const simConfig = getSim(target)\n const value = Reflect.get(target, prop, receiver);\n if (typeof value === 'function' && simConfig?.symbol) {\n return function (...args: any[]) {\n const f = value as Function;\n const p = (userConfig: SymbolIntentApiServiceProxyBaseConfig) => {\n const headers = {...(userConfig?.headers ?? {}), ...makeIntentHeaderBySymbol(simConfig.symbol as Symbol)};\n const method = userConfig?.method ?? 'post';\n if(method === 'post' && userConfig?.multipartFormData) {\n return apiService.post({\n target: `/${String(prop)}`,\n config: {\n bypassTransform: userConfig?.bypassTransform,\n transformText: userConfig?.transformText,\n fetch: {\n credentials: 'include',\n headers: headers,\n body: ConvertUtils.toFormData(userConfig?.body)\n }\n }\n });\n } else if (method === 'post') {\n return apiService.postJson({\n target: `/${String(prop)}`,\n config: {\n bypassTransform: userConfig?.bypassTransform,\n transformText: userConfig?.transformText,\n fetch: {\n credentials: 'include',\n headers: headers,\n body: userConfig?.body\n }\n }\n });\n }else if (method === 'petch') {\n return apiService.patchJson({\n target: `/${String(prop)}`,\n config: {\n bypassTransform: userConfig?.bypassTransform,\n transformText: userConfig?.transformText,\n fetch: {\n credentials: 'include',\n headers: headers,\n body: userConfig?.body\n }\n }\n });\n } else {\n return apiService[method]({\n target: {url: `/${String(prop)}`, searchParams: userConfig?.body},\n config: {\n bypassTransform: userConfig?.bypassTransform,\n transformText: userConfig?.transformText,\n fetch: {\n credentials: 'include',\n headers: headers,\n }\n }\n });\n }\n };\n args.push(p);\n return Reflect.apply(f, target, args);\n }\n }\n return Reflect.get(target, prop, receiver);\n },\n\n apply(target: T, thisArg: any, argArray: any[]): any {\n console.log('SymbolIntentApiServiceProxyBase apply (from handler)');\n // @ts-ignore\n return Reflect.apply(target, thisArg, argArray);\n }\n };\n\n // \uC0DD\uC131\uC790\uC5D0\uC11C Proxy \uAC1D\uCCB4\uB97C \uBC18\uD658\uD569\uB2C8\uB2E4.\n\n // @ts-ignore\n return new Proxy(this, handler);\n }\n}"],
|
|
5
|
+
"mappings": "AAAA,SAAS,cAAmB;AAC5B,SAAS,gCAAgC;AACzC,SAAS,oBAAoB;AAMtB,MAAM,gCAAwD;AAAA;AAAA,EAEnE,YACE,YACA;AAEA,UAAM,UAA2B;AAAA,MAC/B,IAAI,QAAW,MAAuB,UAAoB;AACxD,cAAM,YAAY,OAAO,MAAM;AAC/B,cAAM,QAAQ,QAAQ,IAAI,QAAQ,MAAM,QAAQ;AAChD,YAAI,OAAO,UAAU,cAAc,WAAW,QAAQ;AACpD,iBAAO,YAAa,MAAa;AAC/B,kBAAM,IAAI;AACV,kBAAM,IAAI,CAAC,eAAsD;AAC/D,oBAAM,UAAU,EAAC,GAAI,YAAY,WAAW,CAAC,GAAI,GAAG,yBAAyB,UAAU,MAAgB,EAAC;AACxG,oBAAM,SAAS,YAAY,UAAU;AACrC,kBAAG,WAAW,UAAU,YAAY,mBAAmB;AACrD,uBAAO,WAAW,KAAK;AAAA,kBACrB,QAAQ,IAAI,OAAO,IAAI,CAAC;AAAA,kBACxB,QAAQ;AAAA,oBACN,iBAAiB,YAAY;AAAA,oBAC7B,eAAe,YAAY;AAAA,oBAC3B,OAAO;AAAA,sBACL,aAAa;AAAA,sBACb;AAAA,sBACA,MAAM,aAAa,WAAW,YAAY,IAAI;AAAA,oBAChD;AAAA,kBACF;AAAA,gBACF,CAAC;AAAA,cACH,WAAW,WAAW,QAAQ;AAC5B,uBAAO,WAAW,SAAS;AAAA,kBACzB,QAAQ,IAAI,OAAO,IAAI,CAAC;AAAA,kBACxB,QAAQ;AAAA,oBACN,iBAAiB,YAAY;AAAA,oBAC7B,eAAe,YAAY;AAAA,oBAC3B,OAAO;AAAA,sBACL,aAAa;AAAA,sBACb;AAAA,sBACA,MAAM,YAAY;AAAA,oBACpB;AAAA,kBACF;AAAA,gBACF,CAAC;AAAA,cACH,WAAU,WAAW,SAAS;AAC5B,uBAAO,WAAW,UAAU;AAAA,kBAC1B,QAAQ,IAAI,OAAO,IAAI,CAAC;AAAA,kBACxB,QAAQ;AAAA,oBACN,iBAAiB,YAAY;AAAA,oBAC7B,eAAe,YAAY;AAAA,oBAC3B,OAAO;AAAA,sBACL,aAAa;AAAA,sBACb;AAAA,sBACA,MAAM,YAAY;AAAA,oBACpB;AAAA,kBACF;AAAA,gBACF,CAAC;AAAA,cACH,OAAO;AACL,uBAAO,WAAW,MAAM,EAAE;AAAA,kBACxB,QAAQ,EAAC,KAAK,IAAI,OAAO,IAAI,CAAC,IAAI,cAAc,YAAY,KAAI;AAAA,kBAChE,QAAQ;AAAA,oBACN,iBAAiB,YAAY;AAAA,oBAC7B,eAAe,YAAY;AAAA,oBAC3B,OAAO;AAAA,sBACL,aAAa;AAAA,sBACb;AAAA,oBACF;AAAA,kBACF;AAAA,gBACF,CAAC;AAAA,cACH;AAAA,YACF;AACA,iBAAK,KAAK,CAAC;AACX,mBAAO,QAAQ,MAAM,GAAG,QAAQ,IAAI;AAAA,UACtC;AAAA,QACF;AACA,eAAO,QAAQ,IAAI,QAAQ,MAAM,QAAQ;AAAA,MAC3C;AAAA,MAEA,MAAM,QAAW,SAAc,UAAsB;AACnD,gBAAQ,IAAI,sDAAsD;AAElE,eAAO,QAAQ,MAAM,QAAQ,SAAS,QAAQ;AAAA,MAChD;AAAA,IACF;AAKA,WAAO,IAAI,MAAM,MAAM,OAAO;AAAA,EAChC;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/proxy/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/proxy/index.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './IntentSchemeFrontProxy';\nexport * from './IntentSchemeServerProxy';\nexport * from './SymbolIntentApiServiceProxy';\nexport * from './SymbolIntentApiServiceProxyBase';"],
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["// export * from './SimpleBootHttpSSRFactory';\n// export * from './SimpleBootHttpSSRServer';\n// export * from './codes';\n// export * from './decorators';\n// export * from './filters';\n// export * from './initializers';\n// export * from './option';\n// export * from './proxy';\nexport default {\n\n}"],
|
|
5
|
+
"mappings": ";AAQA,IAAO,cAAQ,CAEf;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var dooboostoreSimpleBootHttpServerSsr = (() => {
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
default: () => src_default
|
|
24
|
+
});
|
|
25
|
+
var src_default = {};
|
|
26
|
+
return __toCommonJS(src_exports);
|
|
27
|
+
})();
|
|
28
|
+
//# sourceMappingURL=dooboostore-simple-boot-http-server-ssr.umd.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["// export * from './SimpleBootHttpSSRFactory';\n// export * from './SimpleBootHttpSSRServer';\n// export * from './codes';\n// export * from './decorators';\n// export * from './filters';\n// export * from './initializers';\n// export * from './option';\n// export * from './proxy';\nexport default {\n\n}"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAQA,MAAO,cAAQ,CAEf;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dooboostore/simple-boot-http-server-ssr",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"main": "dist/index.js",
|
|
5
|
-
"types": "dist/index.d.ts",
|
|
3
|
+
"version": "1.0.11",
|
|
6
4
|
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/cjs/index.js",
|
|
7
|
+
"module": "./dist/esm/index.js",
|
|
8
|
+
"types": "./dist/esm/index.d.ts",
|
|
7
9
|
"description": "front end SPA frameworks SSR",
|
|
8
10
|
"files": [
|
|
9
|
-
"
|
|
10
|
-
"**/*.d.ts"
|
|
11
|
+
"dist"
|
|
11
12
|
],
|
|
12
|
-
"publishConfig": {
|
|
13
|
-
"access": "public"
|
|
14
|
-
},
|
|
15
13
|
"keywords": [
|
|
16
14
|
"front",
|
|
17
15
|
"spa",
|
|
@@ -21,6 +19,21 @@
|
|
|
21
19
|
"framwork",
|
|
22
20
|
"node"
|
|
23
21
|
],
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/esm/index.d.ts",
|
|
25
|
+
"import": "./dist/esm/index.js",
|
|
26
|
+
"require": "./dist/cjs/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./*": {
|
|
29
|
+
"types": "./dist/esm/*.d.ts",
|
|
30
|
+
"import": "./dist/esm/*.js",
|
|
31
|
+
"require": "./dist/cjs/*.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
24
37
|
"author": "dooboostore <dooboostore@gmail.com> (https://github.com/dooboostore)",
|
|
25
38
|
"contributors": [
|
|
26
39
|
"sewoo <sewooimda@nate.com> (https://github.com/sewoo)",
|
|
@@ -38,49 +51,51 @@
|
|
|
38
51
|
"type": "git",
|
|
39
52
|
"url": "https://github.com/dooboostore-develop/packages"
|
|
40
53
|
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"reflect-metadata": "^0.2.2",
|
|
56
|
+
"@dooboostore/core": "1.0.18",
|
|
57
|
+
"@dooboostore/core-web": "1.0.5",
|
|
58
|
+
"@dooboostore/core-node": "1.0.6",
|
|
59
|
+
"@dooboostore/simple-boot": "1.0.48",
|
|
60
|
+
"@dooboostore/dom-render": "1.0.107",
|
|
61
|
+
"@dooboostore/simple-boot-front": "1.0.126",
|
|
62
|
+
"@dooboostore/simple-boot-http-server": "1.0.19"
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"jsdom": "^26.0.0"
|
|
66
|
+
},
|
|
41
67
|
"devDependencies": {
|
|
42
|
-
"@types/
|
|
68
|
+
"@types/jsdom": "^21.1.7",
|
|
69
|
+
"@babel/core": "^7.24.0",
|
|
70
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
71
|
+
"@babel/plugin-proposal-decorators": "^7.24.0",
|
|
72
|
+
"@babel/plugin-transform-private-property-in-object": "^7.25.9",
|
|
73
|
+
"@babel/preset-env": "^7.24.0",
|
|
74
|
+
"@babel/preset-typescript": "^7.24.0",
|
|
43
75
|
"@types/jest": "^26.0.22",
|
|
44
|
-
"
|
|
45
|
-
"@types/mime-types": "^2.1.1",
|
|
76
|
+
"raw-loader": "^4.0.2",
|
|
46
77
|
"@typescript-eslint/eslint-plugin": "^4.16.1",
|
|
47
78
|
"@typescript-eslint/parser": "^4.16.1",
|
|
48
|
-
"eslint": "^7.21.0",
|
|
49
|
-
"eslint-config-standard": "^16.0.2",
|
|
50
|
-
"eslint-plugin-import": "^2.22.1",
|
|
51
|
-
"eslint-plugin-node": "^11.1.0",
|
|
52
|
-
"eslint-plugin-promise": "^4.3.1",
|
|
53
|
-
"jest": "^26.6.3",
|
|
54
|
-
"supertest": "^6.1.3",
|
|
55
|
-
"ts-jest": "^26.5.4",
|
|
56
|
-
"@types/node": "^20",
|
|
57
79
|
"tslib": "^2.8.1",
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"@dooboostore/core": "1.0.8",
|
|
64
|
-
"@dooboostore/core-web": "1.0.1",
|
|
65
|
-
"@dooboostore/simple-boot": "1.0.44",
|
|
66
|
-
"@dooboostore/core-node": "1.0.1",
|
|
67
|
-
"@dooboostore/dom-render": "1.0.102",
|
|
68
|
-
"@dooboostore/simple-boot-front": "1.0.121",
|
|
69
|
-
"@dooboostore/simple-boot-http-server": "1.0.16"
|
|
80
|
+
"@types/node": "^20",
|
|
81
|
+
"typescript": "^5.9.2",
|
|
82
|
+
"@types/node-gzip": "^1.1.0",
|
|
83
|
+
"esbuild-plugin-tsc": "^0.5.0",
|
|
84
|
+
"esbuild": "^0.23.0"
|
|
70
85
|
},
|
|
71
86
|
"scripts": {
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
87
|
+
"clean": "rm -rf dist",
|
|
88
|
+
"build:esm": "node build.mjs esm && tsc -p tsconfig.esm.json --emitDeclarationOnly",
|
|
89
|
+
"watch:esm": "pnpm run build:esm && node build.mjs esm --watch",
|
|
90
|
+
"build:cjs": "node build.mjs cjs && tsc -p tsconfig.cjs.json --emitDeclarationOnly && cp package.cjs.json dist/cjs/package.json",
|
|
91
|
+
"watch:cjs": "pnpm run build:cjs && node build.mjs cjs --watch",
|
|
92
|
+
"build": "pnpm run clean && node build.mjs all && tsc -p tsconfig.esm.json --emitDeclarationOnly && tsc -p tsconfig.cjs.json --emitDeclarationOnly && cp package.cjs.json dist/cjs/package.json",
|
|
93
|
+
"build:umd-bundle": "node build.mjs umd-bundle",
|
|
94
|
+
"watch:umd-bundle": "pnpm run build:umd-bundle && node build.mjs umd-bundle --watch",
|
|
95
|
+
"build:esm-bundle": "node build.mjs esm-bundle",
|
|
96
|
+
"watch:esm-bundle": "pnpm run build:esm-bundle && node build.mjs esm-bundle --watch",
|
|
97
|
+
"publish:npm": "pnpm run build && cp package.json package.json.back && pnpm pack && TARBALL_NAME=$(ls dooboostore-simple-boot-http-server-ssr-*.tgz | head -n 1) && tar -xzf \"$TARBALL_NAME\" -C . --strip-components=1 package/package.json && rm \"$TARBALL_NAME\" && (pnpm publish --no-git-checks || true) && cp package.json.back package.json && rm -rf package.json.back ",
|
|
98
|
+
"typecheck": "tsc --noEmit",
|
|
99
|
+
"test": "echo test"
|
|
85
100
|
}
|
|
86
101
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { __awaiter } from "tslib";
|
|
2
|
-
export class SimpleBootHttpSSRFactory {
|
|
3
|
-
create(simFrontOption_1) {
|
|
4
|
-
return __awaiter(this, arguments, void 0, function* (simFrontOption, using = [], domExcludes = []) {
|
|
5
|
-
const front = yield this.factory(simFrontOption, using, domExcludes);
|
|
6
|
-
return front;
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=SimpleBootHttpSSRFactory.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SimpleBootHttpServer } from '@dooboostore/simple-boot-http-server/SimpleBootHttpServer';
|
|
2
|
-
export class SimpleBootHttpSSRServer extends SimpleBootHttpServer {
|
|
3
|
-
constructor(option) {
|
|
4
|
-
super(option);
|
|
5
|
-
}
|
|
6
|
-
run(otherInstanceSim) {
|
|
7
|
-
const oi = new Map();
|
|
8
|
-
otherInstanceSim === null || otherInstanceSim === void 0 ? void 0 : otherInstanceSim.forEach((value, key) => oi.set(key, value));
|
|
9
|
-
return super.run(oi);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=SimpleBootHttpSSRServer.js.map
|
package/codes/HttpHeaders.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { HttpHeaders as AHttpHeaders } from '@dooboostore/simple-boot-http-server/codes/HttpHeaders';
|
|
2
|
-
import { Mimes } from './Mimes';
|
|
3
|
-
export const HttpHeaders = Object.assign(Object.assign({}, AHttpHeaders), { XSimpleBootSsrIntentScheme: 'x-simple-boot-ssr-intent-scheme' });
|
|
4
|
-
export const makeIntentHeaderBySymbol = (symbol) => {
|
|
5
|
-
return {
|
|
6
|
-
[HttpHeaders.Accept]: Mimes.ApplicationJsonPostSimpleBootSsrIntentScheme,
|
|
7
|
-
[HttpHeaders.XSimpleBootSsrIntentScheme]: `Symbol.for(${symbol.description})`
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=HttpHeaders.js.map
|
package/codes/Mimes.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { Mimes as AMimes } from '@dooboostore/simple-boot-http-server/codes/Mimes';
|
|
2
|
-
export const Mimes = Object.assign(Object.assign({}, AMimes), { ApplicationJsonPostSimpleBootSsrIntentScheme: 'application/json-post+simple-boot-ssr-intent-scheme', Intent: 'intent' });
|
|
3
|
-
//# sourceMappingURL=Mimes.js.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { getSim } from '@dooboostore/simple-boot/decorators/SimDecorator';
|
|
2
|
-
import { AroundForceReturn } from '@dooboostore/simple-boot/decorators/aop/AOPDecorator';
|
|
3
|
-
import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';
|
|
4
|
-
export const LoadAroundBefore = (obj, propertyKey, args) => {
|
|
5
|
-
var _a, _b, _c;
|
|
6
|
-
const simstanceManager = obj._SimpleBoot_simstanceManager;
|
|
7
|
-
const simOption = obj._SimpleBoot_simOption;
|
|
8
|
-
const config = getSim(obj);
|
|
9
|
-
if (simstanceManager && simOption && (config === null || config === void 0 ? void 0 : config.scheme)) {
|
|
10
|
-
const key = config.scheme + '_' + propertyKey;
|
|
11
|
-
const type = ReflectUtils.getReturnType(obj, propertyKey);
|
|
12
|
-
const isHas = (key in ((_a = simOption.window.server_side_data) !== null && _a !== void 0 ? _a : {}));
|
|
13
|
-
if (isHas) {
|
|
14
|
-
const data = (_b = simOption.window.server_side_data) === null || _b === void 0 ? void 0 : _b[key];
|
|
15
|
-
(_c = simOption.window.server_side_data) === null || _c === void 0 ? true : delete _c[key];
|
|
16
|
-
let rdata;
|
|
17
|
-
if (type === Promise) {
|
|
18
|
-
rdata = Promise.resolve(data);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
rdata = data;
|
|
22
|
-
}
|
|
23
|
-
throw new AroundForceReturn(rdata);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
return args;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return args;
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=LoadAroundBefore.js.map
|