@onurege3467/zerohelper 10.3.0 → 11.0.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.
Files changed (81) hide show
  1. package/README.md +9 -779
  2. package/dist/index.js +19 -44
  3. package/package.json +21 -70
  4. package/dist/bin/commands/cache.d.ts +0 -2
  5. package/dist/bin/commands/cache.js +0 -92
  6. package/dist/bin/commands/db-backup.d.ts +0 -3
  7. package/dist/bin/commands/db-backup.js +0 -118
  8. package/dist/bin/commands/db.d.ts +0 -2
  9. package/dist/bin/commands/db.js +0 -334
  10. package/dist/bin/commands/import-export.d.ts +0 -3
  11. package/dist/bin/commands/import-export.js +0 -123
  12. package/dist/bin/commands/init.d.ts +0 -2
  13. package/dist/bin/commands/init.js +0 -85
  14. package/dist/bin/commands/migrate.d.ts +0 -3
  15. package/dist/bin/commands/migrate.js +0 -167
  16. package/dist/bin/commands/repl.d.ts +0 -2
  17. package/dist/bin/commands/repl.js +0 -96
  18. package/dist/bin/commands/seed.d.ts +0 -2
  19. package/dist/bin/commands/seed.js +0 -76
  20. package/dist/bin/commands/zpack.d.ts +0 -2
  21. package/dist/bin/commands/zpack.js +0 -36
  22. package/dist/bin/index.d.ts +0 -2
  23. package/dist/bin/index.js +0 -28
  24. package/dist/bin/types.d.ts +0 -22
  25. package/dist/bin/types.js +0 -2
  26. package/dist/bin/utils/config.d.ts +0 -3
  27. package/dist/bin/utils/config.js +0 -78
  28. package/dist/bin/utils/prompts.d.ts +0 -3
  29. package/dist/bin/utils/prompts.js +0 -115
  30. package/dist/bin/zero.d.ts +0 -2
  31. package/dist/bin/zero.js +0 -849
  32. package/dist/database/IDatabase.d.ts +0 -71
  33. package/dist/database/IDatabase.js +0 -48
  34. package/dist/database/cacheWrapper.d.ts +0 -34
  35. package/dist/database/cacheWrapper.js +0 -214
  36. package/dist/database/index.d.ts +0 -12
  37. package/dist/database/index.js +0 -100
  38. package/dist/database/json.d.ts +0 -32
  39. package/dist/database/json.js +0 -208
  40. package/dist/database/migration.d.ts +0 -21
  41. package/dist/database/migration.js +0 -97
  42. package/dist/database/mongodb.d.ts +0 -26
  43. package/dist/database/mongodb.js +0 -145
  44. package/dist/database/mysql.d.ts +0 -29
  45. package/dist/database/mysql.js +0 -282
  46. package/dist/database/pg.d.ts +0 -28
  47. package/dist/database/pg.js +0 -200
  48. package/dist/database/redis.d.ts +0 -31
  49. package/dist/database/redis.js +0 -176
  50. package/dist/database/seeder.d.ts +0 -20
  51. package/dist/database/seeder.js +0 -37
  52. package/dist/database/sqlite.d.ts +0 -26
  53. package/dist/database/sqlite.js +0 -211
  54. package/dist/database/telemetry.d.ts +0 -35
  55. package/dist/database/telemetry.js +0 -41
  56. package/dist/database/toon.d.ts +0 -33
  57. package/dist/database/toon.js +0 -244
  58. package/dist/database/types.d.ts +0 -71
  59. package/dist/database/types.js +0 -2
  60. package/dist/database/zpack.d.ts +0 -75
  61. package/dist/database/zpack.js +0 -616
  62. package/dist/functions/ai.d.ts +0 -126
  63. package/dist/functions/ai.js +0 -387
  64. package/dist/functions/index.d.ts +0 -223
  65. package/dist/functions/index.js +0 -686
  66. package/dist/functions/security.d.ts +0 -15
  67. package/dist/functions/security.js +0 -46
  68. package/dist/functions/toon.d.ts +0 -10
  69. package/dist/functions/toon.js +0 -214
  70. package/dist/functions/worker.d.ts +0 -5
  71. package/dist/functions/worker.js +0 -35
  72. package/dist/index.d.ts +0 -8
  73. package/dist/migrations/1767521950635_test_migration.d.ts +0 -3
  74. package/dist/migrations/1767521950635_test_migration.js +0 -11
  75. package/dist/migrations/1767522158826_create_users_table.d.ts +0 -2
  76. package/dist/migrations/1767522158826_create_users_table.js +0 -11
  77. package/dist/package.json +0 -79
  78. package/dist/tests/test.d.ts +0 -1
  79. package/dist/tests/test.js +0 -26
  80. package/dist/zero.config.d.ts +0 -10
  81. package/dist/zero.config.js +0 -13
@@ -1,223 +0,0 @@
1
- import * as security from './security';
2
- import * as toon from './toon';
3
- import * as ai from './ai';
4
- export declare function makeUniqueId(): string;
5
- export declare function randomArray<T>(arr: T[]): T;
6
- export declare function randomText(length?: number): string;
7
- export declare function randomNumber(min?: number, max?: number): number;
8
- export declare function randomEmoji(): string;
9
- export declare function randomHex(): string;
10
- export declare function randomFloat(min: number, max: number): number;
11
- export declare function titleCase(sentence: string): string;
12
- export declare function generateRandomString(length: number): string;
13
- export declare function generateSlug(text: string): string;
14
- export declare function wordCount(text: string): number;
15
- export declare function shuffleArray<T>(array: T[]): T[];
16
- export declare function flattenArray(arr: any[]): any[];
17
- export declare function removeFalsyValues<T>(arr: T[]): T[];
18
- export declare function groupBy<T>(arr: T[], key: keyof T): Record<string, T[]>;
19
- export declare function pluck<T, K extends keyof T>(arr: T[], key: K): T[K][];
20
- export declare function sortBy<T>(arr: T[], key: keyof T): T[];
21
- export declare function filterObjectByKey<T extends object>(obj: T, keys: string[]): Partial<T>;
22
- export declare function deepMerge(obj1: any, obj2: any): any;
23
- export declare function encryptText(text: string, secret: string): {
24
- encryptedText: string;
25
- iv: string;
26
- };
27
- export declare function decryptText(encryptedText: string, secret: string, ivHex: string): string;
28
- export declare function hashPassword(password: string): string;
29
- export declare function verifyPassword(password: string, hash: string): boolean;
30
- export declare function generateJWT(payload: object, secret: string): string;
31
- export declare function verifyJWT(token: string, secret: string): any;
32
- export declare function generateSalt(): string;
33
- export declare function validateUUID(uuid: string): boolean;
34
- export declare function isPasswordStrong(password: string): boolean;
35
- export declare function mean(arr: number[]): number;
36
- export declare function median(arr: number[]): number;
37
- export declare function variance(arr: number[]): number;
38
- export declare function standardDeviation(arr: number[]): number;
39
- export declare function sum(arr: number[]): number;
40
- export declare function max(arr: number[]): number;
41
- export declare function min(arr: number[]): number;
42
- export declare function range(start: number, end: number): number[];
43
- export declare function isPrime(num: number): boolean;
44
- export declare function factorial(n: number): number;
45
- export declare function combination(n: number, r: number): number;
46
- export declare function permutation(n: number, r: number): number;
47
- export declare function formatDate(date: Date, format?: string): string;
48
- export declare function dateDifference(date1: Date, date2: Date): number;
49
- export declare function addDays(date: Date, days: number): Date;
50
- export declare function subtractDays(date: Date, days: number): Date;
51
- export declare function fetchData(url: string): Promise<any>;
52
- export declare function postData(url: string, data: any): Promise<any>;
53
- export declare function isEmail(email: string): boolean;
54
- export declare function isPhone(phone: string): boolean;
55
- export declare function isURL(url: string): boolean;
56
- export declare function sanitizeHTML(html: string): string;
57
- export declare function validateCreditCard(cardNumber: string): boolean;
58
- export interface ValidationSchema {
59
- [key: string]: {
60
- required?: boolean;
61
- type?: string;
62
- minLength?: number;
63
- maxLength?: number;
64
- pattern?: RegExp;
65
- min?: number;
66
- max?: number;
67
- };
68
- }
69
- export declare function validateSchema(data: any, schema: ValidationSchema): {
70
- isValid: boolean;
71
- errors: string[];
72
- };
73
- export declare function sanitizeInput(input: any, options?: {
74
- trim?: boolean;
75
- removeHTML?: boolean;
76
- escape?: boolean;
77
- }): any;
78
- export type LogLevel = 'error' | 'warn' | 'info' | 'debug';
79
- export interface LoggerOptions {
80
- level?: LogLevel;
81
- enableColors?: boolean;
82
- enableTimestamp?: boolean;
83
- logFile?: string | null;
84
- }
85
- export declare class Logger {
86
- private level;
87
- private enableColors;
88
- private enableTimestamp;
89
- private logFile;
90
- private levels;
91
- private colors;
92
- constructor(options?: LoggerOptions);
93
- private shouldLog;
94
- private formatMessage;
95
- private writeToFile;
96
- log(level: LogLevel, message: string, data?: any): void;
97
- error(message: string, data?: any): void;
98
- warn(message: string, data?: any): void;
99
- info(message: string, data?: any): void;
100
- debug(message: string, data?: any): void;
101
- setLevel(level: LogLevel): void;
102
- getLevel(): LogLevel;
103
- }
104
- export declare function createLogger(options?: LoggerOptions): Logger;
105
- export declare function logInfo(message: string, data?: any): void;
106
- export declare function logError(message: string, data?: any): void;
107
- export declare function logWarn(message: string, data?: any): void;
108
- export declare function logDebug(message: string, data?: any): void;
109
- export declare const http_module: {
110
- fetchData: typeof fetchData;
111
- postData: typeof postData;
112
- };
113
- export declare const date_module: {
114
- formatDate: typeof formatDate;
115
- dateDifference: typeof dateDifference;
116
- addDays: typeof addDays;
117
- subtractDays: typeof subtractDays;
118
- };
119
- export declare const random_module: {
120
- makeUniqueId: typeof makeUniqueId;
121
- randomArray: typeof randomArray;
122
- randomText: typeof randomText;
123
- randomNumber: typeof randomNumber;
124
- randomEmoji: typeof randomEmoji;
125
- randomHex: typeof randomHex;
126
- randomFloat: typeof randomFloat;
127
- };
128
- export declare const string_module: {
129
- titleCase: typeof titleCase;
130
- generateRandomString: typeof generateRandomString;
131
- generateSlug: typeof generateSlug;
132
- wordCount: typeof wordCount;
133
- };
134
- export declare const array_module: {
135
- shuffleArray: typeof shuffleArray;
136
- flattenArray: typeof flattenArray;
137
- removeFalsyValues: typeof removeFalsyValues;
138
- groupBy: typeof groupBy;
139
- pluck: typeof pluck;
140
- sortBy: typeof sortBy;
141
- };
142
- export declare const object_module: {
143
- filterObjectByKey: typeof filterObjectByKey;
144
- deepMerge: typeof deepMerge;
145
- };
146
- export declare const crypto_module: {
147
- encryptText: typeof encryptText;
148
- decryptText: typeof decryptText;
149
- hashPassword: typeof hashPassword;
150
- verifyPassword: typeof verifyPassword;
151
- generateJWT: typeof generateJWT;
152
- verifyJWT: typeof verifyJWT;
153
- generateSalt: typeof generateSalt;
154
- validateUUID: typeof validateUUID;
155
- isPasswordStrong: typeof isPasswordStrong;
156
- };
157
- export declare const math_module: {
158
- mean: typeof mean;
159
- median: typeof median;
160
- variance: typeof variance;
161
- standardDeviation: typeof standardDeviation;
162
- sum: typeof sum;
163
- max: typeof max;
164
- min: typeof min;
165
- range: typeof range;
166
- isPrime: typeof isPrime;
167
- combination: typeof combination;
168
- permutation: typeof permutation;
169
- };
170
- export declare const validation_module: {
171
- isEmail: typeof isEmail;
172
- isPhone: typeof isPhone;
173
- isURL: typeof isURL;
174
- sanitizeHTML: typeof sanitizeHTML;
175
- validateCreditCard: typeof validateCreditCard;
176
- validateSchema: typeof validateSchema;
177
- sanitizeInput: typeof sanitizeInput;
178
- };
179
- export declare const logger_module: {
180
- createLogger: typeof createLogger;
181
- Logger: typeof Logger;
182
- info: typeof logInfo;
183
- error: typeof logError;
184
- warn: typeof logWarn;
185
- debug: typeof logDebug;
186
- };
187
- export declare const security_module: {
188
- checkRateLimit(key: string, options: security.RateLimiterOptions): Promise<{
189
- allowed: boolean;
190
- remaining: number;
191
- reset: number;
192
- }>;
193
- };
194
- export declare const worker_module: {
195
- runAsyncTask<T>(taskFn: string, data: any): Promise<T>;
196
- };
197
- export declare const toon_module: {
198
- stringify: typeof toon.stringify;
199
- parse: typeof toon.parse;
200
- };
201
- export declare const ai_module: {
202
- estimateTokens(text: string): number;
203
- truncateToTokenLimit(text: string, maxTokens: number): string;
204
- splitByTokenLimit(text: string, maxTokens: number): string[];
205
- formatChatMessage(role: "system" | "user" | "assistant", content: string): ai.ChatMessage;
206
- createFewShotPrompt(examples: Array<{
207
- input: string;
208
- output: string;
209
- }>, query: string): string;
210
- mergeSystemAndUser(systemPrompt: string, userPrompt: string): ai.ChatMessage[];
211
- fitMessagesToContext(messages: ai.ChatMessage[], maxTokens: number): ai.ChatMessage[];
212
- estimateConversationCost(messages: ai.ChatMessage[], model?: string, expectedOutputTokens?: number): ai.CostEstimate;
213
- getModelTokenLimit(model: string): number;
214
- getModelPricing(model: string): {
215
- input: number;
216
- output: number;
217
- };
218
- extractJSONFromMarkdown(text: string): any;
219
- parseStreamingChunk(chunk: string): ai.StreamingResponse;
220
- isTokenLimitExceeded(prompt: string, maxTokens: number): boolean;
221
- truncatePromptByPercentage(prompt: string, percentage: number): string;
222
- compressConversationHistory(messages: ai.ChatMessage[], keepRecent?: number, maxSummaryTokens?: number): ai.ChatMessage[];
223
- };