@sera4/essentia 1.1.41 → 1.1.42

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.
@@ -142,21 +142,24 @@ export class TestServerWrapper {
142
142
  return this.routePrinter.getAll();
143
143
  }
144
144
 
145
- // Support for injecting certain memberships in every request
146
- withMembership (m) {
147
- const headers = { field: "tws-membership", value: JSON.stringify(m) }
145
+ withHeader (h) {
148
146
  return {
149
- get: (url, options) => this.get(url, {...headers, ...options}),
150
- post: (url, options) => this.post(url, {...headers, ...options}),
151
- put: (url, options) => this.put(url, {...headers, ...options}),
152
- delete: (url, options) => this.delete(url, {...headers, ...options}),
153
- upload: (url, fields, file, options) => this.upload(url, fields, file, {...headers, ...options}),
147
+ get: (url, options) => this.get(url, {...h, ...options}),
148
+ post: (url, options) => this.post(url, {...h, ...options}),
149
+ put: (url, options) => this.put(url, {...h, ...options}),
150
+ delete: (url, options) => this.delete(url, {...h, ...options}),
151
+ upload: (url, fields, file, options) => this.upload(url, fields, file, {...h, ...options}),
154
152
  stop: this.stop,
155
153
  allRoutes: this.allRoutes,
156
154
  v1: this.v1
157
155
  }
158
156
  }
159
157
 
158
+ withMembership (m) {
159
+ const h = { field: "tws-membership", value: JSON.stringify(m) }
160
+ return this.withHeader(h);
161
+ }
162
+
160
163
  withS4 () {
161
164
  return this.withMembership({s4_role: 1, id: uuidv4(), account_id: uuidv4(), tenant_id: uuidv4()});
162
165
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sera4/essentia",
3
- "version": "1.1.41",
3
+ "version": "1.1.42",
4
4
  "description": "A library of utilities for Teleporte Web Services",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/package.tar.gz CHANGED
Binary file