akanjs 2.3.10 → 2.3.11-rc.1
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/document/into.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { DocumentModel, QueryOf } from "akanjs/constant";
|
|
|
4
4
|
import type { FilterCls, FilterQueryOf, FilterSortOf, SchemaOf } from ".";
|
|
5
5
|
import type { CacheDatabase, QueryMethodPart } from "./database";
|
|
6
6
|
import type { DataLoader } from "./dataLoader";
|
|
7
|
-
import type { DocumentUpdate, DocumentUpdateOptions } from "./documentQuery";
|
|
7
|
+
import type { DocumentQuery, DocumentUpdate, DocumentUpdateOptions } from "./documentQuery";
|
|
8
8
|
import { type LoaderBuilder, type ModelCls, makeLoaderBuilder } from "./loaderInfo";
|
|
9
9
|
import type { DocumentProjection } from "./types";
|
|
10
10
|
|
|
@@ -15,7 +15,7 @@ interface DefaultMdlStats<
|
|
|
15
15
|
TDocument,
|
|
16
16
|
TSchema,
|
|
17
17
|
_Partial extends Partial<TSchema> = Partial<TSchema>,
|
|
18
|
-
_FilterQuery extends
|
|
18
|
+
_FilterQuery extends DocumentQuery<TSchema> = DocumentQuery<TSchema>,
|
|
19
19
|
_Projection = DocumentProjection<TSchema>,
|
|
20
20
|
> {
|
|
21
21
|
pickOneAndWrite: (query: _FilterQuery, rawData: _Partial) => Promise<TDocument>;
|
|
@@ -47,7 +47,7 @@ export interface UpdateResult {
|
|
|
47
47
|
modifiedCount: number;
|
|
48
48
|
upsertedId?: string | null;
|
|
49
49
|
}
|
|
50
|
-
export interface BulkWriteOperation<Raw, _RawDoc = DocumentModel<Raw>, _RawQuery =
|
|
50
|
+
export interface BulkWriteOperation<Raw, _RawDoc = DocumentModel<Raw>, _RawQuery = DocumentQuery<_RawDoc>> {
|
|
51
51
|
updateOne: {
|
|
52
52
|
filter: _RawQuery;
|
|
53
53
|
update: DocumentUpdate;
|
|
@@ -69,7 +69,7 @@ export type Mdl<
|
|
|
69
69
|
Doc,
|
|
70
70
|
Raw,
|
|
71
71
|
_RawDoc = DocumentModel<Raw>,
|
|
72
|
-
_RawQuery =
|
|
72
|
+
_RawQuery extends DocumentQuery<_RawDoc> = DocumentQuery<_RawDoc>,
|
|
73
73
|
_Projection extends DocumentProjection<Raw> = DocumentProjection<Raw>,
|
|
74
74
|
> = DefaultMdlStats<Doc, _RawDoc, Partial<_RawDoc>, _RawQuery, _Projection> & {
|
|
75
75
|
refName: string;
|
package/package.json
CHANGED
|
@@ -5,8 +5,6 @@ import type { BaseBuildArtifact } from "../types";
|
|
|
5
5
|
import { AkanResponse } from "./akanResponse";
|
|
6
6
|
import type { WebProxy } from "./types";
|
|
7
7
|
|
|
8
|
-
const RESERVED_BASE_PATHS = new Set(["admin"]);
|
|
9
|
-
|
|
10
8
|
export class HostBasePathWebProxy implements WebProxy {
|
|
11
9
|
static readonly refName = "HostBasePathWebProxy";
|
|
12
10
|
#domainMap: Map<string, string> | null = null;
|
|
@@ -37,8 +35,6 @@ export class HostBasePathWebProxy implements WebProxy {
|
|
|
37
35
|
);
|
|
38
36
|
}
|
|
39
37
|
|
|
40
|
-
if (RESERVED_BASE_PATHS.has(firstPath)) return AkanResponse.next({ request: { headers } });
|
|
41
|
-
|
|
42
38
|
const internalPath = `/${[locale, basePath, ...segments.slice(2)].filter(Boolean).join("/")}`;
|
|
43
39
|
targetUrl.pathname = internalPath;
|
|
44
40
|
return AkanResponse.rewrite(toProxyRequestUrl(requestUrl, targetUrl), { request: { headers } });
|
package/server/webRouter.ts
CHANGED
|
@@ -53,7 +53,6 @@ import type { RscTraceMetadata, SsrManifest } from "./ssrTypes";
|
|
|
53
53
|
import { createSystemPageResponse, getSystemPageHomeHref } from "./systemPages";
|
|
54
54
|
import type { BaseBuildArtifact, HttpRoutes, RenderState } from "./types";
|
|
55
55
|
|
|
56
|
-
const RESERVED_BASE_PATHS = new Set(["admin"]);
|
|
57
56
|
const CLIENT_CLOSED_REQUEST_STATUS = 499;
|
|
58
57
|
export const DEFAULT_HTML_RESULT_CACHE_MAX_BODY_BYTES = 2 * 1024 * 1024;
|
|
59
58
|
const APPLE_APP_SITE_ASSOCIATION_PATH = "/.well-known/apple-app-site-association";
|
|
@@ -228,8 +227,6 @@ export function normalizeRscTargetUrlForHostBasePath(
|
|
|
228
227
|
|
|
229
228
|
const targetBasePath = firstPath && basePaths.includes(firstPath) ? firstPath : null;
|
|
230
229
|
if (seedEntries && routeMatches(targetUrl)) return { url: targetUrl, basePath: targetBasePath ?? basePath };
|
|
231
|
-
if (RESERVED_BASE_PATHS.has(firstPath ?? "")) return { url: targetUrl, basePath: basePath ?? targetBasePath };
|
|
232
|
-
|
|
233
230
|
const candidates = [...new Set([basePath, ...basePaths].filter((bp): bp is string => Boolean(bp)))];
|
|
234
231
|
for (const candidate of candidates) {
|
|
235
232
|
if (firstPath === candidate) continue;
|
|
@@ -1075,8 +1072,7 @@ export class WebRouter {
|
|
|
1075
1072
|
}
|
|
1076
1073
|
const assetLinks = associations
|
|
1077
1074
|
.filter(
|
|
1078
|
-
(association) =>
|
|
1079
|
-
association.domains.length > 0 && (association.androidSha256CertFingerprints?.length ?? 0) > 0,
|
|
1075
|
+
(association) => association.domains.length > 0 && (association.androidSha256CertFingerprints?.length ?? 0) > 0,
|
|
1080
1076
|
)
|
|
1081
1077
|
.map((association) => ({
|
|
1082
1078
|
relation: ["delegate_permission/common.handle_all_urls"],
|
package/types/document/into.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ import type { DocumentModel, QueryOf } from "akanjs/constant";
|
|
|
3
3
|
import type { FilterCls, FilterQueryOf, FilterSortOf } from ".";
|
|
4
4
|
import type { CacheDatabase, QueryMethodPart } from "./database.d.ts";
|
|
5
5
|
import type { DataLoader } from "./dataLoader.d.ts";
|
|
6
|
-
import type { DocumentUpdate, DocumentUpdateOptions } from "./documentQuery.d.ts";
|
|
6
|
+
import type { DocumentQuery, DocumentUpdate, DocumentUpdateOptions } from "./documentQuery.d.ts";
|
|
7
7
|
import { type LoaderBuilder, type ModelCls } from "./loaderInfo.d.ts";
|
|
8
8
|
import type { DocumentProjection } from "./types.d.ts";
|
|
9
9
|
export type CRUDEventType = "create" | "update" | "remove";
|
|
10
10
|
export type SaveEventType = "save" | CRUDEventType;
|
|
11
|
-
interface DefaultMdlStats<TDocument, TSchema, _Partial extends Partial<TSchema> = Partial<TSchema>, _FilterQuery extends
|
|
11
|
+
interface DefaultMdlStats<TDocument, TSchema, _Partial extends Partial<TSchema> = Partial<TSchema>, _FilterQuery extends DocumentQuery<TSchema> = DocumentQuery<TSchema>, _Projection = DocumentProjection<TSchema>> {
|
|
12
12
|
pickOneAndWrite: (query: _FilterQuery, rawData: _Partial) => Promise<TDocument>;
|
|
13
13
|
pickAndWrite: (docId: string, rawData: _Partial) => Promise<TDocument>;
|
|
14
14
|
pickOne: (query: _FilterQuery, projection?: _Projection) => Promise<TDocument>;
|
|
@@ -32,7 +32,7 @@ export interface UpdateResult {
|
|
|
32
32
|
modifiedCount: number;
|
|
33
33
|
upsertedId?: string | null;
|
|
34
34
|
}
|
|
35
|
-
export interface BulkWriteOperation<Raw, _RawDoc = DocumentModel<Raw>, _RawQuery =
|
|
35
|
+
export interface BulkWriteOperation<Raw, _RawDoc = DocumentModel<Raw>, _RawQuery = DocumentQuery<_RawDoc>> {
|
|
36
36
|
updateOne: {
|
|
37
37
|
filter: _RawQuery;
|
|
38
38
|
update: DocumentUpdate;
|
|
@@ -50,7 +50,7 @@ type FindOneChain<Doc> = Promise<Doc | null> & {
|
|
|
50
50
|
skip(skip: number): FindOneChain<Doc>;
|
|
51
51
|
select(projection?: unknown): FindOneChain<Doc>;
|
|
52
52
|
};
|
|
53
|
-
export type Mdl<Doc, Raw, _RawDoc = DocumentModel<Raw>, _RawQuery =
|
|
53
|
+
export type Mdl<Doc, Raw, _RawDoc = DocumentModel<Raw>, _RawQuery extends DocumentQuery<_RawDoc> = DocumentQuery<_RawDoc>, _Projection extends DocumentProjection<Raw> = DocumentProjection<Raw>> = DefaultMdlStats<Doc, _RawDoc, Partial<_RawDoc>, _RawQuery, _Projection> & {
|
|
54
54
|
refName: string;
|
|
55
55
|
new (data: Partial<_RawDoc> | Partial<Doc>): Doc;
|
|
56
56
|
find(query: _RawQuery, projection?: _Projection): FindManyChain<Doc>;
|