@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
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { Db, InsertOneResult, InsertManyResult, Filter, WithId, UpdateResult, DeleteResult, Collection, OptionalUnlessRequiredId } from 'mongodb';
|
|
2
|
-
import mongoose, { Document, Model, PaginateModel, AggregatePaginateModel, FilterQuery, ProjectionType, QueryOptions, PopulateOptions, PaginateOptions, PopulateOption, PaginateResult, PipelineStage, AggregatePaginateResult, InsertManyOptions, UpdateQuery, ClientSession, QueryWithHelpers, Schema, SchemaDefinition } from 'mongoose';
|
|
3
|
-
|
|
4
|
-
declare class C_Model extends Model {
|
|
5
|
-
}
|
|
6
|
-
declare class C_Db extends Db {
|
|
7
|
-
}
|
|
8
|
-
declare class C_Document extends Document {
|
|
9
|
-
}
|
|
10
|
-
declare class C_Collection<D extends Partial<C_Document>> extends Collection<D> {
|
|
11
|
-
}
|
|
12
|
-
interface I_GenericDocument extends Partial<C_Document> {
|
|
13
|
-
id?: string;
|
|
14
|
-
isDel?: boolean;
|
|
15
|
-
createdAt?: Date;
|
|
16
|
-
updatedAt?: Date;
|
|
17
|
-
}
|
|
18
|
-
interface I_VirtualNestedOptions {
|
|
19
|
-
[key: string]: I_VirtualNestedOptions | number | string | boolean;
|
|
20
|
-
}
|
|
21
|
-
interface I_HookNextFunction {
|
|
22
|
-
(error?: Error | null): void;
|
|
23
|
-
}
|
|
24
|
-
type T_MiddlewareContext<T> = T | QueryWithHelpers<T, T>;
|
|
25
|
-
interface I_VirtualOptions {
|
|
26
|
-
ref: string;
|
|
27
|
-
localField: string;
|
|
28
|
-
foreignField: string;
|
|
29
|
-
count?: boolean;
|
|
30
|
-
justOne?: boolean;
|
|
31
|
-
options?: I_VirtualNestedOptions;
|
|
32
|
-
}
|
|
33
|
-
interface I_MongooseOptions<D extends Partial<C_Document>> {
|
|
34
|
-
mongoose: typeof mongoose;
|
|
35
|
-
virtuals?: {
|
|
36
|
-
name: keyof D | string;
|
|
37
|
-
options?: I_VirtualOptions;
|
|
38
|
-
get?: (this: D) => void;
|
|
39
|
-
}[];
|
|
40
|
-
}
|
|
41
|
-
type T_MongooseShema<D> = mongoose.Schema<D>;
|
|
42
|
-
type T_MongoosePlugin = (schema: Schema, options?: Record<string, unknown>) => void;
|
|
43
|
-
type T_Input_MongooseSchema<D> = SchemaDefinition<D>;
|
|
44
|
-
interface I_GenerateSchemaOptions<D extends Partial<C_Document>> extends I_MongooseOptions<D> {
|
|
45
|
-
schema: T_Input_MongooseSchema<D>;
|
|
46
|
-
standalone?: boolean;
|
|
47
|
-
}
|
|
48
|
-
type T_MongooseModelMiddlewareFunction = (this: T_MiddlewareContext<C_Document>, next: I_HookNextFunction) => void;
|
|
49
|
-
interface I_MongooseModelMiddleware {
|
|
50
|
-
method: string;
|
|
51
|
-
fn: T_MongooseModelMiddlewareFunction;
|
|
52
|
-
}
|
|
53
|
-
interface I_GenerateModelOptions<D extends Partial<C_Document>> extends I_MongooseOptions<D> {
|
|
54
|
-
schema: T_Input_MongooseSchema<D>;
|
|
55
|
-
name: string;
|
|
56
|
-
aggregate?: boolean;
|
|
57
|
-
middlewares?: I_MongooseModelMiddleware[];
|
|
58
|
-
pagination?: boolean;
|
|
59
|
-
}
|
|
60
|
-
interface I_ExtendedModel<D extends Partial<C_Document>> extends Model<D>, PaginateModel<D>, AggregatePaginateModel<D> {
|
|
61
|
-
}
|
|
62
|
-
interface I_ReturnSuccess<D, E = {}> {
|
|
63
|
-
success: true;
|
|
64
|
-
result: D & E;
|
|
65
|
-
message?: string;
|
|
66
|
-
code?: number | string;
|
|
67
|
-
}
|
|
68
|
-
interface I_ReturnFailure {
|
|
69
|
-
success: false;
|
|
70
|
-
message: string;
|
|
71
|
-
code: number | string;
|
|
72
|
-
}
|
|
73
|
-
type I_Return<D = void, E = {}> = I_ReturnSuccess<D, E> | I_ReturnFailure;
|
|
74
|
-
type T_Filter<D> = Filter<D>;
|
|
75
|
-
type T_InsertOneResult<D> = InsertOneResult<D>;
|
|
76
|
-
type T_InsertManyResult<D> = InsertManyResult<D>;
|
|
77
|
-
type T_FilterQuery<T> = FilterQuery<T>;
|
|
78
|
-
type T_ProjectionType<T> = ProjectionType<T>;
|
|
79
|
-
type T_QueryOptions<T> = QueryOptions<T>;
|
|
80
|
-
type T_PaginateOptions = PaginateOptions;
|
|
81
|
-
type T_PopulateOption = PopulateOption;
|
|
82
|
-
type T_PopulateOptions = PopulateOptions;
|
|
83
|
-
type T_PipelineStage = PipelineStage;
|
|
84
|
-
type T_PaginateResult<T> = PaginateResult<T>;
|
|
85
|
-
type T_AggregatePaginateResult<T> = AggregatePaginateResult<T>;
|
|
86
|
-
type T_InsertManyOptions = InsertManyOptions;
|
|
87
|
-
type T_UpdateQuery<T> = UpdateQuery<T>;
|
|
88
|
-
type T_UpdateResult = UpdateResult;
|
|
89
|
-
type T_DeleteResult = DeleteResult;
|
|
90
|
-
type T_WithId<T> = WithId<T>;
|
|
91
|
-
type T_OptionalUnlessRequiredId<T> = OptionalUnlessRequiredId<T>;
|
|
92
|
-
type T_Input_Populate = string | string[] | T_PopulateOptions | T_PopulateOptions[];
|
|
93
|
-
interface T_PaginateOptionsWithPopulate extends T_PaginateOptions, T_PopulateOption {
|
|
94
|
-
}
|
|
95
|
-
type T_GenerateSlugQueryResponse<D> = T_FilterQuery<D> & {
|
|
96
|
-
$or: Array<{
|
|
97
|
-
slug: string;
|
|
98
|
-
} | {
|
|
99
|
-
slugHistory: string;
|
|
100
|
-
}>;
|
|
101
|
-
} & {
|
|
102
|
-
id?: {
|
|
103
|
-
$ne: string;
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
interface I_Input_FindOne<T> extends T_PopulateOption {
|
|
107
|
-
filter: T_FilterQuery<T>;
|
|
108
|
-
projection?: T_ProjectionType<T>;
|
|
109
|
-
options?: T_QueryOptions<T>;
|
|
110
|
-
}
|
|
111
|
-
interface I_Input_FindAll<T> extends T_PopulateOption {
|
|
112
|
-
filter: T_FilterQuery<T>;
|
|
113
|
-
projection?: T_ProjectionType<T>;
|
|
114
|
-
options?: T_QueryOptions<T>;
|
|
115
|
-
}
|
|
116
|
-
interface I_Input_FindPaging<T> {
|
|
117
|
-
filter?: T_FilterQuery<T>;
|
|
118
|
-
options?: T_PaginateOptionsWithPopulate;
|
|
119
|
-
}
|
|
120
|
-
interface I_Input_FindPagingAggregate {
|
|
121
|
-
pipeline: T_PipelineStage[];
|
|
122
|
-
options?: T_PaginateOptionsWithPopulate;
|
|
123
|
-
}
|
|
124
|
-
interface I_Input_CreateOne<T> {
|
|
125
|
-
doc: T;
|
|
126
|
-
}
|
|
127
|
-
interface I_Input_CreateMany<T> {
|
|
128
|
-
docs: T[];
|
|
129
|
-
}
|
|
130
|
-
interface I_Input_UpdateOne<T> extends T_PopulateOption {
|
|
131
|
-
filter: T_FilterQuery<T>;
|
|
132
|
-
update: T_UpdateQuery<T>;
|
|
133
|
-
options?: I_UpdateOptionsExtended;
|
|
134
|
-
}
|
|
135
|
-
interface I_Input_UpdateMany<T> extends T_PopulateOption {
|
|
136
|
-
filter: T_FilterQuery<T>;
|
|
137
|
-
update: T_UpdateQuery<T>;
|
|
138
|
-
options?: I_UpdateOptionsExtended;
|
|
139
|
-
}
|
|
140
|
-
interface I_Input_DeleteOne<T> {
|
|
141
|
-
filter: T_FilterQuery<T>;
|
|
142
|
-
options?: I_DeleteOptionsExtended;
|
|
143
|
-
}
|
|
144
|
-
interface I_Input_DeleteMany<T> {
|
|
145
|
-
filter: T_FilterQuery<T>;
|
|
146
|
-
options?: I_DeleteOptionsExtended;
|
|
147
|
-
}
|
|
148
|
-
interface I_UpdateOptionsExtended extends Omit<QueryOptions, 'session'> {
|
|
149
|
-
session?: ClientSession;
|
|
150
|
-
}
|
|
151
|
-
interface I_DeleteOptionsExtended extends Omit<QueryOptions, 'session'> {
|
|
152
|
-
session?: ClientSession;
|
|
153
|
-
}
|
|
154
|
-
interface I_SlugifyOptions {
|
|
155
|
-
replacement?: string;
|
|
156
|
-
remove?: RegExp;
|
|
157
|
-
lower?: boolean;
|
|
158
|
-
strict?: boolean;
|
|
159
|
-
locale?: string;
|
|
160
|
-
trim?: boolean;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export { C_Collection, C_Db, C_Document, C_Model, type I_DeleteOptionsExtended, type I_ExtendedModel, type I_GenerateModelOptions, type I_GenerateSchemaOptions, type I_GenericDocument, 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_MongooseModelMiddleware, type I_MongooseOptions, type I_Return, type I_ReturnFailure, type I_ReturnSuccess, type I_SlugifyOptions, type I_UpdateOptionsExtended, type T_AggregatePaginateResult, 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_UpdateQuery, type T_UpdateResult, type T_WithId };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ApolloClientOptions, ApolloCache } from '@apollo/client';
|
|
2
|
-
import { ReactNode, ReactElement, JSX } from 'react';
|
|
3
|
-
|
|
4
|
-
type T_Children = ReactNode | ReactNode[] | ReactElement | JSX.Element | null;
|
|
5
|
-
interface I_ApolloOptions extends Omit<ApolloClientOptions<unknown>, 'cache'> {
|
|
6
|
-
cache?: ApolloCache<unknown>;
|
|
7
|
-
url?: string;
|
|
8
|
-
}
|
|
9
|
-
interface I_GraphqlCodegenConfig {
|
|
10
|
-
uri: string;
|
|
11
|
-
from: string;
|
|
12
|
-
to: string;
|
|
13
|
-
withComponent?: boolean;
|
|
14
|
-
withHOC?: boolean;
|
|
15
|
-
withHooks?: boolean;
|
|
16
|
-
withMutationFn?: boolean;
|
|
17
|
-
withRefetchFn?: boolean;
|
|
18
|
-
}
|
|
19
|
-
interface I_LoadingContext {
|
|
20
|
-
isLoading: boolean;
|
|
21
|
-
isGlobalLoading: boolean;
|
|
22
|
-
showLoading: (global?: boolean) => void;
|
|
23
|
-
hideLoading: () => void;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type { I_ApolloOptions, I_GraphqlCodegenConfig, I_LoadingContext, T_Children };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ApolloClientOptions, ApolloCache } from '@apollo/client';
|
|
2
|
-
import { ReactNode, ReactElement, JSX } from 'react';
|
|
3
|
-
|
|
4
|
-
type T_Children = ReactNode | ReactNode[] | ReactElement | JSX.Element | null;
|
|
5
|
-
interface I_ApolloOptions extends Omit<ApolloClientOptions<unknown>, 'cache'> {
|
|
6
|
-
cache?: ApolloCache<unknown>;
|
|
7
|
-
url?: string;
|
|
8
|
-
}
|
|
9
|
-
interface I_GraphqlCodegenConfig {
|
|
10
|
-
uri: string;
|
|
11
|
-
from: string;
|
|
12
|
-
to: string;
|
|
13
|
-
withComponent?: boolean;
|
|
14
|
-
withHOC?: boolean;
|
|
15
|
-
withHooks?: boolean;
|
|
16
|
-
withMutationFn?: boolean;
|
|
17
|
-
withRefetchFn?: boolean;
|
|
18
|
-
}
|
|
19
|
-
interface I_LoadingContext {
|
|
20
|
-
isLoading: boolean;
|
|
21
|
-
isGlobalLoading: boolean;
|
|
22
|
-
showLoading: (global?: boolean) => void;
|
|
23
|
-
hideLoading: () => void;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type { I_ApolloOptions, I_GraphqlCodegenConfig, I_LoadingContext, T_Children };
|
package/dist/utils/index.d.cts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { I_Config } from '../typescript/config.cjs';
|
|
2
|
-
export { localStorage } from './localStorage.cjs';
|
|
3
|
-
export { throwResponse } from './log.cjs';
|
|
4
|
-
export { generateModel, generateSchema, generateShortId, generateSlug, generateSlugQuery } from './mongoose.cjs';
|
|
5
|
-
export { serializer } from './serializer.cjs';
|
|
6
|
-
export { validate } from './validate.cjs';
|
|
7
|
-
export { default as aggregatePaginate } from 'mongoose-aggregate-paginate-v2';
|
|
8
|
-
export { default as mongoosePaginate } from 'mongoose-paginate-v2';
|
|
9
|
-
import '../typescript/log.cjs';
|
|
10
|
-
import '../typescript/mongoose.cjs';
|
|
11
|
-
import 'mongodb';
|
|
12
|
-
import 'mongoose';
|
|
13
|
-
|
|
14
|
-
declare function deepMerge(...configs: (I_Config | I_Config[])[]): I_Config;
|
|
15
|
-
declare function isJson(str: string): boolean;
|
|
16
|
-
declare function regexSearchMapper(str: string): string;
|
|
17
|
-
declare const removeAccent: (str: string) => string;
|
|
18
|
-
|
|
19
|
-
export { deepMerge, isJson, regexSearchMapper, removeAccent };
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { I_Config } from '../typescript/config.js';
|
|
2
|
-
export { localStorage } from './localStorage.js';
|
|
3
|
-
export { throwResponse } from './log.js';
|
|
4
|
-
export { generateModel, generateSchema, generateShortId, generateSlug, generateSlugQuery } from './mongoose.js';
|
|
5
|
-
export { serializer } from './serializer.js';
|
|
6
|
-
export { validate } from './validate.js';
|
|
7
|
-
export { default as aggregatePaginate } from 'mongoose-aggregate-paginate-v2';
|
|
8
|
-
export { default as mongoosePaginate } from 'mongoose-paginate-v2';
|
|
9
|
-
import '../typescript/log.js';
|
|
10
|
-
import '../typescript/mongoose.js';
|
|
11
|
-
import 'mongodb';
|
|
12
|
-
import 'mongoose';
|
|
13
|
-
|
|
14
|
-
declare function deepMerge(...configs: (I_Config | I_Config[])[]): I_Config;
|
|
15
|
-
declare function isJson(str: string): boolean;
|
|
16
|
-
declare function regexSearchMapper(str: string): string;
|
|
17
|
-
declare const removeAccent: (str: string) => string;
|
|
18
|
-
|
|
19
|
-
export { deepMerge, isJson, regexSearchMapper, removeAccent };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
declare const localStorage: {
|
|
2
|
-
/**
|
|
3
|
-
* Get the value of a key.
|
|
4
|
-
* @param key The key to retrieve.
|
|
5
|
-
* @returns A promise that resolves to the value associated with the key, or `null` if the key doesn't exist.
|
|
6
|
-
*/
|
|
7
|
-
get<T = unknown>(key: string): Promise<T | null>;
|
|
8
|
-
/**
|
|
9
|
-
* Set the value for a key.
|
|
10
|
-
* @param key The key to set.
|
|
11
|
-
* @param value The value to store. Can be any serializable type.
|
|
12
|
-
* @returns A promise that resolves once the value is stored.
|
|
13
|
-
*/
|
|
14
|
-
set<T = unknown>(key: string, value: T): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Remove the value associated with a key.
|
|
17
|
-
* @param key The key to remove.
|
|
18
|
-
* @returns A promise that resolves once the key is removed.
|
|
19
|
-
*/
|
|
20
|
-
remove(key: string): Promise<void>;
|
|
21
|
-
/**
|
|
22
|
-
* Clear all keys and values in the storage.
|
|
23
|
-
* @returns A promise that resolves once the storage is cleared.
|
|
24
|
-
*/
|
|
25
|
-
clear(): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Get the name of the key at a specific index.
|
|
28
|
-
* @param index The index of the key.
|
|
29
|
-
* @returns A promise that resolves to the key name or `null` if the index is out of bounds.
|
|
30
|
-
*/
|
|
31
|
-
key(index: number): Promise<string | null>;
|
|
32
|
-
/**
|
|
33
|
-
* Get all keys in the storage.
|
|
34
|
-
* @returns A promise that resolves to an array of all keys.
|
|
35
|
-
*/
|
|
36
|
-
keys(): Promise<string[]>;
|
|
37
|
-
/**
|
|
38
|
-
* Get the number of items in the storage.
|
|
39
|
-
* @returns A promise that resolves to the number of keys stored.
|
|
40
|
-
*/
|
|
41
|
-
length(): Promise<number>;
|
|
42
|
-
/**
|
|
43
|
-
* Iterates over all key-value pairs in the storage.
|
|
44
|
-
* @param iteratee A callback function that receives the value, key, and iteration number.
|
|
45
|
-
* @returns A promise that resolves once iteration is complete.
|
|
46
|
-
*/
|
|
47
|
-
iterate<T = unknown>(iteratee: (value: T, key: string, iterationNumber: number) => void): Promise<void>;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export { localStorage };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
declare const localStorage: {
|
|
2
|
-
/**
|
|
3
|
-
* Get the value of a key.
|
|
4
|
-
* @param key The key to retrieve.
|
|
5
|
-
* @returns A promise that resolves to the value associated with the key, or `null` if the key doesn't exist.
|
|
6
|
-
*/
|
|
7
|
-
get<T = unknown>(key: string): Promise<T | null>;
|
|
8
|
-
/**
|
|
9
|
-
* Set the value for a key.
|
|
10
|
-
* @param key The key to set.
|
|
11
|
-
* @param value The value to store. Can be any serializable type.
|
|
12
|
-
* @returns A promise that resolves once the value is stored.
|
|
13
|
-
*/
|
|
14
|
-
set<T = unknown>(key: string, value: T): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Remove the value associated with a key.
|
|
17
|
-
* @param key The key to remove.
|
|
18
|
-
* @returns A promise that resolves once the key is removed.
|
|
19
|
-
*/
|
|
20
|
-
remove(key: string): Promise<void>;
|
|
21
|
-
/**
|
|
22
|
-
* Clear all keys and values in the storage.
|
|
23
|
-
* @returns A promise that resolves once the storage is cleared.
|
|
24
|
-
*/
|
|
25
|
-
clear(): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Get the name of the key at a specific index.
|
|
28
|
-
* @param index The index of the key.
|
|
29
|
-
* @returns A promise that resolves to the key name or `null` if the index is out of bounds.
|
|
30
|
-
*/
|
|
31
|
-
key(index: number): Promise<string | null>;
|
|
32
|
-
/**
|
|
33
|
-
* Get all keys in the storage.
|
|
34
|
-
* @returns A promise that resolves to an array of all keys.
|
|
35
|
-
*/
|
|
36
|
-
keys(): Promise<string[]>;
|
|
37
|
-
/**
|
|
38
|
-
* Get the number of items in the storage.
|
|
39
|
-
* @returns A promise that resolves to the number of keys stored.
|
|
40
|
-
*/
|
|
41
|
-
length(): Promise<number>;
|
|
42
|
-
/**
|
|
43
|
-
* Iterates over all key-value pairs in the storage.
|
|
44
|
-
* @param iteratee A callback function that receives the value, key, and iteration number.
|
|
45
|
-
* @returns A promise that resolves once iteration is complete.
|
|
46
|
-
*/
|
|
47
|
-
iterate<T = unknown>(iteratee: (value: T, key: string, iterationNumber: number) => void): Promise<void>;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export { localStorage };
|
package/dist/utils/log.d.cts
DELETED
package/dist/utils/log.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export { default as aggregatePaginate } from 'mongoose-aggregate-paginate-v2';
|
|
2
|
-
export { default as mongoosePaginate } from 'mongoose-paginate-v2';
|
|
3
|
-
import { C_Document, I_GenerateSchemaOptions, T_MongooseShema, I_GenerateModelOptions, I_ExtendedModel, I_SlugifyOptions, T_FilterQuery, T_GenerateSlugQueryResponse } from '../typescript/mongoose.cjs';
|
|
4
|
-
import 'mongodb';
|
|
5
|
-
import 'mongoose';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Generate a mongoose schema with optional virtuals and generic fields.
|
|
9
|
-
* @param options - Schema generation options.
|
|
10
|
-
* @param options.mongoose - The mongoose instance.
|
|
11
|
-
* @param options.schema - The schema definition.
|
|
12
|
-
* @param options.virtuals - List of virtual fields.
|
|
13
|
-
* @param options.standalone - Whether to include generic fields.
|
|
14
|
-
* @returns Enhanced schema.
|
|
15
|
-
*/
|
|
16
|
-
declare function generateSchema<D extends Partial<C_Document>>({ mongoose, schema, virtuals, standalone, }: I_GenerateSchemaOptions<D>): T_MongooseShema<D>;
|
|
17
|
-
/**
|
|
18
|
-
* Generate a mongoose model with optional pagination, aggregation, and middleware.
|
|
19
|
-
* @param options - Model generation options.
|
|
20
|
-
* @param options.mongoose - The mongoose instance.
|
|
21
|
-
* @param options.name - The name of the model.
|
|
22
|
-
* @param options.schema - The schema definition.
|
|
23
|
-
* @param options.pagination - Whether to enable pagination plugin.
|
|
24
|
-
* @param options.aggregate - Whether to enable aggregate pagination plugin.
|
|
25
|
-
* @param options.virtuals - List of virtual fields.
|
|
26
|
-
* @param options.middlewares - Middleware functions to add.
|
|
27
|
-
* @returns Mongoose model.
|
|
28
|
-
*/
|
|
29
|
-
declare function generateModel<D extends Partial<C_Document>>({ mongoose, name, schema, pagination, aggregate, virtuals, middlewares, }: I_GenerateModelOptions<D>): I_ExtendedModel<D>;
|
|
30
|
-
declare function generateSlug(str?: string, options?: I_SlugifyOptions): string;
|
|
31
|
-
declare function generateShortId(uuid: string, length?: number): string;
|
|
32
|
-
declare function generateSlugQuery<D>(slug: string, filters?: T_FilterQuery<D>, id?: string): T_GenerateSlugQueryResponse<D>;
|
|
33
|
-
|
|
34
|
-
export { generateModel, generateSchema, generateShortId, generateSlug, generateSlugQuery };
|
package/dist/utils/mongoose.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export { default as aggregatePaginate } from 'mongoose-aggregate-paginate-v2';
|
|
2
|
-
export { default as mongoosePaginate } from 'mongoose-paginate-v2';
|
|
3
|
-
import { C_Document, I_GenerateSchemaOptions, T_MongooseShema, I_GenerateModelOptions, I_ExtendedModel, I_SlugifyOptions, T_FilterQuery, T_GenerateSlugQueryResponse } from '../typescript/mongoose.js';
|
|
4
|
-
import 'mongodb';
|
|
5
|
-
import 'mongoose';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Generate a mongoose schema with optional virtuals and generic fields.
|
|
9
|
-
* @param options - Schema generation options.
|
|
10
|
-
* @param options.mongoose - The mongoose instance.
|
|
11
|
-
* @param options.schema - The schema definition.
|
|
12
|
-
* @param options.virtuals - List of virtual fields.
|
|
13
|
-
* @param options.standalone - Whether to include generic fields.
|
|
14
|
-
* @returns Enhanced schema.
|
|
15
|
-
*/
|
|
16
|
-
declare function generateSchema<D extends Partial<C_Document>>({ mongoose, schema, virtuals, standalone, }: I_GenerateSchemaOptions<D>): T_MongooseShema<D>;
|
|
17
|
-
/**
|
|
18
|
-
* Generate a mongoose model with optional pagination, aggregation, and middleware.
|
|
19
|
-
* @param options - Model generation options.
|
|
20
|
-
* @param options.mongoose - The mongoose instance.
|
|
21
|
-
* @param options.name - The name of the model.
|
|
22
|
-
* @param options.schema - The schema definition.
|
|
23
|
-
* @param options.pagination - Whether to enable pagination plugin.
|
|
24
|
-
* @param options.aggregate - Whether to enable aggregate pagination plugin.
|
|
25
|
-
* @param options.virtuals - List of virtual fields.
|
|
26
|
-
* @param options.middlewares - Middleware functions to add.
|
|
27
|
-
* @returns Mongoose model.
|
|
28
|
-
*/
|
|
29
|
-
declare function generateModel<D extends Partial<C_Document>>({ mongoose, name, schema, pagination, aggregate, virtuals, middlewares, }: I_GenerateModelOptions<D>): I_ExtendedModel<D>;
|
|
30
|
-
declare function generateSlug(str?: string, options?: I_SlugifyOptions): string;
|
|
31
|
-
declare function generateShortId(uuid: string, length?: number): string;
|
|
32
|
-
declare function generateSlugQuery<D>(slug: string, filters?: T_FilterQuery<D>, id?: string): T_GenerateSlugQueryResponse<D>;
|
|
33
|
-
|
|
34
|
-
export { generateModel, generateSchema, generateShortId, generateSlug, generateSlugQuery };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
declare const validate: {
|
|
2
|
-
common: {
|
|
3
|
-
/**
|
|
4
|
-
* Check if a value is empty (null, undefined, empty string, empty array, or empty object).
|
|
5
|
-
* @param {unknown} value - The value to check.
|
|
6
|
-
* @returns {boolean} - True if the value is empty; otherwise, false.
|
|
7
|
-
*/
|
|
8
|
-
isEmpty(value: unknown): boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Validator to check if a value is not empty.
|
|
11
|
-
* @returns {(value: unknown) => Promise<boolean>} - The validation function.
|
|
12
|
-
*/
|
|
13
|
-
isEmptyValidator<T>(): (this: T, value: unknown) => Promise<boolean>;
|
|
14
|
-
/**
|
|
15
|
-
* Validator to check if a value is unique in specified fields.
|
|
16
|
-
* @param {string[]} fields - Fields to check for uniqueness.
|
|
17
|
-
* @returns {(value: unknown) => Promise<boolean>} - The validation function.
|
|
18
|
-
*/
|
|
19
|
-
isUniqueValidator<T extends {
|
|
20
|
-
constructor: {
|
|
21
|
-
findOne: (query: Record<string, unknown>) => Promise<unknown>;
|
|
22
|
-
};
|
|
23
|
-
}>(fields: string[]): (this: T, value: unknown) => Promise<boolean>;
|
|
24
|
-
/**
|
|
25
|
-
* Validator to check if a value matches all regex patterns in an array.
|
|
26
|
-
* @param {RegExp[]} regexArray - Array of regex patterns.
|
|
27
|
-
* @returns {(value: string) => Promise<boolean>} - The validation function.
|
|
28
|
-
*/
|
|
29
|
-
matchesRegexValidator(regexArray: RegExp[]): (value: string) => Promise<boolean>;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { validate };
|
package/dist/utils/validate.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
declare const validate: {
|
|
2
|
-
common: {
|
|
3
|
-
/**
|
|
4
|
-
* Check if a value is empty (null, undefined, empty string, empty array, or empty object).
|
|
5
|
-
* @param {unknown} value - The value to check.
|
|
6
|
-
* @returns {boolean} - True if the value is empty; otherwise, false.
|
|
7
|
-
*/
|
|
8
|
-
isEmpty(value: unknown): boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Validator to check if a value is not empty.
|
|
11
|
-
* @returns {(value: unknown) => Promise<boolean>} - The validation function.
|
|
12
|
-
*/
|
|
13
|
-
isEmptyValidator<T>(): (this: T, value: unknown) => Promise<boolean>;
|
|
14
|
-
/**
|
|
15
|
-
* Validator to check if a value is unique in specified fields.
|
|
16
|
-
* @param {string[]} fields - Fields to check for uniqueness.
|
|
17
|
-
* @returns {(value: unknown) => Promise<boolean>} - The validation function.
|
|
18
|
-
*/
|
|
19
|
-
isUniqueValidator<T extends {
|
|
20
|
-
constructor: {
|
|
21
|
-
findOne: (query: Record<string, unknown>) => Promise<unknown>;
|
|
22
|
-
};
|
|
23
|
-
}>(fields: string[]): (this: T, value: unknown) => Promise<boolean>;
|
|
24
|
-
/**
|
|
25
|
-
* Validator to check if a value matches all regex patterns in an array.
|
|
26
|
-
* @param {RegExp[]} regexArray - Array of regex patterns.
|
|
27
|
-
* @returns {(value: string) => Promise<boolean>} - The validation function.
|
|
28
|
-
*/
|
|
29
|
-
matchesRegexValidator(regexArray: RegExp[]): (value: string) => Promise<boolean>;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { validate };
|
|
File without changes
|
|
File without changes
|