0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-27 21:39:16 -05:00
logto/packages/connectors/connector-wechat-native/src/constant.ts
Gao Sun 6b322a537c
refactor: add connector packages
the initial commit to move all connector packages to the main
repo.
2023-04-01 15:53:14 +08:00

58 lines
1.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { ConnectorMetadata } from '@logto/connector-kit';
import { ConnectorPlatform, ConnectorConfigFormItemType } from '@logto/connector-kit';
export const authorizationEndpoint = 'wechat://'; // This is used to arouse the native WeChat App
export const accessTokenEndpoint = 'https://api.weixin.qq.com/sns/oauth2/access_token';
export const userInfoEndpoint = 'https://api.weixin.qq.com/sns/userinfo';
export const scope = 'snsapi_userinfo';
// See https://developers.weixin.qq.com/doc/oplatform/Return_codes/Return_code_descriptions_new.html to know more about WeChat response error code
export const invalidAuthCodeErrcode = [40_029, 40_163, 42_003];
export const invalidAccessTokenErrcode = [40_001, 40_014];
export const defaultMetadata: ConnectorMetadata = {
id: 'wechat-native',
target: 'wechat',
platform: ConnectorPlatform.Native,
name: {
en: 'WeChat',
'zh-CN': '微信',
'tr-TR': 'WeChat',
ko: 'WeChat',
},
logo: './logo.svg',
logoDark: null,
description: {
en: 'WeChat is a cross-platform instant messaging app.',
'zh-CN': '微信是一款跨平台的即时通讯软件。',
'tr-TR': 'WeChat, çoklu platformda kullanılabilen bir anlık mesajlaşma uygulamasıdır.',
ko: 'WeChat은 크로스 플랫폼 메시징 앱입니다.',
},
readme: './README.md',
formItems: [
{
key: 'appId',
label: 'App ID',
required: true,
type: ConnectorConfigFormItemType.Text,
placeholder: '<app-id>',
},
{
key: 'appSecret',
label: 'App Secret',
required: true,
type: ConnectorConfigFormItemType.Text,
placeholder: '<app-secret>',
},
{
key: 'universalLinks',
label: 'Universal Links',
required: false,
type: ConnectorConfigFormItemType.Text,
placeholder: '<universal-links>',
},
],
};
export const defaultTimeout = 5000;