appos 0.2.1-0 → 0.2.2-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/dist/bin/auth-schema-7KeUwlcd.mjs +2 -0
- package/dist/bin/concurrently.mjs +2 -0
- package/dist/bin/event-v2sCJkNd.mjs +2 -0
- package/dist/bin/extract-blob-metadata-TqNd9w-6.mjs +2 -0
- package/dist/bin/generate-image-variant-D8H9FxgD.mjs +2 -0
- package/dist/bin/generate-preview-5jLZLX6I.mjs +2 -0
- package/dist/bin/main.mjs +362 -0
- package/dist/bin/purge-attachment-CMlJMNOk.mjs +2 -0
- package/dist/bin/purge-audit-logs-hd6q6vnR.mjs +2 -0
- package/dist/bin/purge-unattached-blobs-BYv5b9R9.mjs +2 -0
- package/dist/bin/track-db-changes-q0Vl7Htm.mjs +2 -0
- package/dist/bin/vite.mjs +2 -0
- package/dist/bin/vitest.mjs +2 -0
- package/dist/bin/workflow-BagSlsMp.mjs +2 -0
- package/dist/bin/youch-handler-Jj6i1XIT.mjs +2 -0
- package/dist/exports/api/_virtual/rolldown_runtime.mjs +1 -0
- package/dist/exports/api/app-context.d.mts +115 -0
- package/dist/exports/api/app-context.mjs +1 -0
- package/dist/exports/api/auth-schema.d.mts +4248 -0
- package/dist/exports/api/auth-schema.mjs +1 -0
- package/dist/exports/api/auth.d.mts +398 -0
- package/dist/exports/api/auth.mjs +1 -0
- package/dist/exports/api/cache.d.mts +44 -0
- package/dist/exports/api/cache.mjs +1 -0
- package/dist/exports/api/config.d.mts +28 -0
- package/dist/exports/api/config.mjs +1 -0
- package/dist/exports/api/container.d.mts +210 -0
- package/dist/exports/api/container.mjs +1 -0
- package/dist/exports/api/database.d.mts +99 -0
- package/dist/exports/api/database.mjs +1 -0
- package/dist/exports/api/event.d.mts +235 -0
- package/dist/exports/api/event.mjs +1 -0
- package/dist/exports/api/i18n.d.mts +34 -0
- package/dist/exports/api/i18n.mjs +1 -0
- package/dist/exports/api/index.d.mts +21 -0
- package/dist/exports/api/index.mjs +1 -0
- package/dist/exports/api/logger.d.mts +21 -0
- package/dist/exports/api/logger.mjs +1 -0
- package/dist/exports/api/mailer.d.mts +70 -0
- package/dist/exports/api/mailer.mjs +1 -0
- package/dist/exports/api/middleware/request-logger.d.mts +24 -0
- package/dist/exports/api/middleware.d.mts +39 -0
- package/dist/exports/api/middleware.mjs +1 -0
- package/dist/exports/api/node_modules/.bun/change-case@5.4.4/node_modules/change-case/dist/index.mjs +1 -0
- package/dist/exports/api/openapi.d.mts +271 -0
- package/dist/exports/api/openapi.mjs +1 -0
- package/dist/exports/api/orm.d.mts +13 -0
- package/dist/exports/api/orm.mjs +1 -0
- package/dist/exports/api/otel.d.mts +40 -0
- package/dist/exports/api/otel.mjs +1 -0
- package/dist/exports/api/packages/appos/src/constants.mjs +1 -0
- package/dist/exports/api/packages/appos/src/instrumentation.d.mts +7 -0
- package/dist/exports/api/packages/appos/src/instrumentation.mjs +1 -0
- package/dist/exports/api/packages/appos/src/web/auth.mjs +1 -0
- package/dist/exports/api/redis.d.mts +34 -0
- package/dist/exports/api/redis.mjs +1 -0
- package/dist/exports/api/storage-schema.d.mts +707 -0
- package/dist/exports/api/storage-schema.mjs +1 -0
- package/dist/exports/api/storage.d.mts +506 -0
- package/dist/exports/api/storage.mjs +1 -0
- package/dist/exports/api/workflow.d.mts +250 -0
- package/dist/exports/api/workflow.mjs +1 -0
- package/dist/exports/api/workflows/_virtual/rolldown_runtime.mjs +1 -0
- package/dist/exports/api/workflows/auth-schema.mjs +1 -0
- package/dist/exports/api/workflows/auth.d.mts +375 -0
- package/dist/exports/api/workflows/cache.d.mts +44 -0
- package/dist/exports/api/workflows/config.d.mts +18 -0
- package/dist/exports/api/workflows/container.d.mts +167 -0
- package/dist/exports/api/workflows/database.d.mts +46 -0
- package/dist/exports/api/workflows/event.d.mts +68 -0
- package/dist/exports/api/workflows/event.mjs +1 -0
- package/dist/exports/api/workflows/extract-blob-metadata.mjs +1 -0
- package/dist/exports/api/workflows/generate-image-variant.d.mts +99 -0
- package/dist/exports/api/workflows/generate-image-variant.mjs +1 -0
- package/dist/exports/api/workflows/generate-preview.mjs +1 -0
- package/dist/exports/api/workflows/index.d.mts +2 -0
- package/dist/exports/api/workflows/index.mjs +1 -0
- package/dist/exports/api/workflows/logger.d.mts +21 -0
- package/dist/exports/api/workflows/mailer.d.mts +70 -0
- package/dist/exports/api/workflows/orm.d.mts +13 -0
- package/dist/exports/api/workflows/purge-attachment.mjs +1 -0
- package/dist/exports/api/workflows/purge-audit-logs.mjs +1 -0
- package/dist/exports/api/workflows/purge-unattached-blobs.mjs +1 -0
- package/dist/exports/api/workflows/redis.mjs +1 -0
- package/dist/exports/api/workflows/storage-schema.d.mts +699 -0
- package/dist/exports/api/workflows/storage.d.mts +396 -0
- package/dist/exports/api/workflows/track-db-changes.d.mts +72 -0
- package/dist/exports/api/workflows/track-db-changes.mjs +1 -0
- package/dist/exports/api/workflows/workflow.d.mts +24 -0
- package/dist/exports/api/workflows/workflow.mjs +1 -0
- package/dist/exports/cli/_virtual/rolldown_runtime.mjs +1 -0
- package/dist/exports/cli/api/auth-schema.mjs +1 -0
- package/dist/exports/cli/api/auth.d.mts +375 -0
- package/dist/exports/cli/api/cache.d.mts +44 -0
- package/dist/exports/cli/api/config.d.mts +18 -0
- package/dist/exports/cli/api/container.d.mts +167 -0
- package/dist/exports/cli/api/database.d.mts +46 -0
- package/dist/exports/cli/api/event.d.mts +68 -0
- package/dist/exports/cli/api/event.mjs +1 -0
- package/dist/exports/cli/api/logger.d.mts +21 -0
- package/dist/exports/cli/api/mailer.d.mts +70 -0
- package/dist/exports/cli/api/orm.d.mts +13 -0
- package/dist/exports/cli/api/redis.mjs +1 -0
- package/dist/exports/cli/api/storage-schema.d.mts +699 -0
- package/dist/exports/cli/api/storage.d.mts +396 -0
- package/dist/exports/cli/api/workflow.d.mts +2 -0
- package/dist/exports/cli/api/workflow.mjs +1 -0
- package/dist/exports/cli/api/workflows/extract-blob-metadata.mjs +1 -0
- package/dist/exports/cli/api/workflows/generate-image-variant.d.mts +63 -0
- package/dist/exports/cli/api/workflows/generate-image-variant.mjs +1 -0
- package/dist/exports/cli/api/workflows/generate-preview.mjs +1 -0
- package/dist/exports/cli/api/workflows/purge-attachment.mjs +1 -0
- package/dist/exports/cli/api/workflows/purge-audit-logs.mjs +1 -0
- package/dist/exports/cli/api/workflows/purge-unattached-blobs.mjs +1 -0
- package/dist/exports/cli/api/workflows/track-db-changes.mjs +1 -0
- package/dist/exports/cli/command.d.mts +54 -0
- package/dist/exports/cli/command.mjs +1 -0
- package/dist/exports/cli/context.d.mts +170 -0
- package/dist/exports/cli/index.d.mts +3 -0
- package/dist/exports/cli/index.mjs +1 -0
- package/dist/exports/devtools/index.d.ts +3 -0
- package/dist/exports/devtools/index.js +1 -0
- package/dist/exports/instrumentation.d.mts +1 -0
- package/dist/exports/instrumentation.mjs +1 -0
- package/dist/exports/tests/_virtual/rolldown_runtime.mjs +1 -0
- package/dist/exports/tests/api.d.mts +86 -0
- package/dist/exports/tests/api.mjs +1 -0
- package/dist/exports/tests/mock.d.mts +1 -0
- package/dist/exports/tests/mock.mjs +1 -0
- package/dist/exports/tests/node_modules/.bun/change-case@5.4.4/node_modules/change-case/dist/index.mjs +1 -0
- package/dist/exports/tests/node_modules/.bun/rate-limit-redis@4.3.1_f1fa5524233c9c60/node_modules/rate-limit-redis/dist/index.mjs +25 -0
- package/dist/exports/tests/packages/appos/src/api/app-context.d.mts +115 -0
- package/dist/exports/tests/packages/appos/src/api/auth-schema.d.mts +4248 -0
- package/dist/exports/tests/packages/appos/src/api/auth-schema.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/auth.d.mts +398 -0
- package/dist/exports/tests/packages/appos/src/api/cache.d.mts +44 -0
- package/dist/exports/tests/packages/appos/src/api/config.d.mts +28 -0
- package/dist/exports/tests/packages/appos/src/api/container.d.mts +210 -0
- package/dist/exports/tests/packages/appos/src/api/database.d.mts +99 -0
- package/dist/exports/tests/packages/appos/src/api/database.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/event.d.mts +235 -0
- package/dist/exports/tests/packages/appos/src/api/event.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/i18n.d.mts +34 -0
- package/dist/exports/tests/packages/appos/src/api/index.d.mts +27 -0
- package/dist/exports/tests/packages/appos/src/api/logger.d.mts +21 -0
- package/dist/exports/tests/packages/appos/src/api/mailer.d.mts +70 -0
- package/dist/exports/tests/packages/appos/src/api/middleware/error-handler.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/middleware/health.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/middleware/i18n.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/middleware/request-logger.d.mts +24 -0
- package/dist/exports/tests/packages/appos/src/api/middleware/request-logger.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/middleware/shutdown.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/middleware/timeout.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/middleware/youch-handler.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/middleware.d.mts +39 -0
- package/dist/exports/tests/packages/appos/src/api/middleware.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/openapi.d.mts +271 -0
- package/dist/exports/tests/packages/appos/src/api/orm.d.mts +13 -0
- package/dist/exports/tests/packages/appos/src/api/otel.d.mts +40 -0
- package/dist/exports/tests/packages/appos/src/api/redis.d.mts +34 -0
- package/dist/exports/tests/packages/appos/src/api/redis.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/server.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/storage-schema.d.mts +707 -0
- package/dist/exports/tests/packages/appos/src/api/storage.d.mts +506 -0
- package/dist/exports/tests/packages/appos/src/api/workflow.d.mts +250 -0
- package/dist/exports/tests/packages/appos/src/api/workflow.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/workflows/extract-blob-metadata.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/workflows/generate-image-variant.d.mts +99 -0
- package/dist/exports/tests/packages/appos/src/api/workflows/generate-image-variant.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/workflows/generate-preview.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/workflows/purge-attachment.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/workflows/purge-audit-logs.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/workflows/purge-unattached-blobs.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/api/workflows/track-db-changes.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/constants.mjs +1 -0
- package/dist/exports/tests/packages/appos/src/instrumentation.d.mts +7 -0
- package/dist/exports/tests/packages/appos/src/instrumentation.mjs +1 -0
- package/dist/exports/tests/react.d.mts +2 -0
- package/dist/exports/tests/react.mjs +1 -0
- package/dist/exports/tests/setup.d.mts +1 -0
- package/dist/exports/tests/setup.mjs +1 -0
- package/dist/exports/vendors/date.js +1 -0
- package/dist/exports/vendors/toolkit.js +1 -0
- package/dist/exports/vendors/zod.d.ts +1 -0
- package/dist/exports/vendors/zod.js +1 -0
- package/dist/exports/vite/index.d.mts +19 -0
- package/dist/exports/vite/index.mjs +1 -0
- package/dist/exports/vitest/config.d.mts +1 -0
- package/dist/exports/vitest/config.mjs +1 -0
- package/dist/exports/vitest/globals.d.mts +1 -0
- package/dist/exports/vitest/globals.mjs +1 -0
- package/dist/exports/vitest/index.d.mts +1 -0
- package/dist/exports/vitest/index.mjs +1 -0
- package/dist/exports/web/api/auth.d.ts +125 -0
- package/dist/exports/web/api/database.d.ts +4 -0
- package/dist/exports/web/api/logger.d.ts +1 -0
- package/dist/exports/web/auth.d.ts +2388 -0
- package/dist/exports/web/auth.js +1 -0
- package/dist/exports/web/i18n.d.ts +42 -0
- package/dist/exports/web/i18n.js +1 -0
- package/dist/exports/web/index.d.ts +6 -0
- package/dist/exports/web/index.js +1 -0
- package/package.json +138 -98
- package/build/bin/main.mjs +0 -2
- package/build/exports/cli/index.d.mts +0 -325
- package/build/exports/cli/index.mjs +0 -1
- package/build/exports/instrumentation/execAsync-DaIUcs6_.mjs +0 -1
- package/build/exports/instrumentation/getMachineId-bsd-bB6ipDhm.mjs +0 -1
- package/build/exports/instrumentation/getMachineId-darwin-D1Bx5aCe.mjs +0 -2
- package/build/exports/instrumentation/getMachineId-linux-D_R9Tla0.mjs +0 -1
- package/build/exports/instrumentation/getMachineId-unsupported-BZKPE_Ev.mjs +0 -1
- package/build/exports/instrumentation/getMachineId-win-CmPvIqHL.mjs +0 -1
- package/build/exports/instrumentation/instrumentation.d.mts +0 -1
- package/build/exports/instrumentation/instrumentation.mjs +0 -80
- package/build/exports/server/index.d.mts +0 -327
- package/build/exports/server/index.mjs +0 -219
- package/build/exports/server/react-gPO8Jsy-.mjs +0 -13
- package/build/exports/server/server.node-D_9RYjm9.mjs +0 -210
- package/build/exports/store/index.d.mts +0 -58
- package/build/exports/store/index.mjs +0 -15
- package/build/exports/support/datetime.js +0 -1
- package/build/exports/support/utils.js +0 -1
- package/build/exports/support/zod.d.ts +0 -2
- package/build/exports/support/zod.js +0 -23
- package/build/exports/test/dist-DAsoCGWk.mjs +0 -348
- package/build/exports/test/index.d.mts +0 -3
- package/build/exports/test/index.mjs +0 -1
- package/build/exports/test/magic-string.es-BWgiB2kd.mjs +0 -14
- package/build/exports/test/setup.d.mts +0 -1
- package/build/exports/test/setup.mjs +0 -329
- /package/{build/exports/support/datetime.d.ts → dist/exports/vendors/date.d.ts} +0 -0
- /package/{build/exports/support/utils.d.ts → dist/exports/vendors/toolkit.d.ts} +0 -0
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
import { CustomTypeOptions, InitOptions, InitOptions as InitI18nOptions, i18n, i18n as i18n$1 } from "i18next";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import pino, { LoggerOptions } from "pino";
|
|
4
|
-
import * as nodemailer_lib_dkim0 from "nodemailer/lib/dkim";
|
|
5
|
-
import * as nodemailer_lib_smtp_transport0 from "nodemailer/lib/smtp-transport";
|
|
6
|
-
import * as nodemailer0 from "nodemailer";
|
|
7
|
-
import * as nodemailer_lib_shared0 from "nodemailer/lib/shared";
|
|
8
|
-
import * as nodemailer_lib_mailer_mail_message0 from "nodemailer/lib/mailer/mail-message";
|
|
9
|
-
import Mail from "nodemailer/lib/mailer/index.ts";
|
|
10
|
-
import { JSX } from "react";
|
|
11
|
-
import * as _keyv_redis0 from "@keyv/redis";
|
|
12
|
-
import { KeyvRedisOptions, RedisClientOptions, RedisClientType } from "@keyv/redis";
|
|
13
|
-
import * as drizzle_orm_node_postgres0 from "drizzle-orm/node-postgres";
|
|
14
|
-
import { AnyRelations, EmptyRelations } from "drizzle-orm";
|
|
15
|
-
import { Pool, PoolConfig } from "pg";
|
|
16
|
-
import { Span } from "@opentelemetry/api";
|
|
17
|
-
|
|
18
|
-
//#region src/server/config.d.ts
|
|
19
|
-
/**
|
|
20
|
-
* The config base schema.
|
|
21
|
-
*/
|
|
22
|
-
declare const baseSchema: z.ZodObject<{
|
|
23
|
-
APP_NAME: z.ZodDefault<z.ZodString>;
|
|
24
|
-
APP_DESC: z.ZodDefault<z.ZodString>;
|
|
25
|
-
}, z.core.$strip>;
|
|
26
|
-
/**
|
|
27
|
-
* Creates a configuration object by merging base config with user-defined schema.
|
|
28
|
-
*
|
|
29
|
-
* Variables in default values are expanded after defaults are applied.
|
|
30
|
-
* For example: `DATABASE_URL: z.string().default("postgres://{{DB_HOST}}:5432")`
|
|
31
|
-
*
|
|
32
|
-
* @param userSchema User-defined Zod schema to merge with base config.
|
|
33
|
-
* @returns Parsed and validated configuration object.
|
|
34
|
-
*/
|
|
35
|
-
declare function defineConfig<T extends z.ZodRawShape = {}>(userSchema: z.ZodObject<T>): Config<T>;
|
|
36
|
-
/**
|
|
37
|
-
* The configuration type inferred from the merged schema.
|
|
38
|
-
*/
|
|
39
|
-
type Config<T extends z.ZodRawShape = {}> = z.infer<ReturnType<typeof baseSchema.extend<T>>>;
|
|
40
|
-
//#endregion
|
|
41
|
-
//#region src/server/logger.d.ts
|
|
42
|
-
/**
|
|
43
|
-
* Extended logger options with OpenTelemetry support.
|
|
44
|
-
*/
|
|
45
|
-
interface DefineLoggerOptions extends LoggerOptions {}
|
|
46
|
-
/**
|
|
47
|
-
* The logger instance type.
|
|
48
|
-
*/
|
|
49
|
-
type Logger = Awaited<ReturnType<typeof defineLogger>>;
|
|
50
|
-
/**
|
|
51
|
-
* Define the logger instance.
|
|
52
|
-
*
|
|
53
|
-
* @param opts - The options.
|
|
54
|
-
* @returns The logger.
|
|
55
|
-
*/
|
|
56
|
-
declare function defineLogger(opts: DefineLoggerOptions): Promise<pino.Logger<never, boolean>>;
|
|
57
|
-
//#endregion
|
|
58
|
-
//#region src/server/mailer.d.ts
|
|
59
|
-
/**
|
|
60
|
-
* The mailer type.
|
|
61
|
-
*/
|
|
62
|
-
type Mailer = ReturnType<typeof defineMailer>;
|
|
63
|
-
/**
|
|
64
|
-
* The mailer payload type with React component.
|
|
65
|
-
*/
|
|
66
|
-
type MailerPayloadReact = Omit<Mail.Options, "from" | "html" | "text"> & {
|
|
67
|
-
/**
|
|
68
|
-
* The email address to send the email from.
|
|
69
|
-
*/
|
|
70
|
-
from?: string;
|
|
71
|
-
/**
|
|
72
|
-
* The React component to render as the email body.
|
|
73
|
-
*/
|
|
74
|
-
react: JSX.Element;
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* The mailer payload type with direct HTML and text.
|
|
78
|
-
*/
|
|
79
|
-
type MailerPayloadHtml = Omit<Mail.Options, "from"> & {
|
|
80
|
-
/**
|
|
81
|
-
* The email address to send the email from.
|
|
82
|
-
*/
|
|
83
|
-
from?: string;
|
|
84
|
-
/**
|
|
85
|
-
* The HTML content of the email.
|
|
86
|
-
*/
|
|
87
|
-
html: string;
|
|
88
|
-
/**
|
|
89
|
-
* The plain text content of the email.
|
|
90
|
-
*/
|
|
91
|
-
text: string;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* The mailer payload type - supports either React component or direct HTML+text.
|
|
95
|
-
*/
|
|
96
|
-
type MailerPayload = MailerPayloadReact | MailerPayloadHtml;
|
|
97
|
-
/**
|
|
98
|
-
* Define the options for the mailer.
|
|
99
|
-
*/
|
|
100
|
-
interface DefineMailerOptions {
|
|
101
|
-
/**
|
|
102
|
-
* The default email address to use as the sender.
|
|
103
|
-
*/
|
|
104
|
-
from: string;
|
|
105
|
-
/**
|
|
106
|
-
* The SMTP URL to use for sending emails.
|
|
107
|
-
*/
|
|
108
|
-
smtpUrl: string;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Define the mailer.
|
|
112
|
-
*
|
|
113
|
-
* @param env - The environment variables.
|
|
114
|
-
* @returns The mailer.
|
|
115
|
-
*/
|
|
116
|
-
declare function defineMailer({
|
|
117
|
-
from,
|
|
118
|
-
smtpUrl
|
|
119
|
-
}: DefineMailerOptions): {
|
|
120
|
-
send(payload: MailerPayload): Promise<void>;
|
|
121
|
-
options: Mail.Options;
|
|
122
|
-
meta: Map<string, any>;
|
|
123
|
-
dkim: nodemailer_lib_dkim0;
|
|
124
|
-
transporter: nodemailer0.Transport<nodemailer_lib_smtp_transport0.SentMessageInfo, nodemailer0.TransportOptions>;
|
|
125
|
-
logger: nodemailer_lib_shared0.Logger;
|
|
126
|
-
MailMessage: nodemailer_lib_mailer_mail_message0<nodemailer_lib_smtp_transport0.SentMessageInfo>;
|
|
127
|
-
_defaults: nodemailer_lib_smtp_transport0.Options;
|
|
128
|
-
removeListener<K>(eventName: string | symbol, listener: (...args: any[]) => void): nodemailer0.Transporter<nodemailer_lib_smtp_transport0.SentMessageInfo, nodemailer_lib_smtp_transport0.Options>;
|
|
129
|
-
off<K>(eventName: string | symbol, listener: (...args: any[]) => void): nodemailer0.Transporter<nodemailer_lib_smtp_transport0.SentMessageInfo, nodemailer_lib_smtp_transport0.Options>;
|
|
130
|
-
removeAllListeners(eventName?: string | symbol | undefined): nodemailer0.Transporter<nodemailer_lib_smtp_transport0.SentMessageInfo, nodemailer_lib_smtp_transport0.Options>;
|
|
131
|
-
setMaxListeners(n: number): nodemailer0.Transporter<nodemailer_lib_smtp_transport0.SentMessageInfo, nodemailer_lib_smtp_transport0.Options>;
|
|
132
|
-
getMaxListeners(): number;
|
|
133
|
-
rawListeners<K>(eventName: string | symbol): Function[];
|
|
134
|
-
listenerCount<K>(eventName: string | symbol, listener?: Function | undefined): number;
|
|
135
|
-
eventNames(): (string | symbol)[];
|
|
136
|
-
};
|
|
137
|
-
//#endregion
|
|
138
|
-
//#region src/store/cache.d.ts
|
|
139
|
-
/**
|
|
140
|
-
* The cache instance type.
|
|
141
|
-
*/
|
|
142
|
-
type Cache = Awaited<ReturnType<typeof defineCache>>;
|
|
143
|
-
/**
|
|
144
|
-
* Options for defining the cache.
|
|
145
|
-
*/
|
|
146
|
-
type DefineCacheOptions = {
|
|
147
|
-
/**
|
|
148
|
-
* The connection string or Redis client options.
|
|
149
|
-
*/
|
|
150
|
-
connect: string | RedisClientOptions | RedisClientType;
|
|
151
|
-
/**
|
|
152
|
-
* The logger instance.
|
|
153
|
-
*/
|
|
154
|
-
logger: Logger;
|
|
155
|
-
/**
|
|
156
|
-
* The Keyv Redis options.
|
|
157
|
-
*/
|
|
158
|
-
options?: KeyvRedisOptions;
|
|
159
|
-
};
|
|
160
|
-
/**
|
|
161
|
-
* Define the cache instance.
|
|
162
|
-
*
|
|
163
|
-
* @param opts - The options for defining the cache.
|
|
164
|
-
* @returns The cache instance.
|
|
165
|
-
*/
|
|
166
|
-
declare function defineCache({
|
|
167
|
-
connect,
|
|
168
|
-
logger,
|
|
169
|
-
options
|
|
170
|
-
}: DefineCacheOptions): Promise<_keyv_redis0.Keyv<any>>;
|
|
171
|
-
//#endregion
|
|
172
|
-
//#region src/store/database.d.ts
|
|
173
|
-
/**
|
|
174
|
-
* Options for defining the database.
|
|
175
|
-
*/
|
|
176
|
-
interface DefineDatabaseOptions<TSchema extends Record<string, unknown> = Record<string, never>, TRelations extends AnyRelations = EmptyRelations> {
|
|
177
|
-
logger: Logger;
|
|
178
|
-
poolConfig: PoolConfig;
|
|
179
|
-
relations?: TRelations;
|
|
180
|
-
schema?: TSchema;
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* The database type.
|
|
184
|
-
*/
|
|
185
|
-
type Database = Awaited<ReturnType<typeof defineDatabase>>;
|
|
186
|
-
/**
|
|
187
|
-
* Define the database with the provided options.
|
|
188
|
-
*
|
|
189
|
-
* @param opts The options for defining the database, including pool configuration, relations, and schema.
|
|
190
|
-
* @template TSchema The schema type for the database.
|
|
191
|
-
* @template TRelations The relations type for the database.
|
|
192
|
-
* @returns
|
|
193
|
-
*/
|
|
194
|
-
declare function defineDatabase<TSchema extends Record<string, unknown> = Record<string, never>, TRelations extends AnyRelations = EmptyRelations>(opts: DefineDatabaseOptions<TSchema, TRelations>): Promise<drizzle_orm_node_postgres0.NodePgDatabase<TSchema, TRelations> & {
|
|
195
|
-
$client: Pool;
|
|
196
|
-
}>;
|
|
197
|
-
//#endregion
|
|
198
|
-
//#region src/server/container.d.ts
|
|
199
|
-
/**
|
|
200
|
-
* The base application container type that holds required services like
|
|
201
|
-
* config, databases, and caches.
|
|
202
|
-
*/
|
|
203
|
-
interface AppContainer {
|
|
204
|
-
/**
|
|
205
|
-
* The application configuration.
|
|
206
|
-
*/
|
|
207
|
-
config: Config;
|
|
208
|
-
/**
|
|
209
|
-
* A map of caches available in the application.
|
|
210
|
-
*/
|
|
211
|
-
cache: Record<string, Cache>;
|
|
212
|
-
/**
|
|
213
|
-
* A map of databases available in the application.
|
|
214
|
-
*/
|
|
215
|
-
db: Record<string, Database>;
|
|
216
|
-
/**
|
|
217
|
-
* The i18n instance for internationalization.
|
|
218
|
-
*/
|
|
219
|
-
i18n: i18n$1;
|
|
220
|
-
/**
|
|
221
|
-
* The logger instance for logging messages.
|
|
222
|
-
*/
|
|
223
|
-
logger: Logger;
|
|
224
|
-
/**
|
|
225
|
-
* The mailer instance for sending emails.
|
|
226
|
-
*/
|
|
227
|
-
mailer: Mailer;
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Global namespace for user container augmentation.
|
|
231
|
-
* Users can extend Container interface in their container.ts file.
|
|
232
|
-
*/
|
|
233
|
-
declare global {
|
|
234
|
-
namespace AppOS {
|
|
235
|
-
interface Container {}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* The container type used throughout the application.
|
|
240
|
-
* Merges base AppContainer with user's custom Container augmentations.
|
|
241
|
-
*/
|
|
242
|
-
type Container = AppContainer & AppOS.Container;
|
|
243
|
-
/**
|
|
244
|
-
* Defines an application container with type-safe validation and inference.
|
|
245
|
-
*
|
|
246
|
-
* This helper function ensures that:
|
|
247
|
-
* 1. All required base fields (config, cache, db) are provided
|
|
248
|
-
* 2. Custom fields are fully preserved in the inferred type
|
|
249
|
-
* 3. TypeScript provides autocomplete for all fields in commands/routes
|
|
250
|
-
*
|
|
251
|
-
* @template T - The container type extending AppContainer
|
|
252
|
-
* @param container - The container object with required and custom fields
|
|
253
|
-
* @returns The same container object with full type inference
|
|
254
|
-
*
|
|
255
|
-
* @example
|
|
256
|
-
* ```typescript
|
|
257
|
-
* // In your container.ts file:
|
|
258
|
-
* export async function defineContainer() {
|
|
259
|
-
* const config = defineConfig(z.object({
|
|
260
|
-
* API_KEY: z.string(),
|
|
261
|
-
* }));
|
|
262
|
-
*
|
|
263
|
-
* return defineAppContainer({
|
|
264
|
-
* cache: {},
|
|
265
|
-
* config,
|
|
266
|
-
* db: {},
|
|
267
|
-
* // Add custom field - they'll be fully typed!
|
|
268
|
-
* test: "hello",
|
|
269
|
-
* });
|
|
270
|
-
* }
|
|
271
|
-
*
|
|
272
|
-
* // In your commands:
|
|
273
|
-
* defineCommand({
|
|
274
|
-
* async run(args, opts, container) {
|
|
275
|
-
* console.log(container.test); // Autocompletes "test" field
|
|
276
|
-
* }
|
|
277
|
-
* });
|
|
278
|
-
* ```
|
|
279
|
-
*/
|
|
280
|
-
declare function defineAppContainer<T extends AppContainer>(container: T): T;
|
|
281
|
-
//#endregion
|
|
282
|
-
//#region src/server/i18n.d.ts
|
|
283
|
-
/**
|
|
284
|
-
* Initializes i18next instance with the provided options.
|
|
285
|
-
*
|
|
286
|
-
* @param opts Initialization options for i18next.
|
|
287
|
-
* @returns A promise that resolves to the initialized i18next instance.
|
|
288
|
-
*/
|
|
289
|
-
declare function defineI18n(opts: InitOptions): Promise<i18n$1>;
|
|
290
|
-
//#endregion
|
|
291
|
-
//#region src/server/otel.d.ts
|
|
292
|
-
/**
|
|
293
|
-
* Wraps an async function with an OpenTelemetry span for distributed tracing.
|
|
294
|
-
*
|
|
295
|
-
* Automatically handles span lifecycle (start/end), error recording, and context propagation.
|
|
296
|
-
* The span will appear as a child of the currently active span (if any).
|
|
297
|
-
*
|
|
298
|
-
* @param tracerName - Fully qualified module path (e.g., "api/routes/payouts", "packages/primitives/mailer")
|
|
299
|
-
* @param spanName - Operation name following {verb} {object} pattern (e.g., "fetch payouts", "send email")
|
|
300
|
-
* @param fn - The async function to execute within the span context. Receives span for custom attributes.
|
|
301
|
-
* @param attributes - Optional span attributes for high-cardinality data (IDs, counts, etc.).
|
|
302
|
-
* Use semantic conventions: https://opentelemetry.io/docs/specs/semconv/
|
|
303
|
-
* @returns Promise resolving to the function's return value.
|
|
304
|
-
*
|
|
305
|
-
* @example
|
|
306
|
-
* // Basic usage - simple business operation
|
|
307
|
-
* await withOtelSpan("api/routes/payouts", "fetch payouts", async () => {
|
|
308
|
-
* return await db.query.payouts.findMany();
|
|
309
|
-
* });
|
|
310
|
-
*
|
|
311
|
-
* @example
|
|
312
|
-
* // With attributes and custom span data
|
|
313
|
-
* const payouts = await withOtelSpan(
|
|
314
|
-
* "api/routes/payouts",
|
|
315
|
-
* "fetch payouts",
|
|
316
|
-
* async (span) => {
|
|
317
|
-
* const results = await db.query.payouts.findMany();
|
|
318
|
-
* span.setAttribute("payouts.count", results.length);
|
|
319
|
-
* span.addEvent("cache.miss");
|
|
320
|
-
* return results;
|
|
321
|
-
* },
|
|
322
|
-
* { "payouts.limit": 100, "payouts.offset": 0 }
|
|
323
|
-
* );
|
|
324
|
-
*/
|
|
325
|
-
declare function withOtelSpan<T>(fn: (span: Span) => Promise<T>, attributes?: Record<string, string | number | boolean>): Promise<T>;
|
|
326
|
-
//#endregion
|
|
327
|
-
export { AppContainer, Config, Container, type CustomTypeOptions, DefineLoggerOptions, DefineMailerOptions, type InitI18nOptions, Logger, Mailer, MailerPayload, MailerPayloadHtml, MailerPayloadReact, baseSchema, defineAppContainer, defineConfig, defineI18n, defineLogger, defineMailer, type i18n, withOtelSpan };
|