Skip to content

Commit 3257e91

Browse files
author
sunlei
committed
twilio datasource
1 parent 5482579 commit 3257e91

64 files changed

Lines changed: 122853 additions & 25 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

server/node-service/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"openapi-types": "^12.1.0",
5555
"openblocks-core": "^0.0.7",
5656
"openblocks-sdk": "^0.0.35",
57+
"pino": "^8.11.0",
5758
"stylis": "^4.1.3",
5859
"swagger-client": "^3.18.5",
5960
"typescript": "^4.9.3",

server/node-service/scripts/openApiDataSourceGen.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ async function gen(options: Options) {
2929
if (postMan) {
3030
console.info("is PostMan Collection start transforming...");
3131
const collection = postManCollectionFile ?? pluginDefaultCollectionFile;
32-
if (collection) {
33-
console.error("postman collection file path not got.");
34-
return;
35-
}
3632
await postManToOpenApi(collection, pluginSpecYamlFile, { defaultTag: "General" });
3733
}
3834

server/node-service/scripts/openApiDataSourceTemplate.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const <%=id %>Plugin: DataSourcePlugin<any, DataSourceConfigType> = {
3333
category: "api",
3434
dataSourceConfig,
3535
queryConfig: async () => {
36-
const { actions, categories } = await parseOpenApi(spec, parseOptions);
36+
const { actions, categories } = await parseOpenApi(spec<% if (isJsonSpec) { %> as unknown<% } %> as OpenAPI.Document, parseOptions);
3737
return {
3838
type: "query",
3939
label: "Action",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import pino from "pino";
2+
3+
global.logger = pino();
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { Logger } from "pino";
2+
3+
declare global {
4+
var logger: Logger;
5+
}
6+
7+
export {};

server/node-service/src/plugins/circleCi/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ const circleCiPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
5858
category: "api",
5959
dataSourceConfig,
6060
queryConfig: async () => {
61-
const { actions, categories } = await parseOpenApi(spec, parseOptions);
61+
const { actions, categories } = await parseOpenApi(
62+
spec as unknown as OpenAPI.Document,
63+
parseOptions
64+
);
6265
return {
6366
type: "query",
6467
label: "Action",

server/node-service/src/plugins/couchdb/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const couchdbPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
6060
category: "database",
6161
dataSourceConfig,
6262
queryConfig: async () => {
63-
const { actions, categories } = await parseOpenApi(spec, parseOptions);
63+
const { actions, categories } = await parseOpenApi(spec as OpenAPI.Document, parseOptions);
6464
return {
6565
type: "query",
6666
label: "Operation",

server/node-service/src/plugins/front/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const frontPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
3737
category: "api",
3838
dataSourceConfig,
3939
queryConfig: async () => {
40-
const { actions, categories } = await parseOpenApi(spec, parseOptions);
40+
const { actions, categories } = await parseOpenApi(spec as OpenAPI.Document, parseOptions);
4141
return {
4242
type: "query",
4343
label: "Action",

server/node-service/src/plugins/huggingFace/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ const huggingFacePlugin: DataSourcePlugin<any, DataSourceConfigType> = {
3939
category: "api",
4040
dataSourceConfig,
4141
queryConfig: async () => {
42-
const { actions, categories } = await parseOpenApi(spec, parseOptions);
42+
const { actions, categories } = await parseOpenApi(
43+
spec as unknown as OpenAPI.Document,
44+
parseOptions
45+
);
4346
return {
4447
type: "query",
4548
label: "Action",

server/node-service/src/plugins/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import supabaseStoragePlugin from "./supabaseStorage";
2626
import cloudinaryPlugin from "./cloudinary";
2727
import notionPlugin from "./notion";
2828
import datadogPlugin from "./datadog";
29+
import twilioPlugin from "./twilio";
2930

3031
let plugins: (DataSourcePlugin | DataSourcePluginFactory)[] = [
3132
s3Plugin,
@@ -56,6 +57,7 @@ let plugins: (DataSourcePlugin | DataSourcePluginFactory)[] = [
5657
cloudinaryPlugin,
5758
notionPlugin,
5859
datadogPlugin,
60+
twilioPlugin,
5961
];
6062

6163
try {

0 commit comments

Comments
 (0)