@epilot/pricing-client 3.57.0 → 3.59.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/openapi.d.ts CHANGED
@@ -3948,6 +3948,21 @@ declare namespace Components {
3948
3948
  */
3949
3949
  CompositePrice;
3950
3950
  }
3951
+ /**
3952
+ * Echo of the request parameters used to compute the price, in the caller-facing shape.
3953
+ */
3954
+ export interface ComputePriceInputs {
3955
+ [name: string]: any;
3956
+ type?: ProductCategory;
3957
+ consumptionHT?: number;
3958
+ consumptionNT?: number;
3959
+ consumptionType?: ConsumptionTypeGetAg;
3960
+ zipCode?: string;
3961
+ city?: string;
3962
+ providerId?: string;
3963
+ billingPeriod?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time";
3964
+ referenceDate?: string; // date
3965
+ }
3951
3966
  /**
3952
3967
  * The compute price payload
3953
3968
  */
@@ -3985,6 +4000,12 @@ declare namespace Components {
3985
4000
  * The optional reference date for the price computation (ISO 8601 format)
3986
4001
  */
3987
4002
  reference_date?: string; // date
4003
+ /**
4004
+ * The city the postal code belongs to. Not used for price computation,
4005
+ * only echoed back in `inputs` for display purposes.
4006
+ *
4007
+ */
4008
+ city?: string;
3988
4009
  }
3989
4010
  /**
3990
4011
  * The compute price payload for gas
@@ -4022,6 +4043,12 @@ declare namespace Components {
4022
4043
  * The optional reference date for the price computation (ISO 8601 format)
4023
4044
  */
4024
4045
  reference_date?: string; // date
4046
+ /**
4047
+ * The city the postal code belongs to. Not used for price computation,
4048
+ * only echoed back in `inputs` for display purposes.
4049
+ *
4050
+ */
4051
+ city?: string;
4025
4052
  /**
4026
4053
  * The type of energy to compute the price
4027
4054
  */
@@ -4064,6 +4091,12 @@ declare namespace Components {
4064
4091
  * The optional reference date for the price computation (ISO 8601 format)
4065
4092
  */
4066
4093
  reference_date?: string; // date
4094
+ /**
4095
+ * The city the postal code belongs to. Not used for price computation,
4096
+ * only echoed back in `inputs` for display purposes.
4097
+ *
4098
+ */
4099
+ city?: string;
4067
4100
  /**
4068
4101
  * The type of energy to compute the price
4069
4102
  */
@@ -4135,6 +4168,23 @@ declare namespace Components {
4135
4168
  */
4136
4169
  billing_period: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time";
4137
4170
  breakdown: /* Price breakdown */ ComputedPriceBreakdown;
4171
+ /**
4172
+ * A snapshot of the parameters this price was computed from, for display purposes
4173
+ * (e.g. showing "computed for 3,500 kWh/year"). Included in the `_meta` signature.
4174
+ *
4175
+ */
4176
+ inputs?: {
4177
+ [name: string]: any;
4178
+ type?: ProductCategory;
4179
+ consumptionHT?: number;
4180
+ consumptionNT?: number;
4181
+ consumptionType?: ConsumptionTypeGetAg;
4182
+ zipCode?: string;
4183
+ city?: string;
4184
+ providerId?: string;
4185
+ billingPeriod?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time";
4186
+ referenceDate?: string; // date
4187
+ };
4138
4188
  _meta?: /* Signature meta data payload */ SignatureMeta;
4139
4189
  }
4140
4190
  /**
@@ -5406,10 +5456,24 @@ declare namespace Components {
5406
5456
  */
5407
5457
  billing_period: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time";
5408
5458
  breakdown: /* Price breakdown */ ComputedPriceBreakdown;
5409
- _meta?: /* Signature meta data payload */ SignatureMeta;
5459
+ /**
5460
+ * A snapshot of the parameters this price was computed from, for display purposes
5461
+ * (e.g. showing "computed for 3,500 kWh/year"). Included in the `_meta` signature.
5462
+ *
5463
+ */
5410
5464
  inputs?: {
5411
5465
  [name: string]: any;
5466
+ type?: ProductCategory;
5467
+ consumptionHT?: number;
5468
+ consumptionNT?: number;
5469
+ consumptionType?: ConsumptionTypeGetAg;
5470
+ zipCode?: string;
5471
+ city?: string;
5472
+ providerId?: string;
5473
+ billingPeriod?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time";
5474
+ referenceDate?: string; // date
5412
5475
  };
5476
+ _meta?: /* Signature meta data payload */ SignatureMeta;
5413
5477
  }
5414
5478
  /**
5415
5479
  * The provider entity
@@ -9752,6 +9816,179 @@ declare namespace Components {
9752
9816
  * }
9753
9817
  */
9754
9818
  ProductRecommendation[];
9819
+ /**
9820
+ * Context about what the recommendations were searched against.
9821
+ */
9822
+ source?: {
9823
+ /**
9824
+ * The first line item of the contract used as source for the recommendation.
9825
+ * Carries the amounts the customer currently pays; only present when searching by contract_id.
9826
+ *
9827
+ */
9828
+ item?: /**
9829
+ * The first line item of the contract used as source for the recommendation.
9830
+ * Carries the amounts the customer currently pays; only present when searching by contract_id.
9831
+ *
9832
+ */
9833
+ /**
9834
+ * Represents a price item
9835
+ * example:
9836
+ * {
9837
+ * "amount_subtotal": 10000,
9838
+ * "amount_total": 10600,
9839
+ * "currency": "EUR",
9840
+ * "description": "Annual internet service",
9841
+ * "price_id": "7e24ff5d-d580-4136-a32f-19191eed039a",
9842
+ * "product_id": "6241487f-b7fd-428b-ab92-24ee0b37fd84",
9843
+ * "taxes": [
9844
+ * {
9845
+ * "amount": 600,
9846
+ * "tax": {
9847
+ * "active": true,
9848
+ * "description": "Without Behaviour",
9849
+ * "rate": 6,
9850
+ * "region": "DE",
9851
+ * "type": "VAT",
9852
+ * "_created_at": "2022-02-07T14:49:08.831Z",
9853
+ * "_id": "18bbbc2e-2c37-4f91-924a-07ae60d830e4",
9854
+ * "_org": "739224",
9855
+ * "_schema": "tax",
9856
+ * "_title": "Tax Without Behaviour",
9857
+ * "_updated_at": "2022-02-07T14:49:08.831Z"
9858
+ * }
9859
+ * },
9860
+ * {
9861
+ * "amount": 600,
9862
+ * "tax": {
9863
+ * "active": true,
9864
+ * "description": "Without Behaviour",
9865
+ * "rate": 6,
9866
+ * "region": "DE",
9867
+ * "type": "VAT",
9868
+ * "_created_at": "2022-02-07T14:49:08.831Z",
9869
+ * "_id": "18bbbc2e-2c37-4f91-924a-07ae60d830e4",
9870
+ * "_org": "739224",
9871
+ * "_schema": "tax",
9872
+ * "_title": "Tax Without Behaviour",
9873
+ * "_updated_at": "2022-02-07T14:49:08.831Z"
9874
+ * }
9875
+ * }
9876
+ * ],
9877
+ * "unit_amount": 10000,
9878
+ * "unit_amount_net": 10000,
9879
+ * "pricing_model": "per_unit",
9880
+ * "_price": {
9881
+ * "unit_amount": 10000,
9882
+ * "unit_amount_currency": "EUR",
9883
+ * "unit_amount_decimal": "100.00",
9884
+ * "sales_tax": "standard",
9885
+ * "is_tax_inclusive": false,
9886
+ * "price_display_in_journeys": "show_price",
9887
+ * "type": "one_time",
9888
+ * "billing_period": "weekly",
9889
+ * "billing_duration_unit": "months",
9890
+ * "notice_time_unit": "months",
9891
+ * "termination_time_unit": "months",
9892
+ * "renewal_duration_unit": "months",
9893
+ * "_schema": "price",
9894
+ * "_title": "Solar Panel Module",
9895
+ * "description": "Solar Panel Module",
9896
+ * "active": true,
9897
+ * "tax": {
9898
+ * "$relation": [
9899
+ * {
9900
+ * "entity_id": "24641e82-0690-4135-8b43-ef12a9b1c5dc"
9901
+ * },
9902
+ * {
9903
+ * "entity_id": "24641e82-0690-4135-8b43-ef12a9b1c5dc"
9904
+ * }
9905
+ * ]
9906
+ * },
9907
+ * "_id": "7e24ff5d-d580-4136-a32f-19191eed039a",
9908
+ * "_org": "728",
9909
+ * "_created_at": "2022-06-03T16:04:10.369Z",
9910
+ * "_updated_at": "2022-06-03T16:04:10.369Z",
9911
+ * "pricing_model": "per_unit"
9912
+ * },
9913
+ * "_product": {
9914
+ * "name": "Cool box",
9915
+ * "type": "product",
9916
+ * "_id": "73f857a4-0fbc-4aa6-983f-87c0d6d410a6",
9917
+ * "_title": "Cool box"
9918
+ * }
9919
+ * }
9920
+ */
9921
+ PriceItem | /**
9922
+ * Represents a composite price input to the pricing library.
9923
+ * example:
9924
+ * {
9925
+ * "amount_subtotal": 10000,
9926
+ * "amount_total": 10600,
9927
+ * "currency": "EUR",
9928
+ * "description": "Annual internet service",
9929
+ * "price_id": "7e24ff5d-d580-4136-a32f-19191eed039a",
9930
+ * "product_id": "6241487f-b7fd-428b-ab92-24ee0b37fd84",
9931
+ * "taxes": [
9932
+ * {
9933
+ * "amount": 600,
9934
+ * "tax": {
9935
+ * "active": true,
9936
+ * "description": "Without Behaviour",
9937
+ * "rate": 6,
9938
+ * "region": "DE",
9939
+ * "type": "VAT",
9940
+ * "_created_at": "2022-02-07T14:49:08.831Z",
9941
+ * "_id": "18bbbc2e-2c37-4f91-924a-07ae60d830e4",
9942
+ * "_org": "739224",
9943
+ * "_schema": "tax",
9944
+ * "_title": "Tax Without Behaviour",
9945
+ * "_updated_at": "2022-02-07T14:49:08.831Z"
9946
+ * }
9947
+ * }
9948
+ * ],
9949
+ * "unit_amount": 10000,
9950
+ * "unit_amount_net": 10000,
9951
+ * "pricing_model": "per_unit",
9952
+ * "_price": {
9953
+ * "unit_amount": 10000,
9954
+ * "unit_amount_currency": "EUR",
9955
+ * "unit_amount_decimal": "100.00",
9956
+ * "sales_tax": "standard",
9957
+ * "is_tax_inclusive": false,
9958
+ * "price_display_in_journeys": "show_price",
9959
+ * "type": "one_time",
9960
+ * "billing_period": "weekly",
9961
+ * "billing_duration_unit": "months",
9962
+ * "notice_time_unit": "months",
9963
+ * "termination_time_unit": "months",
9964
+ * "renewal_duration_unit": "months",
9965
+ * "_schema": "price",
9966
+ * "_title": "Solar Panel Module",
9967
+ * "description": "Solar Panel Module",
9968
+ * "active": true,
9969
+ * "tax": {
9970
+ * "$relation": [
9971
+ * {
9972
+ * "entity_id": "24641e82-0690-4135-8b43-ef12a9b1c5dc"
9973
+ * }
9974
+ * ]
9975
+ * },
9976
+ * "_id": "7e24ff5d-d580-4136-a32f-19191eed039a",
9977
+ * "_org": "728",
9978
+ * "_created_at": "2022-06-03T16:04:10.369Z",
9979
+ * "_updated_at": "2022-06-03T16:04:10.369Z",
9980
+ * "pricing_model": "per_unit"
9981
+ * },
9982
+ * "_product": {
9983
+ * "name": "Cool box",
9984
+ * "type": "product",
9985
+ * "_id": "73f857a4-0fbc-4aa6-983f-87c0d6d410a6",
9986
+ * "_title": "Cool box"
9987
+ * }
9988
+ * }
9989
+ */
9990
+ CompositePriceItem;
9991
+ };
9755
9992
  }
9756
9993
  /**
9757
9994
  * Product recommendations request payload
@@ -14290,6 +14527,7 @@ export type CheckoutMode = Components.Schemas.CheckoutMode;
14290
14527
  export type CompositePrice = Components.Schemas.CompositePrice;
14291
14528
  export type CompositePriceItem = Components.Schemas.CompositePriceItem;
14292
14529
  export type CompositePriceItemDto = Components.Schemas.CompositePriceItemDto;
14530
+ export type ComputePriceInputs = Components.Schemas.ComputePriceInputs;
14293
14531
  export type ComputePriceParams = Components.Schemas.ComputePriceParams;
14294
14532
  export type ComputePriceParamsBase = Components.Schemas.ComputePriceParamsBase;
14295
14533
  export type ComputePriceParamsGas = Components.Schemas.ComputePriceParamsGas;
package/dist/openapi.json CHANGED
@@ -2534,6 +2534,7 @@
2534
2534
  "type": "power",
2535
2535
  "billing_period": "monthly",
2536
2536
  "postal_code": "04109",
2537
+ "city": "Leipzig",
2537
2538
  "consumption": 3500,
2538
2539
  "association_id": "123456789"
2539
2540
  }
@@ -2574,6 +2575,13 @@
2574
2575
  "amount_decimal": "50.00"
2575
2576
  }
2576
2577
  }
2578
+ },
2579
+ "inputs": {
2580
+ "type": "power",
2581
+ "consumptionHT": 3500,
2582
+ "zipCode": "04109",
2583
+ "city": "Leipzig",
2584
+ "billingPeriod": "monthly"
2577
2585
  }
2578
2586
  }
2579
2587
  }
@@ -7577,6 +7585,10 @@
7577
7585
  "description": "The optional reference date for the price computation (ISO 8601 format)",
7578
7586
  "type": "string",
7579
7587
  "format": "date"
7588
+ },
7589
+ "city": {
7590
+ "description": "The city the postal code belongs to. Not used for price computation,\nonly echoed back in `inputs` for display purposes.\n",
7591
+ "type": "string"
7580
7592
  }
7581
7593
  },
7582
7594
  "required": [
@@ -7816,6 +7828,14 @@
7816
7828
  "breakdown": {
7817
7829
  "$ref": "#/components/schemas/ComputedPriceBreakdown"
7818
7830
  },
7831
+ "inputs": {
7832
+ "description": "A snapshot of the parameters this price was computed from, for display purposes\n(e.g. showing \"computed for 3,500 kWh/year\"). Included in the `_meta` signature.\n",
7833
+ "allOf": [
7834
+ {
7835
+ "$ref": "#/components/schemas/ComputePriceInputs"
7836
+ }
7837
+ ]
7838
+ },
7819
7839
  "_meta": {
7820
7840
  "$ref": "#/components/schemas/SignatureMeta"
7821
7841
  }
@@ -7828,6 +7848,49 @@
7828
7848
  "breakdown"
7829
7849
  ]
7830
7850
  },
7851
+ "ComputePriceInputs": {
7852
+ "type": "object",
7853
+ "description": "Echo of the request parameters used to compute the price, in the caller-facing shape.",
7854
+ "properties": {
7855
+ "type": {
7856
+ "$ref": "#/components/schemas/ProductCategory"
7857
+ },
7858
+ "consumptionHT": {
7859
+ "type": "number"
7860
+ },
7861
+ "consumptionNT": {
7862
+ "type": "number"
7863
+ },
7864
+ "consumptionType": {
7865
+ "$ref": "#/components/schemas/ConsumptionTypeGetAg"
7866
+ },
7867
+ "zipCode": {
7868
+ "type": "string"
7869
+ },
7870
+ "city": {
7871
+ "type": "string"
7872
+ },
7873
+ "providerId": {
7874
+ "type": "string"
7875
+ },
7876
+ "billingPeriod": {
7877
+ "type": "string",
7878
+ "enum": [
7879
+ "weekly",
7880
+ "monthly",
7881
+ "every_quarter",
7882
+ "every_6_months",
7883
+ "yearly",
7884
+ "one_time"
7885
+ ]
7886
+ },
7887
+ "referenceDate": {
7888
+ "type": "string",
7889
+ "format": "date"
7890
+ }
7891
+ },
7892
+ "additionalProperties": true
7893
+ },
7831
7894
  "SpotMarketBiddingZone": {
7832
7895
  "description": "The bidding zone for a spot market price.",
7833
7896
  "type": "string",
@@ -11257,6 +11320,23 @@
11257
11320
  "items": {
11258
11321
  "$ref": "#/components/schemas/ProductRecommendation"
11259
11322
  }
11323
+ },
11324
+ "source": {
11325
+ "type": "object",
11326
+ "description": "Context about what the recommendations were searched against.",
11327
+ "properties": {
11328
+ "item": {
11329
+ "description": "The first line item of the contract used as source for the recommendation.\nCarries the amounts the customer currently pays; only present when searching by contract_id.\n",
11330
+ "anyOf": [
11331
+ {
11332
+ "$ref": "#/components/schemas/PriceItem"
11333
+ },
11334
+ {
11335
+ "$ref": "#/components/schemas/CompositePriceItem"
11336
+ }
11337
+ ]
11338
+ }
11339
+ }
11260
11340
  }
11261
11341
  },
11262
11342
  "required": [
@@ -28,11 +28,3 @@ export declare const DynamicTariffModeValues: {
28
28
  readonly dayAheadMarket: "day_ahead_market";
29
29
  readonly manual: "manual";
30
30
  };
31
- /**
32
- * Entity attribute types a conditional pricing variant may override (`overridable_attribute`).
33
- * An allowlist, so a new attribute type is never overridable by default. No pricing schema to
34
- * `satisfies` against — `models.test.ts` checks these against the entity spec.
35
- */
36
- export declare const OVERRIDABLE_ATTRIBUTE_TYPE_LIST: readonly ["string", "number", "currency", "boolean", "date", "datetime", "select", "radio", "multiselect", "checkbox", "country", "tags"];
37
- /** `string`, not a literal union, so callers can test an unnarrowed `attribute.type`. */
38
- export declare const OVERRIDABLE_ATTRIBUTE_TYPES: ReadonlySet<string>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OVERRIDABLE_ATTRIBUTE_TYPES = exports.OVERRIDABLE_ATTRIBUTE_TYPE_LIST = exports.DynamicTariffModeValues = exports.TypeGetAgValues = exports.MarkupPricingModelValues = exports.PricingModelValues = void 0;
3
+ exports.DynamicTariffModeValues = exports.TypeGetAgValues = exports.MarkupPricingModelValues = exports.PricingModelValues = void 0;
4
4
  /**
5
5
  * Runtime companions for spec enums, for consumers that need the values and not
6
6
  * just the union type.
@@ -31,25 +31,4 @@ exports.DynamicTariffModeValues = {
31
31
  dayAheadMarket: 'day_ahead_market',
32
32
  manual: 'manual',
33
33
  };
34
- /**
35
- * Entity attribute types a conditional pricing variant may override (`overridable_attribute`).
36
- * An allowlist, so a new attribute type is never overridable by default. No pricing schema to
37
- * `satisfies` against — `models.test.ts` checks these against the entity spec.
38
- */
39
- exports.OVERRIDABLE_ATTRIBUTE_TYPE_LIST = [
40
- 'string',
41
- 'number',
42
- 'currency',
43
- 'boolean',
44
- 'date',
45
- 'datetime',
46
- 'select',
47
- 'radio',
48
- 'multiselect',
49
- 'checkbox',
50
- 'country',
51
- 'tags',
52
- ];
53
- /** `string`, not a literal union, so callers can test an unnarrowed `attribute.type`. */
54
- exports.OVERRIDABLE_ATTRIBUTE_TYPES = new Set(exports.OVERRIDABLE_ATTRIBUTE_TYPE_LIST);
55
34
  //# sourceMappingURL=schema-model.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/pricing-client",
3
- "version": "3.57.0",
3
+ "version": "3.59.0",
4
4
  "description": "Client for epilot Pricing APIs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,6 +24,18 @@
24
24
  "cart",
25
25
  "pricing"
26
26
  ],
27
+ "scripts": {
28
+ "test": "vitest",
29
+ "bundle-definition": "webpack",
30
+ "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/pricing-api.yaml",
31
+ "openapi:local": "node ../../scripts/update-openapi.js ../../../pricing-api/lambda/ApiHandlerFunction/openapi.yml",
32
+ "typegen": "openapi typegen src/openapi.json --client > src/openapi.d.ts",
33
+ "build": "tsc && npm run build:patch && npm run bundle-definition",
34
+ "build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
35
+ "build:watch": "npm run build && tsc -w",
36
+ "prepublishOnly": "npm run typegen && npm run build",
37
+ "lint": "biome check src"
38
+ },
27
39
  "files": [
28
40
  "*.js",
29
41
  "*.d.ts",
@@ -60,16 +72,5 @@
60
72
  "webpack": "^5.18.0",
61
73
  "webpack-cli": "^4.4.0"
62
74
  },
63
- "gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7",
64
- "scripts": {
65
- "test": "vitest",
66
- "bundle-definition": "webpack",
67
- "openapi": "node ../../scripts/update-openapi.js https://docs.api.epilot.io/pricing-api.yaml",
68
- "openapi:local": "node ../../scripts/update-openapi.js ../../../pricing-api/lambda/ApiHandlerFunction/openapi.yml",
69
- "typegen": "openapi typegen src/openapi.json --client > src/openapi.d.ts",
70
- "build": "tsc && npm run build:patch && npm run bundle-definition",
71
- "build:patch": "sed -i'' -e '/^__exportStar.*openapi.*$/d' dist/index.js",
72
- "build:watch": "npm run build && tsc -w",
73
- "lint": "biome check src"
74
- }
75
- }
75
+ "gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7"
76
+ }