@dxos/edge-client 0.8.4-main.72ec0f3 → 0.8.4-main.7ace549

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": "@dxos/edge-client",
3
- "version": "0.8.4-main.72ec0f3",
3
+ "version": "0.8.4-main.7ace549",
4
4
  "description": "EDGE Client",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -45,21 +45,21 @@
45
45
  "@effect/platform": "^0.92.1",
46
46
  "isomorphic-ws": "^5.0.0",
47
47
  "ws": "^8.14.2",
48
- "@dxos/async": "0.8.4-main.72ec0f3",
49
- "@dxos/context": "0.8.4-main.72ec0f3",
50
- "@dxos/credentials": "0.8.4-main.72ec0f3",
51
- "@dxos/invariant": "0.8.4-main.72ec0f3",
52
- "@dxos/debug": "0.8.4-main.72ec0f3",
53
- "@dxos/keyring": "0.8.4-main.72ec0f3",
54
- "@dxos/crypto": "0.8.4-main.72ec0f3",
55
- "@dxos/log": "0.8.4-main.72ec0f3",
56
- "@dxos/keys": "0.8.4-main.72ec0f3",
57
- "@dxos/node-std": "0.8.4-main.72ec0f3",
58
- "@dxos/util": "0.8.4-main.72ec0f3",
59
- "@dxos/protocols": "0.8.4-main.72ec0f3"
48
+ "@dxos/async": "0.8.4-main.7ace549",
49
+ "@dxos/context": "0.8.4-main.7ace549",
50
+ "@dxos/credentials": "0.8.4-main.7ace549",
51
+ "@dxos/debug": "0.8.4-main.7ace549",
52
+ "@dxos/invariant": "0.8.4-main.7ace549",
53
+ "@dxos/crypto": "0.8.4-main.7ace549",
54
+ "@dxos/keyring": "0.8.4-main.7ace549",
55
+ "@dxos/keys": "0.8.4-main.7ace549",
56
+ "@dxos/log": "0.8.4-main.7ace549",
57
+ "@dxos/util": "0.8.4-main.7ace549",
58
+ "@dxos/protocols": "0.8.4-main.7ace549",
59
+ "@dxos/node-std": "0.8.4-main.7ace549"
60
60
  },
61
61
  "devDependencies": {
62
- "@dxos/test-utils": "0.8.4-main.72ec0f3"
62
+ "@dxos/test-utils": "0.8.4-main.7ace549"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "effect": "^3.13.3"
@@ -19,6 +19,7 @@ import {
19
19
  type CreateSpaceResponseBody,
20
20
  EdgeAuthChallengeError,
21
21
  EdgeCallFailedError,
22
+ type EdgeFailure,
22
23
  type EdgeStatus,
23
24
  type ExecuteWorkflowResponseBody,
24
25
  type ExportBundleRequest,
@@ -75,12 +76,6 @@ type EdgeHttpRequestArgs = {
75
76
  */
76
77
  json?: boolean;
77
78
 
78
- /**
79
- * Do not expect a standard EDGE JSON response with a `success` field.
80
- * @deprecated Use only for debugging.
81
- */
82
- rawResponse?: boolean;
83
-
84
79
  /**
85
80
  * Force authentication.
86
81
  * This should be used for requests with large bodies to avoid sending the body twice.
@@ -325,7 +320,6 @@ export class EdgeHttpClient {
325
320
  ...args,
326
321
  body: input,
327
322
  method: 'POST',
328
- rawResponse: true,
329
323
  });
330
324
  }
331
325
 
@@ -354,6 +348,12 @@ export class EdgeHttpClient {
354
348
  return this._call(new URL(`/test/functions/${spaceId}/triggers/crons`, this.baseUrl), { method: 'GET' });
355
349
  }
356
350
 
351
+ public async forceRunCronTrigger(spaceId: SpaceId, triggerId: ObjectId) {
352
+ return this._call(new URL(`/test/functions/${spaceId}/triggers/crons/${triggerId}/run`, this.baseUrl), {
353
+ method: 'POST',
354
+ });
355
+ }
356
+
357
357
  //
358
358
  // Import/Export space.
359
359
  //
@@ -418,9 +418,6 @@ export class EdgeHttpClient {
418
418
 
419
419
  if (response.ok) {
420
420
  const body = await response.clone().json();
421
- if (args.rawResponse) {
422
- return body as any;
423
- }
424
421
  invariant(body, 'Expected body to be present');
425
422
  if (!('success' in body)) {
426
423
  return body;
@@ -434,13 +431,13 @@ export class EdgeHttpClient {
434
431
  continue;
435
432
  }
436
433
 
437
- const body =
434
+ const body: EdgeFailure =
438
435
  response.headers.get('Content-Type') === 'application/json' ? await response.clone().json() : undefined;
439
436
 
440
437
  invariant(!body?.success, 'Expected body to not be a failure response or undefined.');
441
438
 
442
- if (body?.errorData?.type === 'auth_challenge' && typeof body?.errorData?.challenge === 'string') {
443
- processingError = new EdgeAuthChallengeError(body.errorData.challenge, body.errorData);
439
+ if (body?.data?.type === 'auth_challenge' && typeof body?.data?.challenge === 'string') {
440
+ processingError = new EdgeAuthChallengeError(body.data.challenge, body.data);
444
441
  } else if (body?.success === false) {
445
442
  processingError = EdgeCallFailedError.fromUnsuccessfulResponse(response, body);
446
443
  } else {