@raytio/decrypt-helper 6.3.4 → 6.3.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/dist/api/authedFetch.js
CHANGED
|
@@ -11,14 +11,19 @@ export function authedFetch(apiToken, url, options, retrying = false) {
|
|
|
11
11
|
return __awaiter(this, void 0, void 0, function* () {
|
|
12
12
|
console.log(`[API] ${retrying ? "Retry" : "Start"} ${url}`);
|
|
13
13
|
const startTime = Date.now();
|
|
14
|
-
const response = yield fetch(url, Object.assign(Object.assign({}, options), { headers: { Authorization: `Bearer ${apiToken}` } }));
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
14
|
+
const response = yield fetch(url, Object.assign(Object.assign({}, options), { headers: Object.assign({ Authorization: `Bearer ${apiToken}` }, options === null || options === void 0 ? void 0 : options.headers) }));
|
|
15
|
+
let apiResponse = null;
|
|
16
|
+
const contentType = response.headers.get("content-type");
|
|
17
|
+
if (contentType === null || contentType === void 0 ? void 0 : contentType.startsWith("application/json")) {
|
|
18
|
+
const responseText = yield response.text();
|
|
19
|
+
apiResponse = responseText ? JSON.parse(responseText) : null;
|
|
20
|
+
}
|
|
21
|
+
if (!response.ok) {
|
|
18
22
|
if (!retrying && response.status === 504) {
|
|
19
23
|
console.log(`[API] Error ${response.status} (will retry) ${url}`);
|
|
20
24
|
return authedFetch(apiToken, url, options, true);
|
|
21
25
|
}
|
|
26
|
+
const error = (apiResponse === null || apiResponse === void 0 ? void 0 : apiResponse.message) || (apiResponse === null || apiResponse === void 0 ? void 0 : apiResponse.error) || "No error message provided";
|
|
22
27
|
console.log(`[API] Error ${response.status} (no retry) ${url}`);
|
|
23
28
|
throw new Error(`Failed due to API Error from ${url}: "${error}"`);
|
|
24
29
|
}
|
|
@@ -14,6 +14,10 @@ import { authedFetch } from "./authedFetch.js";
|
|
|
14
14
|
*/
|
|
15
15
|
export function updateInstanceData(apiToken, envConfig, iId, instance) {
|
|
16
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
yield authedFetch(apiToken, `${envConfig.api_url}/db/v1/dsm_access_application_instances_u?id=eq.${iId}`, {
|
|
17
|
+
yield authedFetch(apiToken, `${envConfig.api_url}/db/v1/dsm_access_application_instances_u?id=eq.${iId}`, {
|
|
18
|
+
method: "PATCH",
|
|
19
|
+
headers: { "Content-Type": "application/json" },
|
|
20
|
+
body: JSON.stringify(instance),
|
|
21
|
+
});
|
|
18
22
|
});
|
|
19
23
|
}
|
|
@@ -27,7 +27,16 @@ const byPriority = (schema) => ([a], [b]) => {
|
|
|
27
27
|
export function formatOutput(profileObjects, allSchemas, realVers, apiToken, envConfig) {
|
|
28
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
29
|
const locale = process.env.PDF_LANGUAGE || process.env.DATE_FORMAT || "en-NZ";
|
|
30
|
-
const
|
|
30
|
+
const tagsToHide = [
|
|
31
|
+
"type:client_only",
|
|
32
|
+
"type:globally_unique_field",
|
|
33
|
+
];
|
|
34
|
+
const filteredPOs = profileObjects.filter((PO) => {
|
|
35
|
+
const schemaName = findSchemaLabel(PO.labels);
|
|
36
|
+
return (schemaName &&
|
|
37
|
+
!tagsToHide.some((tag) => { var _a, _b; return (_b = (_a = allSchemas.find((s) => s.name === schemaName)) === null || _a === void 0 ? void 0 : _a.tags) === null || _b === void 0 ? void 0 : _b.includes(tag); }));
|
|
38
|
+
});
|
|
39
|
+
const PODetails = filteredPOs.reduce((accumulatorPromiseOuter, PO) => __awaiter(this, void 0, void 0, function* () {
|
|
31
40
|
var _a;
|
|
32
41
|
const accumulatorOuter = yield accumulatorPromiseOuter;
|
|
33
42
|
const schemaName = findSchemaLabel(PO.labels);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raytio/decrypt-helper",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.5",
|
|
4
4
|
"author": "Raytio",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "A helper to decrypt data shared by Raytio users",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@aws-amplify/auth": "3.4.25",
|
|
26
|
-
"@raytio/core": "^11.
|
|
26
|
+
"@raytio/core": "^11.5.0",
|
|
27
27
|
"@raytio/maxcryptor": "^3.1.0",
|
|
28
|
-
"@raytio/types": "^
|
|
28
|
+
"@raytio/types": "^8.0.0",
|
|
29
29
|
"aws-sdk": "^2.754.0",
|
|
30
30
|
"jsx-pdf": "^2.3.0",
|
|
31
31
|
"localstorage-polyfill": "^1.0.1",
|