angular-odata 0.162.0 → 0.163.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.
@@ -8147,18 +8147,25 @@ class CsdlRecord {
8147
8147
  }
8148
8148
  }
8149
8149
  class CsdlPropertyValue {
8150
- Name;
8150
+ Property;
8151
+ Bool;
8151
8152
  String;
8152
8153
  Date;
8153
8154
  EnumMember;
8154
- constructor({ Name, String, Date, EnumMember, }) {
8155
- this.Name = Name;
8155
+ TextContent;
8156
+ constructor({ Property, Bool, String, Date, EnumMember, TextContent, }) {
8157
+ this.Property = Property;
8158
+ this.Bool = Bool;
8156
8159
  this.String = String;
8157
8160
  this.Date = Date;
8158
8161
  this.EnumMember = EnumMember?.map((a) => new CsdlEnumMember(a));
8162
+ this.TextContent = TextContent;
8159
8163
  }
8160
8164
  toJson() {
8161
- const json = { Name: this.Name };
8165
+ const json = { Property: this.Property };
8166
+ if (this.Bool !== undefined) {
8167
+ json['Bool'] = this.Bool;
8168
+ }
8162
8169
  if (this.String !== undefined) {
8163
8170
  json['String'] = this.String;
8164
8171
  }
@@ -8168,10 +8175,16 @@ class CsdlPropertyValue {
8168
8175
  if (Array.isArray(this.EnumMember) && this.EnumMember.length > 0) {
8169
8176
  json['EnumMember'] = this.EnumMember.map((m) => m.toJson());
8170
8177
  }
8178
+ if (this.TextContent !== undefined) {
8179
+ json['TextContent'] = this.TextContent;
8180
+ }
8171
8181
  return json;
8172
8182
  }
8173
8183
  toConfig() {
8174
- const config = { name: this.Name };
8184
+ const config = { property: this.Property };
8185
+ if (this.Bool !== undefined) {
8186
+ config['bool'] = this.Bool;
8187
+ }
8175
8188
  if (this.String !== undefined) {
8176
8189
  config['string'] = this.String;
8177
8190
  }
@@ -8181,6 +8194,9 @@ class CsdlPropertyValue {
8181
8194
  if (Array.isArray(this.EnumMember) && this.EnumMember.length > 0) {
8182
8195
  config['enumMembers'] = this.EnumMember.map((m) => m.toConfig());
8183
8196
  }
8197
+ if (this.TextContent !== undefined) {
8198
+ config['textContent'] = this.TextContent;
8199
+ }
8184
8200
  return config;
8185
8201
  }
8186
8202
  }
@@ -8401,10 +8417,8 @@ class CsdlEnumType extends CsdlAnnotable {
8401
8417
  return {
8402
8418
  ...super.toConfig(),
8403
8419
  name: this.Name,
8404
- fields: this.Member.reduce((acc, m) => ({
8405
- ...acc,
8406
- [m.Name]: m.toConfig(),
8407
- }), {}),
8420
+ fields: this.Member.reduce((acc, m) => ({ ...acc, [m.Name]: m.toConfig(), }), {}),
8421
+ members: this.Member.reduce((acc, m) => ({ ...acc, [m.Name]: m.Value, [m.Value]: m.Name }), {}),
8408
8422
  flags: this.IsFlags,
8409
8423
  };
8410
8424
  }
@@ -8425,11 +8439,11 @@ class CsdlMember extends CsdlAnnotable {
8425
8439
  return json;
8426
8440
  }
8427
8441
  toConfig(base) {
8428
- const config = {
8442
+ return {
8429
8443
  ...super.toConfig(),
8444
+ name: this.Name,
8430
8445
  value: this.Value,
8431
8446
  };
8432
- return config;
8433
8447
  }
8434
8448
  }
8435
8449
 
@@ -8446,12 +8460,15 @@ class CsdlStructuralProperty extends CsdlAnnotable {
8446
8460
  this.Type = this.Collection ? Type.substring(11, Type.length - 1) : Type;
8447
8461
  }
8448
8462
  toJson() {
8449
- return {
8463
+ const json = {
8450
8464
  ...super.toJson(),
8451
8465
  Name: this.Name,
8452
- Type: this.Collection ? `Collection(${this.Type})` : this.Type,
8453
- Nullable: this.Nullable,
8466
+ Type: this.Collection ? `Collection(${this.Type})` : this.Type
8454
8467
  };
8468
+ if (this.Nullable !== undefined) {
8469
+ json['Nullable'] = this.Nullable;
8470
+ }
8471
+ return json;
8455
8472
  }
8456
8473
  }
8457
8474
  class CsdlProperty extends CsdlStructuralProperty {
@@ -8794,7 +8811,7 @@ class CsdlFunction extends CsdlCallable {
8794
8811
  entitySetPath: this.EntitySetPath,
8795
8812
  bound: this.IsBound,
8796
8813
  composable: this.IsComposable,
8797
- parameters: this.Parameter?.map((p) => p.toConfig()),
8814
+ parameters: this.Parameter?.reduce((acc, p) => ({ ...acc, [p.Name]: p.toConfig() }), {}),
8798
8815
  return: this.ReturnType?.toConfig(),
8799
8816
  };
8800
8817
  }
@@ -8813,7 +8830,7 @@ class CsdlAction extends CsdlCallable {
8813
8830
  name: this.Name,
8814
8831
  entitySetPath: this.EntitySetPath,
8815
8832
  bound: this.IsBound,
8816
- parameters: this.Parameter?.map((p) => p.toConfig()),
8833
+ parameters: this.Parameter?.reduce((acc, p) => ({ ...acc, [p.Name]: p.toConfig() }), {}),
8817
8834
  return: this.ReturnType?.toConfig(),
8818
8835
  };
8819
8836
  }
@@ -8880,24 +8897,51 @@ class CsdlParameter extends CsdlAnnotable {
8880
8897
  this.SRID = SRID;
8881
8898
  }
8882
8899
  toJson() {
8883
- return {
8900
+ const json = {
8884
8901
  ...super.toJson(),
8885
8902
  Name: this.Name,
8886
- Type: this.Collection ? `Collection(${this.Type})` : this.Type,
8887
- Nullable: this.Nullable,
8888
- MaxLength: this.MaxLength,
8889
- Precision: this.Precision,
8890
- Scale: this.Scale,
8891
- SRID: this.SRID,
8903
+ Type: this.Collection ? `Collection(${this.Type})` : this.Type
8892
8904
  };
8905
+ if (this.Nullable !== undefined) {
8906
+ json['Nullable'] = this.Nullable;
8907
+ }
8908
+ if (this.MaxLength !== undefined) {
8909
+ json['MaxLength'] = this.MaxLength;
8910
+ }
8911
+ if (this.Precision !== undefined) {
8912
+ json['Precision'] = this.Precision;
8913
+ }
8914
+ if (this.Scale !== undefined) {
8915
+ json['Scale'] = this.Scale;
8916
+ }
8917
+ if (this.SRID !== undefined) {
8918
+ json['SRID'] = this.SRID;
8919
+ }
8920
+ return json;
8893
8921
  }
8894
8922
  toConfig() {
8895
- return {
8923
+ const config = {
8896
8924
  ...super.toConfig(),
8925
+ name: this.Name,
8897
8926
  type: this.Type,
8898
- nullable: this.Nullable,
8899
- collection: false,
8927
+ collection: this.Collection,
8900
8928
  };
8929
+ if (this.Nullable !== undefined) {
8930
+ config.nullable = this.Nullable;
8931
+ }
8932
+ if (this.MaxLength !== undefined) {
8933
+ config.maxLength = this.MaxLength;
8934
+ }
8935
+ if (this.Precision !== undefined) {
8936
+ config.precision = this.Precision;
8937
+ }
8938
+ if (this.Scale !== undefined) {
8939
+ config.scale = this.Scale;
8940
+ }
8941
+ if (this.SRID !== undefined) {
8942
+ config.srid = this.SRID;
8943
+ }
8944
+ return config;
8901
8945
  }
8902
8946
  }
8903
8947
  class CsdlReturnType {
@@ -8918,20 +8962,47 @@ class CsdlReturnType {
8918
8962
  this.SRID = SRID;
8919
8963
  }
8920
8964
  toJson() {
8921
- return {
8922
- Type: this.Collection ? `Collection(${this.Type})` : this.Type,
8923
- Nullable: this.Nullable,
8924
- MaxLength: this.MaxLength,
8925
- Precision: this.Precision,
8926
- Scale: this.Scale,
8927
- SRID: this.SRID,
8965
+ const json = {
8966
+ Type: this.Collection ? `Collection(${this.Type})` : this.Type
8928
8967
  };
8968
+ if (this.Nullable !== undefined) {
8969
+ json['Nullable'] = this.Nullable;
8970
+ }
8971
+ if (this.MaxLength !== undefined) {
8972
+ json['MaxLength'] = this.MaxLength;
8973
+ }
8974
+ if (this.Precision !== undefined) {
8975
+ json['Precision'] = this.Precision;
8976
+ }
8977
+ if (this.Scale !== undefined) {
8978
+ json['Scale'] = this.Scale;
8979
+ }
8980
+ if (this.SRID !== undefined) {
8981
+ json['SRID'] = this.SRID;
8982
+ }
8983
+ return json;
8929
8984
  }
8930
8985
  toConfig() {
8931
- return {
8986
+ const config = {
8932
8987
  type: this.Type,
8933
- collection: false,
8988
+ collection: this.Collection
8934
8989
  };
8990
+ if (this.Nullable !== undefined) {
8991
+ config.nullable = this.Nullable;
8992
+ }
8993
+ if (this.MaxLength !== undefined) {
8994
+ config.maxLength = this.MaxLength;
8995
+ }
8996
+ if (this.Precision !== undefined) {
8997
+ config.precision = this.Precision;
8998
+ }
8999
+ if (this.Scale !== undefined) {
9000
+ config.scale = this.Scale;
9001
+ }
9002
+ if (this.SRID !== undefined) {
9003
+ config.srid = this.SRID;
9004
+ }
9005
+ return config;
8935
9006
  }
8936
9007
  }
8937
9008
 
@@ -9459,8 +9530,6 @@ class ODataMetadataParser {
9459
9530
  case ODataMetadataParser.ATTRIBUTE_TERM:
9460
9531
  case ODataMetadataParser.ATTRIBUTE_QUALIFIER:
9461
9532
  case ODataMetadataParser.ATTRIBUTE_STRING:
9462
- case ODataMetadataParser.ATTRIBUTE_BOOL:
9463
- case ODataMetadataParser.ATTRIBUTE_INT:
9464
9533
  case ODataMetadataParser.ATTRIBUTE_TARGET_NAMESPACE:
9465
9534
  case ODataMetadataParser.ATTRIBUTE_NAME:
9466
9535
  case ODataMetadataParser.ATTRIBUTE_TYPE:
@@ -9482,6 +9551,7 @@ class ODataMetadataParser {
9482
9551
  case ODataMetadataParser.ATTRIBUTE_BASE_TERM:
9483
9552
  case ODataMetadataParser.ATTRIBUTE_APPLIES_TO:
9484
9553
  return this.getAttributeValue(attributes, field.name);
9554
+ case ODataMetadataParser.ATTRIBUTE_BOOL:
9485
9555
  case ODataMetadataParser.ATTRIBUTE_NULLABLE:
9486
9556
  case ODataMetadataParser.ATTRIBUTE_UNICODE:
9487
9557
  case ODataMetadataParser.ATTRIBUTE_OPEN_TYPE:
@@ -9493,6 +9563,7 @@ class ODataMetadataParser {
9493
9563
  case ODataMetadataParser.ATTRIBUTE_ABSTRACT:
9494
9564
  case ODataMetadataParser.ATTRIBUTE_IS_FLAGS:
9495
9565
  return this.propertyValueToBoolean(this.getAttributeValue(attributes, field.name));
9566
+ case ODataMetadataParser.ATTRIBUTE_INT:
9496
9567
  case ODataMetadataParser.ATTRIBUTE_VALUE:
9497
9568
  case ODataMetadataParser.ATTRIBUTE_MAX_LENGTH:
9498
9569
  case ODataMetadataParser.ATTRIBUTE_PRECISION: