@bikefinder/sdk 0.2.0 → 0.4.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.
@@ -913,20 +913,6 @@ export const zAwsFirmwareRequest = z
913
913
  releaseId: z.string(),
914
914
  })
915
915
  .strict();
916
- export const zAwsObservationSeries = z
917
- .object({
918
- definitionId: z
919
- .int()
920
- .min(0, { error: "Invalid value: Expected uint16 to be >= 0" })
921
- .max(65535, { error: "Invalid value: Expected uint16 to be <= 65535" }),
922
- subject: z.string().nullish(),
923
- })
924
- .strict();
925
- export const zAwsObservationSelection = z
926
- .object({
927
- series: z.array(zAwsObservationSeries).min(1).max(100),
928
- })
929
- .strict();
930
916
  export const zAwsSettingsCapabilities = z
931
917
  .object({
932
918
  modemTrace: z.boolean().nullish(),
@@ -6317,52 +6303,6 @@ export const zHistoryPage = z
6317
6303
  nextCursor: z.string().nullable(),
6318
6304
  })
6319
6305
  .catchall(z.unknown());
6320
- export const zInsuranceAddress = z
6321
- .object({
6322
- line1: z.string(),
6323
- line2: z.string(),
6324
- town: z.string(),
6325
- postcode: z.string(),
6326
- })
6327
- .catchall(z.unknown());
6328
- export const zInsuranceCustomer = z
6329
- .object({
6330
- title: z.string(),
6331
- firstname: z.string(),
6332
- lastname: z.string(),
6333
- email: z.string(),
6334
- dob: z.string(),
6335
- phone: z.string(),
6336
- address: zInsuranceAddress,
6337
- })
6338
- .catchall(z.unknown());
6339
- export const zInsuranceCycle = z
6340
- .object({
6341
- value: z.number(),
6342
- })
6343
- .catchall(z.unknown());
6344
- export const zInsuranceDelivery = z
6345
- .object({
6346
- status: z.string(),
6347
- schedule: z.string(),
6348
- customer: zInsuranceCustomer,
6349
- })
6350
- .catchall(z.unknown());
6351
- export const zInsurancePolicy = z
6352
- .object({
6353
- cycles: z.array(zInsuranceCycle),
6354
- startDate: z.string(),
6355
- bfSubscriptionId: z.string(),
6356
- bfReference: z.string(),
6357
- })
6358
- .catchall(z.unknown());
6359
- export const zInsurancePolicyRequest = z
6360
- .object({
6361
- customer: zInsuranceCustomer,
6362
- policy: zInsurancePolicy,
6363
- })
6364
- .catchall(z.unknown());
6365
- export const zInsuranceTier = z.union([z.string(), z.int()]);
6366
6306
  export const zInventoryMemberValue = z
6367
6307
  .object({
6368
6308
  slot: z
@@ -6393,11 +6333,11 @@ export const zLegacyLteCancellation = z
6393
6333
  })
6394
6334
  .catchall(z.unknown());
6395
6335
  export const zLegacyLteDispatchState = z.enum([
6396
- "Queued",
6397
- "Dispatched",
6398
- "Expired",
6336
+ "queued",
6337
+ "dispatched",
6338
+ "expired",
6399
6339
  ]);
6400
- export const zLegacyLteOperationKind = z.enum(["Queue", "Cancel"]);
6340
+ export const zLegacyLteOperationKind = z.enum(["queue", "cancel"]);
6401
6341
  export const zLegacyLteOperation = z
6402
6342
  .object({
6403
6343
  requestId: z.uuid(),
@@ -8695,6 +8635,20 @@ export const zObservationRadioWifiAccessPointsObservation = z
8695
8635
  measuredAt: z.iso.datetime({ offset: true }),
8696
8636
  })
8697
8637
  .catchall(z.unknown());
8638
+ export const zObservationSeries = z
8639
+ .object({
8640
+ definitionId: z
8641
+ .int()
8642
+ .min(0, { error: "Invalid value: Expected uint16 to be >= 0" })
8643
+ .max(65535, { error: "Invalid value: Expected uint16 to be <= 65535" }),
8644
+ subject: z.string().nullish(),
8645
+ })
8646
+ .strict();
8647
+ export const zAwsObservationSelection = z
8648
+ .object({
8649
+ series: z.array(zObservationSeries).min(1).max(100),
8650
+ })
8651
+ .strict();
8698
8652
  export const zObservationSystemBootedObservation = z
8699
8653
  .object({
8700
8654
  type: z.enum(["system.booted"]),
@@ -9524,72 +9478,6 @@ export const zPhotoPage = z
9524
9478
  nextCursor: z.string().nullable(),
9525
9479
  })
9526
9480
  .catchall(z.unknown());
9527
- export const zPolicyCode = z.union([z.string(), z.int()]);
9528
- export const zInsuranceContractData = z
9529
- .object({
9530
- id: z.string().nullish(),
9531
- country: z.string().nullish(),
9532
- iterator: z.int().gte(-9007199254740991).lte(9007199254740991).nullish(),
9533
- referenceNo: z.string().nullish(),
9534
- timestamp: z.iso.datetime({ offset: true }).nullish(),
9535
- cancelled: z.boolean().nullish(),
9536
- policyCode: zPolicyCode.nullish(),
9537
- tier: zInsuranceTier.nullish(),
9538
- delivery: zInsuranceDelivery.nullish(),
9539
- })
9540
- .catchall(z.unknown());
9541
- export const zInsuranceContractDocument = z
9542
- .object({
9543
- id: z.string(),
9544
- revision: z.string(),
9545
- createdAt: z.iso.datetime({ offset: true }),
9546
- updatedAt: z.iso.datetime({ offset: true }),
9547
- data: zInsuranceContractData,
9548
- })
9549
- .catchall(z.unknown());
9550
- export const zInsuranceContractPage = z
9551
- .object({
9552
- items: z.array(zInsuranceContractDocument),
9553
- nextCursor: z.string().nullable(),
9554
- })
9555
- .catchall(z.unknown());
9556
- export const zInsuranceResult = z
9557
- .object({
9558
- policyCode: zPolicyCode,
9559
- schedule: z.string(),
9560
- })
9561
- .catchall(z.unknown());
9562
- export const zInsuranceAttemptData = z
9563
- .object({
9564
- attemptId: z.string().nullish(),
9565
- referenceNo: z.string().nullish(),
9566
- contractId: z.string().nullish(),
9567
- country: z.string().nullish(),
9568
- iterator: z.int().gte(-9007199254740991).lte(9007199254740991).nullish(),
9569
- state: z.string().nullish(),
9570
- resolved: z.boolean().nullish(),
9571
- timestamp: z.iso.datetime({ offset: true }).nullish(),
9572
- request: zInsurancePolicyRequest.nullish(),
9573
- tier: zInsuranceTier.nullish(),
9574
- maxBikeValue: z.number().nullish(),
9575
- result: zInsuranceResult.nullish(),
9576
- })
9577
- .catchall(z.unknown());
9578
- export const zInsuranceAttemptDocument = z
9579
- .object({
9580
- id: z.string(),
9581
- revision: z.string(),
9582
- createdAt: z.iso.datetime({ offset: true }),
9583
- updatedAt: z.iso.datetime({ offset: true }),
9584
- data: zInsuranceAttemptData,
9585
- })
9586
- .catchall(z.unknown());
9587
- export const zInsuranceAttemptPage = z
9588
- .object({
9589
- items: z.array(zInsuranceAttemptDocument),
9590
- nextCursor: z.string().nullable(),
9591
- })
9592
- .catchall(z.unknown());
9593
9481
  export const zPositionGnssFixValue = z
9594
9482
  .object({
9595
9483
  coordinates: zCoordinatesValue,
@@ -10020,7 +9908,6 @@ export const zStaffSubscriptionData = z
10020
9908
  managementUrl: z.string().nullish(),
10021
9909
  country: z.string().nullish(),
10022
9910
  isDemo: z.boolean().nullish(),
10023
- tier: zInsuranceTier.nullish(),
10024
9911
  type: z.string().nullish(),
10025
9912
  deleted: z.boolean().nullish(),
10026
9913
  })
@@ -10054,7 +9941,6 @@ export const zSubscriptionData = z
10054
9941
  managementUrl: z.string().nullish(),
10055
9942
  country: z.string().nullish(),
10056
9943
  isDemo: z.boolean().nullish(),
10057
- tier: zInsuranceTier.nullish(),
10058
9944
  type: z.string().nullish(),
10059
9945
  deleted: z.boolean().nullish(),
10060
9946
  })
@@ -10421,7 +10307,6 @@ export const zTrackerDataSubscription = z
10421
10307
  isActive: z.boolean().nullish(),
10422
10308
  isDemo: z.boolean().nullish(),
10423
10309
  status: z.string().nullish(),
10424
- tier: zTextOrNumber.nullish(),
10425
10310
  country: z.string().nullish(),
10426
10311
  endTime: z.iso.datetime({ offset: true }).nullish(),
10427
10312
  timestamp: z.iso.datetime({ offset: true }).nullish(),
@@ -10929,21 +10814,6 @@ export const zWorkflowExecutionValue = z
10929
10814
  operation: zWorkflowExecutionValueOperation.nullable(),
10930
10815
  })
10931
10816
  .catchall(z.unknown());
10932
- export const zReadAwsObservationSeries = z
10933
- .object({
10934
- definitionId: z
10935
- .int()
10936
- .min(0, { error: "Invalid value: Expected uint16 to be >= 0" })
10937
- .max(65535, { error: "Invalid value: Expected uint16 to be <= 65535" }),
10938
- subject: z.string().nullish(),
10939
- })
10940
- .catchall(z.unknown());
10941
- export const zAwsObservationReading = z
10942
- .object({
10943
- series: zReadAwsObservationSeries,
10944
- observation: zCurrentObservation.nullable(),
10945
- })
10946
- .catchall(z.unknown());
10947
10817
  export const zReadCustomerFirmwareReportOutcome = z.enum([
10948
10818
  "transferFailed",
10949
10819
  "targetVersionObserved",
@@ -11086,6 +10956,21 @@ export const zAwsSettingsSnapshot = z
11086
10956
  readIssues: z.array(zAwsSettingsReadIssue),
11087
10957
  })
11088
10958
  .catchall(z.unknown());
10959
+ export const zReadObservationSeries = z
10960
+ .object({
10961
+ definitionId: z
10962
+ .int()
10963
+ .min(0, { error: "Invalid value: Expected uint16 to be >= 0" })
10964
+ .max(65535, { error: "Invalid value: Expected uint16 to be <= 65535" }),
10965
+ subject: z.string().nullish(),
10966
+ })
10967
+ .catchall(z.unknown());
10968
+ export const zAwsObservationReading = z
10969
+ .object({
10970
+ series: zReadObservationSeries,
10971
+ observation: zCurrentObservation.nullable(),
10972
+ })
10973
+ .catchall(z.unknown());
11089
10974
  export const zSetTrackerSubscriptionBody = zAllocationChange;
11090
10975
  export const zSetTrackerSubscriptionPath = z.object({
11091
10976
  id: z.string(),
@@ -11747,37 +11632,3 @@ export const zGetStaffSubscriptionPath = z.object({
11747
11632
  * OK
11748
11633
  */
11749
11634
  export const zGetStaffSubscriptionResponse = zStaffSubscriptionDocument;
11750
- export const zListInsuranceContractsPath = z.object({
11751
- id: z.string(),
11752
- });
11753
- export const zListInsuranceContractsQuery = z.object({
11754
- provider: z.string().optional(),
11755
- limit: z.int().gte(1).lte(100).optional(),
11756
- cursor: z.string().optional(),
11757
- });
11758
- /**
11759
- * OK
11760
- */
11761
- export const zListInsuranceContractsResponse = zInsuranceContractPage;
11762
- export const zGetInsuranceContractPath = z.object({
11763
- id: z.string(),
11764
- contractId: z.string(),
11765
- });
11766
- export const zGetInsuranceContractQuery = z.object({
11767
- provider: z.string().optional(),
11768
- });
11769
- /**
11770
- * OK
11771
- */
11772
- export const zGetInsuranceContractResponse = zInsuranceContractDocument;
11773
- export const zListInsuranceAttemptsPath = z.object({
11774
- id: z.string(),
11775
- });
11776
- export const zListInsuranceAttemptsQuery = z.object({
11777
- limit: z.int().gte(1).lte(100).optional(),
11778
- cursor: z.string().optional(),
11779
- });
11780
- /**
11781
- * OK
11782
- */
11783
- export const zListInsuranceAttemptsResponse = zInsuranceAttemptPage;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  import { ApiRequests } from "./generated/sdk.gen.js";
2
+ import type { Observation } from "./generated/types.gen.js";
3
+ import type { observationDefinitions } from "./device-schema.js";
2
4
  export type * from "./generated/types.gen.js";
3
5
  export type { ITrackerHub, IStaffTrackerHub, } from "./signalr/TypedSignalR.Client/BikeFinder.Api.Trackers.js";
4
- export type { PageRequest, StaffTrackerPageRequest, TrackerSelection, } from "./signalr/BikeFinder.Api.Trackers.js";
6
+ export type { StaffTrackerPageRequest, TrackerSelection, } from "./signalr/BikeFinder.Api.Trackers.js";
7
+ export type { PageRequest } from "./signalr/BikeFinder.Api.Http.js";
5
8
  export type { HubConnection, IStreamResult, IStreamSubscriber, ISubscription, } from "@microsoft/signalr";
6
9
  export interface ClientOptions {
7
10
  baseUrl: string;
@@ -23,8 +26,19 @@ export declare function createBikeFinderClient(options: ClientOptions): {
23
26
  };
24
27
  export type BikeFinderClient = ReturnType<typeof createBikeFinderClient>;
25
28
  /** Encode exact current-observation selections for repeated GET series parameters. */
26
- export declare function observationSeriesQuery(series: readonly import("./generated/types.gen.js").AwsObservationSeries[]): string[];
29
+ export declare function observationSeriesQuery(series: readonly import("./generated/types.gen.js").ObservationSeries[]): string[];
27
30
  export { workflowDefinition } from "./workflow-schema.js";
28
31
  export type { FirmwareMode, WorkflowState } from "./workflow-schema.js";
29
32
  export { observationValueSchema, observationDefinitions, settingsValueSchema, } from "./device-schema.js";
30
- export type { ObservationFact, MetricName, DeviceSettings, } from "./device-schema.js";
33
+ type ObservationDefinition = (typeof observationDefinitions)[number];
34
+ export type MetricName = ObservationDefinition["name"];
35
+ /** Protocol identity with the same typed value used by HTTP and realtime. */
36
+ export type ObservationFact = {
37
+ [D in ObservationDefinition as D["name"]]: {
38
+ definitionId: D["id"];
39
+ metric: D["name"];
40
+ value: Extract<Observation, {
41
+ type: D["name"];
42
+ }>["value"];
43
+ };
44
+ }[MetricName];
@@ -0,0 +1,7 @@
1
+ /** Transpiled from BikeFinder.Api.Http.PageRequest */
2
+ export type PageRequest = {
3
+ /** Transpiled from int */
4
+ limit: number;
5
+ /** Transpiled from string? */
6
+ cursor?: string;
7
+ };
@@ -0,0 +1,4 @@
1
+ /* THIS (.ts) FILE IS GENERATED BY Tapper */
2
+ /* eslint-disable */
3
+ /* tslint:disable */
4
+ export {};
@@ -1,10 +1,3 @@
1
- /** Transpiled from BikeFinder.Api.Trackers.PageRequest */
2
- export type PageRequest = {
3
- /** Transpiled from int */
4
- limit: number;
5
- /** Transpiled from string? */
6
- cursor?: string;
7
- };
8
1
  /** Transpiled from BikeFinder.Api.Trackers.StaffTrackerPageRequest */
9
2
  export type StaffTrackerPageRequest = {
10
3
  /** Transpiled from int */
@@ -1,6 +1,7 @@
1
1
  import type { IStreamResult } from "@microsoft/signalr";
2
2
  import type { TrackerDocument, TrackerPage, AccountProfileDocument, NotificationPage, SubscriptionPage, FavoritePage } from "../BikeFinder.Api.Firestore.js";
3
- import type { PageRequest, StaffTrackerPageRequest } from "../BikeFinder.Api.Trackers.js";
3
+ import type { PageRequest } from "../BikeFinder.Api.Http.js";
4
+ import type { StaffTrackerPageRequest } from "../BikeFinder.Api.Trackers.js";
4
5
  import type { AwsObservationSelection, AwsObservationReading, AwsCommandUpdate, AwsSettingsSnapshot } from "../BikeFinder.Api.Aws.js";
5
6
  import type { Observation } from "../BikeFinder.Observations.Model.js";
6
7
  export type ITrackerHub = {
@@ -11,7 +12,7 @@ export type ITrackerHub = {
11
12
  */
12
13
  watchTracker(id: string): IStreamResult<TrackerDocument>;
13
14
  /**
14
- * @param query Transpiled from BikeFinder.Api.Trackers.PageRequest
15
+ * @param query Transpiled from BikeFinder.Api.Http.PageRequest
15
16
  * @param cancellation Transpiled from System.Threading.CancellationToken
16
17
  * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Api.Firestore.TrackerPage>
17
18
  */
@@ -22,13 +23,13 @@ export type ITrackerHub = {
22
23
  */
23
24
  watchAccount(): IStreamResult<AccountProfileDocument>;
24
25
  /**
25
- * @param query Transpiled from BikeFinder.Api.Trackers.PageRequest
26
+ * @param query Transpiled from BikeFinder.Api.Http.PageRequest
26
27
  * @param cancellation Transpiled from System.Threading.CancellationToken
27
28
  * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Api.Firestore.NotificationPage>
28
29
  */
29
30
  watchNotifications(query: PageRequest): IStreamResult<NotificationPage>;
30
31
  /**
31
- * @param query Transpiled from BikeFinder.Api.Trackers.PageRequest
32
+ * @param query Transpiled from BikeFinder.Api.Http.PageRequest
32
33
  * @param cancellation Transpiled from System.Threading.CancellationToken
33
34
  * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Api.Firestore.SubscriptionPage>
34
35
  */
@@ -80,7 +81,7 @@ export type IStaffTrackerHub = {
80
81
  */
81
82
  watchSettings(id: string): IStreamResult<AwsSettingsSnapshot>;
82
83
  /**
83
- * @param query Transpiled from BikeFinder.Api.Trackers.PageRequest
84
+ * @param query Transpiled from BikeFinder.Api.Http.PageRequest
84
85
  * @param cancellation Transpiled from System.Threading.CancellationToken
85
86
  * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Api.Firestore.FavoritePage>
86
87
  */