@oino-ts/db 0.16.2 → 0.17.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.
@@ -1,104 +1,98 @@
1
- /** Set the name of the OINO ID field (default \_OINOID\_) */
2
-
3
- export class OINODbConfig {
4
- /** Name of the synthetic OINO ID field */
5
- static OINODB_ID_FIELD:string = "_OINOID_"
6
- /** Private key separator of the synthetic OINO ID field */
7
- static OINODB_ID_SEPARATOR:string = "_"
8
- private static OINODB_ID_SEPARATOR_ESCAPED:string = "%"
9
-
10
- /** Name of the OINODbSqlFilter-parameter in request */
11
- static OINODB_SQL_FILTER_PARAM:string = "oinosqlfilter"
12
-
13
- /** Name of the OINODbSqlOrder-parameter in request */
14
- static OINODB_SQL_ORDER_PARAM:string = "oinosqlorder"
15
-
16
- /** Name of the OINODbSqlLimit-parameter in request */
17
- static OINODB_SQL_LIMIT_PARAM:string = "oinosqllimit"
18
-
19
- /** Name of the OINODbSqlAggregate-parameter in request */
20
- static OINODB_SQL_AGGREGATE_PARAM:string = "oinosqlaggregate"
21
-
22
- /** Name of the OINODbSqlSelect-parameter in request */
23
- static OINODB_SQL_SELECT_PARAM:string = "oinosqlselect"
24
-
25
- /** Name of the OINOContentType-parameter request */
26
- static OINODB_REQUEST_TYPE:string = "oinorequesttype"
27
-
28
- /** Name of the OINOContentType-parameter request */
29
- static OINODB_RESPONSE_TYPE:string = "oinoresponsetype"
30
-
31
- /**
32
- * Set the name of the OINO ID field
33
- * @param idField name of the OINO ID field
34
- */
35
- static setOinoIdField(idField: string) {
36
- if (idField) {
37
- OINODbConfig.OINODB_ID_FIELD = idField;
38
- }
39
- }
40
-
41
- /**
42
- * Set the separator character of the OINO ID field
43
- * @param idSeparator character to use as separator of id parts
44
- */
45
- static setOinoIdSeparator(idSeparator: string) {
46
- if (idSeparator && (idSeparator.length == 1)) {
47
- OINODbConfig.OINODB_ID_SEPARATOR = idSeparator;
48
- OINODbConfig.OINODB_ID_SEPARATOR_ESCAPED = '%' + idSeparator.charCodeAt(0).toString(16);
49
- }
50
- }
51
-
52
- /**
53
- * Print OINO ID for primary key values.
54
- *
55
- * @param primaryKeys an array of primary key values.
56
- *
57
- */
58
- static printOINOId(primaryKeys:string[]):string {
59
- let result:string = ""
60
- for (let i=0; i< primaryKeys.length; i++) {
61
- if (i > 0) {
62
- result += OINODbConfig.OINODB_ID_SEPARATOR
63
- }
64
- result += encodeURIComponent(primaryKeys[i] as string).replaceAll(OINODbConfig.OINODB_ID_SEPARATOR, OINODbConfig.OINODB_ID_SEPARATOR_ESCAPED)
65
- }
66
- return result
67
- }
68
-
69
- /**
70
- * Set the name of the OINODbSqlFilter-param field
71
- *
72
- * @param sqlFilterParam name of the http parameter with `OINODbSqlFilter` definition
73
- *
74
- */
75
- static setOinoSqlFilterParam(sqlFilterParam: string) {
76
- if (sqlFilterParam) {
77
- OINODbConfig.OINODB_SQL_FILTER_PARAM = sqlFilterParam;
78
- }
79
- }
80
-
81
- /**
82
- * Set the name of the OINODbSqlOrder-param field
83
- *
84
- * @param sqlOrderParam name of the http parameter with `OINODbSqlOrder` definition
85
- *
86
- */
87
- static setOinoSqlOrderParam(sqlOrderParam: string) {
88
- if (sqlOrderParam) {
89
- OINODbConfig.OINODB_SQL_ORDER_PARAM = sqlOrderParam;
90
- }
91
- }
92
-
93
- /**
94
- * Set the name of the OINODbSqlLimit-param field
95
- *
96
- * @param sqlLimitParam name of the http parameter with `OINODbSqlLimit` definition
97
- *
98
- */
99
- static setOinoSqlLimitParam(sqlLimitParam: string) {
100
- if (sqlLimitParam) {
101
- OINODbConfig.OINODB_SQL_LIMIT_PARAM = sqlLimitParam;
102
- }
103
- }
104
- }
1
+ /** Set the name of the OINO ID field (default \_OINOID\_) */
2
+
3
+ export class OINODbConfig {
4
+ /** Name of the synthetic OINO ID field */
5
+ static OINODB_ID_FIELD:string = "_OINOID_"
6
+ /** Private key separator of the synthetic OINO ID field */
7
+ static OINODB_ID_SEPARATOR:string = "_"
8
+ private static OINODB_ID_SEPARATOR_ESCAPED:string = "%"
9
+
10
+ /** Name of the OINODbSqlFilter-parameter in request */
11
+ static OINODB_SQL_FILTER_PARAM:string = "oinosqlfilter"
12
+
13
+ /** Name of the OINODbSqlOrder-parameter in request */
14
+ static OINODB_SQL_ORDER_PARAM:string = "oinosqlorder"
15
+
16
+ /** Name of the OINODbSqlLimit-parameter in request */
17
+ static OINODB_SQL_LIMIT_PARAM:string = "oinosqllimit"
18
+
19
+ /** Name of the OINODbSqlAggregate-parameter in request */
20
+ static OINODB_SQL_AGGREGATE_PARAM:string = "oinosqlaggregate"
21
+
22
+ /** Name of the OINODbSqlSelect-parameter in request */
23
+ static OINODB_SQL_SELECT_PARAM:string = "oinosqlselect"
24
+
25
+ /**
26
+ * Set the name of the OINO ID field
27
+ * @param idField name of the OINO ID field
28
+ */
29
+ static setOinoIdField(idField: string) {
30
+ if (idField) {
31
+ OINODbConfig.OINODB_ID_FIELD = idField;
32
+ }
33
+ }
34
+
35
+ /**
36
+ * Set the separator character of the OINO ID field
37
+ * @param idSeparator character to use as separator of id parts
38
+ */
39
+ static setOinoIdSeparator(idSeparator: string) {
40
+ if (idSeparator && (idSeparator.length == 1)) {
41
+ OINODbConfig.OINODB_ID_SEPARATOR = idSeparator;
42
+ OINODbConfig.OINODB_ID_SEPARATOR_ESCAPED = '%' + idSeparator.charCodeAt(0).toString(16);
43
+ }
44
+ }
45
+
46
+ /**
47
+ * Print OINO ID for primary key values.
48
+ *
49
+ * @param primaryKeys an array of primary key values.
50
+ *
51
+ */
52
+ static printOINOId(primaryKeys:string[]):string {
53
+ let result:string = ""
54
+ for (let i=0; i< primaryKeys.length; i++) {
55
+ if (i > 0) {
56
+ result += OINODbConfig.OINODB_ID_SEPARATOR
57
+ }
58
+ result += encodeURIComponent(primaryKeys[i] as string).replaceAll(OINODbConfig.OINODB_ID_SEPARATOR, OINODbConfig.OINODB_ID_SEPARATOR_ESCAPED)
59
+ }
60
+ return result
61
+ }
62
+
63
+ /**
64
+ * Set the name of the OINODbSqlFilter-param field
65
+ *
66
+ * @param sqlFilterParam name of the http parameter with `OINODbSqlFilter` definition
67
+ *
68
+ */
69
+ static setOinoSqlFilterParam(sqlFilterParam: string) {
70
+ if (sqlFilterParam) {
71
+ OINODbConfig.OINODB_SQL_FILTER_PARAM = sqlFilterParam;
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Set the name of the OINODbSqlOrder-param field
77
+ *
78
+ * @param sqlOrderParam name of the http parameter with `OINODbSqlOrder` definition
79
+ *
80
+ */
81
+ static setOinoSqlOrderParam(sqlOrderParam: string) {
82
+ if (sqlOrderParam) {
83
+ OINODbConfig.OINODB_SQL_ORDER_PARAM = sqlOrderParam;
84
+ }
85
+ }
86
+
87
+ /**
88
+ * Set the name of the OINODbSqlLimit-param field
89
+ *
90
+ * @param sqlLimitParam name of the http parameter with `OINODbSqlLimit` definition
91
+ *
92
+ */
93
+ static setOinoSqlLimitParam(sqlLimitParam: string) {
94
+ if (sqlLimitParam) {
95
+ OINODbConfig.OINODB_SQL_LIMIT_PARAM = sqlLimitParam;
96
+ }
97
+ }
98
+ }