0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-24 22:41:28 -05:00

chore(connectors): config template md files to json files (#987)

* chore(connectors): config template md files to json files

* chore(connectors): fix path of reading config-template files
This commit is contained in:
Darcy Ye 2022-05-31 12:58:24 +08:00 committed by GitHub
parent 7f4f4f84ad
commit 5fc2fc6ff7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 40 additions and 64 deletions

View file

@ -1,7 +1,5 @@
```json
{
"appId": "<app-id>",
"signType": "<signing-algorithm>",
"privateKey": "<private-key>"
}
```

View file

@ -17,9 +17,9 @@ export const alipaySigningAlgorithms = ['RSA', 'RSA2'] as const;
// eslint-disable-next-line unicorn/prefer-module
const currentPath = __dirname;
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.json');
const readmeContentFallback = 'Please check README.md file directory.';
const configTemplateFallback = 'Please check config-template.md file directory.';
const configTemplateFallback = 'Please check config-template.json file directory.';
export const defaultMetadata: ConnectorMetadata = {
id: 'alipay-native',

View file

@ -1,7 +1,5 @@
```json
{
"appId": "<app-id>",
"signType": "<signing-algorithm>",
"privateKey": "<private-key>"
}
```

View file

@ -18,9 +18,9 @@ export const alipaySigningAlgorithms = ['RSA', 'RSA2'] as const;
// eslint-disable-next-line unicorn/prefer-module
const currentPath = __dirname;
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.json');
const readmeContentFallback = 'Please check README.md file directory.';
const configTemplateFallback = 'Please check config-template.md file directory.';
const configTemplateFallback = 'Please check config-template.json file directory.';
export const defaultMetadata: ConnectorMetadata = {
id: 'alipay-web',

View file

@ -1,4 +1,3 @@
```json
{
"accessKeyId": "<access-key-id>",
"accessKeySecret": "<access-key-secret>",
@ -22,4 +21,3 @@
}
]
}
```

View file

@ -15,9 +15,9 @@ export const staticConfigs = {
// eslint-disable-next-line unicorn/prefer-module
const currentPath = __dirname;
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.json');
const readmeContentFallback = 'Please check README.md file directory.';
const configTemplateFallback = 'Please check config-template.md file directory.';
const configTemplateFallback = 'Please check config-template.json file directory.';
export const defaultMetadata: ConnectorMetadata = {
id: 'aliyun-direct-mail',

View file

@ -1,4 +1,3 @@
```json
{
"accessKeyId": "<access-key-id>",
"accessKeySecret": "<access-key-secret>",
@ -27,7 +26,6 @@
"name": "<test-template-name>",
"content": "<test-template-content>",
"remark": "<test-template-remark>"
},
}
]
}
```

View file

@ -31,9 +31,9 @@ export enum SmsTemplateType {
// eslint-disable-next-line unicorn/prefer-module
const currentPath = __dirname;
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.json');
const readmeContentFallback = 'Please check README.md file directory.';
const configTemplateFallback = 'Please check config-template.md file directory.';
const configTemplateFallback = 'Please check config-template.json file directory.';
export const defaultMetadata: ConnectorMetadata = {
id: 'aliyun-short-message-service',

View file

@ -0,0 +1,3 @@
{
"clientId": "<client-id>"
}

View file

@ -15,9 +15,9 @@ export const scope = ''; // Note: `openid` is required when adding more scope(s)
// eslint-disable-next-line unicorn/prefer-module
const currentPath = __dirname;
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.json');
const readmeContentFallback = 'Please check README.md file directory.';
const configTemplateFallback = 'Please check config-template.md file directory.';
const configTemplateFallback = 'Please check config-template.json file directory.';
export const defaultMetadata: ConnectorMetadata = {
id: 'apple-universal',

View file

@ -1,6 +1,4 @@
```json
{
"clientId": "<client-id>",
"clientSecret": "<client-secret>"
}
```

View file

@ -1,6 +0,0 @@
```json
{
"clientId": "<client-id>",
"clientSecret": "<client-secret>"
}
```

View file

@ -20,9 +20,9 @@ export const scope = 'email,public_profile';
// eslint-disable-next-line unicorn/prefer-module
const currentPath = __dirname;
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.json');
const readmeContentFallback = 'Please check README.md file directory.';
const configTemplateFallback = 'Please check config-template.md file directory.';
const configTemplateFallback = 'Please check config-template.json file directory.';
export const defaultMetadata: ConnectorMetadata = {
id: 'facebook-universal',

View file

@ -1,6 +1,4 @@
```json
{
"clientId": "<client-id>",
"clientSecret": "<client-secret>"
}
```

View file

@ -11,9 +11,9 @@ export const userInfoEndpoint = 'https://api.github.com/user';
// eslint-disable-next-line unicorn/prefer-module
const currentPath = __dirname;
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.json');
const readmeContentFallback = 'Please check README.md file directory.';
const configTemplateFallback = 'Please check config-template.md file directory.';
const configTemplateFallback = 'Please check config-template.json file directory.';
export const defaultMetadata: ConnectorMetadata = {
id: 'github-universal',

View file

@ -1,6 +1,4 @@
```json
{
"clientId": "<client-id>",
"clientSecret": "<client-secret>"
}
```

View file

@ -11,9 +11,9 @@ export const scope = 'openid profile email';
// eslint-disable-next-line unicorn/prefer-module
const currentPath = __dirname;
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.json');
const readmeContentFallback = 'Please check README.md file directory.';
const configTemplateFallback = 'Please check config-template.md file directory.';
const configTemplateFallback = 'Please check config-template.json file directory.';
export const defaultMetadata: ConnectorMetadata = {
id: 'google-universal',

View file

@ -1,4 +1,3 @@
```json
{
"apiKey": "<api-key>",
"fromEmail": "noreply@logto.test.io",
@ -7,20 +6,19 @@
"usageType": "SignIn",
"type": "text/plain",
"subject": "Logto SignIn Template",
"content": "This is for sign-in purposes only. Your passcode is {{code}}.",
"content": "This is for sign-in purposes only. Your passcode is {{code}}."
},
{
"usageType": "Register",
"type": "text/plain",
"subject": "Logto Register Template",
"content": "This is for registering purposes only. Your passcode is {{code}}.",
"content": "This is for registering purposes only. Your passcode is {{code}}."
},
{
"usageType": "Test",
"type": "text/plain",
"subject": "Logto Test Template",
"content": "This is for testing purposes only. Your passcode is {{code}}.",
"content": "This is for testing purposes only. Your passcode is {{code}}."
}
]
}
```

View file

@ -8,9 +8,9 @@ export const endpoint = 'https://api.sendgrid.com/v3/mail/send';
// eslint-disable-next-line unicorn/prefer-module
const currentPath = __dirname;
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.json');
const readmeContentFallback = 'Please check README.md file directory.';
const configTemplateFallback = 'Please check config-template.md file directory.';
const configTemplateFallback = 'Please check config-template.json file directory.';
export const defaultMetadata: ConnectorMetadata = {
id: 'sendgrid-email-service',

View file

@ -1,4 +1,3 @@
```json
{
"accountSID": "<account-sid>",
"authToken": "<auth-token>",
@ -6,16 +5,15 @@
"templates": [
{
"usageType": "SignIn",
"content": "This is for sign-in purposes only. Your passcode is {{code}}.",
"content": "This is for sign-in purposes only. Your passcode is {{code}}."
},
{
"usageType": "Register",
"content": "This is for registering purposes only. Your passcode is {{code}}.",
"content": "This is for registering purposes only. Your passcode is {{code}}."
},
{
"usageType": "Test",
"content": "This is for testing purposes only. Your passcode is {{code}}.",
"content": "This is for testing purposes only. Your passcode is {{code}}."
}
]
}
```

View file

@ -8,9 +8,9 @@ export const endpoint = 'https://api.twilio.com/2010-04-01/Accounts/{{accountSID
// eslint-disable-next-line unicorn/prefer-module
const currentPath = __dirname;
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.json');
const readmeContentFallback = 'Please check README.md file directory.';
const configTemplateFallback = 'Please check config-template.md file directory.';
const configTemplateFallback = 'Please check config-template.json file directory.';
export const defaultMetadata: ConnectorMetadata = {
id: 'twilio-short-message-service',

View file

@ -0,0 +1,5 @@
{
"appId": "<app-id>",
"appSecret": "<app-secret>",
"universalLinks": "<optional-universal-links>"
}

View file

@ -11,9 +11,9 @@ export const scope = 'snsapi_userinfo';
// eslint-disable-next-line unicorn/prefer-module
const currentPath = __dirname;
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.json');
const readmeContentFallback = 'Please check README.md file directory.';
const configTemplateFallback = 'Please check config-template.md file directory.';
const configTemplateFallback = 'Please check config-template.json file directory.';
export const defaultMetadata: ConnectorMetadata = {
id: 'wechat-native',

View file

@ -1,6 +1,4 @@
```json
{
"appId": "<app-id>",
"appSecret": "<app-secret>"
}
```

View file

@ -1,6 +0,0 @@
```json
{
"appId": "<app-id>",
"appSecret": "<app-secret>"
}
```

View file

@ -11,9 +11,9 @@ export const scope = 'snsapi_login';
// eslint-disable-next-line unicorn/prefer-module
const currentPath = __dirname;
const pathToReadmeFile = path.join(currentPath, '..', 'README.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.md');
const pathToConfigTemplate = path.join(currentPath, '..', 'docs', 'config-template.json');
const readmeContentFallback = 'Please check README.md file directory.';
const configTemplateFallback = 'Please check config-template.md file directory.';
const configTemplateFallback = 'Please check config-template.json file directory.';
export const defaultMetadata: ConnectorMetadata = {
id: 'wechat-web',

View file

@ -16,7 +16,7 @@ export const mockMetadata: ConnectorMetadata = {
'zh-CN': '连接器',
},
readme: 'README.md',
configTemplate: 'config-template.md',
configTemplate: 'config-template.json',
};
export const mockConnector: Connector = {