@harperfast/harper 5.0.4 → 5.0.5

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@harperfast/harper",
3
3
  "description": "Harper is an open-source Node.js performance platform that unifies database, cache, application, and messaging layers into one in-memory process.",
4
- "version": "5.0.4",
4
+ "version": "5.0.5",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://harper.fast",
7
7
  "bugs": {
@@ -22,29 +22,32 @@
22
22
  "harper": "./dist/bin/harper.js"
23
23
  },
24
24
  "files": [
25
- "dist",
26
25
  "bin",
26
+ "CODE_OF_CONDUCT.md",
27
27
  "components",
28
28
  "config",
29
+ "config-app.schema.json",
30
+ "config-root.schema.json",
29
31
  "dataLayer",
32
+ "dist",
33
+ "index.*",
30
34
  "json",
31
35
  "launchServiceScripts",
36
+ "README.md",
32
37
  "resources",
38
+ "schema.graphql",
33
39
  "security",
40
+ "SECURITY.md",
34
41
  "server",
35
42
  "sqlTranslator",
43
+ "static",
44
+ "studio",
45
+ "SUPPORT.md",
36
46
  "upgrade",
37
47
  "utility",
38
- "validation",
39
- "studio",
40
- "static",
41
- "index.*",
42
48
  "v1.*",
43
49
  "v2.*",
44
- "README.md",
45
- "SECURITY.md",
46
- "SUPPORT.md",
47
- "CODE_OF_CONDUCT.md"
50
+ "validation"
48
51
  ],
49
52
  "scripts": {
50
53
  "build": "tsc --project tsconfig.build.json",
package/schema.graphql ADDED
@@ -0,0 +1,245 @@
1
+ """
2
+ A flexible JSON-like value.
3
+ Accepts objects, arrays, strings, numbers, booleans, or null.
4
+ Useful for schemaless or mixed content.
5
+ """
6
+ scalar Any
7
+
8
+ """
9
+ Arbitrary-precision integer for values larger than 32-bit/64-bit ranges.
10
+ Input may be provided as a JSON number or string; tooling may return it as a
11
+ string to avoid precision loss. Use `Long` for 64-bit integers when possible.
12
+ """
13
+ scalar BigInt
14
+
15
+ """
16
+ Binary large object. Represents binary data such as images or files.
17
+ Typically encoded as Base64 in JSON.
18
+ """
19
+ scalar Blob
20
+
21
+ """
22
+ true or false
23
+ """
24
+ scalar Boolean
25
+
26
+ """
27
+ Raw bytes. Typically encoded/transported as Base64 in JSON.
28
+ Use when you need deterministic binary data that is not a large file.
29
+ """
30
+ scalar Bytes
31
+
32
+ """
33
+ Date/time scalar. Recommended format: RFC 3339/ISO-8601 (e.g.,
34
+ "2025-12-02T19:44:00Z"). Represents an absolute timestamp.
35
+ """
36
+ scalar Date
37
+
38
+ """
39
+ A signed double-precision floating-point value
40
+ """
41
+ scalar Float
42
+
43
+ """
44
+ ID (serialized as a String): A unique identifier that's often used to refetch an
45
+ object or as the key for a cache. Although it's serialized as a String, an ID is
46
+ not intended to be human‐readable.
47
+ """
48
+ scalar ID
49
+
50
+ """
51
+ A signed 32‐bit integer
52
+ """
53
+ scalar Int
54
+
55
+ """
56
+ 64-bit signed integer. Some clients may serialize values as strings to
57
+ preserve precision across environments.
58
+ """
59
+ scalar Long
60
+
61
+ """
62
+ A UTF‐8 character sequence
63
+ """
64
+ scalar String
65
+
66
+ """
67
+ Attach to an object type to persist it as a table.
68
+
69
+ Example:
70
+ ```
71
+ type Post @table(table: "posts", database: "blog") {
72
+ id: ID @primaryKey
73
+ title: String @indexed(type: "fulltext")
74
+ body: String
75
+ createdAt: Date @createdTime
76
+ updatedAt: Date @updatedTime
77
+ }
78
+ ```
79
+ """
80
+ directive @table(
81
+ """
82
+ Explicit table name. If omitted, a sensible default derived from the
83
+ type name will be used.
84
+ """
85
+ table: String
86
+ """
87
+ Logical database/namespace to place this table in.
88
+ """
89
+ database: String
90
+ """
91
+ Default time-to-live (TTL) for records in seconds. Use a positive value to
92
+ enable automatic expiration; omit or set to 0 to disable.
93
+ """
94
+ expiration: Int
95
+ """
96
+ Enable auditing for create/update/delete operations.
97
+ """
98
+ audit: Boolean
99
+ """
100
+ The amount of time after expiration before a record can be evicted (defaults to zero).
101
+ """
102
+ eviction: Int
103
+ """
104
+ The interval for scanning for expired records (defaults to one quarter of the
105
+ total of expiration and eviction).
106
+ """
107
+ scanInterval: Int
108
+ """
109
+ By default, all tables within a replicated database will be replicated. Transactions
110
+ are replicated atomically, which may involve data across multiple tables. However,
111
+ you can also configure replication for individual tables, and disable and exclude
112
+ replication for specific tables in a database by setting replicate to false in the
113
+ table definition.
114
+ """
115
+ replicate: Boolean
116
+ ) on OBJECT
117
+
118
+ """
119
+ Expose the table via the REST API. When applied to a `@table` type, routes are
120
+ generated using the type name or the provided alias.
121
+ """
122
+ directive @export(
123
+ """
124
+ Optional alias to use for REST endpoints. If omitted, the type/table name is
125
+ used.
126
+ """
127
+ name: String
128
+ """
129
+ REST support is, by default, turned on for any exported resource. You may specify
130
+ false to disable this automatic API support.
131
+ """
132
+ rest: Boolean
133
+ """
134
+ MQTT support is, by default, turned on for any exported resource. You may specify
135
+ false to disable this automatic API support.
136
+ """
137
+ mqtt: Boolean
138
+ ) on OBJECT
139
+ """
140
+ As a NoSQL database, HarperDB supports heterogeneous records (also referred to as
141
+ documents), so you can freely specify additional properties on any record. If you
142
+ do want to restrict the records to only defined properties, you can always do that
143
+ by adding the sealed directive.
144
+ """
145
+ directive @sealed on OBJECT
146
+
147
+ """
148
+ Marks the primary key field for the table. The value must be unique per record
149
+ and is used for lookups, updates, and relationships.
150
+ """
151
+ directive @primaryKey on FIELD_DEFINITION
152
+
153
+ """
154
+ Allows enumeration over a computed field, causing it to be included in serialized responses. (Non-computed fields are always enumerable, and don't need to be flagged.)
155
+ """
156
+ directive @enumerable on FIELD_DEFINITION
157
+
158
+ """
159
+ Flags the field as containing the expiration time of the entry.
160
+ """
161
+ directive @expiresAt on FIELD_DEFINITION
162
+
163
+ """
164
+ Permit access to the field based on the named roles, only.
165
+ """
166
+ directive @allow(role: String) on FIELD_DEFINITION
167
+
168
+ """
169
+ Create an index for the annotated field. Supports traditional and vector/ANN
170
+ index types.
171
+ """
172
+ directive @indexed(
173
+ """
174
+ Optional index type, e.g. "HNSW"
175
+ """
176
+ type: String
177
+ """
178
+ Distance metric for vector indexes (e.g., "euclidean", "cosine").
179
+ Ignored for non-vector index types.
180
+ """
181
+ distance: String
182
+ """
183
+ Construction effort/recall parameter (HNSW). Higher values improve recall at
184
+ the cost of build time and memory.
185
+ """
186
+ efConstruction: Int
187
+ """
188
+ Maximum number of bi-directional connections per node (HNSW).
189
+ Typical range: 4–64.
190
+ """
191
+ M: Int
192
+ """
193
+ Routing optimization level for search graphs (implementation-specific).
194
+ """
195
+ optimizeRouting: Int
196
+ """
197
+ Additional multiplier for graph links (implementation-specific).
198
+ """
199
+ mL: Int
200
+ """
201
+ Search-time effort/recall parameter used during construction (implementation-
202
+ specific). Larger values typically yield better accuracy.
203
+ """
204
+ efConstructionSearch: Int
205
+ ) on FIELD_DEFINITION
206
+
207
+ """
208
+ Define a derived field whose value is computed from other fields.
209
+ Useful for denormalized or presentation-friendly data.
210
+ """
211
+ directive @computed(
212
+ """
213
+ Computation expression or reference describing how to derive this field from
214
+ other fields (engine-specific syntax).
215
+ """
216
+ from: String
217
+ """
218
+ Increment when the computation changes to trigger recomputation.
219
+ """
220
+ version: Int
221
+ ) on FIELD_DEFINITION
222
+ """
223
+ Automatically sets this field to the record's creation timestamp. The server
224
+ assigns the value on insert.
225
+ """
226
+ directive @createdTime on FIELD_DEFINITION
227
+ """
228
+ Automatically updates this field to the current timestamp whenever the record
229
+ is updated.
230
+ """
231
+ directive @updatedTime on FIELD_DEFINITION
232
+ """
233
+ Declares a relationship to another record or records.
234
+ Use on fields that should resolve to related entities by ID.
235
+ """
236
+ directive @relationship(
237
+ """
238
+ Name of field in THIS table containing foreign key(s) (for one-to-many or many-to-many).
239
+ """
240
+ from: String
241
+ """
242
+ Name of field in OTHER table containing foreign key (for one-to-one or many-to-one).
243
+ """
244
+ to: String
245
+ ) on FIELD_DEFINITION
package/security/keys.js CHANGED
@@ -238,7 +238,7 @@ function loadCertificates() {
238
238
 
239
239
  promise = certificateTable.put({
240
240
  name: certCn,
241
- uses: config.uses ?? [configKey.includes('operations') ? ['operations-api'] : []],
241
+ uses: config.uses ?? (configKey.includes('operations') ? ['operations-api'] : []),
242
242
  ciphers: config.ciphers,
243
243
  certificate: certificatePem,
244
244
  private_key_name,