@btffamily/vacepey 1.0.1

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 (51) hide show
  1. package/build/brokers/nats/listener.ev.d.ts +29 -0
  2. package/build/brokers/nats/listener.ev.js +44 -0
  3. package/build/brokers/nats/publisher.ev.d.ts +19 -0
  4. package/build/brokers/nats/publisher.ev.js +28 -0
  5. package/build/brokers/nats/subjects.ev.d.ts +84 -0
  6. package/build/brokers/nats/subjects.ev.js +91 -0
  7. package/build/brokers/rabbitMQ/consumer.d.ts +35 -0
  8. package/build/brokers/rabbitMQ/consumer.js +74 -0
  9. package/build/brokers/rabbitMQ/exchanges.d.ts +36 -0
  10. package/build/brokers/rabbitMQ/exchanges.js +43 -0
  11. package/build/brokers/rabbitMQ/producer.d.ts +17 -0
  12. package/build/brokers/rabbitMQ/producer.js +40 -0
  13. package/build/dtos/word.dto.d.ts +11 -0
  14. package/build/dtos/word.dto.js +2 -0
  15. package/build/events/listener.ev.d.ts +29 -0
  16. package/build/events/listener.ev.js +44 -0
  17. package/build/events/publisher.ev.d.ts +19 -0
  18. package/build/events/publisher.ev.js +28 -0
  19. package/build/events/subjects.ev.d.ts +84 -0
  20. package/build/events/subjects.ev.js +91 -0
  21. package/build/index.d.ts +14 -0
  22. package/build/index.js +109 -0
  23. package/build/middleware/async.mw.d.ts +3 -0
  24. package/build/middleware/async.mw.js +4 -0
  25. package/build/middleware/auth.mw.d.ts +24 -0
  26. package/build/middleware/auth.mw.js +98 -0
  27. package/build/middleware/db.mw.d.ts +6 -0
  28. package/build/middleware/db.mw.js +43 -0
  29. package/build/middleware/redis.mw.d.ts +19 -0
  30. package/build/middleware/redis.mw.js +28 -0
  31. package/build/middleware/role.mw.d.ts +4 -0
  32. package/build/middleware/role.mw.js +19 -0
  33. package/build/services/mongo.service.d.ts +7 -0
  34. package/build/services/mongo.service.js +14 -0
  35. package/build/services/random.service.d.ts +8 -0
  36. package/build/services/random.service.js +30 -0
  37. package/build/services/word.service.d.ts +8 -0
  38. package/build/services/word.service.js +73 -0
  39. package/build/src/ca-certificate.crt +32 -0
  40. package/build/src/index.ts +192 -0
  41. package/build/utils/cache.util.d.ts +3 -0
  42. package/build/utils/cache.util.js +7 -0
  43. package/build/utils/encryption.util.d.ts +66 -0
  44. package/build/utils/encryption.util.js +208 -0
  45. package/build/utils/functions.util.d.ts +133 -0
  46. package/build/utils/functions.util.js +1032 -0
  47. package/build/utils/snippets/decryption.snippet.d.ts +0 -0
  48. package/build/utils/snippets/decryption.snippet.js +255 -0
  49. package/build/utils/types.util.d.ts +58 -0
  50. package/build/utils/types.util.js +2 -0
  51. package/package.json +49 -0
@@ -0,0 +1,133 @@
1
+ import mongoose from 'mongoose';
2
+ import { DateCompare, IArrayToObject, IBase64ToString, IDateToday, IDateIsPast, IDatesSplit, IMonthsSplit, ISlugit, IStringToBase64, FormatDateType } from './types.util';
3
+ import { AxiosRequestConfig } from 'axios';
4
+ export declare const slugit: (payload: ISlugit) => string;
5
+ export declare const charLen: (data: string) => number;
6
+ export declare const wordLen: (data: string) => number;
7
+ export declare const isObject: (arg: any) => boolean;
8
+ export declare const isString: (arg: any) => boolean;
9
+ export declare const isArray: (arg: any) => boolean;
10
+ export declare const strToArray: (arg: string, split: string) => Array<string>;
11
+ export declare const strToArrayEs6: (arg: string, split: string) => Array<string>;
12
+ export declare const strIncludes: (arg: any, inc: string) => boolean;
13
+ export declare const strIncludesEs6: (arg: any, inc: string) => boolean;
14
+ export declare const arrayIncludesEs6: (arr: Array<any>, inc: string) => boolean;
15
+ export declare const arrayIncludes: (arr: Array<any>, inc: string) => boolean;
16
+ export declare const listIncludes: (data: {
17
+ arr: Array<string>;
18
+ list: Array<string>;
19
+ type: 'some' | 'every';
20
+ }) => boolean;
21
+ export declare const timeToMinutes: (data: {
22
+ hr: number;
23
+ min: number;
24
+ sec: number;
25
+ }) => number;
26
+ export declare const rangeFromMinutes: (dur: number) => {
27
+ start: Date;
28
+ end: Date;
29
+ diff: number;
30
+ };
31
+ export declare const dateToWord: (date: any) => string;
32
+ export declare const dateToWordRaw: () => string;
33
+ export declare const isEmptyObject: (obj: object) => boolean;
34
+ export declare const isBase64: (data: string) => boolean;
35
+ export declare const getBase64Mime: (data: string) => string;
36
+ export declare const capitalize: (word: string, each?: boolean) => string;
37
+ export declare const convertUrlToBase64: (url: string) => Promise<any>;
38
+ export declare const urlToBase64: (url: string, headers?: AxiosRequestConfig['headers']) => Promise<string | undefined>;
39
+ export declare const leadingNum: (val: number, length?: number, pad?: string) => string;
40
+ export declare const daysOfWeek: () => Array<{
41
+ id: number;
42
+ name: string;
43
+ }>;
44
+ export declare const monthsOfYear: () => Array<{
45
+ id: number;
46
+ name: string;
47
+ }>;
48
+ export declare const formatDate: (date: any, type: FormatDateType) => string;
49
+ export declare const dateToday: (d?: any) => IDateToday;
50
+ export declare const sortData: (data: Array<any>, prop?: string) => Array<any>;
51
+ export declare const rearrangeArray: (from: number, to: number, arr: Array<any>) => Array<any>;
52
+ export declare const isObjectId: (val: string) => boolean;
53
+ export declare const isPos: (val: number) => boolean;
54
+ export declare const isNeg: (val: number) => boolean;
55
+ export declare const isNumber: (val: any) => boolean;
56
+ export declare const isZero: (val: any) => boolean;
57
+ export declare const checkDateFormat: (date: string) => boolean;
58
+ export declare const checkTimeFormat: (time: string) => boolean;
59
+ export declare const dateIsToday: (date: string) => boolean;
60
+ export declare const dateIsYesterday: (date: string) => boolean;
61
+ export declare const dateIsEqual: (fDate: string, lDate: string) => boolean;
62
+ export declare const dateIsPast: (data: IDateIsPast) => boolean;
63
+ export declare const dateIsFuture: (today: string, date: string) => boolean;
64
+ export declare const yesterdayFromDate: (date: string) => string;
65
+ export declare const daysFromDates: (data: {
66
+ start: string;
67
+ end: string;
68
+ dir: 'default' | 'reverse';
69
+ }) => number;
70
+ export declare const generate: (size: number, options: {
71
+ type: 'code' | 'alpha' | 'num';
72
+ alpha: boolean;
73
+ }) => string;
74
+ export declare const notDefined: (val: any, truthy?: boolean) => boolean;
75
+ export declare const isDefined: (val: any, truthy?: boolean) => boolean;
76
+ export declare const isPrecise: (data: {
77
+ value: number | string;
78
+ length: number;
79
+ }) => boolean;
80
+ export declare const hasDecimal: (value: number | string) => boolean;
81
+ export declare const toDecimal: (value: number, places: number) => number;
82
+ export declare const UIID: (batch?: number) => string;
83
+ export declare const compareISODate: (dateA: string, dateB: string, type: DateCompare) => boolean;
84
+ export declare const getWeeksDates: (year: number, month: number, data: Array<IMonthsSplit>) => Array<IDatesSplit>;
85
+ export declare const getDatesInRange: (start: string, end: string) => Array<string>;
86
+ export declare const getWeeksInMonth: (year: number, month: number) => Array<IMonthsSplit>;
87
+ export declare const validateBase64: (data: string) => boolean;
88
+ export declare const getCodeFromName: (name: string) => string;
89
+ /**
90
+ * @name getDaysFromDates
91
+ * @param prev
92
+ * @param next
93
+ * @returns
94
+ */
95
+ export declare const getDaysFromDates: (then: string, now: string) => number;
96
+ /**
97
+ * @name firstDayOfMonth
98
+ * @param d
99
+ * @returns
100
+ */
101
+ export declare const firstDayOfMonth: (d?: string) => {
102
+ date: Date;
103
+ converted: IDateToday;
104
+ };
105
+ /**
106
+ * @name lastDayOfMonth
107
+ * @param d
108
+ * @returns
109
+ */
110
+ export declare const lastDayOfMonth: (d?: string) => {
111
+ date: Date;
112
+ converted: IDateToday;
113
+ };
114
+ export declare const formatISO: (ISO: string) => {
115
+ date: string;
116
+ time: string;
117
+ };
118
+ export declare const hasSAC: (value: string) => boolean;
119
+ export declare const enumToArray: (data: Object, type: 'all' | 'values-only' | 'keys-only') => any[];
120
+ export declare const objectToArray: (data: Object) => {
121
+ key: any;
122
+ value: any;
123
+ type: any;
124
+ }[];
125
+ export declare const isJson: (value: string) => boolean;
126
+ export declare const arrayToObject: (data: Array<IArrayToObject>) => any;
127
+ export declare const arrayToSingleObject: (data: Array<any>) => any;
128
+ export declare const stringToBase64: (data: IStringToBase64) => string;
129
+ export declare const base64ToString: (data: IBase64ToString) => string;
130
+ export declare const dateFromWeekNumber: (weekNum: number) => IDateToday;
131
+ export declare const weekStartDate: (date: string) => IDateToday;
132
+ export declare const weekEndDate: (date: string) => IDateToday;
133
+ export declare const toMongoId: (id: string) => mongoose.Types.ObjectId;