@facteurjs/adonisjs 1.0.0-beta.3 → 2.0.0-beta.0
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/README.md +25 -0
- package/dist/_virtual/rolldown_runtime.mjs +36 -0
- package/dist/adonisjs/configure.d.mts +6 -0
- package/dist/adonisjs/configure.mjs +44 -0
- package/dist/adonisjs/stubs/index.mjs +5 -0
- package/dist/adonisjs/stubs/stubs/config/notifications.stub +17 -0
- package/dist/adonisjs/stubs/stubs/index.ts +1 -0
- package/dist/adonisjs/stubs/stubs/make/notification.stub +9 -0
- package/dist/adonisjs/stubs/stubs/migrations/notifications.stub +36 -0
- package/dist/adonisjs/stubs/stubs/migrations/preferences.stub +32 -0
- package/dist/channels/aws-sns.d.mts +9 -0
- package/dist/channels/{aws-sns.js → aws-sns.mjs} +2 -0
- package/dist/channels/database.d.mts +9 -0
- package/dist/channels/{database.js → database.mjs} +2 -0
- package/dist/channels/discord.d.mts +9 -0
- package/dist/channels/{discord.js → discord.mjs} +2 -0
- package/dist/channels/{expo.js → expo.mjs} +2 -0
- package/dist/channels/fcm.d.mts +9 -0
- package/dist/channels/{fcm.js → fcm.mjs} +2 -0
- package/dist/channels/{mail.d.ts → mail.d.mts} +1 -1
- package/dist/channels/{mail.js → mail.mjs} +2 -1
- package/dist/channels/{slack.js → slack.mjs} +2 -0
- package/dist/channels/socketio.d.mts +9 -0
- package/dist/channels/{socketio.js → socketio.mjs} +2 -0
- package/dist/channels/transmit.d.mts +9 -0
- package/dist/channels/{transmit.js → transmit.mjs} +2 -0
- package/dist/channels/twilio.d.mts +9 -0
- package/dist/channels/{twilio.js → twilio.mjs} +2 -0
- package/dist/channels/{webhook.js → webhook.mjs} +2 -0
- package/dist/channels/webpush.d.mts +9 -0
- package/dist/channels/{webpush.js → webpush.mjs} +2 -0
- package/dist/{channels.d.ts → channels.d.mts} +11 -17
- package/dist/{channels.js → channels.mjs} +5 -8
- package/dist/core/src/database/{types.d.ts → types.d.mts} +2 -6
- package/dist/core/src/types/channel.d.mts +56 -0
- package/dist/core/src/types/events.d.mts +13 -0
- package/dist/core/src/types/{extend.d.ts → extend.d.mts} +1 -5
- package/dist/core/src/types/notifications.d.mts +40 -0
- package/dist/core/src/types/options.d.mts +141 -0
- package/dist/core/src/types/preferences.d.mts +28 -0
- package/dist/core/src/types/queue.d.mts +11 -0
- package/dist/{database/index.d.ts → database.d.mts} +1 -1
- package/dist/{database/index.js → database.mjs} +3 -4
- package/dist/{define_config.d.ts → define_config.d.mts} +4 -2
- package/dist/{providers/facteur_provider.d.ts → facteur_provider.d.mts} +1 -1
- package/dist/{providers/facteur_provider.js → facteur_provider.mjs} +1 -1
- package/dist/index.d.mts +6 -0
- package/dist/index.mjs +8 -0
- package/dist/{manager.d.ts → manager.d.mts} +8 -3
- package/dist/manager.mjs +32 -0
- package/dist/server/{adapter.js → adapter.mjs} +7 -6
- package/dist/services/{main.d.ts → main.d.mts} +2 -2
- package/dist/types.d.mts +30 -0
- package/dist/types.mjs +11 -0
- package/package.json +58 -47
- package/dist/_virtual/rolldown_runtime.js +0 -25
- package/dist/channels/aws-sns.d.ts +0 -12
- package/dist/channels/database.d.ts +0 -12
- package/dist/channels/discord.d.ts +0 -12
- package/dist/channels/fcm.d.ts +0 -12
- package/dist/channels/socketio.d.ts +0 -12
- package/dist/channels/transmit.d.ts +0 -12
- package/dist/channels/twilio.d.ts +0 -12
- package/dist/channels/webpush.d.ts +0 -12
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -7
- package/dist/manager.js +0 -21
- package/dist/types.d.ts +0 -15
- package/dist/types.js +0 -11
- /package/dist/channels/{expo.d.ts → expo.d.mts} +0 -0
- /package/dist/channels/{slack.d.ts → slack.d.mts} +0 -0
- /package/dist/channels/{webhook.d.ts → webhook.d.mts} +0 -0
- /package/dist/{define_config.js → define_config.mjs} +0 -0
- /package/dist/services/{main.js → main.mjs} +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { DatabaseAdapter, Identifier } from "../database/types.mjs";
|
|
2
|
+
import { Channel } from "./channel.mjs";
|
|
3
|
+
import { QueueAdapter } from "./queue.mjs";
|
|
4
|
+
import { DefaultPreferences } from "./preferences.mjs";
|
|
5
|
+
import { ChannelName } from "./extend.mjs";
|
|
6
|
+
import { Emitter } from "./events.mjs";
|
|
7
|
+
import { Notifiable, Notification } from "./notifications.mjs";
|
|
8
|
+
import { Awaitable } from "@julr/utils/types";
|
|
9
|
+
import { Logger } from "@julr/utils/logger";
|
|
10
|
+
import { Duration } from "@julr/tenace/types";
|
|
11
|
+
|
|
12
|
+
//#region ../core/src/types/options.d.ts
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Configuration options for the Facteur library
|
|
16
|
+
*/
|
|
17
|
+
interface FacteurConfiguration<KnownChannels extends Record<string, Channel> = Record<string, Channel>, DBAdapter extends DatabaseAdapter | null = null> {
|
|
18
|
+
logger?: Logger;
|
|
19
|
+
emitter?: Emitter;
|
|
20
|
+
/**
|
|
21
|
+
* Channels to use for sending notifications.
|
|
22
|
+
*/
|
|
23
|
+
channels: KnownChannels;
|
|
24
|
+
/**
|
|
25
|
+
* A queue adapter to use for sending notifications.
|
|
26
|
+
* Needs to be provided if you want to use some queueing capabilities.
|
|
27
|
+
*/
|
|
28
|
+
queueAdapter?: QueueAdapter;
|
|
29
|
+
/**
|
|
30
|
+
* Database adapter to use for storing things, like topics and preferences.
|
|
31
|
+
* If not provided, you will not be able these features.
|
|
32
|
+
*/
|
|
33
|
+
databaseAdapter?: DBAdapter;
|
|
34
|
+
/**
|
|
35
|
+
* Discoverer configuration
|
|
36
|
+
*/
|
|
37
|
+
discoverer: {
|
|
38
|
+
/**
|
|
39
|
+
* Directory to search for notification classes. Will scan recursively.
|
|
40
|
+
*/
|
|
41
|
+
searchDirectory: URL;
|
|
42
|
+
/**
|
|
43
|
+
* Suffix for notification files.
|
|
44
|
+
* @default '_notification.ts'
|
|
45
|
+
*/
|
|
46
|
+
fileSuffix?: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* The default preferences for the users.
|
|
50
|
+
*/
|
|
51
|
+
preferences?: DefaultPreferences<KnownChannels>;
|
|
52
|
+
/**
|
|
53
|
+
* A callback that will be called to instantiate a notification class.
|
|
54
|
+
* Can be handy for using dependency injection or other custom instantiation logic.
|
|
55
|
+
* If not provided, the default constructor will be used.
|
|
56
|
+
*/
|
|
57
|
+
notificationResolver?: NotificationResolver;
|
|
58
|
+
/**
|
|
59
|
+
* Global retry configuration for channel sends.
|
|
60
|
+
* Can be overridden per-channel or per-send.
|
|
61
|
+
*/
|
|
62
|
+
retry?: RetryConfig<KnownChannels>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Resolver function type for notifications
|
|
66
|
+
*/
|
|
67
|
+
type NotificationResolver = (notification: new (ctx: MessageCtx<any, any>, ...args: any[]) => Notification, ctx: MessageCtx<any, any>) => Awaitable<Notification>;
|
|
68
|
+
interface NotificationOptions<N extends Notifiable = Notifiable> {
|
|
69
|
+
/**
|
|
70
|
+
* A human readable name for the notification.
|
|
71
|
+
* Used for UI purpose
|
|
72
|
+
*/
|
|
73
|
+
name: string;
|
|
74
|
+
/**
|
|
75
|
+
* A unique identifier for the notification.
|
|
76
|
+
* Used to identify the notification in the database and preferences.
|
|
77
|
+
*
|
|
78
|
+
* By default it is the class name
|
|
79
|
+
*/
|
|
80
|
+
identifier?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Bypass preferences and send the notification regardless of user settings.
|
|
83
|
+
* Useful for critical notifications that should always be sent.
|
|
84
|
+
*/
|
|
85
|
+
critical?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Human readable tags. Also used for UI purpose
|
|
88
|
+
*/
|
|
89
|
+
tags?: string[];
|
|
90
|
+
/**
|
|
91
|
+
* Channel category
|
|
92
|
+
*/
|
|
93
|
+
category?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Channels to deliver the notification by.
|
|
96
|
+
*/
|
|
97
|
+
deliverBy: Partial<Record<ChannelName, boolean | DeliverByOptions<N>>>;
|
|
98
|
+
}
|
|
99
|
+
interface DeliverByOptions<N extends Notifiable = Notifiable> {
|
|
100
|
+
if: (options: {
|
|
101
|
+
to: N;
|
|
102
|
+
params?: any;
|
|
103
|
+
preferences?: Record<string, boolean | undefined>;
|
|
104
|
+
}) => boolean;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Parameters received by the `as*Message` methods of a notification.
|
|
108
|
+
*/
|
|
109
|
+
interface MessageCtx<N extends Notifiable | undefined = Notifiable, Params extends Record<string, any> = {}> {
|
|
110
|
+
to: N;
|
|
111
|
+
params: Params;
|
|
112
|
+
tenantId?: Identifier | undefined;
|
|
113
|
+
}
|
|
114
|
+
type ExtractChannelTargets<T> = T extends Channel<any, any, any, infer U> ? U : never;
|
|
115
|
+
/**
|
|
116
|
+
* Retry options for channel sends
|
|
117
|
+
*/
|
|
118
|
+
interface RetryOptions {
|
|
119
|
+
/**
|
|
120
|
+
* Number of retry attempts when a channel send fails.
|
|
121
|
+
* Uses exponential backoff with jitter.
|
|
122
|
+
* @default 0 (no retries)
|
|
123
|
+
*/
|
|
124
|
+
retries?: number;
|
|
125
|
+
/**
|
|
126
|
+
* Timeout for each channel send operation.
|
|
127
|
+
* Accepts milliseconds or duration strings like '30s', '1m'.
|
|
128
|
+
*/
|
|
129
|
+
timeout?: Duration;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Global retry configuration with per-channel overrides
|
|
133
|
+
*/
|
|
134
|
+
interface RetryConfig<KnownChannels extends Record<string, Channel> = Record<string, Channel>> extends RetryOptions {
|
|
135
|
+
/**
|
|
136
|
+
* Per-channel retry overrides
|
|
137
|
+
*/
|
|
138
|
+
channels?: { [K in keyof KnownChannels]?: RetryOptions };
|
|
139
|
+
}
|
|
140
|
+
//#endregion
|
|
141
|
+
export { ExtractChannelTargets, FacteurConfiguration, MessageCtx, NotificationOptions };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Channel } from "./channel.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../core/src/types/preferences.d.ts
|
|
4
|
+
type ChannelPreferences<KnownChannels extends Record<string, Channel>> = Record<keyof KnownChannels, boolean>;
|
|
5
|
+
/**
|
|
6
|
+
* Shape for the `preferences` option in facteur configuration
|
|
7
|
+
*/
|
|
8
|
+
interface DefaultPreferences<KnownChannels extends Record<string, Channel>> {
|
|
9
|
+
/**
|
|
10
|
+
* If false, user preferences will not be taken into account before sending notifications.
|
|
11
|
+
*/
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Global preferences for all notifications.
|
|
15
|
+
*/
|
|
16
|
+
global?: {
|
|
17
|
+
channels?: ChannelPreferences<KnownChannels>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Per-category preferences.
|
|
21
|
+
* Use `Notification.options.category` to define category on a notification.
|
|
22
|
+
*/
|
|
23
|
+
categories?: Record<string, {
|
|
24
|
+
channels?: Partial<ChannelPreferences<KnownChannels>>;
|
|
25
|
+
} | boolean>;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { DefaultPreferences };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region ../core/src/types/queue.d.ts
|
|
2
|
+
interface QueueItemOptions {
|
|
3
|
+
delay?: number;
|
|
4
|
+
}
|
|
5
|
+
interface QueueAdapter {
|
|
6
|
+
queue(message: any, options?: QueueItemOptions): Promise<void>;
|
|
7
|
+
startQueueProcessor(): void;
|
|
8
|
+
disconnect(): void;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { QueueAdapter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { database_d_exports } from "
|
|
1
|
+
import { database_d_exports } from "./channels/database.mjs";
|
|
2
2
|
import * as _facteurjs_core_database_types0 from "@facteurjs/core/database/types";
|
|
3
3
|
import * as _adonisjs_core_types0 from "@adonisjs/core/types";
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { configProvider } from "@adonisjs/core";
|
|
2
1
|
import { RuntimeException } from "@adonisjs/core/exceptions";
|
|
2
|
+
import { configProvider } from "@adonisjs/core";
|
|
3
3
|
|
|
4
4
|
//#region src/database/index.ts
|
|
5
5
|
const databases = {
|
|
@@ -7,15 +7,14 @@ const databases = {
|
|
|
7
7
|
return configProvider.create(async (app) => {
|
|
8
8
|
const db = await app.container.make("lucid.db");
|
|
9
9
|
const connectionName = config?.connectionName || db.primaryConnectionName;
|
|
10
|
-
const connection = db.manager.get(connectionName);
|
|
11
10
|
/**
|
|
12
11
|
* Throw error when mentioned connection is not specified
|
|
13
12
|
* in the database file
|
|
14
13
|
*/
|
|
15
|
-
if (!
|
|
14
|
+
if (!db.manager.get(connectionName)) throw new RuntimeException(`Invalid connection name "${connectionName}" referenced by "config/notifications.ts" file. First register the connection inside "config/database.ts" file`);
|
|
16
15
|
const { knexAdapter } = await import("@facteurjs/core/database/adapters/knex");
|
|
17
16
|
return knexAdapter({
|
|
18
|
-
connection: db.connection(connectionName).getWriteClient(),
|
|
17
|
+
connection: () => db.connection(connectionName).getWriteClient(),
|
|
19
18
|
tableNames: {
|
|
20
19
|
notifications: config?.tableNames?.notifications,
|
|
21
20
|
preferences: config?.tableNames?.preferences
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { database_d_exports } from "./channels/database.
|
|
2
|
-
import { Channel
|
|
1
|
+
import { database_d_exports } from "./channels/database.mjs";
|
|
2
|
+
import { Channel } from "./core/src/types/channel.mjs";
|
|
3
|
+
import { DefaultPreferences } from "./core/src/types/preferences.mjs";
|
|
4
|
+
import { FacteurConfiguration } from "./core/src/types/options.mjs";
|
|
3
5
|
import { ConfigProvider } from "@adonisjs/core/types";
|
|
4
6
|
import { HttpContext } from "@adonisjs/core/http";
|
|
5
7
|
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { defineConfig } from "./define_config.mjs";
|
|
2
|
+
import { channels } from "./channels.mjs";
|
|
3
|
+
import { NotificationManager } from "./manager.mjs";
|
|
4
|
+
import { configure } from "./adonisjs/configure.mjs";
|
|
5
|
+
export * from "@facteurjs/core";
|
|
6
|
+
export { NotificationManager, channels, configure, defineConfig };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineConfig } from "./define_config.mjs";
|
|
2
|
+
import { channels } from "./channels.mjs";
|
|
3
|
+
import { NotificationManager } from "./manager.mjs";
|
|
4
|
+
import { configure } from "./adonisjs/configure.mjs";
|
|
5
|
+
|
|
6
|
+
export * from "@facteurjs/core"
|
|
7
|
+
|
|
8
|
+
export { NotificationManager, channels, configure, defineConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { DatabaseAdapter } from "./core/src/database/types.mjs";
|
|
2
|
+
import { AdonisAuthorizationCallback, types_d_exports } from "./types.mjs";
|
|
3
3
|
import { Facteur } from "@facteurjs/core";
|
|
4
4
|
import { HttpRouterService } from "@adonisjs/core/types";
|
|
5
5
|
|
|
@@ -7,7 +7,12 @@ import { HttpRouterService } from "@adonisjs/core/types";
|
|
|
7
7
|
declare class NotificationManager<KnownChannels extends Record<string, types_d_exports.Channel>, DBAdapter extends DatabaseAdapter | null = null> extends Facteur<KnownChannels, DBAdapter> {
|
|
8
8
|
#private;
|
|
9
9
|
constructor(config: types_d_exports.FacteurConfiguration<KnownChannels, DBAdapter>, router: HttpRouterService);
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Register the notification API routes
|
|
12
|
+
*/
|
|
13
|
+
registerRoutes(options: {
|
|
14
|
+
authorize: AdonisAuthorizationCallback;
|
|
15
|
+
}): void;
|
|
11
16
|
}
|
|
12
17
|
//#endregion
|
|
13
18
|
export { NotificationManager };
|
package/dist/manager.mjs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AdonisServerAdapter } from "./server/adapter.mjs";
|
|
2
|
+
import { Facteur } from "@facteurjs/core";
|
|
3
|
+
import { createFacteurServer } from "@facteurjs/core/api";
|
|
4
|
+
|
|
5
|
+
//#region src/manager.ts
|
|
6
|
+
var NotificationManager = class extends Facteur {
|
|
7
|
+
#serverAdapter;
|
|
8
|
+
constructor(config, router) {
|
|
9
|
+
super(config);
|
|
10
|
+
this.#serverAdapter = new AdonisServerAdapter(router);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Register the notification API routes
|
|
14
|
+
*/
|
|
15
|
+
registerRoutes(options) {
|
|
16
|
+
return createFacteurServer({
|
|
17
|
+
facteur: this,
|
|
18
|
+
adapter: this.#serverAdapter,
|
|
19
|
+
authorize: (context) => {
|
|
20
|
+
const ctx = context.request.context;
|
|
21
|
+
return options.authorize({
|
|
22
|
+
notifiableId: context.notifiableId,
|
|
23
|
+
tenantId: context.tenantId,
|
|
24
|
+
ctx
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { NotificationManager };
|
|
@@ -7,14 +7,15 @@ var AdonisServerAdapter = class {
|
|
|
7
7
|
for (const route of routes) {
|
|
8
8
|
const pattern = route.route;
|
|
9
9
|
const method = route.method.toUpperCase();
|
|
10
|
-
this.router.route(pattern, [method], async (
|
|
10
|
+
this.router.route(pattern, [method], async (ctx) => {
|
|
11
11
|
const result = await route.handler({
|
|
12
|
-
body: request.body(),
|
|
13
|
-
params: request.params(),
|
|
14
|
-
query: request.qs(),
|
|
15
|
-
headers: request.headers()
|
|
12
|
+
body: ctx.request.body(),
|
|
13
|
+
params: ctx.request.params(),
|
|
14
|
+
query: ctx.request.qs(),
|
|
15
|
+
headers: ctx.request.headers(),
|
|
16
|
+
context: ctx
|
|
16
17
|
});
|
|
17
|
-
return response.status(result.status).send(result.body);
|
|
18
|
+
return ctx.response.status(result.status).send(result.body);
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { types_d_exports } from "../types.
|
|
2
|
-
import { NotificationManager } from "../manager.
|
|
1
|
+
import { types_d_exports } from "../types.mjs";
|
|
2
|
+
import { NotificationManager } from "../manager.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/services/main.d.ts
|
|
5
5
|
declare let facteur: NotificationManager<types_d_exports.NotificationChannels, null>;
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { __exportAll, __reExport } from "./_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { Identifier } from "@facteurjs/core/database/types";
|
|
3
|
+
import { ConfigProvider } from "@adonisjs/core/types";
|
|
4
|
+
import { HttpContext } from "@adonisjs/core/http";
|
|
5
|
+
export * from "@facteurjs/core/types";
|
|
6
|
+
|
|
7
|
+
//#region src/types.d.ts
|
|
8
|
+
declare namespace types_d_exports {
|
|
9
|
+
export { AdonisAuthorizationCallback, AdonisAuthorizationContext, InferChannels };
|
|
10
|
+
}
|
|
11
|
+
import * as import__facteurjs_core_types from "@facteurjs/core/types";
|
|
12
|
+
type InferChannels<T> = T extends {
|
|
13
|
+
channels: infer Channels;
|
|
14
|
+
} ? { [K in keyof Channels]: Channels[K] extends ConfigProvider<infer P> ? P : never } : never;
|
|
15
|
+
/**
|
|
16
|
+
* Context passed to the AdonisJS authorization callback.
|
|
17
|
+
* Includes the full HttpContext for accessing auth, session, etc.
|
|
18
|
+
*/
|
|
19
|
+
interface AdonisAuthorizationContext {
|
|
20
|
+
notifiableId: Identifier;
|
|
21
|
+
tenantId: Identifier | undefined;
|
|
22
|
+
ctx: HttpContext;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Authorization callback for AdonisJS.
|
|
26
|
+
* Use `ctx.auth.user` to get the authenticated user.
|
|
27
|
+
*/
|
|
28
|
+
type AdonisAuthorizationCallback = (context: AdonisAuthorizationContext) => Promise<boolean> | boolean;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { AdonisAuthorizationCallback, AdonisAuthorizationContext, InferChannels, types_d_exports };
|
package/dist/types.mjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { __reExport } from "./_virtual/rolldown_runtime.mjs";
|
|
2
|
+
|
|
3
|
+
export * from "@facteurjs/core/types"
|
|
4
|
+
|
|
5
|
+
//#region src/types.ts
|
|
6
|
+
var types_exports = {};
|
|
7
|
+
import * as import__facteurjs_core_types from "@facteurjs/core/types";
|
|
8
|
+
__reExport(types_exports, import__facteurjs_core_types);
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
export { types_exports };
|
package/package.json
CHANGED
|
@@ -1,43 +1,70 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@facteurjs/adonisjs",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "2.0.0-beta.0",
|
|
4
|
+
"description": "AdonisJS integration for Facteur - Send notifications via multiple channels in your AdonisJS application",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"adonis",
|
|
7
|
+
"adonisjs",
|
|
8
|
+
"email",
|
|
9
|
+
"notification-system",
|
|
10
|
+
"notifications",
|
|
11
|
+
"push-notifications",
|
|
12
|
+
"sms",
|
|
13
|
+
"webhooks"
|
|
14
|
+
],
|
|
7
15
|
"license": "MIT",
|
|
8
|
-
"
|
|
16
|
+
"author": "Julien Ripouteau <julien@ripouteau.com>",
|
|
9
17
|
"files": [
|
|
10
18
|
"dist"
|
|
11
19
|
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "./dist/index.mjs",
|
|
22
|
+
"module": "./dist/index.mjs",
|
|
23
|
+
"types": "./dist/index.d.mts",
|
|
12
24
|
"exports": {
|
|
13
|
-
".": "./dist/index.
|
|
14
|
-
"./channels/aws-sns": "./dist/channels/aws-sns.
|
|
15
|
-
"./channels/database": "./dist/channels/database.
|
|
16
|
-
"./channels/discord": "./dist/channels/discord.
|
|
17
|
-
"./channels/expo": "./dist/channels/expo.
|
|
18
|
-
"./channels/fcm": "./dist/channels/fcm.
|
|
19
|
-
"./channels/slack": "./dist/channels/slack.
|
|
20
|
-
"./channels/socketio": "./dist/channels/socketio.
|
|
21
|
-
"./channels/transmit": "./dist/channels/transmit.
|
|
22
|
-
"./channels/twilio": "./dist/channels/twilio.
|
|
23
|
-
"./channels/webhook": "./dist/channels/webhook.
|
|
24
|
-
"./channels/webpush": "./dist/channels/webpush.
|
|
25
|
-
"./database": "./dist/database
|
|
26
|
-
"./
|
|
27
|
-
"./services/main": "./dist/services/main.
|
|
28
|
-
"./types": "./dist/types.
|
|
29
|
-
"./package.json": "./package.json"
|
|
30
|
-
|
|
25
|
+
".": "./dist/index.mjs",
|
|
26
|
+
"./channels/aws-sns": "./dist/channels/aws-sns.mjs",
|
|
27
|
+
"./channels/database": "./dist/channels/database.mjs",
|
|
28
|
+
"./channels/discord": "./dist/channels/discord.mjs",
|
|
29
|
+
"./channels/expo": "./dist/channels/expo.mjs",
|
|
30
|
+
"./channels/fcm": "./dist/channels/fcm.mjs",
|
|
31
|
+
"./channels/slack": "./dist/channels/slack.mjs",
|
|
32
|
+
"./channels/socketio": "./dist/channels/socketio.mjs",
|
|
33
|
+
"./channels/transmit": "./dist/channels/transmit.mjs",
|
|
34
|
+
"./channels/twilio": "./dist/channels/twilio.mjs",
|
|
35
|
+
"./channels/webhook": "./dist/channels/webhook.mjs",
|
|
36
|
+
"./channels/webpush": "./dist/channels/webpush.mjs",
|
|
37
|
+
"./database": "./dist/database.mjs",
|
|
38
|
+
"./facteur_provider": "./dist/facteur_provider.mjs",
|
|
39
|
+
"./services/main": "./dist/services/main.mjs",
|
|
40
|
+
"./types": "./dist/types.mjs",
|
|
41
|
+
"./package.json": "./package.json"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@julr/utils": "1.9.0",
|
|
48
|
+
"@poppinss/exception": "^1.2.3",
|
|
49
|
+
"@facteurjs/core": "2.0.0-beta.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@adonisjs/core": "^7.0.0-next.23",
|
|
53
|
+
"@adonisjs/tsconfig": "2.0.0-next.3",
|
|
54
|
+
"@adonisjs/lucid": "^22.0.0-next.5",
|
|
55
|
+
"@adonisjs/mail": "^10.0.0-next.1",
|
|
56
|
+
"@adonisjs/redis": "^10.0.0-next.2",
|
|
57
|
+
"@adonisjs/transmit": "^2.0.0-1"
|
|
31
58
|
},
|
|
32
|
-
"main": "./dist/index.js",
|
|
33
|
-
"module": "./dist/index.js",
|
|
34
|
-
"types": "./dist/index.d.ts",
|
|
35
59
|
"peerDependencies": {
|
|
36
|
-
"@adonisjs/core": "^
|
|
37
|
-
"@adonisjs/lucid": "^
|
|
38
|
-
"@adonisjs/mail": "^
|
|
39
|
-
"@adonisjs/redis": "^
|
|
40
|
-
"@adonisjs/transmit": "^2.0.
|
|
60
|
+
"@adonisjs/core": "^7.0.0-next.23",
|
|
61
|
+
"@adonisjs/lucid": "^22.0.0-next.5",
|
|
62
|
+
"@adonisjs/mail": "^10.0.0-next.1",
|
|
63
|
+
"@adonisjs/redis": "^10.0.0-next.2",
|
|
64
|
+
"@adonisjs/transmit": "^2.0.0-1"
|
|
65
|
+
},
|
|
66
|
+
"engines": {
|
|
67
|
+
"node": ">=22.0.0"
|
|
41
68
|
},
|
|
42
69
|
"peerDependenciesMeta": {
|
|
43
70
|
"@adonisjs/lucid": {
|
|
@@ -53,22 +80,6 @@
|
|
|
53
80
|
"optional": true
|
|
54
81
|
}
|
|
55
82
|
},
|
|
56
|
-
"dependencies": {
|
|
57
|
-
"@julr/utils": "1.9.0",
|
|
58
|
-
"@poppinss/exception": "^1.2.2",
|
|
59
|
-
"@facteurjs/core": "1.0.0-beta.3"
|
|
60
|
-
},
|
|
61
|
-
"devDependencies": {
|
|
62
|
-
"@adonisjs/core": "^6.19.0",
|
|
63
|
-
"@adonisjs/lucid": "^21.8.0",
|
|
64
|
-
"@adonisjs/mail": "^9.2.2",
|
|
65
|
-
"@adonisjs/redis": "^9.2.0",
|
|
66
|
-
"@adonisjs/transmit": "^2.0.2",
|
|
67
|
-
"p-event": "^6.0.1"
|
|
68
|
-
},
|
|
69
|
-
"publishConfig": {
|
|
70
|
-
"access": "public"
|
|
71
|
-
},
|
|
72
83
|
"scripts": {
|
|
73
84
|
"build": "tsdown",
|
|
74
85
|
"stub": "tsdown",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all) __defProp(target, name, {
|
|
8
|
-
get: all[name],
|
|
9
|
-
enumerable: true
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
14
|
-
key = keys[i];
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
16
|
-
get: ((k) => from[k]).bind(null, key),
|
|
17
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
export { __export, __reExport };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "@facteurjs/core/channels/aws-sns";
|
|
2
|
-
export * from "@facteurjs/core/channels/aws-sns/types";
|
|
3
|
-
|
|
4
|
-
//#region src/channels/aws-sns.d.ts
|
|
5
|
-
|
|
6
|
-
import * as import___facteurjs_core_channels_aws_sns from "@facteurjs/core/channels/aws-sns";
|
|
7
|
-
__reExport(aws_sns_d_exports, import___facteurjs_core_channels_aws_sns);
|
|
8
|
-
import * as import___facteurjs_core_channels_aws_sns_types from "@facteurjs/core/channels/aws-sns/types";
|
|
9
|
-
__reExport(aws_sns_d_exports, import___facteurjs_core_channels_aws_sns_types);
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
export { aws_sns_d_exports };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "@facteurjs/core/database";
|
|
2
|
-
export * from "@facteurjs/core/database/types";
|
|
3
|
-
|
|
4
|
-
//#region src/channels/database.d.ts
|
|
5
|
-
|
|
6
|
-
import * as import___facteurjs_core_database from "@facteurjs/core/database";
|
|
7
|
-
__reExport(database_d_exports, import___facteurjs_core_database);
|
|
8
|
-
import * as import___facteurjs_core_database_types from "@facteurjs/core/database/types";
|
|
9
|
-
__reExport(database_d_exports, import___facteurjs_core_database_types);
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
export { database_d_exports };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "@facteurjs/core/channels/discord";
|
|
2
|
-
export * from "@facteurjs/core/channels/discord/types";
|
|
3
|
-
|
|
4
|
-
//#region src/channels/discord.d.ts
|
|
5
|
-
|
|
6
|
-
import * as import___facteurjs_core_channels_discord from "@facteurjs/core/channels/discord";
|
|
7
|
-
__reExport(discord_d_exports, import___facteurjs_core_channels_discord);
|
|
8
|
-
import * as import___facteurjs_core_channels_discord_types from "@facteurjs/core/channels/discord/types";
|
|
9
|
-
__reExport(discord_d_exports, import___facteurjs_core_channels_discord_types);
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
export { discord_d_exports };
|
package/dist/channels/fcm.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "@facteurjs/core/channels/fcm";
|
|
2
|
-
export * from "@facteurjs/core/channels/fcm/types";
|
|
3
|
-
|
|
4
|
-
//#region src/channels/fcm.d.ts
|
|
5
|
-
|
|
6
|
-
import * as import___facteurjs_core_channels_fcm from "@facteurjs/core/channels/fcm";
|
|
7
|
-
__reExport(fcm_d_exports, import___facteurjs_core_channels_fcm);
|
|
8
|
-
import * as import___facteurjs_core_channels_fcm_types from "@facteurjs/core/channels/fcm/types";
|
|
9
|
-
__reExport(fcm_d_exports, import___facteurjs_core_channels_fcm_types);
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
export { fcm_d_exports };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "@facteurjs/core/channels/socketio";
|
|
2
|
-
export * from "@facteurjs/core/channels/socketio/types";
|
|
3
|
-
|
|
4
|
-
//#region src/channels/socketio.d.ts
|
|
5
|
-
|
|
6
|
-
import * as import___facteurjs_core_channels_socketio from "@facteurjs/core/channels/socketio";
|
|
7
|
-
__reExport(socketio_d_exports, import___facteurjs_core_channels_socketio);
|
|
8
|
-
import * as import___facteurjs_core_channels_socketio_types from "@facteurjs/core/channels/socketio/types";
|
|
9
|
-
__reExport(socketio_d_exports, import___facteurjs_core_channels_socketio_types);
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
export { socketio_d_exports };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "@facteurjs/core/channels/transmit";
|
|
2
|
-
export * from "@facteurjs/core/channels/transmit/types";
|
|
3
|
-
|
|
4
|
-
//#region src/channels/transmit.d.ts
|
|
5
|
-
|
|
6
|
-
import * as import___facteurjs_core_channels_transmit from "@facteurjs/core/channels/transmit";
|
|
7
|
-
__reExport(transmit_d_exports, import___facteurjs_core_channels_transmit);
|
|
8
|
-
import * as import___facteurjs_core_channels_transmit_types from "@facteurjs/core/channels/transmit/types";
|
|
9
|
-
__reExport(transmit_d_exports, import___facteurjs_core_channels_transmit_types);
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
export { transmit_d_exports };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "@facteurjs/core/channels/twilio";
|
|
2
|
-
export * from "@facteurjs/core/channels/twilio/types";
|
|
3
|
-
|
|
4
|
-
//#region src/channels/twilio.d.ts
|
|
5
|
-
|
|
6
|
-
import * as import___facteurjs_core_channels_twilio from "@facteurjs/core/channels/twilio";
|
|
7
|
-
__reExport(twilio_d_exports, import___facteurjs_core_channels_twilio);
|
|
8
|
-
import * as import___facteurjs_core_channels_twilio_types from "@facteurjs/core/channels/twilio/types";
|
|
9
|
-
__reExport(twilio_d_exports, import___facteurjs_core_channels_twilio_types);
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
export { twilio_d_exports };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "@facteurjs/core/channels/webpush";
|
|
2
|
-
export * from "@facteurjs/core/channels/webpush/types";
|
|
3
|
-
|
|
4
|
-
//#region src/channels/webpush.d.ts
|
|
5
|
-
|
|
6
|
-
import * as import___facteurjs_core_channels_webpush from "@facteurjs/core/channels/webpush";
|
|
7
|
-
__reExport(webpush_d_exports, import___facteurjs_core_channels_webpush);
|
|
8
|
-
import * as import___facteurjs_core_channels_webpush_types from "@facteurjs/core/channels/webpush/types";
|
|
9
|
-
__reExport(webpush_d_exports, import___facteurjs_core_channels_webpush_types);
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
export { webpush_d_exports };
|