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:
parent
7f4f4f84ad
commit
5fc2fc6ff7
27 changed files with 40 additions and 64 deletions
|
@ -1,7 +1,5 @@
|
|||
```json
|
||||
{
|
||||
"appId": "<app-id>",
|
||||
"signType": "<signing-algorithm>",
|
||||
"privateKey": "<private-key>"
|
||||
}
|
||||
```
|
|
@ -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',
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
```json
|
||||
{
|
||||
"appId": "<app-id>",
|
||||
"signType": "<signing-algorithm>",
|
||||
"privateKey": "<private-key>"
|
||||
}
|
||||
```
|
|
@ -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',
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
```json
|
||||
{
|
||||
"accessKeyId": "<access-key-id>",
|
||||
"accessKeySecret": "<access-key-secret>",
|
||||
|
@ -22,4 +21,3 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
```
|
|
@ -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',
|
||||
|
|
|
@ -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>"
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
|
@ -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',
|
||||
|
|
3
packages/connector-apple/docs/config-template.json
Normal file
3
packages/connector-apple/docs/config-template.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"clientId": "<client-id>"
|
||||
}
|
|
@ -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',
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
```json
|
||||
{
|
||||
"clientId": "<client-id>",
|
||||
"clientSecret": "<client-secret>"
|
||||
}
|
||||
```
|
|
@ -1,6 +0,0 @@
|
|||
```json
|
||||
{
|
||||
"clientId": "<client-id>",
|
||||
"clientSecret": "<client-secret>"
|
||||
}
|
||||
```
|
|
@ -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',
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
```json
|
||||
{
|
||||
"clientId": "<client-id>",
|
||||
"clientSecret": "<client-secret>"
|
||||
}
|
||||
```
|
|
@ -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',
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
```json
|
||||
{
|
||||
"clientId": "<client-id>",
|
||||
"clientSecret": "<client-secret>"
|
||||
}
|
||||
```
|
|
@ -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',
|
||||
|
|
|
@ -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}}."
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
|
@ -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',
|
||||
|
|
|
@ -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}}."
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
|
@ -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',
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"appId": "<app-id>",
|
||||
"appSecret": "<app-secret>",
|
||||
"universalLinks": "<optional-universal-links>"
|
||||
}
|
|
@ -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',
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
```json
|
||||
{
|
||||
"appId": "<app-id>",
|
||||
"appSecret": "<app-secret>"
|
||||
}
|
||||
```
|
|
@ -1,6 +0,0 @@
|
|||
```json
|
||||
{
|
||||
"appId": "<app-id>",
|
||||
"appSecret": "<app-secret>"
|
||||
}
|
||||
```
|
|
@ -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',
|
||||
|
|
|
@ -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 = {
|
||||
|
|
Loading…
Add table
Reference in a new issue