@imqueue/pg-sequelize 4.2.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 (63) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/CONTRIBUTING.md +58 -0
  3. package/CONTRIBUTION-TERMS.md +79 -0
  4. package/LICENSE +585 -0
  5. package/README.md +94 -0
  6. package/SECURITY.md +41 -0
  7. package/index.d.ts +86 -0
  8. package/index.js +87 -0
  9. package/package.json +75 -0
  10. package/src/BaseModel.d.ts +695 -0
  11. package/src/BaseModel.js +917 -0
  12. package/src/Graph.d.ts +215 -0
  13. package/src/Graph.js +257 -0
  14. package/src/decorators/AssociatedWith.d.ts +94 -0
  15. package/src/decorators/AssociatedWith.js +71 -0
  16. package/src/decorators/ColumnIndex.d.ts +206 -0
  17. package/src/decorators/ColumnIndex.js +98 -0
  18. package/src/decorators/CreatedBy.d.ts +27 -0
  19. package/src/decorators/CreatedBy.js +84 -0
  20. package/src/decorators/DeletedBy.d.ts +30 -0
  21. package/src/decorators/DeletedBy.js +89 -0
  22. package/src/decorators/DynamicView.d.ts +124 -0
  23. package/src/decorators/DynamicView.js +113 -0
  24. package/src/decorators/Emittable.d.ts +39 -0
  25. package/src/decorators/Emittable.js +42 -0
  26. package/src/decorators/NullableIndex.d.ts +77 -0
  27. package/src/decorators/NullableIndex.js +64 -0
  28. package/src/decorators/UpdatedBy.d.ts +27 -0
  29. package/src/decorators/UpdatedBy.js +105 -0
  30. package/src/decorators/View.d.ts +87 -0
  31. package/src/decorators/View.js +93 -0
  32. package/src/decorators/index.d.ts +32 -0
  33. package/src/decorators/index.js +33 -0
  34. package/src/helpers/index.d.ts +24 -0
  35. package/src/helpers/index.js +25 -0
  36. package/src/helpers/js.d.ts +61 -0
  37. package/src/helpers/js.js +88 -0
  38. package/src/helpers/query.d.ts +445 -0
  39. package/src/helpers/query.js +1095 -0
  40. package/src/index.d.ts +162 -0
  41. package/src/index.js +223 -0
  42. package/src/types/DataPage.d.ts +52 -0
  43. package/src/types/DataPage.js +2 -0
  44. package/src/types/FieldsInput.d.ts +41 -0
  45. package/src/types/FieldsInput.js +75 -0
  46. package/src/types/FilterInput.d.ts +136 -0
  47. package/src/types/FilterInput.js +291 -0
  48. package/src/types/JsonObject.d.ts +16 -0
  49. package/src/types/JsonObject.js +50 -0
  50. package/src/types/OrderByInput.d.ts +45 -0
  51. package/src/types/OrderByInput.js +80 -0
  52. package/src/types/PaginationInput.d.ts +44 -0
  53. package/src/types/PaginationInput.js +90 -0
  54. package/src/types/index.d.ts +30 -0
  55. package/src/types/index.js +31 -0
  56. package/src/types/ranges/DateRange.d.ts +27 -0
  57. package/src/types/ranges/DateRange.js +69 -0
  58. package/src/types/ranges/IRange.d.ts +47 -0
  59. package/src/types/ranges/IRange.js +2 -0
  60. package/src/types/ranges/NumericRange.d.ts +19 -0
  61. package/src/types/ranges/NumericRange.js +61 -0
  62. package/src/types/ranges/index.d.ts +26 -0
  63. package/src/types/ranges/index.js +27 -0
@@ -0,0 +1,32 @@
1
+ /*!
2
+ * @imqueue/pg-sequelize - Sequelize ORM refines for @imqueue
3
+ *
4
+ * I'm Queue Software Project
5
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ *
20
+ * If you want to use this code in a closed source (commercial) project, you can
21
+ * purchase a proprietary commercial license. Please contact us at
22
+ * <support@imqueue.com> to get commercial licensing options.
23
+ */
24
+ export * from './CreatedBy.js';
25
+ export * from './UpdatedBy.js';
26
+ export * from './DeletedBy.js';
27
+ export * from './DynamicView.js';
28
+ export * from './View.js';
29
+ export * from './NullableIndex.js';
30
+ export * from './AssociatedWith.js';
31
+ export * from './ColumnIndex.js';
32
+ export * from './Emittable.js';
@@ -0,0 +1,33 @@
1
+ /*!
2
+ * @imqueue/pg-sequelize - Sequelize ORM refines for @imqueue
3
+ *
4
+ * I'm Queue Software Project
5
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ *
20
+ * If you want to use this code in a closed source (commercial) project, you can
21
+ * purchase a proprietary commercial license. Please contact us at
22
+ * <support@imqueue.com> to get commercial licensing options.
23
+ */
24
+ export * from './CreatedBy.js';
25
+ export * from './UpdatedBy.js';
26
+ export * from './DeletedBy.js';
27
+ export * from './DynamicView.js';
28
+ export * from './View.js';
29
+ export * from './NullableIndex.js';
30
+ export * from './AssociatedWith.js';
31
+ export * from './ColumnIndex.js';
32
+ export * from './Emittable.js';
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * @imqueue/pg-sequelize - Sequelize ORM refines for @imqueue
3
+ *
4
+ * I'm Queue Software Project
5
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ *
20
+ * If you want to use this code in a closed source (commercial) project, you can
21
+ * purchase a proprietary commercial license. Please contact us at
22
+ * <support@imqueue.com> to get commercial licensing options.
23
+ */
24
+ export * from './query.js';
@@ -0,0 +1,25 @@
1
+ /*!
2
+ * @imqueue/pg-sequelize - Sequelize ORM refines for @imqueue
3
+ *
4
+ * I'm Queue Software Project
5
+ * Copyright (C) 2025 imqueue.com <support@imqueue.com>
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ *
20
+ * If you want to use this code in a closed source (commercial) project, you can
21
+ * purchase a proprietary commercial license. Please contact us at
22
+ * <support@imqueue.com> to get commercial licensing options.
23
+ */
24
+ export * from './query.js';
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,61 @@
1
+ /*!
2
+ * @imqueue/pg-sequelize - Sequelize ORM refines for @imqueue
3
+ *
4
+ * I'm Queue Software Project
5
+ * Copyright (C) 2026 imqueue.com <support@imqueue.com>
6
+ *
7
+ * Permission to use, copy, modify, and/or distribute this software for any
8
+ * purpose with or without fee is hereby granted, provided that the above
9
+ * copyright notice and this permission notice appear in all copies.
10
+ *
11
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13
+ * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
+ * PERFORMANCE OF THIS SOFTWARE.
18
+ */
19
+ /**
20
+ * Type guard helpers, inlined from @imqueue/js (only the handful this
21
+ * package actually uses), preserving the original semantics exactly.
22
+ */
23
+ /**
24
+ * Returns true if a given value is not undefined or null, false otherwise
25
+ *
26
+ * @param value
27
+ */
28
+ export declare function isDefined(value: any): boolean;
29
+ /**
30
+ * Returns true if a given value is defined and is truthy
31
+ *
32
+ * @param value
33
+ */
34
+ export declare function isOk(value: any): boolean;
35
+ /**
36
+ * Returns true if a given value is object-like (arrays included,
37
+ * functions excluded)
38
+ *
39
+ * @param obj
40
+ */
41
+ export declare function isObject(obj: any): boolean;
42
+ /**
43
+ * Checks if a given value is Array
44
+ *
45
+ * @param value
46
+ */
47
+ export declare function isArray(value: any): boolean;
48
+ /**
49
+ * Returns true if a given value is null, undefined, serializes to an empty
50
+ * string or is an object without own enumerable keys
51
+ *
52
+ * @param value
53
+ */
54
+ export declare function isEmpty(value: any): boolean;
55
+ /**
56
+ * Recursively checks if property contains value.
57
+ * If no - it will be deleted from object
58
+ *
59
+ * @param obj
60
+ */
61
+ export declare function clearObject(obj: any): boolean;
@@ -0,0 +1,88 @@
1
+ /*!
2
+ * @imqueue/pg-sequelize - Sequelize ORM refines for @imqueue
3
+ *
4
+ * I'm Queue Software Project
5
+ * Copyright (C) 2026 imqueue.com <support@imqueue.com>
6
+ *
7
+ * Permission to use, copy, modify, and/or distribute this software for any
8
+ * purpose with or without fee is hereby granted, provided that the above
9
+ * copyright notice and this permission notice appear in all copies.
10
+ *
11
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13
+ * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
+ * PERFORMANCE OF THIS SOFTWARE.
18
+ */
19
+ /**
20
+ * Type guard helpers, inlined from @imqueue/js (only the handful this
21
+ * package actually uses), preserving the original semantics exactly.
22
+ */
23
+ /**
24
+ * Returns true if a given value is not undefined or null, false otherwise
25
+ *
26
+ * @param value
27
+ */
28
+ export function isDefined(value) {
29
+ return typeof value !== 'undefined' && value !== null;
30
+ }
31
+ /**
32
+ * Returns true if a given value is defined and is truthy
33
+ *
34
+ * @param value
35
+ */
36
+ export function isOk(value) {
37
+ return !!(isDefined(value) && value);
38
+ }
39
+ /**
40
+ * Returns true if a given value is object-like (arrays included,
41
+ * functions excluded)
42
+ *
43
+ * @param obj
44
+ */
45
+ export function isObject(obj) {
46
+ return typeof obj !== 'function' && Object(obj) === obj;
47
+ }
48
+ /**
49
+ * Checks if a given value is Array
50
+ *
51
+ * @param value
52
+ */
53
+ export function isArray(value) {
54
+ return Array.isArray(value);
55
+ }
56
+ /**
57
+ * Returns true if a given value is null, undefined, serializes to an empty
58
+ * string or is an object without own enumerable keys
59
+ *
60
+ * @param value
61
+ */
62
+ export function isEmpty(value) {
63
+ return (!isDefined(value) ||
64
+ `${value}` === '' ||
65
+ (isObject(value) && !Object.keys(value).length));
66
+ }
67
+ /**
68
+ * Recursively checks if property contains value.
69
+ * If no - it will be deleted from object
70
+ *
71
+ * @param obj
72
+ */
73
+ export function clearObject(obj) {
74
+ let empty = true;
75
+ for (const [key, value] of Object.entries(obj)) {
76
+ empty = isEmpty(value)
77
+ ? true
78
+ : isObject(value)
79
+ ? clearObject(value) || isEmpty(value)
80
+ : false;
81
+ if (empty) {
82
+ delete obj[key];
83
+ empty = false;
84
+ }
85
+ }
86
+ return empty;
87
+ }
88
+ //# sourceMappingURL=js.js.map