@epilot/entity-client 4.20.2 → 4.20.4

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/openapi.json CHANGED
@@ -222,6 +222,24 @@
222
222
  "schema": {
223
223
  "type": "number"
224
224
  }
225
+ },
226
+ {
227
+ "in": "query",
228
+ "name": "fields",
229
+ "required": false,
230
+ "style": "form",
231
+ "explode": false,
232
+ "schema": {
233
+ "type": "array",
234
+ "items": {
235
+ "type": "string"
236
+ },
237
+ "example": [
238
+ "id",
239
+ "attributes",
240
+ "capabilites"
241
+ ]
242
+ }
225
243
  }
226
244
  ],
227
245
  "responses": {
@@ -447,6 +465,60 @@
447
465
  }
448
466
  }
449
467
  },
468
+ "/v1/entity/{slug}:validate": {
469
+ "post": {
470
+ "operationId": "validateEntity",
471
+ "summary": "validateEntity",
472
+ "description": "Validates an entity against the schema.",
473
+ "tags": [
474
+ "Entities"
475
+ ],
476
+ "parameters": [
477
+ {
478
+ "$ref": "#/components/parameters/EntitySlugPathPriceParam"
479
+ }
480
+ ],
481
+ "requestBody": {
482
+ "content": {
483
+ "application/json": {
484
+ "schema": {
485
+ "$ref": "#/components/schemas/Entity"
486
+ },
487
+ "examples": {
488
+ "Valid Price": {
489
+ "$ref": "#/components/examples/PriceEntity"
490
+ },
491
+ "Invalid Price": {
492
+ "$ref": "#/components/examples/EmptyGenericEntity"
493
+ }
494
+ }
495
+ }
496
+ }
497
+ },
498
+ "responses": {
499
+ "200": {
500
+ "description": "Success",
501
+ "content": {
502
+ "application/json": {
503
+ "schema": {
504
+ "$ref": "#/components/schemas/EntityValidationResultSuccess"
505
+ }
506
+ }
507
+ }
508
+ },
509
+ "422": {
510
+ "description": "Error",
511
+ "content": {
512
+ "application/json": {
513
+ "schema": {
514
+ "$ref": "#/components/schemas/EntityValidationResultError"
515
+ }
516
+ }
517
+ }
518
+ }
519
+ }
520
+ }
521
+ },
450
522
  "/v1/entity/{slug}:upsert": {
451
523
  "patch": {
452
524
  "operationId": "upsertEntity",
@@ -1963,39 +2035,6 @@
1963
2035
  }
1964
2036
  }
1965
2037
  }
1966
- },
1967
- "/v1/clusterAssignment/{orgId}": {
1968
- "get": {
1969
- "operationId": "getElasticClusterForOrg",
1970
- "summary": "getElasticClusterForOrg",
1971
- "description": "Gets the Elastic cluster assignment by orgId.",
1972
- "tags": [
1973
- "Elastic Cluster Assignment"
1974
- ],
1975
- "parameters": [
1976
- {
1977
- "in": "path",
1978
- "name": "orgId",
1979
- "description": "The organization to fetch the cluster assigment",
1980
- "required": true,
1981
- "schema": {
1982
- "type": "string"
1983
- }
1984
- }
1985
- ],
1986
- "responses": {
1987
- "200": {
1988
- "description": "Success",
1989
- "content": {
1990
- "application/json": {
1991
- "schema": {
1992
- "$ref": "#/components/schemas/ESClusterAssignment"
1993
- }
1994
- }
1995
- }
1996
- }
1997
- }
1998
- }
1999
2038
  }
2000
2039
  },
2001
2040
  "components": {
@@ -2213,10 +2252,12 @@
2213
2252
  "example": "FF_MY_FEATURE_FLAG",
2214
2253
  "description": "This group should only be active when the feature flag is enabled"
2215
2254
  },
2216
- "setting_flag": {
2217
- "type": "string",
2218
- "example": "MY_SETTING",
2219
- "description": "This group should only be active when the setting is enabled"
2255
+ "settings_flag": {
2256
+ "type": "array",
2257
+ "description": "This group should only be active when all the settings have the correct value",
2258
+ "items": {
2259
+ "$ref": "#/components/schemas/SettingFlag"
2260
+ }
2220
2261
  },
2221
2262
  "info_tooltip_title": {
2222
2263
  "type": "object",
@@ -2546,10 +2587,12 @@
2546
2587
  "example": "FF_MY_FEATURE_FLAG",
2547
2588
  "description": "This attribute should only be active when the feature flag is enabled"
2548
2589
  },
2549
- "setting_flag": {
2550
- "type": "string",
2551
- "example": "MY_SETTING",
2552
- "description": "This attribute should only be active when the setting is enabled"
2590
+ "settings_flag": {
2591
+ "type": "array",
2592
+ "description": "This attribute should only be active when all the settings have the correct value",
2593
+ "items": {
2594
+ "$ref": "#/components/schemas/SettingFlag"
2595
+ }
2553
2596
  },
2554
2597
  "value_formatter": {
2555
2598
  "type": "string"
@@ -3135,9 +3178,12 @@
3135
3178
  "type": "string",
3136
3179
  "description": "Name of the feature flag that enables this action"
3137
3180
  },
3138
- "setting_flag": {
3139
- "type": "string",
3140
- "description": "Name of the setting flag that enables this action"
3181
+ "settings_flag": {
3182
+ "type": "array",
3183
+ "description": "This action should only be active when all the settings have the correct value",
3184
+ "items": {
3185
+ "$ref": "#/components/schemas/SettingFlag"
3186
+ }
3141
3187
  },
3142
3188
  "new_entity_item": {
3143
3189
  "type": "object",
@@ -3598,9 +3644,12 @@
3598
3644
  "type": "string",
3599
3645
  "description": "Binds summary field visibility to the feature flag state."
3600
3646
  },
3601
- "setting_flag": {
3602
- "type": "string",
3603
- "description": "Binds summary field visibility to the setting flag state."
3647
+ "settings_flag": {
3648
+ "type": "array",
3649
+ "description": "This summary attribute should only be visible when all the settings have the correct value",
3650
+ "items": {
3651
+ "$ref": "#/components/schemas/SettingFlag"
3652
+ }
3604
3653
  }
3605
3654
  },
3606
3655
  "required": [
@@ -3723,10 +3772,12 @@
3723
3772
  "example": "FF_MY_FEATURE_FLAG",
3724
3773
  "description": "This capability should only be active when the feature flag is enabled"
3725
3774
  },
3726
- "setting_flag": {
3727
- "type": "string",
3728
- "example": "MY_SETTING",
3729
- "description": "This capability should only be active when the setting is enabled"
3775
+ "settings_flag": {
3776
+ "type": "array",
3777
+ "description": "This capability should only be active when all the settings have the correct value",
3778
+ "items": {
3779
+ "$ref": "#/components/schemas/SettingFlag"
3780
+ }
3730
3781
  }
3731
3782
  },
3732
3783
  "required": [
@@ -4061,6 +4112,105 @@
4061
4112
  },
4062
4113
  "additionalProperties": true
4063
4114
  },
4115
+ "EntityItem": {
4116
+ "allOf": [
4117
+ {
4118
+ "$ref": "#/components/schemas/BaseEntity"
4119
+ },
4120
+ {
4121
+ "$ref": "#/components/schemas/Entity"
4122
+ }
4123
+ ]
4124
+ },
4125
+ "EntityValidationError": {
4126
+ "type": "object",
4127
+ "description": "Validation error for an entity attribute",
4128
+ "properties": {
4129
+ "code": {
4130
+ "type": "string",
4131
+ "description": "Error code identifier",
4132
+ "example": "custom"
4133
+ },
4134
+ "params": {
4135
+ "type": "object",
4136
+ "description": "Additional parameters for the error",
4137
+ "properties": {
4138
+ "type": {
4139
+ "type": "string",
4140
+ "description": "The type of the error",
4141
+ "example": "missing_field"
4142
+ }
4143
+ }
4144
+ },
4145
+ "path": {
4146
+ "type": "array",
4147
+ "description": "The path to the attribute that failed validation",
4148
+ "items": {
4149
+ "type": "string"
4150
+ },
4151
+ "example": [
4152
+ "first_name"
4153
+ ]
4154
+ },
4155
+ "message": {
4156
+ "type": "string",
4157
+ "description": "A human-readable message describing the error",
4158
+ "example": "Invalid input"
4159
+ }
4160
+ },
4161
+ "required": [
4162
+ "code",
4163
+ "params",
4164
+ "path",
4165
+ "message"
4166
+ ]
4167
+ },
4168
+ "EntityValidationResultSuccess": {
4169
+ "type": "object",
4170
+ "description": "Validation result for a successful validation",
4171
+ "properties": {
4172
+ "status": {
4173
+ "type": "string",
4174
+ "enum": [
4175
+ "success"
4176
+ ]
4177
+ },
4178
+ "errors": {
4179
+ "type": "array",
4180
+ "maxItems": 0,
4181
+ "items": {
4182
+ "$ref": "#/components/schemas/EntityValidationError"
4183
+ }
4184
+ }
4185
+ },
4186
+ "required": [
4187
+ "status",
4188
+ "errors"
4189
+ ]
4190
+ },
4191
+ "EntityValidationResultError": {
4192
+ "type": "object",
4193
+ "description": "Validation result for a failed validation",
4194
+ "properties": {
4195
+ "status": {
4196
+ "type": "string",
4197
+ "enum": [
4198
+ "error"
4199
+ ]
4200
+ },
4201
+ "errors": {
4202
+ "type": "array",
4203
+ "minItems": 1,
4204
+ "items": {
4205
+ "$ref": "#/components/schemas/EntityValidationError"
4206
+ }
4207
+ }
4208
+ },
4209
+ "required": [
4210
+ "status",
4211
+ "errors"
4212
+ ]
4213
+ },
4064
4214
  "HydratedEntity": {
4065
4215
  "type": "object",
4066
4216
  "description": "Entity with relation data resolved into the attribute values",
@@ -4152,6 +4302,16 @@
4152
4302
  }
4153
4303
  ]
4154
4304
  },
4305
+ "HydratedEntityItem": {
4306
+ "allOf": [
4307
+ {
4308
+ "$ref": "#/components/schemas/BaseEntity"
4309
+ },
4310
+ {
4311
+ "$ref": "#/components/schemas/HydratedEntity"
4312
+ }
4313
+ ]
4314
+ },
4155
4315
  "GetRelationsResp": {
4156
4316
  "type": "array",
4157
4317
  "items": {
@@ -4818,16 +4978,16 @@
4818
4978
  }
4819
4979
  }
4820
4980
  },
4821
- "ESClusterAssignment": {
4981
+ "SettingFlag": {
4822
4982
  "type": "object",
4823
4983
  "properties": {
4824
- "orgId": {
4984
+ "name": {
4825
4985
  "type": "string",
4826
- "description": "The organization for which the cluster assignment is returned"
4986
+ "description": "The name of the organization setting to check"
4827
4987
  },
4828
- "cluster": {
4829
- "type": "string",
4830
- "description": "Name of the elastic cluster the organization is assigned to"
4988
+ "enabled": {
4989
+ "type": "boolean",
4990
+ "description": "Whether the setting should be enabled or not"
4831
4991
  }
4832
4992
  }
4833
4993
  }
@@ -4851,6 +5011,20 @@
4851
5011
  "$ref": "#/components/schemas/EntitySlug"
4852
5012
  }
4853
5013
  },
5014
+ "EntitySlugPathPriceParam": {
5015
+ "name": "slug",
5016
+ "description": "Entity Type",
5017
+ "in": "path",
5018
+ "required": true,
5019
+ "schema": {
5020
+ "allOf": [
5021
+ {
5022
+ "$ref": "#/components/schemas/EntitySlug"
5023
+ }
5024
+ ],
5025
+ "example": "price"
5026
+ }
5027
+ },
4854
5028
  "TaxonomySlugQueryParam": {
4855
5029
  "name": "taxonomySlug",
4856
5030
  "description": "Taxonomy slug",
@@ -4927,7 +5101,7 @@
4927
5101
  },
4928
5102
  "IncludeReverseDeprecatedQueryParam": {
4929
5103
  "name": "include_reverse",
4930
- "description": "When true, includes reverse relations in response (other entities pointing to this entity) \n*It gets overriden by mode query parameter.*\n",
5104
+ "description": "When true, includes reverse relations in response (other entities pointing to this entity)\n*It gets overriden by mode query parameter.*\n",
4931
5105
  "in": "query",
4932
5106
  "deprecated": true,
4933
5107
  "schema": {
@@ -4976,7 +5150,7 @@
4976
5150
  },
4977
5151
  "EntityRelationsModeQueryParam": {
4978
5152
  "name": "mode",
4979
- "description": "Options to determine how relations will be included in the result. \n*It overrides the include_reverse query param.* \nExplanation of possible options: \n- direct: include relations to which the searched entity refers \n- reverse: include relations that refer to the entity you are looking for \n- both: both direct and reverse relations\n",
5153
+ "description": "Options to determine how relations will be included in the result.\n*It overrides the include_reverse query param.*\nExplanation of possible options:\n- direct: include relations to which the searched entity refers\n- reverse: include relations that refer to the entity you are looking for\n- both: both direct and reverse relations\n",
4980
5154
  "in": "query",
4981
5155
  "required": false,
4982
5156
  "schema": {
@@ -5000,6 +5174,10 @@
5000
5174
  }
5001
5175
  },
5002
5176
  "examples": {
5177
+ "EmptyGenericEntity": {
5178
+ "description": "Example of an empty, generic entity",
5179
+ "value": {}
5180
+ },
5003
5181
  "TaxEntity": {
5004
5182
  "description": "Example of a Tax Rate entity",
5005
5183
  "value": {
@@ -5222,6 +5400,7 @@
5222
5400
  "code": "MODEL_375KW_PREMIUM",
5223
5401
  "type": "One Time",
5224
5402
  "description": "Solar Panel 375 kWp Premium",
5403
+ "internal_description": "Solar Panel 375 kWp Premium",
5225
5404
  "billing_scheme": "per_unit",
5226
5405
  "unit_amount": "€ 28500",
5227
5406
  "tiers_mode": "Standard"
@@ -5612,6 +5791,37 @@
5612
5791
  ]
5613
5792
  }
5614
5793
  }
5794
+ },
5795
+ "EntityValidationError": {
5796
+ "description": "Example of an entity validation error",
5797
+ "value": {
5798
+ "code": "string",
5799
+ "params": {
5800
+ "type": "string"
5801
+ },
5802
+ "path": [
5803
+ "string"
5804
+ ],
5805
+ "message": "string"
5806
+ }
5807
+ },
5808
+ "EntityValidationResultSuccess": {
5809
+ "description": "Example of a successful entity validation result",
5810
+ "value": {
5811
+ "status": "success",
5812
+ "errors": []
5813
+ }
5814
+ },
5815
+ "EntityValidationResultError": {
5816
+ "description": "Example of a failed entity validation result",
5817
+ "value": {
5818
+ "status": "error",
5819
+ "errors": [
5820
+ {
5821
+ "$ref": "#/components/examples/EntityValidationError"
5822
+ }
5823
+ ]
5824
+ }
5615
5825
  }
5616
5826
  }
5617
5827
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/entity-client",
3
- "version": "4.20.2",
3
+ "version": "4.20.4",
4
4
  "description": "JavaScript client library for the epilot Core Entity API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -72,4 +72,4 @@
72
72
  "webpack-cli": "^4.4.0"
73
73
  },
74
74
  "gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7"
75
- }
75
+ }