@furo/open-models 1.18.0 → 1.19.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/dist/index.d.ts CHANGED
@@ -29,6 +29,7 @@ export { BytesValue } from "./well_known/BytesValue.js";
29
29
  export { StringValue } from "./well_known/StringValue.js";
30
30
  export { Timestamp } from "./well_known/Timestamp.js";
31
31
  export { Struct } from "./well_known/Struct.js";
32
+ export { ListValue } from "./well_known/ListValue.js";
32
33
  export type { JSONValue } from "./well_known/Struct.js";
33
34
  export type { JSONObject } from "./well_known/Struct.js";
34
35
  export { Duration } from "./well_known/Duration.js";
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ export { BytesValue } from "./well_known/BytesValue.js";
30
30
  export { StringValue } from "./well_known/StringValue.js";
31
31
  export { Timestamp } from "./well_known/Timestamp.js";
32
32
  export { Struct } from "./well_known/Struct.js";
33
+ export { ListValue } from "./well_known/ListValue.js";
33
34
  export { Duration } from "./well_known/Duration.js";
34
35
  export { FieldMask } from "./well_known/FieldMask.js";
35
36
  // proxies
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+C,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGvD,aAAa;AACb,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,M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AAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,aAAa;AACb,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAIvG,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { FieldNode, type ValueStateSummary, type ModelEventType } from \"./FieldNode\";\nexport { Registry } from \"./Registry\";\nexport { ValueState } from \"./ValueState\";\nexport { OPEN_MODELS_OPTIONS } from \"./OPEN_MODELS_OPTIONS\";\nexport { ToString, ValueOf } from \"./CustomPrototypes\";\nexport type { FieldConstraints } from \"./FieldConstraints\";\n\n// Primitives\nexport { BOOLEAN } from \"./primitives/BOOLEAN\";\nexport { ENUM } from \"./primitives/ENUM\";\nexport { INT32 } from \"./primitives/INT32\";\nexport { INT64 } from \"./primitives/INT64\";\nexport { SINT32 } from \"./primitives/SINT32\";\nexport { SINT64 } from \"./primitives/SINT64\";\nexport { UINT32 } from \"./primitives/UINT32\";\nexport { UINT64 } from \"./primitives/UINT64\";\nexport { STRING } from \"./primitives/STRING\";\nexport { BYTES } from \"./primitives/BYTES\";\nexport { DOUBLE } from \"./primitives/DOUBLE\";\nexport { FLOAT } from \"./primitives/FLOAT\";\n\n// well known\nexport { EMPTY } from \"./well_known/EMPTY\";\nexport { ANY } from \"./well_known/ANY\";\nexport { Int32Value } from \"./well_known/Int32Value\";\nexport { Int64Value } from \"./well_known/Int64Value\";\nexport { UInt32Value } from \"./well_known/UInt32Value\";\nexport { UInt64Value } from \"./well_known/UInt64Value\";\nexport { DoubleValue } from \"./well_known/DoubleValue\";\nexport { FloatValue } from \"./well_known/FloatValue\";\nexport { BoolValue } from \"./well_known/BoolValue\";\nexport { BytesValue } from \"./well_known/BytesValue\";\nexport { StringValue } from \"./well_known/StringValue\";\nexport { Timestamp } from \"./well_known/Timestamp\";\nexport { Struct } from \"./well_known/Struct\";\n\nexport type { JSONValue } from \"./well_known/Struct\";\nexport type { JSONObject } from \"./well_known/Struct\";\nexport { Duration } from \"./well_known/Duration\";\nexport { FieldMask } from \"./well_known/FieldMask\";\n\n// proxies\nexport { ARRAY } from \"./proxies/ARRAY\";\nexport { MAP } from \"./proxies/MAP\";\nexport { RECURSION } from \"./proxies/RECURSION\";\n\n// Decorators\nexport { ServiceBindings } from \"./decorators/ServiceDecorators\";\nexport { ModelBindings } from \"./decorators/ModelDecorators\";\nexport { fieldBindings } from \"./decorators/FieldBindings\";\nexport type { BindableComponent, FieldNodeLike } from \"./decorators/FieldBindings\";\nexport { SchemaBuilder } from \"./decorators/SchemaBuilder\";\nexport { DefaultServiceEventHandlers, CreateDispatch } from \"./decorators/DefaultServiceEventHandlers\";\nexport type { EntityServiceEventType, TypedEntityService } from \"./decorators/EntityServiceTypes\";\nexport type { EntityServiceEventMap } from \"./decorators/EntityServiceTypes\";\n\nexport { StrictFetcher } from \"./StrictFetcher\";\nexport type { IApiOptions as IStrictApiOptions } from \"./StrictFetcher\";\n\nexport interface IAny {\n \"@type\": string;\n [key: string]: unknown;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+C,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ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,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAInD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,UAAU;AACV,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,aAAa;AACb,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAIvG,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { FieldNode, type ValueStateSummary, type ModelEventType } from \"./FieldNode\";\nexport { Registry } from \"./Registry\";\nexport { ValueState } from \"./ValueState\";\nexport { OPEN_MODELS_OPTIONS } from \"./OPEN_MODELS_OPTIONS\";\nexport { ToString, ValueOf } from \"./CustomPrototypes\";\nexport type { FieldConstraints } from \"./FieldConstraints\";\n\n// Primitives\nexport { BOOLEAN } from \"./primitives/BOOLEAN\";\nexport { ENUM } from \"./primitives/ENUM\";\nexport { INT32 } from \"./primitives/INT32\";\nexport { INT64 } from \"./primitives/INT64\";\nexport { SINT32 } from \"./primitives/SINT32\";\nexport { SINT64 } from \"./primitives/SINT64\";\nexport { UINT32 } from \"./primitives/UINT32\";\nexport { UINT64 } from \"./primitives/UINT64\";\nexport { STRING } from \"./primitives/STRING\";\nexport { BYTES } from \"./primitives/BYTES\";\nexport { DOUBLE } from \"./primitives/DOUBLE\";\nexport { FLOAT } from \"./primitives/FLOAT\";\n\n// well known\nexport { EMPTY } from \"./well_known/EMPTY\";\nexport { ANY } from \"./well_known/ANY\";\nexport { Int32Value } from \"./well_known/Int32Value\";\nexport { Int64Value } from \"./well_known/Int64Value\";\nexport { UInt32Value } from \"./well_known/UInt32Value\";\nexport { UInt64Value } from \"./well_known/UInt64Value\";\nexport { DoubleValue } from \"./well_known/DoubleValue\";\nexport { FloatValue } from \"./well_known/FloatValue\";\nexport { BoolValue } from \"./well_known/BoolValue\";\nexport { BytesValue } from \"./well_known/BytesValue\";\nexport { StringValue } from \"./well_known/StringValue\";\nexport { Timestamp } from \"./well_known/Timestamp\";\nexport { Struct } from \"./well_known/Struct\";\nexport { ListValue } from \"./well_known/ListValue\";\n\nexport type { JSONValue } from \"./well_known/Struct\";\nexport type { JSONObject } from \"./well_known/Struct\";\nexport { Duration } from \"./well_known/Duration\";\nexport { FieldMask } from \"./well_known/FieldMask\";\n\n// proxies\nexport { ARRAY } from \"./proxies/ARRAY\";\nexport { MAP } from \"./proxies/MAP\";\nexport { RECURSION } from \"./proxies/RECURSION\";\n\n// Decorators\nexport { ServiceBindings } from \"./decorators/ServiceDecorators\";\nexport { ModelBindings } from \"./decorators/ModelDecorators\";\nexport { fieldBindings } from \"./decorators/FieldBindings\";\nexport type { BindableComponent, FieldNodeLike } from \"./decorators/FieldBindings\";\nexport { SchemaBuilder } from \"./decorators/SchemaBuilder\";\nexport { DefaultServiceEventHandlers, CreateDispatch } from \"./decorators/DefaultServiceEventHandlers\";\nexport type { EntityServiceEventType, TypedEntityService } from \"./decorators/EntityServiceTypes\";\nexport type { EntityServiceEventMap } from \"./decorators/EntityServiceTypes\";\n\nexport { StrictFetcher } from \"./StrictFetcher\";\nexport type { IApiOptions as IStrictApiOptions } from \"./StrictFetcher\";\n\nexport interface IAny {\n \"@type\": string;\n [key: string]: unknown;\n}\n"]}
@@ -0,0 +1,23 @@
1
+ import type { FieldConstraints } from "../FieldConstraints.js";
2
+ import { FieldNode } from "../FieldNode.js";
3
+ import type { JSONValue } from "./Struct.js";
4
+ /**
5
+ * ListValue is a wrapper around a repeated field of values.
6
+ *
7
+ * The JSON representation for ListValue is JSON array.
8
+ *
9
+ * https://protobuf.dev/reference/protobuf/google.protobuf/#list-value
10
+ */
11
+ export declare class ListValue extends FieldNode {
12
+ get value(): JSONValue[];
13
+ set value(value: JSONValue[]);
14
+ _value: JSONValue[];
15
+ constructor(initData?: JSONValue[], parent?: FieldNode, parentAttributeName?: string);
16
+ __updateWithLiteral(v: JSONValue[]): void;
17
+ __mapProtoNameJsonToJson(data: string): string;
18
+ __toJson(): JSONValue[] | null;
19
+ __toLiteral(): JSONValue[];
20
+ protected __checkConstraints(fieldConstraints: FieldConstraints): string[] | undefined;
21
+ toString(): string;
22
+ __clear(withoutNotification?: boolean): void;
23
+ }
@@ -0,0 +1,84 @@
1
+ import { FieldNode } from "../FieldNode.js";
2
+ import { OPEN_MODELS_OPTIONS } from "../OPEN_MODELS_OPTIONS.js";
3
+ import { Registry } from "../Registry.js";
4
+ /**
5
+ * ListValue is a wrapper around a repeated field of values.
6
+ *
7
+ * The JSON representation for ListValue is JSON array.
8
+ *
9
+ * https://protobuf.dev/reference/protobuf/google.protobuf/#list-value
10
+ */
11
+ export class ListValue extends FieldNode {
12
+ get value() {
13
+ return this._value;
14
+ }
15
+ set value(value) {
16
+ this._value = value;
17
+ if (OPEN_MODELS_OPTIONS.EmitDefaultValues || OPEN_MODELS_OPTIONS.EmitUnpopulated) {
18
+ this.__isEmpty = false;
19
+ }
20
+ else {
21
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input)
22
+ this.__isEmpty = value === null;
23
+ }
24
+ this.__climbUpValidation();
25
+ this.__notifyFieldValueChange(true);
26
+ }
27
+ constructor(initData, parent, parentAttributeName) {
28
+ super(undefined, parent, parentAttributeName);
29
+ this._value = [];
30
+ this.__isEmpty = !(OPEN_MODELS_OPTIONS.EmitDefaultValues || OPEN_MODELS_OPTIONS.EmitUnpopulated);
31
+ this._value = initData ?? [];
32
+ this.__meta.typeName = "google.protobuf.ListValue";
33
+ }
34
+ __updateWithLiteral(v) {
35
+ this._value = v;
36
+ if (OPEN_MODELS_OPTIONS.EmitDefaultValues || OPEN_MODELS_OPTIONS.EmitUnpopulated) {
37
+ this.__isEmpty = false;
38
+ }
39
+ else {
40
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input)
41
+ this.__isEmpty = v === null;
42
+ }
43
+ this.__notifyFieldValueChange(false);
44
+ }
45
+ // eslint-disable-next-line class-methods-use-this
46
+ __mapProtoNameJsonToJson(data) {
47
+ return data;
48
+ }
49
+ __toJson() {
50
+ return this.__toLiteral();
51
+ }
52
+ __toLiteral() {
53
+ return this._value;
54
+ }
55
+ __checkConstraints(fieldConstraints) {
56
+ for (const [constraint] of Object.entries(fieldConstraints)) {
57
+ if (constraint === "required") {
58
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input)
59
+ if (this._value === null) {
60
+ return ["constraint.violation.required"];
61
+ }
62
+ }
63
+ }
64
+ return undefined;
65
+ }
66
+ toString() {
67
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input)
68
+ if (this._value !== null) {
69
+ return JSON.stringify(this._value);
70
+ }
71
+ return "";
72
+ }
73
+ __clear(withoutNotification = false) {
74
+ // only notify when they are changes
75
+ const shouldNotify = JSON.stringify(this._value) !== "[]";
76
+ this._value = [];
77
+ this.__isEmpty = !(OPEN_MODELS_OPTIONS.EmitDefaultValues || OPEN_MODELS_OPTIONS.EmitUnpopulated);
78
+ if (shouldNotify && !withoutNotification) {
79
+ this.__notifyFieldValueChange(false);
80
+ }
81
+ }
82
+ }
83
+ Registry.register("ListValue", ListValue);
84
+ //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AS,GAAG,CAAC,CAAC,mBAAmB,CAAC,iBAAiB,IAAI,mBAAmB,CAAC,eAAe,CAAC,CAAC;QACjG,IAAI,YAAY,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;CACF;AAED,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import type { FieldConstraints } from \"../FieldConstraints\";\nimport { FieldNode } from \"../FieldNode\";\nimport { OPEN_MODELS_OPTIONS } from \"../OPEN_MODELS_OPTIONS\";\nimport { Registry } from \"../Registry\";\nimport type { JSONValue } from \"./Struct\";\n\n/**\n * ListValue is a wrapper around a repeated field of values.\n *\n * The JSON representation for ListValue is JSON array.\n *\n * https://protobuf.dev/reference/protobuf/google.protobuf/#list-value\n */\nexport class ListValue extends FieldNode {\n get value(): JSONValue[] {\n return this._value;\n }\n\n set value(value: JSONValue[]) {\n this._value = value;\n if (OPEN_MODELS_OPTIONS.EmitDefaultValues || OPEN_MODELS_OPTIONS.EmitUnpopulated) {\n this.__isEmpty = false;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input)\n this.__isEmpty = value === null;\n }\n\n this.__climbUpValidation();\n this.__notifyFieldValueChange(true);\n }\n\n public _value: JSONValue[] = [];\n\n constructor(initData?: JSONValue[], parent?: FieldNode, parentAttributeName?: string) {\n super(undefined, parent, parentAttributeName);\n\n this.__isEmpty = !(OPEN_MODELS_OPTIONS.EmitDefaultValues || OPEN_MODELS_OPTIONS.EmitUnpopulated);\n\n this._value = initData ?? [];\n this.__meta.typeName = \"google.protobuf.ListValue\";\n }\n\n override __updateWithLiteral(v: JSONValue[]) {\n this._value = v;\n if (OPEN_MODELS_OPTIONS.EmitDefaultValues || OPEN_MODELS_OPTIONS.EmitUnpopulated) {\n this.__isEmpty = false;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input)\n this.__isEmpty = v === null;\n }\n this.__notifyFieldValueChange(false);\n }\n\n // eslint-disable-next-line class-methods-use-this\n override __mapProtoNameJsonToJson(data: string): string {\n return data;\n }\n\n override __toJson(): JSONValue[] | null {\n return this.__toLiteral();\n }\n\n override __toLiteral() {\n return this._value;\n }\n\n protected override __checkConstraints(fieldConstraints: FieldConstraints): string[] | undefined {\n for (const [constraint] of Object.entries(fieldConstraints)) {\n if (constraint === \"required\") {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input)\n if (this._value === null) {\n return [\"constraint.violation.required\"];\n }\n }\n }\n\n return undefined;\n }\n\n override toString(): string {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input)\n if (this._value !== null) {\n return JSON.stringify(this._value);\n }\n return \"\";\n }\n\n public override __clear(withoutNotification = false) {\n // only notify when they are changes\n const shouldNotify = JSON.stringify(this._value) !== \"[]\";\n this._value = [];\n this.__isEmpty = !(OPEN_MODELS_OPTIONS.EmitDefaultValues || OPEN_MODELS_OPTIONS.EmitUnpopulated);\n if (shouldNotify && !withoutNotification) {\n this.__notifyFieldValueChange(false);\n }\n }\n}\n\nRegistry.register(\"ListValue\", ListValue);\n"]}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "url": "git+ssh://git@github.com/eclipse/eclipsefuro-web.git"
9
9
  },
10
10
  "author": "eclipse furo",
11
- "version": "1.18.0",
11
+ "version": "1.19.0",
12
12
  "type": "module",
13
13
  "main": "dist/index.js",
14
14
  "types": "dist/index.d.ts",
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@furo/open-models",
4
- "version": "1.18.0",
4
+ "version": "1.19.0",
5
5
  "description-markup": "markdown",
6
6
  "default-icon": "icon.svg",
7
7
  "contributions": {