@wzyjs/types 0.2.0 → 0.2.4

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.
Files changed (79) hide show
  1. package/index.ts +3 -3
  2. package/package.json +3 -3
  3. package/dist/cjs/common/index.d.ts +0 -6
  4. package/dist/cjs/common/tools/index.d.ts +0 -4
  5. package/dist/cjs/common/tools/number.d.ts +0 -3
  6. package/dist/cjs/common/tools/number.js +0 -34
  7. package/dist/cjs/common/tools/object.d.ts +0 -10
  8. package/dist/cjs/common/tools/object.js +0 -43
  9. package/dist/cjs/common/tools/other.d.ts +0 -26
  10. package/dist/cjs/common/tools/other.js +0 -112
  11. package/dist/cjs/common/tools/string.d.ts +0 -16
  12. package/dist/cjs/common/tools/string.js +0 -137
  13. package/dist/cjs/common/types/index.d.ts +0 -20
  14. package/dist/cjs/fe/dayjs.d.ts +0 -4
  15. package/dist/cjs/fe/element.d.ts +0 -9
  16. package/dist/cjs/fe/index.d.ts +0 -20
  17. package/dist/cjs/fe/middlewares/error.d.ts +0 -3
  18. package/dist/cjs/fe/middlewares/index.d.ts +0 -1
  19. package/dist/cjs/fe/other.d.ts +0 -1
  20. package/dist/cjs/fe/style.d.ts +0 -10
  21. package/dist/cjs/index_all.d.ts +0 -3
  22. package/dist/cjs/index_fe.d.ts +0 -2
  23. package/dist/cjs/index_rd.d.ts +0 -2
  24. package/dist/cjs/index_rd.js +0 -141
  25. package/dist/cjs/rd/database/Collection.d.ts +0 -22
  26. package/dist/cjs/rd/database/Collection.js +0 -202
  27. package/dist/cjs/rd/database/Database.d.ts +0 -10
  28. package/dist/cjs/rd/database/Database.js +0 -25
  29. package/dist/cjs/rd/database/index.d.ts +0 -2
  30. package/dist/cjs/rd/database/types.d.ts +0 -151
  31. package/dist/cjs/rd/database/types.js +0 -25
  32. package/dist/cjs/rd/database/utils.d.ts +0 -3
  33. package/dist/cjs/rd/database/utils.js +0 -30
  34. package/dist/cjs/rd/index.d.ts +0 -3
  35. package/dist/cjs/rd/jsonFile/index.d.ts +0 -6
  36. package/dist/cjs/rd/jsonFile/index.js +0 -29
  37. package/dist/cjs/rd/mail/index.d.ts +0 -1
  38. package/dist/cjs/rd/mail/index.js +0 -31
  39. package/dist/cjs/rd/middlewares/index.d.ts +0 -1
  40. package/dist/cjs/rd/middlewares/logger.d.ts +0 -1
  41. package/dist/esm/common/index.d.ts +0 -6
  42. package/dist/esm/common/tools/index.d.ts +0 -4
  43. package/dist/esm/common/tools/number.d.ts +0 -3
  44. package/dist/esm/common/tools/number.js +0 -30
  45. package/dist/esm/common/tools/object.d.ts +0 -10
  46. package/dist/esm/common/tools/object.js +0 -39
  47. package/dist/esm/common/tools/other.d.ts +0 -26
  48. package/dist/esm/common/tools/other.js +0 -106
  49. package/dist/esm/common/tools/string.d.ts +0 -16
  50. package/dist/esm/common/tools/string.js +0 -120
  51. package/dist/esm/common/types/index.d.ts +0 -20
  52. package/dist/esm/fe/dayjs.d.ts +0 -4
  53. package/dist/esm/fe/dayjs.js +0 -18
  54. package/dist/esm/fe/element.d.ts +0 -9
  55. package/dist/esm/fe/element.js +0 -36
  56. package/dist/esm/fe/index.d.ts +0 -20
  57. package/dist/esm/fe/index.js +0 -16
  58. package/dist/esm/fe/middlewares/error.d.ts +0 -3
  59. package/dist/esm/fe/middlewares/error.js +0 -22
  60. package/dist/esm/fe/middlewares/index.d.ts +0 -1
  61. package/dist/esm/fe/other.d.ts +0 -1
  62. package/dist/esm/fe/other.js +0 -10
  63. package/dist/esm/fe/style.d.ts +0 -10
  64. package/dist/esm/fe/style.js +0 -45
  65. package/dist/esm/index_all.d.ts +0 -3
  66. package/dist/esm/index_fe.d.ts +0 -2
  67. package/dist/esm/index_fe.js +0 -19
  68. package/dist/esm/index_rd.d.ts +0 -2
  69. package/dist/esm/rd/database/Collection.d.ts +0 -22
  70. package/dist/esm/rd/database/Database.d.ts +0 -10
  71. package/dist/esm/rd/database/index.d.ts +0 -2
  72. package/dist/esm/rd/database/types.d.ts +0 -151
  73. package/dist/esm/rd/database/utils.d.ts +0 -3
  74. package/dist/esm/rd/index.d.ts +0 -3
  75. package/dist/esm/rd/jsonFile/index.d.ts +0 -6
  76. package/dist/esm/rd/mail/index.d.ts +0 -1
  77. /package/{api.ts → src/api.ts} +0 -0
  78. /package/{base.ts → src/base.ts} +0 -0
  79. /package/{other.ts → src/other.ts} +0 -0
@@ -1,151 +0,0 @@
1
- import { Database, ICountRes } from '@cloudbase/node-sdk';
2
- export interface Config {
3
- env: string;
4
- secretId: string;
5
- secretKey: string;
6
- }
7
- export type IdConditions = {
8
- _id: string;
9
- field?: string[] | {
10
- [key: string]: false;
11
- };
12
- options?: {
13
- timeout: number;
14
- multiple?: false;
15
- };
16
- };
17
- export declare enum Command {
18
- Eq = "eq",
19
- Neq = "neq",
20
- Lt = "lt",
21
- Lte = "lte",
22
- Gt = "gt",
23
- Gte = "gte",
24
- In = "in",
25
- Nin = "nin",
26
- Gtlt = "gtlt"
27
- }
28
- export type CommandWhere = {
29
- type: Command.Eq;
30
- value: any;
31
- } | {
32
- type: Command.Neq;
33
- value: any;
34
- } | {
35
- type: Command.Gt;
36
- value: number;
37
- } | {
38
- type: Command.Gte;
39
- value: number;
40
- } | {
41
- type: Command.Lt;
42
- value: number;
43
- } | {
44
- type: Command.Lte;
45
- value: number;
46
- } | {
47
- type: Command.Gtlt;
48
- value: number[];
49
- } | {
50
- type: Command.In;
51
- value: any[];
52
- } | {
53
- type: Command.Nin;
54
- value: any[];
55
- };
56
- export type WhereConditions = {
57
- where?: {
58
- [key: string]: any | CommandWhere;
59
- };
60
- field?: string[] | {
61
- [key: string]: false;
62
- };
63
- page?: {
64
- size?: number;
65
- current?: number;
66
- };
67
- order?: {
68
- field: string;
69
- type?: 'asc' | 'desc';
70
- };
71
- options?: {
72
- timeout?: number;
73
- multiple?: boolean;
74
- };
75
- };
76
- export type Conditions = IdConditions | WhereConditions;
77
- export declare enum Method {
78
- Add = "add",
79
- Find = "find",
80
- FindList = "findList",
81
- Delete = "delete",
82
- Update = "update",
83
- Count = "count"
84
- }
85
- export declare namespace Add {
86
- type Params<D> = {
87
- method: Method.Add;
88
- data: D;
89
- conditions?: Pick<IdConditions, 'field'>;
90
- isReturn?: true;
91
- };
92
- type Res = {
93
- id: string;
94
- };
95
- }
96
- export declare namespace Find {
97
- type Params = {
98
- method: Method.Find;
99
- conditions?: Conditions;
100
- };
101
- type Res<D> = Record<D> | undefined;
102
- }
103
- export declare namespace FindList {
104
- type Params = {
105
- method: Method.FindList;
106
- conditions?: WhereConditions;
107
- };
108
- type Res<D> = {
109
- list?: Record<D>[];
110
- total?: number;
111
- };
112
- }
113
- export declare namespace Delete {
114
- type Params = {
115
- method: Method.Delete;
116
- conditions: Conditions;
117
- };
118
- type Res = {
119
- deleted: number | string;
120
- };
121
- }
122
- export declare namespace Update {
123
- type Params<D> = {
124
- method: Method.Update;
125
- conditions: Conditions;
126
- data: Partial<Record<D>>;
127
- isReturn?: true;
128
- isSet?: true;
129
- };
130
- type Res<D> = {
131
- updated?: number;
132
- doc?: D;
133
- };
134
- }
135
- export declare namespace Count {
136
- type Params = {
137
- method: Method.Count;
138
- conditions?: WhereConditions;
139
- };
140
- type Res = {
141
- total?: number;
142
- };
143
- }
144
- export type MethodParams<D> = Add.Params<D> | Find.Params | FindList.Params | Delete.Params | Update.Params<D> | Count.Params;
145
- export type MethodRes<D> = Add.Res | Find.Res<D> | FindList.Res<D> | Delete.Res | Update.Res<D> | Count.Res;
146
- export type IRes = Database.IAddRes | Database.IGetRes | Database.IDeleteResult | Database.IUpdateResult | ICountRes;
147
- export type Record<D> = D & {
148
- _id: string;
149
- createAt: number;
150
- updateAt: number;
151
- };
@@ -1,3 +0,0 @@
1
- import { Conditions } from './types';
2
- export declare const appendTime: <D>(data: D, type: 'create' | 'update') => D;
3
- export declare const defaultConditions: Conditions;
@@ -1,3 +0,0 @@
1
- export * from './database';
2
- export * from './jsonFile';
3
- export * from './mail';
@@ -1,6 +0,0 @@
1
- export declare class JsonFile {
2
- filePath: string;
3
- constructor(filePath: string);
4
- get(key: string): Promise<unknown>;
5
- set(key: string, value: any): void;
6
- }
@@ -1 +0,0 @@
1
- export declare const sendMail: (toEmail: string, title: string, content?: string) => Promise<string>;
File without changes
File without changes
File without changes