@memberjunction/core 1.3.3 → 1.4.1
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/dist/generic/applicationInfo.d.ts +15 -1
- package/dist/generic/applicationInfo.d.ts.map +1 -1
- package/dist/generic/applicationInfo.js +25 -2
- package/dist/generic/applicationInfo.js.map +1 -1
- package/dist/generic/baseEngine.d.ts +56 -0
- package/dist/generic/baseEngine.d.ts.map +1 -0
- package/dist/generic/baseEngine.js +82 -0
- package/dist/generic/baseEngine.js.map +1 -0
- package/dist/generic/baseEntity.d.ts +99 -9
- package/dist/generic/baseEntity.d.ts.map +1 -1
- package/dist/generic/baseEntity.js +178 -79
- package/dist/generic/baseEntity.js.map +1 -1
- package/dist/generic/baseInfo.d.ts +2 -0
- package/dist/generic/baseInfo.d.ts.map +1 -1
- package/dist/generic/baseInfo.js +27 -3
- package/dist/generic/baseInfo.js.map +1 -1
- package/dist/generic/compositeKey.d.ts +133 -0
- package/dist/generic/compositeKey.d.ts.map +1 -0
- package/dist/generic/compositeKey.js +283 -0
- package/dist/generic/compositeKey.js.map +1 -0
- package/dist/generic/entityInfo.d.ts +33 -8
- package/dist/generic/entityInfo.d.ts.map +1 -1
- package/dist/generic/entityInfo.js +64 -19
- package/dist/generic/entityInfo.js.map +1 -1
- package/dist/generic/interfaces.d.ts +35 -81
- package/dist/generic/interfaces.d.ts.map +1 -1
- package/dist/generic/interfaces.js +32 -182
- package/dist/generic/interfaces.js.map +1 -1
- package/dist/generic/libraryInfo.d.ts +39 -0
- package/dist/generic/libraryInfo.d.ts.map +1 -0
- package/dist/generic/libraryInfo.js +55 -0
- package/dist/generic/libraryInfo.js.map +1 -0
- package/dist/generic/logging.d.ts +43 -0
- package/dist/generic/logging.d.ts.map +1 -1
- package/dist/generic/logging.js +73 -1
- package/dist/generic/logging.js.map +1 -1
- package/dist/generic/metadata.d.ts +28 -9
- package/dist/generic/metadata.d.ts.map +1 -1
- package/dist/generic/metadata.js +52 -16
- package/dist/generic/metadata.js.map +1 -1
- package/dist/generic/providerBase.d.ts +33 -28
- package/dist/generic/providerBase.d.ts.map +1 -1
- package/dist/generic/providerBase.js +119 -185
- package/dist/generic/providerBase.js.map +1 -1
- package/dist/generic/transactionGroup.d.ts +38 -1
- package/dist/generic/transactionGroup.d.ts.map +1 -1
- package/dist/generic/transactionGroup.js +38 -14
- package/dist/generic/transactionGroup.js.map +1 -1
- package/dist/generic/util.d.ts +4 -0
- package/dist/generic/util.d.ts.map +1 -1
- package/dist/generic/util.js +15 -1
- package/dist/generic/util.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/views/runView.d.ts +7 -1
- package/dist/views/runView.d.ts.map +1 -1
- package/dist/views/runView.js +31 -1
- package/dist/views/runView.js.map +1 -1
- package/package.json +3 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EntityRecordNameResult = exports.EntityRecordNameInput = exports.EntitySaveOptions = exports.PotentialDuplicateResponse = exports.PotentialDuplicateResult = exports.PotentialDuplicateRequest = exports.PotentialDuplicate = exports.
|
|
4
|
-
const
|
|
3
|
+
exports.EntityRecordNameResult = exports.EntityRecordNameInput = exports.EntityDeleteOptions = exports.EntitySaveOptions = exports.PotentialDuplicateResponse = exports.PotentialDuplicateResult = exports.PotentialDuplicateRequest = exports.PotentialDuplicate = exports.ProviderType = exports.MetadataInfo = exports.ProviderConfigDataBase = void 0;
|
|
4
|
+
const compositeKey_1 = require("./compositeKey");
|
|
5
5
|
class ProviderConfigDataBase {
|
|
6
6
|
get Data() {
|
|
7
7
|
return this._data;
|
|
@@ -35,186 +35,7 @@ exports.ProviderType = {
|
|
|
35
35
|
Database: 'Database',
|
|
36
36
|
Network: 'Network',
|
|
37
37
|
};
|
|
38
|
-
class CompositeKey {
|
|
39
|
-
constructor(keyValuePairs) {
|
|
40
|
-
this.KeyValuePairs = keyValuePairs || [];
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* returns the value of the key value pair for the specified field name
|
|
44
|
-
* @param fieldName the field name to get the value for
|
|
45
|
-
* @returns the value of the key value pair for the specified field name
|
|
46
|
-
*/
|
|
47
|
-
GetValueByFieldName(fieldName) {
|
|
48
|
-
let key = this.KeyValuePairs.find((keyValue) => {
|
|
49
|
-
return keyValue.FieldName === fieldName;
|
|
50
|
-
});
|
|
51
|
-
return key ? key.Value : null;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* returns the value of the key value pair at the specified index
|
|
55
|
-
* @param index the index of the key value pair to get the value for
|
|
56
|
-
* @returns the value of the key value pair at the specified index
|
|
57
|
-
*/
|
|
58
|
-
GetValueByIndex(index) {
|
|
59
|
-
if (index >= 0 && index < this.KeyValuePairs.length) {
|
|
60
|
-
return this.KeyValuePairs[index].Value;
|
|
61
|
-
}
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* @returns a string representation of the primary key values in the format "FieldName=Value"
|
|
66
|
-
* @example "ID=1 AND Name=John"
|
|
67
|
-
* @param useIsNull if true, will return "FieldName IS NULL" for any key value pair that has a null or undefined value
|
|
68
|
-
*/
|
|
69
|
-
ToString(useIsNull) {
|
|
70
|
-
return this.KeyValuePairs.map((keyValue) => {
|
|
71
|
-
if (useIsNull && (keyValue.Value === null || keyValue.Value === undefined)) {
|
|
72
|
-
return `${keyValue.FieldName} IS NULL`;
|
|
73
|
-
}
|
|
74
|
-
return `${keyValue.FieldName}=${keyValue.Value}`;
|
|
75
|
-
}).join(" AND ");
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* @returns a copy of the KeyValuePairs array but with the Value properties as type string
|
|
79
|
-
*/
|
|
80
|
-
ValuesAsString() {
|
|
81
|
-
return this.KeyValuePairs.map((keyValue) => {
|
|
82
|
-
return {
|
|
83
|
-
FieldName: keyValue.FieldName,
|
|
84
|
-
Value: keyValue.Value.toString()
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Utility function to return a copy of the CompositeKey with the Value properties as string
|
|
90
|
-
* @returns a copy of the KeyValuePairs array but with the Value properties as string
|
|
91
|
-
*/
|
|
92
|
-
Copy() {
|
|
93
|
-
let copy = new CompositeKey();
|
|
94
|
-
copy.KeyValuePairs = this.ValuesAsString();
|
|
95
|
-
return copy;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* @returns the KeyValuePairs as a list of strings in the format "FieldName=Value"
|
|
99
|
-
* @param delimiter the delimiter to use between the field name and value. Defaults to '='
|
|
100
|
-
* @example ["ID=1", "Name=John"]
|
|
101
|
-
*/
|
|
102
|
-
ToList(delimiter) {
|
|
103
|
-
return this.KeyValuePairs.map((pk) => {
|
|
104
|
-
return delimiter ? `${pk.FieldName}${delimiter}${pk.Value}` : `${pk.FieldName}=${pk.Value}`;
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* @returns the value of each key value pair in the format "Value1, Value2, Value3"
|
|
109
|
-
* @param delimiter - the delimiter to use between the values. Defaults to ', '
|
|
110
|
-
* @example "1, John"
|
|
111
|
-
*/
|
|
112
|
-
Values(delimiter) {
|
|
113
|
-
return this.KeyValuePairs.map((keyValue) => {
|
|
114
|
-
return keyValue.Value;
|
|
115
|
-
}).join(delimiter || ", ");
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Utility function to compare the key primary key of this object to another sets to see if they are the same or not
|
|
119
|
-
* @param kvPairs the primary key values to compare against
|
|
120
|
-
* @returns true if the primary key values are the same, false if they are different
|
|
121
|
-
*/
|
|
122
|
-
EqualsKey(kvPairs) {
|
|
123
|
-
if (!kvPairs || kvPairs.length === 0) {
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
if (kvPairs.length !== this.KeyValuePairs.length) {
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
129
|
-
for (const [index, kvPair] of kvPairs.entries()) {
|
|
130
|
-
const sourcekvPair = this.KeyValuePairs[index];
|
|
131
|
-
if (kvPair.FieldName !== sourcekvPair.FieldName || kvPair.Value !== sourcekvPair.Value) {
|
|
132
|
-
return false;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return true;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Utility function to compare this composite key to another
|
|
139
|
-
* @param compositeKey the composite key to compare against
|
|
140
|
-
* @returns true if the primary key values are the same, false if they are different
|
|
141
|
-
*/
|
|
142
|
-
Equals(compositeKey) {
|
|
143
|
-
if (!compositeKey) {
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
return this.EqualsKey(compositeKey.KeyValuePairs);
|
|
147
|
-
}
|
|
148
|
-
LoadFromEntityFields(fields) {
|
|
149
|
-
this.KeyValuePairs = fields.map((field) => {
|
|
150
|
-
return {
|
|
151
|
-
FieldName: field.Name,
|
|
152
|
-
Value: field.Value
|
|
153
|
-
};
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
LoadFromEntityInfoAndRecord(entity, entityRecord) {
|
|
157
|
-
this.KeyValuePairs = entity.PrimaryKeys.map((pk) => {
|
|
158
|
-
return {
|
|
159
|
-
FieldName: pk.Name,
|
|
160
|
-
Value: entityRecord[pk.Name]
|
|
161
|
-
};
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Loads the KeyValuePairs from a list of strings in the format "FieldName=Value"
|
|
166
|
-
* @param list - the list of strings to load from
|
|
167
|
-
* @param delimiter - the delimiter to use between the field name and value. Defaults to '='
|
|
168
|
-
* @example ["ID=1", "Name=John"]
|
|
169
|
-
*/
|
|
170
|
-
LoadFromList(list, delimiter) {
|
|
171
|
-
this.KeyValuePairs = list.map((pk) => {
|
|
172
|
-
let keyValue = delimiter ? pk.split(delimiter) : pk.split("=");
|
|
173
|
-
if (keyValue.length === 2) {
|
|
174
|
-
let keyValuePair = new entityInfo_1.KeyValuePair();
|
|
175
|
-
keyValuePair.FieldName = keyValue[0];
|
|
176
|
-
keyValuePair.Value = keyValue[1];
|
|
177
|
-
return keyValuePair;
|
|
178
|
-
}
|
|
179
|
-
return;
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
ToURLSegment(segment) {
|
|
183
|
-
return this.KeyValuePairs.map((pk) => {
|
|
184
|
-
return `${pk.FieldName}|${pk.Value}`;
|
|
185
|
-
}).join(segment || "||");
|
|
186
|
-
}
|
|
187
|
-
LoadFromURLSegment(entity, routeSegment, segment) {
|
|
188
|
-
if (!routeSegment.includes('|')) {
|
|
189
|
-
// If not, return a single element array with a default field name
|
|
190
|
-
this.KeyValuePairs = [{ FieldName: entity.PrimaryKey.Name, Value: routeSegment }];
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
const parts = segment ? routeSegment.split(segment) : routeSegment.split('||');
|
|
194
|
-
const pkVals = [];
|
|
195
|
-
for (let p of parts) {
|
|
196
|
-
const kv = p.split('|');
|
|
197
|
-
pkVals.push({ FieldName: kv[0], Value: kv[1] });
|
|
198
|
-
}
|
|
199
|
-
this.KeyValuePairs = pkVals;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Helper method to check if the underlying key value pairs are valid or not
|
|
204
|
-
* i.e. if any of the key value pairs are null or undefined
|
|
205
|
-
* @returns true if all key value pairs are valid, false if any are null or undefined
|
|
206
|
-
*/
|
|
207
|
-
Validate() {
|
|
208
|
-
for (let j = 0; j < this.KeyValuePairs.length; j++) {
|
|
209
|
-
if (!this.KeyValuePairs[j] || !this.KeyValuePairs[j].Value) {
|
|
210
|
-
return { IsValid: false, ErrorMessage: 'CompositeKey.Validate: KeyValuePair cannot contain null values. FieldName: ' + this.KeyValuePairs[j]?.FieldName };
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
return { IsValid: true, ErrorMessage: '' };
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
exports.CompositeKey = CompositeKey;
|
|
217
|
-
class PotentialDuplicate extends CompositeKey {
|
|
38
|
+
class PotentialDuplicate extends compositeKey_1.CompositeKey {
|
|
218
39
|
}
|
|
219
40
|
exports.PotentialDuplicate = PotentialDuplicate;
|
|
220
41
|
class PotentialDuplicateRequest {
|
|
@@ -227,13 +48,42 @@ exports.PotentialDuplicateResult = PotentialDuplicateResult;
|
|
|
227
48
|
class PotentialDuplicateResponse {
|
|
228
49
|
}
|
|
229
50
|
exports.PotentialDuplicateResponse = PotentialDuplicateResponse;
|
|
51
|
+
/**
|
|
52
|
+
* Save options used when saving an entity record
|
|
53
|
+
*/
|
|
230
54
|
class EntitySaveOptions {
|
|
231
55
|
constructor() {
|
|
56
|
+
/**
|
|
57
|
+
* If set to true, the record will be saved to the database even if nothing is detected to be "dirty" or changed since the prior load.
|
|
58
|
+
*/
|
|
232
59
|
this.IgnoreDirtyState = false;
|
|
60
|
+
/**
|
|
61
|
+
* If set to true, an AI actions associated with the entity will be skipped during the save operation
|
|
62
|
+
*/
|
|
233
63
|
this.SkipEntityAIActions = false;
|
|
64
|
+
/**
|
|
65
|
+
* If set to true, any Entity Actions associated with invocation types of Create or Update will be skipped during the save operation
|
|
66
|
+
*/
|
|
67
|
+
this.SkipEntityActions = false;
|
|
234
68
|
}
|
|
235
69
|
}
|
|
236
70
|
exports.EntitySaveOptions = EntitySaveOptions;
|
|
71
|
+
/**
|
|
72
|
+
* Options used when deleting an entity record
|
|
73
|
+
*/
|
|
74
|
+
class EntityDeleteOptions {
|
|
75
|
+
constructor() {
|
|
76
|
+
/**
|
|
77
|
+
* If set to true, an AI actions associated with the entity will be skipped during the delete operation
|
|
78
|
+
*/
|
|
79
|
+
this.SkipEntityAIActions = false;
|
|
80
|
+
/**
|
|
81
|
+
* If set to true, any Entity Actions associated with invocation types of Delete will be skipped during the delete operation
|
|
82
|
+
*/
|
|
83
|
+
this.SkipEntityActions = false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.EntityDeleteOptions = EntityDeleteOptions;
|
|
237
87
|
class EntityRecordNameInput {
|
|
238
88
|
}
|
|
239
89
|
exports.EntityRecordNameInput = EntityRecordNameInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/generic/interfaces.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/generic/interfaces.ts"],"names":[],"mappings":";;;AAUA,iDAA8C;AAE9C,MAAa,sBAAsB;IAK/B,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IACD,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IACD,IAAW,gBAAgB;QACvB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IACD,IAAW,cAAc;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IACD,YAAY,IAAS,EAAE,kBAA0B,MAAM,EAAE,cAAyB,EAAE,cAAyB;QAhBrG,oBAAe,GAAa,EAAE,CAAC;QAC/B,oBAAe,GAAa,EAAE,CAAC;QAC/B,sBAAiB,GAAW,MAAM,CAAC;QAevC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,iBAAiB,GAAG,eAAe,CAAC;QACzC,IAAI,cAAc;YACd,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;QAC1C,IAAI,cAAc;YACd,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IAC9C,CAAC;CACJ;AAzBD,wDAyBC;AAED,MAAa,YAAY;CAIxB;AAJD,oCAIC;AAEY,QAAA,YAAY,GAAG;IACxB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;CACZ,CAAC;AAKX,MAAa,kBAAmB,SAAQ,2BAAY;CAEnD;AAFD,gDAEC;AAED,MAAa,yBAAyB;CA2BrC;AA3BD,8DA2BC;AAED,MAAa,wBAAwB;CAKpC;AALD,4DAKC;AAED,uFAAuF;AACvF,MAAa,0BAA0B;CAItC;AAJD,gEAIC;AAcD;;GAEG;AACH,MAAa,iBAAiB;IAA9B;QACI;;WAEG;QACH,qBAAgB,GAAY,KAAK,CAAC;QAClC;;WAEG;QACH,wBAAmB,GAAa,KAAK,CAAC;QACtC;;WAEG;QACH,sBAAiB,GAAa,KAAK,CAAC;IACxC,CAAC;CAAA;AAbD,8CAaC;AAED;;GAEG;AACH,MAAa,mBAAmB;IAAhC;QACI;;WAEG;QACH,wBAAmB,GAAa,KAAK,CAAC;QAEtC;;WAEG;QACH,sBAAiB,GAAa,KAAK,CAAC;IACxC,CAAC;CAAA;AAVD,kDAUC;AAED,MAAa,qBAAqB;CAGjC;AAHD,sDAGC;AAED,MAAa,sBAAsB;CAMjC;AANF,wDAME"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { BaseInfo } from "./baseInfo";
|
|
2
|
+
/**
|
|
3
|
+
* Metadata about a single library that's available for code generation or other purposes.
|
|
4
|
+
*/
|
|
5
|
+
export declare class LibraryInfo extends BaseInfo {
|
|
6
|
+
/**
|
|
7
|
+
* Name of the library - used for import statements and within package.json
|
|
8
|
+
*/
|
|
9
|
+
Name: string;
|
|
10
|
+
/**
|
|
11
|
+
* User readable/AI readable description of the library
|
|
12
|
+
*/
|
|
13
|
+
Description: string;
|
|
14
|
+
/**
|
|
15
|
+
* Only Active libraries are used for new code generation but disabling a library means it won't be used for new code generation, but doesn't remove it from use from previously generated code.
|
|
16
|
+
*/
|
|
17
|
+
Status: 'Pending' | 'Active' | 'Disabled';
|
|
18
|
+
/**
|
|
19
|
+
* Comma-delimted list of items that are exported from the library such as classes, functions, types, etc.
|
|
20
|
+
*/
|
|
21
|
+
ExportedItems: string;
|
|
22
|
+
/**
|
|
23
|
+
* Code definitions for the types that are exported from the library
|
|
24
|
+
*/
|
|
25
|
+
TypeDefinitions: string;
|
|
26
|
+
/**
|
|
27
|
+
* Sample code that demonstrates how to use the library
|
|
28
|
+
*/
|
|
29
|
+
SampleCode: string;
|
|
30
|
+
CreatedAt: Date;
|
|
31
|
+
UpdatedAt: Date;
|
|
32
|
+
private _exportItemsArray;
|
|
33
|
+
/**
|
|
34
|
+
* Helper method to get the ExportedItems as an array of strings, parsing the comma delimited string in the ExportedItems property
|
|
35
|
+
*/
|
|
36
|
+
get ExportItemsArray(): string[];
|
|
37
|
+
constructor(initData?: any);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=libraryInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libraryInfo.d.ts","sourceRoot":"","sources":["../../src/generic/libraryInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC;;GAEG;AACH,qBAAa,WAAY,SAAQ,QAAQ;IACrC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAQ;IAC3B;;OAEG;IACI,WAAW,EAAE,MAAM,CAAQ;IAClC;;OAEG;IACI,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAQ;IACxD;;OAEG;IACI,aAAa,EAAE,MAAM,CAAQ;IACpC;;OAEG;IACI,eAAe,EAAE,MAAM,CAAQ;IACtC;;OAEG;IACI,UAAU,EAAE,MAAM,CAAQ;IACjC,SAAS,EAAE,IAAI,CAAO;IACtB,SAAS,EAAE,IAAI,CAAO;IAEtB,OAAO,CAAC,iBAAiB,CAAkB;IAC3C;;OAEG;IACH,IAAW,gBAAgB,IAAI,MAAM,EAAE,CAQtC;gBAEW,QAAQ,GAAE,GAAU;CAMnC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LibraryInfo = void 0;
|
|
4
|
+
const baseInfo_1 = require("./baseInfo");
|
|
5
|
+
/**
|
|
6
|
+
* Metadata about a single library that's available for code generation or other purposes.
|
|
7
|
+
*/
|
|
8
|
+
class LibraryInfo extends baseInfo_1.BaseInfo {
|
|
9
|
+
/**
|
|
10
|
+
* Helper method to get the ExportedItems as an array of strings, parsing the comma delimited string in the ExportedItems property
|
|
11
|
+
*/
|
|
12
|
+
get ExportItemsArray() {
|
|
13
|
+
if (!this._exportItemsArray && this.ExportedItems && this.ExportedItems.length > 0) {
|
|
14
|
+
this._exportItemsArray = this.ExportedItems.split(',').map(item => item.trim());
|
|
15
|
+
}
|
|
16
|
+
else
|
|
17
|
+
this._exportItemsArray = [];
|
|
18
|
+
return this._exportItemsArray;
|
|
19
|
+
}
|
|
20
|
+
constructor(initData = null) {
|
|
21
|
+
super();
|
|
22
|
+
/**
|
|
23
|
+
* Name of the library - used for import statements and within package.json
|
|
24
|
+
*/
|
|
25
|
+
this.Name = null;
|
|
26
|
+
/**
|
|
27
|
+
* User readable/AI readable description of the library
|
|
28
|
+
*/
|
|
29
|
+
this.Description = null;
|
|
30
|
+
/**
|
|
31
|
+
* Only Active libraries are used for new code generation but disabling a library means it won't be used for new code generation, but doesn't remove it from use from previously generated code.
|
|
32
|
+
*/
|
|
33
|
+
this.Status = null;
|
|
34
|
+
/**
|
|
35
|
+
* Comma-delimted list of items that are exported from the library such as classes, functions, types, etc.
|
|
36
|
+
*/
|
|
37
|
+
this.ExportedItems = null;
|
|
38
|
+
/**
|
|
39
|
+
* Code definitions for the types that are exported from the library
|
|
40
|
+
*/
|
|
41
|
+
this.TypeDefinitions = null;
|
|
42
|
+
/**
|
|
43
|
+
* Sample code that demonstrates how to use the library
|
|
44
|
+
*/
|
|
45
|
+
this.SampleCode = null;
|
|
46
|
+
this.CreatedAt = null;
|
|
47
|
+
this.UpdatedAt = null;
|
|
48
|
+
this._exportItemsArray = null;
|
|
49
|
+
if (initData) {
|
|
50
|
+
this.copyInitData(initData);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.LibraryInfo = LibraryInfo;
|
|
55
|
+
//# sourceMappingURL=libraryInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libraryInfo.js","sourceRoot":"","sources":["../../src/generic/libraryInfo.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAErC;;GAEG;AACH,MAAa,WAAY,SAAQ,mBAAQ;IA6BrC;;OAEG;IACH,IAAW,gBAAgB;QACvB,IAAI,CAAC,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjF,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACpF,CAAC;;YAEG,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;QAEhC,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IAED,YAAY,WAAgB,IAAI;QAC5B,KAAK,EAAE,CAAC;QA1CZ;;WAEG;QACI,SAAI,GAAW,IAAI,CAAC;QAC3B;;WAEG;QACI,gBAAW,GAAW,IAAI,CAAC;QAClC;;WAEG;QACI,WAAM,GAAsC,IAAI,CAAC;QACxD;;WAEG;QACI,kBAAa,GAAW,IAAI,CAAC;QACpC;;WAEG;QACI,oBAAe,GAAW,IAAI,CAAC;QACtC;;WAEG;QACI,eAAU,GAAW,IAAI,CAAC;QACjC,cAAS,GAAS,IAAI,CAAA;QACtB,cAAS,GAAS,IAAI,CAAA;QAEd,sBAAiB,GAAa,IAAI,CAAC;QAgBvC,IAAI,QAAQ,EAAE,CAAC;YACX,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;IACL,CAAC;CACJ;AAhDD,kCAgDC"}
|
|
@@ -2,4 +2,47 @@ export declare function LogError(message: any, logToFileName?: string, ...args:
|
|
|
2
2
|
export declare function LogStatus(message: any, logToFileName?: string, ...args: any[]): void;
|
|
3
3
|
export declare function GetProductionStatus(): boolean;
|
|
4
4
|
export declare function SetProductionStatus(isProduction: boolean): void;
|
|
5
|
+
export declare function FormatConsoleMessage(message: string, serverity: SeverityType): string;
|
|
6
|
+
export declare function FormatFileMessage(message: string, serverity: SeverityType): string;
|
|
7
|
+
export declare const SeverityType: {
|
|
8
|
+
readonly Trace: "Trace";
|
|
9
|
+
readonly Debug: "Debug";
|
|
10
|
+
readonly Info: "Info";
|
|
11
|
+
readonly Warning: "Warning";
|
|
12
|
+
readonly Critical: "Critical";
|
|
13
|
+
};
|
|
14
|
+
export type SeverityType = typeof SeverityType[keyof typeof SeverityType];
|
|
15
|
+
export declare const colors: {
|
|
16
|
+
reset: string;
|
|
17
|
+
bright: string;
|
|
18
|
+
dim: string;
|
|
19
|
+
underscore: string;
|
|
20
|
+
blink: string;
|
|
21
|
+
reverse: string;
|
|
22
|
+
hidden: string;
|
|
23
|
+
fg: {
|
|
24
|
+
black: string;
|
|
25
|
+
red: string;
|
|
26
|
+
green: string;
|
|
27
|
+
yellow: string;
|
|
28
|
+
blue: string;
|
|
29
|
+
magenta: string;
|
|
30
|
+
cyan: string;
|
|
31
|
+
white: string;
|
|
32
|
+
gray: string;
|
|
33
|
+
crimson: string;
|
|
34
|
+
};
|
|
35
|
+
bg: {
|
|
36
|
+
black: string;
|
|
37
|
+
red: string;
|
|
38
|
+
green: string;
|
|
39
|
+
yellow: string;
|
|
40
|
+
blue: string;
|
|
41
|
+
magenta: string;
|
|
42
|
+
cyan: string;
|
|
43
|
+
white: string;
|
|
44
|
+
gray: string;
|
|
45
|
+
crimson: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
5
48
|
//# sourceMappingURL=logging.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/generic/logging.ts"],"names":[],"mappings":"AAYA,wBAAgB,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,aAAa,GAAE,MAAa,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,QAKlF;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,aAAa,GAAE,MAAa,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,QAKnF;AAkBD,wBAAgB,mBAAmB,IAAI,OAAO,CAa7C;AAED,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,OAAO,QAExD"}
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/generic/logging.ts"],"names":[],"mappings":"AAYA,wBAAgB,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,aAAa,GAAE,MAAa,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,QAKlF;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,aAAa,GAAE,MAAa,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,QAKnF;AAkBD,wBAAgB,mBAAmB,IAAI,OAAO,CAa7C;AAED,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,OAAO,QAExD;AAUD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,GAAG,MAAM,CAarF;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,GAAG,MAAM,CAelF;AAED,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE1E,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiClB,CAAC"}
|
package/dist/generic/logging.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SetProductionStatus = exports.GetProductionStatus = exports.LogStatus = exports.LogError = void 0;
|
|
3
|
+
exports.colors = exports.SeverityType = exports.FormatFileMessage = exports.FormatConsoleMessage = exports.SetProductionStatus = exports.GetProductionStatus = exports.LogStatus = exports.LogError = void 0;
|
|
4
4
|
let fs;
|
|
5
5
|
if (runningOnNode()) {
|
|
6
6
|
try {
|
|
@@ -66,4 +66,76 @@ function runningInBrowser() {
|
|
|
66
66
|
function runningOnNode() {
|
|
67
67
|
return (typeof process !== 'undefined' && process.versions !== null && process.versions.node !== null);
|
|
68
68
|
}
|
|
69
|
+
function FormatConsoleMessage(message, serverity) {
|
|
70
|
+
switch (serverity) {
|
|
71
|
+
case 'Trace':
|
|
72
|
+
case 'Debug':
|
|
73
|
+
case 'Info':
|
|
74
|
+
return `${exports.colors.fg.white}${message}${exports.colors.reset}`;
|
|
75
|
+
case 'Warning':
|
|
76
|
+
return `${exports.colors.fg.yellow}${message}${exports.colors.reset}`;
|
|
77
|
+
case 'Critical':
|
|
78
|
+
return `${exports.colors.fg.red}${message}${exports.colors.reset}`;
|
|
79
|
+
default:
|
|
80
|
+
return message;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.FormatConsoleMessage = FormatConsoleMessage;
|
|
84
|
+
function FormatFileMessage(message, serverity) {
|
|
85
|
+
switch (serverity) {
|
|
86
|
+
case 'Trace':
|
|
87
|
+
return `[Trace] ${message}`;
|
|
88
|
+
case 'Debug':
|
|
89
|
+
return `[Debug] ${message}`;
|
|
90
|
+
case 'Info':
|
|
91
|
+
return `[Info] ${message}`;
|
|
92
|
+
case 'Warning':
|
|
93
|
+
return `[Warning] ${message}`;
|
|
94
|
+
case 'Critical':
|
|
95
|
+
return `[Critical] ${message}`;
|
|
96
|
+
default:
|
|
97
|
+
return message;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.FormatFileMessage = FormatFileMessage;
|
|
101
|
+
exports.SeverityType = {
|
|
102
|
+
Trace: 'Trace',
|
|
103
|
+
Debug: 'Debug',
|
|
104
|
+
Info: 'Info',
|
|
105
|
+
Warning: 'Warning',
|
|
106
|
+
Critical: 'Critical'
|
|
107
|
+
};
|
|
108
|
+
exports.colors = {
|
|
109
|
+
reset: "\x1b[0m",
|
|
110
|
+
bright: "\x1b[1m",
|
|
111
|
+
dim: "\x1b[2m",
|
|
112
|
+
underscore: "\x1b[4m",
|
|
113
|
+
blink: "\x1b[5m",
|
|
114
|
+
reverse: "\x1b[7m",
|
|
115
|
+
hidden: "\x1b[8m",
|
|
116
|
+
fg: {
|
|
117
|
+
black: "\x1b[30m",
|
|
118
|
+
red: "\x1b[31m",
|
|
119
|
+
green: "\x1b[32m",
|
|
120
|
+
yellow: "\x1b[33m",
|
|
121
|
+
blue: "\x1b[34m",
|
|
122
|
+
magenta: "\x1b[35m",
|
|
123
|
+
cyan: "\x1b[36m",
|
|
124
|
+
white: "\x1b[37m",
|
|
125
|
+
gray: "\x1b[90m",
|
|
126
|
+
crimson: "\x1b[38m" // Scarlet
|
|
127
|
+
},
|
|
128
|
+
bg: {
|
|
129
|
+
black: "\x1b[40m",
|
|
130
|
+
red: "\x1b[41m",
|
|
131
|
+
green: "\x1b[42m",
|
|
132
|
+
yellow: "\x1b[43m",
|
|
133
|
+
blue: "\x1b[44m",
|
|
134
|
+
magenta: "\x1b[45m",
|
|
135
|
+
cyan: "\x1b[46m",
|
|
136
|
+
white: "\x1b[47m",
|
|
137
|
+
gray: "\x1b[100m",
|
|
138
|
+
crimson: "\x1b[48m"
|
|
139
|
+
}
|
|
140
|
+
};
|
|
69
141
|
//# sourceMappingURL=logging.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/generic/logging.ts"],"names":[],"mappings":";;;AAAA,IAAI,EAAO,CAAC;AAEZ,IAAI,aAAa,EAAE,EAAE,CAAC;IAClB,IAAI,CAAC;QACD,EAAE,GAAG,IA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eC;AAEY,QAAA,YAAY,GAAG;IACxB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACd,CAAC;AAIE,QAAA,MAAM,GAAG;IAClB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,GAAG,EAAE,SAAS;IACd,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IAEjB,EAAE,EAAE;QACA,KAAK,EAAE,UAAU;QACjB,GAAG,EAAE,UAAU;QACf,KAAK,EAAE,UAAU;QACjB,MAAM,EAAE,UAAU;QAClB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,UAAU;QACnB,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,UAAU,CAAC,UAAU;KACjC;IACD,EAAE,EAAE;QACA,KAAK,EAAE,UAAU;QACjB,GAAG,EAAE,UAAU;QACf,KAAK,EAAE,UAAU;QACjB,MAAM,EAAE,UAAU;QAClB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,UAAU;QACnB,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,UAAU;KACtB;CACJ,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { DatasetItemFilterType, DatasetResultType,
|
|
1
|
+
import { DatasetItemFilterType, DatasetResultType, DatasetStatusResultType, EntityRecordNameInput, EntityRecordNameResult, ILocalStorageProvider, IMetadataProvider, PotentialDuplicateRequest, PotentialDuplicateResponse, ProviderConfigDataBase, ProviderType } from "./interfaces";
|
|
2
2
|
import { EntityDependency, EntityInfo, RecordDependency, RecordMergeRequest, RecordMergeResult } from "./entityInfo";
|
|
3
3
|
import { ApplicationInfo } from "./applicationInfo";
|
|
4
4
|
import { BaseEntity } from "./baseEntity";
|
|
5
5
|
import { AuditLogTypeInfo, AuthorizationInfo, RoleInfo, UserInfo } from "./securityInfo";
|
|
6
6
|
import { TransactionGroupBase } from "./transactionGroup";
|
|
7
7
|
import { QueryCategoryInfo, QueryFieldInfo, QueryInfo, QueryPermissionInfo } from "./queryInfo";
|
|
8
|
+
import { LibraryInfo } from "./libraryInfo";
|
|
9
|
+
import { CompositeKey } from "./compositeKey";
|
|
8
10
|
/**
|
|
9
11
|
* Class used to access a wide array of MemberJunction metadata, to instantiate derived classes of BaseEntity for record access and manipulation and more. This class uses a provider model where different providers transparently plug-in to implement the functionality needed based on where the code is running. The provider in use is generally not of any importance to users of the class and code can be written indepdenent of tier/provider.
|
|
10
12
|
*/
|
|
@@ -24,6 +26,17 @@ export declare class Metadata {
|
|
|
24
26
|
get ProviderType(): ProviderType;
|
|
25
27
|
get Applications(): ApplicationInfo[];
|
|
26
28
|
get Entities(): EntityInfo[];
|
|
29
|
+
/**
|
|
30
|
+
* Helper method to find an entity by name in a case insensitive manner.
|
|
31
|
+
* @param entityName
|
|
32
|
+
*/
|
|
33
|
+
EntityByName(entityName: string): EntityInfo;
|
|
34
|
+
/**
|
|
35
|
+
* Helper method to find an entity by ID
|
|
36
|
+
* @param entityID
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
EntityByID(entityID: number): EntityInfo;
|
|
27
40
|
get Queries(): QueryInfo[];
|
|
28
41
|
get QueryFields(): QueryFieldInfo[];
|
|
29
42
|
get QueryCategories(): QueryCategoryInfo[];
|
|
@@ -35,6 +48,7 @@ export declare class Metadata {
|
|
|
35
48
|
get Roles(): RoleInfo[];
|
|
36
49
|
get AuditLogTypes(): AuditLogTypeInfo[];
|
|
37
50
|
get Authorizations(): AuthorizationInfo[];
|
|
51
|
+
get Libraries(): LibraryInfo[];
|
|
38
52
|
/**
|
|
39
53
|
* Helper function to return an Entity Name from a given Entity ID.
|
|
40
54
|
* @param entityName
|
|
@@ -47,32 +61,37 @@ export declare class Metadata {
|
|
|
47
61
|
* @returns
|
|
48
62
|
*/
|
|
49
63
|
EntityNameFromID(entityID: number): string;
|
|
64
|
+
/**
|
|
65
|
+
* Helper function to return an EntityInfo from an Entity ID
|
|
66
|
+
* @param entityID
|
|
67
|
+
*/
|
|
68
|
+
EntityFromEntityID(entityID: number): EntityInfo | null;
|
|
50
69
|
/**
|
|
51
70
|
* Returns true if the combination of userId/entityName/KeyValuePairs has a favorite status on (meaning the user has marked the record as a "favorite" for easy access)
|
|
52
71
|
* @param userId
|
|
53
72
|
* @param entityName
|
|
54
|
-
* @param
|
|
73
|
+
* @param primaryKey
|
|
55
74
|
* @returns
|
|
56
75
|
*/
|
|
57
|
-
GetRecordFavoriteStatus(userId: number, entityName: string,
|
|
76
|
+
GetRecordFavoriteStatus(userId: number, entityName: string, primaryKey: CompositeKey): Promise<boolean>;
|
|
58
77
|
/**
|
|
59
78
|
* Sets the favorite status for a given user for a specific entityName/KeyValuePairs
|
|
60
79
|
* @param userId
|
|
61
80
|
* @param entityName
|
|
62
|
-
* @param
|
|
81
|
+
* @param primaryKey
|
|
63
82
|
* @param isFavorite
|
|
64
83
|
* @param contextUser
|
|
65
84
|
*/
|
|
66
|
-
SetRecordFavoriteStatus(userId: number, entityName: string,
|
|
85
|
+
SetRecordFavoriteStatus(userId: number, entityName: string, primaryKey: CompositeKey, isFavorite: boolean, contextUser?: UserInfo): Promise<void>;
|
|
67
86
|
/**
|
|
68
87
|
* Returns a list of dependencies - records that are linked to the specified Entity/Primary Key Value combination. A dependency is as defined by the relationships in the database. The MemberJunction metadata that is used
|
|
69
88
|
* for this simply reflects the foreign key relationships that exist in the database. The CodeGen tool is what detects all of the relationships and generates the metadata that is used by MemberJunction. The metadata in question
|
|
70
89
|
* is within the EntityField table and specifically the RelatedEntity and RelatedEntityField columns. In turn, this method uses that metadata and queries the database to determine the dependencies. To get the list of entity dependencies
|
|
71
90
|
* you can use the utility method GetEntityDependencies(), which doesn't check for dependencies on a specific record, but rather gets the metadata in one shot that can be used for dependency checking.
|
|
72
91
|
* @param entityName the name of the entity to check
|
|
73
|
-
* @param
|
|
92
|
+
* @param primaryKey the primary key value to check
|
|
74
93
|
*/
|
|
75
|
-
GetRecordDependencies(entityName: string,
|
|
94
|
+
GetRecordDependencies(entityName: string, primaryKey: CompositeKey): Promise<RecordDependency[]>;
|
|
76
95
|
/**
|
|
77
96
|
* Returns a list of record IDs that are possible duplicates of the specified record.
|
|
78
97
|
*
|
|
@@ -114,10 +133,10 @@ export declare class Metadata {
|
|
|
114
133
|
* looking for the IsNameField within the EntityFields collection for a given entity.
|
|
115
134
|
* If no IsNameField is found, but a field called "Name" exists, that value is returned. Otherwise null returned
|
|
116
135
|
* @param entityName
|
|
117
|
-
* @param
|
|
136
|
+
* @param primaryKey
|
|
118
137
|
* @returns the name of the record
|
|
119
138
|
*/
|
|
120
|
-
GetEntityRecordName(entityName: string,
|
|
139
|
+
GetEntityRecordName(entityName: string, primaryKey: CompositeKey): Promise<string>;
|
|
121
140
|
/**
|
|
122
141
|
* Returns one or more record names using the same logic as GetEntityRecordName, but for multiple records at once - more efficient to use this method if you need to get multiple record names at once
|
|
123
142
|
* @param info
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/generic/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/generic/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACvR,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE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