0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

chore: fix test and lint issues

This commit is contained in:
Gao Sun 2023-04-01 22:16:56 +08:00
parent 3ad272f345
commit 5087846e8b
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
88 changed files with 452 additions and 114 deletions

View file

@ -19,9 +19,9 @@
"//": "# `changeset version` won't run version lifecycle scripts, see https://github.com/changesets/changesets/issues/860",
"ci:version": "changeset version && pnpm -r version",
"ci:build": "pnpm -r build",
"ci:lint": "pnpm -r --parallel lint",
"ci:stylelint": "pnpm -r --parallel stylelint",
"ci:test": "pnpm -r --parallel test:ci"
"ci:lint": "pnpm -r --parallel --workspace-concurrency=0 lint",
"ci:stylelint": "pnpm -r --parallel --workspace-concurrency=0 stylelint",
"ci:test": "pnpm -r --parallel --workspace-concurrency=0 test:ci"
},
"devDependencies": {
"@changesets/cli": "^2.25.0",

View file

@ -38,7 +38,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,6 +1,7 @@
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import nock from 'nock';
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { alipayEndpoint } from './constant.js';
import createConnector, { getAccessToken } from './index.js';
import { mockedAlipayNativeConfigWithValidPrivateKey } from './mock.js';

View file

@ -7,6 +7,10 @@
* https://opendocs.alipay.com/open/204/105296/
*/
import { assert } from '@silverhand/essentials';
import { got } from 'got';
import { z } from 'zod';
import type {
GetAuthorizationUri,
GetUserInfo,
@ -21,10 +25,7 @@ import {
ConnectorType,
parseJson,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import dayjs from 'dayjs';
import { got } from 'got';
import { z } from 'zod';
import {
alipayEndpoint,

View file

@ -1,8 +1,8 @@
import crypto from 'node:crypto';
import snakeCaseKeys from 'snakecase-keys';
import { parseJsonObject } from '@logto/connector-kit';
import iconv from 'iconv-lite';
import snakeCaseKeys from 'snakecase-keys';
import { alipaySigningAlgorithmMapping } from './constant.js';
import type { AlipayNativeConfig } from './types.js';

View file

@ -38,7 +38,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,6 +1,7 @@
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import nock from 'nock';
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { alipayEndpoint, authorizationEndpoint } from './constant.js';
import createConnector, { getAccessToken } from './index.js';
import { mockedAlipayConfigWithValidPrivateKey } from './mock.js';

View file

@ -5,6 +5,10 @@
* https://opendocs.alipay.com/open/01emu5
*/
import { assert } from '@silverhand/essentials';
import { got } from 'got';
import { z } from 'zod';
import type {
GetConnectorConfig,
GetAuthorizationUri,
@ -19,10 +23,7 @@ import {
ConnectorType,
parseJson,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import dayjs from 'dayjs';
import { got } from 'got';
import { z } from 'zod';
import {
alipayEndpoint,

View file

@ -1,8 +1,8 @@
import crypto from 'node:crypto';
import snakeCaseKeys from 'snakecase-keys';
import { parseJsonObject } from '@logto/connector-kit';
import iconv from 'iconv-lite';
import snakeCaseKeys from 'snakecase-keys';
import { alipaySigningAlgorithmMapping } from './constant.js';
import type { AlipayConfig } from './types.js';

View file

@ -32,7 +32,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,3 +1,6 @@
import { assert } from '@silverhand/essentials';
import { HTTPError } from 'got';
import type {
CreateConnector,
EmailConnector,
@ -11,8 +14,6 @@ import {
validateConfig,
parseJson,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import { HTTPError } from 'got';
import { defaultMetadata } from './constant.js';
import { singleSendMail } from './single-send-mail.js';

View file

@ -1,6 +1,5 @@
import { createHmac } from 'node:crypto';
import { got } from 'got';
import { createHmac } from 'node:crypto';
import type { PublicParameters } from './types.js';

View file

@ -32,7 +32,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,3 +1,6 @@
import { assert } from '@silverhand/essentials';
import { HTTPError } from 'got';
import type {
GetConnectorConfig,
SendMessageFunction,
@ -11,8 +14,6 @@ import {
ConnectorType,
parseJson,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import { HTTPError } from 'got';
import { defaultMetadata } from './constant.js';
import { sendSms } from './single-send-text.js';

View file

@ -1,6 +1,5 @@
import { createHmac } from 'node:crypto';
import { got } from 'got';
import { createHmac } from 'node:crypto';
import type { PublicParameters } from './types.js';

View file

@ -34,7 +34,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,3 +1,5 @@
import { assert } from '@silverhand/essentials';
import type {
GetAuthorizationUri,
GetUserInfo,
@ -12,7 +14,6 @@ import {
ConnectorType,
} from '@logto/connector-kit';
import { generateStandardId } from '@logto/core-kit';
import { assert } from '@silverhand/essentials';
import { createRemoteJWKSet, jwtVerify } from 'jose';
import { scope, defaultMetadata, jwksUri, issuer, authorizationEndpoint } from './constant.js';

View file

@ -35,7 +35,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,3 +1,5 @@
import { assert } from '@silverhand/essentials';
import type { SESv2Client, SendEmailCommand } from '@aws-sdk/client-sesv2';
import { SESv2ServiceException } from '@aws-sdk/client-sesv2';
import type {
@ -12,7 +14,6 @@ import {
ConnectorType,
validateConfig,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import { defaultMetadata } from './constant.js';
import type { AwsSesConfig } from './types.js';

View file

@ -34,7 +34,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,3 +1,5 @@
import { assert, conditional } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import path from 'node:path';
import type { AuthorizationCodeRequest, AuthorizationUrlRequest } from '@azure/msal-node';
@ -16,8 +18,6 @@ import {
ConnectorType,
parseJson,
} from '@logto/connector-kit';
import { assert, conditional } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import { scopes, defaultMetadata, defaultTimeout, graphAPIEndpoint } from './constant.js';
import type { AzureADConfig } from './types.js';

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,6 +1,7 @@
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import nock from 'nock';
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { accessTokenEndpoint, authorizationEndpoint, userInfoEndpoint } from './constant.js';
import createConnector, { getAccessToken } from './index.js';
import { mockedConfig } from './mock.js';

View file

@ -3,6 +3,9 @@
* https://discord.com/developers/docs/topics/oauth2
*/
import { assert, conditional } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import type {
GetConnectorConfig,
GetAuthorizationUri,
@ -18,8 +21,6 @@ import {
ConnectorType,
parseJson,
} from '@logto/connector-kit';
import { assert, conditional } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import {
defaultMetadata,

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,6 +1,7 @@
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import nock from 'nock';
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { accessTokenEndpoint, authorizationEndpoint, userInfoEndpoint } from './constant.js';
import createConnector, { getAccessToken } from './index.js';
import { clientId, clientSecret, code, dummyRedirectUri, fields, mockedConfig } from './mock.js';

View file

@ -3,6 +3,9 @@
* https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow
*/
import { assert } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import type {
CreateConnector,
SocialConnector,
@ -17,8 +20,6 @@ import {
ConnectorType,
parseJson,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import {
accessTokenEndpoint,

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,6 +1,7 @@
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import nock from 'nock';
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { accessTokenEndpoint, codeEndpoint, userInfoEndpoint } from './constant.js';
import createConnector, { buildAuthorizationUri, getAccessToken } from './index.js';
import { mockedFeishuConfig } from './mock.js';

View file

@ -1,3 +1,6 @@
import { assert, conditional } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import type {
CreateConnector,
GetAuthorizationUri,
@ -12,8 +15,6 @@ import {
ConnectorType,
validateConfig,
} from '@logto/connector-kit';
import { assert, conditional } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import {
accessTokenEndpoint,

View file

@ -34,7 +34,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,5 +1,6 @@
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import nock from 'nock';
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import qs from 'query-string';
import { accessTokenEndpoint, authorizationEndpoint, userInfoEndpoint } from './constant.js';

View file

@ -1,3 +1,6 @@
import { assert, conditional } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import type {
GetAuthorizationUri,
GetUserInfo,
@ -12,8 +15,6 @@ import {
ConnectorType,
parseJson,
} from '@logto/connector-kit';
import { assert, conditional } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import qs from 'query-string';
import {

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,6 +1,7 @@
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import nock from 'nock';
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { accessTokenEndpoint, authorizationEndpoint, userInfoEndpoint } from './constant.js';
import createConnector, { getAccessToken } from './index.js';
import { mockedConfig } from './mock.js';

View file

@ -2,6 +2,9 @@
* The Implementation of OpenID Connect of Google Identity Platform.
* https://developers.google.com/identity/protocols/oauth2/openid-connect
*/
import { conditional, assert } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import type {
GetAuthorizationUri,
GetUserInfo,
@ -16,8 +19,6 @@ import {
ConnectorType,
parseJson,
} from '@logto/connector-kit';
import { conditional, assert } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import {
accessTokenEndpoint,

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,6 +1,7 @@
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import nock from 'nock';
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { accessTokenEndpoint, authorizationEndpoint, userInfoEndpoint } from './constant.js';
import createConnector, { getAccessToken } from './index.js';
import { mockedConfig } from './mock.js';

View file

@ -2,6 +2,9 @@
* The Implementation of OpenID Connect of Kakao.
* https://developers.kakao.com/docs/latest/en/kakaologin/rest-api
*/
import { assert, conditional } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import type {
CreateConnector,
GetAuthorizationUri,
@ -16,8 +19,6 @@ import {
validateConfig,
parseJson,
} from '@logto/connector-kit';
import { assert, conditional } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import {
accessTokenEndpoint,

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,6 +1,7 @@
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { got } from 'got';
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { defaultTimeout, scope } from './constant.js';
import { accessTokenResponseGuard } from './types.js';

View file

@ -1,6 +1,7 @@
import { VerificationCodeType } from '@logto/connector-kit';
import nock from 'nock';
import { VerificationCodeType } from '@logto/connector-kit';
import { emailEndpoint } from './constant.js';
import { mockedAccessTokenResponse, mockedConfig } from './mock.js';

View file

@ -1,3 +1,5 @@
import { HTTPError, got } from 'got';
import type {
CreateConnector,
EmailConnector,
@ -5,7 +7,6 @@ import type {
SendMessageFunction,
} from '@logto/connector-kit';
import { ConnectorType, validateConfig } from '@logto/connector-kit';
import { HTTPError, got } from 'got';
import { defaultMetadata, defaultTimeout, emailEndpoint } from './constant.js';
import { grantAccessToken } from './grant-access-token.js';

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,6 +1,7 @@
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { got } from 'got';
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { defaultTimeout, scope } from './constant.js';
import { accessTokenResponseGuard } from './types.js';

View file

@ -1,6 +1,7 @@
import { VerificationCodeType } from '@logto/connector-kit';
import nock from 'nock';
import { VerificationCodeType } from '@logto/connector-kit';
import { smsEndpoint } from './constant.js';
import { mockedAccessTokenResponse, mockedConfig } from './mock.js';

View file

@ -1,3 +1,5 @@
import { HTTPError, got } from 'got';
import type {
CreateConnector,
GetConnectorConfig,
@ -5,7 +7,6 @@ import type {
SmsConnector,
} from '@logto/connector-kit';
import { ConnectorType, validateConfig } from '@logto/connector-kit';
import { HTTPError, got } from 'got';
import { defaultMetadata, defaultTimeout, smsEndpoint } from './constant.js';
import { grantAccessToken } from './grant-access-token.js';

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -0,0 +1,5 @@
describe('test', () => {
it('makes ci happy', () => {
expect(true);
});
});

View file

@ -1,3 +1,4 @@
import { assert } from '@silverhand/essentials';
import fs from 'node:fs/promises';
import path from 'node:path';
@ -13,7 +14,6 @@ import {
validateConfig,
ConnectorType,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import { defaultMetadata } from './constant.js';
import type { MockMailConfig } from './types.js';

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -0,0 +1,5 @@
describe('test', () => {
it('makes ci happy', () => {
expect(true);
});
});

View file

@ -1,3 +1,4 @@
import { assert } from '@silverhand/essentials';
import fs from 'node:fs/promises';
import path from 'node:path';
@ -13,7 +14,6 @@ import {
validateConfig,
ConnectorType,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import { defaultMetadata } from './constant.js';
import type { MockMailConfig } from './types.js';

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -0,0 +1,5 @@
describe('test', () => {
it('makes ci happy', () => {
expect(true);
});
});

View file

@ -1,3 +1,4 @@
import { assert } from '@silverhand/essentials';
import fs from 'node:fs/promises';
import path from 'node:path';
@ -13,7 +14,6 @@ import {
validateConfig,
ConnectorType,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import { defaultMetadata } from './constant.js';
import type { MockSmsConfig } from './types.js';

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -0,0 +1,5 @@
describe('test', () => {
it('makes ci happy', () => {
expect(true);
});
});

View file

@ -1,4 +1,5 @@
import { randomUUID } from 'node:crypto';
import { z } from 'zod';
import type {
GetAuthorizationUri,
@ -7,7 +8,6 @@ import type {
SocialConnector,
} from '@logto/connector-kit';
import { ConnectorError, ConnectorErrorCodes, ConnectorType } from '@logto/connector-kit';
import { z } from 'zod';
import { defaultMetadata } from './constant.js';
import { mockSocialConfigGuard } from './types.js';

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,6 +1,7 @@
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import nock from 'nock';
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { accessTokenEndpoint, authorizationEndpoint, userInfoEndpoint } from './constant.js';
import createConnector, { getAccessToken } from './index.js';
import { mockedConfig } from './mock.js';

View file

@ -2,6 +2,9 @@
* The Implementation of OAuth2 of Naver.
* https://developers.naver.com/docs/login/api/api.md
*/
import { assert, conditional } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import type {
CreateConnector,
GetAuthorizationUri,
@ -16,8 +19,6 @@ import {
validateConfig,
parseJson,
} from '@logto/connector-kit';
import { assert, conditional } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import {
accessTokenEndpoint,

View file

@ -34,7 +34,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,3 +1,7 @@
import { assert, pick } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import snakecaseKeys from 'snakecase-keys';
import {
type GetAuthorizationUri,
type GetUserInfo,
@ -10,9 +14,6 @@ import {
validateConfig,
ConnectorType,
} from '@logto/connector-kit';
import { assert, pick } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import snakecaseKeys from 'snakecase-keys';
import { defaultMetadata, defaultTimeout } from './constant.js';
import type { OauthConfig } from './types.js';

View file

@ -1,10 +1,11 @@
import { ConnectorError, ConnectorErrorCodes, parseJson } from '@logto/connector-kit';
import { assert, pick } from '@silverhand/essentials';
import type { Response } from 'got';
import { got, HTTPError } from 'got';
import * as qs from 'query-string';
import snakecaseKeys from 'snakecase-keys';
import { ConnectorError, ConnectorErrorCodes, parseJson } from '@logto/connector-kit';
import * as qs from 'query-string';
import { defaultTimeout } from './constant.js';
import type {
OauthConfig,

View file

@ -35,7 +35,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,3 +1,7 @@
import { assert, conditional, pick } from '@silverhand/essentials';
import { HTTPError } from 'got';
import snakecaseKeys from 'snakecase-keys';
import type {
GetAuthorizationUri,
GetUserInfo,
@ -12,10 +16,7 @@ import {
ConnectorType,
} from '@logto/connector-kit';
import { generateStandardId } from '@logto/core-kit';
import { assert, conditional, pick } from '@silverhand/essentials';
import { HTTPError } from 'got';
import { createRemoteJWKSet, jwtVerify } from 'jose';
import snakecaseKeys from 'snakecase-keys';
import { defaultMetadata } from './constant.js';
import type { OidcConfig } from './types.js';

View file

@ -1,9 +1,10 @@
import { ConnectorError, ConnectorErrorCodes, parseJson } from '@logto/connector-kit';
import { assert, pick } from '@silverhand/essentials';
import type { Response } from 'got';
import { got, HTTPError } from 'got';
import snakecaseKeys from 'snakecase-keys';
import { ConnectorError, ConnectorErrorCodes, parseJson } from '@logto/connector-kit';
import { defaultTimeout } from './constant.js';
import type { AccessTokenResponse, OidcConfig } from './types.js';
import { accessTokenResponseGuard, delimiter, authResponseGuard } from './types.js';

View file

@ -35,7 +35,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,3 +1,6 @@
import { assert } from '@silverhand/essentials';
import { z } from 'zod';
import type {
GetAuthorizationUri,
GetUserInfo,
@ -12,9 +15,7 @@ import {
validateConfig,
ConnectorType,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import * as saml from 'samlify';
import { z } from 'zod';
import { defaultMetadata } from './constant.js';
import { samlConfigGuard } from './types.js';

View file

@ -1,6 +1,7 @@
import type * as saml from 'samlify';
import { z } from 'zod';
import type * as saml from 'samlify';
import {
assertionBinding,
authnRequestBinding,

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,3 +1,6 @@
import { assert } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import type {
GetConnectorConfig,
SendMessageFunction,
@ -10,8 +13,6 @@ import {
validateConfig,
ConnectorType,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import { defaultMetadata, endpoint } from './constant.js';
import type {

View file

@ -37,7 +37,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,3 +1,5 @@
import { assert } from '@silverhand/essentials';
import type {
GetConnectorConfig,
CreateConnector,
@ -10,7 +12,6 @@ import {
validateConfig,
ConnectorType,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import nodemailer from 'nodemailer';
import type SMTPTransport from 'nodemailer/lib/smtp-transport';

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,8 +1,7 @@
import { got } from 'got';
import type { BinaryToTextEncoding } from 'node:crypto';
import crypto from 'node:crypto';
import { got } from 'got';
import { tencentErrorResponse } from './schema.js';
import type { TencentErrorResponse, TencentSuccessResponse } from './schema.js';

View file

@ -1,3 +1,6 @@
import { assert } from '@silverhand/essentials';
import { HTTPError } from 'got';
import type {
CreateConnector,
GetConnectorConfig,
@ -10,8 +13,6 @@ import {
ConnectorType,
validateConfig,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import { HTTPError } from 'got';
import { defaultMetadata } from './constant.js';
import { isSmsErrorResponse, sendSmsRequest } from './http.js';

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,3 +1,6 @@
import { assert } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import type {
GetConnectorConfig,
SendMessageFunction,
@ -10,8 +13,6 @@ import {
validateConfig,
ConnectorType,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import { defaultMetadata, endpoint } from './constant.js';
import type { TwilioSmsConfig, PublicParameters } from './types.js';

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,6 +1,7 @@
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import nock from 'nock';
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { accessTokenEndpoint, authorizationEndpoint, userInfoEndpoint } from './constant.js';
import createConnector, { getAccessToken } from './index.js';
import { mockedConfig } from './mock.js';

View file

@ -3,6 +3,9 @@
* https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html
*/
import { assert } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import type {
GetAuthorizationUri,
GetUserInfo,
@ -17,8 +20,6 @@ import {
ConnectorType,
parseJson,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import {
authorizationEndpoint,

View file

@ -33,7 +33,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {

View file

@ -1,6 +1,7 @@
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import nock from 'nock';
import { ConnectorError, ConnectorErrorCodes } from '@logto/connector-kit';
import { accessTokenEndpoint, authorizationEndpoint, userInfoEndpoint } from './constant.js';
import createConnector, { getAccessToken } from './index.js';
import { mockedConfig } from './mock.js';

View file

@ -3,6 +3,9 @@
* https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html
*/
import { assert } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import type {
GetAuthorizationUri,
GetUserInfo,
@ -17,8 +20,6 @@ import {
ConnectorType,
parseJson,
} from '@logto/connector-kit';
import { assert } from '@silverhand/essentials';
import { got, HTTPError } from 'got';
import {
authorizationEndpoint,

View file

@ -54,7 +54,16 @@
"node": "^18.12.0"
},
"eslintConfig": {
"extends": "@silverhand"
"extends": "@silverhand",
"settings": {
"import/core-modules": [
"@silverhand/essentials",
"got",
"nock",
"snakecase-keys",
"zod"
]
}
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"publishConfig": {