@cyberskill/shared 1.6.0 → 1.7.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/dist/commands.cjs +1 -1
- package/dist/commands.js +1 -1
- package/dist/configs/index.cjs +1 -1
- package/dist/configs/index.js +1 -1
- package/dist/controllers/index.cjs +1 -1
- package/dist/controllers/index.js +1 -1
- package/dist/controllers/mongoose.cjs +1 -1
- package/dist/controllers/mongoose.js +1 -1
- package/dist/hooks/react/index.cjs +1 -1
- package/dist/hooks/react/index.js +1 -1
- package/dist/hooks/react/useLocalStorage.cjs +1 -1
- package/dist/hooks/react/useLocalStorage.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +757 -27
- package/dist/index.d.ts +757 -27
- package/dist/index.js +1 -1
- package/dist/utils/command-error.cjs +1 -0
- package/dist/utils/command-error.js +1 -0
- package/dist/utils/command-log.cjs +1 -0
- package/dist/utils/command-log.js +1 -0
- package/dist/utils/command-spinner.cjs +1 -0
- package/dist/utils/command-spinner.js +1 -0
- package/dist/utils/command.cjs +1 -0
- package/dist/utils/command.js +1 -0
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/npm-package.cjs +1 -0
- package/dist/utils/npm-package.js +1 -0
- package/package.json +5 -46
- package/dist/commands.d.cts +0 -1
- package/dist/commands.d.ts +0 -1
- package/dist/components/react/index.d.cts +0 -2
- package/dist/components/react/index.d.ts +0 -2
- package/dist/components/react/loading/index.d.cts +0 -11
- package/dist/components/react/loading/index.d.ts +0 -11
- package/dist/components/react/loading/loading.module.d.cts +0 -2
- package/dist/components/react/loading/loading.module.d.ts +0 -2
- package/dist/configs/commitlint/commitlint.base.d.cts +0 -5
- package/dist/configs/commitlint/commitlint.base.d.ts +0 -5
- package/dist/configs/eslint/eslint.base.d.cts +0 -1154
- package/dist/configs/eslint/eslint.base.d.ts +0 -1154
- package/dist/configs/eslint/eslint.nestjs.d.cts +0 -1156
- package/dist/configs/eslint/eslint.nestjs.d.ts +0 -1156
- package/dist/configs/eslint/eslint.nextjs.d.cts +0 -1156
- package/dist/configs/eslint/eslint.nextjs.d.ts +0 -1156
- package/dist/configs/eslint/eslint.nodejs.d.cts +0 -1156
- package/dist/configs/eslint/eslint.nodejs.d.ts +0 -1156
- package/dist/configs/eslint/vite-react.d.cts +0 -1157
- package/dist/configs/eslint/vite-react.d.ts +0 -1157
- package/dist/configs/graphql/graphql-codegen.d.cts +0 -8
- package/dist/configs/graphql/graphql-codegen.d.ts +0 -8
- package/dist/configs/graphql/index.d.cts +0 -5
- package/dist/configs/graphql/index.d.ts +0 -5
- package/dist/configs/i18n/react/i18next.d.cts +0 -6
- package/dist/configs/i18n/react/i18next.d.ts +0 -6
- package/dist/configs/i18n/react/index.d.cts +0 -2
- package/dist/configs/i18n/react/index.d.ts +0 -2
- package/dist/configs/index.d.cts +0 -9
- package/dist/configs/index.d.ts +0 -9
- package/dist/configs/vitest/react/e2e.d.cts +0 -6
- package/dist/configs/vitest/react/e2e.d.ts +0 -6
- package/dist/configs/vitest/react/unit.d.cts +0 -6
- package/dist/configs/vitest/react/unit.d.ts +0 -6
- package/dist/configs/vitest/react/unit.setup.d.cts +0 -2
- package/dist/configs/vitest/react/unit.setup.d.ts +0 -2
- package/dist/constants/dirname.d.cts +0 -3
- package/dist/constants/dirname.d.ts +0 -3
- package/dist/constants/index.d.cts +0 -2
- package/dist/constants/index.d.ts +0 -2
- package/dist/constants/response-status.d.cts +0 -252
- package/dist/constants/response-status.d.ts +0 -252
- package/dist/contexts/react/index.d.cts +0 -4
- package/dist/contexts/react/index.d.ts +0 -4
- package/dist/contexts/react/loading.d.cts +0 -7
- package/dist/contexts/react/loading.d.ts +0 -7
- package/dist/controllers/index.d.cts +0 -5
- package/dist/controllers/index.d.ts +0 -5
- package/dist/controllers/migration.d.cts +0 -55
- package/dist/controllers/migration.d.ts +0 -55
- package/dist/controllers/mongoose.d.cts +0 -25
- package/dist/controllers/mongoose.d.ts +0 -25
- package/dist/cyberskill-shared-1.6.0.tgz +0 -0
- package/dist/hooks/react/index.d.cts +0 -6
- package/dist/hooks/react/index.d.ts +0 -6
- package/dist/hooks/react/useLoading.d.cts +0 -7
- package/dist/hooks/react/useLoading.d.ts +0 -7
- package/dist/hooks/react/useLocalStorage.d.cts +0 -5
- package/dist/hooks/react/useLocalStorage.d.ts +0 -5
- package/dist/providers/react/apollo-client.d.cts +0 -11
- package/dist/providers/react/apollo-client.d.ts +0 -11
- package/dist/providers/react/index.d.cts +0 -6
- package/dist/providers/react/index.d.ts +0 -6
- package/dist/providers/react/loading.d.cts +0 -10
- package/dist/providers/react/loading.d.ts +0 -10
- package/dist/typescript/command.d.cts +0 -35
- package/dist/typescript/command.d.ts +0 -35
- package/dist/typescript/config.d.cts +0 -5
- package/dist/typescript/config.d.ts +0 -5
- package/dist/typescript/index.d.cts +0 -10
- package/dist/typescript/index.d.ts +0 -10
- package/dist/typescript/log.d.cts +0 -10
- package/dist/typescript/log.d.ts +0 -10
- package/dist/typescript/mongoose.d.cts +0 -163
- package/dist/typescript/mongoose.d.ts +0 -163
- package/dist/typescript/react.d.cts +0 -26
- package/dist/typescript/react.d.ts +0 -26
- package/dist/typescript/serializer.d.cts +0 -6
- package/dist/typescript/serializer.d.ts +0 -6
- package/dist/utils/index.d.cts +0 -19
- package/dist/utils/index.d.ts +0 -19
- package/dist/utils/localStorage.d.cts +0 -50
- package/dist/utils/localStorage.d.ts +0 -50
- package/dist/utils/log.d.cts +0 -5
- package/dist/utils/log.d.ts +0 -5
- package/dist/utils/mongoose.d.cts +0 -34
- package/dist/utils/mongoose.d.ts +0 -34
- package/dist/utils/serializer.d.cts +0 -7
- package/dist/utils/serializer.d.ts +0 -7
- package/dist/utils/validate.d.cts +0 -33
- package/dist/utils/validate.d.ts +0 -33
- /package/dist/utils/{localStorage.cjs → local-storage.cjs} +0 -0
- /package/dist/utils/{localStorage.js → local-storage.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,759 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { Serializer } from './typescript/serializer.js';
|
|
8
|
-
export { DIRNAME } from './constants/dirname.js';
|
|
9
|
-
export { RESPONSE_STATUS } from './constants/response-status.js';
|
|
10
|
-
export { LoadingContext } from './contexts/react/loading.js';
|
|
11
|
-
export { MigrationController } from './controllers/migration.js';
|
|
12
|
-
export { MongooseController } from './controllers/mongoose.js';
|
|
13
|
-
export { useLoading } from './hooks/react/useLoading.js';
|
|
14
|
-
export { useLocalStorage } from './hooks/react/useLocalStorage.js';
|
|
15
|
-
export { ApolloProvider } from './providers/react/apollo-client.js';
|
|
16
|
-
export { LoadingProvider } from './providers/react/loading.js';
|
|
17
|
-
export { deepMerge, isJson, regexSearchMapper, removeAccent } from './utils/index.js';
|
|
18
|
-
export { localStorage } from './utils/localStorage.js';
|
|
19
|
-
export { throwResponse } from './utils/log.js';
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Db, InsertOneResult, InsertManyResult, Filter, WithId, UpdateResult, DeleteResult, Collection, OptionalUnlessRequiredId } from 'mongodb';
|
|
3
|
+
import mongoose, { Document, Model, PaginateModel, AggregatePaginateModel, FilterQuery, ProjectionType, QueryOptions, PopulateOptions, PaginateOptions, PopulateOption, PaginateResult, PipelineStage, AggregatePaginateResult, InsertManyOptions, UpdateQuery, ClientSession, QueryWithHelpers, Schema, SchemaDefinition } from 'mongoose';
|
|
4
|
+
import { ApolloClientOptions, ApolloCache } from '@apollo/client';
|
|
5
|
+
import * as react from 'react';
|
|
6
|
+
import { ReactNode, ReactElement, JSX } from 'react';
|
|
20
7
|
export { default as aggregatePaginate } from 'mongoose-aggregate-paginate-v2';
|
|
21
8
|
export { default as mongoosePaginate } from 'mongoose-paginate-v2';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
9
|
+
|
|
10
|
+
interface I_LoadingProps {
|
|
11
|
+
full?: boolean;
|
|
12
|
+
block?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
message?: string;
|
|
15
|
+
}
|
|
16
|
+
declare function Loading({ full, block, className, message, ...rest }: I_LoadingProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
declare enum E_SpinnerMessage {
|
|
19
|
+
LintCheck = "Running lint checks...",
|
|
20
|
+
LintFix = "Fixing issues...",
|
|
21
|
+
LintStaged = "Running lint-staged...",
|
|
22
|
+
CommitLint = "Running commitlint...",
|
|
23
|
+
Setup = "Setting up...",
|
|
24
|
+
Reset = "Resetting...",
|
|
25
|
+
UnitTest = "Running unit tests...",
|
|
26
|
+
E2ETest = "Running end-to-end tests...",
|
|
27
|
+
Success = " completed successfully!",
|
|
28
|
+
Fail = " failed."
|
|
29
|
+
}
|
|
30
|
+
declare enum E_ErrorType {
|
|
31
|
+
Error = "error",
|
|
32
|
+
Warning = "warning"
|
|
33
|
+
}
|
|
34
|
+
interface I_ErrorEntry {
|
|
35
|
+
type: E_ErrorType;
|
|
36
|
+
file: string;
|
|
37
|
+
message: string;
|
|
38
|
+
position?: string;
|
|
39
|
+
rule?: string;
|
|
40
|
+
}
|
|
41
|
+
interface I_EslintError {
|
|
42
|
+
filePath: string;
|
|
43
|
+
messages: Array<{
|
|
44
|
+
line: number;
|
|
45
|
+
column: number;
|
|
46
|
+
severity: number;
|
|
47
|
+
message: string;
|
|
48
|
+
ruleId: string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
interface I_SpinnerOptions {
|
|
52
|
+
successMessage?: string;
|
|
53
|
+
failureMessage?: string;
|
|
54
|
+
errorList?: unknown[];
|
|
55
|
+
exitOnError?: boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface I_Config {
|
|
59
|
+
[key: string]: string | number | boolean | I_Config | I_Config[];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface T_ThrowResponseArgs {
|
|
63
|
+
message?: string;
|
|
64
|
+
status?: {
|
|
65
|
+
CODE: string | number;
|
|
66
|
+
MESSAGE: string;
|
|
67
|
+
};
|
|
68
|
+
type?: 'graphql' | 'rest';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare class C_Model extends Model {
|
|
72
|
+
}
|
|
73
|
+
declare class C_Db extends Db {
|
|
74
|
+
}
|
|
75
|
+
declare class C_Document extends Document {
|
|
76
|
+
}
|
|
77
|
+
declare class C_Collection<D extends Partial<C_Document>> extends Collection<D> {
|
|
78
|
+
}
|
|
79
|
+
interface I_GenericDocument extends Partial<C_Document> {
|
|
80
|
+
id?: string;
|
|
81
|
+
isDel?: boolean;
|
|
82
|
+
createdAt?: Date;
|
|
83
|
+
updatedAt?: Date;
|
|
84
|
+
}
|
|
85
|
+
interface I_VirtualNestedOptions {
|
|
86
|
+
[key: string]: I_VirtualNestedOptions | number | string | boolean;
|
|
87
|
+
}
|
|
88
|
+
interface I_HookNextFunction {
|
|
89
|
+
(error?: Error | null): void;
|
|
90
|
+
}
|
|
91
|
+
type T_MiddlewareContext<T> = T | QueryWithHelpers<T, T>;
|
|
92
|
+
interface I_VirtualOptions {
|
|
93
|
+
ref: string;
|
|
94
|
+
localField: string;
|
|
95
|
+
foreignField: string;
|
|
96
|
+
count?: boolean;
|
|
97
|
+
justOne?: boolean;
|
|
98
|
+
options?: I_VirtualNestedOptions;
|
|
99
|
+
}
|
|
100
|
+
interface I_MongooseOptions<D extends Partial<C_Document>> {
|
|
101
|
+
mongoose: typeof mongoose;
|
|
102
|
+
virtuals?: {
|
|
103
|
+
name: keyof D | string;
|
|
104
|
+
options?: I_VirtualOptions;
|
|
105
|
+
get?: (this: D) => void;
|
|
106
|
+
}[];
|
|
107
|
+
}
|
|
108
|
+
type T_MongooseShema<D> = mongoose.Schema<D>;
|
|
109
|
+
type T_MongoosePlugin = (schema: Schema, options?: Record<string, unknown>) => void;
|
|
110
|
+
type T_Input_MongooseSchema<D> = SchemaDefinition<D>;
|
|
111
|
+
interface I_GenerateSchemaOptions<D extends Partial<C_Document>> extends I_MongooseOptions<D> {
|
|
112
|
+
schema: T_Input_MongooseSchema<D>;
|
|
113
|
+
standalone?: boolean;
|
|
114
|
+
}
|
|
115
|
+
type T_MongooseModelMiddlewareFunction = (this: T_MiddlewareContext<C_Document>, next: I_HookNextFunction) => void;
|
|
116
|
+
interface I_MongooseModelMiddleware {
|
|
117
|
+
method: string;
|
|
118
|
+
fn: T_MongooseModelMiddlewareFunction;
|
|
119
|
+
}
|
|
120
|
+
interface I_GenerateModelOptions<D extends Partial<C_Document>> extends I_MongooseOptions<D> {
|
|
121
|
+
schema: T_Input_MongooseSchema<D>;
|
|
122
|
+
name: string;
|
|
123
|
+
aggregate?: boolean;
|
|
124
|
+
middlewares?: I_MongooseModelMiddleware[];
|
|
125
|
+
pagination?: boolean;
|
|
126
|
+
}
|
|
127
|
+
interface I_ExtendedModel<D extends Partial<C_Document>> extends Model<D>, PaginateModel<D>, AggregatePaginateModel<D> {
|
|
128
|
+
}
|
|
129
|
+
interface I_ReturnSuccess<D, E = {}> {
|
|
130
|
+
success: true;
|
|
131
|
+
result: D & E;
|
|
132
|
+
message?: string;
|
|
133
|
+
code?: number | string;
|
|
134
|
+
}
|
|
135
|
+
interface I_ReturnFailure {
|
|
136
|
+
success: false;
|
|
137
|
+
message: string;
|
|
138
|
+
code: number | string;
|
|
139
|
+
}
|
|
140
|
+
type I_Return<D = void, E = {}> = I_ReturnSuccess<D, E> | I_ReturnFailure;
|
|
141
|
+
type T_Filter<D> = Filter<D>;
|
|
142
|
+
type T_InsertOneResult<D> = InsertOneResult<D>;
|
|
143
|
+
type T_InsertManyResult<D> = InsertManyResult<D>;
|
|
144
|
+
type T_FilterQuery<T> = FilterQuery<T>;
|
|
145
|
+
type T_ProjectionType<T> = ProjectionType<T>;
|
|
146
|
+
type T_QueryOptions<T> = QueryOptions<T>;
|
|
147
|
+
type T_PaginateOptions = PaginateOptions;
|
|
148
|
+
type T_PopulateOption = PopulateOption;
|
|
149
|
+
type T_PopulateOptions = PopulateOptions;
|
|
150
|
+
type T_PipelineStage = PipelineStage;
|
|
151
|
+
type T_PaginateResult<T> = PaginateResult<T>;
|
|
152
|
+
type T_AggregatePaginateResult<T> = AggregatePaginateResult<T>;
|
|
153
|
+
type T_InsertManyOptions = InsertManyOptions;
|
|
154
|
+
type T_UpdateQuery<T> = UpdateQuery<T>;
|
|
155
|
+
type T_UpdateResult = UpdateResult;
|
|
156
|
+
type T_DeleteResult = DeleteResult;
|
|
157
|
+
type T_WithId<T> = WithId<T>;
|
|
158
|
+
type T_OptionalUnlessRequiredId<T> = OptionalUnlessRequiredId<T>;
|
|
159
|
+
type T_Input_Populate = string | string[] | T_PopulateOptions | T_PopulateOptions[];
|
|
160
|
+
interface T_PaginateOptionsWithPopulate extends T_PaginateOptions, T_PopulateOption {
|
|
161
|
+
}
|
|
162
|
+
type T_GenerateSlugQueryResponse<D> = T_FilterQuery<D> & {
|
|
163
|
+
$or: Array<{
|
|
164
|
+
slug: string;
|
|
165
|
+
} | {
|
|
166
|
+
slugHistory: string;
|
|
167
|
+
}>;
|
|
168
|
+
} & {
|
|
169
|
+
id?: {
|
|
170
|
+
$ne: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
interface I_Input_FindOne<T> extends T_PopulateOption {
|
|
174
|
+
filter: T_FilterQuery<T>;
|
|
175
|
+
projection?: T_ProjectionType<T>;
|
|
176
|
+
options?: T_QueryOptions<T>;
|
|
177
|
+
}
|
|
178
|
+
interface I_Input_FindAll<T> extends T_PopulateOption {
|
|
179
|
+
filter: T_FilterQuery<T>;
|
|
180
|
+
projection?: T_ProjectionType<T>;
|
|
181
|
+
options?: T_QueryOptions<T>;
|
|
182
|
+
}
|
|
183
|
+
interface I_Input_FindPaging<T> {
|
|
184
|
+
filter?: T_FilterQuery<T>;
|
|
185
|
+
options?: T_PaginateOptionsWithPopulate;
|
|
186
|
+
}
|
|
187
|
+
interface I_Input_FindPagingAggregate {
|
|
188
|
+
pipeline: T_PipelineStage[];
|
|
189
|
+
options?: T_PaginateOptionsWithPopulate;
|
|
190
|
+
}
|
|
191
|
+
interface I_Input_CreateOne<T> {
|
|
192
|
+
doc: T;
|
|
193
|
+
}
|
|
194
|
+
interface I_Input_CreateMany<T> {
|
|
195
|
+
docs: T[];
|
|
196
|
+
}
|
|
197
|
+
interface I_Input_UpdateOne<T> extends T_PopulateOption {
|
|
198
|
+
filter: T_FilterQuery<T>;
|
|
199
|
+
update: T_UpdateQuery<T>;
|
|
200
|
+
options?: I_UpdateOptionsExtended;
|
|
201
|
+
}
|
|
202
|
+
interface I_Input_UpdateMany<T> extends T_PopulateOption {
|
|
203
|
+
filter: T_FilterQuery<T>;
|
|
204
|
+
update: T_UpdateQuery<T>;
|
|
205
|
+
options?: I_UpdateOptionsExtended;
|
|
206
|
+
}
|
|
207
|
+
interface I_Input_DeleteOne<T> {
|
|
208
|
+
filter: T_FilterQuery<T>;
|
|
209
|
+
options?: I_DeleteOptionsExtended;
|
|
210
|
+
}
|
|
211
|
+
interface I_Input_DeleteMany<T> {
|
|
212
|
+
filter: T_FilterQuery<T>;
|
|
213
|
+
options?: I_DeleteOptionsExtended;
|
|
214
|
+
}
|
|
215
|
+
interface I_UpdateOptionsExtended extends Omit<QueryOptions, 'session'> {
|
|
216
|
+
session?: ClientSession;
|
|
217
|
+
}
|
|
218
|
+
interface I_DeleteOptionsExtended extends Omit<QueryOptions, 'session'> {
|
|
219
|
+
session?: ClientSession;
|
|
220
|
+
}
|
|
221
|
+
interface I_SlugifyOptions {
|
|
222
|
+
replacement?: string;
|
|
223
|
+
remove?: RegExp;
|
|
224
|
+
lower?: boolean;
|
|
225
|
+
strict?: boolean;
|
|
226
|
+
locale?: string;
|
|
227
|
+
trim?: boolean;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
type T_Children = ReactNode | ReactNode[] | ReactElement | JSX.Element | null;
|
|
231
|
+
interface I_ApolloOptions extends Omit<ApolloClientOptions<unknown>, 'cache'> {
|
|
232
|
+
cache?: ApolloCache<unknown>;
|
|
233
|
+
url?: string;
|
|
234
|
+
}
|
|
235
|
+
interface I_GraphqlCodegenConfig {
|
|
236
|
+
uri: string;
|
|
237
|
+
from: string;
|
|
238
|
+
to: string;
|
|
239
|
+
withComponent?: boolean;
|
|
240
|
+
withHOC?: boolean;
|
|
241
|
+
withHooks?: boolean;
|
|
242
|
+
withMutationFn?: boolean;
|
|
243
|
+
withRefetchFn?: boolean;
|
|
244
|
+
}
|
|
245
|
+
interface I_LoadingContext {
|
|
246
|
+
isLoading: boolean;
|
|
247
|
+
isGlobalLoading: boolean;
|
|
248
|
+
showLoading: (global?: boolean) => void;
|
|
249
|
+
hideLoading: () => void;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
interface Serializer$1<T> {
|
|
253
|
+
serialize: (value: T) => string;
|
|
254
|
+
deserialize: (value: string) => T;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
declare const DIRNAME: string;
|
|
258
|
+
|
|
259
|
+
declare const RESPONSE_STATUS: {
|
|
260
|
+
GRAPHQL_PARSE_FAILED: {
|
|
261
|
+
CODE: string;
|
|
262
|
+
MESSAGE: string;
|
|
263
|
+
};
|
|
264
|
+
GRAPHQL_VALIDATION_FAILED: {
|
|
265
|
+
CODE: string;
|
|
266
|
+
MESSAGE: string;
|
|
267
|
+
};
|
|
268
|
+
BAD_USER_INPUT: {
|
|
269
|
+
CODE: string;
|
|
270
|
+
MESSAGE: string;
|
|
271
|
+
};
|
|
272
|
+
PERSISTED_QUERY_NOT_FOUND: {
|
|
273
|
+
CODE: string;
|
|
274
|
+
MESSAGE: string;
|
|
275
|
+
};
|
|
276
|
+
PERSISTED_QUERY_NOT_SUPPORTED: {
|
|
277
|
+
CODE: string;
|
|
278
|
+
MESSAGE: string;
|
|
279
|
+
};
|
|
280
|
+
OPERATION_RESOLUTION_FAILURE: {
|
|
281
|
+
CODE: string;
|
|
282
|
+
MESSAGE: string;
|
|
283
|
+
};
|
|
284
|
+
CONTINUE: {
|
|
285
|
+
CODE: number;
|
|
286
|
+
MESSAGE: string;
|
|
287
|
+
};
|
|
288
|
+
SWITCHING_PROTOCOLS: {
|
|
289
|
+
CODE: number;
|
|
290
|
+
MESSAGE: string;
|
|
291
|
+
};
|
|
292
|
+
PROCESSING: {
|
|
293
|
+
CODE: number;
|
|
294
|
+
MESSAGE: string;
|
|
295
|
+
};
|
|
296
|
+
OK: {
|
|
297
|
+
CODE: number;
|
|
298
|
+
MESSAGE: string;
|
|
299
|
+
};
|
|
300
|
+
CREATED: {
|
|
301
|
+
CODE: number;
|
|
302
|
+
MESSAGE: string;
|
|
303
|
+
};
|
|
304
|
+
ACCEPTED: {
|
|
305
|
+
CODE: number;
|
|
306
|
+
MESSAGE: string;
|
|
307
|
+
};
|
|
308
|
+
NON_AUTHORITATIVE_INFORMATION: {
|
|
309
|
+
CODE: number;
|
|
310
|
+
MESSAGE: string;
|
|
311
|
+
};
|
|
312
|
+
NO_CONTENT: {
|
|
313
|
+
CODE: number;
|
|
314
|
+
MESSAGE: string;
|
|
315
|
+
};
|
|
316
|
+
RESET_CONTENT: {
|
|
317
|
+
CODE: number;
|
|
318
|
+
MESSAGE: string;
|
|
319
|
+
};
|
|
320
|
+
PARTIAL_CONTENT: {
|
|
321
|
+
CODE: number;
|
|
322
|
+
MESSAGE: string;
|
|
323
|
+
};
|
|
324
|
+
MULTI_STATUS: {
|
|
325
|
+
CODE: number;
|
|
326
|
+
MESSAGE: string;
|
|
327
|
+
};
|
|
328
|
+
MULTIPLE_CHOICES: {
|
|
329
|
+
CODE: number;
|
|
330
|
+
MESSAGE: string;
|
|
331
|
+
};
|
|
332
|
+
MOVED_PERMANENTLY: {
|
|
333
|
+
CODE: number;
|
|
334
|
+
MESSAGE: string;
|
|
335
|
+
};
|
|
336
|
+
MOVED_TEMPORARILY: {
|
|
337
|
+
CODE: number;
|
|
338
|
+
MESSAGE: string;
|
|
339
|
+
};
|
|
340
|
+
SEE_OTHER: {
|
|
341
|
+
CODE: number;
|
|
342
|
+
MESSAGE: string;
|
|
343
|
+
};
|
|
344
|
+
NOT_MODIFIED: {
|
|
345
|
+
CODE: number;
|
|
346
|
+
MESSAGE: string;
|
|
347
|
+
};
|
|
348
|
+
USE_PROXY: {
|
|
349
|
+
CODE: number;
|
|
350
|
+
MESSAGE: string;
|
|
351
|
+
};
|
|
352
|
+
TEMPORARY_REDIRECT: {
|
|
353
|
+
CODE: number;
|
|
354
|
+
MESSAGE: string;
|
|
355
|
+
};
|
|
356
|
+
PERMANENT_REDIRECT: {
|
|
357
|
+
CODE: number;
|
|
358
|
+
MESSAGE: string;
|
|
359
|
+
};
|
|
360
|
+
BAD_REQUEST: {
|
|
361
|
+
CODE: number;
|
|
362
|
+
MESSAGE: string;
|
|
363
|
+
};
|
|
364
|
+
UNAUTHORIZED: {
|
|
365
|
+
CODE: number;
|
|
366
|
+
MESSAGE: string;
|
|
367
|
+
};
|
|
368
|
+
PAYMENT_REQUIRED: {
|
|
369
|
+
CODE: number;
|
|
370
|
+
MESSAGE: string;
|
|
371
|
+
};
|
|
372
|
+
FORBIDDEN: {
|
|
373
|
+
CODE: number;
|
|
374
|
+
MESSAGE: string;
|
|
375
|
+
};
|
|
376
|
+
NOT_FOUND: {
|
|
377
|
+
CODE: number;
|
|
378
|
+
MESSAGE: string;
|
|
379
|
+
};
|
|
380
|
+
METHOD_NOT_ALLOWED: {
|
|
381
|
+
CODE: number;
|
|
382
|
+
MESSAGE: string;
|
|
383
|
+
};
|
|
384
|
+
NOT_ACCEPTABLE: {
|
|
385
|
+
CODE: number;
|
|
386
|
+
MESSAGE: string;
|
|
387
|
+
};
|
|
388
|
+
PROXY_AUTHENTICATION_REQUIRED: {
|
|
389
|
+
CODE: number;
|
|
390
|
+
MESSAGE: string;
|
|
391
|
+
};
|
|
392
|
+
REQUEST_TIMEOUT: {
|
|
393
|
+
CODE: number;
|
|
394
|
+
MESSAGE: string;
|
|
395
|
+
};
|
|
396
|
+
CONFLICT: {
|
|
397
|
+
CODE: number;
|
|
398
|
+
MESSAGE: string;
|
|
399
|
+
};
|
|
400
|
+
GONE: {
|
|
401
|
+
CODE: number;
|
|
402
|
+
MESSAGE: string;
|
|
403
|
+
};
|
|
404
|
+
LENGTH_REQUIRED: {
|
|
405
|
+
CODE: number;
|
|
406
|
+
MESSAGE: string;
|
|
407
|
+
};
|
|
408
|
+
PRECONDITION_FAILED: {
|
|
409
|
+
CODE: number;
|
|
410
|
+
MESSAGE: string;
|
|
411
|
+
};
|
|
412
|
+
REQUEST_TOO_LONG: {
|
|
413
|
+
CODE: number;
|
|
414
|
+
MESSAGE: string;
|
|
415
|
+
};
|
|
416
|
+
REQUEST_URI_TOO_LONG: {
|
|
417
|
+
CODE: number;
|
|
418
|
+
MESSAGE: string;
|
|
419
|
+
};
|
|
420
|
+
UNSUPPORTED_MEDIA_TYPE: {
|
|
421
|
+
CODE: number;
|
|
422
|
+
MESSAGE: string;
|
|
423
|
+
};
|
|
424
|
+
REQUESTED_RANGE_NOT_SATISFIABLE: {
|
|
425
|
+
CODE: number;
|
|
426
|
+
MESSAGE: string;
|
|
427
|
+
};
|
|
428
|
+
EXPECTATION_FAILED: {
|
|
429
|
+
CODE: number;
|
|
430
|
+
MESSAGE: string;
|
|
431
|
+
};
|
|
432
|
+
IM_A_TEAPOT: {
|
|
433
|
+
CODE: number;
|
|
434
|
+
MESSAGE: string;
|
|
435
|
+
};
|
|
436
|
+
INSUFFICIENT_SPACE_ON_RESOURCE: {
|
|
437
|
+
CODE: number;
|
|
438
|
+
MESSAGE: string;
|
|
439
|
+
};
|
|
440
|
+
METHOD_FAILURE: {
|
|
441
|
+
CODE: number;
|
|
442
|
+
MESSAGE: string;
|
|
443
|
+
};
|
|
444
|
+
MISDIRECTED_REQUEST: {
|
|
445
|
+
CODE: number;
|
|
446
|
+
MESSAGE: string;
|
|
447
|
+
};
|
|
448
|
+
UNPROCESSABLE_ENTITY: {
|
|
449
|
+
CODE: number;
|
|
450
|
+
MESSAGE: string;
|
|
451
|
+
};
|
|
452
|
+
LOCKED: {
|
|
453
|
+
CODE: number;
|
|
454
|
+
MESSAGE: string;
|
|
455
|
+
};
|
|
456
|
+
FAILED_DEPENDENCY: {
|
|
457
|
+
CODE: number;
|
|
458
|
+
MESSAGE: string;
|
|
459
|
+
};
|
|
460
|
+
PRECONDITION_REQUIRED: {
|
|
461
|
+
CODE: number;
|
|
462
|
+
MESSAGE: string;
|
|
463
|
+
};
|
|
464
|
+
TOO_MANY_REQUESTS: {
|
|
465
|
+
CODE: number;
|
|
466
|
+
MESSAGE: string;
|
|
467
|
+
};
|
|
468
|
+
REQUEST_HEADER_FIELDS_TOO_LARGE: {
|
|
469
|
+
CODE: number;
|
|
470
|
+
MESSAGE: string;
|
|
471
|
+
};
|
|
472
|
+
UNAVAILABLE_FOR_LEGAL_REASONS: {
|
|
473
|
+
CODE: number;
|
|
474
|
+
MESSAGE: string;
|
|
475
|
+
};
|
|
476
|
+
INTERNAL_SERVER_ERROR: {
|
|
477
|
+
CODE: number;
|
|
478
|
+
MESSAGE: string;
|
|
479
|
+
};
|
|
480
|
+
NOT_IMPLEMENTED: {
|
|
481
|
+
CODE: number;
|
|
482
|
+
MESSAGE: string;
|
|
483
|
+
};
|
|
484
|
+
BAD_GATEWAY: {
|
|
485
|
+
CODE: number;
|
|
486
|
+
MESSAGE: string;
|
|
487
|
+
};
|
|
488
|
+
SERVICE_UNAVAILABLE: {
|
|
489
|
+
CODE: number;
|
|
490
|
+
MESSAGE: string;
|
|
491
|
+
};
|
|
492
|
+
GATEWAY_TIMEOUT: {
|
|
493
|
+
CODE: number;
|
|
494
|
+
MESSAGE: string;
|
|
495
|
+
};
|
|
496
|
+
HTTP_VERSION_NOT_SUPPORTED: {
|
|
497
|
+
CODE: number;
|
|
498
|
+
MESSAGE: string;
|
|
499
|
+
};
|
|
500
|
+
INSUFFICIENT_STORAGE: {
|
|
501
|
+
CODE: number;
|
|
502
|
+
MESSAGE: string;
|
|
503
|
+
};
|
|
504
|
+
NETWORK_AUTHENTICATION_REQUIRED: {
|
|
505
|
+
CODE: number;
|
|
506
|
+
MESSAGE: string;
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
declare const LoadingContext: react.Context<I_LoadingContext | undefined>;
|
|
511
|
+
|
|
512
|
+
declare class MigrationController<D extends Partial<C_Document>> {
|
|
513
|
+
private collection;
|
|
514
|
+
constructor(db: C_Db, collectionName: string);
|
|
515
|
+
createOne(document: D): Promise<{
|
|
516
|
+
success: boolean;
|
|
517
|
+
message: string;
|
|
518
|
+
result?: T_InsertOneResult<D>;
|
|
519
|
+
}>;
|
|
520
|
+
createMany(documents: D[]): Promise<{
|
|
521
|
+
success: boolean;
|
|
522
|
+
message: string;
|
|
523
|
+
result?: T_InsertManyResult<D>;
|
|
524
|
+
}>;
|
|
525
|
+
findOne(filter: T_Filter<D>): Promise<{
|
|
526
|
+
success: boolean;
|
|
527
|
+
message: string;
|
|
528
|
+
result?: T_WithId<D> | null;
|
|
529
|
+
}>;
|
|
530
|
+
findAll(filter?: T_Filter<D>): Promise<{
|
|
531
|
+
success: boolean;
|
|
532
|
+
message: string;
|
|
533
|
+
result?: T_WithId<D>[];
|
|
534
|
+
}>;
|
|
535
|
+
count(filter?: T_Filter<D>): Promise<{
|
|
536
|
+
success: boolean;
|
|
537
|
+
message: string;
|
|
538
|
+
result?: number;
|
|
539
|
+
}>;
|
|
540
|
+
updateOne(filter: T_Filter<D>, update: Partial<D>): Promise<{
|
|
541
|
+
success: boolean;
|
|
542
|
+
message: string;
|
|
543
|
+
result?: T_UpdateResult;
|
|
544
|
+
}>;
|
|
545
|
+
updateMany(filter: T_Filter<D>, update: Partial<D>): Promise<{
|
|
546
|
+
success: boolean;
|
|
547
|
+
message: string;
|
|
548
|
+
result?: T_UpdateResult;
|
|
549
|
+
}>;
|
|
550
|
+
deleteOne(filter: T_Filter<D>): Promise<{
|
|
551
|
+
success: boolean;
|
|
552
|
+
message: string;
|
|
553
|
+
result?: T_DeleteResult;
|
|
554
|
+
}>;
|
|
555
|
+
deleteMany(filter: T_Filter<D>): Promise<{
|
|
556
|
+
success: boolean;
|
|
557
|
+
message: string;
|
|
558
|
+
result?: T_DeleteResult;
|
|
559
|
+
}>;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
declare class MongooseController<D extends Partial<C_Document>> {
|
|
563
|
+
private model;
|
|
564
|
+
constructor(model: I_ExtendedModel<D>);
|
|
565
|
+
private getModelName;
|
|
566
|
+
findOne(filter?: T_FilterQuery<D>, projection?: T_ProjectionType<D>, options?: T_QueryOptions<D>, populate?: T_Input_Populate): Promise<I_Return<D>>;
|
|
567
|
+
findAll(filter?: T_FilterQuery<D>, projection?: T_ProjectionType<D>, options?: T_QueryOptions<D>, populate?: T_Input_Populate): Promise<I_Return<D[]>>;
|
|
568
|
+
findPaging(filter?: T_FilterQuery<D>, options?: T_PaginateOptionsWithPopulate): Promise<I_Return<T_PaginateResult<D>>>;
|
|
569
|
+
findPagingAggregate(pipeline: T_PipelineStage[], options?: T_PaginateOptionsWithPopulate): Promise<I_Return<T_AggregatePaginateResult<D>>>;
|
|
570
|
+
count(filter?: T_FilterQuery<D>): Promise<I_Return<number>>;
|
|
571
|
+
createOne(doc: D | Partial<D>): Promise<I_Return<D>>;
|
|
572
|
+
createMany(docs: (D | Partial<D>)[], options?: T_InsertManyOptions): Promise<I_Return<D[]>>;
|
|
573
|
+
updateOne(filter?: T_FilterQuery<D>, update?: T_UpdateQuery<D>, options?: I_UpdateOptionsExtended): Promise<I_Return<D>>;
|
|
574
|
+
updateMany(filter?: T_FilterQuery<D>, update?: T_UpdateQuery<D>, options?: I_UpdateOptionsExtended): Promise<I_Return<T_UpdateResult>>;
|
|
575
|
+
deleteOne(filter?: T_FilterQuery<D>, options?: I_DeleteOptionsExtended): Promise<I_Return<D>>;
|
|
576
|
+
deleteMany(filter?: T_FilterQuery<D>, options?: I_DeleteOptionsExtended): Promise<I_Return<T_DeleteResult>>;
|
|
577
|
+
generateShortId(id: string): Promise<I_Return<string>>;
|
|
578
|
+
generateSlug(fieldName: string, fields: D, filters?: T_FilterQuery<D>): Promise<I_Return<string>>;
|
|
579
|
+
aggregate(pipeline: T_PipelineStage[]): Promise<I_Return<D[]>>;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
declare function useLoading(): I_LoadingContext;
|
|
583
|
+
|
|
584
|
+
declare function useLocalStorage<T>(key: string, initialValue: T, serializer?: Serializer$1<T>): readonly [T, (value: T | ((val: T) => T)) => Promise<void>];
|
|
585
|
+
|
|
586
|
+
declare function ApolloProvider({ options, children }: {
|
|
587
|
+
options: I_ApolloOptions;
|
|
588
|
+
children: T_Children;
|
|
589
|
+
}): react_jsx_runtime.JSX.Element;
|
|
590
|
+
|
|
591
|
+
declare function LoadingProvider({ children }: {
|
|
592
|
+
children: T_Children;
|
|
593
|
+
}): react_jsx_runtime.JSX.Element;
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Save the entire error list to local storage.
|
|
597
|
+
* @param errorList Array of I_ErrorEntry objects.
|
|
598
|
+
*/
|
|
599
|
+
declare function saveErrorListToStorage(errorList: I_ErrorEntry[]): Promise<void>;
|
|
600
|
+
/**
|
|
601
|
+
* Get all stored error lists.
|
|
602
|
+
* @returns An array of stored error objects.
|
|
603
|
+
*/
|
|
604
|
+
declare function getStoredErrorLists(): Promise<I_ErrorEntry[]>;
|
|
605
|
+
/**
|
|
606
|
+
* Clear expired error lists from storage.
|
|
607
|
+
*/
|
|
608
|
+
declare function clearExpiredErrorLists(): Promise<void>;
|
|
609
|
+
|
|
610
|
+
declare function displayResults(): Promise<void>;
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Wraps an async function with a loading spinner.
|
|
614
|
+
* @param message Message to display in the spinner.
|
|
615
|
+
* @param action Async action to perform.
|
|
616
|
+
* @param options Additional options.
|
|
617
|
+
*/
|
|
618
|
+
declare function runWithSpinner(message: string, action: () => Promise<void>, options?: I_SpinnerOptions): Promise<void>;
|
|
619
|
+
|
|
620
|
+
declare function logProcessStep(message: string, icon?: string): void;
|
|
621
|
+
declare function parseCommandOutput(output: string): void;
|
|
622
|
+
declare function executeCommand(command: string, description: string, parser?: typeof parseCommandOutput): Promise<void>;
|
|
623
|
+
|
|
624
|
+
declare const localStorage: {
|
|
625
|
+
/**
|
|
626
|
+
* Get the value of a key.
|
|
627
|
+
* @param key The key to retrieve.
|
|
628
|
+
* @returns A promise that resolves to the value associated with the key, or `null` if the key doesn't exist.
|
|
629
|
+
*/
|
|
630
|
+
get<T = unknown>(key: string): Promise<T | null>;
|
|
631
|
+
/**
|
|
632
|
+
* Set the value for a key.
|
|
633
|
+
* @param key The key to set.
|
|
634
|
+
* @param value The value to store. Can be any serializable type.
|
|
635
|
+
* @returns A promise that resolves once the value is stored.
|
|
636
|
+
*/
|
|
637
|
+
set<T = unknown>(key: string, value: T): Promise<void>;
|
|
638
|
+
/**
|
|
639
|
+
* Remove the value associated with a key.
|
|
640
|
+
* @param key The key to remove.
|
|
641
|
+
* @returns A promise that resolves once the key is removed.
|
|
642
|
+
*/
|
|
643
|
+
remove(key: string): Promise<void>;
|
|
644
|
+
/**
|
|
645
|
+
* Clear all keys and values in the storage.
|
|
646
|
+
* @returns A promise that resolves once the storage is cleared.
|
|
647
|
+
*/
|
|
648
|
+
clear(): Promise<void>;
|
|
649
|
+
/**
|
|
650
|
+
* Get the name of the key at a specific index.
|
|
651
|
+
* @param index The index of the key.
|
|
652
|
+
* @returns A promise that resolves to the key name or `null` if the index is out of bounds.
|
|
653
|
+
*/
|
|
654
|
+
key(index: number): Promise<string | null>;
|
|
655
|
+
/**
|
|
656
|
+
* Get all keys in the storage.
|
|
657
|
+
* @returns A promise that resolves to an array of all keys.
|
|
658
|
+
*/
|
|
659
|
+
keys(): Promise<string[]>;
|
|
660
|
+
/**
|
|
661
|
+
* Get the number of items in the storage.
|
|
662
|
+
* @returns A promise that resolves to the number of keys stored.
|
|
663
|
+
*/
|
|
664
|
+
length(): Promise<number>;
|
|
665
|
+
/**
|
|
666
|
+
* Iterates over all key-value pairs in the storage.
|
|
667
|
+
* @param iteratee A callback function that receives the value, key, and iteration number.
|
|
668
|
+
* @returns A promise that resolves once iteration is complete.
|
|
669
|
+
*/
|
|
670
|
+
iterate<T = unknown>(iteratee: (value: T, key: string, iterationNumber: number) => void): Promise<void>;
|
|
671
|
+
};
|
|
672
|
+
|
|
673
|
+
declare function throwResponse({ message, status, type, }: T_ThrowResponseArgs): never;
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* Generate a mongoose schema with optional virtuals and generic fields.
|
|
677
|
+
* @param options - Schema generation options.
|
|
678
|
+
* @param options.mongoose - The mongoose instance.
|
|
679
|
+
* @param options.schema - The schema definition.
|
|
680
|
+
* @param options.virtuals - List of virtual fields.
|
|
681
|
+
* @param options.standalone - Whether to include generic fields.
|
|
682
|
+
* @returns Enhanced schema.
|
|
683
|
+
*/
|
|
684
|
+
declare function generateSchema<D extends Partial<C_Document>>({ mongoose, schema, virtuals, standalone, }: I_GenerateSchemaOptions<D>): T_MongooseShema<D>;
|
|
685
|
+
/**
|
|
686
|
+
* Generate a mongoose model with optional pagination, aggregation, and middleware.
|
|
687
|
+
* @param options - Model generation options.
|
|
688
|
+
* @param options.mongoose - The mongoose instance.
|
|
689
|
+
* @param options.name - The name of the model.
|
|
690
|
+
* @param options.schema - The schema definition.
|
|
691
|
+
* @param options.pagination - Whether to enable pagination plugin.
|
|
692
|
+
* @param options.aggregate - Whether to enable aggregate pagination plugin.
|
|
693
|
+
* @param options.virtuals - List of virtual fields.
|
|
694
|
+
* @param options.middlewares - Middleware functions to add.
|
|
695
|
+
* @returns Mongoose model.
|
|
696
|
+
*/
|
|
697
|
+
declare function generateModel<D extends Partial<C_Document>>({ mongoose, name, schema, pagination, aggregate, virtuals, middlewares, }: I_GenerateModelOptions<D>): I_ExtendedModel<D>;
|
|
698
|
+
declare function generateSlug(str?: string, options?: I_SlugifyOptions): string;
|
|
699
|
+
declare function generateShortId(uuid: string, length?: number): string;
|
|
700
|
+
declare function generateSlugQuery<D>(slug: string, filters?: T_FilterQuery<D>, id?: string): T_GenerateSlugQueryResponse<D>;
|
|
701
|
+
|
|
702
|
+
declare function getLatestPackageVersion(packageName: string, forceRefresh?: boolean): Promise<string>;
|
|
703
|
+
/**
|
|
704
|
+
* Check if the installed package is outdated.
|
|
705
|
+
* @param packageName Name of the package.
|
|
706
|
+
* @param forceRefresh Whether to bypass cache and force refresh.
|
|
707
|
+
* @returns True if the installed version is different from the latest version.
|
|
708
|
+
*/
|
|
709
|
+
declare function isPackageOutdated(packageName: string, forceRefresh?: boolean): Promise<boolean>;
|
|
710
|
+
/**
|
|
711
|
+
* Update the specified package to the latest version.
|
|
712
|
+
* @param packageName Name of the package.
|
|
713
|
+
*/
|
|
714
|
+
declare function updatePackage(packageName: string): Promise<void>;
|
|
715
|
+
|
|
716
|
+
interface Serializer<T> {
|
|
717
|
+
serialize: (value: T) => string;
|
|
718
|
+
deserialize: (value: string) => T;
|
|
719
|
+
}
|
|
720
|
+
declare const serializer: Serializer<any>;
|
|
721
|
+
|
|
722
|
+
declare const validate: {
|
|
723
|
+
common: {
|
|
724
|
+
/**
|
|
725
|
+
* Check if a value is empty (null, undefined, empty string, empty array, or empty object).
|
|
726
|
+
* @param {unknown} value - The value to check.
|
|
727
|
+
* @returns {boolean} - True if the value is empty; otherwise, false.
|
|
728
|
+
*/
|
|
729
|
+
isEmpty(value: unknown): boolean;
|
|
730
|
+
/**
|
|
731
|
+
* Validator to check if a value is not empty.
|
|
732
|
+
* @returns {(value: unknown) => Promise<boolean>} - The validation function.
|
|
733
|
+
*/
|
|
734
|
+
isEmptyValidator<T>(): (this: T, value: unknown) => Promise<boolean>;
|
|
735
|
+
/**
|
|
736
|
+
* Validator to check if a value is unique in specified fields.
|
|
737
|
+
* @param {string[]} fields - Fields to check for uniqueness.
|
|
738
|
+
* @returns {(value: unknown) => Promise<boolean>} - The validation function.
|
|
739
|
+
*/
|
|
740
|
+
isUniqueValidator<T extends {
|
|
741
|
+
constructor: {
|
|
742
|
+
findOne: (query: Record<string, unknown>) => Promise<unknown>;
|
|
743
|
+
};
|
|
744
|
+
}>(fields: string[]): (this: T, value: unknown) => Promise<boolean>;
|
|
745
|
+
/**
|
|
746
|
+
* Validator to check if a value matches all regex patterns in an array.
|
|
747
|
+
* @param {RegExp[]} regexArray - Array of regex patterns.
|
|
748
|
+
* @returns {(value: string) => Promise<boolean>} - The validation function.
|
|
749
|
+
*/
|
|
750
|
+
matchesRegexValidator(regexArray: RegExp[]): (value: string) => Promise<boolean>;
|
|
751
|
+
};
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
declare function deepMerge(...configs: (I_Config | I_Config[])[]): I_Config;
|
|
755
|
+
declare function isJson(str: string): boolean;
|
|
756
|
+
declare function regexSearchMapper(str: string): string;
|
|
757
|
+
declare const removeAccent: (str: string) => string;
|
|
758
|
+
|
|
759
|
+
export { ApolloProvider, C_Collection, C_Db, C_Document, C_Model, DIRNAME, E_ErrorType, E_SpinnerMessage, type I_ApolloOptions, type I_Config, type I_DeleteOptionsExtended, type I_ErrorEntry, type I_EslintError, type I_ExtendedModel, type I_GenerateModelOptions, type I_GenerateSchemaOptions, type I_GenericDocument, type I_GraphqlCodegenConfig, type I_HookNextFunction, type I_Input_CreateMany, type I_Input_CreateOne, type I_Input_DeleteMany, type I_Input_DeleteOne, type I_Input_FindAll, type I_Input_FindOne, type I_Input_FindPaging, type I_Input_FindPagingAggregate, type I_Input_UpdateMany, type I_Input_UpdateOne, type I_LoadingContext, type I_LoadingProps, type I_MongooseModelMiddleware, type I_MongooseOptions, type I_Return, type I_ReturnFailure, type I_ReturnSuccess, type I_SlugifyOptions, type I_SpinnerOptions, type I_UpdateOptionsExtended, Loading, LoadingContext, LoadingProvider, MigrationController, MongooseController, RESPONSE_STATUS, type Serializer$1 as Serializer, type T_AggregatePaginateResult, type T_Children, type T_DeleteResult, type T_Filter, type T_FilterQuery, type T_GenerateSlugQueryResponse, type T_Input_MongooseSchema, type T_Input_Populate, type T_InsertManyOptions, type T_InsertManyResult, type T_InsertOneResult, type T_MiddlewareContext, type T_MongooseModelMiddlewareFunction, type T_MongoosePlugin, type T_MongooseShema, type T_OptionalUnlessRequiredId, type T_PaginateOptions, type T_PaginateOptionsWithPopulate, type T_PaginateResult, type T_PipelineStage, type T_PopulateOption, type T_PopulateOptions, type T_ProjectionType, type T_QueryOptions, type T_ThrowResponseArgs, type T_UpdateQuery, type T_UpdateResult, type T_WithId, clearExpiredErrorLists, deepMerge, displayResults, executeCommand, generateModel, generateSchema, generateShortId, generateSlug, generateSlugQuery, getLatestPackageVersion, getStoredErrorLists, isJson, isPackageOutdated, localStorage, logProcessStep, regexSearchMapper, removeAccent, runWithSpinner, saveErrorListToStorage, serializer, throwResponse, updatePackage, useLoading, useLocalStorage, validate };
|