appos 0.2.1 → 0.2.3-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 +63 -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,325 +0,0 @@
|
|
|
1
|
-
import { i18n } 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
|
-
|
|
17
|
-
//#region src/server/config.d.ts
|
|
18
|
-
/**
|
|
19
|
-
* The config base schema.
|
|
20
|
-
*/
|
|
21
|
-
declare const baseSchema: z.ZodObject<{
|
|
22
|
-
APP_NAME: z.ZodDefault<z.ZodString>;
|
|
23
|
-
APP_DESC: z.ZodDefault<z.ZodString>;
|
|
24
|
-
}, z.core.$strip>;
|
|
25
|
-
/**
|
|
26
|
-
* The configuration type inferred from the merged schema.
|
|
27
|
-
*/
|
|
28
|
-
type Config<T extends z.ZodRawShape = {}> = z.infer<ReturnType<typeof baseSchema.extend<T>>>;
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/server/logger.d.ts
|
|
31
|
-
/**
|
|
32
|
-
* Extended logger options with OpenTelemetry support.
|
|
33
|
-
*/
|
|
34
|
-
interface DefineLoggerOptions extends LoggerOptions {}
|
|
35
|
-
/**
|
|
36
|
-
* The logger instance type.
|
|
37
|
-
*/
|
|
38
|
-
type Logger = Awaited<ReturnType<typeof defineLogger>>;
|
|
39
|
-
/**
|
|
40
|
-
* Define the logger instance.
|
|
41
|
-
*
|
|
42
|
-
* @param opts - The options.
|
|
43
|
-
* @returns The logger.
|
|
44
|
-
*/
|
|
45
|
-
declare function defineLogger(opts: DefineLoggerOptions): Promise<pino.Logger<never, boolean>>;
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region src/server/mailer.d.ts
|
|
48
|
-
/**
|
|
49
|
-
* The mailer type.
|
|
50
|
-
*/
|
|
51
|
-
type Mailer = ReturnType<typeof defineMailer>;
|
|
52
|
-
/**
|
|
53
|
-
* The mailer payload type with React component.
|
|
54
|
-
*/
|
|
55
|
-
type MailerPayloadReact = Omit<Mail.Options, "from" | "html" | "text"> & {
|
|
56
|
-
/**
|
|
57
|
-
* The email address to send the email from.
|
|
58
|
-
*/
|
|
59
|
-
from?: string;
|
|
60
|
-
/**
|
|
61
|
-
* The React component to render as the email body.
|
|
62
|
-
*/
|
|
63
|
-
react: JSX.Element;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* The mailer payload type with direct HTML and text.
|
|
67
|
-
*/
|
|
68
|
-
type MailerPayloadHtml = Omit<Mail.Options, "from"> & {
|
|
69
|
-
/**
|
|
70
|
-
* The email address to send the email from.
|
|
71
|
-
*/
|
|
72
|
-
from?: string;
|
|
73
|
-
/**
|
|
74
|
-
* The HTML content of the email.
|
|
75
|
-
*/
|
|
76
|
-
html: string;
|
|
77
|
-
/**
|
|
78
|
-
* The plain text content of the email.
|
|
79
|
-
*/
|
|
80
|
-
text: string;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* The mailer payload type - supports either React component or direct HTML+text.
|
|
84
|
-
*/
|
|
85
|
-
type MailerPayload = MailerPayloadReact | MailerPayloadHtml;
|
|
86
|
-
/**
|
|
87
|
-
* Define the options for the mailer.
|
|
88
|
-
*/
|
|
89
|
-
interface DefineMailerOptions {
|
|
90
|
-
/**
|
|
91
|
-
* The default email address to use as the sender.
|
|
92
|
-
*/
|
|
93
|
-
from: string;
|
|
94
|
-
/**
|
|
95
|
-
* The SMTP URL to use for sending emails.
|
|
96
|
-
*/
|
|
97
|
-
smtpUrl: string;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Define the mailer.
|
|
101
|
-
*
|
|
102
|
-
* @param env - The environment variables.
|
|
103
|
-
* @returns The mailer.
|
|
104
|
-
*/
|
|
105
|
-
declare function defineMailer({
|
|
106
|
-
from,
|
|
107
|
-
smtpUrl
|
|
108
|
-
}: DefineMailerOptions): {
|
|
109
|
-
send(payload: MailerPayload): Promise<void>;
|
|
110
|
-
options: Mail.Options;
|
|
111
|
-
meta: Map<string, any>;
|
|
112
|
-
dkim: nodemailer_lib_dkim0;
|
|
113
|
-
transporter: nodemailer0.Transport<nodemailer_lib_smtp_transport0.SentMessageInfo, nodemailer0.TransportOptions>;
|
|
114
|
-
logger: nodemailer_lib_shared0.Logger;
|
|
115
|
-
MailMessage: nodemailer_lib_mailer_mail_message0<nodemailer_lib_smtp_transport0.SentMessageInfo>;
|
|
116
|
-
_defaults: nodemailer_lib_smtp_transport0.Options;
|
|
117
|
-
removeListener<K>(eventName: string | symbol, listener: (...args: any[]) => void): nodemailer0.Transporter<nodemailer_lib_smtp_transport0.SentMessageInfo, nodemailer_lib_smtp_transport0.Options>;
|
|
118
|
-
off<K>(eventName: string | symbol, listener: (...args: any[]) => void): nodemailer0.Transporter<nodemailer_lib_smtp_transport0.SentMessageInfo, nodemailer_lib_smtp_transport0.Options>;
|
|
119
|
-
removeAllListeners(eventName?: string | symbol | undefined): nodemailer0.Transporter<nodemailer_lib_smtp_transport0.SentMessageInfo, nodemailer_lib_smtp_transport0.Options>;
|
|
120
|
-
setMaxListeners(n: number): nodemailer0.Transporter<nodemailer_lib_smtp_transport0.SentMessageInfo, nodemailer_lib_smtp_transport0.Options>;
|
|
121
|
-
getMaxListeners(): number;
|
|
122
|
-
rawListeners<K>(eventName: string | symbol): Function[];
|
|
123
|
-
listenerCount<K>(eventName: string | symbol, listener?: Function | undefined): number;
|
|
124
|
-
eventNames(): (string | symbol)[];
|
|
125
|
-
};
|
|
126
|
-
//#endregion
|
|
127
|
-
//#region src/store/cache.d.ts
|
|
128
|
-
/**
|
|
129
|
-
* The cache instance type.
|
|
130
|
-
*/
|
|
131
|
-
type Cache = Awaited<ReturnType<typeof defineCache>>;
|
|
132
|
-
/**
|
|
133
|
-
* Options for defining the cache.
|
|
134
|
-
*/
|
|
135
|
-
type DefineCacheOptions = {
|
|
136
|
-
/**
|
|
137
|
-
* The connection string or Redis client options.
|
|
138
|
-
*/
|
|
139
|
-
connect: string | RedisClientOptions | RedisClientType;
|
|
140
|
-
/**
|
|
141
|
-
* The logger instance.
|
|
142
|
-
*/
|
|
143
|
-
logger: Logger;
|
|
144
|
-
/**
|
|
145
|
-
* The Keyv Redis options.
|
|
146
|
-
*/
|
|
147
|
-
options?: KeyvRedisOptions;
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* Define the cache instance.
|
|
151
|
-
*
|
|
152
|
-
* @param opts - The options for defining the cache.
|
|
153
|
-
* @returns The cache instance.
|
|
154
|
-
*/
|
|
155
|
-
declare function defineCache({
|
|
156
|
-
connect,
|
|
157
|
-
logger,
|
|
158
|
-
options
|
|
159
|
-
}: DefineCacheOptions): Promise<_keyv_redis0.Keyv<any>>;
|
|
160
|
-
//#endregion
|
|
161
|
-
//#region src/store/database.d.ts
|
|
162
|
-
/**
|
|
163
|
-
* Options for defining the database.
|
|
164
|
-
*/
|
|
165
|
-
interface DefineDatabaseOptions<TSchema extends Record<string, unknown> = Record<string, never>, TRelations extends AnyRelations = EmptyRelations> {
|
|
166
|
-
logger: Logger;
|
|
167
|
-
poolConfig: PoolConfig;
|
|
168
|
-
relations?: TRelations;
|
|
169
|
-
schema?: TSchema;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* The database type.
|
|
173
|
-
*/
|
|
174
|
-
type Database = Awaited<ReturnType<typeof defineDatabase>>;
|
|
175
|
-
/**
|
|
176
|
-
* Define the database with the provided options.
|
|
177
|
-
*
|
|
178
|
-
* @param opts The options for defining the database, including pool configuration, relations, and schema.
|
|
179
|
-
* @template TSchema The schema type for the database.
|
|
180
|
-
* @template TRelations The relations type for the database.
|
|
181
|
-
* @returns
|
|
182
|
-
*/
|
|
183
|
-
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> & {
|
|
184
|
-
$client: Pool;
|
|
185
|
-
}>;
|
|
186
|
-
//#endregion
|
|
187
|
-
//#region src/server/container.d.ts
|
|
188
|
-
/**
|
|
189
|
-
* The base application container type that holds required services like
|
|
190
|
-
* config, databases, and caches.
|
|
191
|
-
*/
|
|
192
|
-
interface AppContainer {
|
|
193
|
-
/**
|
|
194
|
-
* The application configuration.
|
|
195
|
-
*/
|
|
196
|
-
config: Config;
|
|
197
|
-
/**
|
|
198
|
-
* A map of caches available in the application.
|
|
199
|
-
*/
|
|
200
|
-
cache: Record<string, Cache>;
|
|
201
|
-
/**
|
|
202
|
-
* A map of databases available in the application.
|
|
203
|
-
*/
|
|
204
|
-
db: Record<string, Database>;
|
|
205
|
-
/**
|
|
206
|
-
* The i18n instance for internationalization.
|
|
207
|
-
*/
|
|
208
|
-
i18n: i18n;
|
|
209
|
-
/**
|
|
210
|
-
* The logger instance for logging messages.
|
|
211
|
-
*/
|
|
212
|
-
logger: Logger;
|
|
213
|
-
/**
|
|
214
|
-
* The mailer instance for sending emails.
|
|
215
|
-
*/
|
|
216
|
-
mailer: Mailer;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Global namespace for user container augmentation.
|
|
220
|
-
* Users can extend Container interface in their container.ts file.
|
|
221
|
-
*/
|
|
222
|
-
declare global {
|
|
223
|
-
namespace AppOS {
|
|
224
|
-
interface Container {}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* The container type used throughout the application.
|
|
229
|
-
* Merges base AppContainer with user's custom Container augmentations.
|
|
230
|
-
*/
|
|
231
|
-
type Container = AppContainer & AppOS.Container;
|
|
232
|
-
//#endregion
|
|
233
|
-
//#region src/cli/command.d.ts
|
|
234
|
-
/**
|
|
235
|
-
* The command interface.
|
|
236
|
-
*/
|
|
237
|
-
interface Command<C extends Container, A$1 = readonly unknown[], O$1 = Record<string, unknown>> {
|
|
238
|
-
aliases: string[];
|
|
239
|
-
description: string;
|
|
240
|
-
args: z.ZodTuple<readonly [z.ZodTypeAny, ...z.ZodTypeAny[]], z.ZodTypeAny | null> | z.ZodArray<z.ZodTypeAny>;
|
|
241
|
-
opts: z.ZodObject<z.ZodRawShape>;
|
|
242
|
-
run: (args: A$1, options: O$1, container: C) => Promise<void>;
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* Define a CLI command with type-safe arguments and options.
|
|
246
|
-
*
|
|
247
|
-
* The command name is automatically derived from the filename relative to the commands directory:
|
|
248
|
-
* - `<APPOS_DIR>/<COMMANDS_DIR>/db/push.ts` → `db:push`
|
|
249
|
-
* - `<APPOS_DIR>/<COMMANDS_DIR>/dev.ts` → `dev`
|
|
250
|
-
*
|
|
251
|
-
* Where:
|
|
252
|
-
* - `APPOS_DIR` defaults to "appos" (see constants.ts)
|
|
253
|
-
* - `COMMANDS_DIR` defaults to "commands" (see constants.ts)
|
|
254
|
-
*
|
|
255
|
-
* @example
|
|
256
|
-
* ```typescript
|
|
257
|
-
* // appos/commands/db/migrate.ts
|
|
258
|
-
* import { defineCommand } from "appos/cli";
|
|
259
|
-
* import { z } from "zod";
|
|
260
|
-
*
|
|
261
|
-
* export default defineCommand({
|
|
262
|
-
* description: "Run database migrations",
|
|
263
|
-
* args: z.tuple([]),
|
|
264
|
-
* opts: z.object({
|
|
265
|
-
* dry: z.boolean().default(false)
|
|
266
|
-
* }),
|
|
267
|
-
* async run(args, opts, container) {
|
|
268
|
-
* await container.db.primary.migrate({ dryRun: opts.dry });
|
|
269
|
-
* }
|
|
270
|
-
* });
|
|
271
|
-
* ```
|
|
272
|
-
*/
|
|
273
|
-
declare function defineCommand<C extends Container = Container, ASchema extends z.ZodSchema<unknown> | undefined = undefined, OSchema extends z.ZodSchema<unknown> | undefined = undefined>(def: {
|
|
274
|
-
aliases?: string[];
|
|
275
|
-
description: string;
|
|
276
|
-
args: ASchema;
|
|
277
|
-
opts: OSchema;
|
|
278
|
-
run: (args: ASchema extends z.ZodSchema<infer A> ? A : readonly unknown[], opts: OSchema extends z.ZodSchema<infer O> ? O : Record<string, unknown>, container: C) => Promise<void>;
|
|
279
|
-
}): Command<C, ASchema extends z.ZodSchema<infer A> ? A : readonly unknown[], OSchema extends z.ZodSchema<infer O> ? O : Record<string, unknown>>;
|
|
280
|
-
//#endregion
|
|
281
|
-
//#region src/cli/cli.d.ts
|
|
282
|
-
/**
|
|
283
|
-
* The CLI interface.
|
|
284
|
-
*/
|
|
285
|
-
interface CLI<C extends Container> {
|
|
286
|
-
/**
|
|
287
|
-
* Run the CLI with the provided arguments.
|
|
288
|
-
*/
|
|
289
|
-
run(args?: string[]): Promise<void>;
|
|
290
|
-
/**
|
|
291
|
-
* Show general help for all commands.
|
|
292
|
-
*/
|
|
293
|
-
showHelp(): void;
|
|
294
|
-
/**
|
|
295
|
-
* Show help for a specific command.
|
|
296
|
-
*/
|
|
297
|
-
showCommandHelp(command: Command<C>): void;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* Define a CLI with automatic command discovery.
|
|
301
|
-
*
|
|
302
|
-
* Commands are discovered by scanning the commandsDir for .ts files.
|
|
303
|
-
* The command name is derived from the file path relative to commandsDir:
|
|
304
|
-
* - `<commandsDir>/dev.ts` → `dev`
|
|
305
|
-
* - `<commandsDir>/db/push.ts` → `db:push`
|
|
306
|
-
*
|
|
307
|
-
* @example
|
|
308
|
-
* ```typescript
|
|
309
|
-
* import path from "node:path";
|
|
310
|
-
* import { APPOS_DIR, COMMANDS_DIR } from "#src/constants.ts";
|
|
311
|
-
*
|
|
312
|
-
* const cli = await defineCli({
|
|
313
|
-
* container,
|
|
314
|
-
* commandsDir: path.join(process.cwd(), APPOS_DIR, COMMANDS_DIR)
|
|
315
|
-
* });
|
|
316
|
-
*
|
|
317
|
-
* await cli.run();
|
|
318
|
-
* ```
|
|
319
|
-
*/
|
|
320
|
-
declare function defineCli<C extends Container>(opts: {
|
|
321
|
-
container: C;
|
|
322
|
-
commandsDir: string;
|
|
323
|
-
}): Promise<CLI<C>>;
|
|
324
|
-
//#endregion
|
|
325
|
-
export { CLI, Command, defineCli, defineCommand };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"node:fs";import t from"node:path";var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e},u=((e,t,i)=>(i=e==null?{}:n(o(e)),l(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)))(c(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c}))(),1);function d(n,r=n){let i=[];try{let a=e.readdirSync(n,{withFileTypes:!0});for(let e of a){let a=t.join(n,e.name);e.isDirectory()?i.push(...d(a,r)):e.isFile()&&e.name.endsWith(`.ts`)&&i.push(a)}}catch{}return i}function f(e,n){return t.relative(n,e).replace(/\.ts$/,``).replace(/\//g,`:`)}async function p(e,t){let n={},r=[],i=new Map;if(t.opts&&`shape`in t.opts){let e=t.opts.shape;for(let[t,n]of Object.entries(e)){let e=n.meta?.();e?.short&&typeof e.short==`string`&&i.set(e.short,t)}}for(let t=0;t<e.length;t++){let a=e[t];if(a.startsWith(`--`)){let[r,...i]=a.slice(2).split(`=`);if(i.length>0)n[r]=i.join(`=`);else{let i=e[t+1];i&&!i.startsWith(`-`)?(n[r]=i,t++):n[r]=!0}}else if(a.startsWith(`-`)&&a.length>1){let r=a.slice(1);if(r.length>1)for(let e of r){let t=i.get(e);t&&(n[t]=!0)}else{let a=r,o=i.get(a)||a,s=e[t+1];s&&!s.startsWith(`-`)?(n[o]=s,t++):n[o]=!0}}else r.push(a)}let a={};if(t.opts&&`safeParse`in t.opts){let e=t.opts.safeParse(n);if(!e.success){for(let t of e.error.issues){let e=t.path.join(`.`);console.error(u.default.red(`Error:\n --${e} => ${t.message.toLowerCase()}`))}process.exit(1)}a=e.data}let o=[];if(t.args&&`safeParse`in t.args){let e=t.args.safeParse(r);if(!e.success){for(let t of e.error.issues){let e=t.path.join(`.`);console.error(u.default.red(`Error:\n ${e} => ${t.message.toLowerCase()}`))}process.exit(1)}o=e.data}return{args:o,options:a}}function m(e,t){console.log(`${u.default.bold(e.config.APP_NAME)} - ${e.config.APP_DESC}\n`),console.log(`Commands:`);let n=0;for(let[e,r]of t){let t=r.aliases&&r.aliases.length>0?` (${r.aliases.join(`, `)})`:``,i=e.length+t.length;n=Math.max(n,i)}n+=8;for(let[e,r]of t){let t=r.aliases&&r.aliases.length>0?` (${r.aliases.join(`, `)})`:``,i=r.aliases&&r.aliases.length>0?u.default.dim(` (${r.aliases.join(`, `)})`):``,a=`${u.default.cyan(e)}${i}`,o=e.length+t.length,s=` `.repeat(Math.max(0,n-o));console.log(` ${a}${s}${r.description||`No description`}`)}}function h(e,t){console.log(`${t.description||`No description`}`),console.log();let n=`Usage: ${u.default.cyan(e)}`;if(t.args){let e=t.args._def,r=e?.typeName||e?.type;if(r===`ZodTuple`||r===`tuple`){let t=e.items||[];for(let e of t){let t=e,r=t.meta?.()?.name||t._def?.description||`arg`,i=t.isOptional?.()??!1;n+=i?` [${r}]`:` <${r}>`}if(e.rest){let t=e.rest._def?.description||`args`;n+=` [${t}...]`}}else if(r===`ZodArray`||r===`array`){let r=t.args.meta?.()?.name||`args`,i=e.minLength?.value||0;i===0?n+=` [${r}...]`:i===1?n+=` <${r}>`:n+=` <${r}...>`}}if(t.opts&&(n+=` [options]`),console.log(n),console.log(),t.args){let e=t.args._def,n=e?.typeName||e?.type;if(n===`ZodTuple`||n===`tuple`||n===`ZodArray`||n===`array`){if(console.log(`Arguments:`),n===`ZodTuple`||n===`tuple`){let t=e.items||[];for(let e=0;e<t.length;e++){let n=t[e],r=n.meta?.(),i=r?.name||n._def?.description||`arg${e+1}`,a=r?.description||n._def?.description||i,o=n.isOptional?.()??!1?``:` (required)`;console.log(` ${u.default.cyan(i)}${u.default.dim(o)}\t\t${a}`)}if(e.rest){let t=e.rest._def?.description||`additional args`;console.log(` ${u.default.cyan(`${t}...`)}\t\t${t}`)}}else{let n=t.args.meta?.(),r=n?.name||`args`,i=n?.description||``,a=e.minLength?.value||0,o=r;(a===0||a>1)&&(o=`${r}...`);let s=a>0?` (required)`:``;console.log(` ${u.default.cyan(o)}${u.default.dim(s)}\t\t${i}`)}console.log()}}if(console.log(`Options:`),console.log(` ${u.default.cyan(`-h, --help`)}\t\t\tShow help for this command`),t.opts&&`shape`in t.opts){let e=t.opts.shape;for(let[t,n]of Object.entries(e)){let e=n,r=e.meta?.(),i=e.isOptional?.()??!0,a=e._def?.typeName===`ZodBoolean`,o=r?.short?`-${r.short}, `:` `,s=`--${t}`,c=a?``:` <value>`,l=i?``:` (required)`,d=e._def?.defaultValue,f=d===void 0?``:`(default: ${JSON.stringify(d)})`,p=r?.description||``;console.log(` ${u.default.cyan(o+s+c)}\t\t${p} ${u.default.dim(l+f)}`)}}}async function g(e){let t=new Map,n=new Map,r=d(e.commandsDir);for(let i of r)try{let r=(await import(i)).default;if(r&&typeof r==`object`&&`run`in r){let a=f(i,e.commandsDir);if(t.set(a,r),r.aliases)for(let e of r.aliases)n.set(e,a)}}catch(e){console.warn(u.default.yellow(`Warning: Could not load command from ${i}: ${e instanceof Error?e.message:String(e)}`))}return{async run(r=process.argv.slice(2)){let[i,...a]=r;if(!i||i===`--help`||i===`-h`){m(e.container,t);return}let o=n.get(i)||i,s=t.get(o);if(s||(console.error(u.default.red(`Unknown command: ${i}\n`)),m(e.container,t),process.exit(1)),a.includes(`--help`)||a.includes(`-h`)){h(o,s);return}try{let{args:t,options:n}=await p(a,s);await s.run(t,n,e.container)}catch(e){e instanceof Error&&(console.error(u.default.red(`Error:`),e.message),(e.message.includes(`argument`)||e.message.includes(`Invalid arguments`))&&(console.log(),console.log(`Run '${u.default.cyan(`${o} --help`)}' to see usage information.`))),process.exit(1)}},showHelp(){m(e.container,t)},showCommandHelp(e){h(Array.from(t.entries()).find(([t,n])=>n===e)?.[0]||`unknown`,e)}}}function _(e){return{aliases:e.aliases||[],description:e.description,args:e.args||[],opts:e.opts||{},run:e.run}}export{g as defineCli,_ as defineCommand};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t}from"./instrumentation.mjs";var n=t((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.execAsync=void 0;let n=e(`child_process`);t.execAsync=e(`util`).promisify(n.exec)}));export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,n,r,t as i}from"./instrumentation.mjs";import{t as a}from"./execAsync-DaIUcs6_.mjs";var o=r((r=>{Object.defineProperty(r,`__esModule`,{value:!0}),r.getMachineId=void 0;let o=t(`fs`),s=a(),c=(n(),e(i));async function l(){try{return(await o.promises.readFile(`/etc/hostid`,{encoding:`utf8`})).trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}try{return(await(0,s.execAsync)(`kenv -q smbios.system.uuid`)).stdout.trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}r.getMachineId=l}));export default o();export{};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,r as n,t as r}from"./instrumentation.mjs";import{t as i}from"./execAsync-DaIUcs6_.mjs";var a=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let a=i(),o=(t(),e(r));async function s(){try{let e=(await(0,a.execAsync)(`ioreg -rd1 -c "IOPlatformExpertDevice"`)).stdout.split(`
|
|
2
|
-
`).find(e=>e.includes(`IOPlatformUUID`));if(!e)return;let t=e.split(`" = "`);if(t.length===2)return t[1].slice(0,-1)}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}n.getMachineId=s}));export default a();export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,n,r,t as i}from"./instrumentation.mjs";var a=r((r=>{Object.defineProperty(r,`__esModule`,{value:!0}),r.getMachineId=void 0;let a=t(`fs`),o=(n(),e(i));async function s(){for(let e of[`/etc/machine-id`,`/var/lib/dbus/machine-id`])try{return(await a.promises.readFile(e,{encoding:`utf8`})).trim()}catch(e){o.diag.debug(`error reading machine id: ${e}`)}}r.getMachineId=s}));export default a();export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,r as n,t as r}from"./instrumentation.mjs";var i=n((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let i=(t(),e(r));async function a(){i.diag.debug(`could not read machine-id: unsupported platform`)}n.getMachineId=a}));export default i();export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,n,r,t as i}from"./instrumentation.mjs";import{t as a}from"./execAsync-DaIUcs6_.mjs";var o=r((r=>{Object.defineProperty(r,`__esModule`,{value:!0}),r.getMachineId=void 0;let o=t(`process`),s=a(),c=(n(),e(i));async function l(){let e=`%windir%\\System32\\REG.exe`;o.arch===`ia32`&&`PROCESSOR_ARCHITEW6432`in o.env&&(e=`%windir%\\sysnative\\cmd.exe /c `+e);try{let t=(await(0,s.execAsync)(`${e} QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`)).stdout.split(`REG_SZ`);if(t.length===2)return t[1].trim()}catch(e){c.diag.debug(`error reading machine id: ${e}`)}}r.getMachineId=l}));export default o();export{};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|