@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 +1 -1
- package/dist/index.d.ts +35 -0
- package/dist/types.d.ts +27 -0
- package/package.json +1 -1
- package/tsconfig.json +1 -0
package/build.log
CHANGED
package/dist/index.d.ts
ADDED
|
@@ -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
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -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
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. */
|