lucid-extension-sdk 0.0.258 → 0.0.259

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.
@@ -42,7 +42,8 @@ type SerializedSchemaForApi = {
42
42
  'fieldLabelOverrides'?: SerializedLabelOverrides | undefined;
43
43
  };
44
44
  type serializedPropertiesForApi = {
45
- 'Represents': SemanticCollection[];
45
+ 'Represents'?: SemanticCollection[];
46
+ 'Name'?: string;
46
47
  };
47
48
  export interface SerializedCollectionPatch {
48
49
  'schema'?: SerializedSchemaForApi;
@@ -114,6 +115,8 @@ export interface CollectionPatch {
114
115
  patch: ItemsPatch;
115
116
  /** What the collection implicitly represents **/
116
117
  represents?: SemanticCollection[];
118
+ /** The collection's display name */
119
+ name?: string | undefined;
117
120
  }
118
121
  /** @ignore */
119
122
  export declare function serializeFieldDefinitionForApi(field: FieldDefinition): SerializedFieldDefinitionForApi;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.schemaOKStatus = exports.schemaOutOfSyncStatus = exports.serializeCollectionPatch = exports.serializeFieldDefinitionForApi = exports.serializeItemsPatch = exports.ItemsPatchExhaustive = exports.ItemsPatchInexhaustive = void 0;
4
+ const checks_1 = require("../core/checks");
4
5
  const fieldtypedefinition_1 = require("../core/data/fieldtypedefinition/fieldtypedefinition");
5
6
  const object_1 = require("../core/object");
6
7
  const collectionerrortypes_1 = require("../data/collectionerrortypes");
@@ -72,11 +73,19 @@ function serializeRepresentsAsPropertyForApi(represents) {
72
73
  'Represents': represents, // key needs to match 'Represents' key in cake/app/webroot/ts/property/collection/collectionproperties.ts
73
74
  };
74
75
  }
76
+ function serializeNameAsPropertyForApi(name) {
77
+ return {
78
+ 'Name': name, // key needs to match 'Name' key in cake/app/webroot/ts/property/collection/collectionproperties.ts
79
+ };
80
+ }
75
81
  function serializeCollectionPatch(patch) {
82
+ const representsProperty = patch.represents && serializeRepresentsAsPropertyForApi(patch.represents);
83
+ const nameProperty = (0, checks_1.isString)(patch.name) ? serializeNameAsPropertyForApi(patch.name) : undefined;
84
+ const properties = (representsProperty || nameProperty) && Object.assign(Object.assign({}, representsProperty), nameProperty);
76
85
  return {
77
86
  'schema': patch.schema && serializeSchemaForApi(patch.schema),
78
87
  'itemsPatch': serializeItemsPatch(patch.patch),
79
- 'properties': patch.represents && serializeRepresentsAsPropertyForApi(patch.represents),
88
+ 'properties': properties,
80
89
  };
81
90
  }
82
91
  exports.serializeCollectionPatch = serializeCollectionPatch;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.258",
3
+ "version": "0.0.259",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",