@openmeter/sdk 1.0.0-beta-6d8d5b71ca5a → 1.0.0-beta-35f97704765a

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.
@@ -74,6 +74,25 @@ class Meters {
74
74
  });
75
75
  return (0, utils_js_1.transformResponse)(resp);
76
76
  }
77
+ /**
78
+ * Update a meter by ID or slug
79
+ * @param idOrSlug - The ID or slug of the meter
80
+ * @param meter - The meter update data
81
+ * @param options - Optional request options
82
+ * @returns The updated meter
83
+ */
84
+ async update(idOrSlug, meter, options) {
85
+ const resp = await this.client.PUT('/api/v1/meters/{meterIdOrSlug}', {
86
+ body: meter,
87
+ params: {
88
+ path: {
89
+ meterIdOrSlug: idOrSlug,
90
+ },
91
+ },
92
+ ...options,
93
+ });
94
+ return (0, utils_js_1.transformResponse)(resp);
95
+ }
77
96
  /**
78
97
  * Delete a meter by ID or slug
79
98
  * @param idOrSlug - The ID or slug of the meter
@@ -89,6 +89,30 @@ export declare class Meters {
89
89
  windowSize?: import("./schemas.cjs").components["schemas"]["WindowSize"];
90
90
  data: import("./schemas.cjs").components["schemas"]["MeterQueryRow"][];
91
91
  }>;
92
+ /**
93
+ * Update a meter by ID or slug
94
+ * @param idOrSlug - The ID or slug of the meter
95
+ * @param meter - The meter update data
96
+ * @param options - Optional request options
97
+ * @returns The updated meter
98
+ */
99
+ update(idOrSlug: operations['updateMeter']['parameters']['path']['meterIdOrSlug'], meter: operations['updateMeter']['requestBody']['content']['application/json'], options?: RequestOptions): Promise<{
100
+ readonly id: string;
101
+ description?: string;
102
+ metadata?: import("./schemas.cjs").components["schemas"]["Metadata"] | null;
103
+ readonly createdAt: Date;
104
+ readonly updatedAt: Date;
105
+ readonly deletedAt?: Date;
106
+ name?: string;
107
+ slug: string;
108
+ aggregation: import("./schemas.cjs").components["schemas"]["MeterAggregation"];
109
+ eventType: string;
110
+ eventFrom?: Date;
111
+ valueProperty?: string;
112
+ groupBy?: {
113
+ [key: string]: string;
114
+ };
115
+ }>;
92
116
  /**
93
117
  * Delete a meter by ID or slug
94
118
  * @param idOrSlug - The ID or slug of the meter
@@ -1 +1 @@
1
- {"version":3,"file":"meters.js","sourceRoot":"","sources":["../../../../src/client/meters.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAK9C;;;GAGG;AACH,MAAa,MAAM;IACG;IAApB,YAAoB,MAA4C;QAA5C,WAAM,GAAN,MAAM,CAAsC;IAAG,CAAC;IAEpE;;;;;OAKG;IACI,KAAK,CAAC,MAAM,CAAC,KAAkB,EAAE,OAAwB;QAC9D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE;YACpD,IAAI,EAAE,KAAK;YACX,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,GAAG,CACd,QAAuE,EACvE,OAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gCAAgC,EAAE;YACnE,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,aAAa,EAAE,QAAQ;iBACxB;aACF;YACD,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,IAAI,CAAC,OAAwB;QACxC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE;YACnD,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,KAAK,CAChB,QAAyE,EACzE,KAAuD,EACvD,OAAwB;QAExB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,C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AC,MAAM,CAAC,MAAM,CAAC,gCAAgC,EAAE;YACtE,MAAM,EAAE;gBACN,IAAI,EAAE;oBACJ,aAAa,EAAE,QAAQ;iBACxB;aACF;YACD,GAAG,OAAO;SACX,CAAC,CAAA;QAEF,OAAO,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;IAChC,CAAC;CACF;AAjID,wBAiIC"}
@@ -6472,8 +6472,6 @@ export interface components {
6472
6472
  * @description Named JSONPath expressions to extract the group by values from the event data.
6473
6473
  *
6474
6474
  * Keys must be unique and consist only alphanumeric and underscore characters.
6475
- *
6476
- * TODO: add key format enforcement
6477
6475
  * @example {
6478
6476
  * "type": "$.type"
6479
6477
  * }
@@ -6556,8 +6554,6 @@ export interface components {
6556
6554
  * @description Named JSONPath expressions to extract the group by values from the event data.
6557
6555
  *
6558
6556
  * Keys must be unique and consist only alphanumeric and underscore characters.
6559
- *
6560
- * TODO: add key format enforcement
6561
6557
  * @example {
6562
6558
  * "type": "$.type"
6563
6559
  * }
@@ -6687,8 +6683,6 @@ export interface components {
6687
6683
  * @description Named JSONPath expressions to extract the group by values from the event data.
6688
6684
  *
6689
6685
  * Keys must be unique and consist only alphanumeric and underscore characters.
6690
- *
6691
- * TODO: add key format enforcement
6692
6686
  * @example {
6693
6687
  * "type": "$.type"
6694
6688
  * }
@@ -6002,7 +6002,7 @@ exports.createMeterBody = zod_1.z
6002
6002
  groupBy: zod_1.z
6003
6003
  .record(zod_1.z.string(), zod_1.z.string())
6004
6004
  .optional()
6005
- .describe('Named JSONPath expressions to extract the group by values from the event data.\n\nKeys must be unique and consist only alphanumeric and underscore characters.\n\nTODO: add key format enforcement'),
6005
+ .describe('Named JSONPath expressions to extract the group by values from the event data.\n\nKeys must be unique and consist only alphanumeric and underscore characters.'),
6006
6006
  metadata: zod_1.z
6007
6007
  .record(zod_1.z.string(), zod_1.z.string())
6008
6008
  .describe('Set of key-value pairs.\nMetadata can be used to store additional information about a resource.')
@@ -6065,7 +6065,7 @@ exports.updateMeterBody = zod_1.z
6065
6065
  groupBy: zod_1.z
6066
6066
  .record(zod_1.z.string(), zod_1.z.string())
6067
6067
  .optional()
6068
- .describe('Named JSONPath expressions to extract the group by values from the event data.\n\nKeys must be unique and consist only alphanumeric and underscore characters.\n\nTODO: add key format enforcement'),
6068
+ .describe('Named JSONPath expressions to extract the group by values from the event data.\n\nKeys must be unique and consist only alphanumeric and underscore characters.'),
6069
6069
  metadata: zod_1.z
6070
6070
  .record(zod_1.z.string(), zod_1.z.string())
6071
6071
  .describe('Set of key-value pairs.\nMetadata can be used to store additional information about a resource.')