init
This commit is contained in:
1
conf/funcs/getCurrentTimestamp.js
Normal file
1
conf/funcs/getCurrentTimestamp.js
Normal file
@ -0,0 +1 @@
|
||||
module.exports = () => new Date().toISOString();
|
3
conf/funcs/getFallbackTimestamp.js
Normal file
3
conf/funcs/getFallbackTimestamp.js
Normal file
@ -0,0 +1,3 @@
|
||||
module.exports = (params) => {
|
||||
return params.defaultValue ? new Date(params.defaultValue).toISOString() : new Date().toISOString();
|
||||
};
|
4
conf/functionsConfig.json
Normal file
4
conf/functionsConfig.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"getCurrentTimestamp": "./funcs/getCurrentTimestamp.js",
|
||||
"getFallbackTimestamp": "./funcs/getFallbackTimestamp.js"
|
||||
}
|
28
conf/transformConfig.json
Normal file
28
conf/transformConfig.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"fields": {
|
||||
"id": {"from": "id"},
|
||||
"login": {"from": "username"},
|
||||
"full_name": {
|
||||
"from": "name",
|
||||
"fallback": "username"
|
||||
},
|
||||
"email": {
|
||||
"template": "${username}@example.com"
|
||||
},
|
||||
"language": "zh-CN",
|
||||
"is_admin": false,
|
||||
"last_login": {
|
||||
"func": "getCurrentTimestamp"
|
||||
},
|
||||
"created": {
|
||||
"from": "create_date",
|
||||
"func": "getFallbackTimestamp",
|
||||
"params": {"defaultValue": "2023-01-01T00:00:00.000Z"}
|
||||
},
|
||||
"visibility": "public",
|
||||
"followers_count": 0,
|
||||
"following_count": 0,
|
||||
"starred_repos_count": 0,
|
||||
"username": {"from": "username"}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user