@strapi/email 0.0.0-next.ce5699024a72ea224891438d5bbe39f904ec6774 → 0.0.0-next.d23f1485e5669cca1cee1bf5f8168b6b8109b78f

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.
@@ -1,15 +1,24 @@
1
1
  'use strict';
2
2
 
3
- var contentApi = {
4
- type: 'content-api',
5
- routes: [
3
+ var utils = require('@strapi/utils');
4
+ var email = require('./validation/email.js');
5
+
6
+ const createRoutes = utils.createContentApiRoutesFactory(()=>{
7
+ const validator = new email.EmailRouteValidator(strapi);
8
+ return [
6
9
  {
7
10
  method: 'POST',
8
11
  path: '/',
9
- handler: 'email.send'
12
+ handler: 'email.send',
13
+ request: {
14
+ body: {
15
+ 'application/json': validator.sendEmailInput
16
+ }
17
+ },
18
+ response: validator.emailResponse
10
19
  }
11
- ]
12
- };
20
+ ];
21
+ });
13
22
 
14
- module.exports = contentApi;
23
+ module.exports = createRoutes;
15
24
  //# sourceMappingURL=content-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-api.js","sources":["../../../server/src/routes/content-api.ts"],"sourcesContent":["export default {\n type: 'content-api',\n routes: [\n {\n method: 'POST',\n path: '/',\n handler: 'email.send',\n },\n ],\n};\n"],"names":["type","routes","method","path","handler"],"mappings":";;AAAA,iBAAe;IACbA,IAAM,EAAA,aAAA;IACNC,MAAQ,EAAA;AACN,QAAA;YACEC,MAAQ,EAAA,MAAA;YACRC,IAAM,EAAA,GAAA;YACNC,OAAS,EAAA;AACX;AACD;AACH,CAAE;;;;"}
1
+ {"version":3,"file":"content-api.js","sources":["../../../server/src/routes/content-api.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport { createContentApiRoutesFactory } from '@strapi/utils';\nimport { EmailRouteValidator } from './validation';\n\nconst createRoutes = createContentApiRoutesFactory((): Core.RouterInput['routes'] => {\n const validator = new EmailRouteValidator(strapi);\n\n return [\n {\n method: 'POST',\n path: '/',\n handler: 'email.send',\n request: {\n body: { 'application/json': validator.sendEmailInput },\n },\n response: validator.emailResponse,\n },\n ];\n});\n\nexport default createRoutes;\n"],"names":["createRoutes","createContentApiRoutesFactory","validator","EmailRouteValidator","strapi","method","path","handler","request","body","sendEmailInput","response","emailResponse"],"mappings":";;;;;AAIA,MAAMA,eAAeC,mCAA8B,CAAA,IAAA;IACjD,MAAMC,SAAAA,GAAY,IAAIC,yBAAoBC,CAAAA,MAAAA,CAAAA;IAE1C,OAAO;AACL,QAAA;YACEC,MAAQ,EAAA,MAAA;YACRC,IAAM,EAAA,GAAA;YACNC,OAAS,EAAA,YAAA;YACTC,OAAS,EAAA;gBACPC,IAAM,EAAA;AAAE,oBAAA,kBAAA,EAAoBP,UAAUQ;AAAe;AACvD,aAAA;AACAC,YAAAA,QAAAA,EAAUT,UAAUU;AACtB;AACD,KAAA;AACH,CAAA;;;;"}
@@ -1,13 +1,22 @@
1
- var contentApi = {
2
- type: 'content-api',
3
- routes: [
1
+ import { createContentApiRoutesFactory } from '@strapi/utils';
2
+ import { EmailRouteValidator } from './validation/email.mjs';
3
+
4
+ const createRoutes = createContentApiRoutesFactory(()=>{
5
+ const validator = new EmailRouteValidator(strapi);
6
+ return [
4
7
  {
5
8
  method: 'POST',
6
9
  path: '/',
7
- handler: 'email.send'
10
+ handler: 'email.send',
11
+ request: {
12
+ body: {
13
+ 'application/json': validator.sendEmailInput
14
+ }
15
+ },
16
+ response: validator.emailResponse
8
17
  }
9
- ]
10
- };
18
+ ];
19
+ });
11
20
 
12
- export { contentApi as default };
21
+ export { createRoutes as default };
13
22
  //# sourceMappingURL=content-api.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-api.mjs","sources":["../../../server/src/routes/content-api.ts"],"sourcesContent":["export default {\n type: 'content-api',\n routes: [\n {\n method: 'POST',\n path: '/',\n handler: 'email.send',\n },\n ],\n};\n"],"names":["type","routes","method","path","handler"],"mappings":"AAAA,iBAAe;IACbA,IAAM,EAAA,aAAA;IACNC,MAAQ,EAAA;AACN,QAAA;YACEC,MAAQ,EAAA,MAAA;YACRC,IAAM,EAAA,GAAA;YACNC,OAAS,EAAA;AACX;AACD;AACH,CAAE;;;;"}
1
+ {"version":3,"file":"content-api.mjs","sources":["../../../server/src/routes/content-api.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport { createContentApiRoutesFactory } from '@strapi/utils';\nimport { EmailRouteValidator } from './validation';\n\nconst createRoutes = createContentApiRoutesFactory((): Core.RouterInput['routes'] => {\n const validator = new EmailRouteValidator(strapi);\n\n return [\n {\n method: 'POST',\n path: '/',\n handler: 'email.send',\n request: {\n body: { 'application/json': validator.sendEmailInput },\n },\n response: validator.emailResponse,\n },\n ];\n});\n\nexport default createRoutes;\n"],"names":["createRoutes","createContentApiRoutesFactory","validator","EmailRouteValidator","strapi","method","path","handler","request","body","sendEmailInput","response","emailResponse"],"mappings":";;;AAIA,MAAMA,eAAeC,6BAA8B,CAAA,IAAA;IACjD,MAAMC,SAAAA,GAAY,IAAIC,mBAAoBC,CAAAA,MAAAA,CAAAA;IAE1C,OAAO;AACL,QAAA;YACEC,MAAQ,EAAA,MAAA;YACRC,IAAM,EAAA,GAAA;YACNC,OAAS,EAAA,YAAA;YACTC,OAAS,EAAA;gBACPC,IAAM,EAAA;AAAE,oBAAA,kBAAA,EAAoBP,UAAUQ;AAAe;AACvD,aAAA;AACAC,YAAAA,QAAAA,EAAUT,UAAUU;AACtB;AACD,KAAA;AACH,CAAA;;;;"}
@@ -1,9 +1,9 @@
1
1
  import admin from './admin.mjs';
2
- import contentApi from './content-api.mjs';
2
+ import createRoutes from './content-api.mjs';
3
3
 
4
4
  const routes = {
5
5
  admin,
6
- 'content-api': contentApi
6
+ 'content-api': createRoutes
7
7
  };
8
8
 
9
9
  export { routes };
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ var z = require('zod/v4');
4
+
5
+ function _interopNamespaceDefault(e) {
6
+ var n = Object.create(null);
7
+ if (e) {
8
+ Object.keys(e).forEach(function (k) {
9
+ if (k !== 'default') {
10
+ var d = Object.getOwnPropertyDescriptor(e, k);
11
+ Object.defineProperty(n, k, d.get ? d : {
12
+ enumerable: true,
13
+ get: function () { return e[k]; }
14
+ });
15
+ }
16
+ });
17
+ }
18
+ n.default = e;
19
+ return Object.freeze(n);
20
+ }
21
+
22
+ var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
23
+
24
+ class EmailRouteValidator {
25
+ get sendEmailInput() {
26
+ return z__namespace.object({
27
+ from: z__namespace.string().optional(),
28
+ to: z__namespace.string(),
29
+ cc: z__namespace.string().optional(),
30
+ bcc: z__namespace.string().optional(),
31
+ replyTo: z__namespace.string().optional(),
32
+ subject: z__namespace.string(),
33
+ text: z__namespace.string(),
34
+ html: z__namespace.string().optional()
35
+ }).catchall(z__namespace.string());
36
+ }
37
+ get emailResponse() {
38
+ return z__namespace.object({});
39
+ }
40
+ constructor(strapi){
41
+ this._strapi = strapi;
42
+ }
43
+ }
44
+
45
+ exports.EmailRouteValidator = EmailRouteValidator;
46
+ //# sourceMappingURL=email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.js","sources":["../../../../server/src/routes/validation/email.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport * as z from 'zod/v4';\n\nexport class EmailRouteValidator {\n protected readonly _strapi: Core.Strapi;\n\n public constructor(strapi: Core.Strapi) {\n this._strapi = strapi;\n }\n\n get sendEmailInput() {\n return z\n .object({\n from: z.string().optional(),\n to: z.string(),\n cc: z.string().optional(),\n bcc: z.string().optional(),\n replyTo: z.string().optional(),\n subject: z.string(),\n text: z.string(),\n html: z.string().optional(),\n })\n .catchall(z.string());\n }\n\n get emailResponse() {\n return z.object({});\n }\n}\n"],"names":["EmailRouteValidator","sendEmailInput","z","object","from","string","optional","to","cc","bcc","replyTo","subject","text","html","catchall","emailResponse","strapi","_strapi"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAMA,mBAAAA,CAAAA;AAOX,IAAA,IAAIC,cAAiB,GAAA;QACnB,OAAOC,YAAAA,CACJC,MAAM,CAAC;YACNC,IAAMF,EAAAA,YAAAA,CAAEG,MAAM,EAAA,CAAGC,QAAQ,EAAA;AACzBC,YAAAA,EAAAA,EAAIL,aAAEG,MAAM,EAAA;YACZG,EAAIN,EAAAA,YAAAA,CAAEG,MAAM,EAAA,CAAGC,QAAQ,EAAA;YACvBG,GAAKP,EAAAA,YAAAA,CAAEG,MAAM,EAAA,CAAGC,QAAQ,EAAA;YACxBI,OAASR,EAAAA,YAAAA,CAAEG,MAAM,EAAA,CAAGC,QAAQ,EAAA;AAC5BK,YAAAA,OAAAA,EAAST,aAAEG,MAAM,EAAA;AACjBO,YAAAA,IAAAA,EAAMV,aAAEG,MAAM,EAAA;YACdQ,IAAMX,EAAAA,YAAAA,CAAEG,MAAM,EAAA,CAAGC,QAAQ;SAE1BQ,CAAAA,CAAAA,QAAQ,CAACZ,YAAAA,CAAEG,MAAM,EAAA,CAAA;AACtB;AAEA,IAAA,IAAIU,aAAgB,GAAA;QAClB,OAAOb,YAAAA,CAAEC,MAAM,CAAC,EAAC,CAAA;AACnB;AArBA,IAAA,WAAA,CAAmBa,MAAmB,CAAE;QACtC,IAAI,CAACC,OAAO,GAAGD,MAAAA;AACjB;AAoBF;;;;"}
@@ -0,0 +1,25 @@
1
+ import * as z from 'zod/v4';
2
+
3
+ class EmailRouteValidator {
4
+ get sendEmailInput() {
5
+ return z.object({
6
+ from: z.string().optional(),
7
+ to: z.string(),
8
+ cc: z.string().optional(),
9
+ bcc: z.string().optional(),
10
+ replyTo: z.string().optional(),
11
+ subject: z.string(),
12
+ text: z.string(),
13
+ html: z.string().optional()
14
+ }).catchall(z.string());
15
+ }
16
+ get emailResponse() {
17
+ return z.object({});
18
+ }
19
+ constructor(strapi){
20
+ this._strapi = strapi;
21
+ }
22
+ }
23
+
24
+ export { EmailRouteValidator };
25
+ //# sourceMappingURL=email.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.mjs","sources":["../../../../server/src/routes/validation/email.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport * as z from 'zod/v4';\n\nexport class EmailRouteValidator {\n protected readonly _strapi: Core.Strapi;\n\n public constructor(strapi: Core.Strapi) {\n this._strapi = strapi;\n }\n\n get sendEmailInput() {\n return z\n .object({\n from: z.string().optional(),\n to: z.string(),\n cc: z.string().optional(),\n bcc: z.string().optional(),\n replyTo: z.string().optional(),\n subject: z.string(),\n text: z.string(),\n html: z.string().optional(),\n })\n .catchall(z.string());\n }\n\n get emailResponse() {\n return z.object({});\n }\n}\n"],"names":["EmailRouteValidator","sendEmailInput","z","object","from","string","optional","to","cc","bcc","replyTo","subject","text","html","catchall","emailResponse","strapi","_strapi"],"mappings":";;AAGO,MAAMA,mBAAAA,CAAAA;AAOX,IAAA,IAAIC,cAAiB,GAAA;QACnB,OAAOC,CAAAA,CACJC,MAAM,CAAC;YACNC,IAAMF,EAAAA,CAAAA,CAAEG,MAAM,EAAA,CAAGC,QAAQ,EAAA;AACzBC,YAAAA,EAAAA,EAAIL,EAAEG,MAAM,EAAA;YACZG,EAAIN,EAAAA,CAAAA,CAAEG,MAAM,EAAA,CAAGC,QAAQ,EAAA;YACvBG,GAAKP,EAAAA,CAAAA,CAAEG,MAAM,EAAA,CAAGC,QAAQ,EAAA;YACxBI,OAASR,EAAAA,CAAAA,CAAEG,MAAM,EAAA,CAAGC,QAAQ,EAAA;AAC5BK,YAAAA,OAAAA,EAAST,EAAEG,MAAM,EAAA;AACjBO,YAAAA,IAAAA,EAAMV,EAAEG,MAAM,EAAA;YACdQ,IAAMX,EAAAA,CAAAA,CAAEG,MAAM,EAAA,CAAGC,QAAQ;SAE1BQ,CAAAA,CAAAA,QAAQ,CAACZ,CAAAA,CAAEG,MAAM,EAAA,CAAA;AACtB;AAEA,IAAA,IAAIU,aAAgB,GAAA;QAClB,OAAOb,CAAAA,CAAEC,MAAM,CAAC,EAAC,CAAA;AACnB;AArBA,IAAA,WAAA,CAAmBa,MAAmB,CAAE;QACtC,IAAI,CAACC,OAAO,GAAGD,MAAAA;AACjB;AAoBF;;;;"}
@@ -27,13 +27,9 @@ declare const _default: {
27
27
  };
28
28
  }[];
29
29
  };
30
- 'content-api': {
31
- type: string;
32
- routes: {
33
- method: string;
34
- path: string;
35
- handler: string;
36
- }[];
30
+ 'content-api': () => {
31
+ type: "content-api";
32
+ routes: import("@strapi/types/dist/core").RouteInput[];
37
33
  };
38
34
  };
39
35
  controllers: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../server/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,wBAOE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../server/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,wBAOE"}
@@ -1,10 +1,7 @@
1
- declare const _default: {
2
- type: string;
3
- routes: {
4
- method: string;
5
- path: string;
6
- handler: string;
7
- }[];
1
+ import type { Core } from '@strapi/types';
2
+ declare const createRoutes: () => {
3
+ type: "content-api";
4
+ routes: Core.RouteInput[];
8
5
  };
9
- export default _default;
6
+ export default createRoutes;
10
7
  //# sourceMappingURL=content-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-api.d.ts","sourceRoot":"","sources":["../../../../server/src/routes/content-api.ts"],"names":[],"mappings":";;;;;;;;AAAA,wBASE"}
1
+ {"version":3,"file":"content-api.d.ts","sourceRoot":"","sources":["../../../../server/src/routes/content-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAI1C,QAAA,MAAM,YAAY;;;CAchB,CAAC;AAEH,eAAe,YAAY,CAAC"}
@@ -15,13 +15,9 @@ export declare const routes: {
15
15
  };
16
16
  }[];
17
17
  };
18
- 'content-api': {
19
- type: string;
20
- routes: {
21
- method: string;
22
- path: string;
23
- handler: string;
24
- }[];
18
+ 'content-api': () => {
19
+ type: "content-api";
20
+ routes: import("@strapi/types/dist/core").RouteInput[];
25
21
  };
26
22
  };
27
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/routes/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;CAGlB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../server/src/routes/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;CAGlB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { Core } from '@strapi/types';
2
+ import * as z from 'zod/v4';
3
+ export declare class EmailRouteValidator {
4
+ protected readonly _strapi: Core.Strapi;
5
+ constructor(strapi: Core.Strapi);
6
+ get sendEmailInput(): z.ZodObject<{
7
+ from: z.ZodOptional<z.ZodString>;
8
+ to: z.ZodString;
9
+ cc: z.ZodOptional<z.ZodString>;
10
+ bcc: z.ZodOptional<z.ZodString>;
11
+ replyTo: z.ZodOptional<z.ZodString>;
12
+ subject: z.ZodString;
13
+ text: z.ZodString;
14
+ html: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$catchall<z.ZodString>>;
16
+ get emailResponse(): z.ZodObject<{}, z.core.$strip>;
17
+ }
18
+ //# sourceMappingURL=email.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../../../server/src/routes/validation/email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,qBAAa,mBAAmB;IAC9B,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC;gBAErB,MAAM,EAAE,IAAI,CAAC,MAAM;IAItC,IAAI,cAAc;;;;;;;;;sCAajB;IAED,IAAI,aAAa,mCAEhB;CACF"}
@@ -0,0 +1,2 @@
1
+ export { EmailRouteValidator } from './email';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../server/src/routes/validation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/email",
3
- "version": "0.0.0-next.ce5699024a72ea224891438d5bbe39f904ec6774",
3
+ "version": "0.0.0-next.d23f1485e5669cca1cee1bf5f8168b6b8109b78f",
4
4
  "description": "Easily configure your Strapi application to send emails.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -56,23 +56,24 @@
56
56
  "watch": "run -T rollup -c -w"
57
57
  },
58
58
  "dependencies": {
59
- "@strapi/design-system": "2.0.0-rc.21",
60
- "@strapi/icons": "2.0.0-rc.21",
61
- "@strapi/provider-email-sendmail": "0.0.0-next.ce5699024a72ea224891438d5bbe39f904ec6774",
62
- "@strapi/utils": "0.0.0-next.ce5699024a72ea224891438d5bbe39f904ec6774",
59
+ "@strapi/design-system": "2.0.0-rc.29",
60
+ "@strapi/icons": "2.0.0-rc.29",
61
+ "@strapi/provider-email-sendmail": "0.0.0-next.d23f1485e5669cca1cee1bf5f8168b6b8109b78f",
62
+ "@strapi/utils": "0.0.0-next.d23f1485e5669cca1cee1bf5f8168b6b8109b78f",
63
63
  "koa2-ratelimit": "^1.1.3",
64
64
  "lodash": "4.17.21",
65
65
  "react-intl": "6.6.2",
66
66
  "react-query": "3.39.3",
67
- "yup": "0.32.9"
67
+ "yup": "0.32.9",
68
+ "zod": "3.25.67"
68
69
  },
69
70
  "devDependencies": {
70
- "@strapi/admin": "0.0.0-next.ce5699024a72ea224891438d5bbe39f904ec6774",
71
- "@strapi/types": "0.0.0-next.ce5699024a72ea224891438d5bbe39f904ec6774",
71
+ "@strapi/admin": "0.0.0-next.d23f1485e5669cca1cee1bf5f8168b6b8109b78f",
72
+ "@strapi/types": "0.0.0-next.d23f1485e5669cca1cee1bf5f8168b6b8109b78f",
72
73
  "@testing-library/react": "15.0.7",
73
74
  "@types/koa": "2.13.4",
74
75
  "@types/lodash": "^4.14.191",
75
- "koa": "2.15.4",
76
+ "koa": "2.16.1",
76
77
  "koa-body": "6.0.1",
77
78
  "msw": "1.3.0",
78
79
  "react": "18.3.1",