@proteinjs/db-driver-spanner 1.23.5 → 1.24.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.
- package/CHANGELOG.md +16 -0
- package/dist/generated/test/index.d.ts.map +1 -1
- package/dist/generated/test/index.js +15 -1
- package/dist/generated/test/index.js.map +1 -1
- package/dist/src/SpannerSchemaOperations.d.ts.map +1 -1
- package/dist/src/SpannerSchemaOperations.js +4 -1
- package/dist/src/SpannerSchemaOperations.js.map +1 -1
- package/dist/test/ColumnEncryption.test.d.ts +2 -0
- package/dist/test/ColumnEncryption.test.d.ts.map +1 -0
- package/dist/test/ColumnEncryption.test.js +482 -0
- package/dist/test/ColumnEncryption.test.js.map +1 -0
- package/dist/test/EncryptedSearch.test.d.ts +2 -0
- package/dist/test/EncryptedSearch.test.d.ts.map +1 -0
- package/dist/test/EncryptedSearch.test.js +455 -0
- package/dist/test/EncryptedSearch.test.js.map +1 -0
- package/dist/test/EncryptionLifecycleWalker.test.d.ts +2 -0
- package/dist/test/EncryptionLifecycleWalker.test.d.ts.map +1 -0
- package/dist/test/EncryptionLifecycleWalker.test.js +408 -0
- package/dist/test/EncryptionLifecycleWalker.test.js.map +1 -0
- package/dist/test/EncryptionPerf.test.d.ts +2 -0
- package/dist/test/EncryptionPerf.test.d.ts.map +1 -0
- package/dist/test/EncryptionPerf.test.js +278 -0
- package/dist/test/EncryptionPerf.test.js.map +1 -0
- package/dist/test/EncryptionSortAndUnique.test.d.ts +2 -0
- package/dist/test/EncryptionSortAndUnique.test.d.ts.map +1 -0
- package/dist/test/EncryptionSortAndUnique.test.js +229 -0
- package/dist/test/EncryptionSortAndUnique.test.js.map +1 -0
- package/dist/test/index.d.ts +1 -0
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +1 -0
- package/dist/test/index.js.map +1 -1
- package/dist/test/util/columnEncryptionTestHarness.d.ts +23 -0
- package/dist/test/util/columnEncryptionTestHarness.d.ts.map +1 -0
- package/dist/test/util/columnEncryptionTestHarness.js +136 -0
- package/dist/test/util/columnEncryptionTestHarness.js.map +1 -0
- package/dist/test/util/columnEncryptionTestTables.d.ts +75 -0
- package/dist/test/util/columnEncryptionTestTables.d.ts.map +1 -0
- package/dist/test/util/columnEncryptionTestTables.js +124 -0
- package/dist/test/util/columnEncryptionTestTables.js.map +1 -0
- package/dist/test/util/serviceUpdateVerbsTestTables.d.ts +2 -2
- package/generated/test/index.ts +15 -1
- package/package.json +6 -6
- package/src/SpannerSchemaOperations.ts +4 -1
- package/test/ColumnEncryption.test.ts +252 -0
- package/test/EncryptedSearch.test.ts +247 -0
- package/test/EncryptionLifecycleWalker.test.ts +223 -0
- package/test/EncryptionPerf.test.ts +156 -0
- package/test/EncryptionSortAndUnique.test.ts +130 -0
- package/test/index.ts +1 -0
- package/test/util/columnEncryptionTestHarness.ts +54 -0
- package/test/util/columnEncryptionTestTables.ts +115 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
39
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
40
|
+
if (ar || !(i in from)) {
|
|
41
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
42
|
+
ar[i] = from[i];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.purgeColumnEncryptionTestRows = exports.loadColumnEncryptionTestSchema = void 0;
|
|
49
|
+
var db_1 = require("@proteinjs/db");
|
|
50
|
+
var test_1 = require("@proteinjs/db/test");
|
|
51
|
+
/**
|
|
52
|
+
* Schema loading for the column-encryption suites. `Db.delete` consults the reverse-cascade
|
|
53
|
+
* edge index over the WHOLE static table registry, and dynamic-reference edges are
|
|
54
|
+
* target-agnostic — so a delete from ANY table queries every registered table holding a
|
|
55
|
+
* `reverseCascadeDelete` dynamic-reference column (the cascade-delete test tables). A
|
|
56
|
+
* single-file run must therefore create those alongside the suite's own tables, plus the
|
|
57
|
+
* framework's data-key table. Serial `loadTable` (never batch `loadTables`): the registry
|
|
58
|
+
* deliberately holds same-name table pairs for schema-change tests, which a batch create
|
|
59
|
+
* would collide on.
|
|
60
|
+
*
|
|
61
|
+
* @internal This module is intended to be used only in tests.
|
|
62
|
+
*/
|
|
63
|
+
var loadColumnEncryptionTestSchema = function (tableManager, suiteTables) { return __awaiter(void 0, void 0, void 0, function () {
|
|
64
|
+
var tables, _i, tables_1, table;
|
|
65
|
+
return __generator(this, function (_a) {
|
|
66
|
+
switch (_a.label) {
|
|
67
|
+
case 0:
|
|
68
|
+
tables = __spreadArray(__spreadArray(__spreadArray([], Object.values(test_1.cascadeDeleteTestTables), true), [
|
|
69
|
+
new db_1.DataEncryptionKeyTable()
|
|
70
|
+
], false), suiteTables, true);
|
|
71
|
+
_i = 0, tables_1 = tables;
|
|
72
|
+
_a.label = 1;
|
|
73
|
+
case 1:
|
|
74
|
+
if (!(_i < tables_1.length)) return [3 /*break*/, 4];
|
|
75
|
+
table = tables_1[_i];
|
|
76
|
+
return [4 /*yield*/, tableManager.loadTable(table)];
|
|
77
|
+
case 2:
|
|
78
|
+
_a.sent();
|
|
79
|
+
_a.label = 3;
|
|
80
|
+
case 3:
|
|
81
|
+
_i++;
|
|
82
|
+
return [3 /*break*/, 1];
|
|
83
|
+
case 4: return [2 /*return*/];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}); };
|
|
87
|
+
exports.loadColumnEncryptionTestSchema = loadColumnEncryptionTestSchema;
|
|
88
|
+
/**
|
|
89
|
+
* Clean-slate purge of a suite's tables (rows + their derived token tables) in beforeAll:
|
|
90
|
+
* a prior run killed mid-flight (or a teardown starved out by shared-emulator contention)
|
|
91
|
+
* leaves seeded rows behind, and exact-match search assertions must never depend on a
|
|
92
|
+
* previous process having exited cleanly.
|
|
93
|
+
*/
|
|
94
|
+
var purgeColumnEncryptionTestRows = function (spannerDriver, suiteTables) { return __awaiter(void 0, void 0, void 0, function () {
|
|
95
|
+
var encryptedColumns, tables, _i, suiteTables_1, table, tokenTable, _loop_1, _a, tables_2, table;
|
|
96
|
+
return __generator(this, function (_b) {
|
|
97
|
+
switch (_b.label) {
|
|
98
|
+
case 0:
|
|
99
|
+
encryptedColumns = new db_1.EncryptedColumns();
|
|
100
|
+
tables = [];
|
|
101
|
+
for (_i = 0, suiteTables_1 = suiteTables; _i < suiteTables_1.length; _i++) {
|
|
102
|
+
table = suiteTables_1[_i];
|
|
103
|
+
tables.push(table);
|
|
104
|
+
tokenTable = encryptedColumns.tokenTableFor(table);
|
|
105
|
+
if (tokenTable) {
|
|
106
|
+
tables.push(tokenTable);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
_loop_1 = function (table) {
|
|
110
|
+
return __generator(this, function (_c) {
|
|
111
|
+
switch (_c.label) {
|
|
112
|
+
case 0: return [4 /*yield*/, spannerDriver.runDml(function () { return ({ sql: "DELETE FROM `".concat(table.name, "` WHERE TRUE") }); })];
|
|
113
|
+
case 1:
|
|
114
|
+
_c.sent();
|
|
115
|
+
return [2 /*return*/];
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
_a = 0, tables_2 = tables;
|
|
120
|
+
_b.label = 1;
|
|
121
|
+
case 1:
|
|
122
|
+
if (!(_a < tables_2.length)) return [3 /*break*/, 4];
|
|
123
|
+
table = tables_2[_a];
|
|
124
|
+
return [5 /*yield**/, _loop_1(table)];
|
|
125
|
+
case 2:
|
|
126
|
+
_b.sent();
|
|
127
|
+
_b.label = 3;
|
|
128
|
+
case 3:
|
|
129
|
+
_a++;
|
|
130
|
+
return [3 /*break*/, 1];
|
|
131
|
+
case 4: return [2 /*return*/];
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}); };
|
|
135
|
+
exports.purgeColumnEncryptionTestRows = purgeColumnEncryptionTestRows;
|
|
136
|
+
//# sourceMappingURL=columnEncryptionTestHarness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnEncryptionTestHarness.js","sourceRoot":"","sources":["../../../test/util/columnEncryptionTestHarness.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAA8F;AAC9F,2CAA6D;AAG7D;;;;;;;;;;;GAWG;AACI,IAAM,8BAA8B,GAAG,UAC5C,YAA0B,EAC1B,WAAyB;;;;;gBAEnB,MAAM,iDACP,MAAM,CAAC,MAAM,CAAC,8BAAuB,CAAC;oBACzC,IAAI,2BAAsB,EAAE;2BACzB,WAAW,OACf,CAAC;sBACwB,EAAN,iBAAM;;;qBAAN,CAAA,oBAAM,CAAA;gBAAf,KAAK;gBACd,qBAAM,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,EAAA;;gBAAnC,SAAmC,CAAC;;;gBADlB,IAAM,CAAA;;;;;KAG3B,CAAC;AAZW,QAAA,8BAA8B,kCAYzC;AAEF;;;;;GAKG;AACI,IAAM,6BAA6B,GAAG,UAC3C,aAA4B,EAC5B,WAAyB;;;;;gBAEnB,gBAAgB,GAAG,IAAI,qBAAgB,EAAE,CAAC;gBAC1C,MAAM,GAAiB,EAAE,CAAC;gBAChC,WAA+B,EAAX,2BAAW,EAAX,yBAAW,EAAX,IAAW,EAAE;oBAAtB,KAAK;oBACd,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBACb,UAAU,GAAG,gBAAgB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;oBACzD,IAAI,UAAU,EAAE;wBACd,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;qBACzB;iBACF;oCAEU,KAAK;;;oCACd,qBAAM,aAAa,CAAC,MAAM,CAAC,cAAM,OAAA,CAAC,EAAE,GAAG,EAAE,uBAAiB,KAAK,CAAC,IAAI,iBAAe,EAAE,CAAC,EAArD,CAAqD,CAAC,EAAA;;gCAAvF,SAAuF,CAAC;;;;;sBADhE,EAAN,iBAAM;;;qBAAN,CAAA,oBAAM,CAAA;gBAAf,KAAK;8CAAL,KAAK;;;;;gBAAI,IAAM,CAAA;;;;;KAG3B,CAAC;AAjBW,QAAA,6BAA6B,iCAiBxC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Record, Table } from '@proteinjs/db';
|
|
2
|
+
/**
|
|
3
|
+
* Tables for the column-encryption suites (`ColumnEncryption.test.ts`,
|
|
4
|
+
* `EncryptedSearch.test.ts`, `EncryptionSortAndUnique.test.ts`,
|
|
5
|
+
* `EncryptionLifecycleWalker.test.ts`, `EncryptionPerf.test.ts`).
|
|
6
|
+
*
|
|
7
|
+
* Defined here rather than in the test files so the reflection build registers them as
|
|
8
|
+
* `Table` loadables — the driver's statement generation and the framework's derived
|
|
9
|
+
* token-table subqueries resolve tables through `tableByName`.
|
|
10
|
+
*/
|
|
11
|
+
/** Core seam suite: contains + equality + opaque encrypted + plaintext metadata. */
|
|
12
|
+
export interface EncNote extends Record {
|
|
13
|
+
scope: string;
|
|
14
|
+
title?: string | null;
|
|
15
|
+
label?: string | null;
|
|
16
|
+
body?: string | null;
|
|
17
|
+
status?: string | null;
|
|
18
|
+
}
|
|
19
|
+
export declare class EncNoteTable extends Table<EncNote> {
|
|
20
|
+
name: string;
|
|
21
|
+
columns: Table<EncNote>['columns'];
|
|
22
|
+
}
|
|
23
|
+
/** Search-exactness suite: one contains column beside plaintext metadata. */
|
|
24
|
+
export interface EncSearchDoc extends Record {
|
|
25
|
+
scope: string;
|
|
26
|
+
title?: string | null;
|
|
27
|
+
name?: string | null;
|
|
28
|
+
kind?: string | null;
|
|
29
|
+
}
|
|
30
|
+
export declare class EncSearchDocTable extends Table<EncSearchDoc> {
|
|
31
|
+
name: string;
|
|
32
|
+
columns: Table<EncSearchDoc>['columns'];
|
|
33
|
+
}
|
|
34
|
+
/** sortKey suite: the declared bounded-reveal native ORDER BY. */
|
|
35
|
+
export interface EncSortedItem extends Record {
|
|
36
|
+
scope: string;
|
|
37
|
+
title?: string | null;
|
|
38
|
+
}
|
|
39
|
+
export declare class EncSortedItemTable extends Table<EncSortedItem> {
|
|
40
|
+
name: string;
|
|
41
|
+
columns: Table<EncSortedItem>['columns'];
|
|
42
|
+
}
|
|
43
|
+
/** Uniqueness suite: unique moves onto the equality fingerprint. */
|
|
44
|
+
export interface EncUniqueTag extends Record {
|
|
45
|
+
scope: string;
|
|
46
|
+
name?: string | null;
|
|
47
|
+
}
|
|
48
|
+
export declare class EncUniqueTagTable extends Table<EncUniqueTag> {
|
|
49
|
+
name: string;
|
|
50
|
+
columns: Table<EncUniqueTag>['columns'];
|
|
51
|
+
}
|
|
52
|
+
/** Lifecycle-walker suite: encrypt / retokenize / decrypt / rotate transitions. */
|
|
53
|
+
export interface EncWalkRow extends Record {
|
|
54
|
+
scope: string;
|
|
55
|
+
title?: string | null;
|
|
56
|
+
body?: string | null;
|
|
57
|
+
}
|
|
58
|
+
export declare class EncWalkRowTable extends Table<EncWalkRow> {
|
|
59
|
+
name: string;
|
|
60
|
+
columns: Table<EncWalkRow>['columns'];
|
|
61
|
+
}
|
|
62
|
+
/** Perf suite: encrypted-at-rest body vs a plaintext twin, 1k-row reads. */
|
|
63
|
+
export interface EncPerfRow extends Record {
|
|
64
|
+
scope: string;
|
|
65
|
+
body?: string | null;
|
|
66
|
+
}
|
|
67
|
+
export declare class EncPerfRowTable extends Table<EncPerfRow> {
|
|
68
|
+
name: string;
|
|
69
|
+
columns: Table<EncPerfRow>['columns'];
|
|
70
|
+
}
|
|
71
|
+
export declare class PlainPerfRowTable extends Table<EncPerfRow> {
|
|
72
|
+
name: string;
|
|
73
|
+
columns: Table<EncPerfRow>['columns'];
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=columnEncryptionTestTables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnEncryptionTestTables.d.ts","sourceRoot":"","sources":["../../../test/util/columnEncryptionTestTables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,KAAK,EAAqB,MAAM,eAAe,CAAC;AAE/E;;;;;;;;GAQG;AAEH,oFAAoF;AACpF,MAAM,WAAW,OAAQ,SAAQ,MAAM;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,qBAAa,YAAa,SAAQ,KAAK,CAAC,OAAO,CAAC;IAC9C,IAAI,SAAsB;IAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAM/B;CACJ;AAED,6EAA6E;AAC7E,MAAM,WAAW,YAAa,SAAQ,MAAM;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI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D,IAAI,SAA0B;IAC9B,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAGlC;CACJ;AAED,qBAAa,iBAAkB,SAAQ,KAAK,CAAC,UAAU,CAAC;IACtD,IAAI,SAA4B;IAChC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAGlC;CACJ"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.PlainPerfRowTable = exports.EncPerfRowTable = exports.EncWalkRowTable = exports.EncUniqueTagTable = exports.EncSortedItemTable = exports.EncSearchDocTable = exports.EncNoteTable = void 0;
|
|
19
|
+
var db_1 = require("@proteinjs/db");
|
|
20
|
+
var EncNoteTable = /** @class */ (function (_super) {
|
|
21
|
+
__extends(EncNoteTable, _super);
|
|
22
|
+
function EncNoteTable() {
|
|
23
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
_this.name = 'db_test_enc_note';
|
|
25
|
+
_this.columns = (0, db_1.withRecordColumns)({
|
|
26
|
+
scope: new db_1.StringColumn('scope', {}, 36),
|
|
27
|
+
title: new db_1.StringColumn('title', { encrypted: { searchable: 'contains' } }),
|
|
28
|
+
label: new db_1.StringColumn('label', { encrypted: { searchable: 'equality' } }),
|
|
29
|
+
body: new db_1.StringColumn('body', { encrypted: {} }, 'MAX'),
|
|
30
|
+
status: new db_1.StringColumn('status', { encrypted: false }),
|
|
31
|
+
});
|
|
32
|
+
return _this;
|
|
33
|
+
}
|
|
34
|
+
return EncNoteTable;
|
|
35
|
+
}(db_1.Table));
|
|
36
|
+
exports.EncNoteTable = EncNoteTable;
|
|
37
|
+
var EncSearchDocTable = /** @class */ (function (_super) {
|
|
38
|
+
__extends(EncSearchDocTable, _super);
|
|
39
|
+
function EncSearchDocTable() {
|
|
40
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
41
|
+
_this.name = 'db_test_enc_search_doc';
|
|
42
|
+
_this.columns = (0, db_1.withRecordColumns)({
|
|
43
|
+
scope: new db_1.StringColumn('scope', {}, 36),
|
|
44
|
+
title: new db_1.StringColumn('title', { encrypted: { searchable: 'contains' } }),
|
|
45
|
+
name: new db_1.StringColumn('name', { encrypted: { searchable: 'equality' } }),
|
|
46
|
+
kind: new db_1.StringColumn('kind', { encrypted: false }),
|
|
47
|
+
});
|
|
48
|
+
return _this;
|
|
49
|
+
}
|
|
50
|
+
return EncSearchDocTable;
|
|
51
|
+
}(db_1.Table));
|
|
52
|
+
exports.EncSearchDocTable = EncSearchDocTable;
|
|
53
|
+
var EncSortedItemTable = /** @class */ (function (_super) {
|
|
54
|
+
__extends(EncSortedItemTable, _super);
|
|
55
|
+
function EncSortedItemTable() {
|
|
56
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
57
|
+
_this.name = 'db_test_enc_sorted_item';
|
|
58
|
+
_this.columns = (0, db_1.withRecordColumns)({
|
|
59
|
+
scope: new db_1.StringColumn('scope', {}, 36),
|
|
60
|
+
title: new db_1.StringColumn('title', { encrypted: { searchable: 'contains', sortKey: { revealPrefix: 3 } } }),
|
|
61
|
+
});
|
|
62
|
+
return _this;
|
|
63
|
+
}
|
|
64
|
+
return EncSortedItemTable;
|
|
65
|
+
}(db_1.Table));
|
|
66
|
+
exports.EncSortedItemTable = EncSortedItemTable;
|
|
67
|
+
var EncUniqueTagTable = /** @class */ (function (_super) {
|
|
68
|
+
__extends(EncUniqueTagTable, _super);
|
|
69
|
+
function EncUniqueTagTable() {
|
|
70
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
71
|
+
_this.name = 'db_test_enc_unique_tag';
|
|
72
|
+
_this.columns = (0, db_1.withRecordColumns)({
|
|
73
|
+
scope: new db_1.StringColumn('scope', {}, 36),
|
|
74
|
+
name: new db_1.StringColumn('name', { unique: { unique: true }, encrypted: { searchable: 'equality' } }),
|
|
75
|
+
});
|
|
76
|
+
return _this;
|
|
77
|
+
}
|
|
78
|
+
return EncUniqueTagTable;
|
|
79
|
+
}(db_1.Table));
|
|
80
|
+
exports.EncUniqueTagTable = EncUniqueTagTable;
|
|
81
|
+
var EncWalkRowTable = /** @class */ (function (_super) {
|
|
82
|
+
__extends(EncWalkRowTable, _super);
|
|
83
|
+
function EncWalkRowTable() {
|
|
84
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
85
|
+
_this.name = 'db_test_enc_walk_row';
|
|
86
|
+
_this.columns = (0, db_1.withRecordColumns)({
|
|
87
|
+
scope: new db_1.StringColumn('scope', {}, 36),
|
|
88
|
+
title: new db_1.StringColumn('title', { encrypted: { searchable: 'contains' } }),
|
|
89
|
+
body: new db_1.StringColumn('body', { encrypted: {} }, 'MAX'),
|
|
90
|
+
});
|
|
91
|
+
return _this;
|
|
92
|
+
}
|
|
93
|
+
return EncWalkRowTable;
|
|
94
|
+
}(db_1.Table));
|
|
95
|
+
exports.EncWalkRowTable = EncWalkRowTable;
|
|
96
|
+
var EncPerfRowTable = /** @class */ (function (_super) {
|
|
97
|
+
__extends(EncPerfRowTable, _super);
|
|
98
|
+
function EncPerfRowTable() {
|
|
99
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
100
|
+
_this.name = 'db_test_enc_perf_row';
|
|
101
|
+
_this.columns = (0, db_1.withRecordColumns)({
|
|
102
|
+
scope: new db_1.StringColumn('scope', {}, 36),
|
|
103
|
+
body: new db_1.StringColumn('body', { encrypted: {} }, 'MAX'),
|
|
104
|
+
});
|
|
105
|
+
return _this;
|
|
106
|
+
}
|
|
107
|
+
return EncPerfRowTable;
|
|
108
|
+
}(db_1.Table));
|
|
109
|
+
exports.EncPerfRowTable = EncPerfRowTable;
|
|
110
|
+
var PlainPerfRowTable = /** @class */ (function (_super) {
|
|
111
|
+
__extends(PlainPerfRowTable, _super);
|
|
112
|
+
function PlainPerfRowTable() {
|
|
113
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
114
|
+
_this.name = 'db_test_plain_perf_row';
|
|
115
|
+
_this.columns = (0, db_1.withRecordColumns)({
|
|
116
|
+
scope: new db_1.StringColumn('scope', {}, 36),
|
|
117
|
+
body: new db_1.StringColumn('body', { encrypted: false }, 'MAX'),
|
|
118
|
+
});
|
|
119
|
+
return _this;
|
|
120
|
+
}
|
|
121
|
+
return PlainPerfRowTable;
|
|
122
|
+
}(db_1.Table));
|
|
123
|
+
exports.PlainPerfRowTable = PlainPerfRowTable;
|
|
124
|
+
//# sourceMappingURL=columnEncryptionTestTables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnEncryptionTestTables.js","sourceRoot":"","sources":["../../../test/util/columnEncryptionTestTables.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oCAA+E;AAqB/E;IAAkC,gCAAc;IAAhD;QAAA,qEASC;QARC,UAAI,GAAG,kBAAkB,CAAC;QAC1B,aAAO,GAA8B,IAAA,sBAAiB,EAAU;YAC9D,KAAK,EAAE,IAAI,iBAAY,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC;YACxC,KAAK,EAAE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AiB;IAAtD;QAAA,qEAMC;QALC,UAAI,GAAG,sBAAsB,CAAC;QAC9B,aAAO,GAAiC,IAAA,sBAAiB,EAAa;YACpE,KAAK,EAAE,IAAI,iBAAY,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC;YACxC,IAAI,EAAE,IAAI,iBAAY,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC;SACzD,CAAC,CAAC;;IACL,CAAC;IAAD,sBAAC;AAAD,CAAC,AAND,CAAqC,UAAK,GAMzC;AANY,0CAAe;AAQ5B;IAAuC,qCAAiB;IAAxD;QAAA,qEAMC;QALC,UAAI,GAAG,wBAAwB,CAAC;QAChC,aAAO,GAAiC,IAAA,sBAAiB,EAAa;YACpE,KAAK,EAAE,IAAI,iBAAY,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC;YACxC,IAAI,EAAE,IAAI,iBAAY,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,CAAC;SAC5D,CAAC,CAAC;;IACL,CAAC;IAAD,wBAAC;AAAD,CAAC,AAND,CAAuC,UAAK,GAM3C;AANY,8CAAiB"}
|
|
@@ -36,10 +36,10 @@ export declare class ServiceVerbsDocTable extends Table<ServiceVerbsDoc> {
|
|
|
36
36
|
created: import("@proteinjs/db").Column<import("moment").Moment, any>;
|
|
37
37
|
updated: import("@proteinjs/db").Column<import("moment").Moment, any>;
|
|
38
38
|
} & {} & {
|
|
39
|
-
title: import("@proteinjs/db").Column<string, any>;
|
|
40
39
|
scope: import("@proteinjs/db").Column<string | undefined, any>;
|
|
41
|
-
|
|
40
|
+
title: import("@proteinjs/db").Column<string, any>;
|
|
42
41
|
body: import("@proteinjs/db").Column<ServiceVerbsDocBody | undefined, any>;
|
|
42
|
+
members: import("@proteinjs/db").Column<ReferenceArray<ServiceVerbsDoc> | undefined, any>;
|
|
43
43
|
} & {};
|
|
44
44
|
}
|
|
45
45
|
//# sourceMappingURL=serviceUpdateVerbsTestTables.d.ts.map
|