@mochabug/adapt-web 0.0.1-beta

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.
Files changed (55) hide show
  1. package/dist/genproto/buf/validate/validate_pb.d.ts +4504 -0
  2. package/dist/genproto/buf/validate/validate_pb.js +422 -0
  3. package/dist/genproto/buf/validate/validate_pb.js.map +1 -0
  4. package/dist/genproto/google/api/annotations_pb.d.ts +13 -0
  5. package/dist/genproto/google/api/annotations_pb.js +27 -0
  6. package/dist/genproto/google/api/annotations_pb.js.map +1 -0
  7. package/dist/genproto/google/api/client_pb.d.ts +795 -0
  8. package/dist/genproto/google/api/client_pb.js +287 -0
  9. package/dist/genproto/google/api/client_pb.js.map +1 -0
  10. package/dist/genproto/google/api/http_pb.d.ts +440 -0
  11. package/dist/genproto/google/api/http_pb.js +34 -0
  12. package/dist/genproto/google/api/http_pb.js.map +1 -0
  13. package/dist/genproto/google/api/launch_stage_pb.d.ts +86 -0
  14. package/dist/genproto/google/api/launch_stage_pb.js +101 -0
  15. package/dist/genproto/google/api/launch_stage_pb.js.map +1 -0
  16. package/dist/genproto/mochabugapis/adapt/automations/v1/automations_pb.d.ts +542 -0
  17. package/dist/genproto/mochabugapis/adapt/automations/v1/automations_pb.js +157 -0
  18. package/dist/genproto/mochabugapis/adapt/automations/v1/automations_pb.js.map +1 -0
  19. package/dist/genproto/mochabugapis/adapt/graph/exchange_pb.d.ts +43 -0
  20. package/dist/genproto/mochabugapis/adapt/graph/exchange_pb.js +26 -0
  21. package/dist/genproto/mochabugapis/adapt/graph/exchange_pb.js.map +1 -0
  22. package/dist/genproto/mochabugapis/adapt/graph/jtd_schema_pb.d.ts +117 -0
  23. package/dist/genproto/mochabugapis/adapt/graph/jtd_schema_pb.js +25 -0
  24. package/dist/genproto/mochabugapis/adapt/graph/jtd_schema_pb.js.map +1 -0
  25. package/dist/genproto/mochabugapis/adapt/graph/receiver_pb.d.ts +39 -0
  26. package/dist/genproto/mochabugapis/adapt/graph/receiver_pb.js +26 -0
  27. package/dist/genproto/mochabugapis/adapt/graph/receiver_pb.js.map +1 -0
  28. package/dist/genproto/mochabugapis/adapt/graph/signal_descriptor_pb.d.ts +43 -0
  29. package/dist/genproto/mochabugapis/adapt/graph/signal_descriptor_pb.js +26 -0
  30. package/dist/genproto/mochabugapis/adapt/graph/signal_descriptor_pb.js.map +1 -0
  31. package/dist/genproto/mochabugapis/adapt/graph/transceiver_pb.d.ts +37 -0
  32. package/dist/genproto/mochabugapis/adapt/graph/transceiver_pb.js +26 -0
  33. package/dist/genproto/mochabugapis/adapt/graph/transceiver_pb.js.map +1 -0
  34. package/dist/genproto/mochabugapis/adapt/graph/transmitter_pb.d.ts +43 -0
  35. package/dist/genproto/mochabugapis/adapt/graph/transmitter_pb.js +26 -0
  36. package/dist/genproto/mochabugapis/adapt/graph/transmitter_pb.js.map +1 -0
  37. package/dist/genproto/mochabugapis/adapt/graph/vertex_config_pb.d.ts +62 -0
  38. package/dist/genproto/mochabugapis/adapt/graph/vertex_config_pb.js +28 -0
  39. package/dist/genproto/mochabugapis/adapt/graph/vertex_config_pb.js.map +1 -0
  40. package/dist/genproto/mochabugapis/adapt/plugins/v1/plugins_pb.d.ts +815 -0
  41. package/dist/genproto/mochabugapis/adapt/plugins/v1/plugins_pb.js +284 -0
  42. package/dist/genproto/mochabugapis/adapt/plugins/v1/plugins_pb.js.map +1 -0
  43. package/dist/genproto/mochabugapis/adapt/runtime/v1/incoming_pb.d.ts +224 -0
  44. package/dist/genproto/mochabugapis/adapt/runtime/v1/incoming_pb.js +75 -0
  45. package/dist/genproto/mochabugapis/adapt/runtime/v1/incoming_pb.js.map +1 -0
  46. package/dist/genproto/mochabugapis/adapt/runtime/v1/runtime_pb.d.ts +1295 -0
  47. package/dist/genproto/mochabugapis/adapt/runtime/v1/runtime_pb.js +346 -0
  48. package/dist/genproto/mochabugapis/adapt/runtime/v1/runtime_pb.js.map +1 -0
  49. package/dist/genproto/mochabugapis/adapt/runtime/v1/store_pb.d.ts +530 -0
  50. package/dist/genproto/mochabugapis/adapt/runtime/v1/store_pb.js +225 -0
  51. package/dist/genproto/mochabugapis/adapt/runtime/v1/store_pb.js.map +1 -0
  52. package/dist/index.d.ts +29 -0
  53. package/dist/index.js +175 -0
  54. package/dist/index.js.map +1 -0
  55. package/package.json +37 -0
@@ -0,0 +1,225 @@
1
+ // Copyright 2023, mochabug AB
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
15
+ import { file_buf_validate_validate } from "../../../../buf/validate/validate_pb";
16
+ import { file_google_protobuf_struct, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
17
+ /**
18
+ * Describes the file mochabugapis/adapt/runtime/v1/store.proto.
19
+ */
20
+ export const file_mochabugapis_adapt_runtime_v1_store = /*@__PURE__*/ fileDesc("Ciltb2NoYWJ1Z2FwaXMvYWRhcHQvcnVudGltZS92MS9zdG9yZS5wcm90bxIdbW9jaGFidWdhcGlzLmFkYXB0LnJ1bnRpbWUudjEiPgoIUHV0VmFsdWUSJQoFdmFsdWUYASABKAsyFi5nb29nbGUucHJvdG9idWYuVmFsdWUSCwoDdHRsGAIgASgFIn8KCEdldFZhbHVlEiUKBXZhbHVlGAEgASgLMhYuZ29vZ2xlLnByb3RvYnVmLlZhbHVlEgsKA3R0bBgCIAEoBRIxCg1sYXN0X21vZGlmaWVkGAMgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIMCgRldGFnGAQgASgJIp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EVSQVRPUl9MRVNTX1RIQU5fT1JfRVFVQUwQBRIWChJPUEVSQVRPUl9OT1RfRVFVQUwQBircAQoUR2xvYmFsUmVzcG9uc2VTdGF0dXMSJgoiR0xPQkFMX1JFU1BPTlNFX1NUQVRVU19VTlNQRUNJRklFRBAAEiIKHkdMT0JBTF9SRVNQT05TRV9TVEFUVVNfU1VDQ0VTUxABEioKJkdMT0JBTF9SRVNQT05TRV9TVEFUVVNfUEFSVElBTF9TVUNDRVNTEAISIQodR0xPQkFMX1JFU1BPTlNFX1NUQVRVU19GQUlMRUQQAxIpCiVHTE9CQUxfUkVTUE9OU0VfU1RBVFVTX0lOVEVSTkFMX0VSUk9SEAQq5AEKD09wZXJhdGlvblN0YXR1cxIgChxPUEVSQVRJT05fU1RBVFVTX1VOU1BFQ0lGSUVEEAASFwoTT1BFUkFUSU9OX1NUQVRVU19PSxABEiAKHE9QRVJBVElPTl9TVEFUVVNfQkFEX1JFUVVFU1QQAhIeChpPUEVSQVRJT05fU1RBVFVTX05PVF9GT1VORBADEigKJE9QRVJBVElPTl9TVEFUVVNfUFJFQ09ORElUSU9OX0ZBSUxFRBAEEioKJk9QRVJBVElPTl9TVEFUVVNfSU5URVJOQUxfU0VSVkVSX0VSUk9SEAViBnByb3RvMw", [file_buf_validate_validate, file_google_protobuf_struct, file_google_protobuf_timestamp]);
21
+ /**
22
+ * Describes the message mochabugapis.adapt.runtime.v1.PutValue.
23
+ * Use `create(PutValueSchema)` to create a new message.
24
+ */
25
+ export const PutValueSchema = /*@__PURE__*/ messageDesc(file_mochabugapis_adapt_runtime_v1_store, 0);
26
+ /**
27
+ * Describes the message mochabugapis.adapt.runtime.v1.GetValue.
28
+ * Use `create(GetValueSchema)` to create a new message.
29
+ */
30
+ export const GetValueSchema = /*@__PURE__*/ messageDesc(file_mochabugapis_adapt_runtime_v1_store, 1);
31
+ /**
32
+ * Describes the message mochabugapis.adapt.runtime.v1.TimestampCondition.
33
+ * Use `create(TimestampConditionSchema)` to create a new message.
34
+ */
35
+ export const TimestampConditionSchema = /*@__PURE__*/ messageDesc(file_mochabugapis_adapt_runtime_v1_store, 2);
36
+ /**
37
+ * Describes the message mochabugapis.adapt.runtime.v1.EtagCondition.
38
+ * Use `create(EtagConditionSchema)` to create a new message.
39
+ */
40
+ export const EtagConditionSchema = /*@__PURE__*/ messageDesc(file_mochabugapis_adapt_runtime_v1_store, 3);
41
+ /**
42
+ * Describes the message mochabugapis.adapt.runtime.v1.Precondition.
43
+ * Use `create(PreconditionSchema)` to create a new message.
44
+ */
45
+ export const PreconditionSchema = /*@__PURE__*/ messageDesc(file_mochabugapis_adapt_runtime_v1_store, 4);
46
+ /**
47
+ * Describes the message mochabugapis.adapt.runtime.v1.UpdateOp.
48
+ * Use `create(UpdateOpSchema)` to create a new message.
49
+ */
50
+ export const UpdateOpSchema = /*@__PURE__*/ messageDesc(file_mochabugapis_adapt_runtime_v1_store, 5);
51
+ /**
52
+ * Describes the message mochabugapis.adapt.runtime.v1.InsertOp.
53
+ * Use `create(InsertOpSchema)` to create a new message.
54
+ */
55
+ export const InsertOpSchema = /*@__PURE__*/ messageDesc(file_mochabugapis_adapt_runtime_v1_store, 6);
56
+ /**
57
+ * Describes the message mochabugapis.adapt.runtime.v1.GetOp.
58
+ * Use `create(GetOpSchema)` to create a new message.
59
+ */
60
+ export const GetOpSchema = /*@__PURE__*/ messageDesc(file_mochabugapis_adapt_runtime_v1_store, 7);
61
+ /**
62
+ * Describes the message mochabugapis.adapt.runtime.v1.DeleteOp.
63
+ * Use `create(DeleteOpSchema)` to create a new message.
64
+ */
65
+ export const DeleteOpSchema = /*@__PURE__*/ messageDesc(file_mochabugapis_adapt_runtime_v1_store, 8);
66
+ /**
67
+ * Describes the message mochabugapis.adapt.runtime.v1.WriteOperation.
68
+ * Use `create(WriteOperationSchema)` to create a new message.
69
+ */
70
+ export const WriteOperationSchema = /*@__PURE__*/ messageDesc(file_mochabugapis_adapt_runtime_v1_store, 9);
71
+ /**
72
+ * Describes the message mochabugapis.adapt.runtime.v1.ReadOperationResult.
73
+ * Use `create(ReadOperationResultSchema)` to create a new message.
74
+ */
75
+ export const ReadOperationResultSchema = /*@__PURE__*/ messageDesc(file_mochabugapis_adapt_runtime_v1_store, 10);
76
+ /**
77
+ * Describes the message mochabugapis.adapt.runtime.v1.WriteOperationResult.
78
+ * Use `create(WriteOperationResultSchema)` to create a new message.
79
+ */
80
+ export const WriteOperationResultSchema = /*@__PURE__*/ messageDesc(file_mochabugapis_adapt_runtime_v1_store, 11);
81
+ /**
82
+ * Operators for comparison
83
+ *
84
+ * @generated from enum mochabugapis.adapt.runtime.v1.Operator
85
+ */
86
+ export var Operator;
87
+ (function (Operator) {
88
+ /**
89
+ * Default value that should never be used.
90
+ *
91
+ * @generated from enum value: OPERATOR_UNSPECIFIED = 0;
92
+ */
93
+ Operator[Operator["UNSPECIFIED"] = 0] = "UNSPECIFIED";
94
+ /**
95
+ * Equal to
96
+ *
97
+ * @generated from enum value: OPERATOR_EQUAL = 1;
98
+ */
99
+ Operator[Operator["EQUAL"] = 1] = "EQUAL";
100
+ /**
101
+ * Greater than
102
+ *
103
+ * @generated from enum value: OPERATOR_GREATER_THAN = 2;
104
+ */
105
+ Operator[Operator["GREATER_THAN"] = 2] = "GREATER_THAN";
106
+ /**
107
+ * Greater than or equal to
108
+ *
109
+ * @generated from enum value: OPERATOR_GREATER_THAN_OR_EQUAL = 3;
110
+ */
111
+ Operator[Operator["GREATER_THAN_OR_EQUAL"] = 3] = "GREATER_THAN_OR_EQUAL";
112
+ /**
113
+ * Less than
114
+ *
115
+ * @generated from enum value: OPERATOR_LESS_THAN = 4;
116
+ */
117
+ Operator[Operator["LESS_THAN"] = 4] = "LESS_THAN";
118
+ /**
119
+ * Less than or equal to
120
+ *
121
+ * @generated from enum value: OPERATOR_LESS_THAN_OR_EQUAL = 5;
122
+ */
123
+ Operator[Operator["LESS_THAN_OR_EQUAL"] = 5] = "LESS_THAN_OR_EQUAL";
124
+ /**
125
+ * Not equal to
126
+ *
127
+ * @generated from enum value: OPERATOR_NOT_EQUAL = 6;
128
+ */
129
+ Operator[Operator["NOT_EQUAL"] = 6] = "NOT_EQUAL";
130
+ })(Operator || (Operator = {}));
131
+ /**
132
+ * Describes the enum mochabugapis.adapt.runtime.v1.Operator.
133
+ */
134
+ export const OperatorSchema = /*@__PURE__*/ enumDesc(file_mochabugapis_adapt_runtime_v1_store, 0);
135
+ /**
136
+ * GlobalResponseStatus represents the overall status of a batch operation.
137
+ *
138
+ * @generated from enum mochabugapis.adapt.runtime.v1.GlobalResponseStatus
139
+ */
140
+ export var GlobalResponseStatus;
141
+ (function (GlobalResponseStatus) {
142
+ /**
143
+ * Default value that should never be used.
144
+ *
145
+ * @generated from enum value: GLOBAL_RESPONSE_STATUS_UNSPECIFIED = 0;
146
+ */
147
+ GlobalResponseStatus[GlobalResponseStatus["UNSPECIFIED"] = 0] = "UNSPECIFIED";
148
+ /**
149
+ * 200 OK: All operations succeeded
150
+ *
151
+ * @generated from enum value: GLOBAL_RESPONSE_STATUS_SUCCESS = 1;
152
+ */
153
+ GlobalResponseStatus[GlobalResponseStatus["SUCCESS"] = 1] = "SUCCESS";
154
+ /**
155
+ * 206 Partial Content: Some operations succeeded
156
+ *
157
+ * @generated from enum value: GLOBAL_RESPONSE_STATUS_PARTIAL_SUCCESS = 2;
158
+ */
159
+ GlobalResponseStatus[GlobalResponseStatus["PARTIAL_SUCCESS"] = 2] = "PARTIAL_SUCCESS";
160
+ /**
161
+ * 400 Bad Request: All operations failed
162
+ *
163
+ * @generated from enum value: GLOBAL_RESPONSE_STATUS_FAILED = 3;
164
+ */
165
+ GlobalResponseStatus[GlobalResponseStatus["FAILED"] = 3] = "FAILED";
166
+ /**
167
+ * 500 Internal Server Error: System error
168
+ *
169
+ * @generated from enum value: GLOBAL_RESPONSE_STATUS_INTERNAL_ERROR = 4;
170
+ */
171
+ GlobalResponseStatus[GlobalResponseStatus["INTERNAL_ERROR"] = 4] = "INTERNAL_ERROR";
172
+ })(GlobalResponseStatus || (GlobalResponseStatus = {}));
173
+ /**
174
+ * Describes the enum mochabugapis.adapt.runtime.v1.GlobalResponseStatus.
175
+ */
176
+ export const GlobalResponseStatusSchema = /*@__PURE__*/ enumDesc(file_mochabugapis_adapt_runtime_v1_store, 1);
177
+ /**
178
+ * OperationStatus represents the status of individual operations in a batch.
179
+ *
180
+ * @generated from enum mochabugapis.adapt.runtime.v1.OperationStatus
181
+ */
182
+ export var OperationStatus;
183
+ (function (OperationStatus) {
184
+ /**
185
+ * Default value that should never be used.
186
+ *
187
+ * @generated from enum value: OPERATION_STATUS_UNSPECIFIED = 0;
188
+ */
189
+ OperationStatus[OperationStatus["UNSPECIFIED"] = 0] = "UNSPECIFIED";
190
+ /**
191
+ * 200 OK
192
+ *
193
+ * @generated from enum value: OPERATION_STATUS_OK = 1;
194
+ */
195
+ OperationStatus[OperationStatus["OK"] = 1] = "OK";
196
+ /**
197
+ * 400 Bad Request
198
+ *
199
+ * @generated from enum value: OPERATION_STATUS_BAD_REQUEST = 2;
200
+ */
201
+ OperationStatus[OperationStatus["BAD_REQUEST"] = 2] = "BAD_REQUEST";
202
+ /**
203
+ * 404 Not Found
204
+ *
205
+ * @generated from enum value: OPERATION_STATUS_NOT_FOUND = 3;
206
+ */
207
+ OperationStatus[OperationStatus["NOT_FOUND"] = 3] = "NOT_FOUND";
208
+ /**
209
+ * 412 Precondition Failed
210
+ *
211
+ * @generated from enum value: OPERATION_STATUS_PRECONDITION_FAILED = 4;
212
+ */
213
+ OperationStatus[OperationStatus["PRECONDITION_FAILED"] = 4] = "PRECONDITION_FAILED";
214
+ /**
215
+ * 500 Internal Server Error
216
+ *
217
+ * @generated from enum value: OPERATION_STATUS_INTERNAL_SERVER_ERROR = 5;
218
+ */
219
+ OperationStatus[OperationStatus["INTERNAL_SERVER_ERROR"] = 5] = "INTERNAL_SERVER_ERROR";
220
+ })(OperationStatus || (OperationStatus = {}));
221
+ /**
222
+ * Describes the enum mochabugapis.adapt.runtime.v1.OperationStatus.
223
+ */
224
+ export const OperationStatusSchema = /*@__PURE__*/ enumDesc(file_mochabugapis_adapt_runtime_v1_store, 2);
225
+ //# sourceMappingURL=store_pb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store_pb.js","sourceRoot":"","sources":["../../../../../../src/genproto/mochabugapis/adapt/runtime/v1/store_pb.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAOjC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAGrG;;GAEG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAY,aAAa,CAC5E,QAAQ,CAAC,gpGAAgpG,EAAE,CAAC,0BAA0B,EAAE,2BAA2B,EAAE,8BAA8B,CAAC,CAAC,CAAC;AAuBxvG;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAyB,aAAa,CAC/D,WAAW,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;AAqC3D;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAyB,aAAa,CAC/D,WAAW,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;AAuB3D;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAmC,aAAa,CACnF,WAAW,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;AAuB3D;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA8B,aAAa,CACzE,WAAW,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;AA8B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,QAiDnB;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAsB,aAAa,CAC5D,QAAQ,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;AAExD;;;;GAIG;AACH,MAAM,CAAN,IAAY,oBAmCX;AAnCD,WAAY,oBAAoB;IAC9B;;;;OAIG;IACH,6EAAe,CAAA;IAEf;;;;OAIG;IACH,qEAAW,CAAA;IAEX;;;;OAIG;IACH,qFAAmB,CAAA;IAEnB;;;;OAIG;IACH,mEAAU,CAAA;IAEV;;;;OAIG;IACH,mFAAkB,CAAA;AACpB,CAAC,EAnCW,oBAAoB,KAApB,oBAAoB,QAmC/B;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAkC,aAAa,CACpF,QAAQ,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC;AAExD;;;;GAIG;AACH,MAAM,CAAN,IAAY,eA0CX;AA1CD,WAAY,eAAe;IACzB;;;;OAIG;IACH,mEAAe,CAAA;IAEf;;;;OAIG;IACH,iDAAM,CAAA;IAEN;;;;OAIG;IACH,mEAAe,CAAA;IAEf;;;;OAIG;IACH,+DAAa,CAAA;IAEb;;;;OAIG;IACH,mFAAuB,CAAA;IAEvB;;;;OAIG;IACH,uFAAyB,CAAA;AAC3B,CAAC,EA1CW,eAAe,KAAf,eAAe,QA0C1B;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA6B,aAAa,CAC1E,QAAQ,CAAC,wCAAwC,EAAE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { AutomationId, GetSessionRequest, GetSessionResponse, InheritSessionRequest, InheritSessionResponse, Output, ReadOutputRequest, ReadOutputResponse, ReadUrlsRequest, ReadUrlsResponse, Session, StartSessionRequest, StartSessionResponse, StopSessionRequest, Url } from "./genproto/mochabugapis/adapt/automations/v1/automations_pb";
2
+ export declare function startSession(req: StartSessionRequest, token?: string): Promise<StartSessionResponse>;
3
+ export declare function inheritSession(req: InheritSessionRequest, sessionToken: string): Promise<InheritSessionResponse>;
4
+ export declare function getSession(req: GetSessionRequest, sessionToken: string): Promise<GetSessionResponse>;
5
+ export declare function readOutput(req: ReadOutputRequest, sessionToken: string): Promise<ReadOutputResponse>;
6
+ export declare function readUrls(req: ReadUrlsRequest, sessionToken: string): Promise<ReadUrlsResponse>;
7
+ export declare function stopSession(req: StopSessionRequest, sessionToken: string): Promise<void>;
8
+ export declare class RestClientError extends Error {
9
+ status: number;
10
+ statusText: string;
11
+ response: Response;
12
+ constructor(response: Response);
13
+ }
14
+ export type SubscriptionOptions = {
15
+ sessionToken: string;
16
+ session: string;
17
+ automation: AutomationId;
18
+ onOutput?: (output: Output) => void;
19
+ onSession?: (session: Session) => void;
20
+ onUrl?: (url: Url) => void;
21
+ };
22
+ export declare class MqttClient {
23
+ private readonly clientId;
24
+ private mqttClient;
25
+ constructor(clientId: string);
26
+ subscribe(opts: SubscriptionOptions): Promise<void>;
27
+ unsubscribe(): Promise<void>;
28
+ }
29
+ export { AutomationId, GetSessionRequest, GetSessionResponse, InheritSessionRequest, InheritSessionResponse, Output, ReadOutputRequest, ReadOutputResponse, ReadUrlsRequest, ReadUrlsResponse, Session, StartSessionRequest, StartSessionResponse, StopSessionRequest, Url, };
package/dist/index.js ADDED
@@ -0,0 +1,175 @@
1
+ import { fromBinary, fromJsonString, toJsonString } from "@bufbuild/protobuf";
2
+ import mqtt from "mqtt";
3
+ import { GetSessionResponseSchema, InheritSessionRequestSchema, InheritSessionResponseSchema, OutputSchema, ReadOutputResponseSchema, ReadUrlsResponseSchema, SessionSchema, StartSessionRequestSchema, StartSessionResponseSchema, UrlSchema, } from "./genproto/mochabugapis/adapt/automations/v1/automations_pb";
4
+ const mqttUrl = "wss://adapt-dev.mochabugapis.com/mqtt";
5
+ const baseUrl = "https://adapt-dev.mochabugapis.com/v1/automations";
6
+ export async function startSession(req, token) {
7
+ const headers = new Headers({
8
+ "Content-Type": "application/json",
9
+ "Response-Type": "application/json",
10
+ });
11
+ if (token) {
12
+ headers.set("Authorization", `Bearer ${token}`);
13
+ }
14
+ const response = await fetch(`${baseUrl}/${req.automation.organization}/${req.automation.group}/${req.automation.automation}/start`, {
15
+ method: "POST",
16
+ body: toJsonString(StartSessionRequestSchema, req),
17
+ headers,
18
+ });
19
+ // Throw an error if the response is not OK
20
+ if (!response.ok) {
21
+ throw new RestClientError(response);
22
+ }
23
+ return fromJsonString(StartSessionResponseSchema, await response.text());
24
+ }
25
+ export async function inheritSession(req, sessionToken) {
26
+ const response = await fetch(`${baseUrl}/${req.automation.organization}/${req.automation.group}/${req.automation.automation}/session/inherit`, {
27
+ method: "POST",
28
+ body: toJsonString(InheritSessionRequestSchema, req),
29
+ headers: {
30
+ "Content-Type": "application/json",
31
+ "Response-Type": "application/json",
32
+ Authorization: `Bearer ${sessionToken}`,
33
+ },
34
+ });
35
+ // Throw an error if the response is not OK
36
+ if (!response.ok) {
37
+ throw new RestClientError(response);
38
+ }
39
+ return fromJsonString(InheritSessionResponseSchema, await response.text());
40
+ }
41
+ export async function getSession(req, sessionToken) {
42
+ const response = await fetch(`${baseUrl}/${req.automation.organization}/${req.automation.group}/${req.automation.automation}/session/status`, {
43
+ method: "GET",
44
+ headers: {
45
+ "Response-Type": "application/json",
46
+ Authorization: `Bearer ${sessionToken}`,
47
+ },
48
+ });
49
+ // Throw an error if the response is not OK
50
+ if (!response.ok) {
51
+ throw new RestClientError(response);
52
+ }
53
+ return fromJsonString(GetSessionResponseSchema, await response.text());
54
+ }
55
+ export async function readOutput(req, sessionToken) {
56
+ const response = await fetch(`${baseUrl}/${req.automation.organization}/${req.automation.group}/${req.automation.automation}/session/output`, {
57
+ method: "GET",
58
+ headers: {
59
+ "Response-Type": "application/json",
60
+ Authorization: `Bearer ${sessionToken}`,
61
+ },
62
+ });
63
+ // Throw an error if the response is not OK
64
+ if (!response.ok) {
65
+ throw new RestClientError(response);
66
+ }
67
+ return fromJsonString(ReadOutputResponseSchema, await response.text());
68
+ }
69
+ export async function readUrls(req, sessionToken) {
70
+ const response = await fetch(`${baseUrl}/${req.automation.organization}/${req.automation.group}/${req.automation.automation}/session/urls`, {
71
+ method: "GET",
72
+ headers: {
73
+ "Response-Type": "application/json",
74
+ Authorization: `Bearer ${sessionToken}`,
75
+ },
76
+ });
77
+ // Throw an error if the response is not OK
78
+ if (!response.ok) {
79
+ throw new RestClientError(response);
80
+ }
81
+ return fromJsonString(ReadUrlsResponseSchema, await response.text());
82
+ }
83
+ export async function stopSession(req, sessionToken) {
84
+ const response = await fetch(`${baseUrl}/${req.automation.organization}/${req.automation.group}/${req.automation.automation}/session/stop`, {
85
+ method: "DELETE",
86
+ headers: {
87
+ Authorization: `Bearer ${sessionToken}`,
88
+ },
89
+ });
90
+ // Throw an error if the response is not OK
91
+ if (!response.ok) {
92
+ throw new RestClientError(response);
93
+ }
94
+ }
95
+ // Define a custom error class
96
+ export class RestClientError extends Error {
97
+ constructor(response) {
98
+ super(`HTTP Error: ${response.status} ${response.statusText}`);
99
+ this.name = "RestClientError";
100
+ this.status = response.status;
101
+ this.statusText = response.statusText;
102
+ this.response = response;
103
+ }
104
+ }
105
+ export class MqttClient {
106
+ constructor(clientId) {
107
+ this.mqttClient = null;
108
+ this.clientId = clientId;
109
+ this.subscribe = this.subscribe.bind(this);
110
+ this.unsubscribe = this.unsubscribe.bind(this);
111
+ }
112
+ async subscribe(opts) {
113
+ this.unsubscribe();
114
+ this.mqttClient = await mqtt.connectAsync(mqttUrl, {
115
+ transformWsUrl: (url, options) => {
116
+ options.password = opts.sessionToken;
117
+ return url;
118
+ },
119
+ clientId: this.clientId,
120
+ password: opts.sessionToken,
121
+ clean: false,
122
+ keepalive: 20,
123
+ protocolVersion: 5,
124
+ });
125
+ // Start by subscribing to the message so that we don't miss anything
126
+ this.mqttClient.on("message", (topic, _, packet) => {
127
+ if (!(packet.payload instanceof Uint8Array)) {
128
+ throw new Error("Payload is not a Uint8Array. The wireformat must be binary");
129
+ }
130
+ if (topic.endsWith("session")) {
131
+ if (opts?.onSession) {
132
+ opts.onSession(fromBinary(SessionSchema, packet.payload));
133
+ }
134
+ }
135
+ else if (topic.endsWith("url")) {
136
+ if (opts?.onUrl) {
137
+ opts.onUrl(fromBinary(UrlSchema, packet.payload));
138
+ }
139
+ }
140
+ else if (topic.endsWith("output")) {
141
+ if (opts?.onOutput) {
142
+ opts.onOutput(fromBinary(OutputSchema, packet.payload));
143
+ }
144
+ }
145
+ else {
146
+ console.error("Unknown topic", topic);
147
+ }
148
+ });
149
+ // Let us now subscribe to all of the requested topics
150
+ const baseTopic = `org/${opts.automation.organization}/ag/${opts.automation.group}/aut/${opts.automation.automation}/session/${opts.session}`;
151
+ const options = {
152
+ qos: 1,
153
+ nl: true,
154
+ rh: 0,
155
+ rap: false,
156
+ };
157
+ const subs = [];
158
+ if (opts.onSession) {
159
+ subs.push(this.mqttClient.subscribeAsync(`${baseTopic}/session`, options));
160
+ }
161
+ if (opts.onUrl) {
162
+ subs.push(this.mqttClient.subscribeAsync(`${baseTopic}/url`, options));
163
+ }
164
+ if (opts.onOutput) {
165
+ subs.push(this.mqttClient.subscribeAsync(`${baseTopic}/output`, options));
166
+ }
167
+ await Promise.all(subs);
168
+ }
169
+ async unsubscribe() {
170
+ if (this.mqttClient) {
171
+ await this.mqttClient.endAsync(true);
172
+ }
173
+ }
174
+ }
175
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAIL,wBAAwB,EAExB,2BAA2B,EAE3B,4BAA4B,EAE5B,YAAY,EAGZ,wBAAwB,EAGxB,sBAAsB,EAEtB,aAAa,EAEb,yBAAyB,EAEzB,0BAA0B,EAG1B,SAAS,GACV,MAAM,6DAA6D,CAAC;AAErE,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AE,CAAC;YACN,EAAE,EAAE,IAAI;YACR,EAAE,EAAE,CAAC;YACL,GAAG,EAAE,KAAK;SACqB,CAAC;QAClC,MAAM,IAAI,GAAG,EAAE,CAAC;QAChB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,IAAI,CAAC,IAAI,CACP,IAAI,CAAC,UAAW,CAAC,cAAc,CAAC,GAAG,SAAS,UAAU,EAAE,OAAO,CAAC,CACjE,CAAC;QACJ,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAW,CAAC,cAAc,CAAC,GAAG,SAAS,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAC1E,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,IAAI,CACP,IAAI,CAAC,UAAW,CAAC,cAAc,CAAC,GAAG,SAAS,SAAS,EAAE,OAAO,CAAC,CAChE,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAEM,KAAK,CAAC,WAAW;QACtB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;CACF"}
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@mochabug/adapt-web",
3
+ "version": "0.0.1-beta",
4
+ "description": "The client library to execute automations, without effort, in a browser environment",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "generate": "cd ../../ && buf generate --include-imports --template clients/web/buf.gen.yaml",
13
+ "build": "npm run generate && tsc"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/mochabug/adapt-automation-clients.git"
18
+ },
19
+ "keywords": [
20
+ "adapt",
21
+ "automations",
22
+ "mochabug"
23
+ ],
24
+ "author": "mochabug AB",
25
+ "license": "ISC",
26
+ "bugs": {
27
+ "url": "https://github.com/mochabug/adapt-automation-clients/issues"
28
+ },
29
+ "homepage": "https://github.com/mochabug/adapt-automation-clients#readme",
30
+ "devDependencies": {
31
+ "typescript": "^5.7.2"
32
+ },
33
+ "dependencies": {
34
+ "@bufbuild/protobuf": "^2.2.2",
35
+ "mqtt": "^5.10.3"
36
+ }
37
+ }