Skip to content

Commit f3337a5

Browse files
committed
refactor: typescript rewrite
0 parents  commit f3337a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+9751
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Top-most editor config file
2+
root = true
3+
4+
# Unix-style newlines with a newline ending every file
5+
[*]
6+
end_of_line = lf
7+
insert_final_newline = true
8+
9+
# Set default charset and tab length
10+
[*.{ts, js, json}]
11+
charset = utf-8
12+
indent_style = tab
13+
tab_width = 2

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/ISSUE_TEMPLATE/bug_report.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve Dabbu Intel API Server for everyone :)
4+
title: '[BUG]:'
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
**Describe the bug**
10+
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
15+
Steps to reproduce the behavior:
16+
17+
1. ...
18+
2. ...
19+
3. See error
20+
21+
**Expected behavior**
22+
23+
A clear and concise description of what you expected to happen.
24+
25+
**Screenshots**
26+
27+
If applicable, add screenshots to help explain your problem.
28+
29+
**Versions (please complete the following information):**
30+
31+
- Dabbu Version: (Current version, seen when server is run) e.g. 0.6.4
32+
- OS Version: (Platform and Version) e.g. macOS 10.15.7 / Windows 10 (20H2) / Ubuntu 20.04.3 x64 / etc
33+
- File type: (Name, extension, mime type) e.g.: MS Word Document (.docx) (application/vnd.openxmlformats-officedocument.wordprocessingml.document)
34+
35+
**Additional context**
36+
37+
Add any other context about the problem here.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for Dabbu Intel API Server
4+
title: '[FEAT]:'
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
15+
A clear and concise description of what you want to happen.
16+
17+
**Describe alternatives you've considered**
18+
19+
A clear and concise description of any alternative solutions or features you've considered.
20+
21+
**Additional context**
22+
23+
Add any other context or screenshots about the feature request here.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Improve code
3+
about: Have any ideas on how code could be re-written to look better or perform better?
4+
title: '[CODE]:'
5+
labels: code-refactor
6+
assignees: ''
7+
---
8+
9+
**Describe the issue**
10+
11+
A clear and concise description of what the issue caused by the current code is.
12+
13+
**How could it be made better?**
14+
15+
A concise description of how you think it can be made better. Relevant code examples are always appreciated.
16+
17+
**Screenshots**
18+
19+
If applicable, add screenshots to help explain the benefits of your changes.
20+
21+
**Additional context**
22+
23+
Add any other context about the problem here.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Request a new file type
3+
about: Ask for a new file type to be supported by the Dabbu Intel API Server
4+
title: '[NFT]:'
5+
labels: enhancement, new-file-type
6+
assignees: gamemaker1
7+
---
8+
9+
**File type info**
10+
11+
- Name: Name of the file type
12+
- Mime type: Mime type of the file type, look [here](https://www.iana.org/assignments/media-types/media-types.xhtml) for more details
13+
- Extension: Extension of the file type
14+
15+
**Any ideas on how support should be added (Optional)**
16+
17+
How you plan to extract data from the file format programmatically. For example, a DOCX file is a zip that contains a `document.xml` file in the `word/` folder, which is parsed for the `w:t` tag.
18+
19+
**Additional information**
20+
21+
Add any other thoughts here

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: '/'
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10

.github/pull_request_template.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
**Describe the change:**
2+
Describe the changes made, features added, etc.
3+
4+
**Issues closed:**
5+
Issues closed/related to this PR
6+
7+
**Release notes:**
8+
All significant commit messages

.github/workflows/ci.yaml

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: CI
2+
3+
# Triggers the workflow on push or pull request events for any branch that has
4+
# this file
5+
on: [push, pull_request]
6+
7+
# This workflow has only two jobs - testing and building (combined into
8+
# one) and uploading the release to github
9+
jobs:
10+
ci:
11+
name: Test and build on node ${{ matrix.node_version }}
12+
# Run the job on an instance of Ubuntu
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
# Run on node 14
17+
node_version: ['14.x']
18+
steps:
19+
# `git clone` the repo
20+
- name: Check out repo
21+
uses: actions/checkout@v1
22+
# Setup the specified version of node
23+
- name: Setup node ${{ matrix.node_version }}
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: ${{ matrix.node_version }}
27+
# Install dependencies and run the `yarn ci` command
28+
- name: Test and build
29+
run: |
30+
yarn
31+
yarn ci
32+
# Save the built binaries
33+
- name: Saving alpine binary
34+
uses: actions/upload-artifact@v2
35+
with:
36+
name: intel-api-server-alpine
37+
path: dist/binaries/intel-api-server-alpine
38+
- name: Saving linux binary
39+
uses: actions/upload-artifact@v2
40+
with:
41+
name: intel-api-server-linux
42+
path: dist/binaries/intel-api-server-linux
43+
- name: Saving macos binary
44+
uses: actions/upload-artifact@v2
45+
with:
46+
name: intel-api-server-macos
47+
path: dist/binaries/intel-api-server-macos
48+
- name: Saving windows binary
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: intel-api-server-win.exe
52+
path: dist/binaries/intel-api-server-win.exe
53+
# Upload the release
54+
release:
55+
name: Upload release
56+
# Make sure the ci task has succeeded before uploading a release
57+
needs: [ci]
58+
runs-on: ubuntu-latest
59+
steps:
60+
# `git clone` the repo
61+
- name: Check out repo
62+
uses: actions/checkout@v1
63+
# Download built binaries
64+
- name: Downloading alpine binary
65+
uses: actions/download-artifact@v2
66+
with:
67+
name: intel-api-server-alpine
68+
- name: Downloading linux binary
69+
uses: actions/download-artifact@v2
70+
with:
71+
name: intel-api-server-linux
72+
- name: Downloading macos binary
73+
uses: actions/download-artifact@v2
74+
with:
75+
name: intel-api-server-macos
76+
- name: Downloading windows binary
77+
uses: actions/download-artifact@v2
78+
with:
79+
name: intel-api-server-win.exe
80+
# Check if the version is different from the last uploaded release
81+
- name: Check version
82+
run: |
83+
revision=`git rev-list --tags --max-count=1`
84+
version_name=`cat version`
85+
previous_version_name=`git describe --tags --abbrev=0`
86+
87+
echo "Uploading version: $version_name"
88+
echo "Previous version: $previous_version_name"
89+
90+
echo "::set-output name=version::$version_name"
91+
echo "::set-output name=previous_version::$previous_version_name"
92+
id: check-version
93+
- name: Create release
94+
# Run it only if the version has been changed
95+
if: ${{ steps.check-version.outputs.version != steps.check-version.outputs.previous_version && github.ref == 'refs/heads/develop' }}
96+
uses: softprops/action-gh-release@v1
97+
with:
98+
body_path: release-notes.md
99+
tag_name: ${{ steps.check-version.outputs.version }}
100+
prerelease: ${{ contains(steps.check-version.outputs.version, '-') }}
101+
name: Dabbu Intel API Server ${{ steps.check-version.outputs.version }}
102+
files: |
103+
intel-api-server-alpine
104+
intel-api-server-linux
105+
intel-api-server-macos
106+
intel-api-server-win.exe
107+
env:
108+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109+
GITHUB_REPO: dabbu-knowledge-platform/intel-api-server

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.vscode/
2+
*.log
3+
4+
logs/
5+
dist/
6+
ignore/
7+
coverage/
8+
node_modules/

Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: node dist/compiled/server.js

code-of-conduct.md

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Code of Conduct
2+
3+
Dabbu Knowledge Platform uses [Contributor Covenant v2.0](https://contributor-covenant.org/version/2/0/code_of_conduct) as its code of conduct. The full text is included [below](#contributor-covenant-code-of-conduct) in English, and translations are available from the Contributor Covenant organisation:
4+
5+
* [contributor-covenant.org/translations](https://www.contributor-covenant.org/translations)
6+
* [github.com/ContributorCovenant](https://github.com/ContributorCovenant/contributor_covenant/tree/release/content/version/2/0)
7+
8+
## Contributor Covenant Code of Conduct
9+
10+
### Our Pledge
11+
12+
We as members, contributors, and leaders pledge to make participation in our
13+
community a harassment-free experience for everyone, regardless of age, body
14+
size, visible or invisible disability, ethnicity, sex characteristics, gender
15+
identity and expression, level of experience, education, socio-economic status,
16+
nationality, personal appearance, race, religion, or sexual identity
17+
and orientation.
18+
19+
We pledge to act and interact in ways that contribute to an open, welcoming,
20+
diverse, inclusive, and healthy community.
21+
22+
### Our Standards
23+
24+
Examples of behavior that contributes to a positive environment for our
25+
community include:
26+
27+
* Demonstrating empathy and kindness toward other people
28+
* Being respectful of differing opinions, viewpoints, and experiences
29+
* Giving and gracefully accepting constructive feedback
30+
* Accepting responsibility and apologizing to those affected by our mistakes,
31+
and learning from the experience
32+
* Focusing on what is best not just for us as individuals, but for the
33+
overall community
34+
35+
Examples of unacceptable behavior include:
36+
37+
* The use of sexualized language or imagery, and sexual attention or
38+
advances of any kind
39+
* Trolling, insulting or derogatory comments, and personal or political attacks
40+
* Public or private harassment
41+
* Publishing others' private information, such as a physical or email
42+
address, without their explicit permission
43+
* Other conduct which could reasonably be considered inappropriate in a
44+
professional setting
45+
46+
### Enforcement Responsibilities
47+
48+
Community leaders are responsible for clarifying and enforcing our standards of
49+
acceptable behavior and will take appropriate and fair corrective action in
50+
response to any behavior that they deem inappropriate, threatening, offensive,
51+
or harmful.
52+
53+
Community leaders have the right and responsibility to remove, edit, or reject
54+
comments, commits, code, wiki edits, issues, and other contributions that are
55+
not aligned to this Code of Conduct, and will communicate reasons for moderation
56+
decisions when appropriate.
57+
58+
### Scope
59+
60+
This Code of Conduct applies within all community spaces, and also applies when
61+
an individual is officially representing the community in public spaces.
62+
Examples of representing our community include using an official e-mail address,
63+
posting via an official social media account, or acting as an appointed
64+
representative at an online or offline event.
65+
66+
### Enforcement
67+
68+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
69+
reported to the community leaders responsible for enforcement at
70+
71+
All complaints will be reviewed and investigated promptly and fairly.
72+
73+
All community leaders are obligated to respect the privacy and security of the
74+
reporter of any incident.
75+
76+
### Enforcement Guidelines
77+
78+
Community leaders will follow these Community Impact Guidelines in determining
79+
the consequences for any action they deem in violation of this Code of Conduct:
80+
81+
#### 1. Correction
82+
83+
**Community Impact**: Use of inappropriate language or other behavior deemed
84+
unprofessional or unwelcome in the community.
85+
86+
**Consequence**: A private, written warning from community leaders, providing
87+
clarity around the nature of the violation and an explanation of why the
88+
behavior was inappropriate. A public apology may be requested.
89+
90+
#### 2. Warning
91+
92+
**Community Impact**: A violation through a single incident or series
93+
of actions.
94+
95+
**Consequence**: A warning with consequences for continued behavior. No
96+
interaction with the people involved, including unsolicited interaction with
97+
those enforcing the Code of Conduct, for a specified period of time. This
98+
includes avoiding interactions in community spaces as well as external channels
99+
like social media. Violating these terms may lead to a temporary or
100+
permanent ban.
101+
102+
#### 3. Temporary Ban
103+
104+
**Community Impact**: A serious violation of community standards, including
105+
sustained inappropriate behavior.
106+
107+
**Consequence**: A temporary ban from any sort of interaction or public
108+
communication with the community for a specified period of time. No public or
109+
private interaction with the people involved, including unsolicited interaction
110+
with those enforcing the Code of Conduct, is allowed during this period.
111+
Violating these terms may lead to a permanent ban.
112+
113+
#### 4. Permanent Ban
114+
115+
**Community Impact**: Demonstrating a pattern of violation of community
116+
standards, including sustained inappropriate behavior, harassment of an
117+
individual, or aggression toward or disparagement of classes of individuals.
118+
119+
**Consequence**: A permanent ban from any sort of public interaction within
120+
the community.
121+
122+
### Attribution
123+
124+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
125+
version 2.0, available at
126+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
127+
128+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
129+
enforcement ladder](https://github.com/mozilla/diversity).
130+
131+
[homepage]: https://www.contributor-covenant.org
132+
133+
For answers to common questions about this code of conduct, see the FAQ at
134+
https://www.contributor-covenant.org/faq. Translations are available at
135+
https://www.contributor-covenant.org/translations.

0 commit comments

Comments
 (0)