lucid-extension-sdk 0.0.238 → 0.0.239
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/core/data/datasource/datasourceutils.js +2 -1
- package/core/data/datasource/spreadsheetpossibledatatypes.d.ts +2 -0
- package/core/data/datasource/spreadsheetpossibledatatypes.js +13 -0
- package/dataconnector/datasourceupdatetypes.d.ts +3 -1
- package/dataconnector/datasourceupdatetypes.js +7 -8
- package/package.json +1 -1
|
@@ -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':
|
|
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 : [];
|
|
@@ -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
|
+
];
|
|
@@ -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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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));
|