@plyaz/core 1.18.1 → 1.18.3
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/dist/frameworks/index.cjs +11 -11
- package/dist/frameworks/index.cjs.map +1 -1
- package/dist/frameworks/index.mjs +11 -11
- package/dist/frameworks/index.mjs.map +1 -1
- package/dist/frameworks/nextjs/index.cjs +11 -11
- package/dist/frameworks/nextjs/index.cjs.map +1 -1
- package/dist/frameworks/nextjs/index.mjs +11 -11
- package/dist/frameworks/nextjs/index.mjs.map +1 -1
- package/dist/frameworks/nextjs/route-factory.d.ts.map +1 -1
- package/dist/index.cjs +11 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +11 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -6118,21 +6118,21 @@ function getStatusForMethod(method) {
|
|
|
6118
6118
|
}
|
|
6119
6119
|
}
|
|
6120
6120
|
__name(getStatusForMethod, "getStatusForMethod");
|
|
6121
|
-
function getInjectedServices() {
|
|
6121
|
+
function getInjectedServices(coreInstance) {
|
|
6122
6122
|
return {
|
|
6123
|
-
db:
|
|
6124
|
-
cache:
|
|
6125
|
-
storage:
|
|
6126
|
-
notifications:
|
|
6127
|
-
api:
|
|
6123
|
+
db: coreInstance.db,
|
|
6124
|
+
cache: coreInstance.cache,
|
|
6125
|
+
storage: coreInstance.storage,
|
|
6126
|
+
notifications: coreInstance.notifications,
|
|
6127
|
+
api: coreInstance.api
|
|
6128
6128
|
};
|
|
6129
6129
|
}
|
|
6130
6130
|
__name(getInjectedServices, "getInjectedServices");
|
|
6131
6131
|
function createServiceGetter(service, getCore) {
|
|
6132
6132
|
return async () => {
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
return
|
|
6133
|
+
const coreInstance = getCore ? await getCore() : Core;
|
|
6134
|
+
const svc = typeof service === "function" ? await service() : ServiceRegistry.get(service);
|
|
6135
|
+
return { service: svc, core: coreInstance };
|
|
6136
6136
|
};
|
|
6137
6137
|
}
|
|
6138
6138
|
__name(createServiceGetter, "createServiceGetter");
|
|
@@ -6165,13 +6165,13 @@ function createNextApiRoute(config) {
|
|
|
6165
6165
|
function createHandler(method, handler) {
|
|
6166
6166
|
return ServerErrorMiddleware.withErrorHandler(
|
|
6167
6167
|
async (request, context) => {
|
|
6168
|
-
const svc = await getService();
|
|
6168
|
+
const { service: svc, core: coreInstance } = await getService();
|
|
6169
6169
|
const routeContext = context;
|
|
6170
6170
|
const params = routeContext?.params ? await routeContext.params : {};
|
|
6171
6171
|
const query = parseQueryParams(request);
|
|
6172
6172
|
const headers = parseHeaders(request);
|
|
6173
6173
|
const body = await parseMutationBody(request, method);
|
|
6174
|
-
const services = injectServices ? getInjectedServices() : emptyServices;
|
|
6174
|
+
const services = injectServices ? getInjectedServices(coreInstance) : emptyServices;
|
|
6175
6175
|
const ctx = {
|
|
6176
6176
|
params,
|
|
6177
6177
|
query,
|