@oino-ts/types 0.17.1 → 0.17.3

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,100 +0,0 @@
1
- import { OINODb, OINODbParams, OINODbDataSet, OINODbApi, OINODataCell, OINOResult } from "@oino-ts/db";
2
- /**
3
- * Implementation of MariaDb/MySql-database.
4
- *
5
- */
6
- export declare class OINODbMsSql extends OINODb {
7
- private _pool;
8
- /**
9
- * Constructor of `OINODbMsSql`
10
- * @param params database parameters
11
- */
12
- constructor(params: OINODbParams);
13
- private _query;
14
- private _exec;
15
- /**
16
- * Print a table name using database specific SQL escaping.
17
- *
18
- * @param sqlTable name of the table
19
- *
20
- */
21
- printSqlTablename(sqlTable: string): string;
22
- /**
23
- * Print a column name with correct SQL escaping.
24
- *
25
- * @param sqlColumn name of the column
26
- *
27
- */
28
- printSqlColumnname(sqlColumn: string): string;
29
- /**
30
- * Print a single data value from serialization using the context of the native data
31
- * type with the correct SQL escaping.
32
- *
33
- * @param cellValue data from sql results
34
- * @param sqlType native type name for table column
35
- *
36
- */
37
- printCellAsSqlValue(cellValue: OINODataCell, sqlType: string): string;
38
- /**
39
- * Print a single string value as valid sql literal
40
- *
41
- * @param sqlString string value
42
- *
43
- */
44
- printSqlString(sqlString: string): string;
45
- /**
46
- * Parse a single SQL result value for serialization using the context of the native data
47
- * type.
48
- *
49
- * @param sqlValue data from serialization
50
- * @param sqlType native type name for table column
51
- *
52
- */
53
- parseSqlValueAsCell(sqlValue: OINODataCell, sqlType: string): OINODataCell;
54
- /**
55
- * Print SQL select statement with DB specific formatting.
56
- *
57
- * @param tableName - The name of the table to select from.
58
- * @param columnNames - The columns to be selected.
59
- * @param whereCondition - The WHERE clause to filter the results.
60
- * @param orderCondition - The ORDER BY clause to sort the results.
61
- * @param limitCondition - The LIMIT clause to limit the number of results.
62
- * @param groupByCondition - The GROUP BY clause to group the results.
63
- *
64
- */
65
- printSqlSelect(tableName: string, columnNames: string, whereCondition: string, orderCondition: string, limitCondition: string, groupByCondition: string): string;
66
- /**
67
- * Connect to database.
68
- *
69
- */
70
- connect(): Promise<OINOResult>;
71
- /**
72
- * Validate connection to database is working.
73
- *
74
- */
75
- validate(): Promise<OINOResult>;
76
- /**
77
- * Execute a select operation.
78
- *
79
- * @param sql SQL statement.
80
- *
81
- */
82
- sqlSelect(sql: string): Promise<OINODbDataSet>;
83
- /**
84
- * Execute other sql operations.
85
- *
86
- * @param sql SQL statement.
87
- *
88
- */
89
- sqlExec(sql: string): Promise<OINODbDataSet>;
90
- private _getSchemaSql;
91
- private _getValidateSql;
92
- /**
93
- * Initialize a data model by getting the SQL schema and populating OINODbDataFields of
94
- * the model.
95
- *
96
- * @param api api which data model to initialize.
97
- *
98
- */
99
- initializeApiDatamodel(api: OINODbApi): Promise<void>;
100
- }
@@ -1 +0,0 @@
1
- export { OINODbMsSql } from "./OINODbMsSql.js";
@@ -1,89 +0,0 @@
1
- import { OINODb, OINODbParams, OINODbDataSet, OINODbApi, OINODataCell, OINOResult } from "@oino-ts/db";
2
- /**
3
- * Implementation of Postgresql-database.
4
- *
5
- */
6
- export declare class OINODbPostgresql extends OINODb {
7
- private _pool;
8
- /**
9
- * Constructor of `OINODbPostgresql`
10
- * @param params database paraneters
11
- */
12
- constructor(params: OINODbParams);
13
- private _parseFieldLength;
14
- private _query;
15
- private _exec;
16
- /**
17
- * Print a table name using database specific SQL escaping.
18
- *
19
- * @param sqlTable name of the table
20
- *
21
- */
22
- printSqlTablename(sqlTable: string): string;
23
- /**
24
- * Print a column name with correct SQL escaping.
25
- *
26
- * @param sqlColumn name of the column
27
- *
28
- */
29
- printSqlColumnname(sqlColumn: string): string;
30
- /**
31
- * Print a single data value from serialization using the context of the native data
32
- * type with the correct SQL escaping.
33
- *
34
- * @param cellValue data from sql results
35
- * @param sqlType native type name for table column
36
- *
37
- */
38
- printCellAsSqlValue(cellValue: OINODataCell, sqlType: string): string;
39
- /**
40
- * Print a single string value as valid sql literal
41
- *
42
- * @param sqlString string value
43
- *
44
- */
45
- printSqlString(sqlString: string): string;
46
- /**
47
- * Parse a single SQL result value for serialization using the context of the native data
48
- * type.
49
- *
50
- * @param sqlValue data from serialization
51
- * @param sqlType native type name for table column
52
- *
53
- */
54
- parseSqlValueAsCell(sqlValue: OINODataCell, sqlType: string): OINODataCell;
55
- /**
56
- * Connect to database.
57
- *
58
- */
59
- connect(): Promise<OINOResult>;
60
- /**
61
- * Validate connection to database is working.
62
- *
63
- */
64
- validate(): Promise<OINOResult>;
65
- /**
66
- * Execute a select operation.
67
- *
68
- * @param sql SQL statement.
69
- *
70
- */
71
- sqlSelect(sql: string): Promise<OINODbDataSet>;
72
- /**
73
- * Execute other sql operations.
74
- *
75
- * @param sql SQL statement.
76
- *
77
- */
78
- sqlExec(sql: string): Promise<OINODbDataSet>;
79
- private _getSchemaSql;
80
- private _getValidateSql;
81
- /**
82
- * Initialize a data model by getting the SQL schema and populating OINODbDataFields of
83
- * the model.
84
- *
85
- * @param api api which data model to initialize.
86
- *
87
- */
88
- initializeApiDatamodel(api: OINODbApi): Promise<void>;
89
- }
@@ -1 +0,0 @@
1
- export { OINODbPostgresql } from "./OINODbPostgresql.js";
@@ -1,42 +0,0 @@
1
- export declare const OINOHASHID_MIN_LENGTH: number;
2
- export declare const OINOHASHID_MAX_LENGTH: number;
3
- /**
4
- * Hashid implementation for OINO API:s for the purpose of making it infeasible to scan
5
- * through numeric autoinc keys. It's not a solution to keeping the id secret in insecure
6
- * channels, just making it hard enough to not iterate through the entire key space. Half
7
- * of the the hashid length is nonce and half cryptotext, i.e. 16 char hashid 8 chars of
8
- * base64 encoded nonce ~ 6 bytes or 48 bits of entropy.
9
- *
10
- */
11
- export declare class OINOHashid {
12
- private _key;
13
- private _iv;
14
- private _domainId;
15
- private _minLength;
16
- private _staticIds;
17
- /**
18
- * Hashid constructor
19
- *
20
- * @param key AES128 key (32 char hex-string)
21
- * @param domainId a sufficiently unique domain ID in which row-Id's are unique
22
- * @param minLength minimum length of nonce and crypto
23
- * @param staticIds whether hash values should remain static per row or random values
24
- *
25
- */
26
- constructor(key: string, domainId: string, minLength?: number, staticIds?: boolean);
27
- /**
28
- * Encode given id value as a hashid either using random data or given seed value for nonce.
29
- *
30
- * @param id numeric value
31
- * @param cellSeed a sufficiently unique seed for the current cell to keep hashids unique but persistent (e.g. fieldname + primarykey values)
32
- *
33
- */
34
- encode(id: string, cellSeed?: string): string;
35
- /**
36
- * Decode given hashid.
37
- *
38
- * @param hashid value
39
- *
40
- */
41
- decode(hashid: string): string;
42
- }
@@ -1 +0,0 @@
1
- export { OINOHashid } from "./OINOHashid.js";