@furo/open-models 1.2.3 → 1.5.0
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/custom-elements.json +469 -441
- package/dist/Fetcher.d.ts +2 -2
- package/dist/Fetcher.js +109 -99
- package/dist/Fetcher.js.map +1 -1
- package/dist/proxies/ARRAY.d.ts +9 -1
- package/dist/proxies/ARRAY.js +26 -1
- package/dist/proxies/ARRAY.js.map +1 -1
- package/dist/well_known/Struct.d.ts +20 -7
- package/dist/well_known/Struct.js +11 -4
- package/dist/well_known/Struct.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
import { FieldNode } from '../FieldNode.js';
|
|
2
2
|
import { FieldConstraints } from '../FieldConstraints.js';
|
|
3
|
+
export type JSONValue = string | number | boolean | null | {
|
|
4
|
+
[x: string]: JSONValue;
|
|
5
|
+
} | Array<JSONValue>;
|
|
6
|
+
export type JSONObject = {
|
|
7
|
+
[x: string]: JSONValue;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Struct represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, Struct might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language.
|
|
11
|
+
*
|
|
12
|
+
* The JSON representation for Struct is JSON object.
|
|
13
|
+
*
|
|
14
|
+
* https://protobuf.dev/reference/protobuf/google.protobuf/#struct
|
|
15
|
+
*/
|
|
3
16
|
export declare class Struct extends FieldNode {
|
|
4
|
-
get value():
|
|
5
|
-
set value(value:
|
|
6
|
-
_value:
|
|
7
|
-
constructor(initData?:
|
|
8
|
-
__updateWithLiteral(v:
|
|
17
|
+
get value(): JSONObject;
|
|
18
|
+
set value(value: JSONObject);
|
|
19
|
+
_value: JSONObject;
|
|
20
|
+
constructor(initData?: JSONObject, parent?: FieldNode, parentAttributeName?: string);
|
|
21
|
+
__updateWithLiteral(v: JSONObject): void;
|
|
9
22
|
__mapProtoNameJsonToJson(data: string): string;
|
|
10
|
-
__toJson():
|
|
11
|
-
__toLiteral():
|
|
23
|
+
__toJson(): JSONObject | null;
|
|
24
|
+
__toLiteral(): JSONObject;
|
|
12
25
|
protected __checkConstraints(fieldConstraints: FieldConstraints): string[] | undefined;
|
|
13
26
|
toString(): string;
|
|
14
27
|
__clear(): void;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { FieldNode } from '../FieldNode.js';
|
|
2
2
|
import { Registry } from '../Registry.js';
|
|
3
3
|
import { OPEN_MODELS_OPTIONS } from '../OPEN_MODELS_OPTIONS.js';
|
|
4
|
+
/**
|
|
5
|
+
* Struct represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, Struct might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language.
|
|
6
|
+
*
|
|
7
|
+
* The JSON representation for Struct is JSON object.
|
|
8
|
+
*
|
|
9
|
+
* https://protobuf.dev/reference/protobuf/google.protobuf/#struct
|
|
10
|
+
*/
|
|
4
11
|
export class Struct extends FieldNode {
|
|
5
12
|
get value() {
|
|
6
13
|
return this._value;
|
|
@@ -19,10 +26,10 @@ export class Struct extends FieldNode {
|
|
|
19
26
|
}
|
|
20
27
|
constructor(initData, parent, parentAttributeName) {
|
|
21
28
|
super(undefined, parent, parentAttributeName);
|
|
22
|
-
this._value =
|
|
29
|
+
this._value = {};
|
|
23
30
|
this.__isEmpty = !(OPEN_MODELS_OPTIONS.EmitDefaultValues ||
|
|
24
31
|
OPEN_MODELS_OPTIONS.EmitUnpopulated);
|
|
25
|
-
this._value = initData ||
|
|
32
|
+
this._value = initData || {};
|
|
26
33
|
this.__meta.typeName = 'google.protobuf.Struct';
|
|
27
34
|
}
|
|
28
35
|
__updateWithLiteral(v) {
|
|
@@ -59,12 +66,12 @@ export class Struct extends FieldNode {
|
|
|
59
66
|
}
|
|
60
67
|
toString() {
|
|
61
68
|
if (this._value !== null) {
|
|
62
|
-
return this._value;
|
|
69
|
+
return JSON.stringify(this._value);
|
|
63
70
|
}
|
|
64
71
|
return '';
|
|
65
72
|
}
|
|
66
73
|
__clear() {
|
|
67
|
-
this._value =
|
|
74
|
+
this._value = {};
|
|
68
75
|
this.__isEmpty = !(OPEN_MODELS_OPTIONS.EmitDefaultValues ||
|
|
69
76
|
OPEN_MODELS_OPTIONS.EmitUnpopulated);
|
|
70
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Struct.js","sourceRoot":"","sources":["../../src/well_known/Struct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"Struct.js","sourceRoot":"","sources":["../../src/well_known/Struct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAY5D;;;;;;GAMG;AACH,MAAM,OAAO,MAAO,SAAQ,SAAS;IACnC,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,IAAI,KAAK,CAAC,KAAiB;QACzB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;QACnB,IACE,mBAAmB,CAAC,iBAAiB;YACrC,mBAAmB,CAAC,eAAe,EACnC,CAAC;YACD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;QACxB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,SAAS,GAAG,KAAK,KAAK,IAAI,CAAA;QACjC,CAAC;QAED,IAAI,CAAC,mBAAmB,EAAE,CAAA;QAC1B,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC;IAID,YACE,QAAqB,EACrB,MAAkB,EAClB,mBAA4B;QAE5B,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB,CAAC,CAAA;QAPxC,WAAM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,CAAC,MAAM,CAAC,CAAA;QACpC,CAAC;QACD,OAAO,EAAE,CAAA;IACX,CAAC;IAED,OAAO;QACL,IAAI,CAAC,MAAM,GAAG,EAAE,CAAA;QAChB,IAAI,CAAC,SAAS,GAAG,CAAC,CAChB,mBAAmB,CAAC,iBAAiB;YACrC,mBAAmB,CAAC,eAAe,CACpC,CAAA;IACH,CAAC;CACF;AAED,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA","sourcesContent":["import { FieldNode } from '../FieldNode'\nimport { Registry } from '../Registry'\nimport { FieldConstraints } from '../FieldConstraints'\nimport { OPEN_MODELS_OPTIONS } from '../OPEN_MODELS_OPTIONS'\n\nexport type JSONValue =\n | string\n | number\n | boolean\n | null\n | { [x: string]: JSONValue }\n | Array<JSONValue>;\n\nexport type JSONObject = { [x: string]: JSONValue };\n\n/**\n * Struct represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, Struct might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language.\n *\n * The JSON representation for Struct is JSON object.\n *\n * https://protobuf.dev/reference/protobuf/google.protobuf/#struct\n */\nexport class Struct extends FieldNode {\n get value(): JSONObject {\n return this._value\n }\n\n set value(value: JSONObject) {\n this._value = value\n if (\n OPEN_MODELS_OPTIONS.EmitDefaultValues ||\n OPEN_MODELS_OPTIONS.EmitUnpopulated\n ) {\n this.__isEmpty = false\n } else {\n this.__isEmpty = value === null\n }\n\n this.__climbUpValidation()\n this.__notifyFieldValueChange(true)\n }\n\n public _value: JSONObject = {}\n\n constructor(\n initData?: JSONObject,\n parent?: FieldNode,\n parentAttributeName?: string,\n ) {\n super(undefined, parent, parentAttributeName)\n\n this.__isEmpty = !(\n OPEN_MODELS_OPTIONS.EmitDefaultValues ||\n OPEN_MODELS_OPTIONS.EmitUnpopulated\n )\n\n this._value = initData || {}\n this.__meta.typeName = 'google.protobuf.Struct'\n }\n\n __updateWithLiteral(v: JSONObject) {\n this._value = v\n if (\n OPEN_MODELS_OPTIONS.EmitDefaultValues ||\n OPEN_MODELS_OPTIONS.EmitUnpopulated\n ) {\n this.__isEmpty = false\n } else {\n this.__isEmpty = v === null\n }\n this.__notifyFieldValueChange(false)\n }\n\n // eslint-disable-next-line class-methods-use-this\n __mapProtoNameJsonToJson(data: string): string {\n return data\n }\n\n __toJson(): JSONObject | null {\n return this.__toLiteral()\n }\n\n __toLiteral() {\n return this._value\n }\n\n protected __checkConstraints(\n fieldConstraints: FieldConstraints,\n ): string[] | undefined {\n // eslint-disable-next-line guard-for-in\n for (const [constraint] of Object.entries(fieldConstraints)) {\n if (constraint === 'required') {\n if (this._value === null) {\n return ['constraint.violation.required']\n }\n }\n }\n\n return undefined\n }\n\n toString(): string {\n if (this._value !== null) {\n return JSON.stringify(this._value)\n }\n return ''\n }\n\n __clear() {\n this._value = {}\n this.__isEmpty = !(\n OPEN_MODELS_OPTIONS.EmitDefaultValues ||\n OPEN_MODELS_OPTIONS.EmitUnpopulated\n )\n }\n}\n\nRegistry.register('Struct', Struct)\n"]}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"homepage": "https://github.com/eclipse/eclipsefuro-web/tree/main/packages",
|
|
6
6
|
"repository": "git@github.com:eclipse/eclipsefuro-web.git",
|
|
7
7
|
"author": "eclipse furo",
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.5.0",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"module": "dist/index.js",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"prettier --write"
|
|
82
82
|
]
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "a1f7e99082b272cbccbc0f3c3368c103c89b3cc3"
|
|
85
85
|
}
|