Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Momento
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Momento
Commits
86981a01
Commit
86981a01
authored
Dec 24, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove js
parent
672cfcfc
Pipeline
#8110
passed with stages
in 2 minutes and 46 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
433 deletions
+0
-433
src/app.module.js
src/app.module.js
+0
-98
src/dto/ReturnMessage.dto.js
src/dto/ReturnMessage.dto.js
+0
-67
src/main.js
src/main.js
+0
-69
src/message/message.service.js
src/message/message.service.js
+0
-117
src/utility/config.js
src/utility/config.js
+0
-82
No files found.
src/app.module.js
deleted
100644 → 0
View file @
672cfcfc
"
use strict
"
;
var
__decorate
=
(
this
&&
this
.
__decorate
)
||
function
(
decorators
,
target
,
key
,
desc
)
{
var
c
=
arguments
.
length
,
r
=
c
<
3
?
target
:
desc
===
null
?
desc
=
Object
.
getOwnPropertyDescriptor
(
target
,
key
)
:
desc
,
d
;
if
(
typeof
Reflect
===
"
object
"
&&
typeof
Reflect
.
decorate
===
"
function
"
)
r
=
Reflect
.
decorate
(
decorators
,
target
,
key
,
desc
);
else
for
(
var
i
=
decorators
.
length
-
1
;
i
>=
0
;
i
--
)
if
(
d
=
decorators
[
i
])
r
=
(
c
<
3
?
d
(
r
)
:
c
>
3
?
d
(
target
,
key
,
r
)
:
d
(
target
,
key
))
||
r
;
return
c
>
3
&&
r
&&
Object
.
defineProperty
(
target
,
key
,
r
),
r
;
};
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
());
});
};
var
__generator
=
(
this
&&
this
.
__generator
)
||
function
(
thisArg
,
body
)
{
var
_
=
{
label
:
0
,
sent
:
function
()
{
if
(
t
[
0
]
&
1
)
throw
t
[
1
];
return
t
[
1
];
},
trys
:
[],
ops
:
[]
},
f
,
y
,
t
,
g
;
return
g
=
{
next
:
verb
(
0
),
"
throw
"
:
verb
(
1
),
"
return
"
:
verb
(
2
)
},
typeof
Symbol
===
"
function
"
&&
(
g
[
Symbol
.
iterator
]
=
function
()
{
return
this
;
}),
g
;
function
verb
(
n
)
{
return
function
(
v
)
{
return
step
([
n
,
v
]);
};
}
function
step
(
op
)
{
if
(
f
)
throw
new
TypeError
(
"
Generator is already executing.
"
);
while
(
_
)
try
{
if
(
f
=
1
,
y
&&
(
t
=
op
[
0
]
&
2
?
y
[
"
return
"
]
:
op
[
0
]
?
y
[
"
throw
"
]
||
((
t
=
y
[
"
return
"
])
&&
t
.
call
(
y
),
0
)
:
y
.
next
)
&&
!
(
t
=
t
.
call
(
y
,
op
[
1
])).
done
)
return
t
;
if
(
y
=
0
,
t
)
op
=
[
op
[
0
]
&
2
,
t
.
value
];
switch
(
op
[
0
])
{
case
0
:
case
1
:
t
=
op
;
break
;
case
4
:
_
.
label
++
;
return
{
value
:
op
[
1
],
done
:
false
};
case
5
:
_
.
label
++
;
y
=
op
[
1
];
op
=
[
0
];
continue
;
case
7
:
op
=
_
.
ops
.
pop
();
_
.
trys
.
pop
();
continue
;
default
:
if
(
!
(
t
=
_
.
trys
,
t
=
t
.
length
>
0
&&
t
[
t
.
length
-
1
])
&&
(
op
[
0
]
===
6
||
op
[
0
]
===
2
))
{
_
=
0
;
continue
;
}
if
(
op
[
0
]
===
3
&&
(
!
t
||
(
op
[
1
]
>
t
[
0
]
&&
op
[
1
]
<
t
[
3
])))
{
_
.
label
=
op
[
1
];
break
;
}
if
(
op
[
0
]
===
6
&&
_
.
label
<
t
[
1
])
{
_
.
label
=
t
[
1
];
t
=
op
;
break
;
}
if
(
t
&&
_
.
label
<
t
[
2
])
{
_
.
label
=
t
[
2
];
_
.
ops
.
push
(
op
);
break
;
}
if
(
t
[
2
])
_
.
ops
.
pop
();
_
.
trys
.
pop
();
continue
;
}
op
=
body
.
call
(
thisArg
,
_
);
}
catch
(
e
)
{
op
=
[
6
,
e
];
y
=
0
;
}
finally
{
f
=
t
=
0
;
}
if
(
op
[
0
]
&
5
)
throw
op
[
1
];
return
{
value
:
op
[
0
]
?
op
[
1
]
:
void
0
,
done
:
true
};
}
};
var
__spreadArray
=
(
this
&&
this
.
__spreadArray
)
||
function
(
to
,
from
,
pack
)
{
if
(
pack
||
arguments
.
length
===
2
)
for
(
var
i
=
0
,
l
=
from
.
length
,
ar
;
i
<
l
;
i
++
)
{
if
(
ar
||
!
(
i
in
from
))
{
if
(
!
ar
)
ar
=
Array
.
prototype
.
slice
.
call
(
from
,
0
,
i
);
ar
[
i
]
=
from
[
i
];
}
}
return
to
.
concat
(
ar
||
Array
.
prototype
.
slice
.
call
(
from
));
};
exports
.
__esModule
=
true
;
exports
.
AppModule
=
void
0
;
var
common_1
=
require
(
"
@nestjs/common
"
);
var
config_1
=
require
(
"
@nestjs/config
"
);
var
config_2
=
require
(
"
./utility/config
"
);
var
koishi_nestjs_1
=
require
(
"
koishi-nestjs
"
);
var
koishi_plugin_adapter_onebot_ex_1
=
require
(
"
koishi-plugin-adapter-onebot-ex
"
);
var
message_service_1
=
require
(
"
./message/message.service
"
);
var
plugin_assets_s3_1
=
require
(
"
@koishijs/plugin-assets-s3
"
);
var
AppModule
=
/** @class */
(
function
()
{
function
AppModule
()
{
}
AppModule
=
__decorate
([
(
0
,
common_1
.
Module
)({
imports
:
[
config_1
.
ConfigModule
.
forRoot
({
ignoreEnvVars
:
true
,
load
:
[
config_2
.
loadConfig
],
isGlobal
:
true
}),
koishi_nestjs_1
.
KoishiModule
.
registerAsync
({
inject
:
[
config_1
.
ConfigService
],
useFactory
:
function
(
configService
)
{
return
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
var
onebotConfig
,
s3Config
;
return
__generator
(
this
,
function
(
_a
)
{
onebotConfig
=
configService
.
get
(
'
onebot
'
);
s3Config
=
configService
.
get
(
'
s3
'
);
return
[
2
/*return*/
,
{
prefix
:
'
__never_prefix
'
,
minSimilarity
:
1
,
help
:
false
,
useWs
:
true
,
usePlugins
:
__spreadArray
([
(
0
,
koishi_nestjs_1
.
PluginDef
)(
koishi_plugin_adapter_onebot_ex_1
[
"
default
"
],
onebotConfig
)
],
(
s3Config
?
[(
0
,
koishi_nestjs_1
.
PluginDef
)(
plugin_assets_s3_1
[
"
default
"
],
s3Config
)]
:
[]),
true
)
}];
});
});
}
}),
],
providers
:
[
message_service_1
.
MessageService
]
})
],
AppModule
);
return
AppModule
;
}());
exports
.
AppModule
=
AppModule
;
src/dto/ReturnMessage.dto.js
deleted
100644 → 0
View file @
672cfcfc
"
use strict
"
;
var
__extends
=
(
this
&&
this
.
__extends
)
||
(
function
()
{
var
extendStatics
=
function
(
d
,
b
)
{
extendStatics
=
Object
.
setPrototypeOf
||
({
__proto__
:
[]
}
instanceof
Array
&&
function
(
d
,
b
)
{
d
.
__proto__
=
b
;
})
||
function
(
d
,
b
)
{
for
(
var
p
in
b
)
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
b
,
p
))
d
[
p
]
=
b
[
p
];
};
return
extendStatics
(
d
,
b
);
};
return
function
(
d
,
b
)
{
if
(
typeof
b
!==
"
function
"
&&
b
!==
null
)
throw
new
TypeError
(
"
Class extends value
"
+
String
(
b
)
+
"
is not a constructor or null
"
);
extendStatics
(
d
,
b
);
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
})();
var
__decorate
=
(
this
&&
this
.
__decorate
)
||
function
(
decorators
,
target
,
key
,
desc
)
{
var
c
=
arguments
.
length
,
r
=
c
<
3
?
target
:
desc
===
null
?
desc
=
Object
.
getOwnPropertyDescriptor
(
target
,
key
)
:
desc
,
d
;
if
(
typeof
Reflect
===
"
object
"
&&
typeof
Reflect
.
decorate
===
"
function
"
)
r
=
Reflect
.
decorate
(
decorators
,
target
,
key
,
desc
);
else
for
(
var
i
=
decorators
.
length
-
1
;
i
>=
0
;
i
--
)
if
(
d
=
decorators
[
i
])
r
=
(
c
<
3
?
d
(
r
)
:
c
>
3
?
d
(
target
,
key
,
r
)
:
d
(
target
,
key
))
||
r
;
return
c
>
3
&&
r
&&
Object
.
defineProperty
(
target
,
key
,
r
),
r
;
};
exports
.
__esModule
=
true
;
exports
.
ReturnMessageDto
=
exports
.
BlankReturnMessageDto
=
void
0
;
var
openapi
=
require
(
"
@nestjs/swagger
"
);
var
swagger_1
=
require
(
"
@nestjs/swagger
"
);
var
common_1
=
require
(
"
@nestjs/common
"
);
var
BlankReturnMessageDto
=
/** @class */
(
function
()
{
function
BlankReturnMessageDto
(
statusCode
,
message
)
{
this
.
statusCode
=
statusCode
;
this
.
message
=
message
||
'
success
'
;
this
.
success
=
statusCode
<
400
;
}
BlankReturnMessageDto
.
prototype
.
toException
=
function
()
{
return
new
common_1
.
HttpException
(
this
,
this
.
statusCode
);
};
BlankReturnMessageDto
.
_OPENAPI_METADATA_FACTORY
=
function
()
{
return
{
statusCode
:
{
required
:
true
,
type
:
function
()
{
return
Number
;
}
},
message
:
{
required
:
true
,
type
:
function
()
{
return
String
;
}
},
success
:
{
required
:
true
,
type
:
function
()
{
return
Boolean
;
}
}
};
};
__decorate
([
(
0
,
swagger_1
.
ApiProperty
)({
description
:
'
返回状态
'
})
],
BlankReturnMessageDto
.
prototype
,
"
statusCode
"
);
__decorate
([
(
0
,
swagger_1
.
ApiProperty
)({
description
:
'
返回信息
'
})
],
BlankReturnMessageDto
.
prototype
,
"
message
"
);
__decorate
([
(
0
,
swagger_1
.
ApiProperty
)({
description
:
'
是否成功
'
})
],
BlankReturnMessageDto
.
prototype
,
"
success
"
);
return
BlankReturnMessageDto
;
}());
exports
.
BlankReturnMessageDto
=
BlankReturnMessageDto
;
var
ReturnMessageDto
=
/** @class */
(
function
(
_super
)
{
__extends
(
ReturnMessageDto
,
_super
);
function
ReturnMessageDto
(
statusCode
,
message
,
data
)
{
var
_this
=
_super
.
call
(
this
,
statusCode
,
message
)
||
this
;
_this
.
data
=
data
;
return
_this
;
}
ReturnMessageDto
.
_OPENAPI_METADATA_FACTORY
=
function
()
{
return
{
data
:
{
required
:
false
}
};
};
__decorate
([
(
0
,
swagger_1
.
ApiProperty
)({
description
:
'
返回内容
'
})
],
ReturnMessageDto
.
prototype
,
"
data
"
);
return
ReturnMessageDto
;
}(
BlankReturnMessageDto
));
exports
.
ReturnMessageDto
=
ReturnMessageDto
;
src/main.js
deleted
100644 → 0
View file @
672cfcfc
"
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
());
});
};
var
__generator
=
(
this
&&
this
.
__generator
)
||
function
(
thisArg
,
body
)
{
var
_
=
{
label
:
0
,
sent
:
function
()
{
if
(
t
[
0
]
&
1
)
throw
t
[
1
];
return
t
[
1
];
},
trys
:
[],
ops
:
[]
},
f
,
y
,
t
,
g
;
return
g
=
{
next
:
verb
(
0
),
"
throw
"
:
verb
(
1
),
"
return
"
:
verb
(
2
)
},
typeof
Symbol
===
"
function
"
&&
(
g
[
Symbol
.
iterator
]
=
function
()
{
return
this
;
}),
g
;
function
verb
(
n
)
{
return
function
(
v
)
{
return
step
([
n
,
v
]);
};
}
function
step
(
op
)
{
if
(
f
)
throw
new
TypeError
(
"
Generator is already executing.
"
);
while
(
_
)
try
{
if
(
f
=
1
,
y
&&
(
t
=
op
[
0
]
&
2
?
y
[
"
return
"
]
:
op
[
0
]
?
y
[
"
throw
"
]
||
((
t
=
y
[
"
return
"
])
&&
t
.
call
(
y
),
0
)
:
y
.
next
)
&&
!
(
t
=
t
.
call
(
y
,
op
[
1
])).
done
)
return
t
;
if
(
y
=
0
,
t
)
op
=
[
op
[
0
]
&
2
,
t
.
value
];
switch
(
op
[
0
])
{
case
0
:
case
1
:
t
=
op
;
break
;
case
4
:
_
.
label
++
;
return
{
value
:
op
[
1
],
done
:
false
};
case
5
:
_
.
label
++
;
y
=
op
[
1
];
op
=
[
0
];
continue
;
case
7
:
op
=
_
.
ops
.
pop
();
_
.
trys
.
pop
();
continue
;
default
:
if
(
!
(
t
=
_
.
trys
,
t
=
t
.
length
>
0
&&
t
[
t
.
length
-
1
])
&&
(
op
[
0
]
===
6
||
op
[
0
]
===
2
))
{
_
=
0
;
continue
;
}
if
(
op
[
0
]
===
3
&&
(
!
t
||
(
op
[
1
]
>
t
[
0
]
&&
op
[
1
]
<
t
[
3
])))
{
_
.
label
=
op
[
1
];
break
;
}
if
(
op
[
0
]
===
6
&&
_
.
label
<
t
[
1
])
{
_
.
label
=
t
[
1
];
t
=
op
;
break
;
}
if
(
t
&&
_
.
label
<
t
[
2
])
{
_
.
label
=
t
[
2
];
_
.
ops
.
push
(
op
);
break
;
}
if
(
t
[
2
])
_
.
ops
.
pop
();
_
.
trys
.
pop
();
continue
;
}
op
=
body
.
call
(
thisArg
,
_
);
}
catch
(
e
)
{
op
=
[
6
,
e
];
y
=
0
;
}
finally
{
f
=
t
=
0
;
}
if
(
op
[
0
]
&
5
)
throw
op
[
1
];
return
{
value
:
op
[
0
]
?
op
[
1
]
:
void
0
,
done
:
true
};
}
};
exports
.
__esModule
=
true
;
var
core_1
=
require
(
"
@nestjs/core
"
);
var
swagger_1
=
require
(
"
@nestjs/swagger
"
);
var
app_module_1
=
require
(
"
./app.module
"
);
var
config_1
=
require
(
"
@nestjs/config
"
);
function
bootstrap
()
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
app
,
documentConfig
,
document
,
config
;
return
__generator
(
this
,
function
(
_a
)
{
switch
(
_a
.
label
)
{
case
0
:
return
[
4
/*yield*/
,
core_1
.
NestFactory
.
create
(
app_module_1
.
AppModule
)];
case
1
:
app
=
_a
.
sent
();
app
.
enableCors
();
app
.
set
(
'
trust proxy
'
,
[
'
172.16.0.0/12
'
,
'
loopback
'
]);
documentConfig
=
new
swagger_1
.
DocumentBuilder
()
.
setTitle
(
'
momento
'
)
.
setDescription
(
'
The app
'
)
.
setVersion
(
'
1.0
'
)
.
build
();
document
=
swagger_1
.
SwaggerModule
.
createDocument
(
app
,
documentConfig
);
swagger_1
.
SwaggerModule
.
setup
(
'
docs
'
,
app
,
document
);
config
=
app
.
get
(
config_1
.
ConfigService
);
return
[
4
/*yield*/
,
app
.
listen
(
config
.
get
(
'
port
'
)
||
3000
,
config
.
get
(
'
host
'
)
||
'
::
'
)];
case
2
:
_a
.
sent
();
return
[
2
/*return*/
];
}
});
});
}
bootstrap
();
src/message/message.service.js
deleted
100644 → 0
View file @
672cfcfc
"
use strict
"
;
var
__extends
=
(
this
&&
this
.
__extends
)
||
(
function
()
{
var
extendStatics
=
function
(
d
,
b
)
{
extendStatics
=
Object
.
setPrototypeOf
||
({
__proto__
:
[]
}
instanceof
Array
&&
function
(
d
,
b
)
{
d
.
__proto__
=
b
;
})
||
function
(
d
,
b
)
{
for
(
var
p
in
b
)
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
b
,
p
))
d
[
p
]
=
b
[
p
];
};
return
extendStatics
(
d
,
b
);
};
return
function
(
d
,
b
)
{
if
(
typeof
b
!==
"
function
"
&&
b
!==
null
)
throw
new
TypeError
(
"
Class extends value
"
+
String
(
b
)
+
"
is not a constructor or null
"
);
extendStatics
(
d
,
b
);
function
__
()
{
this
.
constructor
=
d
;
}
d
.
prototype
=
b
===
null
?
Object
.
create
(
b
)
:
(
__
.
prototype
=
b
.
prototype
,
new
__
());
};
})();
var
__decorate
=
(
this
&&
this
.
__decorate
)
||
function
(
decorators
,
target
,
key
,
desc
)
{
var
c
=
arguments
.
length
,
r
=
c
<
3
?
target
:
desc
===
null
?
desc
=
Object
.
getOwnPropertyDescriptor
(
target
,
key
)
:
desc
,
d
;
if
(
typeof
Reflect
===
"
object
"
&&
typeof
Reflect
.
decorate
===
"
function
"
)
r
=
Reflect
.
decorate
(
decorators
,
target
,
key
,
desc
);
else
for
(
var
i
=
decorators
.
length
-
1
;
i
>=
0
;
i
--
)
if
(
d
=
decorators
[
i
])
r
=
(
c
<
3
?
d
(
r
)
:
c
>
3
?
d
(
target
,
key
,
r
)
:
d
(
target
,
key
))
||
r
;
return
c
>
3
&&
r
&&
Object
.
defineProperty
(
target
,
key
,
r
),
r
;
};
var
__param
=
(
this
&&
this
.
__param
)
||
function
(
paramIndex
,
decorator
)
{
return
function
(
target
,
key
)
{
decorator
(
target
,
key
,
paramIndex
);
}
};
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
());
});
};
var
__generator
=
(
this
&&
this
.
__generator
)
||
function
(
thisArg
,
body
)
{
var
_
=
{
label
:
0
,
sent
:
function
()
{
if
(
t
[
0
]
&
1
)
throw
t
[
1
];
return
t
[
1
];
},
trys
:
[],
ops
:
[]
},
f
,
y
,
t
,
g
;
return
g
=
{
next
:
verb
(
0
),
"
throw
"
:
verb
(
1
),
"
return
"
:
verb
(
2
)
},
typeof
Symbol
===
"
function
"
&&
(
g
[
Symbol
.
iterator
]
=
function
()
{
return
this
;
}),
g
;
function
verb
(
n
)
{
return
function
(
v
)
{
return
step
([
n
,
v
]);
};
}
function
step
(
op
)
{
if
(
f
)
throw
new
TypeError
(
"
Generator is already executing.
"
);
while
(
_
)
try
{
if
(
f
=
1
,
y
&&
(
t
=
op
[
0
]
&
2
?
y
[
"
return
"
]
:
op
[
0
]
?
y
[
"
throw
"
]
||
((
t
=
y
[
"
return
"
])
&&
t
.
call
(
y
),
0
)
:
y
.
next
)
&&
!
(
t
=
t
.
call
(
y
,
op
[
1
])).
done
)
return
t
;
if
(
y
=
0
,
t
)
op
=
[
op
[
0
]
&
2
,
t
.
value
];
switch
(
op
[
0
])
{
case
0
:
case
1
:
t
=
op
;
break
;
case
4
:
_
.
label
++
;
return
{
value
:
op
[
1
],
done
:
false
};
case
5
:
_
.
label
++
;
y
=
op
[
1
];
op
=
[
0
];
continue
;
case
7
:
op
=
_
.
ops
.
pop
();
_
.
trys
.
pop
();
continue
;
default
:
if
(
!
(
t
=
_
.
trys
,
t
=
t
.
length
>
0
&&
t
[
t
.
length
-
1
])
&&
(
op
[
0
]
===
6
||
op
[
0
]
===
2
))
{
_
=
0
;
continue
;
}
if
(
op
[
0
]
===
3
&&
(
!
t
||
(
op
[
1
]
>
t
[
0
]
&&
op
[
1
]
<
t
[
3
])))
{
_
.
label
=
op
[
1
];
break
;
}
if
(
op
[
0
]
===
6
&&
_
.
label
<
t
[
1
])
{
_
.
label
=
t
[
1
];
t
=
op
;
break
;
}
if
(
t
&&
_
.
label
<
t
[
2
])
{
_
.
label
=
t
[
2
];
_
.
ops
.
push
(
op
);
break
;
}
if
(
t
[
2
])
_
.
ops
.
pop
();
_
.
trys
.
pop
();
continue
;
}
op
=
body
.
call
(
thisArg
,
_
);
}
catch
(
e
)
{
op
=
[
6
,
e
];
y
=
0
;
}
finally
{
f
=
t
=
0
;
}
if
(
op
[
0
]
&
5
)
throw
op
[
1
];
return
{
value
:
op
[
0
]
?
op
[
1
]
:
void
0
,
done
:
true
};
}
};
exports
.
__esModule
=
true
;
exports
.
MessageService
=
void
0
;
var
common_1
=
require
(
"
@nestjs/common
"
);
var
koishi_nestjs_1
=
require
(
"
koishi-nestjs
"
);
var
MessageService
=
/** @class */
(
function
(
_super
)
{
__extends
(
MessageService
,
_super
);
function
MessageService
(
ctx
)
{
var
_this
=
_super
.
call
(
this
,
'
message
'
)
||
this
;
_this
.
ctx
=
ctx
;
return
_this
;
}
MessageService
.
prototype
.
onApplicationBootstrap
=
function
()
{
if
(
this
.
assets
)
{
this
.
log
(
"
Assets transformation enabled.
"
);
}
};
MessageService
.
prototype
.
onMessage
=
function
(
session
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
content
,
e_1
;
return
__generator
(
this
,
function
(
_a
)
{
switch
(
_a
.
label
)
{
case
0
:
content
=
session
.
content
;
if
(
!
this
.
assets
)
return
[
3
/*break*/
,
4
];
_a
.
label
=
1
;
case
1
:
_a
.
trys
.
push
([
1
,
3
,
,
4
]);
return
[
4
/*yield*/
,
this
.
assets
.
transform
(
content
)];
case
2
:
content
=
_a
.
sent
();
return
[
3
/*break*/
,
4
];
case
3
:
e_1
=
_a
.
sent
();
content
=
session
.
content
;
this
.
error
(
"
Failed to transform assets in message:
"
.
concat
(
e_1
.
message
));
return
[
3
/*break*/
,
4
];
case
4
:
this
.
log
(
""
.
concat
(
session
.
userId
,
"
received message from
"
).
concat
(
session
.
username
,
"
:
"
).
concat
(
content
));
return
[
2
/*return*/
];
}
});
});
};
__decorate
([
(
0
,
koishi_nestjs_1
.
UseEvent
)(
'
message
'
)
],
MessageService
.
prototype
,
"
onMessage
"
);
__decorate
([
(
0
,
koishi_nestjs_1
.
WireContextService
)()
],
MessageService
.
prototype
,
"
assets
"
);
MessageService
=
__decorate
([
(
0
,
common_1
.
Injectable
)(),
__param
(
0
,
(
0
,
koishi_nestjs_1
.
InjectContext
)())
],
MessageService
);
return
MessageService
;
}(
common_1
.
ConsoleLogger
));
exports
.
MessageService
=
MessageService
;
src/utility/config.js
deleted
100644 → 0
View file @
672cfcfc
"
use strict
"
;
var
__assign
=
(
this
&&
this
.
__assign
)
||
function
()
{
__assign
=
Object
.
assign
||
function
(
t
)
{
for
(
var
s
,
i
=
1
,
n
=
arguments
.
length
;
i
<
n
;
i
++
)
{
s
=
arguments
[
i
];
for
(
var
p
in
s
)
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
s
,
p
))
t
[
p
]
=
s
[
p
];
}
return
t
;
};
return
__assign
.
apply
(
this
,
arguments
);
};
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
());
});
};
var
__generator
=
(
this
&&
this
.
__generator
)
||
function
(
thisArg
,
body
)
{
var
_
=
{
label
:
0
,
sent
:
function
()
{
if
(
t
[
0
]
&
1
)
throw
t
[
1
];
return
t
[
1
];
},
trys
:
[],
ops
:
[]
},
f
,
y
,
t
,
g
;
return
g
=
{
next
:
verb
(
0
),
"
throw
"
:
verb
(
1
),
"
return
"
:
verb
(
2
)
},
typeof
Symbol
===
"
function
"
&&
(
g
[
Symbol
.
iterator
]
=
function
()
{
return
this
;
}),
g
;
function
verb
(
n
)
{
return
function
(
v
)
{
return
step
([
n
,
v
]);
};
}
function
step
(
op
)
{
if
(
f
)
throw
new
TypeError
(
"
Generator is already executing.
"
);
while
(
_
)
try
{
if
(
f
=
1
,
y
&&
(
t
=
op
[
0
]
&
2
?
y
[
"
return
"
]
:
op
[
0
]
?
y
[
"
throw
"
]
||
((
t
=
y
[
"
return
"
])
&&
t
.
call
(
y
),
0
)
:
y
.
next
)
&&
!
(
t
=
t
.
call
(
y
,
op
[
1
])).
done
)
return
t
;
if
(
y
=
0
,
t
)
op
=
[
op
[
0
]
&
2
,
t
.
value
];
switch
(
op
[
0
])
{
case
0
:
case
1
:
t
=
op
;
break
;
case
4
:
_
.
label
++
;
return
{
value
:
op
[
1
],
done
:
false
};
case
5
:
_
.
label
++
;
y
=
op
[
1
];
op
=
[
0
];
continue
;
case
7
:
op
=
_
.
ops
.
pop
();
_
.
trys
.
pop
();
continue
;
default
:
if
(
!
(
t
=
_
.
trys
,
t
=
t
.
length
>
0
&&
t
[
t
.
length
-
1
])
&&
(
op
[
0
]
===
6
||
op
[
0
]
===
2
))
{
_
=
0
;
continue
;
}
if
(
op
[
0
]
===
3
&&
(
!
t
||
(
op
[
1
]
>
t
[
0
]
&&
op
[
1
]
<
t
[
3
])))
{
_
.
label
=
op
[
1
];
break
;
}
if
(
op
[
0
]
===
6
&&
_
.
label
<
t
[
1
])
{
_
.
label
=
t
[
1
];
t
=
op
;
break
;
}
if
(
t
&&
_
.
label
<
t
[
2
])
{
_
.
label
=
t
[
2
];
_
.
ops
.
push
(
op
);
break
;
}
if
(
t
[
2
])
_
.
ops
.
pop
();
_
.
trys
.
pop
();
continue
;
}
op
=
body
.
call
(
thisArg
,
_
);
}
catch
(
e
)
{
op
=
[
6
,
e
];
y
=
0
;
}
finally
{
f
=
t
=
0
;
}
if
(
op
[
0
]
&
5
)
throw
op
[
1
];
return
{
value
:
op
[
0
]
?
op
[
1
]
:
void
0
,
done
:
true
};
}
};
exports
.
__esModule
=
true
;
exports
.
loadConfig
=
void
0
;
var
yaml_1
=
require
(
"
yaml
"
);
var
fs
=
require
(
"
fs
"
);
var
defaultConfig
=
{
host
:
'
::
'
,
port
:
3000
,
onebot
:
{
bots
:
[]
}
};
function
loadConfig
()
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
()
{
var
readConfig
,
configText
,
e_1
;
return
__generator
(
this
,
function
(
_a
)
{
switch
(
_a
.
label
)
{
case
0
:
readConfig
=
{};
_a
.
label
=
1
;
case
1
:
_a
.
trys
.
push
([
1
,
3
,
,
4
]);
return
[
4
/*yield*/
,
fs
.
promises
.
readFile
(
'
./config.yaml
'
,
'
utf-8
'
)];
case
2
:
configText
=
_a
.
sent
();
readConfig
=
yaml_1
[
"
default
"
].
parse
(
configText
);
return
[
3
/*break*/
,
4
];
case
3
:
e_1
=
_a
.
sent
();
console
.
error
(
"
Failed to read config:
"
.
concat
(
e_1
.
toString
()));
return
[
3
/*break*/
,
4
];
case
4
:
return
[
2
/*return*/
,
__assign
(
__assign
({},
defaultConfig
),
readConfig
)];
}
});
});
}
exports
.
loadConfig
=
loadConfig
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment