@webiny/api-mailer 0.0.0-unstable.78f581c1d2 → 0.0.0-unstable.97a151f74d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/graphql/settings.js +8 -8
- package/graphql/settings.js.map +1 -1
- package/package.json +21 -21
package/graphql/settings.js
CHANGED
|
@@ -26,16 +26,16 @@ const createSettingsGraphQL = () => {
|
|
|
26
26
|
replyTo: String
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
type
|
|
29
|
+
type MailerTransportSettingsResponse {
|
|
30
30
|
data: MailerTransportSettings
|
|
31
31
|
error: MailerTransportSettingsError
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
type MailerQuery {
|
|
35
|
-
getSettings:
|
|
35
|
+
getSettings: MailerTransportSettingsResponse!
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
input
|
|
38
|
+
input MailerTransportSettingsInput {
|
|
39
39
|
host: String!
|
|
40
40
|
port: Number
|
|
41
41
|
user: String!
|
|
@@ -45,7 +45,7 @@ const createSettingsGraphQL = () => {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
type MailerMutation {
|
|
48
|
-
saveSettings(data:
|
|
48
|
+
saveSettings(data: MailerTransportSettingsInput!): MailerTransportSettingsResponse!
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
extend type Query {
|
|
@@ -64,10 +64,10 @@ const createSettingsGraphQL = () => {
|
|
|
64
64
|
try {
|
|
65
65
|
const settings = await context.mailer.getSettings();
|
|
66
66
|
/**
|
|
67
|
-
* We want to remove the password from the response
|
|
67
|
+
* We want to remove the password from the response, if it exists.
|
|
68
68
|
*/
|
|
69
69
|
|
|
70
|
-
if (settings) {
|
|
70
|
+
if (settings !== null && settings !== void 0 && settings.password) {
|
|
71
71
|
// @ts-ignore
|
|
72
72
|
delete settings.password;
|
|
73
73
|
}
|
|
@@ -88,10 +88,10 @@ const createSettingsGraphQL = () => {
|
|
|
88
88
|
input: args.data
|
|
89
89
|
});
|
|
90
90
|
/**
|
|
91
|
-
* We want to remove the password from the response
|
|
91
|
+
* We want to remove the password from the response, if it exists.
|
|
92
92
|
*/
|
|
93
93
|
|
|
94
|
-
if (settings) {
|
|
94
|
+
if (settings !== null && settings !== void 0 && settings.password) {
|
|
95
95
|
// @ts-ignore
|
|
96
96
|
delete settings.password;
|
|
97
97
|
}
|
package/graphql/settings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["emptyResolver","createSettingsGraphQL","GraphQLSchemaPlugin","typeDefs","resolvers","Query","mailer","MailerQuery","getSettings","_","__","context","settings","password","Response","ex","ErrorResponse","Mutation","MailerMutation","saveSettings","args","input","data"],"sources":["settings.ts"],"sourcesContent":["import { ErrorResponse, GraphQLSchemaPlugin, Response } from \"@webiny/handler-graphql\";\nimport { MailerContext } from \"~/types\";\n\nconst emptyResolver = () => ({});\n\nexport const createSettingsGraphQL = () => {\n return new GraphQLSchemaPlugin<MailerContext>({\n typeDefs: `\n type MailerTransportSettingsError {\n message: String!\n code: String\n data: JSON\n }\n \n type MailerTransportSettings {\n host: String\n port: Number\n user: String\n from: String\n replyTo: String\n }\n \n type
|
|
1
|
+
{"version":3,"names":["emptyResolver","createSettingsGraphQL","GraphQLSchemaPlugin","typeDefs","resolvers","Query","mailer","MailerQuery","getSettings","_","__","context","settings","password","Response","ex","ErrorResponse","Mutation","MailerMutation","saveSettings","args","input","data"],"sources":["settings.ts"],"sourcesContent":["import { ErrorResponse, GraphQLSchemaPlugin, Response } from \"@webiny/handler-graphql\";\nimport { MailerContext } from \"~/types\";\n\nconst emptyResolver = () => ({});\n\nexport const createSettingsGraphQL = () => {\n return new GraphQLSchemaPlugin<MailerContext>({\n typeDefs: `\n type MailerTransportSettingsError {\n message: String!\n code: String\n data: JSON\n }\n \n type MailerTransportSettings {\n host: String\n port: Number\n user: String\n from: String\n replyTo: String\n }\n \n type MailerTransportSettingsResponse {\n data: MailerTransportSettings\n error: MailerTransportSettingsError\n }\n \n type MailerQuery {\n getSettings: MailerTransportSettingsResponse!\n }\n \n input MailerTransportSettingsInput {\n host: String!\n port: Number\n user: String!\n password: String\n from: String!\n replyTo: String\n }\n \n type MailerMutation {\n saveSettings(data: MailerTransportSettingsInput!): MailerTransportSettingsResponse!\n }\n \n extend type Query {\n mailer: MailerQuery\n }\n extend type Mutation {\n mailer: MailerMutation\n }\n `,\n resolvers: {\n Query: {\n mailer: emptyResolver\n },\n MailerQuery: {\n getSettings: async (_, __, context) => {\n try {\n const settings = await context.mailer.getSettings();\n /**\n * We want to remove the password from the response, if it exists.\n */\n if (settings?.password) {\n // @ts-ignore\n delete settings.password;\n }\n return new Response(settings);\n } catch (ex) {\n return new ErrorResponse(ex);\n }\n }\n },\n Mutation: {\n mailer: emptyResolver\n },\n MailerMutation: {\n saveSettings: async (_, args: any, context) => {\n try {\n const settings = await context.mailer.saveSettings({\n input: args.data\n });\n /**\n * We want to remove the password from the response, if it exists.\n */\n if (settings?.password) {\n // @ts-ignore\n delete settings.password;\n }\n return new Response(settings);\n } catch (ex) {\n return new ErrorResponse(ex);\n }\n }\n }\n }\n });\n};\n"],"mappings":";;;;;;;AAAA;;AAGA,MAAMA,aAAa,GAAG,OAAO,EAAP,CAAtB;;AAEO,MAAMC,qBAAqB,GAAG,MAAM;EACvC,OAAO,IAAIC,mCAAJ,CAAuC;IAC1CC,QAAQ,EAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SA5CkD;IA6C1CC,SAAS,EAAE;MACPC,KAAK,EAAE;QACHC,MAAM,EAAEN;MADL,CADA;MAIPO,WAAW,EAAE;QACTC,WAAW,EAAE,OAAOC,CAAP,EAAUC,EAAV,EAAcC,OAAd,KAA0B;UACnC,IAAI;YACA,MAAMC,QAAQ,GAAG,MAAMD,OAAO,CAACL,MAAR,CAAeE,WAAf,EAAvB;YACA;AACxB;AACA;;YACwB,IAAII,QAAJ,aAAIA,QAAJ,eAAIA,QAAQ,CAAEC,QAAd,EAAwB;cACpB;cACA,OAAOD,QAAQ,CAACC,QAAhB;YACH;;YACD,OAAO,IAAIC,wBAAJ,CAAaF,QAAb,CAAP;UACH,CAVD,CAUE,OAAOG,EAAP,EAAW;YACT,OAAO,IAAIC,6BAAJ,CAAkBD,EAAlB,CAAP;UACH;QACJ;MAfQ,CAJN;MAqBPE,QAAQ,EAAE;QACNX,MAAM,EAAEN;MADF,CArBH;MAwBPkB,cAAc,EAAE;QACZC,YAAY,EAAE,OAAOV,CAAP,EAAUW,IAAV,EAAqBT,OAArB,KAAiC;UAC3C,IAAI;YACA,MAAMC,QAAQ,GAAG,MAAMD,OAAO,CAACL,MAAR,CAAea,YAAf,CAA4B;cAC/CE,KAAK,EAAED,IAAI,CAACE;YADmC,CAA5B,CAAvB;YAGA;AACxB;AACA;;YACwB,IAAIV,QAAJ,aAAIA,QAAJ,eAAIA,QAAQ,CAAEC,QAAd,EAAwB;cACpB;cACA,OAAOD,QAAQ,CAACC,QAAhB;YACH;;YACD,OAAO,IAAIC,wBAAJ,CAAaF,QAAb,CAAP;UACH,CAZD,CAYE,OAAOG,EAAP,EAAW;YACT,OAAO,IAAIC,6BAAJ,CAAkBD,EAAlB,CAAP;UACH;QACJ;MAjBW;IAxBT;EA7C+B,CAAvC,CAAP;AA0FH,CA3FM"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-mailer",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.97a151f74d",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@babel/runtime": "7.19.0",
|
|
18
|
-
"@webiny/api": "0.0.0-unstable.
|
|
19
|
-
"@webiny/api-headless-cms": "0.0.0-unstable.
|
|
20
|
-
"@webiny/error": "0.0.0-unstable.
|
|
21
|
-
"@webiny/handler-graphql": "0.0.0-unstable.
|
|
22
|
-
"@webiny/plugins": "0.0.0-unstable.
|
|
23
|
-
"@webiny/pubsub": "0.0.0-unstable.
|
|
18
|
+
"@webiny/api": "0.0.0-unstable.97a151f74d",
|
|
19
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.97a151f74d",
|
|
20
|
+
"@webiny/error": "0.0.0-unstable.97a151f74d",
|
|
21
|
+
"@webiny/handler-graphql": "0.0.0-unstable.97a151f74d",
|
|
22
|
+
"@webiny/plugins": "0.0.0-unstable.97a151f74d",
|
|
23
|
+
"@webiny/pubsub": "0.0.0-unstable.97a151f74d",
|
|
24
24
|
"crypto-js": "4.1.1",
|
|
25
25
|
"joi": "17.6.2",
|
|
26
26
|
"lodash": "4.17.21",
|
|
@@ -33,19 +33,19 @@
|
|
|
33
33
|
"@babel/preset-typescript": "^7.18.6",
|
|
34
34
|
"@types/crypto-js": "^4.1.1",
|
|
35
35
|
"@types/nodemailer": "^6.4.4",
|
|
36
|
-
"@webiny/api-headless-cms-ddb": "^0.0.0-unstable.
|
|
37
|
-
"@webiny/api-i18n": "^0.0.0-unstable.
|
|
38
|
-
"@webiny/api-i18n-ddb": "^0.0.0-unstable.
|
|
39
|
-
"@webiny/api-security": "^0.0.0-unstable.
|
|
40
|
-
"@webiny/api-security-so-ddb": "^0.0.0-unstable.
|
|
41
|
-
"@webiny/api-tenancy": "^0.0.0-unstable.
|
|
42
|
-
"@webiny/api-tenancy-so-ddb": "^0.0.0-unstable.
|
|
43
|
-
"@webiny/cli": "^0.0.0-unstable.
|
|
44
|
-
"@webiny/db-dynamodb": "^0.0.0-unstable.
|
|
45
|
-
"@webiny/handler": "^0.0.0-unstable.
|
|
46
|
-
"@webiny/handler-aws": "^0.0.0-unstable.
|
|
47
|
-
"@webiny/handler-db": "^0.0.0-unstable.
|
|
48
|
-
"@webiny/project-utils": "^0.0.0-unstable.
|
|
36
|
+
"@webiny/api-headless-cms-ddb": "^0.0.0-unstable.97a151f74d",
|
|
37
|
+
"@webiny/api-i18n": "^0.0.0-unstable.97a151f74d",
|
|
38
|
+
"@webiny/api-i18n-ddb": "^0.0.0-unstable.97a151f74d",
|
|
39
|
+
"@webiny/api-security": "^0.0.0-unstable.97a151f74d",
|
|
40
|
+
"@webiny/api-security-so-ddb": "^0.0.0-unstable.97a151f74d",
|
|
41
|
+
"@webiny/api-tenancy": "^0.0.0-unstable.97a151f74d",
|
|
42
|
+
"@webiny/api-tenancy-so-ddb": "^0.0.0-unstable.97a151f74d",
|
|
43
|
+
"@webiny/cli": "^0.0.0-unstable.97a151f74d",
|
|
44
|
+
"@webiny/db-dynamodb": "^0.0.0-unstable.97a151f74d",
|
|
45
|
+
"@webiny/handler": "^0.0.0-unstable.97a151f74d",
|
|
46
|
+
"@webiny/handler-aws": "^0.0.0-unstable.97a151f74d",
|
|
47
|
+
"@webiny/handler-db": "^0.0.0-unstable.97a151f74d",
|
|
48
|
+
"@webiny/project-utils": "^0.0.0-unstable.97a151f74d",
|
|
49
49
|
"graphql": "^15.7.2",
|
|
50
50
|
"jest": "^28.1.0",
|
|
51
51
|
"jest-dynalite": "^3.6.1",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"build": "yarn webiny run build",
|
|
62
62
|
"watch": "yarn webiny run watch"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "97a151f74d8c5679323989fcc8cc7036be0f150e"
|
|
65
65
|
}
|