@mcma/core 0.16.4 → 0.16.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.
@@ -0,0 +1,6 @@
1
+ export declare enum LocatorStatus {
2
+ Processing = "Processing",
3
+ Ready = "Ready",
4
+ Archived = "Archived",
5
+ Deleted = "Deleted"
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LocatorStatus = void 0;
4
+ var LocatorStatus;
5
+ (function (LocatorStatus) {
6
+ LocatorStatus["Processing"] = "Processing";
7
+ LocatorStatus["Ready"] = "Ready";
8
+ LocatorStatus["Archived"] = "Archived";
9
+ LocatorStatus["Deleted"] = "Deleted";
10
+ })(LocatorStatus = exports.LocatorStatus || (exports.LocatorStatus = {}));
@@ -1,9 +1,12 @@
1
- import { McmaObject, McmaObjectProperties } from "./mcma-object";
2
- export interface LocatorProperties extends McmaObjectProperties {
1
+ import { McmaResource, McmaResourceProperties } from "./mcma-resource";
2
+ import { LocatorStatus } from "./locator-status";
3
+ export interface LocatorProperties extends McmaResourceProperties {
3
4
  url: string;
5
+ status?: LocatorStatus;
4
6
  }
5
- export declare class Locator extends McmaObject implements LocatorProperties {
7
+ export declare class Locator extends McmaResource implements LocatorProperties {
6
8
  url: string;
9
+ status?: LocatorStatus;
7
10
  constructor(properties: LocatorProperties);
8
11
  constructor(type: string, properties: LocatorProperties);
9
12
  }
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Locator = void 0;
4
- const mcma_object_1 = require("./mcma-object");
4
+ const mcma_resource_1 = require("./mcma-resource");
5
5
  const utils_1 = require("../utils");
6
- class Locator extends mcma_object_1.McmaObject {
6
+ class Locator extends mcma_resource_1.McmaResource {
7
7
  url;
8
+ status;
8
9
  constructor(typeOrProperties, properties) {
9
10
  if (!properties && typeof typeOrProperties !== "string") {
10
11
  properties = typeOrProperties;
@@ -12,7 +13,9 @@ class Locator extends mcma_object_1.McmaObject {
12
13
  }
13
14
  super(typeOrProperties);
14
15
  this.url = properties.url;
16
+ this.status = properties.status;
15
17
  utils_1.Utils.checkProperty(this, "url", "string", true);
18
+ utils_1.Utils.checkProperty(this, "status", "string", false);
16
19
  }
17
20
  }
18
21
  exports.Locator = Locator;
@@ -16,5 +16,5 @@ export declare abstract class McmaResource extends McmaObject implements McmaRes
16
16
  custom?: {
17
17
  [key: string]: any;
18
18
  };
19
- protected constructor(type: string, properties: McmaResourceProperties);
19
+ protected constructor(type: string, properties?: McmaResourceProperties);
20
20
  }
@@ -23,10 +23,10 @@ class McmaResource extends mcma_object_1.McmaObject {
23
23
  custom;
24
24
  constructor(type, properties) {
25
25
  super(type);
26
- this.id = properties.id;
27
- this.dateCreated = utils_1.Utils.ensureValidDateOrUndefined(properties.dateCreated);
28
- this.dateModified = utils_1.Utils.ensureValidDateOrUndefined(properties.dateModified);
29
- if (typeof properties.custom === "object" && Object.keys(properties.custom).length > 0) {
26
+ this.id = properties?.id;
27
+ this.dateCreated = utils_1.Utils.ensureValidDateOrUndefined(properties?.dateCreated);
28
+ this.dateModified = utils_1.Utils.ensureValidDateOrUndefined(properties?.dateModified);
29
+ if (typeof properties?.custom === "object" && Object.keys(properties?.custom).length > 0) {
30
30
  this.custom = Object.assign({}, properties.custom);
31
31
  }
32
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcma/core",
3
- "version": "0.16.4",
3
+ "version": "0.16.5",
4
4
  "description": "Node module with type definitions and helper utils for the EBU MCMA framework",
5
5
  "engines": {
6
6
  "node": "^18.0.0"