ojp-shared-types 0.0.1
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/LICENSE +21 -0
- package/README.md +41 -0
- package/dist/index.d.mts +6275 -0
- package/dist/index.d.ts +6275 -0
- package/dist/index.js +139 -0
- package/dist/index.mjs +111 -0
- package/package.json +28 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
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
|
+
// src/constants.ts
|
|
29
|
+
var VERSION = "0.0.1";
|
|
30
|
+
|
|
31
|
+
// src/types/openapi-dependencies.ts
|
|
32
|
+
var MapNS_Tags = {
|
|
33
|
+
"OJPRequest.ServiceRequest": "siri",
|
|
34
|
+
"ServiceRequest.ServiceRequestContext": "siri",
|
|
35
|
+
"ServiceRequestContext.Language": "siri",
|
|
36
|
+
"ServiceRequest.RequestTimestamp": "siri",
|
|
37
|
+
"ServiceRequest.RequestorRef": "siri",
|
|
38
|
+
"OJPResponse.ServiceDelivery": "siri",
|
|
39
|
+
"ServiceDelivery.ResponseTimestamp": "siri",
|
|
40
|
+
"ServiceDelivery.ProducerRef": "siri",
|
|
41
|
+
// TRR
|
|
42
|
+
"OJPTripRefineRequest.RequestTimestamp": "siri",
|
|
43
|
+
// FareRequest
|
|
44
|
+
"OJPFareRequest.RequestTimestamp": "siri",
|
|
45
|
+
// TripRequest
|
|
46
|
+
"OJPTripRequest.RequestTimestamp": "siri",
|
|
47
|
+
// TripResponse
|
|
48
|
+
"OJPTripDelivery.ResponseTimestamp": "siri",
|
|
49
|
+
"OJPTripDelivery.RequestMessageRef": "siri",
|
|
50
|
+
"OJPTripDelivery.DefaultLanguage": "siri",
|
|
51
|
+
"LegBoard.StopPointRef": "siri",
|
|
52
|
+
"LegIntermediate.StopPointRef": "siri",
|
|
53
|
+
"LegIntermediates.StopPointRef": "siri",
|
|
54
|
+
// OJP v1
|
|
55
|
+
"LegAlight.StopPointRef": "siri",
|
|
56
|
+
"Mode.AirSubmode": "siri",
|
|
57
|
+
"Mode.BusSubmode": "siri",
|
|
58
|
+
"Mode.CoachSubmode": "siri",
|
|
59
|
+
"Mode.FunicularSubmode": "siri",
|
|
60
|
+
"Mode.MetroSubmode": "siri",
|
|
61
|
+
"Mode.TramSubmode": "siri",
|
|
62
|
+
"Mode.TelecabinSubmode": "siri",
|
|
63
|
+
"Mode.RailSubmode": "siri",
|
|
64
|
+
"Mode.WaterSubmode": "siri",
|
|
65
|
+
"Service.LineRef": "siri",
|
|
66
|
+
"Service.OperatorRef": "siri",
|
|
67
|
+
"Service.DirectionRef": "siri",
|
|
68
|
+
"TrackSectionStart.StopPointRef": "siri",
|
|
69
|
+
"TrackSectionEnd.StopPointRef": "siri",
|
|
70
|
+
"Position.Longitude": "siri",
|
|
71
|
+
"LegStart.StopPointRef": "siri",
|
|
72
|
+
"LegEnd.StopPointRef": "siri",
|
|
73
|
+
// LIR Request
|
|
74
|
+
"OJPLocationInformationRequest.RequestTimestamp": "siri",
|
|
75
|
+
"UpperLeft.Longitude": "siri",
|
|
76
|
+
"UpperLeft.Latitude": "siri",
|
|
77
|
+
"LowerRight.Longitude": "siri",
|
|
78
|
+
"LowerRight.Latitude": "siri",
|
|
79
|
+
// TR Request
|
|
80
|
+
"GeoPosition.Longitude": "siri",
|
|
81
|
+
"GeoPosition.Latitude": "siri",
|
|
82
|
+
// SER Request
|
|
83
|
+
"OJPStopEventRequest.RequestTimestamp": "siri",
|
|
84
|
+
"PlaceRef.StopPointRef": "siri"
|
|
85
|
+
};
|
|
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
|
+
var MapArrayTags = {
|
|
101
|
+
// TR Response
|
|
102
|
+
"trip.leg": true,
|
|
103
|
+
"timedLeg.legIntermediate": true,
|
|
104
|
+
"service.attribute": true,
|
|
105
|
+
"linkProjection.position": true,
|
|
106
|
+
// LIR Response
|
|
107
|
+
"pointOfInterest.pointOfInterestCategory": true,
|
|
108
|
+
"place.mode": true,
|
|
109
|
+
"OJPLocationInformationDelivery.placeResult": true,
|
|
110
|
+
// SER Response
|
|
111
|
+
"stopEvent.previousCall": true,
|
|
112
|
+
"stopEvent.onwardCall": true,
|
|
113
|
+
// Fare Response
|
|
114
|
+
"fareResult.tripFareResult": true,
|
|
115
|
+
// TODO - this is not in the current schema (v2)
|
|
116
|
+
"tripFareResult.fareProduct": true
|
|
117
|
+
};
|
|
118
|
+
var MapModelKeepPropertiesXML = {
|
|
119
|
+
"OJPLocationInformationRequest": ["requestTimestamp", "initialInput", "placeRef", "restrictions"],
|
|
120
|
+
"OJPTripRequest": ["requestTimestamp", "origin", "destination", "via", "params"],
|
|
121
|
+
"OJPStopEventRequest": ["requestTimestamp", "location", "params"],
|
|
122
|
+
"OJPTripRefineRequest": ["requestTimestamp", "refineParams", "tripResult"],
|
|
123
|
+
"geoPosition": ["longitude", "latitude"]
|
|
124
|
+
};
|
|
125
|
+
var MapStringValues = {
|
|
126
|
+
"stopPlace.stopPlaceRef": true
|
|
127
|
+
};
|
|
128
|
+
var OpenAPI_Dependencies = {
|
|
129
|
+
MapNS_Tags,
|
|
130
|
+
MapParentArrayTags,
|
|
131
|
+
MapArrayTags,
|
|
132
|
+
MapModelKeepPropertiesXML,
|
|
133
|
+
MapStringValues
|
|
134
|
+
};
|
|
135
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
136
|
+
0 && (module.exports = {
|
|
137
|
+
OpenAPI_Dependencies,
|
|
138
|
+
VERSION
|
|
139
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// src/constants.ts
|
|
2
|
+
var VERSION = "0.0.1";
|
|
3
|
+
|
|
4
|
+
// src/types/openapi-dependencies.ts
|
|
5
|
+
var MapNS_Tags = {
|
|
6
|
+
"OJPRequest.ServiceRequest": "siri",
|
|
7
|
+
"ServiceRequest.ServiceRequestContext": "siri",
|
|
8
|
+
"ServiceRequestContext.Language": "siri",
|
|
9
|
+
"ServiceRequest.RequestTimestamp": "siri",
|
|
10
|
+
"ServiceRequest.RequestorRef": "siri",
|
|
11
|
+
"OJPResponse.ServiceDelivery": "siri",
|
|
12
|
+
"ServiceDelivery.ResponseTimestamp": "siri",
|
|
13
|
+
"ServiceDelivery.ProducerRef": "siri",
|
|
14
|
+
// TRR
|
|
15
|
+
"OJPTripRefineRequest.RequestTimestamp": "siri",
|
|
16
|
+
// FareRequest
|
|
17
|
+
"OJPFareRequest.RequestTimestamp": "siri",
|
|
18
|
+
// TripRequest
|
|
19
|
+
"OJPTripRequest.RequestTimestamp": "siri",
|
|
20
|
+
// TripResponse
|
|
21
|
+
"OJPTripDelivery.ResponseTimestamp": "siri",
|
|
22
|
+
"OJPTripDelivery.RequestMessageRef": "siri",
|
|
23
|
+
"OJPTripDelivery.DefaultLanguage": "siri",
|
|
24
|
+
"LegBoard.StopPointRef": "siri",
|
|
25
|
+
"LegIntermediate.StopPointRef": "siri",
|
|
26
|
+
"LegIntermediates.StopPointRef": "siri",
|
|
27
|
+
// OJP v1
|
|
28
|
+
"LegAlight.StopPointRef": "siri",
|
|
29
|
+
"Mode.AirSubmode": "siri",
|
|
30
|
+
"Mode.BusSubmode": "siri",
|
|
31
|
+
"Mode.CoachSubmode": "siri",
|
|
32
|
+
"Mode.FunicularSubmode": "siri",
|
|
33
|
+
"Mode.MetroSubmode": "siri",
|
|
34
|
+
"Mode.TramSubmode": "siri",
|
|
35
|
+
"Mode.TelecabinSubmode": "siri",
|
|
36
|
+
"Mode.RailSubmode": "siri",
|
|
37
|
+
"Mode.WaterSubmode": "siri",
|
|
38
|
+
"Service.LineRef": "siri",
|
|
39
|
+
"Service.OperatorRef": "siri",
|
|
40
|
+
"Service.DirectionRef": "siri",
|
|
41
|
+
"TrackSectionStart.StopPointRef": "siri",
|
|
42
|
+
"TrackSectionEnd.StopPointRef": "siri",
|
|
43
|
+
"Position.Longitude": "siri",
|
|
44
|
+
"LegStart.StopPointRef": "siri",
|
|
45
|
+
"LegEnd.StopPointRef": "siri",
|
|
46
|
+
// LIR Request
|
|
47
|
+
"OJPLocationInformationRequest.RequestTimestamp": "siri",
|
|
48
|
+
"UpperLeft.Longitude": "siri",
|
|
49
|
+
"UpperLeft.Latitude": "siri",
|
|
50
|
+
"LowerRight.Longitude": "siri",
|
|
51
|
+
"LowerRight.Latitude": "siri",
|
|
52
|
+
// TR Request
|
|
53
|
+
"GeoPosition.Longitude": "siri",
|
|
54
|
+
"GeoPosition.Latitude": "siri",
|
|
55
|
+
// SER Request
|
|
56
|
+
"OJPStopEventRequest.RequestTimestamp": "siri",
|
|
57
|
+
"PlaceRef.StopPointRef": "siri"
|
|
58
|
+
};
|
|
59
|
+
var MapParentArrayTags = {
|
|
60
|
+
"TripResult.trip": ["leg"],
|
|
61
|
+
"leg.timedLeg": ["legIntermediate"],
|
|
62
|
+
"timedLeg.service": ["attribute"],
|
|
63
|
+
"trackSection.linkProjection": ["position"],
|
|
64
|
+
// LIR Request
|
|
65
|
+
"restrictions.placeParam": ["type"],
|
|
66
|
+
// LIR Response
|
|
67
|
+
"place.pointOfInterest": ["pointOfInterestCategory"],
|
|
68
|
+
"placeResult.place": ["mode"],
|
|
69
|
+
"serviceDelivery.OJPLocationInformationDelivery": ["placeResult"],
|
|
70
|
+
// SER Response
|
|
71
|
+
"stopEventResult.stopEvent": ["previousCall", "onwardCall"]
|
|
72
|
+
};
|
|
73
|
+
var MapArrayTags = {
|
|
74
|
+
// TR Response
|
|
75
|
+
"trip.leg": true,
|
|
76
|
+
"timedLeg.legIntermediate": true,
|
|
77
|
+
"service.attribute": true,
|
|
78
|
+
"linkProjection.position": true,
|
|
79
|
+
// LIR Response
|
|
80
|
+
"pointOfInterest.pointOfInterestCategory": true,
|
|
81
|
+
"place.mode": true,
|
|
82
|
+
"OJPLocationInformationDelivery.placeResult": true,
|
|
83
|
+
// SER Response
|
|
84
|
+
"stopEvent.previousCall": true,
|
|
85
|
+
"stopEvent.onwardCall": true,
|
|
86
|
+
// Fare Response
|
|
87
|
+
"fareResult.tripFareResult": true,
|
|
88
|
+
// TODO - this is not in the current schema (v2)
|
|
89
|
+
"tripFareResult.fareProduct": true
|
|
90
|
+
};
|
|
91
|
+
var MapModelKeepPropertiesXML = {
|
|
92
|
+
"OJPLocationInformationRequest": ["requestTimestamp", "initialInput", "placeRef", "restrictions"],
|
|
93
|
+
"OJPTripRequest": ["requestTimestamp", "origin", "destination", "via", "params"],
|
|
94
|
+
"OJPStopEventRequest": ["requestTimestamp", "location", "params"],
|
|
95
|
+
"OJPTripRefineRequest": ["requestTimestamp", "refineParams", "tripResult"],
|
|
96
|
+
"geoPosition": ["longitude", "latitude"]
|
|
97
|
+
};
|
|
98
|
+
var MapStringValues = {
|
|
99
|
+
"stopPlace.stopPlaceRef": true
|
|
100
|
+
};
|
|
101
|
+
var OpenAPI_Dependencies = {
|
|
102
|
+
MapNS_Tags,
|
|
103
|
+
MapParentArrayTags,
|
|
104
|
+
MapArrayTags,
|
|
105
|
+
MapModelKeepPropertiesXML,
|
|
106
|
+
MapStringValues
|
|
107
|
+
};
|
|
108
|
+
export {
|
|
109
|
+
OpenAPI_Dependencies,
|
|
110
|
+
VERSION
|
|
111
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ojp-shared-types",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Shared types for OJP models based on OpenAPI / XSD Schema",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"require": "./dist/index.cjs",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": ["dist"],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "rm -rf dist && tsup src/index.ts --dts --format esm,cjs --out-dir dist",
|
|
18
|
+
"dev": "tsup src/index.ts --dts --format esm,cjs --out-dir dist --watch",
|
|
19
|
+
"generate:ts": "bash ./scripts/generate_models.sh"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [],
|
|
22
|
+
"author": "Vasile Cotovanu",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"tsup": "8.4.0",
|
|
26
|
+
"typescript": "5.8.3"
|
|
27
|
+
}
|
|
28
|
+
}
|