Skip to content

Commit 8a486a9

Browse files
committed
initial commit
0 parents  commit 8a486a9

22 files changed

+4773
-0
lines changed

.eslintrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"project": ["./tsconfig.json"]
5+
},
6+
"extends": [
7+
"@omer-x/eslint-config",
8+
"@omer-x/eslint-config/typescript"
9+
],
10+
"rules": {
11+
"@stylistic/max-len": "off"
12+
}
13+
}

.github/workflows/npm-publish.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Publish Package to npm
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v4
11+
with:
12+
node-version: '20.x'
13+
registry-url: 'https://registry.npmjs.org'
14+
- run: npm ci
15+
# - run: npm test
16+
- run: npm run build
17+
- run: npm publish
18+
env:
19+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Omer Mecitoglu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# OpenAPI 3.1 Types
2+
3+
[![npm version](https://badge.fury.io/js/%40omer-x%2Fopenapi-types.svg)](https://badge.fury.io/js/%40omer-x%2Fopenapi-types)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5+
6+
TypeScript types for the OpenAPI Specification.
7+
8+
## Installation
9+
10+
You can install this package via npm:
11+
12+
```bash
13+
npm install -D @omer-x/openapi-types
14+
```
15+
16+
or via yarn:
17+
18+
```bash
19+
yarn add -D @omer-x/openapi-types
20+
```
21+
22+
## Usage
23+
24+
Import the types you need in your TypeScript project:
25+
26+
```typescript
27+
import { OpenAPIObject, InfoObject, PathsObject } from '@omer-x/openapi-types';
28+
29+
// Example usage
30+
const openApiSpec: OpenAPIObject = {
31+
openapi: "3.1.0",
32+
info: {
33+
title: "Sample API",
34+
version: "1.0.0"
35+
},
36+
paths: {}
37+
};
38+
```
39+
40+
You can also import specific types directly:
41+
42+
```typescript
43+
import type { ComponentsObject } from "@omer-x/openapi-types/components";
44+
import type { ExampleObject } from "@omer-x/openapi-types/example";
45+
import type { InfoObject } from "@omer-x/openapi-types/info";
46+
import type { LinkObject } from "@omer-x/openapi-types/link";
47+
import type { MediaTypeObject } from "@omer-x/openapi-types/media-type";
48+
import type { OperationObject } from "@omer-x/openapi-types/operation";
49+
import type { ParameterObject } from "@omer-x/openapi-types/parameter";
50+
import type { PathItemObject, PathsObject } from "@omer-x/openapi-types/paths";
51+
import type { ReferenceObject } from "@omer-x/openapi-types/reference";
52+
import type { RequestBodyObject } from "@omer-x/openapi-types/request-body";
53+
import type { ResponseObject, ResponsesObject } from "@omer-x/openapi-types/response";
54+
import type { SchemaObject } from "@omer-x/openapi-types/schema";
55+
import type { TagObject } from "@omer-x/openapi-types/tag";
56+
```
57+
58+
## License
59+
60+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)