lucid-extension-sdk 0.0.238 → 0.0.240

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.
@@ -6,6 +6,7 @@ const checks_1 = require("../../checks");
6
6
  const scalarfieldtype_1 = require("../fieldtypedefinition/scalarfieldtype");
7
7
  const alphabet_1 = require("./alphabet");
8
8
  const datasourcetype_1 = require("./datasourcetype");
9
+ const spreadsheetpossibledatatypes_1 = require("./spreadsheetpossibledatatypes");
9
10
  const upstreamupdatetype_1 = require("./upstreamupdatetype");
10
11
  /** @ignore */
11
12
  function _alphabetize(n) {
@@ -77,7 +78,7 @@ function makePrimaryCollectionSchema(rawSchemaFields, data, schemaFromData) {
77
78
  schemaFields.forEach((field, index) => {
78
79
  const finalFieldName = makeNameReadablyUnique(field, usedFieldsNormalized);
79
80
  usedFieldsNormalized.add(normalizeName(finalFieldName));
80
- fields.push({ 'Name': finalFieldName, 'Type': scalarfieldtype_1.ScalarFieldTypeEnum.ANY });
81
+ fields.push({ 'Name': finalFieldName, 'Type': spreadsheetpossibledatatypes_1.SpreadSheetPossibleDataTypes });
81
82
  oldToNewFields.set(rawSchemaFields[index], finalFieldName);
82
83
  });
83
84
  const oldPrimaryKeys = (_b = schemaFromData === null || schemaFromData === void 0 ? void 0 : schemaFromData.primaryKey) !== null && _b !== void 0 ? _b : [];
@@ -53,7 +53,7 @@ export declare const isSerializedImportedDataSource: (subject: unknown) => subje
53
53
  SourceType: (x: unknown) => x is import("./datasourcetype").DataSourceType;
54
54
  UpdateType: (x: unknown) => x is import("./upstreamupdatetype").UpstreamUpdateType;
55
55
  PatchType: (x: unknown) => x is import("./upstreampatchtype").UpstreamPatchType | null | undefined;
56
- SourceConfig: typeof isObject;
56
+ SourceConfig: typeof isObject; /** @ignore until spreadsheet integration is ready for launch (CHART-51946) */
57
57
  }> | null | undefined;
58
58
  }>;
59
59
  Collections: (val: unknown) => val is import("../../guards").DestructureGuardedTypeObj<{
@@ -0,0 +1,2 @@
1
+ import { ScalarFieldTypeEnum } from '../fieldtypedefinition/scalarfieldtype';
2
+ export declare const SpreadSheetPossibleDataTypes: ScalarFieldTypeEnum[];
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SpreadSheetPossibleDataTypes = void 0;
4
+ const scalarfieldtype_1 = require("../fieldtypedefinition/scalarfieldtype");
5
+ exports.SpreadSheetPossibleDataTypes = [
6
+ scalarfieldtype_1.ScalarFieldTypeEnum.BOOLEAN,
7
+ scalarfieldtype_1.ScalarFieldTypeEnum.NUMBER,
8
+ scalarfieldtype_1.ScalarFieldTypeEnum.STRING,
9
+ scalarfieldtype_1.ScalarFieldTypeEnum.NULL,
10
+ scalarfieldtype_1.ScalarFieldTypeEnum.CURRENCY,
11
+ scalarfieldtype_1.ScalarFieldTypeEnum.DATE,
12
+ scalarfieldtype_1.ScalarFieldTypeEnum.COLOR,
13
+ ];
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deserializeActions = exports.actionsHeaderValidator = void 0;
4
- const dataupdatefiltertype_1 = require("../../data/dataupdatefiltertype");
5
4
  const checks_1 = require("../../core/checks");
6
5
  const validators_1 = require("../../core/validators/validators");
6
+ const dataupdatefiltertype_1 = require("../../data/dataupdatefiltertype");
7
7
  const action_1 = require("./action");
8
8
  const dataconnectoractionkeys_1 = require("./dataconnectoractionkeys");
9
9
  exports.actionsHeaderValidator = (0, validators_1.objectValidator)({
@@ -69,8 +69,9 @@ export declare class ItemsPatchInexhaustive {
69
69
  }
70
70
  export declare class ItemsPatchExhaustive {
71
71
  items: Map<string, SerializedFields>;
72
+ renamingMap?: Map<string, string | null> | undefined;
72
73
  errors?: Map<string, SerializedLucidDictionary> | undefined;
73
- constructor(items: Map<string, SerializedFields>, errors?: Map<string, SerializedLucidDictionary> | undefined);
74
+ constructor(items: Map<string, SerializedFields>, renamingMap?: Map<string, string | null> | undefined, errors?: Map<string, SerializedLucidDictionary> | undefined);
74
75
  }
75
76
  export type ItemsPatch = {
76
77
  /**
@@ -89,6 +90,7 @@ export type SerializedItemsPatch = {
89
90
  'errors'?: Record<string, SerializedLucidDictionary>;
90
91
  } | {
91
92
  'exhaustiveItems': Record<string, SerializedFields>;
93
+ 'renamingMap'?: Record<string, string | null>;
92
94
  'errors'?: Record<string, SerializedLucidDictionary>;
93
95
  };
94
96
  export declare function serializeItemsPatch(patch: ItemsPatch): SerializedItemsPatch;
@@ -20,24 +20,23 @@ class ItemsPatchInexhaustive {
20
20
  }
21
21
  exports.ItemsPatchInexhaustive = ItemsPatchInexhaustive;
22
22
  class ItemsPatchExhaustive {
23
- constructor(items, errors) {
23
+ constructor(items, renamingMap, errors) {
24
24
  this.items = items;
25
+ this.renamingMap = renamingMap;
25
26
  this.errors = errors;
26
27
  }
27
28
  }
28
29
  exports.ItemsPatchExhaustive = ItemsPatchExhaustive;
29
30
  function serializeErrors(errors) {
30
- if (!errors) {
31
- return undefined;
32
- }
33
- const serializedErrors = {};
34
- errors.forEach((dictionary, key) => (serializedErrors[key] = dictionary));
35
- return { 'errors': serializedErrors };
31
+ return errors && { 'errors': (0, object_1.fromEntries)(errors) };
32
+ }
33
+ function serializeRenamingMap(renamingMap) {
34
+ return renamingMap && { 'renamingMap': (0, object_1.fromEntries)(renamingMap) };
36
35
  }
37
36
  function serializeItemsPatch(patch) {
38
37
  var _a;
39
38
  if (patch instanceof ItemsPatchExhaustive) {
40
- return Object.assign({ 'exhaustiveItems': (0, object_1.fromEntries)(patch.items.entries()) }, serializeErrors(patch.errors));
39
+ return Object.assign(Object.assign({ 'exhaustiveItems': (0, object_1.fromEntries)(patch.items.entries()) }, serializeRenamingMap(patch.renamingMap)), serializeErrors(patch.errors));
41
40
  }
42
41
  else {
43
42
  return Object.assign({ 'items': (0, object_1.fromEntries)(patch.items.entries()), 'itemsDeleted': (_a = patch.itemsDeleted) !== null && _a !== void 0 ? _a : [] }, serializeErrors(patch.errors));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.238",
3
+ "version": "0.0.240",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",