@syncbridge/common 0.6.8 → 0.6.10
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/constants.js +1 -1
- package/package.json +1 -1
- package/processor-factory.js +1 -1
- package/utils/decode-profile.d.ts +4 -0
- package/utils/decode-profile.js +22 -1
package/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const version = '0.6.
|
|
1
|
+
export const version = '0.6.10';
|
|
2
2
|
export const OWN_ELEMENT_METADATA = Symbol.for('OWN_ELEMENT_METADATA');
|
|
3
3
|
export const COMPONENT_OPTIONS = Symbol.for('COMPONENT_OPTIONS');
|
|
4
4
|
export const PROCESSOR_OPTIONS = Symbol.for('PROCESSOR_OPTIONS');
|
package/package.json
CHANGED
package/processor-factory.js
CHANGED
|
@@ -121,7 +121,7 @@ export var ProcessorFactory;
|
|
|
121
121
|
for (const [key, childMetadata] of Object.entries(newMetadata.components)) {
|
|
122
122
|
// Stack: components/componentName
|
|
123
123
|
await stackExecutor.executeAsync(key, async () => {
|
|
124
|
-
if (!newProfile[key]?.disabled)
|
|
124
|
+
if (!newProfile.components?.[key]?.disabled)
|
|
125
125
|
await _configureComponent(ctx, key, childMetadata);
|
|
126
126
|
});
|
|
127
127
|
}
|
|
@@ -12,6 +12,10 @@ export declare function decodeProfileSilent(materializedMetadata: ProcessorMetad
|
|
|
12
12
|
profile: Profile;
|
|
13
13
|
issues?: StackExecutor.Issue[];
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Encodes profile
|
|
17
|
+
*/
|
|
18
|
+
export declare function encodeProfile(materializedMetadata: ProcessorMetadata, rawProfile: Profile, options?: CodecOptions): Profile;
|
|
15
19
|
/**
|
|
16
20
|
* Encodes profile
|
|
17
21
|
*/
|
package/utils/decode-profile.js
CHANGED
|
@@ -10,7 +10,7 @@ import { secretDecryptor, secretEncryptor } from './encrypt-helpers.js';
|
|
|
10
10
|
export function decodeProfile(materializedMetadata, rawProfile, options) {
|
|
11
11
|
const { profile: out, issues } = decodeProfileSilent(materializedMetadata, rawProfile, options);
|
|
12
12
|
if (issues?.length) {
|
|
13
|
-
const msg = 'Worker profile
|
|
13
|
+
const msg = 'Worker profile decoding error.\n ' +
|
|
14
14
|
issues
|
|
15
15
|
.map(issue => `- ${issue.message}. Location: /${issue.location}`)
|
|
16
16
|
.join('\n ');
|
|
@@ -34,6 +34,27 @@ export function decodeProfileSilent(materializedMetadata, rawProfile, options) {
|
|
|
34
34
|
_codecProcessElement(stackExecutor, 'decode', materializedMetadata, out, options);
|
|
35
35
|
return { profile: out, issues: stackExecutor.issues };
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Encodes profile
|
|
39
|
+
*/
|
|
40
|
+
export function encodeProfile(materializedMetadata, rawProfile, options) {
|
|
41
|
+
const { profile: out, issues } = encodeProfileSilent(materializedMetadata, rawProfile, options);
|
|
42
|
+
if (issues?.length) {
|
|
43
|
+
const msg = 'Worker profile encoding error.\n ' +
|
|
44
|
+
issues
|
|
45
|
+
.map(issue => `- ${issue.message}. Location: /${issue.location}`)
|
|
46
|
+
.join('\n ');
|
|
47
|
+
issues.forEach(issue => {
|
|
48
|
+
if (issue instanceof SbValidationError)
|
|
49
|
+
delete issue.stack;
|
|
50
|
+
});
|
|
51
|
+
throw new SbValidationError(msg, {
|
|
52
|
+
workerId: rawProfile.id,
|
|
53
|
+
issues,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return out;
|
|
57
|
+
}
|
|
37
58
|
/**
|
|
38
59
|
* Encodes profile
|
|
39
60
|
*/
|