@mentra/cloud-client 3.3.0-dev.882 → 3.3.0-dev.884

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mentra/cloud-client",
3
- "version": "3.3.0-dev.882",
3
+ "version": "3.3.0-dev.884",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "exports": {
@@ -12,7 +12,7 @@
12
12
  "test": "bun test"
13
13
  },
14
14
  "dependencies": {
15
- "@mentra/cloud-protocol": "3.3.0-dev.882",
15
+ "@mentra/cloud-protocol": "3.3.0-dev.884",
16
16
  "tweetnacl": "^1.0.3"
17
17
  },
18
18
  "devDependencies": {
@@ -74,11 +74,12 @@ export interface CoreDeps {
74
74
  export class Core {
75
75
  readonly reports: {
76
76
  getLogCollection(reportId: string, signal?: AbortSignal): Promise<ReportLogCollectionSnapshot>;
77
- submit(input: SubmitReportInput): Promise<SubmitReportResult>;
77
+ submit(input: SubmitReportInput, signal?: AbortSignal): Promise<SubmitReportResult>;
78
78
  updateLogCollection(
79
79
  reportId: string,
80
80
  source: ReportLogSource,
81
81
  update: ReportLogCollectionUpdate,
82
+ signal?: AbortSignal,
82
83
  ): Promise<void>;
83
84
  addLogs(
84
85
  reportId: string,
@@ -89,13 +90,14 @@ export class Core {
89
90
  addScreenshots(
90
91
  reportId: string,
91
92
  images: ReportAttachmentInput[],
93
+ signal?: AbortSignal,
92
94
  ): Promise<AddReportArtifactsResult>;
93
95
  addVideos(
94
96
  reportId: string,
95
97
  source: string,
96
98
  videos: ReportAttachmentInput[],
97
99
  ): Promise<AddReportArtifactsResult>;
98
- complete(reportId: string): Promise<{ status: ReportStatus }>;
100
+ complete(reportId: string, signal?: AbortSignal): Promise<{ status: ReportStatus }>;
99
101
  };
100
102
  readonly supportProfile: {
101
103
  update(input: SupportStateInput): Promise<SupportProfileUpdateResult>;
@@ -128,6 +128,7 @@ export interface AddReportLogsOptions {
128
128
  * HTTP 409. A Cloud that predates the field ignores it and stores a new artifact.
129
129
  */
130
130
  retryKey?: string;
131
+ signal?: AbortSignal;
131
132
  }
132
133
 
133
134
  export interface ReportsDeps {
@@ -141,8 +142,8 @@ export class Reports {
141
142
  this.http = deps.http;
142
143
  }
143
144
 
144
- submit(input: SubmitReportInput): Promise<SubmitReportResult> {
145
- return this.http.post<SubmitReportResult>(REPORTS_PATH, input);
145
+ submit(input: SubmitReportInput, signal?: AbortSignal): Promise<SubmitReportResult> {
146
+ return this.http.post<SubmitReportResult>(REPORTS_PATH, input, {signal});
146
147
  }
147
148
 
148
149
  /** Read the current source receipts with the same user session used to submit. */
@@ -181,10 +182,12 @@ export class Reports {
181
182
  reportId: string,
182
183
  source: ReportLogSource,
183
184
  update: ReportLogCollectionUpdate,
185
+ signal?: AbortSignal,
184
186
  ): Promise<void> {
185
187
  return this.http.post<void>(
186
188
  `${REPORTS_PATH}/${encodeURIComponent(reportId)}/log-collection/${source}`,
187
189
  update,
190
+ {signal},
188
191
  );
189
192
  }
190
193
 
@@ -202,12 +205,14 @@ export class Reports {
202
205
  entries,
203
206
  ...(options.retryKey !== undefined ? { retryKey: options.retryKey } : {}),
204
207
  },
208
+ {signal: options.signal},
205
209
  );
206
210
  }
207
211
 
208
212
  addScreenshots(
209
213
  reportId: string,
210
214
  images: ReportAttachmentInput[],
215
+ signal?: AbortSignal,
211
216
  ): Promise<AddReportArtifactsResult> {
212
217
  const form = new FormData();
213
218
  form.append("type", "screenshot");
@@ -232,6 +237,7 @@ export class Reports {
232
237
  return this.http.postForm<AddReportArtifactsResult>(
233
238
  `${REPORTS_PATH}/${encodeURIComponent(reportId)}/artifacts`,
234
239
  form,
240
+ {signal},
235
241
  );
236
242
  }
237
243
 
@@ -273,10 +279,11 @@ export class Reports {
273
279
  );
274
280
  }
275
281
 
276
- complete(reportId: string): Promise<{ status: ReportStatus }> {
282
+ complete(reportId: string, signal?: AbortSignal): Promise<{ status: ReportStatus }> {
277
283
  return this.http.post<{ status: ReportStatus }>(
278
284
  `${REPORTS_PATH}/${encodeURIComponent(reportId)}/complete`,
279
285
  {},
286
+ {signal},
280
287
  );
281
288
  }
282
289
  }