@adminforth/email-invite 1.1.3 → 1.1.4

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/build.log CHANGED
@@ -7,5 +7,5 @@ custom/
7
7
  custom/SetPassword.vue
8
8
  custom/tsconfig.json
9
9
 
10
- sent 14,973 bytes received 58 bytes 30,062.00 bytes/sec
10
+ sent 14,976 bytes received 58 bytes 30,068.00 bytes/sec
11
11
  total size is 14,761 speedup is 0.98
@@ -0,0 +1,35 @@
1
+ import { AdminForthPlugin } from "adminforth";
2
+ import type { IAdminForth, IHttpServer, AdminForthResourceColumn, AdminForthResource, AdminUser, HttpExtra } from "adminforth";
3
+ import type { PluginOptions } from './types.js';
4
+ export default class EmailInvitePlugin extends AdminForthPlugin {
5
+ options: PluginOptions;
6
+ authResource: AdminForthResource;
7
+ emailField: AdminForthResourceColumn;
8
+ emailConfirmedField?: AdminForthResourceColumn;
9
+ constructor(options: PluginOptions);
10
+ modifyResourceConfig(adminforth: IAdminForth, resourceConfig: AdminForthResource): Promise<void>;
11
+ validateConfigAfterDiscover(adminforth: IAdminForth, resourceConfig: AdminForthResource): void;
12
+ instanceUniqueRepresentation(pluginOptions: any): string;
13
+ handleUserCreation({ resource, adminUser, record, adminforth, extra }: {
14
+ resource: AdminForthResource;
15
+ adminUser: AdminUser;
16
+ record: any;
17
+ adminforth: IAdminForth;
18
+ extra?: HttpExtra;
19
+ }): Promise<{
20
+ ok: boolean;
21
+ error?: string;
22
+ }>;
23
+ sendInviteEmail({ recordId, resource, record, adminUser, adminforth, extra }: {
24
+ recordId: any;
25
+ resource: AdminForthResource;
26
+ record: any;
27
+ adminUser: AdminUser;
28
+ adminforth: IAdminForth;
29
+ extra?: HttpExtra;
30
+ }): Promise<{
31
+ ok: boolean;
32
+ error?: string;
33
+ }>;
34
+ setupEndpoints(server: IHttpServer): void;
35
+ }
@@ -0,0 +1,27 @@
1
+ import type { EmailAdapter } from "adminforth";
2
+ import { type PluginsCommonOptions } from "adminforth";
3
+ export interface PluginOptions extends PluginsCommonOptions {
4
+ /**
5
+ * Field name in auth resource which contains email
6
+ */
7
+ emailField: string;
8
+ /**
9
+ * From which email to send invite emails
10
+ * e.g. no-reply@example.com
11
+ */
12
+ sendFrom: string;
13
+ /**
14
+ * Field name in auth resource which contains password
15
+ */
16
+ passwordField: string;
17
+ /**
18
+ * Email adapter to use for sending emails
19
+ */
20
+ adapter: EmailAdapter;
21
+ /**
22
+ * Field name in auth resource which stores email confirmation status
23
+ * If provided, email will be marked as confirmed when user sets password via invite
24
+ * e.g. 'email_confirmed'
25
+ */
26
+ emailConfirmedField?: string;
27
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/email-invite",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
package/tsconfig.json CHANGED
@@ -2,6 +2,7 @@
2
2
  "compilerOptions": {
3
3
  "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include*/
4
4
  "module": "node16", /* Specify what module code is generated. */
5
+ "declaration": true,
5
6
  "outDir": "./dist", /* Specify an output folder for all emitted files. */
6
7
  "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. */
7
8
  "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */