swoop-common 2.2.83 → 2.2.85

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/README.md CHANGED
@@ -1,225 +1,225 @@
1
- .# Swoop Library
2
-
3
- This library is used for rendering **Swoop itinerary templates**.
4
- It provides tools for defining **custom field types**, registering **custom components**,
5
- rendering templates from a **MasterSchema**, and includes SDKs for all related services.
6
- It supports both input mode (for creating templates) and presentation mode (for rendering them for end users).
7
- The schema system is stage-aware, enabling precise control over what data is editable or displayed at which stage.
8
-
9
- > Note: This package is intended for internal use only.
10
-
11
- ---
12
-
13
- # Swoop Library
14
-
15
- ## Initialization
16
-
17
- Before using the Swoop Library, you must initialize it with service URLs:
18
-
19
- ```ts
20
- import { init } from "swoop-common";
21
-
22
- init({
23
- coreServiceUrl: "https://your.core.service",
24
- swoopServiceForwardUrl: "https://your.forward.service",
25
- });
26
- ```
27
-
28
- ## Service Interfaces
29
-
30
- The library provides three primary service interfaces to interact with backend systems:
31
-
32
- - **SwoopService** — Interfaces with the Swoop API.
33
- - **CoreService** — For core service.
34
-
35
- These interfaces offer convenient methods to work seamlessly with the underlying services required by the itinerary system.
36
-
37
- ## StyledFormView
38
-
39
- The `StyledFormView` component is the entry point for rendering a full itinerary template. It handles schema parsing and renderer injection based on mode and form stage.
40
-
41
- ```tsx
42
- import { StyledFormView } from "your-form-library";
43
-
44
- <StyledFormView
45
- initialData={/* object */}
46
- schema={/* MasterSchema */}
47
- onChange={(val) => console.log(val)}
48
- pool="FORM"
49
- readonly={false}
50
- stage="Inst"
51
- />;
52
- ```
53
-
54
- ### Props
55
-
56
- | Name | Type | Description |
57
- | ----------- | -------------------- | ------------------------------------------------------------------ |
58
- | initialData | `any` | Initial values for the template. Should not be updated frequently. |
59
- | schema | `MasterSchema` | Template definition object. |
60
- | onChange | `(val: any) => void` | Callback with updated data. |
61
- | pool | `ComponentPool` | `"FORM"` or `"PRESENTATION"` depending on context. |
62
- | readonly | `boolean` | Disables inputs if true (only relevant in FORM pool). |
63
- | stage | `Stage` | Controls which data segment is being rendered. |
64
-
65
- ### Stages
66
-
67
- The template system is divided into stages:
68
-
69
- - **Stage.Comp** – Data stored on the root component, often static (e.g. metadata, titles). Does not include any dynamic or time-based fields.
70
- - **Stage.Inst** – Instance-specific data (e.g. timings, localized notes). This is the most common stage for editable fields.
71
- - **Stage.User** – Data unique to individual users (e.g. room number).
72
-
73
- Each stage builds on the one before it. For example, `Stage.User` includes everything from `Stage.Comp` and `Stage.Inst`. Fields are editable based on the current stage. If a value is defined in two stages, the lower stage will take priority.
74
-
75
- ---
76
-
77
- ## Custom Components
78
-
79
- Custom components define how individual fields render. These can behave like typical form inputs or be used for display-only formatting in the `PRESENTATION` pool.
80
-
81
- ### Example
82
-
83
- ```tsx
84
- const FormExample: React.FC<Props> = ({
85
- text,
86
- onChange,
87
- getError,
88
- label,
89
- enabled,
90
- }) => {
91
- const [val, setVal] = useState(text);
92
- const error = getError ? getError("example")?.message : undefined;
93
- const onChangeDebounced = useMemo(() => debounce(onChange, 300), [onChange]);
94
-
95
- const update = (value: string) => {
96
- setVal(value);
97
- onChangeDebounced(value);
98
- };
99
-
100
- return (
101
- <Paper
102
- sx={{
103
- display: "flex",
104
- flexDirection: "column",
105
- gap: 1,
106
- p: 2,
107
- background: "#CBC3E3",
108
- mb: 1,
109
- }}
110
- >
111
- {!enabled && "THIS IS DISABLED"}
112
- <Typography variant="h6">{label}</Typography>
113
- <TextField
114
- label="Example label"
115
- value={val}
116
- onChange={(e) => update(e.target.value)}
117
- error={!!error}
118
- helperText={error}
119
- disabled={!enabled}
120
- />
121
- </Paper>
122
- );
123
- };
124
-
125
- const FormRendererExample: React.FC<ControlProps> = ({
126
- data,
127
- handleChange,
128
- path,
129
- label,
130
- enabled,
131
- }) => {
132
- const getError = useLocalErrors(path);
133
- return (
134
- <FormExample
135
- text={data as string}
136
- onChange={(val) => handleChange(path, val)}
137
- getError={getError}
138
- label={label}
139
- enabled={enabled}
140
- />
141
- );
142
- };
143
-
144
- registerComponent("example", FormRendererExample, ComponentPool.FORM);
145
- registerComponent("example", FormRendererExample, ComponentPool.PRESENTATION);
146
- ```
147
-
148
- > Important: You **cannot register two components with the same name within the same pool**. You _can_ register the same component name across different pools (e.g., `"example"` in both `"FORM"` and `"PRESENTATION"`).
149
-
150
- ### Presentation Pool
151
-
152
- The `PRESENTATION` pool is more than just read-only. It is designed for **customer-facing output**, rendering fields in a clean, non-form-like layout for readability and professionalism.
153
-
154
- ---
155
-
156
- ## Custom Types
157
-
158
- Custom field types define what kinds of fields can be used when **building a template**. These appear in the template builder UI as selectable field types and control how data is validated and configured.
159
-
160
- ### Syntax
161
-
162
- ```ts
163
- registerType(
164
- "typeId", // Unique type string
165
- "Display Name", // Name shown in template builder
166
- schema, // JSON Schema defining the data structure
167
- optionsSchema, // JSON Schema defining configuration data structure
168
- requiredOptions // boolean: must the options be filled?
169
- );
170
- ```
171
-
172
- ### Example
173
-
174
- ```ts
175
- registerType(
176
- "enum",
177
- "Dropdown",
178
- { type: "array" },
179
- {
180
- type: "object",
181
- title: "Dropdown Options",
182
- properties: {
183
- enumValues: {
184
- title: "Dropdown Values",
185
- type: "array",
186
- items: { type: "string" },
187
- },
188
- },
189
- },
190
- true
191
- );
192
- ```
193
-
194
- This type defines a dropdown field where the values are defined via the `enumValues` property in the template configuration.
195
-
196
- ### Custom Option Editors
197
-
198
- If you want to render a **custom options block** (i.e., how the field type's options are displayed in the template editor), you must do the following:
199
-
200
- 1. In the top-level `optionsSchema` of the type, define `"x-type": "yourTypeName"`
201
- 2. Create and register a custom component with the name `"yourTypeName"` in the `"FORM"` pool.
202
-
203
- This component will then be used to render the configuration UI for that field type.
204
-
205
- ---
206
-
207
- ## File Locations
208
-
209
- - **Custom components** must be placed in `src/renderers`. They may be nested within subfolders. All files inside `renderers/` will be automatically imported in the correct order.
210
- - **Custom types** must be added to `src/default_registration/fields_base.tsx`.
211
-
212
- No manual import wiring is required beyond placing the file in the correct folder.
213
-
214
- ---
215
-
216
- ## Publishing to NPM
217
-
218
- To publish a new version of the package:
219
-
220
- ```bash
221
- npm run build # Compile the package
222
- npm version patch # Bump the patch version (or use minor/major as needed)
223
- npm adduser # Log in to NPM (if not already)
224
- npm publish # Publish the package
225
- ```
1
+ .# Swoop Library
2
+
3
+ This library is used for rendering **Swoop itinerary templates**.
4
+ It provides tools for defining **custom field types**, registering **custom components**,
5
+ rendering templates from a **MasterSchema**, and includes SDKs for all related services.
6
+ It supports both input mode (for creating templates) and presentation mode (for rendering them for end users).
7
+ The schema system is stage-aware, enabling precise control over what data is editable or displayed at which stage.
8
+
9
+ > Note: This package is intended for internal use only.
10
+
11
+ ---
12
+
13
+ # Swoop Library
14
+
15
+ ## Initialization
16
+
17
+ Before using the Swoop Library, you must initialize it with service URLs:
18
+
19
+ ```ts
20
+ import { init } from "swoop-common";
21
+
22
+ init({
23
+ coreServiceUrl: "https://your.core.service",
24
+ swoopServiceForwardUrl: "https://your.forward.service",
25
+ });
26
+ ```
27
+
28
+ ## Service Interfaces
29
+
30
+ The library provides three primary service interfaces to interact with backend systems:
31
+
32
+ - **SwoopService** — Interfaces with the Swoop API.
33
+ - **CoreService** — For core service.
34
+
35
+ These interfaces offer convenient methods to work seamlessly with the underlying services required by the itinerary system.
36
+
37
+ ## StyledFormView
38
+
39
+ The `StyledFormView` component is the entry point for rendering a full itinerary template. It handles schema parsing and renderer injection based on mode and form stage.
40
+
41
+ ```tsx
42
+ import { StyledFormView } from "your-form-library";
43
+
44
+ <StyledFormView
45
+ initialData={/* object */}
46
+ schema={/* MasterSchema */}
47
+ onChange={(val) => console.log(val)}
48
+ pool="FORM"
49
+ readonly={false}
50
+ stage="Inst"
51
+ />;
52
+ ```
53
+
54
+ ### Props
55
+
56
+ | Name | Type | Description |
57
+ | ----------- | -------------------- | ------------------------------------------------------------------ |
58
+ | initialData | `any` | Initial values for the template. Should not be updated frequently. |
59
+ | schema | `MasterSchema` | Template definition object. |
60
+ | onChange | `(val: any) => void` | Callback with updated data. |
61
+ | pool | `ComponentPool` | `"FORM"` or `"PRESENTATION"` depending on context. |
62
+ | readonly | `boolean` | Disables inputs if true (only relevant in FORM pool). |
63
+ | stage | `Stage` | Controls which data segment is being rendered. |
64
+
65
+ ### Stages
66
+
67
+ The template system is divided into stages:
68
+
69
+ - **Stage.Comp** – Data stored on the root component, often static (e.g. metadata, titles). Does not include any dynamic or time-based fields.
70
+ - **Stage.Inst** – Instance-specific data (e.g. timings, localized notes). This is the most common stage for editable fields.
71
+ - **Stage.User** – Data unique to individual users (e.g. room number).
72
+
73
+ Each stage builds on the one before it. For example, `Stage.User` includes everything from `Stage.Comp` and `Stage.Inst`. Fields are editable based on the current stage. If a value is defined in two stages, the lower stage will take priority.
74
+
75
+ ---
76
+
77
+ ## Custom Components
78
+
79
+ Custom components define how individual fields render. These can behave like typical form inputs or be used for display-only formatting in the `PRESENTATION` pool.
80
+
81
+ ### Example
82
+
83
+ ```tsx
84
+ const FormExample: React.FC<Props> = ({
85
+ text,
86
+ onChange,
87
+ getError,
88
+ label,
89
+ enabled,
90
+ }) => {
91
+ const [val, setVal] = useState(text);
92
+ const error = getError ? getError("example")?.message : undefined;
93
+ const onChangeDebounced = useMemo(() => debounce(onChange, 300), [onChange]);
94
+
95
+ const update = (value: string) => {
96
+ setVal(value);
97
+ onChangeDebounced(value);
98
+ };
99
+
100
+ return (
101
+ <Paper
102
+ sx={{
103
+ display: "flex",
104
+ flexDirection: "column",
105
+ gap: 1,
106
+ p: 2,
107
+ background: "#CBC3E3",
108
+ mb: 1,
109
+ }}
110
+ >
111
+ {!enabled && "THIS IS DISABLED"}
112
+ <Typography variant="h6">{label}</Typography>
113
+ <TextField
114
+ label="Example label"
115
+ value={val}
116
+ onChange={(e) => update(e.target.value)}
117
+ error={!!error}
118
+ helperText={error}
119
+ disabled={!enabled}
120
+ />
121
+ </Paper>
122
+ );
123
+ };
124
+
125
+ const FormRendererExample: React.FC<ControlProps> = ({
126
+ data,
127
+ handleChange,
128
+ path,
129
+ label,
130
+ enabled,
131
+ }) => {
132
+ const getError = useLocalErrors(path);
133
+ return (
134
+ <FormExample
135
+ text={data as string}
136
+ onChange={(val) => handleChange(path, val)}
137
+ getError={getError}
138
+ label={label}
139
+ enabled={enabled}
140
+ />
141
+ );
142
+ };
143
+
144
+ registerComponent("example", FormRendererExample, ComponentPool.FORM);
145
+ registerComponent("example", FormRendererExample, ComponentPool.PRESENTATION);
146
+ ```
147
+
148
+ > Important: You **cannot register two components with the same name within the same pool**. You _can_ register the same component name across different pools (e.g., `"example"` in both `"FORM"` and `"PRESENTATION"`).
149
+
150
+ ### Presentation Pool
151
+
152
+ The `PRESENTATION` pool is more than just read-only. It is designed for **customer-facing output**, rendering fields in a clean, non-form-like layout for readability and professionalism.
153
+
154
+ ---
155
+
156
+ ## Custom Types
157
+
158
+ Custom field types define what kinds of fields can be used when **building a template**. These appear in the template builder UI as selectable field types and control how data is validated and configured.
159
+
160
+ ### Syntax
161
+
162
+ ```ts
163
+ registerType(
164
+ "typeId", // Unique type string
165
+ "Display Name", // Name shown in template builder
166
+ schema, // JSON Schema defining the data structure
167
+ optionsSchema, // JSON Schema defining configuration data structure
168
+ requiredOptions // boolean: must the options be filled?
169
+ );
170
+ ```
171
+
172
+ ### Example
173
+
174
+ ```ts
175
+ registerType(
176
+ "enum",
177
+ "Dropdown",
178
+ { type: "array" },
179
+ {
180
+ type: "object",
181
+ title: "Dropdown Options",
182
+ properties: {
183
+ enumValues: {
184
+ title: "Dropdown Values",
185
+ type: "array",
186
+ items: { type: "string" },
187
+ },
188
+ },
189
+ },
190
+ true
191
+ );
192
+ ```
193
+
194
+ This type defines a dropdown field where the values are defined via the `enumValues` property in the template configuration.
195
+
196
+ ### Custom Option Editors
197
+
198
+ If you want to render a **custom options block** (i.e., how the field type's options are displayed in the template editor), you must do the following:
199
+
200
+ 1. In the top-level `optionsSchema` of the type, define `"x-type": "yourTypeName"`
201
+ 2. Create and register a custom component with the name `"yourTypeName"` in the `"FORM"` pool.
202
+
203
+ This component will then be used to render the configuration UI for that field type.
204
+
205
+ ---
206
+
207
+ ## File Locations
208
+
209
+ - **Custom components** must be placed in `src/renderers`. They may be nested within subfolders. All files inside `renderers/` will be automatically imported in the correct order.
210
+ - **Custom types** must be added to `src/default_registration/fields_base.tsx`.
211
+
212
+ No manual import wiring is required beyond placing the file in the correct folder.
213
+
214
+ ---
215
+
216
+ ## Publishing to NPM
217
+
218
+ To publish a new version of the package:
219
+
220
+ ```bash
221
+ npm run build # Compile the package
222
+ npm version patch # Bump the patch version (or use minor/major as needed)
223
+ npm adduser # Log in to NPM (if not already)
224
+ npm publish # Publish the package
225
+ ```
@@ -8,6 +8,7 @@ import "../../renderers/Image/ImagePresentation";
8
8
  import "../../renderers/StagedText";
9
9
  import "../../renderers/Subset";
10
10
  import "../../renderers/TemplatePicker";
11
+ import "../../renderers/testComponent/TestCompForm";
11
12
  import "../../renderers/textfield/MultilineForm";
12
13
  import "../../renderers/textfield/MultilinePresentation";
13
14
  import "../../schema/formBuilders/formBuilderJsonSchema";
@@ -10,6 +10,7 @@ import "../../renderers/Image/ImagePresentation";
10
10
  import "../../renderers/StagedText";
11
11
  import "../../renderers/Subset";
12
12
  import "../../renderers/TemplatePicker";
13
+ import "../../renderers/testComponent/TestCompForm";
13
14
  import "../../renderers/textfield/MultilineForm";
14
15
  import "../../renderers/textfield/MultilinePresentation";
15
16
  // Build template from schema last
@@ -0,0 +1,35 @@
1
+ import React, { useMemo, useState } from "react";
2
+ import { Box, debounce, MenuItem, Select, TextField } from "@mui/material";
3
+ import { useLocalErrors } from "../../hooks/errors";
4
+ import { ComponentPool } from "../../registry/types";
5
+ import { registerComponent } from "../../registry/components";
6
+ const TestCompForm = ({ textValues, onChange, getError, label, enabled, }) => {
7
+ var _a, _b;
8
+ const [values, setValues] = useState(textValues);
9
+ const [key, setKey] = useState(null);
10
+ const error = getError ? (_a = getError("testComp")) === null || _a === void 0 ? void 0 : _a.message : undefined;
11
+ const onChangeDebounced = useMemo(() => debounce(onChange, 300), [onChange]);
12
+ // Update text field value when key selection changes
13
+ const val = key ? ((_b = values[key]) !== null && _b !== void 0 ? _b : "") : "";
14
+ const handleSelectChange = (selectedKey) => {
15
+ setKey(selectedKey);
16
+ };
17
+ const update = (value) => {
18
+ setValues((prev) => {
19
+ const updated = Object.assign(Object.assign({}, prev), { [key]: value });
20
+ onChangeDebounced(updated);
21
+ return updated;
22
+ });
23
+ };
24
+ return (React.createElement(Box, null,
25
+ React.createElement(Select, { fullWidth: true, value: key, onChange: (e) => handleSelectChange(e.target.value), disabled: !enabled },
26
+ React.createElement(MenuItem, { value: "option1" }, "Option 1"),
27
+ React.createElement(MenuItem, { value: "option2" }, "Option 2"),
28
+ React.createElement(MenuItem, { value: "option3" }, "Option 3")),
29
+ React.createElement(TextField, { label: label, value: val, onChange: (e) => update(e.target.value), error: !!error, helperText: error, multiline: true, fullWidth: true, sx: { mb: 1 }, disabled: !enabled || !key })));
30
+ };
31
+ const FormRendererExample = ({ data, handleChange, path, label, enabled, }) => {
32
+ const getError = useLocalErrors(path);
33
+ return (React.createElement(TestCompForm, { textValues: data, onChange: (addr) => handleChange(path, addr), getError: getError, label: label, enabled: enabled }));
34
+ };
35
+ registerComponent("testComp", FormRendererExample, ComponentPool.FORM);
@@ -37,8 +37,8 @@ registerType("enum", "Dropdown", { type: "string" }, {
37
37
  title: "Dropdown Values",
38
38
  type: "array",
39
39
  items: { type: "string" },
40
- }
41
- }
40
+ },
41
+ },
42
42
  }, true);
43
43
  registerType("array", "List", { type: "array" }, {
44
44
  type: "object",
@@ -62,7 +62,7 @@ registerType("stagedEnum", "Staged Dropdown", {
62
62
  title: "Dropdown Values",
63
63
  type: "array",
64
64
  items: { type: "string" },
65
- }
65
+ },
66
66
  },
67
67
  }, true);
68
68
  registerType("object", "Group", { type: "object" }, {
@@ -106,31 +106,32 @@ registerType("address", "Address", {
106
106
  properties: {
107
107
  line1: {
108
108
  type: "string",
109
- title: "Address Line 1"
109
+ title: "Address Line 1",
110
110
  },
111
111
  line2: {
112
112
  type: "string",
113
- title: "Address Line 2"
113
+ title: "Address Line 2",
114
114
  },
115
115
  city: {
116
116
  type: "string",
117
- title: "City"
117
+ title: "City",
118
118
  },
119
119
  county: {
120
120
  type: "string",
121
- title: "County"
121
+ title: "County",
122
122
  },
123
123
  postcode: {
124
124
  type: "string",
125
125
  title: "Postcode",
126
- pattern: "^[A-Z]{1,2}[0-9][0-9A-Z]? ?[0-9][A-Z]{2}$"
126
+ pattern: "^[A-Z]{1,2}[0-9][0-9A-Z]? ?[0-9][A-Z]{2}$",
127
127
  },
128
128
  number: {
129
129
  type: "number",
130
- title: "Number"
131
- }
130
+ title: "Number",
131
+ },
132
132
  },
133
- required: ["line1", "city", "postcode"]
133
+ required: ["line1", "city", "postcode"],
134
134
  }, {}, false);
135
135
  registerType("image", "Image", { type: "string" }, {}, false);
136
136
  registerType("multiline", "Multiline", { type: "string" }, {}, false);
137
+ registerType("testComp", "Test Component", { type: "object" }, {}, false);
package/package.json CHANGED
@@ -1,66 +1,66 @@
1
- {
2
- "name": "swoop-common",
3
- "version": "2.2.83",
4
- "main": "dist/api/index.js",
5
- "types": "dist/api/index.d.ts",
6
- "exports": {
7
- ".": {
8
- "import": "./dist/api/index.js",
9
- "require": "./dist/api/index.js",
10
- "types": "./dist/api/index.d.ts"
11
- },
12
- "./rendering": {
13
- "import": "./dist/rendering/index.js",
14
- "require": "./dist/rendering/index.js",
15
- "types": "./dist/rendering/index.d.ts"
16
- }
17
- },
18
- "./rendering": {
19
- "import": "./dist/rendering/index.js",
20
- "require": "./dist/rendering/index.js",
21
- "types": "./dist/rendering/index.d.ts"
22
- },
23
- "files": [
24
- "dist"
25
- ],
26
- "scripts": {
27
- "test": "echo \"Error: no test specified\" && exit 1",
28
- "build": "rimraf ./dist && tsc",
29
- "build-imports": "tsx ./src/rendering/prebuild/import.ts",
30
- "generate-swoop-specs": "tsx ./src/api/specsgen.ts",
31
- "build-core-sdk": "npx openapi-typescript-codegen --input ./openapi/core_service.yaml --output ./src/api/generated/core --client fetch",
32
- "build-swoop-sdk": "npm run generate-swoop-specs && npx openapi-typescript-codegen --input ./openapi/swoop_service.yaml --output ./src/api/generated/swoop --client fetch --postfixModels Swoop --request ./src/api/templates/request.ts",
33
- "prebuild": "npm run build-imports && npm run build-sdk",
34
- "build-sdk-exports": "tsx ./src/api/gen.ts",
35
- "build-sdk": "npm run build-core-sdk && npm run build-swoop-sdk && npm run build-sdk-exports"
36
- },
37
- "author": "",
38
- "license": "ISC",
39
- "description": "",
40
- "dependencies": {
41
- "@apidevtools/swagger-parser": "^12.0.0",
42
- "@emotion/react": "^11.14.0",
43
- "@emotion/styled": "^11.14.1",
44
- "@jsonforms/core": "^3.5.1",
45
- "@jsonforms/material-renderers": "^3.5.1",
46
- "@jsonforms/react": "^3.5.1",
47
- "ajv": "^8.17.1",
48
- "js-yaml": "^4.1.1",
49
- "lodash.merge": "^4.6.2",
50
- "openapi-ts": "^0.3.4",
51
- "react": "^19.0.0",
52
- "rimraf": "^6.0.1",
53
- "swoop-common": "^2.1.55"
54
- },
55
- "devDependencies": {
56
- "@apidevtools/swagger-cli": "^4.0.4",
57
- "@hey-api/openapi-ts": "^0.80.2",
58
- "@types/js-yaml": "^4.0.9",
59
- "@types/lodash.merge": "^4.6.9",
60
- "@types/node": "^24.0.14",
61
- "@types/react": "^19",
62
- "openapi-typescript-codegen": "^0.29.0",
63
- "tsx": "^4.20.3",
64
- "typescript": "^5.8.3"
65
- }
66
- }
1
+ {
2
+ "name": "swoop-common",
3
+ "version": "2.2.85",
4
+ "main": "dist/api/index.js",
5
+ "types": "dist/api/index.d.ts",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./dist/api/index.js",
9
+ "require": "./dist/api/index.js",
10
+ "types": "./dist/api/index.d.ts"
11
+ },
12
+ "./rendering": {
13
+ "import": "./dist/rendering/index.js",
14
+ "require": "./dist/rendering/index.js",
15
+ "types": "./dist/rendering/index.d.ts"
16
+ }
17
+ },
18
+ "./rendering": {
19
+ "import": "./dist/rendering/index.js",
20
+ "require": "./dist/rendering/index.js",
21
+ "types": "./dist/rendering/index.d.ts"
22
+ },
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "scripts": {
27
+ "test": "echo \"Error: no test specified\" && exit 1",
28
+ "build": "rimraf ./dist && tsc",
29
+ "build-imports": "tsx ./src/rendering/prebuild/import.ts",
30
+ "generate-swoop-specs": "tsx ./src/api/specsgen.ts",
31
+ "build-core-sdk": "npx openapi-typescript-codegen --input ./openapi/core_service.yaml --output ./src/api/generated/core --client fetch",
32
+ "build-swoop-sdk": "npm run generate-swoop-specs && npx openapi-typescript-codegen --input ./openapi/swoop_service.yaml --output ./src/api/generated/swoop --client fetch --postfixModels Swoop --request ./src/api/templates/request.ts",
33
+ "prebuild": "npm run build-imports && npm run build-sdk",
34
+ "build-sdk-exports": "tsx ./src/api/gen.ts",
35
+ "build-sdk": "npm run build-core-sdk && npm run build-swoop-sdk && npm run build-sdk-exports"
36
+ },
37
+ "author": "",
38
+ "license": "ISC",
39
+ "description": "",
40
+ "dependencies": {
41
+ "@apidevtools/swagger-parser": "^12.0.0",
42
+ "@emotion/react": "^11.14.0",
43
+ "@emotion/styled": "^11.14.1",
44
+ "@jsonforms/core": "^3.5.1",
45
+ "@jsonforms/material-renderers": "^3.5.1",
46
+ "@jsonforms/react": "^3.5.1",
47
+ "ajv": "^8.17.1",
48
+ "js-yaml": "^4.1.1",
49
+ "lodash.merge": "^4.6.2",
50
+ "openapi-ts": "^0.3.4",
51
+ "react": "^19.0.0",
52
+ "rimraf": "^6.0.1",
53
+ "swoop-common": "^2.1.55"
54
+ },
55
+ "devDependencies": {
56
+ "@apidevtools/swagger-cli": "^4.0.4",
57
+ "@hey-api/openapi-ts": "^0.80.2",
58
+ "@types/js-yaml": "^4.0.9",
59
+ "@types/lodash.merge": "^4.6.9",
60
+ "@types/node": "^24.0.14",
61
+ "@types/react": "^19",
62
+ "openapi-typescript-codegen": "^0.29.0",
63
+ "tsx": "^4.20.3",
64
+ "typescript": "^5.8.3"
65
+ }
66
+ }