Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,21 @@ jobs:
name: Build 🔧
runs-on: ubuntu-latest
steps:
- run: git config --global init.defaultBranch node-typescript
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
- name: Checkout 🛎️
uses: actions/checkout@master
- name: Install 🟢
- uses: actions/checkout@master
- id: node-cache
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-${{ github.repository }}-node-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ github.repository }}-node-modules-
- if: steps.node-cache.outputs.cache-hit != 'true'
run: yarn install
- name: Build 🔧
run: yarn build:tsc
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ dist ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ dist ]
schedule:
- cron: '18 1 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
13 changes: 13 additions & 0 deletions dist/config/scripts/Config.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export declare const scripts: {
config: {
scripts: string;
};
build: {
tsc: string;
dist: string;
};
lint: {
fix: string;
run: string;
};
};
16 changes: 16 additions & 0 deletions dist/config/scripts/Config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.scripts = void 0;
exports.scripts = {
config: {
scripts: "ts-node ./config/scripts"
},
build: {
tsc: "tsc",
dist: "tsc"
},
lint: {
fix: "eslint --fix --ext .ts,.tsx .",
run: "eslint --ext .ts,.tsx ."
}
};
1 change: 1 addition & 0 deletions dist/config/scripts/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
10 changes: 10 additions & 0 deletions dist/config/scripts/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const package_1 = require("@taccl/package");
const scripts = (0, package_1.writeScripts)(path_1.default.join(__dirname.replace(process.cwd(), ''), 'Config'));
console.log('scripts:');
console.log(scripts);
1 change: 1 addition & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib';
13 changes: 13 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./lib"), exports);
8 changes: 8 additions & 0 deletions dist/lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export { standbyRequest } from './info/Standby';
export { authRequest } from './info/Auth';
export { infoRequest } from './info/Info';
export { progressRequest } from './submit/Progress';
export { confirmRequest } from './submit/Confirm';
export { successRequest } from './submit/result/Success';
export { failureRequest } from './submit/result/Failure';
export { errorRequest } from './submit/result/Error';
19 changes: 19 additions & 0 deletions dist/lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.errorRequest = exports.failureRequest = exports.successRequest = exports.confirmRequest = exports.progressRequest = exports.infoRequest = exports.authRequest = exports.standbyRequest = void 0;
var Standby_1 = require("./info/Standby");
Object.defineProperty(exports, "standbyRequest", { enumerable: true, get: function () { return Standby_1.standbyRequest; } });
var Auth_1 = require("./info/Auth");
Object.defineProperty(exports, "authRequest", { enumerable: true, get: function () { return Auth_1.authRequest; } });
var Info_1 = require("./info/Info");
Object.defineProperty(exports, "infoRequest", { enumerable: true, get: function () { return Info_1.infoRequest; } });
var Progress_1 = require("./submit/Progress");
Object.defineProperty(exports, "progressRequest", { enumerable: true, get: function () { return Progress_1.progressRequest; } });
var Confirm_1 = require("./submit/Confirm");
Object.defineProperty(exports, "confirmRequest", { enumerable: true, get: function () { return Confirm_1.confirmRequest; } });
var Success_1 = require("./submit/result/Success");
Object.defineProperty(exports, "successRequest", { enumerable: true, get: function () { return Success_1.successRequest; } });
var Failure_1 = require("./submit/result/Failure");
Object.defineProperty(exports, "failureRequest", { enumerable: true, get: function () { return Failure_1.failureRequest; } });
var Error_1 = require("./submit/result/Error");
Object.defineProperty(exports, "errorRequest", { enumerable: true, get: function () { return Error_1.errorRequest; } });
2 changes: 2 additions & 0 deletions dist/lib/info/Auth.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { LightResponse, RequestParams } from '../util/type';
export declare function authRequest({ key }: RequestParams): Promise<LightResponse>;
35 changes: 35 additions & 0 deletions dist/lib/info/Auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.authRequest = void 0;
const util_1 = require("../util");
function authRequest({ key }) {
return __awaiter(this, void 0, void 0, function* () {
const harEntry = yield (0, util_1.loadHarEntryByUrl)('/auth');
let req = harEntry.request;
req.url = (0, util_1.getUrlWithParams)({
url: req.url,
params: {
key
}
});
req = (0, util_1.parseRequest)(req);
req = yield (0, util_1.useCookiesFromBrowser)(req);
// TODO : Use Cookies from Browser => Clean Code
const res = yield (0, util_1.request)(req);
yield (0, util_1.saveCookiesFromResponse)(res);
return (0, util_1.lightResponse)(res);
});
}
exports.authRequest = authRequest;
// authRequest({
// key: string
// });
2 changes: 2 additions & 0 deletions dist/lib/info/Info.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { RequestParams, LightResponse } from '../util/type';
export declare function infoRequest({ key }: RequestParams): Promise<LightResponse>;
35 changes: 35 additions & 0 deletions dist/lib/info/Info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.infoRequest = void 0;
const util_1 = require("../util");
function infoRequest({ key }) {
return __awaiter(this, void 0, void 0, function* () {
const harEntry = yield (0, util_1.loadHarEntryByUrl)('/info');
let req = harEntry.request;
req.url = (0, util_1.getUrlWithParams)({
url: req.url,
params: {
key
}
});
req = (0, util_1.parseRequest)(req);
req = yield (0, util_1.useCookiesFromBrowser)(req);
// TODO : Use Cookies from Browser => Clean Code
const res = yield (0, util_1.request)(req);
yield (0, util_1.saveCookiesFromResponse)(res);
return (0, util_1.lightResponse)(res);
});
}
exports.infoRequest = infoRequest;
// infoRequest({
// key: string
// });
18 changes: 18 additions & 0 deletions dist/lib/info/Standby.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { LightResponse, RequestParams } from '../util/type';
/**
* @params { orgCd,sid }
* @returns
* @statusCode 302
* @Location
* /nidlogin.login
* => LoginException
* /auth?key=${key}
* => Success
* @Headers
* @SetCookie
* @NID_SES
* *expire*
* => Cookie expired
*
*/
export declare function standbyRequest({ orgCd, sid }: RequestParams): Promise<LightResponse>;
53 changes: 53 additions & 0 deletions dist/lib/info/Standby.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.standbyRequest = void 0;
const util_1 = require("../util");
/**
* @params { orgCd,sid }
* @returns
* @statusCode 302
* @Location
* /nidlogin.login
* => LoginException
* /auth?key=${key}
* => Success
* @Headers
* @SetCookie
* @NID_SES
* *expire*
* => Cookie expired
*
*/
function standbyRequest({ orgCd, sid }) {
return __awaiter(this, void 0, void 0, function* () {
const harEntry = yield (0, util_1.loadHarEntryByUrl)('/reservation');
let req = harEntry.request;
req.url = (0, util_1.getUrlWithParams)({
url: req.url,
params: {
orgCd,
sid
}
});
req = (0, util_1.parseRequest)(req);
req = yield (0, util_1.useCookiesFromBrowser)(req);
// TODO : Use Cookies from Browser => Clean Code
const res = yield (0, util_1.request)(req);
yield (0, util_1.saveCookiesFromResponse)(res);
return (0, util_1.lightResponse)(res);
});
}
exports.standbyRequest = standbyRequest;
// standbyRequest({
// orgCd: string | number,
// sid: string | number
// });
13 changes: 13 additions & 0 deletions dist/lib/submit/Confirm.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { RequestParams, LightResponse } from '../util/type';
/**
*
* @POST = method
* @JSON = contentType
* @BODY = {
* @key = string;
* }
* @returns
* @lightResponse
*
*/
export declare function confirmRequest({ key, cd }: RequestParams): Promise<LightResponse>;
Loading