@compassdigital/sdk.typescript 4.10.0 → 4.12.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.
@@ -5,30 +5,9 @@ export type RequestQuery<T extends object> = {
5
5
  [K in keyof T]: T[K] extends number|undefined ? string : T[K];
6
6
  }
7
7
 
8
- /**
9
- * Provider TokenDetails
10
- */
11
- export interface RequestContextSession {
12
- user_id: string;
13
- expiry: Date | null;
14
- iat: Date;
15
- scopes: string;
16
- sub: string;
17
- domain?: string;
18
- }
19
-
20
- /**
21
- * Provider request context.
22
- */
23
- export interface RequestContext {
24
- method?: string;
25
- session?: RequestContextSession;
26
- }
27
-
28
8
  /**
29
9
  * All requests implement this interface.
30
10
  */
31
11
  export interface BaseRequest {
32
- context?: RequestContext;
33
12
  headers?: Record<string, string>;
34
13
  }
@@ -198,35 +198,5 @@ describe('ServiceClient', () => {
198
198
  const promise = api.get_task('').combine(500);
199
199
  expect(promise).rejects.toThrow();
200
200
  });
201
-
202
- test('method should throw custom error', async () => {
203
- const err = new Error('my error');
204
- const api = new ServiceClient({
205
- intercept: interceptor(400, '{}'),
206
- throws: err,
207
- });
208
- const promise = api.get_task('');
209
- expect(promise).rejects.toThrow(err);
210
- });
211
-
212
- test('combine and should work with custom error', async () => {
213
- const api = new ServiceClient({
214
- intercept: interceptor(400, '{}'),
215
- throws: new Error('custom'),
216
- });
217
- const res = await api.get_task('{}').combine(400);
218
- expect(res.ok).toBe(false);
219
- expect(res.err).toBeInstanceOf(ServiceError);
220
- });
221
-
222
- test('ignore and should work with custom error', async () => {
223
- const err = new Error('custom');
224
- const api = new ServiceClient({
225
- intercept: interceptor(400, '{}'),
226
- throws: err,
227
- });
228
- const res = await api.get_task('{}').ignore(400);
229
- expect(res).toBeNull();
230
- });
231
201
  });
232
202
  });