swoop-common 2.2.135 → 2.2.136

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.
@@ -7,7 +7,8 @@ export declare const InternalServices: {
7
7
  export declare const init: (opts: {
8
8
  coreServiceUrl: string;
9
9
  swoopServiceForwardUrl: string;
10
- token: string | (() => Promise<string>);
10
+ token?: string | (() => Promise<string>);
11
+ headers?: Record<string, string> | (() => Promise<Record<string, string>>);
11
12
  }) => {
12
13
  SwoopService: Swoop.SwoopService;
13
14
  CoreService: Core.CoreService;
package/dist/api/init.js CHANGED
@@ -18,6 +18,11 @@ export const init = (opts) => {
18
18
  // Token
19
19
  Core.OpenAPI.TOKEN = opts.token;
20
20
  Swoop.OpenAPI.TOKEN = opts.token;
21
+ // Custom headers
22
+ if (opts.headers) {
23
+ Core.OpenAPI.HEADERS = opts.headers;
24
+ Swoop.OpenAPI.HEADERS = opts.headers;
25
+ }
21
26
  initalised = true;
22
27
  return {
23
28
  SwoopService: new Swoop.SwoopService(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swoop-common",
3
- "version": "2.2.135",
3
+ "version": "2.2.136",
4
4
  "main": "dist/api/index.js",
5
5
  "types": "dist/api/index.d.ts",
6
6
  "exports": {