@carbonorm/carbonnode 2.0.34 → 3.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 (77) hide show
  1. package/dist/api/carbonSqlExecutor.d.ts +17 -0
  2. package/dist/api/interfaces/ormInterfaces.d.ts +22 -1
  3. package/dist/api/rest/Blog_Categories.d.ts +37 -0
  4. package/dist/api/rest/Blog_Categories.test.d.ts +11 -0
  5. package/dist/api/rest/Blog_Images.d.ts +37 -0
  6. package/dist/api/rest/Blog_Images.test.d.ts +15 -0
  7. package/dist/api/rest/Blog_Post_Categories.d.ts +37 -0
  8. package/dist/api/rest/Blog_Post_Categories.test.d.ts +13 -0
  9. package/dist/api/rest/Blog_Post_Tags.d.ts +37 -0
  10. package/dist/api/rest/Blog_Post_Tags.test.d.ts +13 -0
  11. package/dist/api/rest/Blog_Posts.d.ts +37 -0
  12. package/dist/api/rest/Blog_Posts.test.d.ts +21 -0
  13. package/dist/api/rest/Blog_Tags.d.ts +37 -0
  14. package/dist/api/rest/Blog_Tags.test.d.ts +11 -0
  15. package/dist/api/rest/C6.d.ts +1000 -0
  16. package/dist/api/rest/Cache.d.ts +37 -0
  17. package/dist/api/rest/Cache.test.d.ts +12 -0
  18. package/dist/api/rest/Cities.d.ts +37 -0
  19. package/dist/api/rest/Cities.test.d.ts +17 -0
  20. package/dist/api/rest/Counties.d.ts +37 -0
  21. package/dist/api/rest/Counties.test.d.ts +18 -0
  22. package/dist/api/rest/Countries.d.ts +37 -0
  23. package/dist/api/rest/Countries.test.d.ts +24 -0
  24. package/dist/api/rest/Geometries.d.ts +37 -0
  25. package/dist/api/rest/Geometries.test.d.ts +16 -0
  26. package/dist/api/rest/Images.d.ts +37 -0
  27. package/dist/api/rest/Images.test.d.ts +16 -0
  28. package/dist/api/rest/Land_Section_Info.d.ts +37 -0
  29. package/dist/api/rest/Land_Section_Info.test.d.ts +15 -0
  30. package/dist/api/rest/Neighborhoods.d.ts +37 -0
  31. package/dist/api/rest/Neighborhoods.test.d.ts +12 -0
  32. package/dist/api/rest/Parcel_Building_Details.d.ts +37 -0
  33. package/dist/api/rest/Parcel_Building_Details.test.d.ts +40 -0
  34. package/dist/api/rest/Parcel_Neighborhoods.d.ts +37 -0
  35. package/dist/api/rest/Parcel_Neighborhoods.test.d.ts +15 -0
  36. package/dist/api/rest/Parcel_Owners.d.ts +37 -0
  37. package/dist/api/rest/Parcel_Owners.test.d.ts +23 -0
  38. package/dist/api/rest/Parcel_Sales.d.ts +37 -0
  39. package/dist/api/rest/Parcel_Sales.test.d.ts +19 -0
  40. package/dist/api/rest/Parcel_Tax_History.d.ts +37 -0
  41. package/dist/api/rest/Parcel_Tax_History.test.d.ts +24 -0
  42. package/dist/api/rest/Parcels.d.ts +37 -0
  43. package/dist/api/rest/Parcels.test.d.ts +42 -0
  44. package/dist/api/rest/Payment_Charge_Logs.d.ts +37 -0
  45. package/dist/api/rest/Payment_Charge_Logs.test.d.ts +17 -0
  46. package/dist/api/rest/Payment_Subscriptions.d.ts +37 -0
  47. package/dist/api/rest/Payment_Subscriptions.test.d.ts +20 -0
  48. package/dist/api/rest/Property_Units.d.ts +37 -0
  49. package/dist/api/rest/Property_Units.test.d.ts +55 -0
  50. package/dist/api/rest/Sources.d.ts +37 -0
  51. package/dist/api/rest/Sources.test.d.ts +17 -0
  52. package/dist/api/rest/States.d.ts +37 -0
  53. package/dist/api/rest/States.test.d.ts +20 -0
  54. package/dist/api/rest/Tax_Districts.d.ts +37 -0
  55. package/dist/api/rest/Tax_Districts.test.d.ts +12 -0
  56. package/dist/api/rest/Users.d.ts +37 -0
  57. package/dist/api/rest/Users.test.d.ts +14 -0
  58. package/dist/api/rest/Valuation_Reports.d.ts +37 -0
  59. package/dist/api/rest/Valuation_Reports.test.d.ts +36 -0
  60. package/dist/api/rest/Zip_Codes.d.ts +37 -0
  61. package/dist/api/rest/Zip_Codes.test.d.ts +15 -0
  62. package/dist/api/restRequest.d.ts +39 -16
  63. package/dist/index.cjs.js +881 -454
  64. package/dist/index.cjs.js.map +1 -1
  65. package/dist/index.d.ts +3 -0
  66. package/dist/index.esm.js +881 -456
  67. package/dist/index.esm.js.map +1 -1
  68. package/dist/variables/isNode.d.ts +2 -0
  69. package/package.json +14 -4
  70. package/scripts/assets/handlebars/C6.ts.handlebars +5 -1
  71. package/scripts/generateRestBindings.cjs +89 -23
  72. package/scripts/generateRestBindings.ts +100 -27
  73. package/src/api/carbonSqlExecutor.ts +279 -0
  74. package/src/api/interfaces/ormInterfaces.ts +9 -1
  75. package/src/api/restRequest.ts +164 -19
  76. package/src/index.ts +3 -0
  77. package/src/variables/isNode.ts +3 -0
@@ -0,0 +1,37 @@
1
+ import { iPostC6RestResponse, iDeleteC6RestResponse, iGetC6RestResponse, iPutC6RestResponse } from "@carbonorm/carbonnode";
2
+ import { iTax_Districts } from "./C6";
3
+ declare const Tax_Districts: {
4
+ Get: (request?: Omit<iTax_Districts, never> & {
5
+ dataInsertMultipleRows?: Omit<iTax_Districts, never>[] | undefined;
6
+ cacheResults?: boolean;
7
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
8
+ debug?: boolean;
9
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
10
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
11
+ }) => Promise<(() => import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<iTax_Districts>>) | import("axios").AxiosResponse<iGetC6RestResponse<iTax_Districts>, any> | null | undefined>;
12
+ Post: (request?: Omit<iTax_Districts, never> & {
13
+ dataInsertMultipleRows?: Omit<iTax_Districts, never>[] | undefined;
14
+ cacheResults?: boolean;
15
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
16
+ debug?: boolean;
17
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
18
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
19
+ }) => Promise<import("axios").AxiosResponse<iPostC6RestResponse<iTax_Districts>, any> | null | undefined>;
20
+ Put: (request?: Omit<iTax_Districts, never> & {
21
+ dataInsertMultipleRows?: Omit<iTax_Districts, never>[] | undefined;
22
+ cacheResults?: boolean;
23
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
24
+ debug?: boolean;
25
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
26
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
27
+ }) => Promise<import("axios").AxiosResponse<iPutC6RestResponse<iTax_Districts, any>, any> | null | undefined>;
28
+ Delete: (request?: Omit<iTax_Districts, never> & {
29
+ dataInsertMultipleRows?: Omit<iTax_Districts, never>[] | undefined;
30
+ cacheResults?: boolean;
31
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
32
+ debug?: boolean;
33
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
34
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
35
+ }) => Promise<import("axios").AxiosResponse<iDeleteC6RestResponse<iTax_Districts, any>, any> | null | undefined>;
36
+ };
37
+ export default Tax_Districts;
@@ -0,0 +1,12 @@
1
+ import { iTax_Districts } from "api/rest/C6";
2
+ /**
3
+ CREATE TABLE `tax_districts` (
4
+ `tax_district_no` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
5
+ `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
6
+ `reduced_mill_levy` decimal(8,2) DEFAULT NULL,
7
+ `reduced_tax_rate` decimal(8,4) DEFAULT NULL,
8
+ PRIMARY KEY (`tax_district_no`)
9
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
10
+ **/
11
+ declare const Test_Data: iTax_Districts;
12
+ export default Test_Data;
@@ -0,0 +1,37 @@
1
+ import { iPostC6RestResponse, iDeleteC6RestResponse, iGetC6RestResponse, iPutC6RestResponse } from "@carbonorm/carbonnode";
2
+ import { iUsers } from "./C6";
3
+ declare const Users: {
4
+ Get: (request?: Omit<iUsers, never> & {
5
+ dataInsertMultipleRows?: Omit<iUsers, never>[] | undefined;
6
+ cacheResults?: boolean;
7
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
8
+ debug?: boolean;
9
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
10
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
11
+ }) => Promise<(() => import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<iUsers>>) | import("axios").AxiosResponse<iGetC6RestResponse<iUsers>, any> | null | undefined>;
12
+ Post: (request?: Omit<iUsers, never> & {
13
+ dataInsertMultipleRows?: Omit<iUsers, never>[] | undefined;
14
+ cacheResults?: boolean;
15
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
16
+ debug?: boolean;
17
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
18
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
19
+ }) => Promise<import("axios").AxiosResponse<iPostC6RestResponse<iUsers>, any> | null | undefined>;
20
+ Put: (request?: Omit<iUsers, never> & {
21
+ dataInsertMultipleRows?: Omit<iUsers, never>[] | undefined;
22
+ cacheResults?: boolean;
23
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
24
+ debug?: boolean;
25
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
26
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
27
+ }) => Promise<import("axios").AxiosResponse<iPutC6RestResponse<iUsers, any>, any> | null | undefined>;
28
+ Delete: (request?: Omit<iUsers, never> & {
29
+ dataInsertMultipleRows?: Omit<iUsers, never>[] | undefined;
30
+ cacheResults?: boolean;
31
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
32
+ debug?: boolean;
33
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
34
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
35
+ }) => Promise<import("axios").AxiosResponse<iDeleteC6RestResponse<iUsers, any>, any> | null | undefined>;
36
+ };
37
+ export default Users;
@@ -0,0 +1,14 @@
1
+ import { iUsers } from "api/rest/C6";
2
+ /**
3
+ CREATE TABLE `users` (
4
+ `user_id` binary(16) NOT NULL,
5
+ `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
6
+ `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
7
+ `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
8
+ `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
9
+ PRIMARY KEY (`user_id`),
10
+ UNIQUE KEY `email` (`email`)
11
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
12
+ **/
13
+ declare const Test_Data: iUsers;
14
+ export default Test_Data;
@@ -0,0 +1,37 @@
1
+ import { iPostC6RestResponse, iDeleteC6RestResponse, iGetC6RestResponse, iPutC6RestResponse } from "@carbonorm/carbonnode";
2
+ import { iValuation_Reports } from "./C6";
3
+ declare const Valuation_Reports: {
4
+ Get: (request?: Omit<iValuation_Reports, never> & {
5
+ dataInsertMultipleRows?: Omit<iValuation_Reports, never>[] | undefined;
6
+ cacheResults?: boolean;
7
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
8
+ debug?: boolean;
9
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
10
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
11
+ }) => Promise<(() => import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<iValuation_Reports>>) | import("axios").AxiosResponse<iGetC6RestResponse<iValuation_Reports>, any> | null | undefined>;
12
+ Post: (request?: Omit<iValuation_Reports, never> & {
13
+ dataInsertMultipleRows?: Omit<iValuation_Reports, never>[] | undefined;
14
+ cacheResults?: boolean;
15
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
16
+ debug?: boolean;
17
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
18
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
19
+ }) => Promise<import("axios").AxiosResponse<iPostC6RestResponse<iValuation_Reports>, any> | null | undefined>;
20
+ Put: (request?: Omit<iValuation_Reports, never> & {
21
+ dataInsertMultipleRows?: Omit<iValuation_Reports, never>[] | undefined;
22
+ cacheResults?: boolean;
23
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
24
+ debug?: boolean;
25
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
26
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
27
+ }) => Promise<import("axios").AxiosResponse<iPutC6RestResponse<iValuation_Reports, any>, any> | null | undefined>;
28
+ Delete: (request?: Omit<iValuation_Reports, never> & {
29
+ dataInsertMultipleRows?: Omit<iValuation_Reports, never>[] | undefined;
30
+ cacheResults?: boolean;
31
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
32
+ debug?: boolean;
33
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
34
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
35
+ }) => Promise<import("axios").AxiosResponse<iDeleteC6RestResponse<iValuation_Reports, any>, any> | null | undefined>;
36
+ };
37
+ export default Valuation_Reports;
@@ -0,0 +1,36 @@
1
+ import { iValuation_Reports } from "api/rest/C6";
2
+ /**
3
+ CREATE TABLE `valuation_reports` (
4
+ `report_id` binary(16) NOT NULL DEFAULT (uuid_to_bin(uuid(),1)),
5
+ `unit_id` binary(16) NOT NULL,
6
+ `report_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
7
+ `report_data` json NOT NULL,
8
+ `sale_price` decimal(12,4) DEFAULT NULL,
9
+ `tax_amount` decimal(10,4) DEFAULT NULL,
10
+ `savings` decimal(12,4) DEFAULT NULL,
11
+ `agency` decimal(12,4) DEFAULT NULL,
12
+ `status` enum('Ordered','Assigned','Submitted','BOE Required','BOE Scheduled','BOE Complete','Successful','Failed','Refunded') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
13
+ `assigned_to` binary(16) DEFAULT NULL,
14
+ `report_creator` binary(16) DEFAULT NULL,
15
+ `report_filler` binary(16) DEFAULT NULL,
16
+ `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
17
+ `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
18
+ `assessment_year_start` datetime NOT NULL,
19
+ `assessment_year_end` datetime NOT NULL,
20
+ `sales_year_start` datetime NOT NULL,
21
+ `sales_year_end` datetime NOT NULL,
22
+ PRIMARY KEY (`report_id`),
23
+ KEY `idx_unit_id` (`unit_id`),
24
+ KEY `idx_status` (`status`),
25
+ KEY `idx_assigned_to` (`assigned_to`),
26
+ KEY `fk_valuation_reports_user_2` (`report_creator`),
27
+ CONSTRAINT `fk_valuation_reports_unit` FOREIGN KEY (`unit_id`) REFERENCES `property_units` (`unit_id`) ON DELETE CASCADE,
28
+ CONSTRAINT `fk_valuation_reports_user_1` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`user_id`) ON DELETE CASCADE,
29
+ CONSTRAINT `fk_valuation_reports_user_2` FOREIGN KEY (`report_creator`) REFERENCES `users` (`user_id`) ON DELETE CASCADE,
30
+ CONSTRAINT `fk_valuation_reports_user_3` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`user_id`) ON DELETE CASCADE,
31
+ CONSTRAINT `valuation_reports_chk_1` CHECK ((`assessment_year_start` <= `assessment_year_end`)),
32
+ CONSTRAINT `valuation_reports_chk_2` CHECK ((`sales_year_start` <= `sales_year_end`))
33
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
34
+ **/
35
+ declare const Test_Data: iValuation_Reports;
36
+ export default Test_Data;
@@ -0,0 +1,37 @@
1
+ import { iPostC6RestResponse, iDeleteC6RestResponse, iGetC6RestResponse, iPutC6RestResponse } from "@carbonorm/carbonnode";
2
+ import { iZip_Codes } from "./C6";
3
+ declare const Zip_Codes: {
4
+ Get: (request?: Omit<iZip_Codes, never> & {
5
+ dataInsertMultipleRows?: Omit<iZip_Codes, never>[] | undefined;
6
+ cacheResults?: boolean;
7
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
8
+ debug?: boolean;
9
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
10
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
11
+ }) => Promise<(() => import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<iZip_Codes>>) | import("axios").AxiosResponse<iGetC6RestResponse<iZip_Codes>, any> | null | undefined>;
12
+ Post: (request?: Omit<iZip_Codes, never> & {
13
+ dataInsertMultipleRows?: Omit<iZip_Codes, never>[] | undefined;
14
+ cacheResults?: boolean;
15
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
16
+ debug?: boolean;
17
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
18
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
19
+ }) => Promise<import("axios").AxiosResponse<iPostC6RestResponse<iZip_Codes>, any> | null | undefined>;
20
+ Put: (request?: Omit<iZip_Codes, never> & {
21
+ dataInsertMultipleRows?: Omit<iZip_Codes, never>[] | undefined;
22
+ cacheResults?: boolean;
23
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
24
+ debug?: boolean;
25
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
26
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
27
+ }) => Promise<import("axios").AxiosResponse<iPutC6RestResponse<iZip_Codes, any>, any> | null | undefined>;
28
+ Delete: (request?: Omit<iZip_Codes, never> & {
29
+ dataInsertMultipleRows?: Omit<iZip_Codes, never>[] | undefined;
30
+ cacheResults?: boolean;
31
+ fetchDependencies?: number | import("@carbonorm/carbonnode").eFetchDependencies | Awaited<import("@carbonorm/carbonnode").apiReturn<iGetC6RestResponse<any>>>[];
32
+ debug?: boolean;
33
+ success?: string | ((r: import("axios").AxiosResponse) => (string | void));
34
+ error?: string | ((r: import("axios").AxiosResponse) => (string | void));
35
+ }) => Promise<import("axios").AxiosResponse<iDeleteC6RestResponse<iZip_Codes, any>, any> | null | undefined>;
36
+ };
37
+ export default Zip_Codes;
@@ -0,0 +1,15 @@
1
+ import { iZip_Codes } from "api/rest/C6";
2
+ /**
3
+ CREATE TABLE `zip_codes` (
4
+ `zip_id` binary(16) NOT NULL DEFAULT (uuid_to_bin(uuid(),1)),
5
+ `zip_code` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
6
+ `geometry_id` binary(16) NOT NULL,
7
+ `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
8
+ PRIMARY KEY (`zip_id`),
9
+ UNIQUE KEY `uq_zip_geometry` (`geometry_id`),
10
+ KEY `idx_zip_code` (`zip_code`),
11
+ CONSTRAINT `zip_codes_ibfk_1` FOREIGN KEY (`geometry_id`) REFERENCES `geometries` (`geometry_id`) ON DELETE RESTRICT
12
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
13
+ **/
14
+ declare const Test_Data: iZip_Codes;
15
+ export default Test_Data;
@@ -1,5 +1,6 @@
1
1
  import { iC6RestfulModel, iDynamicApiImport } from "api/interfaces/ormInterfaces";
2
2
  import { AxiosInstance, AxiosPromise, AxiosResponse } from "axios";
3
+ import { Pool } from "mysql2/promise";
3
4
  export declare function TestRestfulResponse(response: AxiosResponse | any, success: ((r: AxiosResponse) => (string | void)) | string | undefined, error: ((r: AxiosResponse) => (string | void)) | string | undefined): string | boolean | number;
4
5
  export declare function removeInvalidKeys<iRestObject>(request: any, c6Tables: {
5
6
  [key: string]: (iC6RestfulModel & {
@@ -55,20 +56,41 @@ export declare const PUT = "PUT";
55
56
  export declare const GET = "GET";
56
57
  export declare const DELETE = "DELETE";
57
58
  export type iRestMethods = 'GET' | 'POST' | 'PUT' | 'DELETE';
58
- export type RequestGetPutDeleteBody = {
59
- SELECT?: any;
60
- UPDATE?: any;
61
- DELETE?: any;
62
- WHERE?: any;
63
- JOIN?: {
64
- LEFT?: any;
65
- RIGHT?: any;
66
- INNER?: any;
67
- };
68
- PAGINATION?: {
69
- PAGE?: number;
70
- LIMIT?: number;
71
- };
59
+ export type SQLFunction = 'COUNT' | 'GROUP_CONCAT' | 'MAX' | 'MIN' | 'SUM' | 'DISTINCT';
60
+ export type SQLComparisonOperator = '=' | '!=' | '<' | '<=' | '>' | '>=' | 'IN' | 'NOT IN' | 'LIKE' | 'IS NULL' | 'IS NOT NULL' | 'BETWEEN' | 'LESS_THAN' | 'GREATER_THAN';
61
+ export type JoinType = 'INNER' | 'LEFT_OUTER' | 'RIGHT_OUTER';
62
+ export type OrderDirection = 'ASC' | 'DESC';
63
+ export type SubSelect<T = any> = {
64
+ subSelect: true;
65
+ table: string;
66
+ args: RequestGetPutDeleteBody<T>;
67
+ alias: string;
68
+ };
69
+ export type SelectField<T = any> = keyof T | [keyof T, 'AS', string] | [SQLFunction, keyof T] | [SQLFunction, keyof T, string] | SubSelect<T>;
70
+ export type WhereClause<T = any> = Partial<T> | LogicalGroup<T> | ComparisonClause<T>;
71
+ export type LogicalGroup<T = any> = {
72
+ [logicalGroup: string]: Array<WhereClause<T>>;
73
+ };
74
+ export type ComparisonClause<T = any> = [keyof T, SQLComparisonOperator, any];
75
+ export type JoinTableCondition<T = any> = Partial<T> | WhereClause<T>[] | ComparisonClause<T>[];
76
+ export type JoinClause<T = any> = {
77
+ [table: string]: JoinTableCondition<T>;
78
+ };
79
+ export type Join<T = any> = {
80
+ [K in JoinType]?: JoinClause<T>;
81
+ };
82
+ export type Pagination<T = any> = {
83
+ PAGE?: number;
84
+ LIMIT?: number | null;
85
+ ORDER?: Partial<Record<keyof T, OrderDirection>>;
86
+ };
87
+ export type RequestGetPutDeleteBody<T = any> = {
88
+ SELECT?: SelectField<T>[];
89
+ UPDATE?: Partial<T>;
90
+ DELETE?: boolean;
91
+ WHERE?: WhereClause<T>;
92
+ JOIN?: Join<T>;
93
+ PAGINATION?: Pagination<T>;
72
94
  };
73
95
  export type RequestQueryBody<RestTableInterfaces extends {
74
96
  [key: string]: any;
@@ -114,6 +136,7 @@ interface iRest<CustomAndRequiredFields extends {
114
136
  C6: iC6Object;
115
137
  axios?: AxiosInstance;
116
138
  restURL?: string;
139
+ mysqlPool?: Pool;
117
140
  withCredentials?: boolean;
118
141
  tableName: RestShortTableNames | RestShortTableNames[];
119
142
  requestMethod: iRestMethods;
@@ -137,12 +160,12 @@ export declare function extendedTypeHints<RestTableInterfaces extends {
137
160
  debug?: boolean;
138
161
  success?: string | ((r: AxiosResponse) => (string | void));
139
162
  error?: string | ((r: AxiosResponse) => (string | void));
140
- } & CustomAndRequiredFields) => apiReturn<ResponseDataType>;
163
+ } & CustomAndRequiredFields) => Promise<(ResponseDataType extends iPutC6RestResponse<any, any> | iDeleteC6RestResponse<any, any> | iPostC6RestResponse<any> ? null : () => apiReturn<ResponseDataType>) | AxiosResponse<ResponseDataType, any> | null | undefined>;
141
164
  export default function restRequest<CustomAndRequiredFields extends {
142
165
  [key: string]: any;
143
166
  } = any, RestTableInterfaces extends {
144
167
  [key: string]: any;
145
168
  } = any, RequestTableOverrides extends {
146
169
  [key: string]: any;
147
- } = any, ResponseDataType = any, RestShortTableNames extends string = any>({ C6, axios, restURL, withCredentials, tableName, requestMethod, queryCallback, responseCallback, skipPrimaryCheck, clearCache }: iRest<CustomAndRequiredFields, RestTableInterfaces, RequestTableOverrides, ResponseDataType, RestShortTableNames>): (request?: iAPI<Modify<RestTableInterfaces, RequestTableOverrides>> & CustomAndRequiredFields) => apiReturn<ResponseDataType>;
170
+ } = any, ResponseDataType = any, RestShortTableNames extends string = any>({ C6, axios, restURL, mysqlPool, withCredentials, tableName, requestMethod, queryCallback, responseCallback, skipPrimaryCheck, clearCache }: iRest<CustomAndRequiredFields, RestTableInterfaces, RequestTableOverrides, ResponseDataType, RestShortTableNames>): (request?: iAPI<Modify<RestTableInterfaces, RequestTableOverrides>> & CustomAndRequiredFields) => Promise<(ResponseDataType extends iPutC6RestResponse<any, any> | iDeleteC6RestResponse<any, any> | iPostC6RestResponse<any> ? null : () => apiReturn<ResponseDataType>) | AxiosResponse<ResponseDataType, any> | null | undefined>;
148
171
  export {};