ojp-shared-types 0.0.1 → 0.0.3

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/dist/index.js CHANGED
@@ -1,32 +1,5 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- OpenAPI_Dependencies: () => OpenAPI_Dependencies,
24
- VERSION: () => VERSION
25
- });
26
- module.exports = __toCommonJS(index_exports);
27
-
28
1
  // src/constants.ts
29
- var VERSION = "0.0.1";
2
+ var VERSION = "0.0.3";
30
3
 
31
4
  // src/types/openapi-dependencies.ts
32
5
  var MapNS_Tags = {
@@ -42,6 +15,8 @@ var MapNS_Tags = {
42
15
  "OJPTripRefineRequest.RequestTimestamp": "siri",
43
16
  // FareRequest
44
17
  "OJPFareRequest.RequestTimestamp": "siri",
18
+ // TripInfoRequest
19
+ "OJPTripInfoRequest.RequestTimestamp": "siri",
45
20
  // TripRequest
46
21
  "OJPTripRequest.RequestTimestamp": "siri",
47
22
  // TripResponse
@@ -83,26 +58,17 @@ var MapNS_Tags = {
83
58
  "OJPStopEventRequest.RequestTimestamp": "siri",
84
59
  "PlaceRef.StopPointRef": "siri"
85
60
  };
86
- var MapParentArrayTags = {
87
- "TripResult.trip": ["leg"],
88
- "leg.timedLeg": ["legIntermediate"],
89
- "timedLeg.service": ["attribute"],
90
- "trackSection.linkProjection": ["position"],
91
- // LIR Request
92
- "restrictions.placeParam": ["type"],
93
- // LIR Response
94
- "place.pointOfInterest": ["pointOfInterestCategory"],
95
- "placeResult.place": ["mode"],
96
- "serviceDelivery.OJPLocationInformationDelivery": ["placeResult"],
97
- // SER Response
98
- "stopEventResult.stopEvent": ["previousCall", "onwardCall"]
99
- };
100
61
  var MapArrayTags = {
62
+ // Shared
63
+ "places.place": true,
64
+ "situations.ptSituation": true,
65
+ "linkProjection.position": true,
66
+ // Service
67
+ "service.attribute": true,
101
68
  // TR Response
102
69
  "trip.leg": true,
103
70
  "timedLeg.legIntermediate": true,
104
- "service.attribute": true,
105
- "linkProjection.position": true,
71
+ "legTrack.trackSection": true,
106
72
  // LIR Response
107
73
  "pointOfInterest.pointOfInterestCategory": true,
108
74
  "place.mode": true,
@@ -113,13 +79,19 @@ var MapArrayTags = {
113
79
  // Fare Response
114
80
  "fareResult.tripFareResult": true,
115
81
  // TODO - this is not in the current schema (v2)
116
- "tripFareResult.fareProduct": true
82
+ "tripFareResult.fareProduct": true,
83
+ // TripInfoResult
84
+ "OJPTripInfoDelivery.tripInfoResult": true,
85
+ "tripInfoResult.previousCall": true,
86
+ "tripInfoResult.onwardCall": true,
87
+ "journeyTrack.trackSection": true
117
88
  };
118
89
  var MapModelKeepPropertiesXML = {
119
90
  "OJPLocationInformationRequest": ["requestTimestamp", "initialInput", "placeRef", "restrictions"],
120
91
  "OJPTripRequest": ["requestTimestamp", "origin", "destination", "via", "params"],
121
92
  "OJPStopEventRequest": ["requestTimestamp", "location", "params"],
122
93
  "OJPTripRefineRequest": ["requestTimestamp", "refineParams", "tripResult"],
94
+ "OJPTripInfoRequest": ["requestTimestamp", "journeyRef", "operatingDayRef", "params"],
123
95
  "geoPosition": ["longitude", "latitude"]
124
96
  };
125
97
  var MapStringValues = {
@@ -127,13 +99,11 @@ var MapStringValues = {
127
99
  };
128
100
  var OpenAPI_Dependencies = {
129
101
  MapNS_Tags,
130
- MapParentArrayTags,
131
102
  MapArrayTags,
132
103
  MapModelKeepPropertiesXML,
133
104
  MapStringValues
134
105
  };
135
- // Annotate the CommonJS export names for ESM import in node:
136
- 0 && (module.exports = {
106
+ export {
137
107
  OpenAPI_Dependencies,
138
108
  VERSION
139
- });
109
+ };
package/package.json CHANGED
@@ -1,26 +1,29 @@
1
1
  {
2
2
  "name": "ojp-shared-types",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "Shared types for OJP models based on OpenAPI / XSD Schema",
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.js",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
7
8
  "types": "dist/index.d.ts",
8
9
  "exports": {
9
10
  ".": {
10
11
  "require": "./dist/index.cjs",
11
- "import": "./dist/index.js",
12
- "types": "./dist/index.d.ts"
12
+ "import": "./dist/index.js"
13
13
  }
14
14
  },
15
15
  "files": ["dist"],
16
16
  "scripts": {
17
17
  "build": "rm -rf dist && tsup src/index.ts --dts --format esm,cjs --out-dir dist",
18
18
  "dev": "tsup src/index.ts --dts --format esm,cjs --out-dir dist --watch",
19
- "generate:ts": "bash ./scripts/generate_models.sh"
19
+ "generate:ts": "bash ./scripts/generate-ts.sh"
20
20
  },
21
21
  "keywords": [],
22
22
  "author": "Vasile Cotovanu",
23
23
  "license": "MIT",
24
+ "dependencies": {
25
+ "openapi-typescript": "7.8.0"
26
+ },
24
27
  "devDependencies": {
25
28
  "tsup": "8.4.0",
26
29
  "typescript": "5.8.3"