@movmo_app/types 1.0.0 → 1.1.0
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 +104 -3
- package/dist/booking.d.ts +1 -4
- package/dist/booking.js +1 -4
- package/dist/users.d.ts +1 -0
- package/package.json +30 -30
package/README.md
CHANGED
|
@@ -1,3 +1,104 @@
|
|
|
1
|
-
# @
|
|
2
|
-
|
|
3
|
-
This package provides all of the
|
|
1
|
+
# @movmo_app/types
|
|
2
|
+
|
|
3
|
+
This package provides all of the TypeScript type definitions used across the Movmo ecosystem.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The `@movmo_app/types` package serves as a central repository for shared TypeScript types, interfaces, and enums that are used across various Movmo packages and applications. By centralizing these types, we ensure consistency across our codebase and reduce duplication.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# npm
|
|
13
|
+
npm install @movmo_app/types
|
|
14
|
+
|
|
15
|
+
# yarn
|
|
16
|
+
yarn add @movmo_app/types
|
|
17
|
+
|
|
18
|
+
# pnpm
|
|
19
|
+
pnpm add @movmo_app/types
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
Import the types you need in your TypeScript files:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { FlightOffer, DataSource, BookingStatus } from '@movmo_app/types';
|
|
28
|
+
|
|
29
|
+
// Example usage
|
|
30
|
+
const offer: FlightOffer = {
|
|
31
|
+
// ...
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const dataSource: DataSource = "amadeus";
|
|
35
|
+
|
|
36
|
+
const status: BookingStatus = "CONFIRMED";
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Available Types
|
|
40
|
+
|
|
41
|
+
### Core Types
|
|
42
|
+
|
|
43
|
+
- `FlightOffer`: Represents a flight offer from a data source
|
|
44
|
+
- `BookingData`: Contains booking details
|
|
45
|
+
- `PassengerInfo`: Passenger information
|
|
46
|
+
- `PricingInfo`: Flight pricing details
|
|
47
|
+
|
|
48
|
+
### Enums
|
|
49
|
+
|
|
50
|
+
- `DataSource`: Available data sources (e.g., "amadeus", "sabre")
|
|
51
|
+
- `BookingStatus`: Status of a booking (e.g., "PENDING", "CONFIRMED", "CANCELLED")
|
|
52
|
+
- `PaymentMethod`: Available payment methods
|
|
53
|
+
- `FlightClass`: Flight class types (e.g., "ECONOMY", "BUSINESS", "FIRST")
|
|
54
|
+
|
|
55
|
+
### API Request/Response Types
|
|
56
|
+
|
|
57
|
+
- `FlightOfferRequest`: Request format for retrieving flight offers
|
|
58
|
+
- `FlightOfferResponse`: Response format for flight offers
|
|
59
|
+
- `BookingRequest`: Request format for creating a booking
|
|
60
|
+
- `BookingResponse`: Response format for booking creation
|
|
61
|
+
|
|
62
|
+
## Development
|
|
63
|
+
|
|
64
|
+
### Building the Package
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Install dependencies
|
|
68
|
+
pnpm install
|
|
69
|
+
|
|
70
|
+
# Build
|
|
71
|
+
pnpm build
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Adding New Types
|
|
75
|
+
|
|
76
|
+
When adding new types to this package:
|
|
77
|
+
|
|
78
|
+
1. Place the type definitions in the appropriate file under the `src/` directory
|
|
79
|
+
2. Export them from the main `index.ts` file
|
|
80
|
+
3. Ensure proper documentation is added for each type
|
|
81
|
+
4. Update this README if adding significant new types or categories
|
|
82
|
+
|
|
83
|
+
### Version Control
|
|
84
|
+
|
|
85
|
+
This package follows semantic versioning:
|
|
86
|
+
|
|
87
|
+
- **Major version**: Breaking changes to existing types
|
|
88
|
+
- **Minor version**: New types added (non-breaking)
|
|
89
|
+
- **Patch version**: Bug fixes, documentation updates
|
|
90
|
+
|
|
91
|
+
## Internal Usage Guidelines
|
|
92
|
+
|
|
93
|
+
- Avoid duplicating these types in other packages or applications
|
|
94
|
+
- If you need a modified version of an existing type, consider extending it
|
|
95
|
+
- If you find yourself copy-pasting types between projects, consider adding them here instead
|
|
96
|
+
- For types that are only used in a single package, keep them in that package
|
|
97
|
+
|
|
98
|
+
## Deployment
|
|
99
|
+
|
|
100
|
+
This package is automatically published to npm when changes are merged to the main branch via GitHub Actions.
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
Internal use only. © Movmo
|
package/dist/booking.d.ts
CHANGED
|
@@ -56,10 +56,7 @@ export type FlightOfferPricingDetails = {
|
|
|
56
56
|
export declare enum TravelerType {
|
|
57
57
|
ADULT = "adult",
|
|
58
58
|
CHILD = "child",
|
|
59
|
-
|
|
60
|
-
YOUNG = "young",
|
|
61
|
-
HELD_INFANT = "held_infant",
|
|
62
|
-
SEATED_INFANT = "seated_infant"
|
|
59
|
+
INFANT = "infant"
|
|
63
60
|
}
|
|
64
61
|
export interface Passenger {
|
|
65
62
|
id: string;
|
package/dist/booking.js
CHANGED
|
@@ -14,10 +14,7 @@ var TravelerType;
|
|
|
14
14
|
(function (TravelerType) {
|
|
15
15
|
TravelerType["ADULT"] = "adult";
|
|
16
16
|
TravelerType["CHILD"] = "child";
|
|
17
|
-
TravelerType["
|
|
18
|
-
TravelerType["YOUNG"] = "young";
|
|
19
|
-
TravelerType["HELD_INFANT"] = "held_infant";
|
|
20
|
-
TravelerType["SEATED_INFANT"] = "seated_infant";
|
|
17
|
+
TravelerType["INFANT"] = "infant";
|
|
21
18
|
})(TravelerType || (exports.TravelerType = TravelerType = {}));
|
|
22
19
|
;
|
|
23
20
|
;
|
package/dist/users.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@movmo_app/types",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "A collection of Movmo's types",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc",
|
|
9
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
|
-
},
|
|
11
|
-
"keywords": [],
|
|
12
|
-
"license": "ISC",
|
|
13
|
-
"files": [
|
|
14
|
-
"dist"
|
|
15
|
-
],
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@types/node": "^20.14.2",
|
|
18
|
-
"typescript": "^5.4.5"
|
|
19
|
-
},
|
|
20
|
-
"devDependencies": {},
|
|
21
|
-
"repository": {
|
|
22
|
-
"type": "git",
|
|
23
|
-
"url": "git+https://github.com/movmo-app/react-js-packages.git"
|
|
24
|
-
},
|
|
25
|
-
"author": "Movmo",
|
|
26
|
-
"bugs": {
|
|
27
|
-
"url": "https://github.com/movmo-app/react-js-packages/issues"
|
|
28
|
-
},
|
|
29
|
-
"homepage": "https://github.com/movmo-app/react-js-packages/blob/main/packages/@
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@movmo_app/types",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "A collection of Movmo's types",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [],
|
|
12
|
+
"license": "ISC",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/node": "^20.14.2",
|
|
18
|
+
"typescript": "^5.4.5"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/movmo-app/react-js-packages.git"
|
|
24
|
+
},
|
|
25
|
+
"author": "Movmo",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/movmo-app/react-js-packages/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/movmo-app/react-js-packages/blob/main/packages/@movmo_app/types/README.md"
|
|
30
|
+
}
|