chore: lint + add source code link

This commit is contained in:
Nugraha 2022-12-02 23:11:03 +07:00
parent f3db64fa38
commit 35424ceb94
Signed by: ii64
GPG key ID: E41C08AD390E7C49
41 changed files with 15150 additions and 45895 deletions

1
.gitignore vendored
View file

@ -3,6 +3,7 @@ docs/
app.db
docker/server
server
__debug_bin
# Editor directories and files
.vscode/*

View file

@ -12,7 +12,7 @@ CXXFLAGS ?=
CXXFLAGS += -target $(TARGET_TRIPLE)
GOFLAGS ?=
GOFLAGS += -x -o docker/server
GOFLAGS += -x -trimpath -o docker/server
all:
gen: gen-backend-thrift gen-frontend-thrift

View file

@ -1,7 +0,0 @@
{
"plugins": [
"minify-dead-code-elimination",
"@babel/plugin-transform-classes",
"@babel/plugin-syntax-class-properties",
]
}

2
frontend/.gitignore vendored
View file

@ -8,8 +8,6 @@ pnpm-debug.log*
lerna-debug.log*
node_modules
node_modules_linux
node_modules_windows
dist
dist-ssr
*.local

View file

@ -11,65 +11,135 @@ import Int64 = require('node-int64');
import structs_ttypes = require('./structs_types');
import exceptions_ttypes = require('./exceptions_types');
import ttypes = require('./service_types');
declare class Client {
private output: thrift.TTransport;
private pClass: thrift.TProtocol;
private _seqid: number;
private output: thrift.TTransport;
private pClass: thrift.TProtocol;
private _seqid: number;
constructor(output: thrift.TTransport, pClass: { new(trans: thrift.TTransport): thrift.TProtocol });
constructor(
output: thrift.TTransport,
pClass: { new (trans: thrift.TTransport): thrift.TProtocol },
);
login(request: structs_ttypes.LoginRequest): Promise<structs_ttypes.LoginResponse>;
login(request: structs_ttypes.LoginRequest): Promise<structs_ttypes.LoginResponse>;
login(request: structs_ttypes.LoginRequest, callback?: (error: exceptions_ttypes.CoreServicesException, response: structs_ttypes.LoginResponse)=>void): void;
login(
request: structs_ttypes.LoginRequest,
callback?: (
error: exceptions_ttypes.CoreServicesException,
response: structs_ttypes.LoginResponse,
) => void,
): void;
getProfile(request: structs_ttypes.GetProfileRequest): Promise<structs_ttypes.GetProfileResponse>;
getProfile(request: structs_ttypes.GetProfileRequest): Promise<structs_ttypes.GetProfileResponse>;
getProfile(request: structs_ttypes.GetProfileRequest, callback?: (error: exceptions_ttypes.CoreServicesException, response: structs_ttypes.GetProfileResponse)=>void): void;
getProfile(
request: structs_ttypes.GetProfileRequest,
callback?: (
error: exceptions_ttypes.CoreServicesException,
response: structs_ttypes.GetProfileResponse,
) => void,
): void;
logout(request: structs_ttypes.LogoutRequest): Promise<structs_ttypes.LogoutResponse>;
logout(request: structs_ttypes.LogoutRequest): Promise<structs_ttypes.LogoutResponse>;
logout(request: structs_ttypes.LogoutRequest, callback?: (error: exceptions_ttypes.CoreServicesException, response: structs_ttypes.LogoutResponse)=>void): void;
logout(
request: structs_ttypes.LogoutRequest,
callback?: (
error: exceptions_ttypes.CoreServicesException,
response: structs_ttypes.LogoutResponse,
) => void,
): void;
getUserList(request: structs_ttypes.GetUserListRequest): Promise<structs_ttypes.GetUserListResponse>;
getUserList(
request: structs_ttypes.GetUserListRequest,
): Promise<structs_ttypes.GetUserListResponse>;
getUserList(request: structs_ttypes.GetUserListRequest, callback?: (error: exceptions_ttypes.CoreServicesException, response: structs_ttypes.GetUserListResponse)=>void): void;
getUserList(
request: structs_ttypes.GetUserListRequest,
callback?: (
error: exceptions_ttypes.CoreServicesException,
response: structs_ttypes.GetUserListResponse,
) => void,
): void;
createUser(request: structs_ttypes.CreateUserRequest): Promise<structs_ttypes.CreateUserResponse>;
createUser(request: structs_ttypes.CreateUserRequest): Promise<structs_ttypes.CreateUserResponse>;
createUser(request: structs_ttypes.CreateUserRequest, callback?: (error: exceptions_ttypes.CoreServicesException, response: structs_ttypes.CreateUserResponse)=>void): void;
createUser(
request: structs_ttypes.CreateUserRequest,
callback?: (
error: exceptions_ttypes.CoreServicesException,
response: structs_ttypes.CreateUserResponse,
) => void,
): void;
deleteUsers(request: structs_ttypes.DeleteUsersRequest): Promise<structs_ttypes.DeleteUsersResponse>;
deleteUsers(
request: structs_ttypes.DeleteUsersRequest,
): Promise<structs_ttypes.DeleteUsersResponse>;
deleteUsers(request: structs_ttypes.DeleteUsersRequest, callback?: (error: exceptions_ttypes.CoreServicesException, response: structs_ttypes.DeleteUsersResponse)=>void): void;
deleteUsers(
request: structs_ttypes.DeleteUsersRequest,
callback?: (
error: exceptions_ttypes.CoreServicesException,
response: structs_ttypes.DeleteUsersResponse,
) => void,
): void;
getWajibPajakList(request: structs_ttypes.GetWajibPajakListRequest): Promise<structs_ttypes.GetWajibPajakListResponse>;
getWajibPajakList(
request: structs_ttypes.GetWajibPajakListRequest,
): Promise<structs_ttypes.GetWajibPajakListResponse>;
getWajibPajakList(request: structs_ttypes.GetWajibPajakListRequest, callback?: (error: exceptions_ttypes.CoreServicesException, response: structs_ttypes.GetWajibPajakListResponse)=>void): void;
getWajibPajakList(
request: structs_ttypes.GetWajibPajakListRequest,
callback?: (
error: exceptions_ttypes.CoreServicesException,
response: structs_ttypes.GetWajibPajakListResponse,
) => void,
): void;
createWajibPajak(request: structs_ttypes.CreateWajibPajakRequest): Promise<structs_ttypes.CreateWajibPajakResponse>;
createWajibPajak(
request: structs_ttypes.CreateWajibPajakRequest,
): Promise<structs_ttypes.CreateWajibPajakResponse>;
createWajibPajak(request: structs_ttypes.CreateWajibPajakRequest, callback?: (error: exceptions_ttypes.CoreServicesException, response: structs_ttypes.CreateWajibPajakResponse)=>void): void;
createWajibPajak(
request: structs_ttypes.CreateWajibPajakRequest,
callback?: (
error: exceptions_ttypes.CoreServicesException,
response: structs_ttypes.CreateWajibPajakResponse,
) => void,
): void;
deleteWajibPajakList(request: structs_ttypes.DeleteWajibpajakListRequest): Promise<structs_ttypes.DeleteWajibpajakListResponse>;
deleteWajibPajakList(
request: structs_ttypes.DeleteWajibpajakListRequest,
): Promise<structs_ttypes.DeleteWajibpajakListResponse>;
deleteWajibPajakList(request: structs_ttypes.DeleteWajibpajakListRequest, callback?: (error: exceptions_ttypes.CoreServicesException, response: structs_ttypes.DeleteWajibpajakListResponse)=>void): void;
}
deleteWajibPajakList(
request: structs_ttypes.DeleteWajibpajakListRequest,
callback?: (
error: exceptions_ttypes.CoreServicesException,
response: structs_ttypes.DeleteWajibpajakListResponse,
) => void,
): void;
}
declare class Processor {
private _handler: object;
constructor(handler: object);
process(input: thrift.TProtocol, output: thrift.TProtocol): void;
process_login(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_getProfile(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_logout(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_getUserList(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_createUser(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_deleteUsers(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_getWajibPajakList(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_createWajibPajak(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_deleteWajibPajakList(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_login(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_getProfile(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_logout(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_getUserList(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_createUser(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_deleteUsers(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_getWajibPajakList(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_createWajibPajak(seqid: number, input: thrift.TProtocol, output: thrift.TProtocol): void;
process_deleteWajibPajakList(
seqid: number,
input: thrift.TProtocol,
output: thrift.TProtocol,
): void;
}

File diff suppressed because it is too large Load diff

View file

@ -8,11 +8,10 @@ import Thrift = thrift.Thrift;
import Q = thrift.Q;
import Int64 = require('node-int64');
declare class CoreServicesException extends Thrift.TException {
public code: number;
public message: string;
public parameters: { [k: string]: string; };
public code: number;
public message: string;
public parameters: { [k: string]: string };
constructor(args?: { code: number; message: string; parameters: { [k: string]: string; }; });
}
constructor(args?: { code: number; message: string; parameters: { [k: string]: string } });
}

View file

@ -3,18 +3,19 @@
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
"use strict";
'use strict';
const thrift = require('thrift');
const Thrift = thrift.Thrift;
const Int64 = require('node-int64');
const ttypes = module.exports = {};
const CoreServicesException = module.exports.CoreServicesException = class extends Thrift.TException {
const ttypes = (module.exports = {});
const CoreServicesException = (module.exports.CoreServicesException = class extends (
Thrift.TException
) {
constructor(args) {
super(args);
this.name = "CoreServicesException";
this.name = 'CoreServicesException';
this.code = null;
this.message = null;
this.parameters = null;
@ -31,7 +32,7 @@ const CoreServicesException = module.exports.CoreServicesException = class exten
}
}
read (input) {
read(input) {
input.readStructBegin();
while (true) {
const ret = input.readFieldBegin();
@ -42,36 +43,36 @@ const CoreServicesException = module.exports.CoreServicesException = class exten
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.I32) {
this.code = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.MAP) {
this.parameters = {};
const _rtmp31 = input.readMapBegin();
const _size0 = _rtmp31.size || 0;
for (let _i2 = 0; _i2 < _size0; ++_i2) {
let key3 = null;
let val4 = null;
key3 = input.readString();
val4 = input.readString();
this.parameters[key3] = val4;
if (ftype == Thrift.Type.I32) {
this.code = input.readI32();
} else {
input.skip(ftype);
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.MAP) {
this.parameters = {};
const _rtmp31 = input.readMapBegin();
const _size0 = _rtmp31.size || 0;
for (let _i2 = 0; _i2 < _size0; ++_i2) {
let key3 = null;
let val4 = null;
key3 = input.readString();
val4 = input.readString();
this.parameters[key3] = val4;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
@ -81,7 +82,7 @@ const CoreServicesException = module.exports.CoreServicesException = class exten
return;
}
write (output) {
write(output) {
output.writeStructBegin('CoreServicesException');
if (this.code !== null && this.code !== undefined) {
output.writeFieldBegin('code', Thrift.Type.I32, 1);
@ -95,10 +96,14 @@ const CoreServicesException = module.exports.CoreServicesException = class exten
}
if (this.parameters !== null && this.parameters !== undefined) {
output.writeFieldBegin('parameters', Thrift.Type.MAP, 3);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.parameters));
for (let kiter5 in this.parameters) {
output.writeMapBegin(
Thrift.Type.STRING,
Thrift.Type.STRING,
Thrift.objectLength(this.parameters),
);
for (const kiter5 in this.parameters) {
if (this.parameters.hasOwnProperty(kiter5)) {
let viter6 = this.parameters[kiter5];
const viter6 = this.parameters[kiter5];
output.writeString(kiter5);
output.writeString(viter6);
}
@ -110,5 +115,4 @@ const CoreServicesException = module.exports.CoreServicesException = class exten
output.writeStructEnd();
return;
}
};
});

View file

@ -8,11 +8,10 @@ import Thrift = thrift.Thrift;
import Q = thrift.Q;
import Int64 = require('node-int64');
declare class CommonException extends Thrift.TException {
public code: number;
public message: string;
public metadata?: { [k: string]: string; };
public code: number;
public message: string;
public metadata?: { [k: string]: string };
constructor(args?: { code: number; message: string; metadata?: { [k: string]: string; }; });
}
constructor(args?: { code: number; message: string; metadata?: { [k: string]: string } });
}

View file

@ -3,18 +3,17 @@
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
"use strict";
'use strict';
const thrift = require('thrift');
const Thrift = thrift.Thrift;
const Int64 = require('node-int64');
const ttypes = module.exports = {};
const CommonException = module.exports.CommonException = class extends Thrift.TException {
const ttypes = (module.exports = {});
const CommonException = (module.exports.CommonException = class extends Thrift.TException {
constructor(args) {
super(args);
this.name = "CommonException";
this.name = 'CommonException';
this.code = null;
this.message = null;
this.metadata = null;
@ -31,7 +30,7 @@ const CommonException = module.exports.CommonException = class extends Thrift.TE
}
}
read (input) {
read(input) {
input.readStructBegin();
while (true) {
const ret = input.readFieldBegin();
@ -42,36 +41,36 @@ const CommonException = module.exports.CommonException = class extends Thrift.TE
}
switch (fid) {
case 1:
if (ftype == Thrift.Type.I32) {
this.code = input.readI32();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.MAP) {
this.metadata = {};
const _rtmp31 = input.readMapBegin();
const _size0 = _rtmp31.size || 0;
for (let _i2 = 0; _i2 < _size0; ++_i2) {
let key3 = null;
let val4 = null;
key3 = input.readString();
val4 = input.readString();
this.metadata[key3] = val4;
if (ftype == Thrift.Type.I32) {
this.code = input.readI32();
} else {
input.skip(ftype);
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.message = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.MAP) {
this.metadata = {};
const _rtmp31 = input.readMapBegin();
const _size0 = _rtmp31.size || 0;
for (let _i2 = 0; _i2 < _size0; ++_i2) {
let key3 = null;
let val4 = null;
key3 = input.readString();
val4 = input.readString();
this.metadata[key3] = val4;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
@ -81,7 +80,7 @@ const CommonException = module.exports.CommonException = class extends Thrift.TE
return;
}
write (output) {
write(output) {
output.writeStructBegin('CommonException');
if (this.code !== null && this.code !== undefined) {
output.writeFieldBegin('code', Thrift.Type.I32, 1);
@ -95,10 +94,14 @@ const CommonException = module.exports.CommonException = class extends Thrift.TE
}
if (this.metadata !== null && this.metadata !== undefined) {
output.writeFieldBegin('metadata', Thrift.Type.MAP, 3);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.metadata));
for (let kiter5 in this.metadata) {
output.writeMapBegin(
Thrift.Type.STRING,
Thrift.Type.STRING,
Thrift.objectLength(this.metadata),
);
for (const kiter5 in this.metadata) {
if (this.metadata.hasOwnProperty(kiter5)) {
let viter6 = this.metadata[kiter5];
const viter6 = this.metadata[kiter5];
output.writeString(kiter5);
output.writeString(viter6);
}
@ -110,5 +113,4 @@ const CommonException = module.exports.CommonException = class extends Thrift.TE
output.writeStructEnd();
return;
}
};
});

View file

@ -9,5 +9,3 @@ import Q = thrift.Q;
import Int64 = require('node-int64');
import structs_ttypes = require('./structs_types');
import exceptions_ttypes = require('./exceptions_types');

View file

@ -3,7 +3,7 @@
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
"use strict";
'use strict';
const thrift = require('thrift');
const Thrift = thrift.Thrift;
@ -12,5 +12,4 @@ const Int64 = require('node-int64');
const structs_ttypes = require('./structs_types');
const exceptions_ttypes = require('./exceptions_types');
const ttypes = module.exports = {};
const ttypes = (module.exports = {});

View file

@ -8,7 +8,6 @@ import Thrift = thrift.Thrift;
import Q = thrift.Q;
import Int64 = require('node-int64');
declare enum RoleType {
UNKNOWN = 0,
SYSTEM = 1,
@ -36,174 +35,201 @@ declare enum WajibPajakOwnership {
}
declare class Role {
public id: Int64;
public displayName: string;
public roleType: RoleType;
public creator?: User;
public users?: User[];
public wajibPajakList?: WajibPajak[];
public id: Int64;
public displayName: string;
public roleType: RoleType;
public creator?: User;
public users?: User[];
public wajibPajakList?: WajibPajak[];
constructor(args?: { id: Int64; displayName: string; roleType: RoleType; creator?: User; users?: User[]; wajibPajakList?: WajibPajak[]; });
}
constructor(args?: {
id: Int64;
displayName: string;
roleType: RoleType;
creator?: User;
users?: User[];
wajibPajakList?: WajibPajak[];
});
}
declare class User {
public id: Int64;
public username: string;
public password: string;
public displayName: string;
public privateKey: Buffer;
public publicKey: Buffer;
public roles?: Role[];
public ownedWajibPajakList?: WajibPajak[];
public rolesWajibPajakList?: Role[];
public id: Int64;
public username: string;
public password: string;
public displayName: string;
public privateKey: Buffer;
public publicKey: Buffer;
public roles?: Role[];
public ownedWajibPajakList?: WajibPajak[];
public rolesWajibPajakList?: Role[];
constructor(args?: { id: Int64; username: string; password: string; displayName: string; privateKey: Buffer; publicKey: Buffer; roles?: Role[]; ownedWajibPajakList?: WajibPajak[]; rolesWajibPajakList?: Role[]; });
}
constructor(args?: {
id: Int64;
username: string;
password: string;
displayName: string;
privateKey: Buffer;
publicKey: Buffer;
roles?: Role[];
ownedWajibPajakList?: WajibPajak[];
rolesWajibPajakList?: Role[];
});
}
declare class WajibPajakProfile {
public npwp: string;
public displayName: string;
public address: string;
public npwp: string;
public displayName: string;
public address: string;
constructor(args?: { npwp: string; displayName: string; address: string; });
}
constructor(args?: { npwp: string; displayName: string; address: string });
}
declare class WajibPajakTaxObligation {
public id: Int64;
public obligation: JenisPajak;
public isActive: boolean;
public id: Int64;
public obligation: JenisPajak;
public isActive: boolean;
constructor(args?: { id: Int64; obligation: JenisPajak; isActive: boolean; });
}
constructor(args?: { id: Int64; obligation: JenisPajak; isActive: boolean });
}
declare class WajibPajak {
public id: Int64;
public profile: WajibPajakProfile;
public owners: User[];
public taxObligations?: WajibPajakTaxObligation[];
public roles?: Role[];
public id: Int64;
public profile: WajibPajakProfile;
public owners: User[];
public taxObligations?: WajibPajakTaxObligation[];
public roles?: Role[];
constructor(args?: { id: Int64; profile: WajibPajakProfile; owners: User[]; taxObligations?: WajibPajakTaxObligation[]; roles?: Role[]; });
}
constructor(args?: {
id: Int64;
profile: WajibPajakProfile;
owners: User[];
taxObligations?: WajibPajakTaxObligation[];
roles?: Role[];
});
}
declare class Pagination {
public page: Int64;
public rowsPerPage: Int64;
public page: Int64;
public rowsPerPage: Int64;
constructor(args?: { page: Int64; rowsPerPage: Int64; });
}
constructor(args?: { page: Int64; rowsPerPage: Int64 });
}
declare class AlertInfo {
public title: string;
public description: string;
public title: string;
public description: string;
constructor(args?: { title: string; description: string; });
}
constructor(args?: { title: string; description: string });
}
declare class LoginRequest {
public username: string;
public password: string;
public username: string;
public password: string;
constructor(args?: { username: string; password: string; });
}
constructor(args?: { username: string; password: string });
}
declare class LoginResponse {
public trkToken: string;
public token: string;
public profile?: User;
public trkToken: string;
public token: string;
public profile?: User;
constructor(args?: { trkToken: string; token: string; profile?: User; });
}
constructor(args?: { trkToken: string; token: string; profile?: User });
}
declare class LogoutRequest {
public token: string;
public token: string;
constructor(args?: { token: string; });
}
constructor(args?: { token: string });
}
declare class LogoutResponse {
}
declare class LogoutResponse {}
declare class GetProfileRequest {
}
declare class GetProfileRequest {}
declare class GetProfileResponse {
public profile: User;
public profile: User;
constructor(args?: { profile: User; });
}
constructor(args?: { profile: User });
}
declare class GetUserListRequest {
public pagination: Pagination;
public searchTerm: string;
public pagination: Pagination;
public searchTerm: string;
constructor(args?: { pagination: Pagination; searchTerm: string; });
}
constructor(args?: { pagination: Pagination; searchTerm: string });
}
declare class GetUserListResponse {
public pagination: Pagination;
public totalUsers: Int64;
public users: User[];
public pagination: Pagination;
public totalUsers: Int64;
public users: User[];
constructor(args?: { pagination: Pagination; totalUsers: Int64; users: User[]; });
}
constructor(args?: { pagination: Pagination; totalUsers: Int64; users: User[] });
}
declare class CreateUserRequest {
public user: User;
public user: User;
constructor(args?: { user: User; });
}
constructor(args?: { user: User });
}
declare class CreateUserResponse {
}
declare class CreateUserResponse {}
declare class DeleteUsersRequest {
public userIds: Int64[];
public userIds: Int64[];
constructor(args?: { userIds: Int64[]; });
}
constructor(args?: { userIds: Int64[] });
}
declare class DeleteUsersResponse {
public success: Int64[];
public ignored: Int64[];
public success: Int64[];
public ignored: Int64[];
constructor(args?: { success: Int64[]; ignored: Int64[]; });
}
constructor(args?: { success: Int64[]; ignored: Int64[] });
}
declare class GetWajibPajakListRequest {
public pagination: Pagination;
public ownership: WajibPajakOwnership;
public searchTerm: string;
public pagination: Pagination;
public ownership: WajibPajakOwnership;
public searchTerm: string;
constructor(args?: { pagination: Pagination; ownership: WajibPajakOwnership; searchTerm: string; });
}
constructor(args?: {
pagination: Pagination;
ownership: WajibPajakOwnership;
searchTerm: string;
});
}
declare class GetWajibPajakListResponse {
public pagination: Pagination;
public totalWajibPajak: Int64;
public wajibPajakList: WajibPajak[];
public pagination: Pagination;
public totalWajibPajak: Int64;
public wajibPajakList: WajibPajak[];
constructor(args?: { pagination: Pagination; totalWajibPajak: Int64; wajibPajakList: WajibPajak[]; });
}
constructor(args?: {
pagination: Pagination;
totalWajibPajak: Int64;
wajibPajakList: WajibPajak[];
});
}
declare class CreateWajibPajakRequest {
public wajibPajak: WajibPajak;
public wajibPajak: WajibPajak;
constructor(args?: { wajibPajak: WajibPajak; });
}
constructor(args?: { wajibPajak: WajibPajak });
}
declare class CreateWajibPajakResponse {
}
declare class CreateWajibPajakResponse {}
declare class DeleteWajibpajakListRequest {
public wpIds: Int64[];
public wpIds: Int64[];
constructor(args?: { wpIds: Int64[]; });
}
constructor(args?: { wpIds: Int64[] });
}
declare class DeleteWajibpajakListResponse {
public success: Int64[];
public ignored: Int64[];
public success: Int64[];
public ignored: Int64[];
constructor(args?: { success: Int64[]; ignored: Int64[]; });
}
constructor(args?: { success: Int64[]; ignored: Int64[] });
}

File diff suppressed because it is too large Load diff

View file

@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WPW-CTL</title>
<title>Vite + Vue + TS</title>
</head>
<body>
<div id="app"></div>

View file

@ -1,5 +1,5 @@
{
"name": "frontend",
"name": "frontend2",
"private": true,
"version": "0.0.0",
"type": "module",
@ -14,82 +14,50 @@
"@algolia/client-search": "^4.14.2",
"@heroicons/vue": "^2.0.13",
"@vueuse/core": "^9.4.0",
"classnames": "^2.3.2",
"flowbite": "1.5.0",
"flowbite-vue": "^0.0.6",
"pinia": "^2.0.23",
"node-int64": "^0.4.0",
"node-stdlib-browser": "^1.2.0",
"pinia": "^2.0.27",
"thrift": "^0.16.0",
"vue": "^3.2.41",
"vue-router": "^4.1.6",
"vue3-easy-data-table": "^1.5.12",
"vue3-easy-data-table": "^1.5.20",
"vue3-perfect-scrollbar": "^1.6.1"
},
"devDependencies": {
"node-stdlib-browser": "^1.2.0",
"@ampproject/rollup-plugin-closure-compiler": "^0.27.0",
"@babel/core": "^7.0.0",
"@babel/plugin-syntax-class-properties": "^7.12.13",
"@babel/plugin-transform-classes": "^7.19.0",
"@babel/preset-env": "^7.19.4",
"@esbuild-plugins/node-globals-polyfill": "^0.1.1",
"@esbuild-plugins/node-modules-polyfill": "^0.1.4",
"@lopatnov/rollup-plugin-uglify": "^2.1.5",
"@originjs/vite-plugin-commonjs": "^1.0.3",
"@rollup/plugin-babel": "^6.0.2",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-inject": "^4.0.4",
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-commonjs": "^23.0.3",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-terser": "^0.1.0",
"@rushstack/eslint-patch": "^1.2.0",
"@types/node": "^16.18.3",
"@types/thrift": "^0.10.11",
"@vitejs/plugin-legacy": "^2.3.0",
"@vitejs/plugin-vue": "^3.2.0",
"@vitejs/plugin-vue-jsx": "^2.1.0",
"@vitejs/plugin-vue-jsx": "^2.1.1",
"@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^11.0.2",
"@vue/tsconfig": "^0.1.3",
"@vuedx/typecheck": "^0.7.6",
"@vuedx/typescript-plugin-vue": "^0.7.6",
"autoprefixer": "^10.4.13",
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
"class-names": "^1.0.0",
"esbuild": "*",
"eslint": "^8.5.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.7.0",
"node-int64": "^0.4.0",
"postcss": "^8.4.18",
"postcss": "^8.2.15",
"prettier": "^2.7.1",
"rollup": "^2.79.0",
"rollup-obfuscator": "^3.0.1",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-node-polyfills": "^0.2.1",
"tailwindcss": "^3.2.2",
"terser": "^5.15.1",
"tailwindcss": "^3",
"typescript": "^4.6.4",
"vite": "^3.2.0",
"vite-plugin-chunk-split": "^0.4.3",
"vite": "^3.2.3",
"vite-plugin-commonjs": "^0.6.0",
"vite-plugin-node-stdlib-browser": "^0.1.1",
"vue-router": "^4.1.6",
"vue-tsc": "^1.0.9"
},
"eslintConfigxxx": {
"root": true,
"env": {
"browser": true,
"node": true,
"es6": true
},
"extendsxx": [
"plugin:vue/essential",
"plugin:prettier/recommended",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
}
}

File diff suppressed because it is too large Load diff

View file

@ -4,8 +4,8 @@
import NavigationBar from './components/NavigationBar.vue';
import { useHub } from './hub';
import { useTheme } from './stores/theme';
import /* * as */structs from '@thriftgen/structs_types';
import /* * as */exceptions from '@thriftgen/exceptions_types';
import /* * as */ structs from '@thriftgen/structs_types';
import /* * as */ exceptions from '@thriftgen/exceptions_types';
import { RouteMeta, useRouter } from 'vue-router';
import { AlertType, useAlert } from './stores/alert';
import { useAuth } from './stores/auth';

View file

@ -4,7 +4,7 @@ import { useAlert } from '@/stores/alert';
import { useAuth } from '@/stores/auth';
import { computed, ref, watch } from 'vue';
import { RouteLocationRaw, RouterLink, useRouter } from 'vue-router';
import /* * as */structs from '@thriftgen/structs_types';
import /* * as */ structs from '@thriftgen/structs_types';
import SpinnerIcon from './SpinnerIcon.vue';
import { NavbarLinkMeta } from '@/router';
const auth = useAuth();

View file

@ -1,5 +1,5 @@
import { ThriftClient } from './xhr_client';
import /* * as */Core from '@thriftgen/CoreService';
import /* * as */ Core from '@thriftgen/CoreService';
import { ServiceType } from './service_type';
import { ClientOptions } from '.';
import { defaultClientOptions } from './defaults';

View file

@ -8,7 +8,12 @@ import {
} from 'thrift';
import { computed } from 'vue';
import { ClientOptions } from '.';
import { CookieKeyAuthToken, CookieKeyTrackToken, HeaderKeyAuthToken, HeaderKeyTrackToken } from './hub';
import {
CookieKeyAuthToken,
CookieKeyTrackToken,
HeaderKeyAuthToken,
HeaderKeyTrackToken,
} from './hub';
export function initXHRClient<TClient>(
clientCtor: TClientConstructor<TClient>,

View file

@ -1,6 +1,6 @@
import { defineStore } from 'pinia';
import /* * as */structs from '@thriftgen/structs_types';
import /* * as */ structs from '@thriftgen/structs_types';
import { deleteCookie, getCookie, setCookie } from '@/utils/cookie';
import { CookieKeyAuthToken, CookieKeyTrackToken } from '@/hub/hub';
import { RemovableRef, useLocalStorage } from '@vueuse/core';

View file

@ -11,7 +11,7 @@ export const useTheme = defineStore({
return state._darkTheme;
},
navigationBarVisibility(state): boolean {
return state._navigationBarVisibility
return state._navigationBarVisibility;
},
},
actions: {

View file

@ -1,6 +1,6 @@
<script lang="ts" setup>
import /* * as */structs from '@thriftgen/structs_types';
import /* * as */exceptions from '@thriftgen/exceptions_types';
import /* * as */ structs from '@thriftgen/structs_types';
import /* * as */ exceptions from '@thriftgen/exceptions_types';
import { useHub } from '@/hub';
import { computed, ref, watch } from 'vue';
import type { Header, Item, ServerOptions, SortType } from 'vue3-easy-data-table';

View file

@ -11,6 +11,8 @@ const auth = useAuth();
<HeadingPage
>Welcome<span v-if="auth.profile">, {{ auth.profile?.displayName }}</span></HeadingPage
>
<a class="text-blue-600" href="https://git.obj.my.id/study-dumps/wpw-final">Source code</a>
</div>
</div>
</template>

View file

@ -3,8 +3,8 @@ import LoginCard from '@/views/core/components/LoginCard.vue';
import NavigationBar from '@/components/NavigationBar.vue';
import { useAuth } from '@/stores/auth';
import { useRoute, useRouter } from 'vue-router';
import /* * as */structs from '@thriftgen/structs_types';
import /* * as */exceptions from '@thriftgen/exceptions_types';
import /* * as */ structs from '@thriftgen/structs_types';
import /* * as */ exceptions from '@thriftgen/exceptions_types';
import { useAlert } from '@/stores/alert';
import { computed, watch } from 'vue';

View file

@ -1,8 +1,8 @@
<script lang="ts" setup>
import AlertBox from '@/components/AlertBox.vue';
import { useHub } from '@/hub';
import /* * as */structs from '@thriftgen/structs_types';
import /* * as */exceptions from '@thriftgen/exceptions_types';
import /* * as */ structs from '@thriftgen/structs_types';
import /* * as */ exceptions from '@thriftgen/exceptions_types';
import { computed, ref, watch } from 'vue';
import { Header, Item, ServerOptions, SortType } from 'vue3-easy-data-table';
import HeadingPage from './components/HeadingPage.vue';

View file

@ -1,6 +1,6 @@
<script lang="ts" setup>
import { useHub } from '@/hub';
import /* * as */structs from '@thriftgen/structs_types';
import /* * as */ structs from '@thriftgen/structs_types';
import { EyeIcon, EyeSlashIcon } from '@heroicons/vue/24/solid';
import { computed, ref, watch } from 'vue';
import AlertBox from '@/components/AlertBox.vue';

View file

@ -30,7 +30,7 @@ function hide() {
onMounted(() => {
const targetEl = refTargetEl.value;
let options: any = {
const options: any = {
onHide: () => {
console.log('modal hide');
emit('onHide');
@ -46,10 +46,10 @@ onMounted(() => {
};
if (props.backdropClasses) options.backdropClasses = props.backdropClasses;
if (props.placement) options.placement = props.placement;
// @ts-ignore
modal = new Modal(targetEl, options);
watch(
() => props.show,
(value) => {

View file

@ -5,8 +5,6 @@ import HomeView from './HomeView.vue';
import LoginView from './LoginView.vue';
import UserWajibPajakListViewVue from './UserWajibPajakListView.vue';
export function routes(): RouteRecordRaw[] {
return [
{

View file

@ -3,6 +3,5 @@
declare module '*.vue' {
import type { DefineComponent } from 'vue';
const component: DefineComponent<{}, {}, any>;
export default component;
}

View file

@ -3,13 +3,9 @@
"paths": {
"@/*": ["./src/*"],
"@thriftgen/*": ["./gen/*"],
// "@flowbite-vue": ["./3rdparty/flowbite-vue/src/*"],
},
// "target": "ESNext",
// "module": "ESNext",
"target": "ESNext",
"module": "ESNext",
"target": "ES5",
"sourceMap": true,
"useDefineForClassFields": true,
"moduleResolution": "Node",
"strict": true,
@ -19,17 +15,18 @@
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"noImplicitReturns": true,
"lib": ["ESNext", "DOM"],
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"plugins": [{ "name": "@vuedx/typescript-plugin-vue" }],
"skipLibCheck": true,
"noEmit": true
"noEmit": true,
"types": [
// "webpack-env",
]
},
"include": [
"env.d.ts",
"src/**/*.ts",
"src/**/*.d.ts",
"src/**/*.tsx",
"src/**/*.ts",
"src/**/*.d.ts",
"src/**/*.tsx",
"src/**/*.vue",
],
"references": [{ "path": "./tsconfig.node.json" }]

View file

@ -4,12 +4,12 @@
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
},
"include": [
"package.json",
"vite.config.ts",
"vite-polyfill-aliases.ts",
"vite-polyfill-aliases.ts"
]
}

View file

@ -1,4 +1,10 @@
export default {
// This Rollup aliases are extracted from @esbuild-plugins/node-modules-polyfill,
// see https://github.com/remorses/esbuild-plugins/blob/master/node-modules-polyfill/src/polyfills.ts
// process and buffer are excluded because already managed
// by node-globals-polyfill
// https://github.com/vitejs/vite/issues/9511
util: 'rollup-plugin-node-polyfills/polyfills/util',
sys: 'util',
events: 'rollup-plugin-node-polyfills/polyfills/events',
@ -27,6 +33,4 @@ export default {
buffer: 'rollup-plugin-node-polyfills/polyfills/buffer-es6',
process: 'rollup-plugin-node-polyfills/polyfills/process-es6',
// Buffer: 'buffer/',
// process: 'rollup-plugin-node-globals',
};

View file

@ -1,3 +1,5 @@
import { Plugin } from 'rollup';
import { fileURLToPath, URL } from 'node:url';
import { defineConfig, optimizeDeps } from 'vite';
import vue from '@vitejs/plugin-vue';
@ -7,28 +9,66 @@ import { esbuildCommonjs, viteCommonjs } from '@originjs/vite-plugin-commonjs';
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill';
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill';
import { Plugin } from 'rollup';
import { splitVendorChunkPlugin } from 'vite';
import rollupNodePolyfills from 'rollup-plugin-node-polyfills';
import viteNodePolyfills from 'vite-plugin-node-stdlib-browser';
import { nodeResolve as rollupNodeResolve } from '@rollup/plugin-node-resolve';
import rollupCommonjs from '@rollup/plugin-commonjs';
import terser from '@rollup/plugin-terser';
import compiler from '@ampproject/rollup-plugin-closure-compiler';
import { babel, getBabelOutputPlugin } from '@rollup/plugin-babel';
import legacy from '@vitejs/plugin-legacy';
import uglify from '@lopatnov/rollup-plugin-uglify';
import { obfuscator } from 'rollup-obfuscator';
import { chunkSplitPlugin } from 'vite-plugin-chunk-split';
import { dependencies } from './package.json';
import polyfillAliases from './vite-polyfill-aliases';
import { resolve } from 'node:path';
import { dependencies } from './package.json';
export function injectSecPlugin(mode) {
return ['production', 'live'].indexOf(mode) !== -1 ? secPlugins : [];
function injectSecPlugin(mode) {
return ['production', 'live', 'prod'].indexOf(mode) !== -1 ? secPlugins : [];
}
// https://vitejs.dev/config/
export default defineConfig(({ command, mode, ssrBuild }) => {
return {
plugins: [viteCommonjs(), vue(), vueJsx()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'@thriftgen': fileURLToPath(new URL('./gen', import.meta.url)),
...polyfillAliases,
},
},
define: {
global: 'globalThis',
},
optimizeDeps: {
esbuildOptions: {
define: { global: 'globalThis' },
plugins: [
NodeGlobalsPolyfillPlugin({
process: true,
buffer: true,
}),
NodeModulesPolyfillPlugin(),
],
},
},
build: {
outDir: '../public',
manifest: true,
minify: false,
rollupOptions: {
plugins: [
rollupNodePolyfills(),
rollupNodeResolve(),
rollupCommonjs({}),
esbuildCommonjs(['thrift']),
...injectSecPlugin(mode),
],
},
},
};
});
import { obfuscator } from 'rollup-obfuscator';
import terser from '@rollup/plugin-terser';
export const secPlugins: Plugin[] = [
// NOT WORK.
// babel({
@ -186,164 +226,4 @@ export const secPlugins: Plugin[] = [
comments: 'some',
},
}),
];
// https://vitejs.dev/config/
export default defineConfig(({ command, mode, ssrBuild }) => {
return {
plugins: [viteCommonjs(), vue(), vueJsx()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'@thriftgen': fileURLToPath(new URL('./gen', import.meta.url)),
...polyfillAliases,
},
},
define: {
global: 'window',
},
optimizeDeps: {
esbuildOptions: {
define: { global: 'globalThis' },
plugins: [
NodeGlobalsPolyfillPlugin({
process: true,
buffer: true,
}),
NodeModulesPolyfillPlugin(),
],
},
// exclude: ['flowbite', 'flowbite-vue', 'thrift'],
},
build: {
outDir: '../public',
manifest: true,
minify: false,
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
},
output: {
// to be able to use manual chunk - iife
// inlineDynamicImports: true,
manualChunks(id, { getModuleInfo, getModuleIds }) {
// const dynImpIds = getModuleInfo(id).dynamicImporters;
// if (/(gen\/|thrift|Thrift|util|events|inherits|WebSocket|Int64|ws)/.test(id)) return 'ext';
// if (/flowbite/.test(id)) return 'flowbite';
// if (/data-table/.test(id)) return 'edt';
// if (/scrollbar/.test(id)) return 'scrollbar';
// if (/(node_modules)/.test(id)) return 'vendor';
// if (id in dependencies) {
// return 'vendor';
// }
},
},
plugins: [
rollupNodePolyfills(),
rollupNodeResolve(),
rollupCommonjs({}),
esbuildCommonjs(['thrift']),
],
},
},
};
});
export const x = defineConfig(({ command, mode, ssrBuild }) => {
return {
plugins: [viteNodePolyfills(), viteCommonjs(), vue(), vueJsx()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
'@thriftgen': fileURLToPath(new URL('./gen', import.meta.url)),
// '@flowbite-vue': fileURLToPath(new URL('./3rdparty/flowbite-vue/src', import.meta.url)),
...polyfillAliases,
},
},
optimizeDeps: {
esbuildOptions: {
define: { global: 'globalThis' },
plugins: [
NodeGlobalsPolyfillPlugin({
process: true,
buffer: true,
}),
NodeModulesPolyfillPlugin(),
],
},
// include: [],
// exclude: [/@thriftgen/],
// exclude: [
// 'flowbite',
// 'flowbite-vue',
// 'thrift',
// 'vue3-easy-data-table',
// 'vue3-perfect-scrollbar',
// ...['structs_types', 'exceptions_types', 'CoreService'].map((x) => '@thriftgen/' + x),
// ],
},
build: {
outDir: '../public',
manifest: true,
// minify: 'terser',
minify: false,
// target: 'esnext',
rollupOptions: {
// input: {
// main: resolve(__dirname, 'index.html'),
// },
// output: {
// // format: 'iife',
// // format: 'cjs',
// globals: {
// // vue: "Vue"
// },
// // to be able to use manual chunk - iife
// // inlineDynamicImports: true,
// // manualChunks(id, { getModuleInfo, getModuleIds }) {
// // // if (/(gen\/|thrift|Thrift|util|inherits|WebSocket|Int64)/.test(id)) return 'ext';
// // // const dynImpIds = getModuleInfo(id).dynamicImporters;
// // if (/data-table/.test(id)) return 'edt';
// // if (/(node_modules)/.test(id)) return 'vendor';
// // // if (id in dependencies) {
// // // return 'vendor';
// // // }
// // },
// },
external: [
// "vue",
],
plugins: [
// chunkSplitPlugin({
// strategy: 'single-vendor',
// customSplitting: {
// 'thrift-vendor': ['thrift'],
// 'flowbite-vendor': ['flowbite'],
// },
// }),
// splitVendorChunkPlugin(),
rollupNodePolyfills(),
rollupNodeResolve(),
rollupCommonjs({}),
esbuildCommonjs(['thrift']),
// NOT WORK.
// ...legacy({
// targets: ['defaults', 'IE 11'],
// }),
...injectSecPlugin(mode),
],
},
},
};
});
];

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
<script type="module" crossorigin src="/assets/index.241d8ed5.js"></script>
<script type="module" crossorigin src="/assets/index.d28a354c.js"></script>
<link rel="stylesheet" href="/assets/index.d6f403e9.css">
</head>
<body>

View file

@ -1,6 +1,6 @@
{
"index.html": {
"file": "assets/index.241d8ed5.js",
"file": "assets/index.d28a354c.js",
"src": "index.html",
"isEntry": true,
"css": [