@harperfast/harper-pro 5.0.0-alpha.9 → 5.0.0-beta.2

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 (181) hide show
  1. package/core/.dockerignore +9 -0
  2. package/core/.git-blame-ignore-revs +2 -0
  3. package/core/.github/workflows/create-release.yaml +4 -4
  4. package/core/.github/workflows/integration-tests.yml +12 -10
  5. package/core/.github/workflows/notify-release-published.yaml +1 -1
  6. package/core/.github/workflows/publish-docker.yaml +2 -2
  7. package/core/.github/workflows/publish-npm.yaml +4 -4
  8. package/core/CONTRIBUTING.md +1 -1
  9. package/core/Dockerfile +62 -0
  10. package/core/build-tools/build-studio.sh +12 -0
  11. package/core/build-tools/build.sh +22 -0
  12. package/core/build-tools/download-prebuilds.js +13 -0
  13. package/core/components/Logger.ts +14 -0
  14. package/core/components/Scope.ts +35 -11
  15. package/core/components/componentLoader.ts +27 -10
  16. package/core/components/operations.js +10 -2
  17. package/core/config/configUtils.js +1 -1
  18. package/core/dataLayer/CreateTableObject.js +2 -2
  19. package/core/dataLayer/schema.js +7 -5
  20. package/core/dataLayer/schemaDescribe.js +1 -1
  21. package/core/index.d.ts +11 -6
  22. package/core/index.js +2 -0
  23. package/core/integrationTests/README.md +24 -0
  24. package/core/integrationTests/apiTests/tests/10_otherRoleTests.mjs +6 -6
  25. package/core/integrationTests/apiTests/tests/12_configuration.mjs +1 -1
  26. package/core/integrationTests/apiTests/tests/14_tokenAuth.mjs +2 -2
  27. package/core/integrationTests/apiTests/tests/16_terminologyUpdates.mjs +4 -4
  28. package/core/integrationTests/apiTests/tests/1_environmentSetup.mjs +1 -1
  29. package/core/integrationTests/apiTests/tests/2_dataLoad.mjs +4 -4
  30. package/core/integrationTests/apiTests/tests/3_sqlTests.mjs +3 -3
  31. package/core/integrationTests/apiTests/tests/4_noSqlTests.mjs +12 -12
  32. package/core/integrationTests/apiTests/tests/5_noSqlRoleTesting.mjs +8 -8
  33. package/core/integrationTests/apiTests/tests/7_jobsAndJobRoleTesting.mjs +10 -12
  34. package/core/integrationTests/apiTests/tests/8_deleteTests.mjs +8 -8
  35. package/core/integrationTests/apiTests/tests/9_transactions.mjs +2 -2
  36. package/core/integrationTests/apiTests/utils/search.mjs +1 -1
  37. package/core/integrationTests/apiTests/utils/table.mjs +1 -1
  38. package/core/integrationTests/server/operation-user-rbac.test.ts +1 -1
  39. package/core/integrationTests/server/operations-server.test.ts +1 -1
  40. package/core/integrationTests/server/storage-reclamation.test.ts +1 -1
  41. package/core/integrationTests/utils/README.md +1 -15
  42. package/core/integrationTests/utils/harperLifecycle.ts +33 -21
  43. package/core/package.json +23 -5
  44. package/core/resources/ResourceInterface.ts +1 -1
  45. package/core/resources/Table.ts +26 -11
  46. package/core/resources/analytics/read.ts +33 -26
  47. package/core/resources/analytics/write.ts +3 -7
  48. package/core/resources/databases.ts +29 -18
  49. package/core/resources/search.ts +10 -5
  50. package/core/security/auth.ts +1 -1
  51. package/core/security/jsLoader.ts +302 -83
  52. package/core/security/keys.js +11 -12
  53. package/core/security/user.ts +3 -3
  54. package/core/server/REST.ts +18 -2
  55. package/core/server/Server.ts +2 -1
  56. package/core/server/fastifyRoutes.ts +1 -0
  57. package/core/server/http.ts +13 -9
  58. package/core/server/loadRootComponents.js +1 -0
  59. package/core/server/operationsServer.ts +2 -1
  60. package/core/server/threads/manageThreads.js +49 -35
  61. package/core/static/defaultConfig.yaml +3 -0
  62. package/core/unitTests/apiTests/RESTProperties-test.mjs +2 -2
  63. package/core/unitTests/apiTests/basicREST-test.mjs +2 -2
  64. package/core/unitTests/components/Scope.test.js +54 -16
  65. package/core/unitTests/components/fixtures/testJSWithDeps/child-dir/circular.js +4 -0
  66. package/core/unitTests/components/fixtures/testJSWithDeps/child-dir/in-child-dir.js +4 -0
  67. package/core/unitTests/components/fixtures/testJSWithDeps/child-dir/typestrip.ts +2 -0
  68. package/core/unitTests/components/fixtures/testJSWithDeps/resources.js +43 -0
  69. package/core/unitTests/components/fixtures/testJSWithDeps/test-child-process.js +18 -0
  70. package/core/unitTests/components/globalIsolation.test.js +87 -1
  71. package/core/unitTests/config/configUtils.test.js +1 -260
  72. package/core/unitTests/resources/query.test.js +16 -1
  73. package/core/unitTests/resources/vectorIndex.test.js +1 -1
  74. package/core/unitTests/server/fastifyRoutes/operations.test.js +1 -1
  75. package/core/unitTests/testUtils.js +0 -17
  76. package/core/utility/hdbTerms.ts +3 -0
  77. package/core/utility/installation.ts +2 -5
  78. package/core/utility/lmdb/commonUtility.js +21 -10
  79. package/dist/core/{resources/ResourceInterfaceV2.js → components/Logger.js} +1 -1
  80. package/dist/core/components/Logger.js.map +1 -0
  81. package/dist/core/components/Scope.js +18 -10
  82. package/dist/core/components/Scope.js.map +1 -1
  83. package/dist/core/components/componentLoader.js +17 -10
  84. package/dist/core/components/componentLoader.js.map +1 -1
  85. package/dist/core/components/operations.js +2 -2
  86. package/dist/core/components/operations.js.map +1 -1
  87. package/dist/core/config/configUtils.js +1 -1
  88. package/dist/core/config/configUtils.js.map +1 -1
  89. package/dist/core/dataLayer/CreateTableObject.js +2 -2
  90. package/dist/core/dataLayer/CreateTableObject.js.map +1 -1
  91. package/dist/core/dataLayer/schema.js +6 -5
  92. package/dist/core/dataLayer/schema.js.map +1 -1
  93. package/dist/core/dataLayer/schemaDescribe.js +1 -1
  94. package/dist/core/dataLayer/schemaDescribe.js.map +1 -1
  95. package/dist/core/index.js +2 -0
  96. package/dist/core/index.js.map +1 -1
  97. package/dist/core/resources/Table.js +12 -4
  98. package/dist/core/resources/Table.js.map +1 -1
  99. package/dist/core/resources/analytics/read.js +32 -22
  100. package/dist/core/resources/analytics/read.js.map +1 -1
  101. package/dist/core/resources/analytics/write.js +3 -6
  102. package/dist/core/resources/analytics/write.js.map +1 -1
  103. package/dist/core/resources/databases.js +22 -19
  104. package/dist/core/resources/databases.js.map +1 -1
  105. package/dist/core/resources/search.js +11 -5
  106. package/dist/core/resources/search.js.map +1 -1
  107. package/dist/core/security/auth.js +1 -1
  108. package/dist/core/security/auth.js.map +1 -1
  109. package/dist/core/security/jsLoader.js +265 -73
  110. package/dist/core/security/jsLoader.js.map +1 -1
  111. package/dist/core/security/keys.js +11 -12
  112. package/dist/core/security/keys.js.map +1 -1
  113. package/dist/core/security/user.js +3 -3
  114. package/dist/core/security/user.js.map +1 -1
  115. package/dist/core/server/REST.js +16 -2
  116. package/dist/core/server/REST.js.map +1 -1
  117. package/dist/core/server/Server.js.map +1 -1
  118. package/dist/core/server/fastifyRoutes.js +2 -0
  119. package/dist/core/server/fastifyRoutes.js.map +1 -1
  120. package/dist/core/server/http.js +12 -6
  121. package/dist/core/server/http.js.map +1 -1
  122. package/dist/core/server/loadRootComponents.js +1 -0
  123. package/dist/core/server/loadRootComponents.js.map +1 -1
  124. package/dist/core/server/operationsServer.js +3 -1
  125. package/dist/core/server/operationsServer.js.map +1 -1
  126. package/dist/core/server/threads/manageThreads.js +50 -35
  127. package/dist/core/server/threads/manageThreads.js.map +1 -1
  128. package/dist/core/utility/hdbTerms.js +3 -0
  129. package/dist/core/utility/hdbTerms.js.map +1 -1
  130. package/dist/core/utility/installation.js.map +1 -1
  131. package/dist/core/utility/lmdb/commonUtility.js +20 -13
  132. package/dist/core/utility/lmdb/commonUtility.js.map +1 -1
  133. package/dist/licensing/usageLicensing.js.map +1 -1
  134. package/dist/replication/knownNodes.js +5 -37
  135. package/dist/replication/knownNodes.js.map +1 -1
  136. package/dist/replication/nodeIdMapping.js +2 -35
  137. package/dist/replication/nodeIdMapping.js.map +1 -1
  138. package/dist/replication/replicationConnection.js +15 -6
  139. package/dist/replication/replicationConnection.js.map +1 -1
  140. package/dist/replication/replicator.js +3 -2
  141. package/dist/replication/replicator.js.map +1 -1
  142. package/dist/replication/setNode.js +1 -1
  143. package/dist/replication/setNode.js.map +1 -1
  144. package/dist/security/certificate.js.map +1 -1
  145. package/licensing/usageLicensing.ts +3 -2
  146. package/npm-shrinkwrap.json +303 -282
  147. package/package.json +4 -3
  148. package/replication/knownNodes.ts +3 -2
  149. package/replication/nodeIdMapping.ts +1 -1
  150. package/replication/replicationConnection.ts +33 -8
  151. package/replication/replicator.ts +7 -2
  152. package/replication/setNode.ts +1 -1
  153. package/security/certificate.ts +2 -1
  154. package/studio/web/assets/{index-v3wIpSYx.js → index-CWN9Wp5V.js} +2 -2
  155. package/studio/web/assets/{index-v3wIpSYx.js.map → index-CWN9Wp5V.js.map} +1 -1
  156. package/studio/web/assets/{index-ChCctErQ.js → index-CzghSAn2.js} +2 -2
  157. package/studio/web/assets/{index-ChCctErQ.js.map → index-CzghSAn2.js.map} +1 -1
  158. package/studio/web/assets/{index-Qu8D43wo.js → index-DMDhGP7N.js} +5 -5
  159. package/studio/web/assets/{index-Qu8D43wo.js.map → index-DMDhGP7N.js.map} +1 -1
  160. package/studio/web/assets/{index.lazy-tVSPM7bX.js → index.lazy-C-yDTGUy.js} +2 -2
  161. package/studio/web/assets/{index.lazy-tVSPM7bX.js.map → index.lazy-C-yDTGUy.js.map} +1 -1
  162. package/studio/web/assets/{profiler-C9as4sv-.js → profiler-0fZAOscv.js} +2 -2
  163. package/studio/web/assets/{profiler-C9as4sv-.js.map → profiler-0fZAOscv.js.map} +1 -1
  164. package/studio/web/assets/{react-redux-RRIhZnM6.js → react-redux-BIxqK8O6.js} +2 -2
  165. package/studio/web/assets/{react-redux-RRIhZnM6.js.map → react-redux-BIxqK8O6.js.map} +1 -1
  166. package/studio/web/assets/{startRecording-DYa4zCXV.js → startRecording-Ca3Gf2MY.js} +2 -2
  167. package/studio/web/assets/{startRecording-DYa4zCXV.js.map → startRecording-Ca3Gf2MY.js.map} +1 -1
  168. package/studio/web/index.html +1 -1
  169. package/core/resources/ResourceInterfaceV2.ts +0 -53
  170. package/core/resources/ResourceV2.ts +0 -67
  171. package/core/resources/analytics/profile.ts +0 -109
  172. package/core/unitTests/apiTests/analytics-test.mjs +0 -38
  173. package/core/v1.d.ts +0 -47
  174. package/core/v1.js +0 -38
  175. package/core/v2.d.ts +0 -47
  176. package/core/v2.js +0 -38
  177. package/dist/core/resources/ResourceInterfaceV2.js.map +0 -1
  178. package/dist/core/resources/ResourceV2.js +0 -27
  179. package/dist/core/resources/ResourceV2.js.map +0 -1
  180. package/dist/core/resources/analytics/profile.js +0 -144
  181. package/dist/core/resources/analytics/profile.js.map +0 -1
package/core/index.d.ts CHANGED
@@ -1,8 +1,14 @@
1
- export { Resource } from './resources/Resource.ts';
2
1
  import { Resource as ResourceImport } from './resources/Resource.ts';
2
+ import { server as serverImport } from './server/Server.ts';
3
+ import { tables as dbTables, databases as dbDatabases } from './resources/databases.ts';
4
+ import { BlobCreationOptions } from './resources/blob.ts';
5
+ import { Logger } from './utility/logging/logger.ts';
6
+
7
+ export { Resource } from './resources/Resource.ts';
3
8
  export type {
4
9
  Query,
5
10
  Context,
11
+ Session,
6
12
  SourceContext,
7
13
  SubscriptionRequest,
8
14
  RequestTargetOrId,
@@ -13,11 +19,9 @@ export type { RecordObject } from './resources/RecordEncoder.ts';
13
19
  export type { IterableEventQueue } from './resources/IterableEventQueue.ts';
14
20
  export { RequestTarget } from './resources/RequestTarget.ts';
15
21
  export { server } from './server/Server';
16
- import { server as serverImport } from './server/Server.ts';
17
- export { tables, databases } from './resources/databases.ts';
18
- import { tables as dbTables, databases as dbDatabases } from './resources/databases.ts';
19
- import { BlobCreationOptions } from './resources/blob.ts';
20
- import { Logger } from './utility/logging/logger.ts';
22
+ export { tables, databases, type Table } from './resources/databases.ts';
23
+ export type { Attribute } from './resources/Table.ts';
24
+
21
25
  export { Scope } from './components/Scope.ts';
22
26
  export type { FilesOption, FilesOptionObject } from './components/deriveGlobOptions.ts';
23
27
  export type { FileAndURLPathConfig } from './components/Component.ts';
@@ -41,6 +45,7 @@ export { type Logger, logger };
41
45
 
42
46
  declare global {
43
47
  const tables: typeof dbTables;
48
+ const logger: Logger;
44
49
  const databases: typeof dbDatabases;
45
50
  const server: typeof serverImport;
46
51
  const Resource: typeof ResourceImport;
package/core/index.js CHANGED
@@ -7,6 +7,7 @@ if (!workerThreads.isMainThread) {
7
7
  const { globals } = require('./server/threads/threadServer.js');
8
8
 
9
9
  // exported types are needed for parsing as well
10
+ exports.Attribute = undefined;
10
11
  exports.Config = undefined;
11
12
  exports.ConfigValue = undefined;
12
13
  exports.Context = undefined;
@@ -25,6 +26,7 @@ exports.Scope = undefined;
25
26
  exports.Session = undefined;
26
27
  exports.SourceContext = undefined;
27
28
  exports.SubscriptionRequest = undefined;
29
+ exports.Table = undefined;
28
30
  exports.User = undefined;
29
31
 
30
32
  // these are all overwritten by the globals, but need to be here so that Node's static
@@ -118,6 +118,30 @@ This option is used by the CI workflow and is useful for executing the same subs
118
118
 
119
119
  This option can be overridden using the `HARPER_INTEGRATION_TEST_SHARD` environment variable.
120
120
 
121
+ ### Server Log Capture
122
+
123
+ When `HARPER_INTEGRATION_TEST_LOG_DIR` is set, each Harper instance writes its logs (`hdb.log`, `stdout.log`, `stderr.log`) to a per-suite subdirectory under the specified path. Directory names are derived from the suite name and loopback address (e.g. `Operations_Server-127_0_0_2/`).
124
+
125
+ This is primarily designed for CI, where Harper's child process output is not visible in the GitHub Actions UI. On test failure, the log directory is uploaded as an artifact for debugging.
126
+
127
+ **Important:** When this setting is active, it overrides any `logging.root` value in the Harper config passed via `options.config`. The suite log directory takes precedence so that logs are captured in a known, per-suite location.
128
+
129
+ Logs from passing suites are automatically cleaned up on process exit. Only logs from failed suites are preserved.
130
+
131
+ ```sh
132
+ # Local usage
133
+ HARPER_INTEGRATION_TEST_LOG_DIR=/tmp/harper-test-logs npm run test:integration
134
+
135
+ # Inspect logs after a failure
136
+ ls /tmp/harper-test-logs/
137
+ # Operations_Server-127_0_0_2/
138
+ # hdb.log
139
+ # stdout.log
140
+ # stderr.log
141
+ ```
142
+
143
+ ---
144
+
121
145
  #### `--only`
122
146
 
123
147
  > Equivalent to Node.js Test Runner's [`--test-only`](https://nodejs.org/docs/latest-v24.x/api/cli.html#--test-only) option.
@@ -189,7 +189,7 @@ describe('10. Other Role Tests', () => {
189
189
  assert.equal(r.body.another.breed.schema, 'another', r.text);
190
190
  assert.equal(r.body.another.breed.name, 'breed', r.text);
191
191
  assert.equal(r.body.another.breed.attributes.length, 0, r.text);
192
- assert.equal(r.body.another.breed.hash_attribute, 'id', r.text);
192
+ assert.equal(r.body.another.breed.primary_key, 'id', r.text);
193
193
  assert.equal(r.body.another.breed.record_count, 350, r.text);
194
194
  assert.ok(r.body.another.breed.hasOwnProperty('last_updated_record'), r.text);
195
195
  assert.ok(r.body.hasOwnProperty('northnwd'), r.text);
@@ -254,7 +254,7 @@ describe('10. Other Role Tests', () => {
254
254
  assert.ok(r.body.hasOwnProperty('schema'), r.text);
255
255
  assert.ok(r.body.hasOwnProperty('name'), r.text);
256
256
  assert.ok(r.body.hasOwnProperty('attributes'), r.text);
257
- assert.ok(r.body.hasOwnProperty('hash_attribute'), r.text);
257
+ assert.ok(r.body.hasOwnProperty('primary_key'), r.text);
258
258
  assert.ok(r.body.hasOwnProperty('record_count'), r.text);
259
259
  assert.ok(r.body.hasOwnProperty('last_updated_record'), r.text);
260
260
  assert.equal(r.body.attributes.length, 2, r.text);
@@ -1622,7 +1622,7 @@ describe('10. Other Role Tests', () => {
1622
1622
  operation: 'search_by_value',
1623
1623
  schema: 'rick_rolled',
1624
1624
  table: `${testData.regi_tb}`,
1625
- hash_attribute: 'id',
1625
+ primary_key: 'id',
1626
1626
  search_attribute: 'id',
1627
1627
  search_value: '*',
1628
1628
  get_attributes: ['*'],
@@ -1646,7 +1646,7 @@ describe('10. Other Role Tests', () => {
1646
1646
  operation: 'search_by_value',
1647
1647
  schema: 'rick_rolled',
1648
1648
  table: `${testData.regi_tb}`,
1649
- hash_attribute: 'id',
1649
+ primary_key: 'id',
1650
1650
  search_attribute: 'id',
1651
1651
  search_value: '*',
1652
1652
  get_attributes: ['*'],
@@ -1661,7 +1661,7 @@ describe('10. Other Role Tests', () => {
1661
1661
  operation: 'search_by_value',
1662
1662
  schema: 'dev',
1663
1663
  table: 'rick_rolled',
1664
- hash_attribute: 'id',
1664
+ primary_key: 'id',
1665
1665
  search_attribute: 'id',
1666
1666
  search_value: '*',
1667
1667
  get_attributes: ['*'],
@@ -1685,7 +1685,7 @@ describe('10. Other Role Tests', () => {
1685
1685
  operation: 'search_by_value',
1686
1686
  schema: 'dev',
1687
1687
  table: 'rick_rolled',
1688
- hash_attribute: 'id',
1688
+ primary_key: 'id',
1689
1689
  search_attribute: 'id',
1690
1690
  search_value: '*',
1691
1691
  get_attributes: ['*'],
@@ -12,7 +12,7 @@ describe('12. Configuration', () => {
12
12
 
13
13
  it('Create table for tests', () => {
14
14
  return req()
15
- .send({ operation: 'create_table', schema: 'dev', table: 'create_attr_test', hash_attribute: 'id' })
15
+ .send({ operation: 'create_table', schema: 'dev', table: 'create_attr_test', primary_key: 'id' })
16
16
  .expect((r) => assert.ok(r.body.message.includes('successfully created'), r.text))
17
17
  .expect(200);
18
18
  });
@@ -77,7 +77,7 @@ describe('14. Token Auth', () => {
77
77
  operation: 'search_by_hash',
78
78
  schema: `${testData.schema}`,
79
79
  table: `${testData.emps_tb}`,
80
- hash_attribute: `${testData.emps_id}`,
80
+ primary_key: `${testData.emps_id}`,
81
81
  hash_values: [1],
82
82
  get_attributes: ['*'],
83
83
  })
@@ -95,7 +95,7 @@ describe('14. Token Auth', () => {
95
95
  operation: 'search_by_hash',
96
96
  schema: `${testData.schema}`,
97
97
  table: `${testData.emps_tb}`,
98
- hash_attribute: `${testData.emps_id}`,
98
+ primary_key: `${testData.emps_id}`,
99
99
  hash_values: [1],
100
100
  get_attributes: ['*'],
101
101
  })
@@ -19,21 +19,21 @@ describe('16. Terminology Updates', () => {
19
19
 
20
20
  it('create_table todo with database', () => {
21
21
  return req()
22
- .send({ operation: 'create_table', database: 'tuckerdoodle', table: 'todo', hash_attribute: 'id' })
22
+ .send({ operation: 'create_table', database: 'tuckerdoodle', table: 'todo', primary_key: 'id' })
23
23
  .expect((r) => assert.equal(r.body.message, "table 'tuckerdoodle.todo' successfully created.", r.text))
24
24
  .expect(200);
25
25
  });
26
26
 
27
27
  it('create_table done with database', () => {
28
28
  return req()
29
- .send({ operation: 'create_table', database: 'tuckerdoodle', table: 'done', hash_attribute: 'id' })
29
+ .send({ operation: 'create_table', database: 'tuckerdoodle', table: 'done', primary_key: 'id' })
30
30
  .expect((r) => assert.equal(r.body.message, "table 'tuckerdoodle.done' successfully created.", r.text))
31
31
  .expect(200);
32
32
  });
33
33
 
34
34
  it('create_table friends without database', () => {
35
35
  return req()
36
- .send({ operation: 'create_table', table: 'friends', hash_attribute: 'id' })
36
+ .send({ operation: 'create_table', table: 'friends', primary_key: 'id' })
37
37
  .expect((r) => assert.equal(r.body.message, "table 'data.friends' successfully created.", r.text))
38
38
  .expect(200);
39
39
  });
@@ -341,7 +341,7 @@ describe('16. Terminology Updates', () => {
341
341
 
342
342
  it('create_table "working" for jobs', () => {
343
343
  return req()
344
- .send({ operation: 'create_table', database: 'job_guy', table: 'working', hash_attribute: 'id' })
344
+ .send({ operation: 'create_table', database: 'job_guy', table: 'working', primary_key: 'id' })
345
345
  .expect((r) => assert.equal(r.body.message, "table 'job_guy.working' successfully created.", r.text))
346
346
  .expect(200);
347
347
  });
@@ -215,7 +215,7 @@ describe('1. Environment Setup', () => {
215
215
  operation: 'create_table',
216
216
  database: 1123,
217
217
  table: 1,
218
- hash_attribute: 'id',
218
+ primary_key: 'id',
219
219
  })
220
220
  .expect((r) => {
221
221
  const body = JSON.stringify(r.body);
@@ -275,7 +275,7 @@ describe('2. Data Load', () => {
275
275
  operation: 'search_by_hash',
276
276
  schema: `${testData.schema}`,
277
277
  table: `${testData.supp_tb}`,
278
- hash_attribute: `${testData.supp_id}`,
278
+ primary_key: `${testData.supp_id}`,
279
279
  hash_values: [10],
280
280
  get_attributes: ['supplierid', 'companyname', 'contactname'],
281
281
  })
@@ -344,7 +344,7 @@ describe('2. Data Load', () => {
344
344
  operation: 'search_by_hash',
345
345
  schema: `${testData.schema}`,
346
346
  table: `${testData.supp_tb}`,
347
- hash_attribute: `${testData.supp_id}`,
347
+ primary_key: `${testData.supp_id}`,
348
348
  hash_values: [19],
349
349
  get_attributes: ['supplierid', 'companyname', 'contactname'],
350
350
  })
@@ -377,7 +377,7 @@ describe('2. Data Load', () => {
377
377
  operation: 'search_by_hash',
378
378
  schema: `${testData.schema}`,
379
379
  table: `${testData.cust_tb}`,
380
- hash_attribute: `${testData.supp_id}`,
380
+ primary_key: `${testData.supp_id}`,
381
381
  hash_values: ['TEST1'],
382
382
  get_attributes: ['postalcode', 'customerid'],
383
383
  })
@@ -405,7 +405,7 @@ describe('2. Data Load', () => {
405
405
  operation: 'search_by_hash',
406
406
  schema: `${testData.schema}`,
407
407
  table: `${testData.cust_tb}`,
408
- hash_attribute: `${testData.supp_id}`,
408
+ primary_key: `${testData.supp_id}`,
409
409
  hash_values: ['TEST2'],
410
410
  get_attributes: ['postalcode', 'customerid'],
411
411
  })
@@ -451,7 +451,7 @@ describe('3. SQL Tests', () => {
451
451
 
452
452
  it('Create table keywords for SQL tests', () => {
453
453
  return req()
454
- .send({ operation: 'create_table', schema: 'dev', table: 'keywords', hash_attribute: 'id' })
454
+ .send({ operation: 'create_table', schema: 'dev', table: 'keywords', primary_key: 'id' })
455
455
  .expect((r) => assert.ok(r.body.message.includes('successfully created'), r.text))
456
456
  .expect(200);
457
457
  });
@@ -596,7 +596,7 @@ describe('3. SQL Tests', () => {
596
596
 
597
597
  it('Create table dev.cat for Update', async () => {
598
598
  await req()
599
- .send({ operation: 'create_table', schema: 'dev', table: 'cat', hash_attribute: 'id' })
599
+ .send({ operation: 'create_table', schema: 'dev', table: 'cat', primary_key: 'id' })
600
600
  .expect((r) => assert.equal(r.body.message, "table 'dev.cat' successfully created.", r.text))
601
601
  .expect(200);
602
602
  await setTimeout(200);
@@ -875,7 +875,7 @@ describe('3. SQL Tests', () => {
875
875
 
876
876
  it('Create table "geo"', () => {
877
877
  return req()
878
- .send({ operation: 'create_table', table: 'geo', hash_attribute: 'id' })
878
+ .send({ operation: 'create_table', table: 'geo', primary_key: 'id' })
879
879
  .expect((r) => assert.equal(r.body.message, "table 'data.geo' successfully created.", r.text))
880
880
  .expect(200);
881
881
  });
@@ -190,7 +190,7 @@ describe('4. NoSQL Tests', () => {
190
190
  operation: 'search_by_hash',
191
191
  schema: `${testData.schema}`,
192
192
  table: `${testData.emps_tb}`,
193
- hash_attribute: `${testData.emps_id}`,
193
+ primary_key: `${testData.emps_id}`,
194
194
  hash_values: [100],
195
195
  get_attributes: ['firstname', 'lastname'],
196
196
  })
@@ -204,7 +204,7 @@ describe('4. NoSQL Tests', () => {
204
204
  operation: 'search_by_hash',
205
205
  schema: `${testData.schema}`,
206
206
  table: `${testData.emps_tb}`,
207
- hash_attribute: `${testData.emps_id}`,
207
+ primary_key: `${testData.emps_id}`,
208
208
  hash_values: [1],
209
209
  get_attributes: ['firstname', 'lastname'],
210
210
  })
@@ -219,7 +219,7 @@ describe('4. NoSQL Tests', () => {
219
219
  operation: 'search_by_hash',
220
220
  schema: `${testData.schema}`,
221
221
  table: `${testData.emps_tb}`,
222
- hash_attribute: `${testData.emps_id}`,
222
+ primary_key: `${testData.emps_id}`,
223
223
  hash_values: [1, 5],
224
224
  get_attributes: ['firstname', 'lastname'],
225
225
  })
@@ -237,7 +237,7 @@ describe('4. NoSQL Tests', () => {
237
237
  operation: 'search_by_value',
238
238
  schema: `${testData.schema}`,
239
239
  table: `${testData.emps_tb}`,
240
- hash_attribute: `${testData.emps_id}`,
240
+ primary_key: `${testData.emps_id}`,
241
241
  search_attribute: 'lastname',
242
242
  search_value: 'Xyz',
243
243
  get_attributes: ['firstname', 'lastname'],
@@ -252,7 +252,7 @@ describe('4. NoSQL Tests', () => {
252
252
  operation: 'search_by_value',
253
253
  schema: `${testData.schema}`,
254
254
  table: `${testData.emps_tb}`,
255
- hash_attribute: `${testData.emps_id}`,
255
+ primary_key: `${testData.emps_id}`,
256
256
  search_attribute: 'lastname',
257
257
  search_value: 'King',
258
258
  get_attributes: ['firstname', 'lastname'],
@@ -268,7 +268,7 @@ describe('4. NoSQL Tests', () => {
268
268
  operation: 'search_by_value',
269
269
  schema: `${testData.schema}`,
270
270
  table: `${testData.emps_tb}`,
271
- hash_attribute: `${testData.emps_id}`,
271
+ primary_key: `${testData.emps_id}`,
272
272
  search_attribute: 'lastname',
273
273
  search_value: 'D*',
274
274
  get_attributes: ['firstname', 'lastname'],
@@ -634,7 +634,7 @@ describe('4. NoSQL Tests', () => {
634
634
  operation: 'search_by_hash',
635
635
  schema: `${testData.schema}`,
636
636
  table: `${testData.emps_tb}`,
637
- hash_attribute: `${testData.emps_id}`,
637
+ primary_key: `${testData.emps_id}`,
638
638
  hash_values: [1],
639
639
  get_attributes: [`${testData.emps_id}`, 'address'],
640
640
  })
@@ -725,7 +725,7 @@ describe('4. NoSQL Tests', () => {
725
725
  operation: 'search_by_hash',
726
726
  schema: `${testData.schema}`,
727
727
  table: `${testData.emps_tb}`,
728
- hash_attribute: `${testData.emps_id}`,
728
+ primary_key: `${testData.emps_id}`,
729
729
  hash_values: [1],
730
730
  get_attributes: ['address', 'test_record'],
731
731
  })
@@ -825,7 +825,7 @@ describe('4. NoSQL Tests', () => {
825
825
  operation: 'search_by_hash',
826
826
  schema: `${testData.schema}`,
827
827
  table: `${testData.emps_tb}`,
828
- hash_attribute: `${testData.emps_id}`,
828
+ primary_key: `${testData.emps_id}`,
829
829
  hash_values: [2],
830
830
  get_attributes: ['address', 'hireDate', 'notes'],
831
831
  })
@@ -1079,7 +1079,7 @@ describe('4. NoSQL Tests', () => {
1079
1079
  operation: 'search_by_hash',
1080
1080
  schema: 'dev',
1081
1081
  table: 'leading_zero',
1082
- hash_attribute: 'id',
1082
+ primary_key: 'id',
1083
1083
  hash_values: [0],
1084
1084
  get_attributes: ['*'],
1085
1085
  })
@@ -1099,7 +1099,7 @@ describe('4. NoSQL Tests', () => {
1099
1099
  operation: 'search_by_hash',
1100
1100
  schema: 'dev',
1101
1101
  table: 'leading_zero',
1102
- hash_attribute: 'id',
1102
+ primary_key: 'id',
1103
1103
  hash_values: ['011', '00011'],
1104
1104
  get_attributes: ['*'],
1105
1105
  })
@@ -1391,7 +1391,7 @@ describe('4. NoSQL Tests', () => {
1391
1391
  operation: 'search_by_hash',
1392
1392
  schema: `${testData.schema}`,
1393
1393
  table: `${testData.emps_tb}`,
1394
- hash_attribute: `${testData.emps_id}`,
1394
+ primary_key: `${testData.emps_id}`,
1395
1395
  hash_values: [1],
1396
1396
  get_attributes: [`${testData.emps_id}`, '__createdtime__'],
1397
1397
  })
@@ -808,7 +808,7 @@ describe('5. NoSQL Role Testing', () => {
808
808
  operation: 'search_by_value',
809
809
  table: `${testData.supp_tb}`,
810
810
  schema: `${testData.schema}`,
811
- hash_attribute: 'id',
811
+ primary_key: 'id',
812
812
  search_attribute: `${testData.supp_id}`,
813
813
  search_value: '*',
814
814
  get_attributes: [`${testData.supp_id}`],
@@ -822,7 +822,7 @@ describe('5. NoSQL Role Testing', () => {
822
822
  operation: 'search_by_value',
823
823
  table: `${testData.supp_tb}`,
824
824
  schema: `${testData.schema}`,
825
- hash_attribute: 'id',
825
+ primary_key: 'id',
826
826
  search_attribute: `${testData.supp_id}`,
827
827
  search_value: '*',
828
828
  get_attributes: [`${testData.supp_id}`],
@@ -846,7 +846,7 @@ describe('5. NoSQL Role Testing', () => {
846
846
  operation: 'search_by_value',
847
847
  table: `${testData.regi_tb}`,
848
848
  schema: `${testData.schema}`,
849
- hash_attribute: 'id',
849
+ primary_key: 'id',
850
850
  search_attribute: 'regionid',
851
851
  search_value: '*',
852
852
  get_attributes: ['*'],
@@ -860,7 +860,7 @@ describe('5. NoSQL Role Testing', () => {
860
860
  operation: 'search_by_value',
861
861
  table: `${testData.regi_tb}`,
862
862
  schema: `${testData.schema}`,
863
- hash_attribute: 'id',
863
+ primary_key: 'id',
864
864
  search_attribute: 'regionid',
865
865
  search_value: '*',
866
866
  get_attributes: ['*'],
@@ -1087,7 +1087,7 @@ describe('5. NoSQL Role Testing', () => {
1087
1087
  operation: 'search_by_value',
1088
1088
  table: `${testData.ship_tb}`,
1089
1089
  schema: `${testData.schema}`,
1090
- hash_attribute: 'id',
1090
+ primary_key: 'id',
1091
1091
  search_attribute: `${testData.ship_id}`,
1092
1092
  search_value: '*',
1093
1093
  get_attributes: ['companyname'],
@@ -1118,7 +1118,7 @@ describe('5. NoSQL Role Testing', () => {
1118
1118
  operation: 'search_by_value',
1119
1119
  table: `${testData.ship_tb}`,
1120
1120
  schema: `${testData.schema}`,
1121
- hash_attribute: 'id',
1121
+ primary_key: 'id',
1122
1122
  search_attribute: `${testData.ship_id}`,
1123
1123
  search_value: '*',
1124
1124
  get_attributes: ['*'],
@@ -1298,7 +1298,7 @@ describe('5. NoSQL Role Testing', () => {
1298
1298
 
1299
1299
  it('NoSQL create_table - non-SU expect fail', () => {
1300
1300
  return reqAsNonSU(headersTestUser)
1301
- .send({ operation: 'create_table', schema: 'test-schema', table: 'test-table', hash_attribute: 'id' })
1301
+ .send({ operation: 'create_table', schema: 'test-schema', table: 'test-table', primary_key: 'id' })
1302
1302
  .expect((r) => {
1303
1303
  assert.equal(
1304
1304
  r.body.error,
@@ -1318,7 +1318,7 @@ describe('5. NoSQL Role Testing', () => {
1318
1318
 
1319
1319
  it('NoSQL create_table - SU expect success', () => {
1320
1320
  return req()
1321
- .send({ operation: 'create_table', schema: 'test-schema', table: 'test-table', hash_attribute: 'id' })
1321
+ .send({ operation: 'create_table', schema: 'test-schema', table: 'test-table', primary_key: 'id' })
1322
1322
  .expect(200);
1323
1323
  });
1324
1324
 
@@ -18,26 +18,24 @@ describe('7. Jobs & Job Role Testing', () => {
18
18
  });
19
19
 
20
20
  it('Create dogs table for S3 test', () => {
21
- return req()
22
- .send({ operation: 'create_table', schema: 'S3_DATA', table: 'dogs', hash_attribute: 'id' })
23
- .expect(200);
21
+ return req().send({ operation: 'create_table', schema: 'S3_DATA', table: 'dogs', primary_key: 'id' }).expect(200);
24
22
  });
25
23
 
26
24
  it('Create breed table for S3 test', () => {
27
25
  return req()
28
- .send({ operation: 'create_table', schema: 'S3_DATA', table: 'breed', hash_attribute: 'id' })
26
+ .send({ operation: 'create_table', schema: 'S3_DATA', table: 'breed', primary_key: 'id' })
29
27
  .expect(200);
30
28
  });
31
29
 
32
30
  it('Create owners table for S3 test', () => {
33
31
  return req()
34
- .send({ operation: 'create_table', schema: 'S3_DATA', table: 'owners', hash_attribute: 'id' })
32
+ .send({ operation: 'create_table', schema: 'S3_DATA', table: 'owners', primary_key: 'id' })
35
33
  .expect(200);
36
34
  });
37
35
 
38
36
  it('Create sensor table for S3 test', () => {
39
37
  return req()
40
- .send({ operation: 'create_table', schema: 'S3_DATA', table: 'sensor', hash_attribute: 'id' })
38
+ .send({ operation: 'create_table', schema: 'S3_DATA', table: 'sensor', primary_key: 'id' })
41
39
  .expect(200);
42
40
  });
43
41
 
@@ -275,13 +273,13 @@ describe('7. Jobs & Job Role Testing', () => {
275
273
 
276
274
  it('Create S3 test table', () => {
277
275
  return req()
278
- .send({ operation: 'create_table', schema: 'S3_DATA', table: 's3_test', hash_attribute: 'id' })
276
+ .send({ operation: 'create_table', schema: 'S3_DATA', table: 's3_test', primary_key: 'id' })
279
277
  .expect(200);
280
278
  });
281
279
 
282
280
  it('Create S3 CSV import test table', () => {
283
281
  return req()
284
- .send({ operation: 'create_table', schema: 'S3_DATA', table: 's3_test_csv_import', hash_attribute: 'id' })
282
+ .send({ operation: 'create_table', schema: 'S3_DATA', table: 's3_test_csv_import', primary_key: 'id' })
285
283
  .expect(200);
286
284
  });
287
285
 
@@ -291,7 +289,7 @@ describe('7. Jobs & Job Role Testing', () => {
291
289
  operation: 'create_table',
292
290
  schema: 'S3_DATA',
293
291
  table: 's3_test_json_import',
294
- hash_attribute: 'id',
292
+ primary_key: 'id',
295
293
  })
296
294
  .expect(200);
297
295
  });
@@ -616,7 +614,7 @@ describe('7. Jobs & Job Role Testing', () => {
616
614
 
617
615
  it('Jobs - Add runner table', async () => {
618
616
  await req()
619
- .send({ operation: 'create_table', schema: 'test_job', table: 'runner', hash_attribute: 'runner_id' })
617
+ .send({ operation: 'create_table', schema: 'test_job', table: 'runner', primary_key: 'runner_id' })
620
618
  .expect(200);
621
619
  await setTimeout(500);
622
620
  });
@@ -802,7 +800,7 @@ describe('7. Jobs & Job Role Testing', () => {
802
800
  operation: 'search_by_hash',
803
801
  schema: `${testData.schema}`,
804
802
  table: `${testData.ship_tb}`,
805
- hash_attribute: `${testData.ship_id}`,
803
+ primary_key: `${testData.ship_id}`,
806
804
  hash_values: [1],
807
805
  get_attributes: ['companyname'],
808
806
  },
@@ -879,7 +877,7 @@ describe('7. Jobs & Job Role Testing', () => {
879
877
  operation: 'search_by_hash',
880
878
  schema: `${testData.schema}`,
881
879
  table: `${testData.supp_tb}`,
882
- hash_attribute: `${testData.supp_id}`,
880
+ primary_key: `${testData.supp_id}`,
883
881
  hash_values: [1],
884
882
  get_attributes: [testData.supp_id],
885
883
  },
@@ -23,7 +23,7 @@ describe('8. Delete Tests', () => {
23
23
 
24
24
  it('create test table', async () => {
25
25
  await req()
26
- .send({ operation: 'create_table', schema: 'test_delete_before', table: 'address', hash_attribute: 'id' })
26
+ .send({ operation: 'create_table', schema: 'test_delete_before', table: 'address', primary_key: 'id' })
27
27
  .expect((r) => assert.ok(r.body.message.includes('successfully created'), r.text))
28
28
  .expect(200);
29
29
  await setTimeout(500);
@@ -99,7 +99,7 @@ describe('8. Delete Tests', () => {
99
99
  operation: 'search_by_hash',
100
100
  schema: 'test_delete_before',
101
101
  table: 'address',
102
- hash_attribute: 'id',
102
+ primary_key: 'id',
103
103
  hash_values: [1, 2, 3, 4, 5, 6, 11, 12, 13],
104
104
  get_attributes: ['id', 'address'],
105
105
  })
@@ -193,7 +193,7 @@ describe('8. Delete Tests', () => {
193
193
  operation: 'search_by_hash',
194
194
  schema: 'test_delete_before',
195
195
  table: 'address',
196
- hash_attribute: 'id',
196
+ primary_key: 'id',
197
197
  hash_values: ['1a', '2a', '3a', '4a', '5a', '6a', '11a', '12a', '13a'],
198
198
  get_attributes: ['id', 'address'],
199
199
  })
@@ -234,7 +234,7 @@ describe('8. Delete Tests', () => {
234
234
  operation: 'create_table',
235
235
  schema: `${testData.drop_schema}`,
236
236
  table: `${testData.drop_table}`,
237
- hash_attribute: 'id',
237
+ primary_key: 'id',
238
238
  })
239
239
  .expect((r) => assert.equal(r.body.message, "table 'drop_schema.drop_table' successfully created.", r.text))
240
240
  .expect(200);
@@ -288,7 +288,7 @@ describe('8. Delete Tests', () => {
288
288
  operation: 'create_table',
289
289
  schema: `${testData.drop_schema}`,
290
290
  table: `${testData.drop_table}`,
291
- hash_attribute: 'id',
291
+ primary_key: 'id',
292
292
  })
293
293
  .expect((r) => assert.equal(r.body.message, "table 'drop_schema.drop_table' successfully created.", r.text))
294
294
  .expect(200);
@@ -381,7 +381,7 @@ describe('8. Delete Tests', () => {
381
381
 
382
382
  it('create table test', async () => {
383
383
  await req()
384
- .send({ operation: 'create_table', schema: 'drop_attr', table: 'test', hash_attribute: 'id' })
384
+ .send({ operation: 'create_table', schema: 'drop_attr', table: 'test', primary_key: 'id' })
385
385
  .expect((r) => assert.ok(r.body.message.includes('successfully created'), r.text))
386
386
  .expect(200);
387
387
  await setTimeout(2000);
@@ -552,7 +552,7 @@ describe('8. Delete Tests', () => {
552
552
 
553
553
  it('create table test', () => {
554
554
  return req()
555
- .send({ operation: 'create_table', schema: 'drop_attr', table: 'test', hash_attribute: 'id' })
555
+ .send({ operation: 'create_table', schema: 'drop_attr', table: 'test', primary_key: 'id' })
556
556
  .expect((r) => assert.ok(r.body.message.includes('successfully created'), r.text))
557
557
  .expect(200);
558
558
  });
@@ -722,7 +722,7 @@ describe('8. Delete Tests', () => {
722
722
 
723
723
  it('create table test', async () => {
724
724
  await req()
725
- .send({ operation: 'create_table', schema: 'drop_attr', table: 'test', hash_attribute: 'id' })
725
+ .send({ operation: 'create_table', schema: 'drop_attr', table: 'test', primary_key: 'id' })
726
726
  .expect(200)
727
727
  .expect((r) => assert.ok(r.body.message.includes('successfully created'), r.text));
728
728
  await setTimeout(2000);
@@ -19,7 +19,7 @@ describe('9. Transactions', () => {
19
19
  operation: 'create_table',
20
20
  schema: 'test_delete_before',
21
21
  table: 'testerama',
22
- hash_attribute: 'id',
22
+ primary_key: 'id',
23
23
  })
24
24
  .expect((r) => assert.ok(r.body.message.includes('successfully created'), r.text))
25
25
  .expect(200);
@@ -92,7 +92,7 @@ describe('9. Transactions', () => {
92
92
  operation: 'create_table',
93
93
  schema: 'test_delete_before',
94
94
  table: 'test_read',
95
- hash_attribute: 'id',
95
+ primary_key: 'id',
96
96
  })
97
97
  .expect((r) => assert.ok(r.body.message.includes('successfully created'), r.text))
98
98
  .expect(200);
@@ -7,7 +7,7 @@ export function searchByHash(schemaName, tableName, hashAttribute, hashValues, g
7
7
  operation: 'search_by_hash',
8
8
  schema: schemaName,
9
9
  table: tableName,
10
- hash_attribute: hashAttribute,
10
+ primary_key: hashAttribute,
11
11
  hash_values: hashValues,
12
12
  get_attributes: getAttributes,
13
13
  })
@@ -7,7 +7,7 @@ export function createTable(databaseName, tableName, hashAttribute) {
7
7
  operation: 'create_table',
8
8
  database: databaseName,
9
9
  table: tableName,
10
- hash_attribute: hashAttribute,
10
+ primary_key: hashAttribute,
11
11
  })
12
12
  .expect((r) => {
13
13
  const body = JSON.stringify(r.body);
@@ -50,7 +50,7 @@ suite('operations RBAC', (ctx: ContextWithHarper) => {
50
50
 
51
51
  // Create database, table, and seed data
52
52
  await op({ operation: 'create_database', database: DATABASE });
53
- await op({ operation: 'create_table', schema: DATABASE, table: TABLE, hash_attribute: HASH_ATTR });
53
+ await op({ operation: 'create_table', schema: DATABASE, table: TABLE, primary_key: HASH_ATTR });
54
54
  await op({
55
55
  operation: 'insert',
56
56
  schema: DATABASE,