swoop-common 2.2.0 → 2.2.2

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
+ ```
@@ -1,4 +1,6 @@
1
1
  export type Error = {
2
- spanId: string;
3
2
  message: string;
3
+ code: number;
4
+ trace: number;
5
+ span: number;
4
6
  };
@@ -34,7 +34,7 @@ export declare class ComponentService {
34
34
  * Get Component
35
35
  * Get Component via ID
36
36
  * @param componentId Id of a component
37
- * @returns any OK
37
+ * @returns any The request was completed successfully
38
38
  * @throws ApiError
39
39
  */
40
40
  static componentGet(componentId: ComponentId): CancelablePromise<any>;
@@ -58,7 +58,7 @@ export class ComponentService {
58
58
  * Get Component
59
59
  * Get Component via ID
60
60
  * @param componentId Id of a component
61
- * @returns any OK
61
+ * @returns any The request was completed successfully
62
62
  * @throws ApiError
63
63
  */
64
64
  static componentGet(componentId) {
@@ -69,9 +69,10 @@ export class ComponentService {
69
69
  'componentId': componentId,
70
70
  },
71
71
  errors: {
72
- 401: `Unauthorized - Missing or invalid Authorization header`,
73
- 403: `Forbidden - The client is authenticated but not authorized to access this resource`,
74
- 404: `If the component does not exist`,
72
+ 401: `Missing or invalid Authorization header`,
73
+ 403: `The client is authenticated but not authorized to access this resource`,
74
+ 404: `If a resource is not found`,
75
+ 500: `Internal Server Error`,
75
76
  },
76
77
  });
77
78
  }
@@ -39,7 +39,7 @@ export declare class CoreService {
39
39
  * Create a Snapshot
40
40
  * Creates a new snapshot. A snapshot is a reference to a specific itinerary revision group id.
41
41
  * @param requestBody
42
- * @returns DTOSnapshotRead When a snapshot is created
42
+ * @returns DTOSnapshotRead When the entity is created
43
43
  * @throws ApiError
44
44
  */
45
45
  snapshotCreate(requestBody: DTOSnapshotCreate): CancelablePromise<DTOSnapshotRead>;
@@ -261,7 +261,7 @@ export declare class CoreService {
261
261
  * Get Component
262
262
  * Get Component via ID
263
263
  * @param componentId Id of a component
264
- * @returns any OK
264
+ * @returns any The request was completed successfully
265
265
  * @throws ApiError
266
266
  */
267
267
  componentGet(componentId: ComponentId): CancelablePromise<any>;
@@ -40,7 +40,7 @@ export class CoreService {
40
40
  * Create a Snapshot
41
41
  * Creates a new snapshot. A snapshot is a reference to a specific itinerary revision group id.
42
42
  * @param requestBody
43
- * @returns DTOSnapshotRead When a snapshot is created
43
+ * @returns DTOSnapshotRead When the entity is created
44
44
  * @throws ApiError
45
45
  */
46
46
  snapshotCreate(requestBody) {
@@ -51,10 +51,9 @@ export class CoreService {
51
51
  mediaType: 'application/json',
52
52
  errors: {
53
53
  400: `If the payload is malformed`,
54
- 401: `Unauthorized - Missing or invalid Authorization header`,
55
- 404: `If the entity does not exists`,
56
- 500: `When an internal server error occurs when creating a snapshot entity`,
57
- 503: `Service Unavailable - The server is temporarily unable to handle the request`,
54
+ 401: `When the user is not authorised to make a request`,
55
+ 404: `If the entity does not exist`,
56
+ 500: `When an internal server error occurs when creating the entity`,
58
57
  },
59
58
  });
60
59
  }
@@ -85,10 +84,9 @@ export class CoreService {
85
84
  'on': on,
86
85
  },
87
86
  errors: {
88
- 400: `If the filter options or query parameters contain invalid values`,
89
- 401: `Unauthorized - Missing or invalid Authorization header`,
90
- 500: `When an internal server error occurs when listing all related snapshots`,
91
- 503: `Service Unavailable - The server is temporarily unable to handle the request`,
87
+ 400: `If the payload is malformed`,
88
+ 401: `When the user is not authorised to make a request`,
89
+ 500: `When an internal server error occurs when creating the entity`,
92
90
  },
93
91
  });
94
92
  }
@@ -566,7 +564,7 @@ export class CoreService {
566
564
  * Get Component
567
565
  * Get Component via ID
568
566
  * @param componentId Id of a component
569
- * @returns any OK
567
+ * @returns any The request was completed successfully
570
568
  * @throws ApiError
571
569
  */
572
570
  componentGet(componentId) {
@@ -577,9 +575,10 @@ export class CoreService {
577
575
  'componentId': componentId,
578
576
  },
579
577
  errors: {
580
- 401: `Unauthorized - Missing or invalid Authorization header`,
581
- 403: `Forbidden - The client is authenticated but not authorized to access this resource`,
582
- 404: `If the component does not exist`,
578
+ 401: `Missing or invalid Authorization header`,
579
+ 403: `The client is authenticated but not authorized to access this resource`,
580
+ 404: `If a resource is not found`,
581
+ 500: `Internal Server Error`,
583
582
  },
584
583
  });
585
584
  }
@@ -8,7 +8,7 @@ export declare class SnapshotService {
8
8
  * Create a Snapshot
9
9
  * Creates a new snapshot. A snapshot is a reference to a specific itinerary revision group id.
10
10
  * @param requestBody
11
- * @returns DTOSnapshotRead When a snapshot is created
11
+ * @returns DTOSnapshotRead When the entity is created
12
12
  * @throws ApiError
13
13
  */
14
14
  static snapshotCreate(requestBody: DTOSnapshotCreate): CancelablePromise<DTOSnapshotRead>;
@@ -5,7 +5,7 @@ export class SnapshotService {
5
5
  * Create a Snapshot
6
6
  * Creates a new snapshot. A snapshot is a reference to a specific itinerary revision group id.
7
7
  * @param requestBody
8
- * @returns DTOSnapshotRead When a snapshot is created
8
+ * @returns DTOSnapshotRead When the entity is created
9
9
  * @throws ApiError
10
10
  */
11
11
  static snapshotCreate(requestBody) {
@@ -16,10 +16,9 @@ export class SnapshotService {
16
16
  mediaType: 'application/json',
17
17
  errors: {
18
18
  400: `If the payload is malformed`,
19
- 401: `Unauthorized - Missing or invalid Authorization header`,
20
- 404: `If the entity does not exists`,
21
- 500: `When an internal server error occurs when creating a snapshot entity`,
22
- 503: `Service Unavailable - The server is temporarily unable to handle the request`,
19
+ 401: `When the user is not authorised to make a request`,
20
+ 404: `If the entity does not exist`,
21
+ 500: `When an internal server error occurs when creating the entity`,
23
22
  },
24
23
  });
25
24
  }
@@ -50,10 +49,9 @@ export class SnapshotService {
50
49
  'on': on,
51
50
  },
52
51
  errors: {
53
- 400: `If the filter options or query parameters contain invalid values`,
54
- 401: `Unauthorized - Missing or invalid Authorization header`,
55
- 500: `When an internal server error occurs when listing all related snapshots`,
56
- 503: `Service Unavailable - The server is temporarily unable to handle the request`,
52
+ 400: `If the payload is malformed`,
53
+ 401: `When the user is not authorised to make a request`,
54
+ 500: `When an internal server error occurs when creating the entity`,
57
55
  },
58
56
  });
59
57
  }
package/package.json CHANGED
@@ -1,60 +1,60 @@
1
- {
2
- "name": "swoop-common",
3
- "version": "2.2.0",
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
- "files": [
19
- "dist"
20
- ],
21
- "scripts": {
22
- "test": "echo \"Error: no test specified\" && exit 1",
23
- "build": "rimraf ./dist && tsc",
24
- "build-imports": "tsx ./src/rendering/prebuild/import.ts",
25
- "build-core-sdk": "npx openapi-typescript-codegen --input ./openapi/core_service.yaml --output ./src/api/generated/core --client fetch",
26
- "build-swoop-sdk": "npx openapi-typescript-codegen --input ./openapi/swoop_service.yaml --output ./src/api/generated/swoop --client fetch --postfixModels Swoop --request ./src/api/templates/request.ts",
27
- "prebuild": "npm run build-imports && npm run build-sdk",
28
- "build-sdk-exports": "tsx ./src/api/gen.ts",
29
- "build-sdk": "npm run build-core-sdk && npm run build-swoop-sdk && npm run build-sdk-exports"
30
- },
31
- "author": "",
32
- "license": "ISC",
33
- "description": "",
34
- "dependencies": {
35
- "@apidevtools/swagger-parser": "^12.0.0",
36
- "@emotion/react": "^11.14.0",
37
- "@emotion/styled": "^11.14.1",
38
- "@jsonforms/core": "^3.5.1",
39
- "@jsonforms/material-renderers": "^3.5.1",
40
- "@jsonforms/react": "^3.5.1",
41
- "ajv": "^8.17.1",
42
- "js-yaml": "^4.1.0",
43
- "lodash.merge": "^4.6.2",
44
- "openapi-ts": "^0.3.4",
45
- "react": "^19.0.0",
46
- "rimraf": "^6.0.1",
47
- "swoop-common": "^2.1.55"
48
- },
49
- "devDependencies": {
50
- "@apidevtools/swagger-cli": "^4.0.4",
51
- "@hey-api/openapi-ts": "^0.80.2",
52
- "@types/js-yaml": "^4.0.9",
53
- "@types/lodash.merge": "^4.6.9",
54
- "@types/node": "^24.0.14",
55
- "@types/react": "^19",
56
- "openapi-typescript-codegen": "^0.29.0",
57
- "tsx": "^4.20.3",
58
- "typescript": "^5.8.3"
59
- }
60
- }
1
+ {
2
+ "name": "swoop-common",
3
+ "version": "2.2.2",
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
+ "files": [
19
+ "dist"
20
+ ],
21
+ "scripts": {
22
+ "test": "echo \"Error: no test specified\" && exit 1",
23
+ "build": "rimraf ./dist && tsc",
24
+ "build-imports": "tsx ./src/rendering/prebuild/import.ts",
25
+ "build-core-sdk": "npx openapi-typescript-codegen --input ./openapi/core_service.yaml --output ./src/api/generated/core --client fetch",
26
+ "build-swoop-sdk": "npx openapi-typescript-codegen --input ./openapi/swoop_service.yaml --output ./src/api/generated/swoop --client fetch --postfixModels Swoop --request ./src/api/templates/request.ts",
27
+ "prebuild": "npm run build-imports && npm run build-sdk",
28
+ "build-sdk-exports": "tsx ./src/api/gen.ts",
29
+ "build-sdk": "npm run build-core-sdk && npm run build-swoop-sdk && npm run build-sdk-exports"
30
+ },
31
+ "author": "",
32
+ "license": "ISC",
33
+ "description": "",
34
+ "dependencies": {
35
+ "@apidevtools/swagger-parser": "^12.0.0",
36
+ "@emotion/react": "^11.14.0",
37
+ "@emotion/styled": "^11.14.1",
38
+ "@jsonforms/core": "^3.5.1",
39
+ "@jsonforms/material-renderers": "^3.5.1",
40
+ "@jsonforms/react": "^3.5.1",
41
+ "ajv": "^8.17.1",
42
+ "js-yaml": "^4.1.0",
43
+ "lodash.merge": "^4.6.2",
44
+ "openapi-ts": "^0.3.4",
45
+ "react": "^19.0.0",
46
+ "rimraf": "^6.0.1",
47
+ "swoop-common": "^2.1.55"
48
+ },
49
+ "devDependencies": {
50
+ "@apidevtools/swagger-cli": "^4.0.4",
51
+ "@hey-api/openapi-ts": "^0.80.2",
52
+ "@types/js-yaml": "^4.0.9",
53
+ "@types/lodash.merge": "^4.6.9",
54
+ "@types/node": "^24.0.14",
55
+ "@types/react": "^19",
56
+ "openapi-typescript-codegen": "^0.29.0",
57
+ "tsx": "^4.20.3",
58
+ "typescript": "^5.8.3"
59
+ }
60
+ }