@syncbridge/common 0.10.1 → 0.10.3

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 CHANGED
@@ -1,4 +1,4 @@
1
- export const version = '0.10.1';
1
+ export const version = '0.10.3';
2
2
  export const CLASS_METADATA = Symbol.for('CLASS_METADATA');
3
3
  export const CLASS_TYPE = Symbol.for('CLASS_TYPE');
4
4
  export const VARIABLE_CONTAINER = Symbol.for('VARIABLE_CONTAINER');
@@ -5,7 +5,7 @@ import { ComponentMetadata } from '../models/index.js';
5
5
  import { UseComponent as _UseComponent } from './use-component.decorator.js';
6
6
  export declare function Component<T extends ComponentBase>(options: Component.Options): (target: Type<T>) => void;
7
7
  export declare namespace Component {
8
- type Options = DeepPartial<StrictOmit<ComponentMetadata, 'components' | 'variables'>> & {
8
+ type Options = DeepPartial<StrictOmit<ComponentMetadata, 'uri' | 'components' | 'variables' | 'version'>> & {
9
9
  className?: string;
10
10
  };
11
11
  function UseVariables<T extends ComponentBase>(variablesClass?: Type): (target: T, propertyKey: "values") => void;
@@ -39,7 +39,7 @@ export function Component(options) {
39
39
  version: pkgjson.version,
40
40
  abstract: !!options.abstract,
41
41
  author: parseNpmAuthor(pkgjson.author),
42
- ...omit(options, ['uri']),
42
+ ...omit(options, ['uri', 'components', 'variables', 'version']),
43
43
  });
44
44
  const base = Object.getPrototypeOf(target);
45
45
  const baseMetadata = Reflect.getMetadata(CLASS_METADATA, base);
@@ -23,7 +23,7 @@ export declare namespace Processor {
23
23
  function OnUpdateProfile<T extends ProcessorBase>(): (target: Type<T>, propertyKey: string | symbol) => void;
24
24
  }
25
25
  export declare namespace Processor {
26
- type Options = DeepPartial<StrictOmit<ProcessorMetadata, 'components' | 'variables'>> & {
26
+ type Options = DeepPartial<StrictOmit<ProcessorMetadata, 'uri' | 'components' | 'variables' | 'version'>> & {
27
27
  className?: string;
28
28
  };
29
29
  }
@@ -39,7 +39,7 @@ export function Processor(options) {
39
39
  displayName: className,
40
40
  version: pkgjson.version,
41
41
  abstract: !!options.abstract,
42
- ...omit(options, ['uri']),
42
+ ...omit(options, ['uri', 'components', 'variables', 'version']),
43
43
  });
44
44
  target.uri = uri;
45
45
  target.packageName = packageName;
@@ -12,6 +12,7 @@ export declare class ElementComponentMetadata {
12
12
  propertyKey?: string;
13
13
  interfaceUri: string;
14
14
  classUri?: string;
15
+ version?: string;
15
16
  description?: string;
16
17
  required?: boolean;
17
18
  variables?: VariableMetadataRecord;
@@ -36,6 +36,14 @@ __decorate([
36
36
  }),
37
37
  __metadata("design:type", String)
38
38
  ], ElementComponentMetadata.prototype, "classUri", void 0);
39
+ __decorate([
40
+ ApiField({
41
+ label: 'Version',
42
+ description: 'Version of the class',
43
+ examples: ['0.2.1', '2.1.5', '1.18.1-alpha.1'],
44
+ }),
45
+ __metadata("design:type", String)
46
+ ], ElementComponentMetadata.prototype, "version", void 0);
39
47
  __decorate([
40
48
  ApiField({
41
49
  label: 'Description',
@@ -8,6 +8,7 @@ export declare class ElementMetadata {
8
8
  constructor(init?: Partial<ElementMetadata>);
9
9
  abstract?: boolean;
10
10
  uri: string;
11
+ version?: string;
11
12
  displayName: string;
12
13
  iconUrl?: string;
13
14
  description?: string;
@@ -20,6 +20,14 @@ __decorate([
20
20
  }),
21
21
  __metadata("design:type", String)
22
22
  ], ElementMetadata.prototype, "uri", void 0);
23
+ __decorate([
24
+ ApiField({
25
+ label: 'Version',
26
+ description: 'Version of the class',
27
+ examples: ['0.2.1', '2.1.5', '1.18.1-alpha.1'],
28
+ }),
29
+ __metadata("design:type", String)
30
+ ], ElementMetadata.prototype, "version", void 0);
23
31
  __decorate([
24
32
  ApiField({
25
33
  label: 'Name',
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@syncbridge/common",
3
- "version": "0.10.1",
3
+ "version": "0.10.3",
4
4
  "description": "SyncBridge Common utilities",
5
5
  "author": "Panates Inc",
6
6
  "license": "MIT",
7
7
  "dependencies": {
8
- "@jsopen/objects": "^2.2.0",
8
+ "@jsopen/objects": "^2.2.1",
9
9
  "fast-deep-equal": "^3.1.3",
10
10
  "node-events-async": "^1.5.2",
11
11
  "caller-callsite": "^6.0.0",
@@ -32,6 +32,7 @@ export function materializeMetadataSilent(profile, returnUndefinedComponentsAsAb
32
32
  const processorRec = ExtensionRegistry.getProcessor(profile.processorUri);
33
33
  const metadata = omitUndefined(clone({
34
34
  uri: processorRec.metadata.uri,
35
+ version: processorRec.version,
35
36
  displayName: processorRec.metadata.displayName,
36
37
  description: processorRec.metadata.description,
37
38
  iconUrl: processorRec.metadata.iconUrl,
@@ -87,7 +88,8 @@ function _materializeComponents(stackExecutor, srcMetadata, profile, returnUndef
87
88
  }
88
89
  materializedComponent = {
89
90
  classUri: profileComponent.uri,
90
- ...omit(metadataComponent, ['classUri', 'variables']),
91
+ version: reg.version,
92
+ ...omit(metadataComponent, ['classUri', 'variables', 'version']),
91
93
  };
92
94
  materializedComponent.variables = merge({}, [reg.metadata.variables || {}, metadataComponent.variables || {}], { deep: 'full' });
93
95
  materializedComponent.variables = sortVariables(materializedComponent.variables);