lucid-extension-sdk 0.0.293 → 0.0.295
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/serializedfield/serializedfields.d.ts +4 -0
- package/core/data/serializedfield/serializedfields.js +3 -3
- package/dataconnector/actions/patch.d.ts +0 -4
- package/dataconnector/actions/patch.js +3 -7
- package/dataconnector/actions/serializedpatchtypes.d.ts +0 -2
- package/dataconnector/actions/serializedpatchtypes.js +0 -1
- package/package.json +1 -1
|
@@ -97,6 +97,10 @@ export declare const isSerializedMillisecondsDateObject: (subject: unknown) => s
|
|
|
97
97
|
ms: typeof isNumber;
|
|
98
98
|
isDateOnly: (x: unknown) => x is boolean | undefined;
|
|
99
99
|
}>;
|
|
100
|
+
export declare const isSerializedIsoDateObject: (subject: unknown) => subject is import("../../guards").DestructureGuardedTypeObj<{
|
|
101
|
+
isoDate: typeof isString;
|
|
102
|
+
displayTimezone: (x: unknown) => x is string | null | undefined;
|
|
103
|
+
}>;
|
|
100
104
|
export declare const isSerializedLucidDateObject: (x: unknown) => x is import("../../guards").DestructureGuardedTypeObj<{
|
|
101
105
|
ms: typeof isNumber;
|
|
102
106
|
isDateOnly: (x: unknown) => x is boolean | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSerializedFields = exports.isSerializedJsonFieldType = exports.isSerializedFieldType = exports.isSerializedTimeObject = exports.isSerializedLucidDateObject = exports.isSerializedMillisecondsDateObject = exports.isSerializedLucidCurrency = exports.isSerializedLucidDictionary = exports.isJsonSerializedLucidDictionary = exports.isNestedSerializedLucidDictionary = exports.isSerializedColorObjectFieldType = void 0;
|
|
3
|
+
exports.isSerializedFields = exports.isSerializedJsonFieldType = exports.isSerializedFieldType = exports.isSerializedTimeObject = exports.isSerializedLucidDateObject = exports.isSerializedIsoDateObject = exports.isSerializedMillisecondsDateObject = exports.isSerializedLucidCurrency = exports.isSerializedLucidDictionary = exports.isJsonSerializedLucidDictionary = exports.isNestedSerializedLucidDictionary = exports.isSerializedColorObjectFieldType = void 0;
|
|
4
4
|
const checks_1 = require("../../checks");
|
|
5
5
|
const validators_1 = require("../../validators/validators");
|
|
6
6
|
function isSerializedColorObjectFieldType(value) {
|
|
@@ -24,11 +24,11 @@ exports.isSerializedMillisecondsDateObject = (0, validators_1.objectValidator)({
|
|
|
24
24
|
'ms': checks_1.isNumber,
|
|
25
25
|
'isDateOnly': (0, validators_1.option)(checks_1.isBoolean),
|
|
26
26
|
});
|
|
27
|
-
|
|
27
|
+
exports.isSerializedIsoDateObject = (0, validators_1.objectValidator)({
|
|
28
28
|
'isoDate': checks_1.isString,
|
|
29
29
|
'displayTimezone': (0, validators_1.nullableOption)(checks_1.isString),
|
|
30
30
|
});
|
|
31
|
-
exports.isSerializedLucidDateObject = (0, validators_1.either)(exports.isSerializedMillisecondsDateObject, isSerializedIsoDateObject);
|
|
31
|
+
exports.isSerializedLucidDateObject = (0, validators_1.either)(exports.isSerializedMillisecondsDateObject, exports.isSerializedIsoDateObject);
|
|
32
32
|
exports.isSerializedTimeObject = (0, validators_1.objectValidator)({
|
|
33
33
|
'hours': checks_1.isNumber,
|
|
34
34
|
'minutes': (0, validators_1.option)(checks_1.isNumber),
|
|
@@ -76,8 +76,6 @@ export declare class SchemaPatch extends Patch {
|
|
|
76
76
|
columnsDeleted: string[];
|
|
77
77
|
/** */
|
|
78
78
|
columnOrdering: [string, string | null][] | undefined;
|
|
79
|
-
/** Changes to the primary key */
|
|
80
|
-
primaryKey: string[] | undefined;
|
|
81
79
|
constructor(
|
|
82
80
|
/** The id of the patch */
|
|
83
81
|
id: string,
|
|
@@ -89,8 +87,6 @@ export declare class SchemaPatch extends Patch {
|
|
|
89
87
|
columnsDeleted: string[],
|
|
90
88
|
/** */
|
|
91
89
|
columnOrdering: [string, string | null][] | undefined,
|
|
92
|
-
/** Changes to the primary key */
|
|
93
|
-
primaryKey: string[] | undefined,
|
|
94
90
|
/** The syncSourceId of the changed data source */
|
|
95
91
|
syncSourceId: string,
|
|
96
92
|
/** The syncCollectionId of the changed collection */
|
|
@@ -116,7 +116,6 @@ class ThirdPartyColumnPatch {
|
|
|
116
116
|
static deserialize(data) {
|
|
117
117
|
var _a;
|
|
118
118
|
const result = new ThirdPartyColumnPatch((_a = data['name']) !== null && _a !== void 0 ? _a : undefined, data['fieldType'] != null ? (0, fieldtypedefinition_1.deserializeFieldTypeDefinition)(data['fieldType']) : undefined);
|
|
119
|
-
console.log(`\n\nSerialization result: ${JSON.stringify(result.toJSON())}\n\n`);
|
|
120
119
|
return result;
|
|
121
120
|
}
|
|
122
121
|
}
|
|
@@ -133,8 +132,6 @@ class SchemaPatch extends Patch {
|
|
|
133
132
|
columnsDeleted,
|
|
134
133
|
/** */
|
|
135
134
|
columnOrdering,
|
|
136
|
-
/** Changes to the primary key */
|
|
137
|
-
primaryKey,
|
|
138
135
|
/** The syncSourceId of the changed data source */
|
|
139
136
|
syncSourceId,
|
|
140
137
|
/** The syncCollectionId of the changed collection */
|
|
@@ -144,7 +141,6 @@ class SchemaPatch extends Patch {
|
|
|
144
141
|
this.columnsChanged = columnsChanged;
|
|
145
142
|
this.columnsDeleted = columnsDeleted;
|
|
146
143
|
this.columnOrdering = columnOrdering;
|
|
147
|
-
this.primaryKey = primaryKey;
|
|
148
144
|
}
|
|
149
145
|
toJSON() {
|
|
150
146
|
return {
|
|
@@ -160,13 +156,13 @@ class SchemaPatch extends Patch {
|
|
|
160
156
|
clone() {
|
|
161
157
|
return new SchemaPatch(this.id, this.columnsAdded.map((columnAdded) => columnAdded.clone()), objMap(this.columnsChanged, (columnChange) => columnChange.clone()), [...this.columnsDeleted], this.columnOrdering && [
|
|
162
158
|
...this.columnOrdering.map(([base, target]) => [base, target]),
|
|
163
|
-
], this.
|
|
159
|
+
], this.syncSourceId, this.syncCollectionId);
|
|
164
160
|
}
|
|
165
161
|
}
|
|
166
162
|
exports.SchemaPatch = SchemaPatch;
|
|
167
163
|
function _schemaPatchParser(id, patch) {
|
|
168
|
-
var _a
|
|
169
|
-
return new SchemaPatch(id, patch['columnsAdded'].map(ThirdPartyColumn.deserialize), objMap(patch['columnsChanged'], ThirdPartyColumnPatch.deserialize), patch['columnsDeleted'], (_a = patch['columnOrdering']) !== null && _a !== void 0 ? _a : undefined,
|
|
164
|
+
var _a;
|
|
165
|
+
return new SchemaPatch(id, patch['columnsAdded'].map(ThirdPartyColumn.deserialize), objMap(patch['columnsChanged'], ThirdPartyColumnPatch.deserialize), patch['columnsDeleted'], (_a = patch['columnOrdering']) !== null && _a !== void 0 ? _a : undefined, patch['syncSourceId'], patch['syncCollectionId']);
|
|
170
166
|
}
|
|
171
167
|
const schemaPatchParser = (id, patch) => {
|
|
172
168
|
if ((0, serializedpatchtypes_1.patchSchemaValidator)(patch)) {
|
|
@@ -37,7 +37,6 @@ export declare const patchSchemaValidator: (subject: unknown) => subject is impo
|
|
|
37
37
|
};
|
|
38
38
|
columnsDeleted: (p1: unknown) => p1 is string[];
|
|
39
39
|
columnOrdering: (x: unknown) => x is [string, string | null][] | null | undefined;
|
|
40
|
-
primaryKey: (x: unknown) => x is string[] | null | undefined;
|
|
41
40
|
syncSourceId: typeof isString;
|
|
42
41
|
syncCollectionId: typeof isString;
|
|
43
42
|
adapterType: (x: unknown) => x is "EXTENSION_API";
|
|
@@ -69,7 +68,6 @@ export declare const patchValidator: (x: unknown) => x is import("../../core/gua
|
|
|
69
68
|
};
|
|
70
69
|
columnsDeleted: (p1: unknown) => p1 is string[];
|
|
71
70
|
columnOrdering: (x: unknown) => x is [string, string | null][] | null | undefined;
|
|
72
|
-
primaryKey: (x: unknown) => x is string[] | null | undefined;
|
|
73
71
|
syncSourceId: typeof isString;
|
|
74
72
|
syncCollectionId: typeof isString;
|
|
75
73
|
adapterType: (x: unknown) => x is "EXTENSION_API";
|
|
@@ -27,7 +27,6 @@ exports.patchSchemaValidator = (0, validators_1.objectValidator)({
|
|
|
27
27
|
columnsChanged: (0, validators_1.mapValidator)(exports.thirdPartyColumnPatchValidator),
|
|
28
28
|
columnsDeleted: (0, validators_1.arrayValidator)(checks_1.isString),
|
|
29
29
|
columnOrdering: (0, validators_1.nullableOption)((0, validators_1.arrayValidator)((0, validators_1.tupleValidator)(checks_1.isString, (0, validators_1.nullable)(checks_1.isString)))),
|
|
30
|
-
primaryKey: (0, validators_1.nullableOption)((0, validators_1.arrayValidator)(checks_1.isString)),
|
|
31
30
|
syncSourceId: checks_1.isString,
|
|
32
31
|
syncCollectionId: checks_1.isString,
|
|
33
32
|
adapterType: (0, checks_1.isLiteral)('EXTENSION_API'),
|