@syncbridge/common 0.13.0 → 0.13.2

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.13.0';
1
+ export const version = '0.13.2';
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, 'classType' | 'className' | 'components' | 'variables' | 'version'>> & {
8
+ type Options = DeepPartial<StrictOmit<ComponentMetadata, 'uri' | 'classType' | 'className' | 'components' | 'variables' | 'version'>> & {
9
9
  className?: string;
10
10
  };
11
11
  function UseVariables<T extends ComponentBase>(variablesClass?: Type): (target: T, propertyKey: "values") => void;
@@ -33,7 +33,7 @@ export function Component(options) {
33
33
  throw new TypeError('Class name is required');
34
34
  /** Determine uri */
35
35
  Reflect.defineMetadata(CLASS_TYPE, 'component', target);
36
- const packageName = pkgjson.syncbridge?.name || pkgjson.name;
36
+ const packageName = pkgjson.name;
37
37
  const uri = packageName + ':' + className;
38
38
  const metadata = defineOwnMetadata(target, CLASS_METADATA, {
39
39
  classType: 'component',
@@ -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, 'classType' | 'className' | 'components' | 'variables' | 'version'>> & {
26
+ type Options = DeepPartial<StrictOmit<ProcessorMetadata, 'uri' | 'classType' | 'className' | 'components' | 'variables' | 'version'>> & {
27
27
  className?: string;
28
28
  };
29
29
  }
@@ -6,6 +6,7 @@ import { VariableMetadataRecord } from './variable-metadata.js';
6
6
  export declare class ElementMetadata {
7
7
  constructor(init?: Partial<ElementMetadata>);
8
8
  abstract?: boolean;
9
+ uri: string;
9
10
  className: string;
10
11
  version: string;
11
12
  displayName: string;
@@ -11,6 +11,13 @@ let ElementMetadata = class ElementMetadata {
11
11
  }
12
12
  abstract;
13
13
  };
14
+ __decorate([
15
+ ApiField({
16
+ description: 'URI of the element',
17
+ examples: ['@syncbridge/net:TcpClient', '@syncbridge/serial:SerialClient'],
18
+ }),
19
+ __metadata("design:type", String)
20
+ ], ElementMetadata.prototype, "uri", void 0);
14
21
  __decorate([
15
22
  ApiField({
16
23
  label: 'Class Name',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncbridge/common",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "SyncBridge Common utilities",
5
5
  "author": "Panates Inc",
6
6
  "license": "MIT",