@bikefinder/sdk 0.1.8 → 0.3.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/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 } 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;
@@ -22,7 +25,20 @@ export declare function createBikeFinderClient(options: ClientOptions): {
22
25
  dispose(): Promise<void>;
23
26
  };
24
27
  export type BikeFinderClient = ReturnType<typeof createBikeFinderClient>;
28
+ /** Encode exact current-observation selections for repeated GET series parameters. */
29
+ export declare function observationSeriesQuery(series: readonly import("./generated/types.gen.js").AwsObservationSeries[]): string[];
25
30
  export { workflowDefinition } from "./workflow-schema.js";
26
31
  export type { FirmwareMode, WorkflowState } from "./workflow-schema.js";
27
- export { observationValueSchema, observationDefinitions, settingsValueSchema } from "./device-schema.js";
28
- export type { ObservationFact, MetricName, DeviceSettings } from "./device-schema.js";
32
+ export { observationValueSchema, observationDefinitions, settingsValueSchema, } 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];
package/dist/index.js CHANGED
@@ -65,5 +65,9 @@ export function createBikeFinderClient(options) {
65
65
  },
66
66
  };
67
67
  }
68
+ /** Encode exact current-observation selections for repeated GET series parameters. */
69
+ export function observationSeriesQuery(series) {
70
+ return series.map(({ definitionId, subject }) => subject == null ? `${definitionId}` : `${definitionId}/${subject}`);
71
+ }
68
72
  export { workflowDefinition } from "./workflow-schema.js";
69
- export { observationValueSchema, observationDefinitions, settingsValueSchema } from "./device-schema.js";
73
+ export { observationValueSchema, observationDefinitions, settingsValueSchema, } from "./device-schema.js";
@@ -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,7 +1,22 @@
1
- /** Transpiled from BikeFinder.Api.Trackers.PageRequest */
2
- export type PageRequest = {
1
+ /** Transpiled from BikeFinder.Api.Trackers.StaffTrackerPageRequest */
2
+ export type StaffTrackerPageRequest = {
3
3
  /** Transpiled from int */
4
4
  limit: number;
5
5
  /** Transpiled from string? */
6
6
  cursor?: string;
7
+ /** Transpiled from BikeFinder.Api.Trackers.TrackerSelection? */
8
+ selection?: TrackerSelection;
9
+ };
10
+ /** Transpiled from BikeFinder.Api.Trackers.TrackerSelection */
11
+ export type TrackerSelection = {
12
+ /** Transpiled from string? */
13
+ serialNumber?: string;
14
+ /** Transpiled from string? */
15
+ imei?: string;
16
+ /** Transpiled from string? */
17
+ iccid?: string;
18
+ /** Transpiled from string? */
19
+ accountId?: string;
20
+ /** Transpiled from string? */
21
+ subscriptionId?: string;
7
22
  };
@@ -0,0 +1 @@
1
+ export type * from "../generated/types.gen.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,9 @@
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 } from "../BikeFinder.Api.Trackers.js";
4
- import type { AwsObservationSelection, AwsObservationReading, AwsObservation, AwsCommandUpdate, AwsSettingsSnapshot } from "../BikeFinder.Api.Aws.js";
3
+ import type { PageRequest } from "../BikeFinder.Api.Http.js";
4
+ import type { StaffTrackerPageRequest } from "../BikeFinder.Api.Trackers.js";
5
+ import type { AwsObservationSelection, AwsObservationReading, AwsCommandUpdate, AwsSettingsSnapshot } from "../BikeFinder.Api.Aws.js";
6
+ import type { Observation } from "../BikeFinder.Observations.Model.js";
5
7
  export type ITrackerHub = {
6
8
  /**
7
9
  * @param id Transpiled from string
@@ -10,7 +12,7 @@ export type ITrackerHub = {
10
12
  */
11
13
  watchTracker(id: string): IStreamResult<TrackerDocument>;
12
14
  /**
13
- * @param query Transpiled from BikeFinder.Api.Trackers.PageRequest
15
+ * @param query Transpiled from BikeFinder.Api.Http.PageRequest
14
16
  * @param cancellation Transpiled from System.Threading.CancellationToken
15
17
  * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Api.Firestore.TrackerPage>
16
18
  */
@@ -21,13 +23,13 @@ export type ITrackerHub = {
21
23
  */
22
24
  watchAccount(): IStreamResult<AccountProfileDocument>;
23
25
  /**
24
- * @param query Transpiled from BikeFinder.Api.Trackers.PageRequest
26
+ * @param query Transpiled from BikeFinder.Api.Http.PageRequest
25
27
  * @param cancellation Transpiled from System.Threading.CancellationToken
26
28
  * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Api.Firestore.NotificationPage>
27
29
  */
28
30
  watchNotifications(query: PageRequest): IStreamResult<NotificationPage>;
29
31
  /**
30
- * @param query Transpiled from BikeFinder.Api.Trackers.PageRequest
32
+ * @param query Transpiled from BikeFinder.Api.Http.PageRequest
31
33
  * @param cancellation Transpiled from System.Threading.CancellationToken
32
34
  * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Api.Firestore.SubscriptionPage>
33
35
  */
@@ -41,45 +43,45 @@ export type IStaffTrackerHub = {
41
43
  */
42
44
  watchTracker(id: string): IStreamResult<TrackerDocument>;
43
45
  /**
44
- * @param query Transpiled from BikeFinder.Api.Trackers.PageRequest
46
+ * @param query Transpiled from BikeFinder.Api.Trackers.StaffTrackerPageRequest
45
47
  * @param cancellation Transpiled from System.Threading.CancellationToken
46
48
  * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Api.Firestore.TrackerPage>
47
49
  */
48
- watchTrackers(query: PageRequest): IStreamResult<TrackerPage>;
50
+ watchTrackers(query: StaffTrackerPageRequest): IStreamResult<TrackerPage>;
49
51
  /**
50
52
  * @param id Transpiled from string
51
53
  * @param query Transpiled from BikeFinder.Api.Aws.AwsObservationSelection
52
54
  * @param cancellation Transpiled from System.Threading.CancellationToken
53
55
  * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Api.Aws.AwsObservationReading[]>
54
56
  */
55
- watchAwsObservations(id: string, query: AwsObservationSelection): IStreamResult<AwsObservationReading[]>;
57
+ watchObservations(id: string, query: AwsObservationSelection): IStreamResult<AwsObservationReading[]>;
56
58
  /**
57
59
  * @param id Transpiled from string
58
60
  * @param cancellation Transpiled from System.Threading.CancellationToken
59
- * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Api.Aws.AwsObservation>
61
+ * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Observations.Model.Observation>
60
62
  */
61
- watchAwsObservationEvents(id: string): IStreamResult<AwsObservation>;
63
+ watchObservationEvents(id: string): IStreamResult<Observation>;
62
64
  /**
63
65
  * @param id Transpiled from string
64
66
  * @param cancellation Transpiled from System.Threading.CancellationToken
65
67
  * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Api.Aws.AwsCommandUpdate>
66
68
  */
67
- watchAwsCommandEvents(id: string): IStreamResult<AwsCommandUpdate>;
69
+ watchCommandEvents(id: string): IStreamResult<AwsCommandUpdate>;
68
70
  /**
69
71
  * @param id Transpiled from string
70
- * @param requestId Transpiled from uint
72
+ * @param operationId Transpiled from System.Guid
71
73
  * @param cancellation Transpiled from System.Threading.CancellationToken
72
74
  * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Api.Aws.AwsCommandUpdate>
73
75
  */
74
- watchAwsCommand(id: string, requestId: number): IStreamResult<AwsCommandUpdate>;
76
+ watchCommand(id: string, operationId: string): IStreamResult<AwsCommandUpdate>;
75
77
  /**
76
78
  * @param id Transpiled from string
77
79
  * @param cancellation Transpiled from System.Threading.CancellationToken
78
80
  * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Api.Aws.AwsSettingsSnapshot>
79
81
  */
80
- watchAwsSettings(id: string): IStreamResult<AwsSettingsSnapshot>;
82
+ watchSettings(id: string): IStreamResult<AwsSettingsSnapshot>;
81
83
  /**
82
- * @param query Transpiled from BikeFinder.Api.Trackers.PageRequest
84
+ * @param query Transpiled from BikeFinder.Api.Http.PageRequest
83
85
  * @param cancellation Transpiled from System.Threading.CancellationToken
84
86
  * @returns Transpiled from System.Collections.Generic.IAsyncEnumerable<BikeFinder.Api.Firestore.FavoritePage>
85
87
  */
@@ -67,20 +67,20 @@ class IStaffTrackerHub_HubProxy {
67
67
  watchTrackers = (query) => {
68
68
  return this.connection.stream("WatchTrackers", query);
69
69
  };
70
- watchAwsObservations = (id, query) => {
71
- return this.connection.stream("WatchAwsObservations", id, query);
70
+ watchObservations = (id, query) => {
71
+ return this.connection.stream("WatchObservations", id, query);
72
72
  };
73
- watchAwsObservationEvents = (id) => {
74
- return this.connection.stream("WatchAwsObservationEvents", id);
73
+ watchObservationEvents = (id) => {
74
+ return this.connection.stream("WatchObservationEvents", id);
75
75
  };
76
- watchAwsCommandEvents = (id) => {
77
- return this.connection.stream("WatchAwsCommandEvents", id);
76
+ watchCommandEvents = (id) => {
77
+ return this.connection.stream("WatchCommandEvents", id);
78
78
  };
79
- watchAwsCommand = (id, requestId) => {
80
- return this.connection.stream("WatchAwsCommand", id, requestId);
79
+ watchCommand = (id, operationId) => {
80
+ return this.connection.stream("WatchCommand", id, operationId);
81
81
  };
82
- watchAwsSettings = (id) => {
83
- return this.connection.stream("WatchAwsSettings", id);
82
+ watchSettings = (id) => {
83
+ return this.connection.stream("WatchSettings", id);
84
84
  };
85
85
  watchFavorites = (query) => {
86
86
  return this.connection.stream("WatchFavorites", query);