Skip to content

Commit c0f6542

Browse files
marshallswainclaude
andcommitted
fix: Check in lib files for Node 12 compatibility testing
Temporarily remove lib/ from .gitignore and commit built files to enable Node 12 compatibility testing without complex builds. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 313a64b commit c0f6542

25 files changed

+958
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ node_modules
3232
data/
3333

3434
# Compiled TypeScript output
35-
lib/
35+
# lib/ - temporarily checked in for Node 12 compatibility testing

lib/adapter.d.ts

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import { AdapterBase, AdapterParams, AdapterServiceOptions, PaginationOptions } from '@feathersjs/adapter-commons';
2+
import { Model, Query, PopulateOptions, ClientSession, Document } from 'mongoose';
3+
import { Id, Paginated } from '@feathersjs/feathers';
4+
export interface MongooseAdapterOptions<T extends Document = Document> extends AdapterServiceOptions {
5+
Model: Model<T>;
6+
lean?: boolean;
7+
overwrite?: boolean;
8+
discriminators?: Model<T>[];
9+
useEstimatedDocumentCount?: boolean;
10+
queryModifier?: (query: Query<T, T>) => void;
11+
}
12+
export interface MongooseAdapterParams extends AdapterParams {
13+
mongoose?: {
14+
session?: ClientSession;
15+
upsert?: boolean;
16+
writeResult?: boolean;
17+
};
18+
query?: {
19+
$populate?: PopulateOptions | PopulateOptions[];
20+
[key: string]: unknown;
21+
};
22+
queryModifier?: ((query: Query<Document, Document>) => void) | false;
23+
collation?: MongooseCollation;
24+
}
25+
export type AdapterId = Id;
26+
export type NullableAdapterId = AdapterId | null;
27+
interface MongooseCollation {
28+
locale: string;
29+
strength?: number;
30+
[key: string]: unknown;
31+
}
32+
export declare class MongooseAdapter<Result extends Document = Document, Data = Partial<Result>, ServiceParams extends MongooseAdapterParams = MongooseAdapterParams, PatchData = Partial<Data>> extends AdapterBase<Result, Data, PatchData, ServiceParams, MongooseAdapterOptions<Result>> {
33+
Model: Model<Result>;
34+
lean: boolean;
35+
overwrite: boolean;
36+
discriminatorKey: string;
37+
discriminators: Record<string, Model<Result>>;
38+
useEstimatedDocumentCount: boolean;
39+
constructor(options: MongooseAdapterOptions<Result>);
40+
get id(): string;
41+
allowsMulti(method: string, params?: MongooseAdapterParams): boolean;
42+
_getQueryModifier(params?: MongooseAdapterParams): (modelQuery: Query<any, any>) => Query<any, any, {}, any>;
43+
private applyPopulate;
44+
private getModelForParams;
45+
private applyCollation;
46+
private checkIdConflict;
47+
private buildFinalQuery;
48+
private performOptimizedMultiPatch;
49+
private performSingleDocumentPatch;
50+
private performMultiDocumentPatch;
51+
private applySelect;
52+
_find(params?: ServiceParams & {
53+
paginate?: PaginationOptions;
54+
}): Promise<Paginated<Result>>;
55+
_find(params?: ServiceParams & {
56+
paginate: false;
57+
}): Promise<Result[]>;
58+
_find(params?: ServiceParams): Promise<Paginated<Result> | Result[]>;
59+
_get(id: Id, params?: ServiceParams): Promise<Result>;
60+
_create(data: Data, params?: ServiceParams): Promise<Result>;
61+
_create(data: Data[], params?: ServiceParams): Promise<Result[]>;
62+
_create(data: Data | Data[], params?: ServiceParams): Promise<Result | Result[]>;
63+
_update(id: Id, data: Data, params?: ServiceParams): Promise<Result>;
64+
_patch(id: null, data: PatchData, params?: ServiceParams): Promise<Result[]>;
65+
_patch(id: Id, data: PatchData, params?: ServiceParams): Promise<Result>;
66+
_patch(id: Id | null, data: PatchData, params?: ServiceParams): Promise<Result | Result[]>;
67+
_remove(id: null, params?: ServiceParams): Promise<Result[]>;
68+
_remove(id: Id, params?: ServiceParams): Promise<Result>;
69+
_remove(id: Id | null, params?: ServiceParams): Promise<Result | Result[]>;
70+
}
71+
export {};
72+
//# sourceMappingURL=adapter.d.ts.map

lib/adapter.d.ts.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)