@taylordb/shared 0.2.0 → 0.4.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 (70) hide show
  1. package/dist/cjs/@types/index.d.ts +2 -0
  2. package/dist/cjs/@types/index.js +19 -0
  3. package/dist/cjs/@types/index.js.map +1 -0
  4. package/dist/cjs/@types/metadata.d.ts +32 -0
  5. package/dist/cjs/@types/metadata.js +3 -0
  6. package/dist/cjs/@types/metadata.js.map +1 -0
  7. package/dist/cjs/@types/table-loader.d.ts +99 -0
  8. package/dist/cjs/@types/table-loader.js +3 -0
  9. package/dist/cjs/@types/table-loader.js.map +1 -0
  10. package/dist/cjs/column-types.d.ts +114 -0
  11. package/dist/{esm/table-types.js → cjs/column-types.js} +1 -1
  12. package/dist/cjs/column-types.js.map +1 -0
  13. package/dist/cjs/constants/date-filters.d.ts +26 -0
  14. package/dist/cjs/constants/date-filters.js +32 -0
  15. package/dist/cjs/constants/date-filters.js.map +1 -0
  16. package/dist/cjs/constants/index.d.ts +2 -0
  17. package/dist/cjs/constants/index.js +19 -0
  18. package/dist/cjs/constants/index.js.map +1 -0
  19. package/dist/cjs/constants/select.d.ts +43 -0
  20. package/dist/cjs/constants/select.js +47 -0
  21. package/dist/cjs/constants/select.js.map +1 -0
  22. package/dist/cjs/index.d.ts +4 -0
  23. package/dist/cjs/index.js +21 -0
  24. package/dist/cjs/index.js.map +1 -0
  25. package/dist/cjs/utilities/index.d.ts +4 -0
  26. package/dist/cjs/utilities/index.js +21 -0
  27. package/dist/cjs/utilities/index.js.map +1 -0
  28. package/dist/cjs/utilities/makeCamelCase.d.ts +2 -0
  29. package/dist/cjs/utilities/makeCamelCase.js +11 -0
  30. package/dist/cjs/utilities/makeCamelCase.js.map +1 -0
  31. package/dist/cjs/utilities/makeColumnName.d.ts +1 -0
  32. package/dist/cjs/utilities/makeColumnName.js +11 -0
  33. package/dist/cjs/utilities/makeColumnName.js.map +1 -0
  34. package/dist/cjs/utilities/makeSelectKey.d.ts +1 -0
  35. package/dist/cjs/utilities/makeSelectKey.js +6 -0
  36. package/dist/cjs/utilities/makeSelectKey.js.map +1 -0
  37. package/dist/cjs/utilities/validateString.d.ts +2 -0
  38. package/dist/cjs/utilities/validateString.js +7 -0
  39. package/dist/cjs/utilities/validateString.js.map +1 -0
  40. package/dist/esm/@types/index.js +2 -18
  41. package/dist/esm/@types/index.js.map +1 -1
  42. package/dist/esm/@types/metadata.js +1 -2
  43. package/dist/esm/@types/table-loader.js +1 -2
  44. package/dist/esm/column-types.d.ts +100 -7
  45. package/dist/esm/column-types.js +1 -2
  46. package/dist/esm/column-types.js.map +1 -1
  47. package/dist/esm/constants/date-filters.js +4 -7
  48. package/dist/esm/constants/date-filters.js.map +1 -1
  49. package/dist/esm/constants/index.js +2 -18
  50. package/dist/esm/constants/index.js.map +1 -1
  51. package/dist/esm/constants/select.js +2 -5
  52. package/dist/esm/constants/select.js.map +1 -1
  53. package/dist/esm/index.d.ts +0 -1
  54. package/dist/esm/index.js +4 -21
  55. package/dist/esm/index.js.map +1 -1
  56. package/dist/esm/utilities/index.js +4 -20
  57. package/dist/esm/utilities/index.js.map +1 -1
  58. package/dist/esm/utilities/makeCamelCase.js +3 -10
  59. package/dist/esm/utilities/makeCamelCase.js.map +1 -1
  60. package/dist/esm/utilities/makeColumnName.js +1 -5
  61. package/dist/esm/utilities/makeColumnName.js.map +1 -1
  62. package/dist/esm/utilities/makeSelectKey.js +1 -5
  63. package/dist/esm/utilities/makeSelectKey.js.map +1 -1
  64. package/dist/esm/utilities/validateString.js +2 -6
  65. package/dist/esm/utilities/validateString.js.map +1 -1
  66. package/dist/tsconfig.cjs.tsbuildinfo +1 -0
  67. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  68. package/package.json +1 -1
  69. package/dist/esm/table-types.d.ts +0 -26
  70. package/dist/esm/table-types.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ export * from './metadata.js';
2
+ export * from './table-loader.js';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./metadata.js"), exports);
18
+ __exportStar(require("./table-loader.js"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/@types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,oDAAkC"}
@@ -0,0 +1,32 @@
1
+ import { AggregateConfiguration, Configuration, FiltersSet, PaginationRequest } from './table-loader.js';
2
+ export type SelectQueryMetaData = {
3
+ type: 'select';
4
+ } & Configuration<string>;
5
+ export type PaginationQueryMetaData = {
6
+ type: 'pagination';
7
+ filtersSet?: FiltersSet<string>;
8
+ pagination?: PaginationRequest;
9
+ };
10
+ export type AggregationQueryMetaData = {
11
+ type: 'aggregation';
12
+ } & AggregateConfiguration<string>;
13
+ export type UpdateMutationMetaData = {
14
+ type: 'update';
15
+ values: any;
16
+ filtersSet?: FiltersSet<string>;
17
+ };
18
+ export type DeleteMutationMetaData = {
19
+ type: 'delete';
20
+ filtersSet?: FiltersSet<string>;
21
+ deletedRecordIds: number[];
22
+ };
23
+ export type CreateMutationMetaData = {
24
+ type: 'create';
25
+ createdRecords: any[];
26
+ };
27
+ export type AvailableMetaData = UpdateMutationMetaData | DeleteMutationMetaData | CreateMutationMetaData | SelectQueryMetaData | PaginationQueryMetaData | AggregationQueryMetaData;
28
+ export type QueryMetadata = SelectQueryMetaData | PaginationQueryMetaData | AggregationQueryMetaData;
29
+ export type MutationMetaData = UpdateMutationMetaData | DeleteMutationMetaData | CreateMutationMetaData;
30
+ export type MetadataWithTableName<T extends AvailableMetaData> = T & {
31
+ tableName: string;
32
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../src/@types/metadata.ts"],"names":[],"mappings":""}
@@ -0,0 +1,99 @@
1
+ export type FieldWithDirection<FN> = {
2
+ field: FN;
3
+ direction: string;
4
+ values?: unknown;
5
+ };
6
+ export type FiltersSet<FN> = {
7
+ conjunction: 'and' | 'or';
8
+ filtersSet: (FiltersSet<FN> | Filters<FN>)[];
9
+ };
10
+ export type Filters<FN> = {
11
+ field: FN;
12
+ operator: string;
13
+ value?: unknown;
14
+ };
15
+ export type FieldsOrder<FN> = {
16
+ field: FN;
17
+ isVisible: boolean;
18
+ };
19
+ export type FieldsConfiguration<FN extends string> = {
20
+ [key in FN]: string[] | null;
21
+ };
22
+ export type FieldsWithPaginationConfiguration = {
23
+ field: string;
24
+ pagination?: PaginationRequest;
25
+ fields: string[];
26
+ };
27
+ export type FieldsConfigurations = {
28
+ field: string;
29
+ pagination?: PaginationRequest;
30
+ fields: FieldsConfigurations[];
31
+ isVisible: boolean;
32
+ isQueryable: boolean;
33
+ isFilterable: boolean;
34
+ hasPagination: boolean;
35
+ };
36
+ export type ObjConfigurationVisibleField<FN extends string> = Configuration<string> & {
37
+ field: FN;
38
+ };
39
+ export type ConfigurationVisibleField<FN extends string> = '*' | FN | `${FN}:${string}` | ObjConfigurationVisibleField<FN>;
40
+ export type Configuration<FN extends string> = {
41
+ filtersSet?: FiltersSet<FN>;
42
+ /**
43
+ *
44
+ * This property is deprecated please use filtersSet instead
45
+ *
46
+ * @deprecated
47
+ */
48
+ filters?: Filters<FN>[];
49
+ sorting?: FieldWithDirection<FN>[];
50
+ pagination?: PaginationRequest | LimitOffset;
51
+ fields?: ConfigurationVisibleField<FN>[];
52
+ };
53
+ export type LimitOffset = {
54
+ limit: number;
55
+ offset: number;
56
+ };
57
+ export type PaginationRequest = {
58
+ perPage: number;
59
+ page: number;
60
+ };
61
+ export type PaginationResponse = {
62
+ total: number;
63
+ } | {
64
+ page: number;
65
+ perPage: number;
66
+ total: number;
67
+ pages: number;
68
+ };
69
+ export type InsertionReturnValue<DB extends object, TB extends keyof DB> = {
70
+ [key in keyof DB[TB]]: any;
71
+ };
72
+ export type AggregationFields<FN extends string> = {
73
+ [field in FN]: string[];
74
+ };
75
+ export type FieldBasedGrouping<FN extends string> = FieldWithDirection<FN>;
76
+ export type FormulaBasedGrouping<FN extends string> = {
77
+ formula: string;
78
+ } & Pick<FieldWithDirection<FN>, 'direction'>;
79
+ export type GroupingConfiguration<FN extends string> = FieldBasedGrouping<FN> | FormulaBasedGrouping<FN>;
80
+ export type AggregateConfiguration<FN extends string> = Exclude<Configuration<FN>, 'fields' | 'sorting'> & {
81
+ groupings?: GroupingConfiguration<FN>[];
82
+ aggregations?: AggregationFields<FN>;
83
+ };
84
+ export type Aggregates<FN extends string> = {
85
+ [k in FN]?: {
86
+ [operator: string]: AggregationValue;
87
+ };
88
+ };
89
+ export type AggregationValue = number | null | object | undefined;
90
+ export type AggregateRecord<FN extends string> = {
91
+ slug?: string;
92
+ value?: unknown;
93
+ count: number;
94
+ children?: AggregateRecord<FN>[];
95
+ aggregates: Aggregates<FN>;
96
+ };
97
+ export type FieldAggregation = {
98
+ [name: string]: () => AggregationValue;
99
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=table-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-loader.js","sourceRoot":"","sources":["../../../src/@types/table-loader.ts"],"names":[],"mappings":""}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Copyright (c) 2025 TaylorDB
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ type IsWithinOperatorValue = 'pastWeek' | 'pastMonth' | 'pastYear' | 'nextWeek' | 'nextMonth' | 'nextYear' | 'daysFromNow' | 'daysAgo' | 'currentWeek' | 'currentMonth' | 'currentYear';
8
+ type DefaultDateFilterValue = ('today' | 'tomorrow' | 'yesterday' | 'oneWeekAgo' | 'oneWeekFromNow' | 'oneMonthAgo' | 'oneMonthFromNow') | ['exactDay' | 'exactTimestamp', string] | ['daysAgo' | 'daysFromNow', number];
9
+ type DateFilters = {
10
+ '=': DefaultDateFilterValue;
11
+ '!=': DefaultDateFilterValue;
12
+ '<': DefaultDateFilterValue;
13
+ '>': DefaultDateFilterValue;
14
+ '<=': DefaultDateFilterValue;
15
+ '>=': DefaultDateFilterValue;
16
+ isWithIn: IsWithinOperatorValue | {
17
+ value: 'daysAgo' | 'daysFromNow';
18
+ date: number;
19
+ };
20
+ isEmpty: boolean;
21
+ isNotEmpty: boolean;
22
+ };
23
+ type DateAggregations = {
24
+ empty: number;
25
+ filled: number;
26
+ unique: number;
27
+ percentEmpty: number;
28
+ percentFilled: number;
29
+ percentUnique: number;
30
+ min: number | null;
31
+ max: number | null;
32
+ daysRange: number | null;
33
+ monthRange: number | null;
34
+ };
35
+ type TextFilters = {
36
+ '=': string;
37
+ '!=': string;
38
+ caseEqual: string;
39
+ hasAnyOf: string[];
40
+ contains: string;
41
+ startsWith: string;
42
+ endsWith: string;
43
+ doesNotContain: string;
44
+ };
45
+ type LinkFilters = {
46
+ hasAnyOf: number[];
47
+ hasAllOf: number[];
48
+ isExactly: number[];
49
+ '=': number;
50
+ hasNoneOf: number[];
51
+ };
52
+ type LinkAggregations = {
53
+ empty: number;
54
+ filled: number;
55
+ percentEmpty: number;
56
+ percentFilled: number;
57
+ };
58
+ type NumberFilters = {
59
+ '>': number;
60
+ '>=': number;
61
+ '<': number;
62
+ '<=': number;
63
+ hasAnyOf: number[];
64
+ hasNoneOf: number[];
65
+ };
66
+ type NumberAggregations = {
67
+ sum: number;
68
+ average: number;
69
+ median: number;
70
+ min: number | null;
71
+ max: number | null;
72
+ range: number;
73
+ standardDeviation: number;
74
+ histogram: Record<string, number>;
75
+ empty: number;
76
+ filled: number;
77
+ unique: number;
78
+ percentEmpty: number;
79
+ percentFilled: number;
80
+ percentUnique: number;
81
+ };
82
+ type CheckboxFilters = {
83
+ '=': number;
84
+ };
85
+ /**
86
+ *
87
+ * Column types
88
+ *
89
+ */
90
+ export type ColumnType<S, U, I, R extends boolean, F extends {
91
+ [key: string]: any;
92
+ } = object, A extends {
93
+ [key: string]: any;
94
+ } = object> = {
95
+ raw: S;
96
+ insert: I;
97
+ update: U;
98
+ filters: F;
99
+ aggregations: A;
100
+ isRequired: R;
101
+ };
102
+ export type DateColumnType<R extends boolean> = ColumnType<string, string, string, R, DateFilters, DateAggregations>;
103
+ export type TextColumnType<R extends boolean> = ColumnType<string, string, string, R, TextFilters>;
104
+ export type LinkColumnType<T extends string, R extends boolean> = ColumnType<object, number | number[] | {
105
+ newIds: number[];
106
+ deletedIds: number[];
107
+ }, number | number[], R, LinkFilters, LinkAggregations> & {
108
+ linkedTo: T;
109
+ };
110
+ export type NumberColumnType<R extends boolean> = ColumnType<number, number, number, R, NumberFilters, NumberAggregations>;
111
+ export type CheckboxColumnType<R extends boolean> = ColumnType<boolean, boolean, boolean, R, CheckboxFilters>;
112
+ export type AutoGeneratedNumberColumnType = ColumnType<number, never, never, false, NumberFilters, NumberAggregations>;
113
+ export type AutoGeneratedDateColumnType = ColumnType<string, never, never, false, DateFilters, DateAggregations>;
114
+ export {};
@@ -6,4 +6,4 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- //# sourceMappingURL=table-types.js.map
9
+ //# sourceMappingURL=column-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column-types.js","sourceRoot":"","sources":["../../src/column-types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
@@ -0,0 +1,26 @@
1
+ export declare enum DefaultOperatorValue {
2
+ TODAY = "today",
3
+ TOMORROW = "tomorrow",
4
+ YESTERDAY = "yesterday",
5
+ ONE_WEEK_AGO = "oneWeekAgo",
6
+ ONE_WEEK_FROM_NOW = "oneWeekFromNow",
7
+ ONE_MONTH_AGO = "oneMonthAgo",
8
+ ONE_MONTH_FROM_NOW = "oneMonthFromNow",
9
+ DAYS_AGO = "daysAgo",
10
+ DAYS_FROM_NOW = "daysFromNow",
11
+ EXACT_DAY = "exactDay",
12
+ EXACT_TIMESTAMP = "exactTimestamp"
13
+ }
14
+ export declare enum IsWithinOperatorValue {
15
+ PAST_WEEK = "pastWeek",
16
+ PAST_MONTH = "pastMonth",
17
+ PAST_YEAR = "pastYear",
18
+ NEXT_WEEK = "nextWeek",
19
+ NEXT_MONTH = "nextMonth",
20
+ NEXT_YEAR = "nextYear",
21
+ DAYS_FROM_NOW = "daysFromNow",
22
+ DAYS_AGO = "daysAgo",
23
+ CURRENT_WEEK = "currentWeek",
24
+ CURRENT_MONTH = "currentMonth",
25
+ CURRENT_YEAR = "currentYear"
26
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IsWithinOperatorValue = exports.DefaultOperatorValue = void 0;
4
+ var DefaultOperatorValue;
5
+ (function (DefaultOperatorValue) {
6
+ DefaultOperatorValue["TODAY"] = "today";
7
+ DefaultOperatorValue["TOMORROW"] = "tomorrow";
8
+ DefaultOperatorValue["YESTERDAY"] = "yesterday";
9
+ DefaultOperatorValue["ONE_WEEK_AGO"] = "oneWeekAgo";
10
+ DefaultOperatorValue["ONE_WEEK_FROM_NOW"] = "oneWeekFromNow";
11
+ DefaultOperatorValue["ONE_MONTH_AGO"] = "oneMonthAgo";
12
+ DefaultOperatorValue["ONE_MONTH_FROM_NOW"] = "oneMonthFromNow";
13
+ DefaultOperatorValue["DAYS_AGO"] = "daysAgo";
14
+ DefaultOperatorValue["DAYS_FROM_NOW"] = "daysFromNow";
15
+ DefaultOperatorValue["EXACT_DAY"] = "exactDay";
16
+ DefaultOperatorValue["EXACT_TIMESTAMP"] = "exactTimestamp";
17
+ })(DefaultOperatorValue || (exports.DefaultOperatorValue = DefaultOperatorValue = {}));
18
+ var IsWithinOperatorValue;
19
+ (function (IsWithinOperatorValue) {
20
+ IsWithinOperatorValue["PAST_WEEK"] = "pastWeek";
21
+ IsWithinOperatorValue["PAST_MONTH"] = "pastMonth";
22
+ IsWithinOperatorValue["PAST_YEAR"] = "pastYear";
23
+ IsWithinOperatorValue["NEXT_WEEK"] = "nextWeek";
24
+ IsWithinOperatorValue["NEXT_MONTH"] = "nextMonth";
25
+ IsWithinOperatorValue["NEXT_YEAR"] = "nextYear";
26
+ IsWithinOperatorValue["DAYS_FROM_NOW"] = "daysFromNow";
27
+ IsWithinOperatorValue["DAYS_AGO"] = "daysAgo";
28
+ IsWithinOperatorValue["CURRENT_WEEK"] = "currentWeek";
29
+ IsWithinOperatorValue["CURRENT_MONTH"] = "currentMonth";
30
+ IsWithinOperatorValue["CURRENT_YEAR"] = "currentYear";
31
+ })(IsWithinOperatorValue || (exports.IsWithinOperatorValue = IsWithinOperatorValue = {}));
32
+ //# sourceMappingURL=date-filters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-filters.js","sourceRoot":"","sources":["../../../src/constants/date-filters.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAYX;AAZD,WAAY,oBAAoB;IAC9B,uCAAe,CAAA;IACf,6CAAqB,CAAA;IACrB,+CAAuB,CAAA;IACvB,mDAA2B,CAAA;IAC3B,4DAAoC,CAAA;IACpC,qDAA6B,CAAA;IAC7B,8DAAsC,CAAA;IACtC,4CAAoB,CAAA;IACpB,qDAA6B,CAAA;IAC7B,8CAAsB,CAAA;IACtB,0DAAkC,CAAA;AACpC,CAAC,EAZW,oBAAoB,oCAApB,oBAAoB,QAY/B;AAED,IAAY,qBAYX;AAZD,WAAY,qBAAqB;IAC/B,+CAAsB,CAAA;IACtB,iDAAwB,CAAA;IACxB,+CAAsB,CAAA;IACtB,+CAAsB,CAAA;IACtB,iDAAwB,CAAA;IACxB,+CAAsB,CAAA;IACtB,sDAA6B,CAAA;IAC7B,6CAAoB,CAAA;IACpB,qDAA4B,CAAA;IAC5B,uDAA8B,CAAA;IAC9B,qDAA4B,CAAA;AAC9B,CAAC,EAZW,qBAAqB,qCAArB,qBAAqB,QAYhC"}
@@ -0,0 +1,2 @@
1
+ export * from './date-filters.js';
2
+ export * from './select.js';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./date-filters.js"), exports);
18
+ __exportStar(require("./select.js"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,8CAA4B"}
@@ -0,0 +1,43 @@
1
+ export declare const TABLE_COLORS: {
2
+ violet1: string;
3
+ blue1: string;
4
+ mint1: string;
5
+ green1: string;
6
+ red1: string;
7
+ pink1: string;
8
+ orange1: string;
9
+ grey1: string;
10
+ violet2: string;
11
+ blue2: string;
12
+ mint2: string;
13
+ green2: string;
14
+ red2: string;
15
+ pink2: string;
16
+ orange2: string;
17
+ grey2: string;
18
+ violet3: string;
19
+ blue3: string;
20
+ mint3: string;
21
+ green3: string;
22
+ red3: string;
23
+ pink3: string;
24
+ orange3: string;
25
+ grey3: string;
26
+ violet4: string;
27
+ blue4: string;
28
+ mint4: string;
29
+ green4: string;
30
+ red4: string;
31
+ pink4: string;
32
+ orange4: string;
33
+ grey4: string;
34
+ violet5: string;
35
+ blue5: string;
36
+ mint5: string;
37
+ green5: string;
38
+ red5: string;
39
+ pink5: string;
40
+ orange5: string;
41
+ grey5: string;
42
+ };
43
+ export declare const TABLE_COLOR_NAMES: string[];
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TABLE_COLOR_NAMES = exports.TABLE_COLORS = void 0;
4
+ exports.TABLE_COLORS = {
5
+ violet1: '#F1EFFF',
6
+ blue1: '#CDF6FE',
7
+ mint1: '#D8FDEE',
8
+ green1: '#D2FFC6',
9
+ red1: '#FEF7F2',
10
+ pink1: '#FFEDF3',
11
+ orange1: '#FDF4DE',
12
+ grey1: '#F3F0F4',
13
+ violet2: '#DFE0FF',
14
+ blue2: '#A5EAFF',
15
+ mint2: '#9CFFE8',
16
+ green2: '#ACFAA9',
17
+ red2: '#FDEEE6',
18
+ pink2: '#FFD2F0',
19
+ orange2: '#FBECCD',
20
+ grey2: '#E4E1E6',
21
+ violet3: '#BDC2FF',
22
+ blue3: '#84D2FE',
23
+ mint3: '#6FEFD1',
24
+ green3: '#7DF890',
25
+ red3: '#F3D1CB',
26
+ pink3: '#DB99CB',
27
+ orange3: '#F2D4A8',
28
+ grey3: '#C8C5CA',
29
+ violet4: '#9BA4FF',
30
+ blue4: '#68A3D9',
31
+ mint4: '#13BBBB',
32
+ green4: '#00CA85',
33
+ red4: '#FB614C',
34
+ pink4: '#C95AAE',
35
+ orange4: '#FF9736',
36
+ grey4: '#ADAAAF',
37
+ violet5: '#4250CC',
38
+ blue5: '#006BCD',
39
+ mint5: '#008989',
40
+ green5: '#009B66',
41
+ red5: '#C34C3B',
42
+ pink5: '#B54E7F',
43
+ orange5: '#C75F00',
44
+ grey5: '#929094',
45
+ };
46
+ exports.TABLE_COLOR_NAMES = Object.keys(exports.TABLE_COLORS);
47
+ //# sourceMappingURL=select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/constants/select.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;CACjB,CAAC;AAEW,QAAA,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAY,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './@types/index.js';
2
+ export * from './column-types.js';
3
+ export * from './constants/index.js';
4
+ export * from './utilities/index.js';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./@types/index.js"), exports);
18
+ __exportStar(require("./column-types.js"), exports);
19
+ __exportStar(require("./constants/index.js"), exports);
20
+ __exportStar(require("./utilities/index.js"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,oDAAkC;AAClC,uDAAqC;AACrC,uDAAqC"}
@@ -0,0 +1,4 @@
1
+ export * from './makeCamelCase.js';
2
+ export * from './makeColumnName.js';
3
+ export * from './makeSelectKey.js';
4
+ export * from './validateString.js';
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./makeCamelCase.js"), exports);
18
+ __exportStar(require("./makeColumnName.js"), exports);
19
+ __exportStar(require("./makeSelectKey.js"), exports);
20
+ __exportStar(require("./validateString.js"), exports);
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,sDAAoC;AACpC,qDAAmC;AACnC,sDAAoC"}
@@ -0,0 +1,2 @@
1
+ export declare const makeCamelCase: (...strings: string[]) => string;
2
+ export default makeCamelCase;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.makeCamelCase = void 0;
7
+ const camelCase_js_1 = __importDefault(require("lodash/camelCase.js"));
8
+ const makeCamelCase = (...strings) => (0, camelCase_js_1.default)(strings.join(' '));
9
+ exports.makeCamelCase = makeCamelCase;
10
+ exports.default = exports.makeCamelCase;
11
+ //# sourceMappingURL=makeCamelCase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeCamelCase.js","sourceRoot":"","sources":["../../../src/utilities/makeCamelCase.ts"],"names":[],"mappings":";;;;;;AAAA,uEAA4C;AAErC,MAAM,aAAa,GAAG,CAAC,GAAG,OAAiB,EAAE,EAAE,CACpD,IAAA,sBAAS,EAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AADlB,QAAA,aAAa,iBACK;AAE/B,kBAAe,qBAAa,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const makeColumnName: (selectKey: string) => string;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeColumnName = void 0;
4
+ const makeColumnName = (selectKey) => {
5
+ return selectKey
6
+ .split('.')
7
+ .map(str => `"${str}"`)
8
+ .join('.');
9
+ };
10
+ exports.makeColumnName = makeColumnName;
11
+ //# sourceMappingURL=makeColumnName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeColumnName.js","sourceRoot":"","sources":["../../../src/utilities/makeColumnName.ts"],"names":[],"mappings":";;;AAAO,MAAM,cAAc,GAAG,CAAC,SAAiB,EAAE,EAAE;IAClD,OAAO,SAAS;SACb,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,GAAG,CAAC;SACtB,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC,CAAC;AALW,QAAA,cAAc,kBAKzB"}
@@ -0,0 +1 @@
1
+ export declare const makeSelectKey: <F extends string, S extends string>(tableName: F, column: S) => `${F}.${S}`;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeSelectKey = void 0;
4
+ const makeSelectKey = (tableName, column) => `${tableName}.${column}`;
5
+ exports.makeSelectKey = makeSelectKey;
6
+ //# sourceMappingURL=makeSelectKey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeSelectKey.js","sourceRoot":"","sources":["../../../src/utilities/makeSelectKey.ts"],"names":[],"mappings":";;;AAAO,MAAM,aAAa,GAAG,CAC3B,SAAY,EACZ,MAAS,EACT,EAAE,CAAC,GAAG,SAAS,IAAI,MAAM,EAAW,CAAC;AAH1B,QAAA,aAAa,iBAGa"}
@@ -0,0 +1,2 @@
1
+ export declare const validateString: (string: string) => boolean;
2
+ export default validateString;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateString = void 0;
4
+ const validateString = (string) => /^(_|[a-zA-Z0-9])+(_?[a-zA-Z0-9]+)*$/.test(string);
5
+ exports.validateString = validateString;
6
+ exports.default = exports.validateString;
7
+ //# sourceMappingURL=validateString.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateString.js","sourceRoot":"","sources":["../../../src/utilities/validateString.ts"],"names":[],"mappings":";;;AAAO,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,EAAE,CAC/C,qCAAqC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AADxC,QAAA,cAAc,kBAC0B;AAErD,kBAAe,sBAAc,CAAC"}
@@ -1,19 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./metadata.js"), exports);
18
- __exportStar(require("./table-loader.js"), exports);
1
+ export * from './metadata.js';
2
+ export * from './table-loader.js';
19
3
  //# sourceMappingURL=index.js.map