lago-javascript-client 1.36.0 → 1.40.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.
@@ -152,7 +152,7 @@ class HttpClient {
152
152
  exports.HttpClient = HttpClient;
153
153
  /**
154
154
  * @title Lago API documentation
155
- * @version 1.36.0
155
+ * @version 1.40.0
156
156
  * @license AGPLv3
157
157
  * @baseUrl https://api.getlago.com/api/v1
158
158
  * @externalDocs https://github.com/getlago
@@ -944,6 +944,74 @@ class Api extends HttpClient {
944
944
  format: "json",
945
945
  ...params,
946
946
  }),
947
+ /**
948
+ * @description This endpoint replaces all existing metadata on a credit note with the provided key-value pairs. Any existing metadata keys not included in the request will be removed.
949
+ *
950
+ * @tags credit_notes
951
+ * @name ReplaceCreditNoteMetadata
952
+ * @summary Replace credit note metadata
953
+ * @request POST:/credit_notes/{lago_id}/metadata
954
+ * @secure
955
+ */
956
+ replaceCreditNoteMetadata: (lagoId, data, params = {}) => this.request({
957
+ path: `/credit_notes/${lagoId}/metadata`,
958
+ method: "POST",
959
+ body: data,
960
+ secure: true,
961
+ type: ContentType.Json,
962
+ format: "json",
963
+ ...params,
964
+ }),
965
+ /**
966
+ * @description This endpoint merges the provided metadata with existing metadata on the credit note. Existing keys not in the request are preserved. New keys are added, existing keys are updated.
967
+ *
968
+ * @tags credit_notes
969
+ * @name MergeCreditNoteMetadata
970
+ * @summary Merge credit note metadata
971
+ * @request PATCH:/credit_notes/{lago_id}/metadata
972
+ * @secure
973
+ */
974
+ mergeCreditNoteMetadata: (lagoId, data, params = {}) => this.request({
975
+ path: `/credit_notes/${lagoId}/metadata`,
976
+ method: "PATCH",
977
+ body: data,
978
+ secure: true,
979
+ type: ContentType.Json,
980
+ format: "json",
981
+ ...params,
982
+ }),
983
+ /**
984
+ * @description This endpoint removes all metadata from a credit note.
985
+ *
986
+ * @tags credit_notes
987
+ * @name DeleteAllCreditNoteMetadata
988
+ * @summary Delete all credit note metadata
989
+ * @request DELETE:/credit_notes/{lago_id}/metadata
990
+ * @secure
991
+ */
992
+ deleteAllCreditNoteMetadata: (lagoId, params = {}) => this.request({
993
+ path: `/credit_notes/${lagoId}/metadata`,
994
+ method: "DELETE",
995
+ secure: true,
996
+ format: "json",
997
+ ...params,
998
+ }),
999
+ /**
1000
+ * @description This endpoint removes a single metadata key from a credit note.
1001
+ *
1002
+ * @tags credit_notes
1003
+ * @name DeleteCreditNoteMetadataKey
1004
+ * @summary Delete a metadata key
1005
+ * @request DELETE:/credit_notes/{lago_id}/metadata/{key}
1006
+ * @secure
1007
+ */
1008
+ deleteCreditNoteMetadataKey: (lagoId, key, params = {}) => this.request({
1009
+ path: `/credit_notes/${lagoId}/metadata/${key}`,
1010
+ method: "DELETE",
1011
+ secure: true,
1012
+ format: "json",
1013
+ ...params,
1014
+ }),
947
1015
  };
948
1016
  customers = {
949
1017
  /**
@@ -1341,7 +1409,7 @@ class Api extends HttpClient {
1341
1409
  ...params,
1342
1410
  }),
1343
1411
  /**
1344
- * @description This endpoint is used for retrieving a specific usage measurement event that has been sent to a customer or a subscription.
1412
+ * @description This endpoint is used for retrieving a specific usage measurement event that has been sent to a customer or a subscription. Note that transaction_id is unique per external_subscription_id so multiple subscriptions can share the same transaction_id. This endpoint will only return the first event found with the given transaction_id. WARNING: If your Lago organization is configured to use the Clickhouse-based event pipeline, multiple events can share the same `transaction_id` (with different timestamps). This endpoint will only return the first event found.
1345
1413
  *
1346
1414
  * @tags events
1347
1415
  * @name FindEvent
@@ -1991,6 +2059,74 @@ class Api extends HttpClient {
1991
2059
  format: "json",
1992
2060
  ...params,
1993
2061
  }),
2062
+ /**
2063
+ * @description This endpoint replaces all existing metadata on a plan with the provided key-value pairs. Any existing metadata keys not included in the request will be removed.
2064
+ *
2065
+ * @tags plans
2066
+ * @name ReplacePlanMetadata
2067
+ * @summary Replace plan metadata
2068
+ * @request POST:/plans/{code}/metadata
2069
+ * @secure
2070
+ */
2071
+ replacePlanMetadata: (code, data, params = {}) => this.request({
2072
+ path: `/plans/${code}/metadata`,
2073
+ method: "POST",
2074
+ body: data,
2075
+ secure: true,
2076
+ type: ContentType.Json,
2077
+ format: "json",
2078
+ ...params,
2079
+ }),
2080
+ /**
2081
+ * @description This endpoint merges the provided metadata with existing metadata on the plan. Existing keys not in the request are preserved. New keys are added, existing keys are updated.
2082
+ *
2083
+ * @tags plans
2084
+ * @name MergePlanMetadata
2085
+ * @summary Merge plan metadata
2086
+ * @request PATCH:/plans/{code}/metadata
2087
+ * @secure
2088
+ */
2089
+ mergePlanMetadata: (code, data, params = {}) => this.request({
2090
+ path: `/plans/${code}/metadata`,
2091
+ method: "PATCH",
2092
+ body: data,
2093
+ secure: true,
2094
+ type: ContentType.Json,
2095
+ format: "json",
2096
+ ...params,
2097
+ }),
2098
+ /**
2099
+ * @description This endpoint removes all metadata from a plan.
2100
+ *
2101
+ * @tags plans
2102
+ * @name DeleteAllPlanMetadata
2103
+ * @summary Delete all plan metadata
2104
+ * @request DELETE:/plans/{code}/metadata
2105
+ * @secure
2106
+ */
2107
+ deleteAllPlanMetadata: (code, params = {}) => this.request({
2108
+ path: `/plans/${code}/metadata`,
2109
+ method: "DELETE",
2110
+ secure: true,
2111
+ format: "json",
2112
+ ...params,
2113
+ }),
2114
+ /**
2115
+ * @description This endpoint removes a single metadata key from a plan.
2116
+ *
2117
+ * @tags plans
2118
+ * @name DeletePlanMetadataKey
2119
+ * @summary Delete a metadata key
2120
+ * @request DELETE:/plans/{code}/metadata/{key}
2121
+ * @secure
2122
+ */
2123
+ deletePlanMetadataKey: (code, key, params = {}) => this.request({
2124
+ path: `/plans/${code}/metadata/${key}`,
2125
+ method: "DELETE",
2126
+ secure: true,
2127
+ format: "json",
2128
+ ...params,
2129
+ }),
1994
2130
  };
1995
2131
  subscriptions = {
1996
2132
  /**
@@ -2265,6 +2401,22 @@ class Api extends HttpClient {
2265
2401
  format: "json",
2266
2402
  ...params,
2267
2403
  }),
2404
+ /**
2405
+ * @description This endpoint retrieves all fixed charges for a specific subscription.
2406
+ *
2407
+ * @tags subscriptions
2408
+ * @name FindAllSubscriptionFixedCharges
2409
+ * @summary List subscription fixed charges
2410
+ * @request GET:/subscriptions/{external_id}/fixed_charges
2411
+ * @secure
2412
+ */
2413
+ findAllSubscriptionFixedCharges: (externalId, params = {}) => this.request({
2414
+ path: `/subscriptions/${externalId}/fixed_charges`,
2415
+ method: "GET",
2416
+ secure: true,
2417
+ format: "json",
2418
+ ...params,
2419
+ }),
2268
2420
  };
2269
2421
  taxes = {
2270
2422
  /**
@@ -2439,6 +2591,74 @@ class Api extends HttpClient {
2439
2591
  format: "json",
2440
2592
  ...params,
2441
2593
  }),
2594
+ /**
2595
+ * @description This endpoint replaces all existing metadata on a wallet with the provided key-value pairs. Any existing metadata keys not included in the request will be removed.
2596
+ *
2597
+ * @tags wallets
2598
+ * @name ReplaceWalletMetadata
2599
+ * @summary Replace wallet metadata
2600
+ * @request POST:/wallets/{lago_id}/metadata
2601
+ * @secure
2602
+ */
2603
+ replaceWalletMetadata: (lagoId, data, params = {}) => this.request({
2604
+ path: `/wallets/${lagoId}/metadata`,
2605
+ method: "POST",
2606
+ body: data,
2607
+ secure: true,
2608
+ type: ContentType.Json,
2609
+ format: "json",
2610
+ ...params,
2611
+ }),
2612
+ /**
2613
+ * @description This endpoint merges the provided metadata with existing metadata on the wallet. Existing keys not in the request are preserved. New keys are added, existing keys are updated.
2614
+ *
2615
+ * @tags wallets
2616
+ * @name MergeWalletMetadata
2617
+ * @summary Merge wallet metadata
2618
+ * @request PATCH:/wallets/{lago_id}/metadata
2619
+ * @secure
2620
+ */
2621
+ mergeWalletMetadata: (lagoId, data, params = {}) => this.request({
2622
+ path: `/wallets/${lagoId}/metadata`,
2623
+ method: "PATCH",
2624
+ body: data,
2625
+ secure: true,
2626
+ type: ContentType.Json,
2627
+ format: "json",
2628
+ ...params,
2629
+ }),
2630
+ /**
2631
+ * @description This endpoint removes all metadata from a wallet.
2632
+ *
2633
+ * @tags wallets
2634
+ * @name DeleteAllWalletMetadata
2635
+ * @summary Delete all wallet metadata
2636
+ * @request DELETE:/wallets/{lago_id}/metadata
2637
+ * @secure
2638
+ */
2639
+ deleteAllWalletMetadata: (lagoId, params = {}) => this.request({
2640
+ path: `/wallets/${lagoId}/metadata`,
2641
+ method: "DELETE",
2642
+ secure: true,
2643
+ format: "json",
2644
+ ...params,
2645
+ }),
2646
+ /**
2647
+ * @description This endpoint removes a single metadata key from a wallet.
2648
+ *
2649
+ * @tags wallets
2650
+ * @name DeleteWalletMetadataKey
2651
+ * @summary Delete a metadata key
2652
+ * @request DELETE:/wallets/{lago_id}/metadata/{key}
2653
+ * @secure
2654
+ */
2655
+ deleteWalletMetadataKey: (lagoId, key, params = {}) => this.request({
2656
+ path: `/wallets/${lagoId}/metadata/${key}`,
2657
+ method: "DELETE",
2658
+ secure: true,
2659
+ format: "json",
2660
+ ...params,
2661
+ }),
2442
2662
  /**
2443
2663
  * @description This endpoint is used to list all wallet transactions.
2444
2664
  *