swoop-common 2.1.3 → 2.1.5

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.
@@ -10,6 +10,7 @@ export declare const init: (opts: {
10
10
  itineraryServiceUrl: string;
11
11
  coreServiceUrl: string;
12
12
  swoopServiceForwardUrl: string;
13
+ token: string;
13
14
  }) => {
14
15
  SwoopService: Swoop.SwoopService;
15
16
  CoreService: Core.CoreService;
package/dist/api/init.js CHANGED
@@ -20,6 +20,9 @@ export const init = (opts) => {
20
20
  Core.OpenAPI.BASE = opts.coreServiceUrl;
21
21
  Itinerary.OpenAPI.BASE = opts.itineraryServiceUrl;
22
22
  Swoop.OpenAPI.BASE = opts.swoopServiceForwardUrl;
23
+ // Token
24
+ Core.OpenAPI.TOKEN = opts.token;
25
+ Itinerary.OpenAPI.TOKEN = opts.token;
23
26
  initalised = true;
24
27
  return {
25
28
  SwoopService: new Swoop.SwoopService(),
@@ -37,8 +37,6 @@ const defaultConverter = (field, stage, omitTitle, isChild) => {
37
37
  "\nFull object: " +
38
38
  JSON.stringify(field, null, 2));
39
39
  const requiredFields = [];
40
- if (field.required && field.fieldType !== "boolean")
41
- requiredFields.push(field.name);
42
40
  // Specific for array
43
41
  let arrayItems = field.fieldType === "array"
44
42
  ? defaultConverter((_b = field.arrayOptions) === null || _b === void 0 ? void 0 : _b.itemDefinition, stage, true, true)
@@ -76,5 +74,5 @@ const defaultConverter = (field, stage, omitTitle, isChild) => {
76
74
  ? { "x-templateIds": (_e = field.componentOptions) === null || _e === void 0 ? void 0 : _e.templateIds }
77
75
  : {};
78
76
  let title = omitTitle ? undefined : field.name;
79
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (!isChild && !(Array.isArray(field.editableIn) ? field.editableIn : []).map(Number).includes(stage) && { readOnly: true })), { title, type: schema.schema.type, "x-type": schema.schema["x-type"] }), templates), (schema.schema.type === "object" && { properties })), { required: requiredFields }), (enumOpts && { enum: enumOpts })), (stagedEnumOpts && { items: { enum: stagedEnumOpts, type: "string" } })), (arrayItems && { items: arrayItems })), (field.fieldType === "object" && { properties }));
77
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (!isChild && !(Array.isArray(field.editableIn) ? field.editableIn : []).map(Number).includes(stage) && { readOnly: true })), { title, type: schema.schema.type, "x-type": schema.schema["x-type"] }), templates), (schema.schema.type === "object" && { properties })), (field.fieldType === "object" && { required: requiredFields })), (enumOpts && { enum: enumOpts })), (stagedEnumOpts && { items: { enum: stagedEnumOpts, type: "string" } })), (arrayItems && { items: arrayItems })), (field.fieldType === "object" && { properties }));
80
78
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swoop-common",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "main": "dist/api/index.js",
5
5
  "types": "dist/api/index.d.ts",
6
6
  "exports": {