@mtnmanager/sdk 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/README.md +134 -0
- package/dist/apis/PublicApi.d.ts +174 -0
- package/dist/apis/PublicApi.js +218 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +19 -0
- package/dist/esm/apis/PublicApi.d.ts +174 -0
- package/dist/esm/apis/PublicApi.js +214 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +3 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/HoursInfo.d.ts +50 -0
- package/dist/esm/models/HoursInfo.js +51 -0
- package/dist/esm/models/LiftStatus.d.ts +25 -0
- package/dist/esm/models/LiftStatus.js +43 -0
- package/dist/esm/models/LiftType.d.ts +36 -0
- package/dist/esm/models/LiftType.js +54 -0
- package/dist/esm/models/OperatingHoursResponse.d.ts +46 -0
- package/dist/esm/models/OperatingHoursResponse.js +53 -0
- package/dist/esm/models/PublicLift.d.ts +88 -0
- package/dist/esm/models/PublicLift.js +73 -0
- package/dist/esm/models/PublicResortInfo.d.ts +57 -0
- package/dist/esm/models/PublicResortInfo.js +60 -0
- package/dist/esm/models/PublicResortResponse.d.ts +68 -0
- package/dist/esm/models/PublicResortResponse.js +59 -0
- package/dist/esm/models/PublicResortStatus.d.ts +45 -0
- package/dist/esm/models/PublicResortStatus.js +48 -0
- package/dist/esm/models/PublicRun.d.ts +88 -0
- package/dist/esm/models/PublicRun.js +73 -0
- package/dist/esm/models/PublicSnowReport.d.ts +82 -0
- package/dist/esm/models/PublicSnowReport.js +67 -0
- package/dist/esm/models/PublicSnowResponse.d.ts +33 -0
- package/dist/esm/models/PublicSnowResponse.js +44 -0
- package/dist/esm/models/RegularHoursDescription.d.ts +50 -0
- package/dist/esm/models/RegularHoursDescription.js +55 -0
- package/dist/esm/models/ResortStatusType.d.ts +26 -0
- package/dist/esm/models/ResortStatusType.js +44 -0
- package/dist/esm/models/RunDifficulty.d.ts +28 -0
- package/dist/esm/models/RunDifficulty.js +46 -0
- package/dist/esm/models/RunStatus.d.ts +25 -0
- package/dist/esm/models/RunStatus.js +43 -0
- package/dist/esm/models/SnowMetrics.d.ts +56 -0
- package/dist/esm/models/SnowMetrics.js +59 -0
- package/dist/esm/models/SurfaceCondition.d.ts +29 -0
- package/dist/esm/models/SurfaceCondition.js +47 -0
- package/dist/esm/models/UnitPreference.d.ts +25 -0
- package/dist/esm/models/UnitPreference.js +43 -0
- package/dist/esm/models/index.d.ts +18 -0
- package/dist/esm/models/index.js +20 -0
- package/dist/esm/runtime.d.ts +184 -0
- package/dist/esm/runtime.js +334 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/HoursInfo.d.ts +50 -0
- package/dist/models/HoursInfo.js +58 -0
- package/dist/models/LiftStatus.d.ts +25 -0
- package/dist/models/LiftStatus.js +51 -0
- package/dist/models/LiftType.d.ts +36 -0
- package/dist/models/LiftType.js +62 -0
- package/dist/models/OperatingHoursResponse.d.ts +46 -0
- package/dist/models/OperatingHoursResponse.js +60 -0
- package/dist/models/PublicLift.d.ts +88 -0
- package/dist/models/PublicLift.js +80 -0
- package/dist/models/PublicResortInfo.d.ts +57 -0
- package/dist/models/PublicResortInfo.js +67 -0
- package/dist/models/PublicResortResponse.d.ts +68 -0
- package/dist/models/PublicResortResponse.js +66 -0
- package/dist/models/PublicResortStatus.d.ts +45 -0
- package/dist/models/PublicResortStatus.js +55 -0
- package/dist/models/PublicRun.d.ts +88 -0
- package/dist/models/PublicRun.js +80 -0
- package/dist/models/PublicSnowReport.d.ts +82 -0
- package/dist/models/PublicSnowReport.js +74 -0
- package/dist/models/PublicSnowResponse.d.ts +33 -0
- package/dist/models/PublicSnowResponse.js +51 -0
- package/dist/models/RegularHoursDescription.d.ts +50 -0
- package/dist/models/RegularHoursDescription.js +62 -0
- package/dist/models/ResortStatusType.d.ts +26 -0
- package/dist/models/ResortStatusType.js +52 -0
- package/dist/models/RunDifficulty.d.ts +28 -0
- package/dist/models/RunDifficulty.js +54 -0
- package/dist/models/RunStatus.d.ts +25 -0
- package/dist/models/RunStatus.js +51 -0
- package/dist/models/SnowMetrics.d.ts +56 -0
- package/dist/models/SnowMetrics.js +66 -0
- package/dist/models/SurfaceCondition.d.ts +29 -0
- package/dist/models/SurfaceCondition.js +55 -0
- package/dist/models/UnitPreference.d.ts +25 -0
- package/dist/models/UnitPreference.js +51 -0
- package/dist/models/index.d.ts +18 -0
- package/dist/models/index.js +36 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +350 -0
- package/package.json +25 -0
package/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# @mtnmanager/sdk@0.0.1
|
|
2
|
+
|
|
3
|
+
A TypeScript SDK client for the localhost API.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
First, install the SDK from npm.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @mtnmanager/sdk --save
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Next, try it out.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import {
|
|
18
|
+
Configuration,
|
|
19
|
+
PublicApi,
|
|
20
|
+
} from '@mtnmanager/sdk';
|
|
21
|
+
import type { GetHoursPublicRequest } from '@mtnmanager/sdk';
|
|
22
|
+
|
|
23
|
+
async function example() {
|
|
24
|
+
console.log("🚀 Testing @mtnmanager/sdk SDK...");
|
|
25
|
+
const api = new PublicApi();
|
|
26
|
+
|
|
27
|
+
const body = {
|
|
28
|
+
// string | Resort slug
|
|
29
|
+
slug: slug_example,
|
|
30
|
+
} satisfies GetHoursPublicRequest;
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
const data = await api.getHoursPublic(body);
|
|
34
|
+
console.log(data);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.error(error);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Run the test
|
|
41
|
+
example().catch(console.error);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Documentation
|
|
46
|
+
|
|
47
|
+
### API Endpoints
|
|
48
|
+
|
|
49
|
+
All URIs are relative to *http://localhost:8787*
|
|
50
|
+
|
|
51
|
+
| Class | Method | HTTP request | Description
|
|
52
|
+
| ----- | ------ | ------------ | -------------
|
|
53
|
+
*PublicApi* | [**getHoursPublic**](docs/PublicApi.md#gethourspublic) | **GET** /report/v1/{slug}/hours | GET /report/v1/:slug/hours Get operating hours (calculated for today + 3 months)
|
|
54
|
+
*PublicApi* | [**getLiftsPublic**](docs/PublicApi.md#getliftspublic) | **GET** /report/v1/{slug}/lifts | GET /report/v1/:slug/lifts Get all lifts with optional status filter
|
|
55
|
+
*PublicApi* | [**getResortPublic**](docs/PublicApi.md#getresortpublic) | **GET** /report/v1/{slug} | GET /report/v1/:slug Get complete resort information for public display
|
|
56
|
+
*PublicApi* | [**getRunsPublic**](docs/PublicApi.md#getrunspublic) | **GET** /report/v1/{slug}/runs | GET /report/v1/:slug/runs Get all runs with optional status filter
|
|
57
|
+
*PublicApi* | [**getSnowPublic**](docs/PublicApi.md#getsnowpublic) | **GET** /report/v1/{slug}/snow | GET /report/v1/:slug/snow Get current snow conditions and reports with metrics
|
|
58
|
+
*PublicApi* | [**getStatusPublic**](docs/PublicApi.md#getstatuspublic) | **GET** /report/v1/{slug}/status | GET /report/v1/:slug/status Get just the resort status
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
### Models
|
|
62
|
+
|
|
63
|
+
- [HoursInfo](docs/HoursInfo.md)
|
|
64
|
+
- [LiftStatus](docs/LiftStatus.md)
|
|
65
|
+
- [LiftType](docs/LiftType.md)
|
|
66
|
+
- [OperatingHoursResponse](docs/OperatingHoursResponse.md)
|
|
67
|
+
- [PublicLift](docs/PublicLift.md)
|
|
68
|
+
- [PublicResortInfo](docs/PublicResortInfo.md)
|
|
69
|
+
- [PublicResortResponse](docs/PublicResortResponse.md)
|
|
70
|
+
- [PublicResortStatus](docs/PublicResortStatus.md)
|
|
71
|
+
- [PublicRun](docs/PublicRun.md)
|
|
72
|
+
- [PublicSnowReport](docs/PublicSnowReport.md)
|
|
73
|
+
- [PublicSnowResponse](docs/PublicSnowResponse.md)
|
|
74
|
+
- [RegularHoursDescription](docs/RegularHoursDescription.md)
|
|
75
|
+
- [ResortStatusType](docs/ResortStatusType.md)
|
|
76
|
+
- [RunDifficulty](docs/RunDifficulty.md)
|
|
77
|
+
- [RunStatus](docs/RunStatus.md)
|
|
78
|
+
- [SnowMetrics](docs/SnowMetrics.md)
|
|
79
|
+
- [SurfaceCondition](docs/SurfaceCondition.md)
|
|
80
|
+
- [UnitPreference](docs/UnitPreference.md)
|
|
81
|
+
|
|
82
|
+
### Authorization
|
|
83
|
+
|
|
84
|
+
Endpoints do not require authorization.
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## About
|
|
88
|
+
|
|
89
|
+
This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/)
|
|
90
|
+
and is automatically generated by the
|
|
91
|
+
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
92
|
+
|
|
93
|
+
- API version: `0.1.0`
|
|
94
|
+
- Package version: `0.0.1`
|
|
95
|
+
- Generator version: `7.18.0-SNAPSHOT`
|
|
96
|
+
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
97
|
+
|
|
98
|
+
The generated npm module supports the following:
|
|
99
|
+
|
|
100
|
+
- Environments
|
|
101
|
+
* Node.js
|
|
102
|
+
* Webpack
|
|
103
|
+
* Browserify
|
|
104
|
+
- Language levels
|
|
105
|
+
* ES5 - you must have a Promises/A+ library installed
|
|
106
|
+
* ES6
|
|
107
|
+
- Module systems
|
|
108
|
+
* CommonJS
|
|
109
|
+
* ES6 module system
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
## Development
|
|
113
|
+
|
|
114
|
+
### Building
|
|
115
|
+
|
|
116
|
+
To build the TypeScript source code, you need to have Node.js and npm installed.
|
|
117
|
+
After cloning the repository, navigate to the project directory and run:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npm install
|
|
121
|
+
npm run build
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Publishing
|
|
125
|
+
|
|
126
|
+
Once you've built the package, you can publish it to npm:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
npm publish
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
[MIT]()
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MtnManager API
|
|
3
|
+
* Public API for retrieving ski resort snow reports, run status, lift status, and operating hours. No authentication required.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { PublicLift, PublicResortResponse, PublicResortStatus, PublicRun, PublicSnowResponse } from '../models/index';
|
|
14
|
+
export interface GetHoursPublicRequest {
|
|
15
|
+
slug: string;
|
|
16
|
+
}
|
|
17
|
+
export interface GetLiftsPublicRequest {
|
|
18
|
+
slug: string;
|
|
19
|
+
status?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface GetResortPublicRequest {
|
|
22
|
+
slug: string;
|
|
23
|
+
}
|
|
24
|
+
export interface GetRunsPublicRequest {
|
|
25
|
+
slug: string;
|
|
26
|
+
status?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface GetSnowPublicRequest {
|
|
29
|
+
slug: string;
|
|
30
|
+
}
|
|
31
|
+
export interface GetStatusPublicRequest {
|
|
32
|
+
slug: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* PublicApi - interface
|
|
36
|
+
*
|
|
37
|
+
* @export
|
|
38
|
+
* @interface PublicApiInterface
|
|
39
|
+
*/
|
|
40
|
+
export interface PublicApiInterface {
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @summary GET /report/v1/:slug/hours Get operating hours (calculated for today + 3 months)
|
|
44
|
+
* @param {string} slug Resort slug
|
|
45
|
+
* @param {*} [options] Override http request option.
|
|
46
|
+
* @throws {RequiredError}
|
|
47
|
+
* @memberof PublicApiInterface
|
|
48
|
+
*/
|
|
49
|
+
getHoursPublicRaw(requestParameters: GetHoursPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
50
|
+
/**
|
|
51
|
+
* GET /report/v1/:slug/hours Get operating hours (calculated for today + 3 months)
|
|
52
|
+
*/
|
|
53
|
+
getHoursPublic(requestParameters: GetHoursPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @summary GET /report/v1/:slug/lifts Get all lifts with optional status filter
|
|
57
|
+
* @param {string} slug Resort slug
|
|
58
|
+
* @param {string} [status] Filter by status
|
|
59
|
+
* @param {*} [options] Override http request option.
|
|
60
|
+
* @throws {RequiredError}
|
|
61
|
+
* @memberof PublicApiInterface
|
|
62
|
+
*/
|
|
63
|
+
getLiftsPublicRaw(requestParameters: GetLiftsPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PublicLift>>>;
|
|
64
|
+
/**
|
|
65
|
+
* GET /report/v1/:slug/lifts Get all lifts with optional status filter
|
|
66
|
+
*/
|
|
67
|
+
getLiftsPublic(requestParameters: GetLiftsPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PublicLift>>;
|
|
68
|
+
/**
|
|
69
|
+
*
|
|
70
|
+
* @summary GET /report/v1/:slug Get complete resort information for public display
|
|
71
|
+
* @param {string} slug Resort slug
|
|
72
|
+
* @param {*} [options] Override http request option.
|
|
73
|
+
* @throws {RequiredError}
|
|
74
|
+
* @memberof PublicApiInterface
|
|
75
|
+
*/
|
|
76
|
+
getResortPublicRaw(requestParameters: GetResortPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PublicResortResponse>>;
|
|
77
|
+
/**
|
|
78
|
+
* GET /report/v1/:slug Get complete resort information for public display
|
|
79
|
+
*/
|
|
80
|
+
getResortPublic(requestParameters: GetResortPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PublicResortResponse>;
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
* @summary GET /report/v1/:slug/runs Get all runs with optional status filter
|
|
84
|
+
* @param {string} slug Resort slug
|
|
85
|
+
* @param {string} [status] Filter by status
|
|
86
|
+
* @param {*} [options] Override http request option.
|
|
87
|
+
* @throws {RequiredError}
|
|
88
|
+
* @memberof PublicApiInterface
|
|
89
|
+
*/
|
|
90
|
+
getRunsPublicRaw(requestParameters: GetRunsPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PublicRun>>>;
|
|
91
|
+
/**
|
|
92
|
+
* GET /report/v1/:slug/runs Get all runs with optional status filter
|
|
93
|
+
*/
|
|
94
|
+
getRunsPublic(requestParameters: GetRunsPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PublicRun>>;
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* @summary GET /report/v1/:slug/snow Get current snow conditions and reports with metrics
|
|
98
|
+
* @param {string} slug Resort slug
|
|
99
|
+
* @param {*} [options] Override http request option.
|
|
100
|
+
* @throws {RequiredError}
|
|
101
|
+
* @memberof PublicApiInterface
|
|
102
|
+
*/
|
|
103
|
+
getSnowPublicRaw(requestParameters: GetSnowPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PublicSnowResponse>>;
|
|
104
|
+
/**
|
|
105
|
+
* GET /report/v1/:slug/snow Get current snow conditions and reports with metrics
|
|
106
|
+
*/
|
|
107
|
+
getSnowPublic(requestParameters: GetSnowPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PublicSnowResponse>;
|
|
108
|
+
/**
|
|
109
|
+
*
|
|
110
|
+
* @summary GET /report/v1/:slug/status Get just the resort status
|
|
111
|
+
* @param {string} slug Resort slug
|
|
112
|
+
* @param {*} [options] Override http request option.
|
|
113
|
+
* @throws {RequiredError}
|
|
114
|
+
* @memberof PublicApiInterface
|
|
115
|
+
*/
|
|
116
|
+
getStatusPublicRaw(requestParameters: GetStatusPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PublicResortStatus>>;
|
|
117
|
+
/**
|
|
118
|
+
* GET /report/v1/:slug/status Get just the resort status
|
|
119
|
+
*/
|
|
120
|
+
getStatusPublic(requestParameters: GetStatusPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PublicResortStatus>;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
*
|
|
124
|
+
*/
|
|
125
|
+
export declare class PublicApi extends runtime.BaseAPI implements PublicApiInterface {
|
|
126
|
+
/**
|
|
127
|
+
* GET /report/v1/:slug/hours Get operating hours (calculated for today + 3 months)
|
|
128
|
+
*/
|
|
129
|
+
getHoursPublicRaw(requestParameters: GetHoursPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
130
|
+
/**
|
|
131
|
+
* GET /report/v1/:slug/hours Get operating hours (calculated for today + 3 months)
|
|
132
|
+
*/
|
|
133
|
+
getHoursPublic(requestParameters: GetHoursPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
134
|
+
/**
|
|
135
|
+
* GET /report/v1/:slug/lifts Get all lifts with optional status filter
|
|
136
|
+
*/
|
|
137
|
+
getLiftsPublicRaw(requestParameters: GetLiftsPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PublicLift>>>;
|
|
138
|
+
/**
|
|
139
|
+
* GET /report/v1/:slug/lifts Get all lifts with optional status filter
|
|
140
|
+
*/
|
|
141
|
+
getLiftsPublic(requestParameters: GetLiftsPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PublicLift>>;
|
|
142
|
+
/**
|
|
143
|
+
* GET /report/v1/:slug Get complete resort information for public display
|
|
144
|
+
*/
|
|
145
|
+
getResortPublicRaw(requestParameters: GetResortPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PublicResortResponse>>;
|
|
146
|
+
/**
|
|
147
|
+
* GET /report/v1/:slug Get complete resort information for public display
|
|
148
|
+
*/
|
|
149
|
+
getResortPublic(requestParameters: GetResortPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PublicResortResponse>;
|
|
150
|
+
/**
|
|
151
|
+
* GET /report/v1/:slug/runs Get all runs with optional status filter
|
|
152
|
+
*/
|
|
153
|
+
getRunsPublicRaw(requestParameters: GetRunsPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PublicRun>>>;
|
|
154
|
+
/**
|
|
155
|
+
* GET /report/v1/:slug/runs Get all runs with optional status filter
|
|
156
|
+
*/
|
|
157
|
+
getRunsPublic(requestParameters: GetRunsPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PublicRun>>;
|
|
158
|
+
/**
|
|
159
|
+
* GET /report/v1/:slug/snow Get current snow conditions and reports with metrics
|
|
160
|
+
*/
|
|
161
|
+
getSnowPublicRaw(requestParameters: GetSnowPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PublicSnowResponse>>;
|
|
162
|
+
/**
|
|
163
|
+
* GET /report/v1/:slug/snow Get current snow conditions and reports with metrics
|
|
164
|
+
*/
|
|
165
|
+
getSnowPublic(requestParameters: GetSnowPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PublicSnowResponse>;
|
|
166
|
+
/**
|
|
167
|
+
* GET /report/v1/:slug/status Get just the resort status
|
|
168
|
+
*/
|
|
169
|
+
getStatusPublicRaw(requestParameters: GetStatusPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PublicResortStatus>>;
|
|
170
|
+
/**
|
|
171
|
+
* GET /report/v1/:slug/status Get just the resort status
|
|
172
|
+
*/
|
|
173
|
+
getStatusPublic(requestParameters: GetStatusPublicRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PublicResortStatus>;
|
|
174
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* MtnManager API
|
|
6
|
+
* Public API for retrieving ski resort snow reports, run status, lift status, and operating hours. No authentication required.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.1.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.PublicApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
class PublicApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* GET /report/v1/:slug/hours Get operating hours (calculated for today + 3 months)
|
|
34
|
+
*/
|
|
35
|
+
getHoursPublicRaw(requestParameters, initOverrides) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
if (requestParameters['slug'] == null) {
|
|
38
|
+
throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling getHoursPublic().');
|
|
39
|
+
}
|
|
40
|
+
const queryParameters = {};
|
|
41
|
+
const headerParameters = {};
|
|
42
|
+
let urlPath = `/report/v1/{slug}/hours`;
|
|
43
|
+
urlPath = urlPath.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug'])));
|
|
44
|
+
const response = yield this.request({
|
|
45
|
+
path: urlPath,
|
|
46
|
+
method: 'GET',
|
|
47
|
+
headers: headerParameters,
|
|
48
|
+
query: queryParameters,
|
|
49
|
+
}, initOverrides);
|
|
50
|
+
return new runtime.VoidApiResponse(response);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* GET /report/v1/:slug/hours Get operating hours (calculated for today + 3 months)
|
|
55
|
+
*/
|
|
56
|
+
getHoursPublic(requestParameters, initOverrides) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
yield this.getHoursPublicRaw(requestParameters, initOverrides);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* GET /report/v1/:slug/lifts Get all lifts with optional status filter
|
|
63
|
+
*/
|
|
64
|
+
getLiftsPublicRaw(requestParameters, initOverrides) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
if (requestParameters['slug'] == null) {
|
|
67
|
+
throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling getLiftsPublic().');
|
|
68
|
+
}
|
|
69
|
+
const queryParameters = {};
|
|
70
|
+
if (requestParameters['status'] != null) {
|
|
71
|
+
queryParameters['status'] = requestParameters['status'];
|
|
72
|
+
}
|
|
73
|
+
const headerParameters = {};
|
|
74
|
+
let urlPath = `/report/v1/{slug}/lifts`;
|
|
75
|
+
urlPath = urlPath.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug'])));
|
|
76
|
+
const response = yield this.request({
|
|
77
|
+
path: urlPath,
|
|
78
|
+
method: 'GET',
|
|
79
|
+
headers: headerParameters,
|
|
80
|
+
query: queryParameters,
|
|
81
|
+
}, initOverrides);
|
|
82
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.PublicLiftFromJSON));
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* GET /report/v1/:slug/lifts Get all lifts with optional status filter
|
|
87
|
+
*/
|
|
88
|
+
getLiftsPublic(requestParameters, initOverrides) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
const response = yield this.getLiftsPublicRaw(requestParameters, initOverrides);
|
|
91
|
+
return yield response.value();
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* GET /report/v1/:slug Get complete resort information for public display
|
|
96
|
+
*/
|
|
97
|
+
getResortPublicRaw(requestParameters, initOverrides) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
if (requestParameters['slug'] == null) {
|
|
100
|
+
throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling getResortPublic().');
|
|
101
|
+
}
|
|
102
|
+
const queryParameters = {};
|
|
103
|
+
const headerParameters = {};
|
|
104
|
+
let urlPath = `/report/v1/{slug}`;
|
|
105
|
+
urlPath = urlPath.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug'])));
|
|
106
|
+
const response = yield this.request({
|
|
107
|
+
path: urlPath,
|
|
108
|
+
method: 'GET',
|
|
109
|
+
headers: headerParameters,
|
|
110
|
+
query: queryParameters,
|
|
111
|
+
}, initOverrides);
|
|
112
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PublicResortResponseFromJSON)(jsonValue));
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* GET /report/v1/:slug Get complete resort information for public display
|
|
117
|
+
*/
|
|
118
|
+
getResortPublic(requestParameters, initOverrides) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
const response = yield this.getResortPublicRaw(requestParameters, initOverrides);
|
|
121
|
+
return yield response.value();
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* GET /report/v1/:slug/runs Get all runs with optional status filter
|
|
126
|
+
*/
|
|
127
|
+
getRunsPublicRaw(requestParameters, initOverrides) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
if (requestParameters['slug'] == null) {
|
|
130
|
+
throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling getRunsPublic().');
|
|
131
|
+
}
|
|
132
|
+
const queryParameters = {};
|
|
133
|
+
if (requestParameters['status'] != null) {
|
|
134
|
+
queryParameters['status'] = requestParameters['status'];
|
|
135
|
+
}
|
|
136
|
+
const headerParameters = {};
|
|
137
|
+
let urlPath = `/report/v1/{slug}/runs`;
|
|
138
|
+
urlPath = urlPath.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug'])));
|
|
139
|
+
const response = yield this.request({
|
|
140
|
+
path: urlPath,
|
|
141
|
+
method: 'GET',
|
|
142
|
+
headers: headerParameters,
|
|
143
|
+
query: queryParameters,
|
|
144
|
+
}, initOverrides);
|
|
145
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.PublicRunFromJSON));
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* GET /report/v1/:slug/runs Get all runs with optional status filter
|
|
150
|
+
*/
|
|
151
|
+
getRunsPublic(requestParameters, initOverrides) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
const response = yield this.getRunsPublicRaw(requestParameters, initOverrides);
|
|
154
|
+
return yield response.value();
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* GET /report/v1/:slug/snow Get current snow conditions and reports with metrics
|
|
159
|
+
*/
|
|
160
|
+
getSnowPublicRaw(requestParameters, initOverrides) {
|
|
161
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
if (requestParameters['slug'] == null) {
|
|
163
|
+
throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling getSnowPublic().');
|
|
164
|
+
}
|
|
165
|
+
const queryParameters = {};
|
|
166
|
+
const headerParameters = {};
|
|
167
|
+
let urlPath = `/report/v1/{slug}/snow`;
|
|
168
|
+
urlPath = urlPath.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug'])));
|
|
169
|
+
const response = yield this.request({
|
|
170
|
+
path: urlPath,
|
|
171
|
+
method: 'GET',
|
|
172
|
+
headers: headerParameters,
|
|
173
|
+
query: queryParameters,
|
|
174
|
+
}, initOverrides);
|
|
175
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PublicSnowResponseFromJSON)(jsonValue));
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* GET /report/v1/:slug/snow Get current snow conditions and reports with metrics
|
|
180
|
+
*/
|
|
181
|
+
getSnowPublic(requestParameters, initOverrides) {
|
|
182
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
+
const response = yield this.getSnowPublicRaw(requestParameters, initOverrides);
|
|
184
|
+
return yield response.value();
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* GET /report/v1/:slug/status Get just the resort status
|
|
189
|
+
*/
|
|
190
|
+
getStatusPublicRaw(requestParameters, initOverrides) {
|
|
191
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
if (requestParameters['slug'] == null) {
|
|
193
|
+
throw new runtime.RequiredError('slug', 'Required parameter "slug" was null or undefined when calling getStatusPublic().');
|
|
194
|
+
}
|
|
195
|
+
const queryParameters = {};
|
|
196
|
+
const headerParameters = {};
|
|
197
|
+
let urlPath = `/report/v1/{slug}/status`;
|
|
198
|
+
urlPath = urlPath.replace(`{${"slug"}}`, encodeURIComponent(String(requestParameters['slug'])));
|
|
199
|
+
const response = yield this.request({
|
|
200
|
+
path: urlPath,
|
|
201
|
+
method: 'GET',
|
|
202
|
+
headers: headerParameters,
|
|
203
|
+
query: queryParameters,
|
|
204
|
+
}, initOverrides);
|
|
205
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PublicResortStatusFromJSON)(jsonValue));
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* GET /report/v1/:slug/status Get just the resort status
|
|
210
|
+
*/
|
|
211
|
+
getStatusPublic(requestParameters, initOverrides) {
|
|
212
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
const response = yield this.getStatusPublicRaw(requestParameters, initOverrides);
|
|
214
|
+
return yield response.value();
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
exports.PublicApi = PublicApi;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PublicApi';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* tslint:disable */
|
|
18
|
+
/* eslint-disable */
|
|
19
|
+
__exportStar(require("./PublicApi"), exports);
|