@harperfast/harper-pro 5.0.0-beta.7 → 5.0.0-beta.8
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/core/bin/cliOperations.js +3 -3
- package/core/components/ApplicationScope.ts +1 -0
- package/core/components/componentLoader.ts +4 -1
- package/core/resources/DatabaseTransaction.ts +67 -32
- package/core/resources/Table.ts +29 -10
- package/core/security/jsLoader.ts +149 -101
- package/core/server/REST.ts +12 -2
- package/core/server/http.ts +4 -1
- package/dist/core/bin/cliOperations.js +3 -3
- package/dist/core/bin/cliOperations.js.map +1 -1
- package/dist/core/components/ApplicationScope.js +1 -0
- package/dist/core/components/ApplicationScope.js.map +1 -1
- package/dist/core/components/componentLoader.js +2 -1
- package/dist/core/components/componentLoader.js.map +1 -1
- package/dist/core/resources/DatabaseTransaction.js +71 -35
- package/dist/core/resources/DatabaseTransaction.js.map +1 -1
- package/dist/core/resources/Table.js +15 -10
- package/dist/core/resources/Table.js.map +1 -1
- package/dist/core/security/jsLoader.js +123 -90
- package/dist/core/security/jsLoader.js.map +1 -1
- package/dist/core/server/REST.js +13 -4
- package/dist/core/server/REST.js.map +1 -1
- package/dist/core/server/http.js +5 -0
- package/dist/core/server/http.js.map +1 -1
- package/dist/licensing/usageLicensing.js +16 -26
- package/dist/licensing/usageLicensing.js.map +1 -1
- package/dist/replication/replicationConnection.js +2 -2
- package/dist/replication/replicationConnection.js.map +1 -1
- package/licensing/usageLicensing.ts +22 -32
- package/npm-shrinkwrap.json +223 -223
- package/package.json +3 -3
- package/replication/replicationConnection.ts +2 -2
- package/studio/web/assets/{index-ClD_q6ya.js → index-CXQsBaYq.js} +5 -5
- package/studio/web/assets/{index-ClD_q6ya.js.map → index-CXQsBaYq.js.map} +1 -1
- package/studio/web/assets/{index.lazy-CXzU1gVu.js → index.lazy-C3Ejfvna.js} +2 -2
- package/studio/web/assets/{index.lazy-CXzU1gVu.js.map → index.lazy-C3Ejfvna.js.map} +1 -1
- package/studio/web/assets/{profile-DCNVg5yY.js → profile-BbbbWJCN.js} +2 -2
- package/studio/web/assets/{profile-DCNVg5yY.js.map → profile-BbbbWJCN.js.map} +1 -1
- package/studio/web/assets/{status-CoGlcjSB.js → status-CFe85l8C.js} +2 -2
- package/studio/web/assets/{status-CoGlcjSB.js.map → status-CFe85l8C.js.map} +1 -1
- package/studio/web/index.html +1 -1
|
@@ -12,6 +12,7 @@ import * as configUtils from '../core/config/configUtils.js';
|
|
|
12
12
|
import * as terms from '../core/utility/hdbTerms.ts';
|
|
13
13
|
import type { Server } from '../core/server/Server.ts';
|
|
14
14
|
import type { Scope } from '../core/components/Scope.ts';
|
|
15
|
+
import { universalHeaders } from '../core/server/http.ts';
|
|
15
16
|
|
|
16
17
|
// eslint-disable-next-line no-unused-vars
|
|
17
18
|
export const suppressHandleApplicationWarning = true;
|
|
@@ -73,27 +74,6 @@ export function initUsageLicensing(params: UsageLicensingInitParams) {
|
|
|
73
74
|
|
|
74
75
|
licenseRegion = params.license.region;
|
|
75
76
|
|
|
76
|
-
const { server } = params;
|
|
77
|
-
|
|
78
|
-
// TODO: This only injects this header on resource API requests.
|
|
79
|
-
// It might be good to add a way for internal plugins to
|
|
80
|
-
// add headers to operations API requests as well.
|
|
81
|
-
server.http(async (request, nextHandler) => {
|
|
82
|
-
const response = nextHandler(request);
|
|
83
|
-
if (response) {
|
|
84
|
-
if (!response.headers?.set) {
|
|
85
|
-
(response as any).headers = new Headers(response.headers);
|
|
86
|
-
}
|
|
87
|
-
if (!(await isLicensed())) {
|
|
88
|
-
response.headers.set(
|
|
89
|
-
'X-License-Info',
|
|
90
|
-
'Unlicensed Harper Pro, this should only be used for educational and development purposes'
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return response;
|
|
95
|
-
});
|
|
96
|
-
|
|
97
77
|
onAnalyticsAggregate(recordUsage);
|
|
98
78
|
|
|
99
79
|
server.registerOperation?.({
|
|
@@ -213,17 +193,27 @@ async function recordUsage(analytics: any) {
|
|
|
213
193
|
}
|
|
214
194
|
}
|
|
215
195
|
});
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
196
|
+
universalHeaders.splice(0, universalHeaders.length); // clear out any previous license nag headers
|
|
197
|
+
} else {
|
|
198
|
+
// assign license nag header
|
|
199
|
+
universalHeaders.splice(
|
|
200
|
+
0,
|
|
201
|
+
universalHeaders.length,
|
|
202
|
+
'X-License-Info',
|
|
203
|
+
'Unlicensed Harper Pro, this should only be used for educational and development purposes'
|
|
204
|
+
);
|
|
205
|
+
if (!process.env.DEV_MODE) {
|
|
206
|
+
const msg =
|
|
207
|
+
'This server does not have valid usage licenses, this should only be used for educational and development purposes.';
|
|
208
|
+
if (!licenseConsoleErrorPrinted) {
|
|
209
|
+
console.error(msg);
|
|
210
|
+
licenseConsoleErrorPrinted = true;
|
|
211
|
+
}
|
|
212
|
+
if (licenseWarningIntervalId === undefined) {
|
|
213
|
+
licenseWarningIntervalId = setInterval(() => {
|
|
214
|
+
logger.notify?.(msg);
|
|
215
|
+
}, LICENSE_NAG_PERIOD).unref();
|
|
216
|
+
}
|
|
227
217
|
}
|
|
228
218
|
}
|
|
229
219
|
}
|