shoal-web-sdk 1.0.106 → 1.0.107

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.
@@ -42,7 +42,7 @@ export declare const getUsageQueryKey: (options: Options<GetUsageData>) => [Pick
42
42
  tags?: ReadonlyArray<string>;
43
43
  }];
44
44
  /**
45
- * Returns usage information for the current billing period.
45
+ * Returns usage information for the current billing period, or for an explicit past window.
46
46
  */
47
47
  export declare const getUsageOptions: (options: Options<GetUsageData>) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../types.gen").UsageInfoResponse, Error, import("../types.gen").UsageInfoResponse, [Pick<Options<GetUsageData>, "query" | "body" | "headers" | "path" | "baseUrl"> & {
48
48
  _id: string;
@@ -46,7 +46,7 @@ export const getCustomerOptions = (options) => {
46
46
  };
47
47
  export const getUsageQueryKey = (options) => createQueryKey('getUsage', options);
48
48
  /**
49
- * Returns usage information for the current billing period.
49
+ * Returns usage information for the current billing period, or for an explicit past window.
50
50
  */
51
51
  export const getUsageOptions = (options) => {
52
52
  return queryOptions({
@@ -18,7 +18,7 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
18
18
  */
19
19
  export declare const getCustomer: <ThrowOnError extends boolean = false>(options: Options<GetCustomerData, ThrowOnError>) => import("./client").RequestResult<GetCustomerResponses, GetCustomerErrors, ThrowOnError, "fields">;
20
20
  /**
21
- * Returns usage information for the current billing period.
21
+ * Returns usage information for the current billing period, or for an explicit past window.
22
22
  */
23
23
  export declare const getUsage: <ThrowOnError extends boolean = false>(options: Options<GetUsageData, ThrowOnError>) => import("./client").RequestResult<GetUsageResponses, GetUsageErrors, ThrowOnError, "fields">;
24
24
  /**
@@ -16,7 +16,7 @@ export const getCustomer = (options) => {
16
16
  });
17
17
  };
18
18
  /**
19
- * Returns usage information for the current billing period.
19
+ * Returns usage information for the current billing period, or for an explicit past window.
20
20
  */
21
21
  export const getUsage = (options) => {
22
22
  return (options.client ?? client).get({
@@ -154,10 +154,14 @@ export type UsageInfoResponse = {
154
154
  from: string;
155
155
  to: string;
156
156
  };
157
+ export type UsagePoint = {
158
+ date: string;
159
+ amount: unknown;
160
+ };
157
161
  export type MeterType = {
158
162
  displayName: string;
159
163
  total: unknown;
160
- values: Array<unknown>;
164
+ points: Array<UsagePoint>;
161
165
  };
162
166
  export type Meters = {
163
167
  computeVms: MeterType;
@@ -243,6 +247,14 @@ export type OrganisationId = string;
243
247
  * A valid currency.
244
248
  */
245
249
  export type Currency2 = Currency;
250
+ /**
251
+ * Start of the usage window. Defaults to the start of the current billing period. Must not be in the future.
252
+ */
253
+ export type UsageFrom = string;
254
+ /**
255
+ * End of the usage window. Defaults to now. Must not be in the future.
256
+ */
257
+ export type UsageTo = string;
246
258
  export type GetCustomerData = {
247
259
  body?: never;
248
260
  path: {
@@ -289,12 +301,20 @@ export type GetUsageData = {
289
301
  * A valid currency.
290
302
  */
291
303
  currency: Currency;
304
+ /**
305
+ * Start of the usage window. Defaults to the start of the current billing period. Must not be in the future.
306
+ */
307
+ from?: string;
308
+ /**
309
+ * End of the usage window. Defaults to now. Must not be in the future.
310
+ */
311
+ to?: string;
292
312
  };
293
313
  url: '/api/v1/usage/{org}';
294
314
  };
295
315
  export type GetUsageErrors = {
296
316
  /**
297
- * Invalid currency
317
+ * Invalid currency or usage window
298
318
  */
299
319
  400: _Error;
300
320
  /**
@@ -2902,56 +2902,90 @@ export declare const zCustomerResponse: z.ZodObject<{
2902
2902
  }, z.core.$strip>>>;
2903
2903
  upcomingInvoiceTotalCents: z.ZodOptional<z.ZodReadonly<z.ZodInt>>;
2904
2904
  }, z.core.$strip>;
2905
+ export declare const zUsagePoint: z.ZodObject<{
2906
+ date: z.ZodISODateTime;
2907
+ amount: z.ZodUnknown;
2908
+ }, z.core.$strip>;
2905
2909
  export declare const zMeterType: z.ZodObject<{
2906
2910
  displayName: z.ZodString;
2907
2911
  total: z.ZodUnknown;
2908
- values: z.ZodArray<z.ZodUnknown>;
2912
+ points: z.ZodArray<z.ZodObject<{
2913
+ date: z.ZodISODateTime;
2914
+ amount: z.ZodUnknown;
2915
+ }, z.core.$strip>>;
2909
2916
  }, z.core.$strip>;
2910
2917
  export declare const zMeters: z.ZodObject<{
2911
2918
  computeVms: z.ZodObject<{
2912
2919
  displayName: z.ZodString;
2913
2920
  total: z.ZodUnknown;
2914
- values: z.ZodArray<z.ZodUnknown>;
2921
+ points: z.ZodArray<z.ZodObject<{
2922
+ date: z.ZodISODateTime;
2923
+ amount: z.ZodUnknown;
2924
+ }, z.core.$strip>>;
2915
2925
  }, z.core.$strip>;
2916
2926
  appHosting: z.ZodObject<{
2917
2927
  displayName: z.ZodString;
2918
2928
  total: z.ZodUnknown;
2919
- values: z.ZodArray<z.ZodUnknown>;
2929
+ points: z.ZodArray<z.ZodObject<{
2930
+ date: z.ZodISODateTime;
2931
+ amount: z.ZodUnknown;
2932
+ }, z.core.$strip>>;
2920
2933
  }, z.core.$strip>;
2921
2934
  databaseStorage: z.ZodObject<{
2922
2935
  displayName: z.ZodString;
2923
2936
  total: z.ZodUnknown;
2924
- values: z.ZodArray<z.ZodUnknown>;
2937
+ points: z.ZodArray<z.ZodObject<{
2938
+ date: z.ZodISODateTime;
2939
+ amount: z.ZodUnknown;
2940
+ }, z.core.$strip>>;
2925
2941
  }, z.core.$strip>;
2926
2942
  networkingSecurity: z.ZodObject<{
2927
2943
  displayName: z.ZodString;
2928
2944
  total: z.ZodUnknown;
2929
- values: z.ZodArray<z.ZodUnknown>;
2945
+ points: z.ZodArray<z.ZodObject<{
2946
+ date: z.ZodISODateTime;
2947
+ amount: z.ZodUnknown;
2948
+ }, z.core.$strip>>;
2930
2949
  }, z.core.$strip>;
2931
2950
  observability: z.ZodObject<{
2932
2951
  displayName: z.ZodString;
2933
2952
  total: z.ZodUnknown;
2934
- values: z.ZodArray<z.ZodUnknown>;
2953
+ points: z.ZodArray<z.ZodObject<{
2954
+ date: z.ZodISODateTime;
2955
+ amount: z.ZodUnknown;
2956
+ }, z.core.$strip>>;
2935
2957
  }, z.core.$strip>;
2936
2958
  platformServices: z.ZodObject<{
2937
2959
  displayName: z.ZodString;
2938
2960
  total: z.ZodUnknown;
2939
- values: z.ZodArray<z.ZodUnknown>;
2961
+ points: z.ZodArray<z.ZodObject<{
2962
+ date: z.ZodISODateTime;
2963
+ amount: z.ZodUnknown;
2964
+ }, z.core.$strip>>;
2940
2965
  }, z.core.$strip>;
2941
2966
  aiMlApis: z.ZodObject<{
2942
2967
  displayName: z.ZodString;
2943
2968
  total: z.ZodUnknown;
2944
- values: z.ZodArray<z.ZodUnknown>;
2969
+ points: z.ZodArray<z.ZodObject<{
2970
+ date: z.ZodISODateTime;
2971
+ amount: z.ZodUnknown;
2972
+ }, z.core.$strip>>;
2945
2973
  }, z.core.$strip>;
2946
2974
  marketplaceLicences: z.ZodObject<{
2947
2975
  displayName: z.ZodString;
2948
2976
  total: z.ZodUnknown;
2949
- values: z.ZodArray<z.ZodUnknown>;
2977
+ points: z.ZodArray<z.ZodObject<{
2978
+ date: z.ZodISODateTime;
2979
+ amount: z.ZodUnknown;
2980
+ }, z.core.$strip>>;
2950
2981
  }, z.core.$strip>;
2951
2982
  infraOverhead: z.ZodObject<{
2952
2983
  displayName: z.ZodString;
2953
2984
  total: z.ZodUnknown;
2954
- values: z.ZodArray<z.ZodUnknown>;
2985
+ points: z.ZodArray<z.ZodObject<{
2986
+ date: z.ZodISODateTime;
2987
+ amount: z.ZodUnknown;
2988
+ }, z.core.$strip>>;
2955
2989
  }, z.core.$strip>;
2956
2990
  }, z.core.$strip>;
2957
2991
  export declare const zUsageInfoResponse: z.ZodObject<{
@@ -2959,47 +2993,74 @@ export declare const zUsageInfoResponse: z.ZodObject<{
2959
2993
  computeVms: z.ZodObject<{
2960
2994
  displayName: z.ZodString;
2961
2995
  total: z.ZodUnknown;
2962
- values: z.ZodArray<z.ZodUnknown>;
2996
+ points: z.ZodArray<z.ZodObject<{
2997
+ date: z.ZodISODateTime;
2998
+ amount: z.ZodUnknown;
2999
+ }, z.core.$strip>>;
2963
3000
  }, z.core.$strip>;
2964
3001
  appHosting: z.ZodObject<{
2965
3002
  displayName: z.ZodString;
2966
3003
  total: z.ZodUnknown;
2967
- values: z.ZodArray<z.ZodUnknown>;
3004
+ points: z.ZodArray<z.ZodObject<{
3005
+ date: z.ZodISODateTime;
3006
+ amount: z.ZodUnknown;
3007
+ }, z.core.$strip>>;
2968
3008
  }, z.core.$strip>;
2969
3009
  databaseStorage: z.ZodObject<{
2970
3010
  displayName: z.ZodString;
2971
3011
  total: z.ZodUnknown;
2972
- values: z.ZodArray<z.ZodUnknown>;
3012
+ points: z.ZodArray<z.ZodObject<{
3013
+ date: z.ZodISODateTime;
3014
+ amount: z.ZodUnknown;
3015
+ }, z.core.$strip>>;
2973
3016
  }, z.core.$strip>;
2974
3017
  networkingSecurity: z.ZodObject<{
2975
3018
  displayName: z.ZodString;
2976
3019
  total: z.ZodUnknown;
2977
- values: z.ZodArray<z.ZodUnknown>;
3020
+ points: z.ZodArray<z.ZodObject<{
3021
+ date: z.ZodISODateTime;
3022
+ amount: z.ZodUnknown;
3023
+ }, z.core.$strip>>;
2978
3024
  }, z.core.$strip>;
2979
3025
  observability: z.ZodObject<{
2980
3026
  displayName: z.ZodString;
2981
3027
  total: z.ZodUnknown;
2982
- values: z.ZodArray<z.ZodUnknown>;
3028
+ points: z.ZodArray<z.ZodObject<{
3029
+ date: z.ZodISODateTime;
3030
+ amount: z.ZodUnknown;
3031
+ }, z.core.$strip>>;
2983
3032
  }, z.core.$strip>;
2984
3033
  platformServices: z.ZodObject<{
2985
3034
  displayName: z.ZodString;
2986
3035
  total: z.ZodUnknown;
2987
- values: z.ZodArray<z.ZodUnknown>;
3036
+ points: z.ZodArray<z.ZodObject<{
3037
+ date: z.ZodISODateTime;
3038
+ amount: z.ZodUnknown;
3039
+ }, z.core.$strip>>;
2988
3040
  }, z.core.$strip>;
2989
3041
  aiMlApis: z.ZodObject<{
2990
3042
  displayName: z.ZodString;
2991
3043
  total: z.ZodUnknown;
2992
- values: z.ZodArray<z.ZodUnknown>;
3044
+ points: z.ZodArray<z.ZodObject<{
3045
+ date: z.ZodISODateTime;
3046
+ amount: z.ZodUnknown;
3047
+ }, z.core.$strip>>;
2993
3048
  }, z.core.$strip>;
2994
3049
  marketplaceLicences: z.ZodObject<{
2995
3050
  displayName: z.ZodString;
2996
3051
  total: z.ZodUnknown;
2997
- values: z.ZodArray<z.ZodUnknown>;
3052
+ points: z.ZodArray<z.ZodObject<{
3053
+ date: z.ZodISODateTime;
3054
+ amount: z.ZodUnknown;
3055
+ }, z.core.$strip>>;
2998
3056
  }, z.core.$strip>;
2999
3057
  infraOverhead: z.ZodObject<{
3000
3058
  displayName: z.ZodString;
3001
3059
  total: z.ZodUnknown;
3002
- values: z.ZodArray<z.ZodUnknown>;
3060
+ points: z.ZodArray<z.ZodObject<{
3061
+ date: z.ZodISODateTime;
3062
+ amount: z.ZodUnknown;
3063
+ }, z.core.$strip>>;
3003
3064
  }, z.core.$strip>;
3004
3065
  }, z.core.$strip>;
3005
3066
  total: z.ZodUnknown;
@@ -4681,6 +4742,14 @@ export declare const zCurrency2: z.ZodEnum<{
4681
4742
  GBP: "GBP";
4682
4743
  USD: "USD";
4683
4744
  }>;
4745
+ /**
4746
+ * Start of the usage window. Defaults to the start of the current billing period. Must not be in the future.
4747
+ */
4748
+ export declare const zUsageFrom: z.ZodISODateTime;
4749
+ /**
4750
+ * End of the usage window. Defaults to now. Must not be in the future.
4751
+ */
4752
+ export declare const zUsageTo: z.ZodISODateTime;
4684
4753
  export declare const zGetCustomerData: z.ZodObject<{
4685
4754
  body: z.ZodOptional<z.ZodNever>;
4686
4755
  path: z.ZodObject<{
@@ -5311,6 +5380,8 @@ export declare const zGetUsageData: z.ZodObject<{
5311
5380
  GBP: "GBP";
5312
5381
  USD: "USD";
5313
5382
  }>;
5383
+ from: z.ZodOptional<z.ZodISODateTime>;
5384
+ to: z.ZodOptional<z.ZodISODateTime>;
5314
5385
  }, z.core.$strip>;
5315
5386
  }, z.core.$strip>;
5316
5387
  /**
@@ -5321,47 +5392,74 @@ export declare const zGetUsageResponse: z.ZodObject<{
5321
5392
  computeVms: z.ZodObject<{
5322
5393
  displayName: z.ZodString;
5323
5394
  total: z.ZodUnknown;
5324
- values: z.ZodArray<z.ZodUnknown>;
5395
+ points: z.ZodArray<z.ZodObject<{
5396
+ date: z.ZodISODateTime;
5397
+ amount: z.ZodUnknown;
5398
+ }, z.core.$strip>>;
5325
5399
  }, z.core.$strip>;
5326
5400
  appHosting: z.ZodObject<{
5327
5401
  displayName: z.ZodString;
5328
5402
  total: z.ZodUnknown;
5329
- values: z.ZodArray<z.ZodUnknown>;
5403
+ points: z.ZodArray<z.ZodObject<{
5404
+ date: z.ZodISODateTime;
5405
+ amount: z.ZodUnknown;
5406
+ }, z.core.$strip>>;
5330
5407
  }, z.core.$strip>;
5331
5408
  databaseStorage: z.ZodObject<{
5332
5409
  displayName: z.ZodString;
5333
5410
  total: z.ZodUnknown;
5334
- values: z.ZodArray<z.ZodUnknown>;
5411
+ points: z.ZodArray<z.ZodObject<{
5412
+ date: z.ZodISODateTime;
5413
+ amount: z.ZodUnknown;
5414
+ }, z.core.$strip>>;
5335
5415
  }, z.core.$strip>;
5336
5416
  networkingSecurity: z.ZodObject<{
5337
5417
  displayName: z.ZodString;
5338
5418
  total: z.ZodUnknown;
5339
- values: z.ZodArray<z.ZodUnknown>;
5419
+ points: z.ZodArray<z.ZodObject<{
5420
+ date: z.ZodISODateTime;
5421
+ amount: z.ZodUnknown;
5422
+ }, z.core.$strip>>;
5340
5423
  }, z.core.$strip>;
5341
5424
  observability: z.ZodObject<{
5342
5425
  displayName: z.ZodString;
5343
5426
  total: z.ZodUnknown;
5344
- values: z.ZodArray<z.ZodUnknown>;
5427
+ points: z.ZodArray<z.ZodObject<{
5428
+ date: z.ZodISODateTime;
5429
+ amount: z.ZodUnknown;
5430
+ }, z.core.$strip>>;
5345
5431
  }, z.core.$strip>;
5346
5432
  platformServices: z.ZodObject<{
5347
5433
  displayName: z.ZodString;
5348
5434
  total: z.ZodUnknown;
5349
- values: z.ZodArray<z.ZodUnknown>;
5435
+ points: z.ZodArray<z.ZodObject<{
5436
+ date: z.ZodISODateTime;
5437
+ amount: z.ZodUnknown;
5438
+ }, z.core.$strip>>;
5350
5439
  }, z.core.$strip>;
5351
5440
  aiMlApis: z.ZodObject<{
5352
5441
  displayName: z.ZodString;
5353
5442
  total: z.ZodUnknown;
5354
- values: z.ZodArray<z.ZodUnknown>;
5443
+ points: z.ZodArray<z.ZodObject<{
5444
+ date: z.ZodISODateTime;
5445
+ amount: z.ZodUnknown;
5446
+ }, z.core.$strip>>;
5355
5447
  }, z.core.$strip>;
5356
5448
  marketplaceLicences: z.ZodObject<{
5357
5449
  displayName: z.ZodString;
5358
5450
  total: z.ZodUnknown;
5359
- values: z.ZodArray<z.ZodUnknown>;
5451
+ points: z.ZodArray<z.ZodObject<{
5452
+ date: z.ZodISODateTime;
5453
+ amount: z.ZodUnknown;
5454
+ }, z.core.$strip>>;
5360
5455
  }, z.core.$strip>;
5361
5456
  infraOverhead: z.ZodObject<{
5362
5457
  displayName: z.ZodString;
5363
5458
  total: z.ZodUnknown;
5364
- values: z.ZodArray<z.ZodUnknown>;
5459
+ points: z.ZodArray<z.ZodObject<{
5460
+ date: z.ZodISODateTime;
5461
+ amount: z.ZodUnknown;
5462
+ }, z.core.$strip>>;
5365
5463
  }, z.core.$strip>;
5366
5464
  }, z.core.$strip>;
5367
5465
  total: z.ZodUnknown;
@@ -183,10 +183,14 @@ export const zCustomerResponse = z.object({
183
183
  paymentMethods: z.array(zPaymentMethodSummary).readonly(),
184
184
  upcomingInvoiceTotalCents: z.optional(z.int().readonly())
185
185
  });
186
+ export const zUsagePoint = z.object({
187
+ date: z.iso.datetime(),
188
+ amount: z.unknown()
189
+ });
186
190
  export const zMeterType = z.object({
187
191
  displayName: z.string(),
188
192
  total: z.unknown(),
189
- values: z.array(z.unknown())
193
+ points: z.array(zUsagePoint)
190
194
  });
191
195
  export const zMeters = z.object({
192
196
  computeVms: zMeterType,
@@ -282,6 +286,14 @@ export const zOrganisationId = z.string();
282
286
  * A valid currency.
283
287
  */
284
288
  export const zCurrency2 = zCurrency;
289
+ /**
290
+ * Start of the usage window. Defaults to the start of the current billing period. Must not be in the future.
291
+ */
292
+ export const zUsageFrom = z.iso.datetime();
293
+ /**
294
+ * End of the usage window. Defaults to now. Must not be in the future.
295
+ */
296
+ export const zUsageTo = z.iso.datetime();
285
297
  export const zGetCustomerData = z.object({
286
298
  body: z.optional(z.never()),
287
299
  path: z.object({
@@ -299,7 +311,9 @@ export const zGetUsageData = z.object({
299
311
  org: z.string()
300
312
  }),
301
313
  query: z.object({
302
- currency: zCurrency
314
+ currency: zCurrency,
315
+ from: z.optional(z.iso.datetime()),
316
+ to: z.optional(z.iso.datetime())
303
317
  })
304
318
  });
305
319
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shoal-web-sdk",
3
- "version": "1.0.106",
3
+ "version": "1.0.107",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build-hooks": "npx tsx tanstack-codegen/generator.ts",