Initial Commit
This commit is contained in:
130
packages/api-stack/api/api-plugin-site/src/index.ts
Normal file
130
packages/api-stack/api/api-plugin-site/src/index.ts
Normal file
@@ -0,0 +1,130 @@
|
||||
// Side-effect imports — surface the error registry + the ServiceRegistry
|
||||
// augmentation to every consumer importing the package barrel.
|
||||
import "./error-codes/error-codes.js";
|
||||
import "./services/registry-augmentation.js";
|
||||
|
||||
// Error codes
|
||||
export {
|
||||
SITE_CODES,
|
||||
SiteError,
|
||||
type SiteErrorCode,
|
||||
} from "./error-codes/error-codes.js";
|
||||
// Integration — recommended middleware composition
|
||||
export {
|
||||
MIDDLEWARE_RECOMMENDATIONS,
|
||||
type MiddlewareRecommendation,
|
||||
type RecommendedRateLimit,
|
||||
type SiteAuditCategory,
|
||||
type SiteRouteGroup,
|
||||
} from "./integration/middleware-recommendations.js";
|
||||
// Middleware
|
||||
export {
|
||||
createDomainResolverMiddleware,
|
||||
type DomainResolverMiddleware,
|
||||
} from "./middleware/domain-resolver.js";
|
||||
// OTel
|
||||
export {
|
||||
getSiteInstruments,
|
||||
resetSiteInstruments,
|
||||
type SiteInstruments,
|
||||
} from "./otel/instruments.js";
|
||||
// Plugin
|
||||
export {
|
||||
type CreateSitePluginOptions,
|
||||
createSitePlugin,
|
||||
} from "./plugin/plugin.js";
|
||||
// Routes
|
||||
export {
|
||||
createPrivateSiteRoutes,
|
||||
type PrivateSiteRoutesDeps,
|
||||
} from "./routes/private-routes.js";
|
||||
export {
|
||||
createPublicSiteRoutes,
|
||||
type PublicSiteRoutesDeps,
|
||||
} from "./routes/public-routes.js";
|
||||
// Schemas — domain
|
||||
export {
|
||||
type AddDomainRequest,
|
||||
AddDomainRequestSchema,
|
||||
type AddDomainResponse,
|
||||
AddDomainResponseSchema,
|
||||
type DomainResolveParam,
|
||||
DomainResolveParamSchema,
|
||||
type DomainResolveResponse,
|
||||
DomainResolveResponseSchema,
|
||||
DomainSchema,
|
||||
type RemoveDomainRequest,
|
||||
RemoveDomainRequestSchema,
|
||||
type RemoveDomainResponse,
|
||||
RemoveDomainResponseSchema,
|
||||
} from "./schemas/domain.js";
|
||||
// Schemas — options
|
||||
export {
|
||||
DEFAULT_CONFIG,
|
||||
mergeConfig,
|
||||
type SitePluginConfig,
|
||||
type SitePluginOptionsInput,
|
||||
SitePluginOptionsSchema,
|
||||
} from "./schemas/options.js";
|
||||
// Schemas — push
|
||||
export {
|
||||
type ApplePushConfig,
|
||||
ApplePushConfigSchema,
|
||||
type FirebasePushConfig,
|
||||
FirebasePushConfigSchema,
|
||||
type PushConfig,
|
||||
PushConfigSchema,
|
||||
type PushConfigValidationResponse,
|
||||
PushConfigValidationResponseSchema,
|
||||
validatePushConfig,
|
||||
} from "./schemas/push.js";
|
||||
// Schemas — site
|
||||
export {
|
||||
type CreateSite,
|
||||
CreateSiteSchema,
|
||||
RecordIdSchema,
|
||||
type Site,
|
||||
type SiteIdParam,
|
||||
SiteIdParamSchema,
|
||||
type SitePublicInfo,
|
||||
SitePublicInfoSchema,
|
||||
SiteSchema,
|
||||
SiteSettingsSchema,
|
||||
SiteStateNumberSchema,
|
||||
SiteThemeSchema,
|
||||
type UpdateSite,
|
||||
UpdateSiteSchema,
|
||||
} from "./schemas/site.js";
|
||||
// Service — db port + normaliser
|
||||
export type { SiteDb } from "./service/db-port.js";
|
||||
// Service — domain resolver
|
||||
export {
|
||||
DomainResolverService,
|
||||
type DomainResolverServiceOptions,
|
||||
} from "./service/domain-resolver.js";
|
||||
export { normalizeDomain } from "./service/normalize-domain.js";
|
||||
// Service — site
|
||||
export {
|
||||
SiteService,
|
||||
type SiteServiceOptions,
|
||||
} from "./service/site.js";
|
||||
|
||||
// Types
|
||||
export type {
|
||||
DomainResolutionResult,
|
||||
OrganizationCreatedEvent,
|
||||
ResolvedOrganization,
|
||||
SiteBootstrapFailedEvent,
|
||||
SiteEventMap,
|
||||
SitePluginLogger,
|
||||
SiteSettings,
|
||||
SiteSettingsUpdatedEvent,
|
||||
SiteStateNumber,
|
||||
SiteTheme,
|
||||
} from "./types/types.js";
|
||||
export {
|
||||
SITE_STATE_ACTIVE,
|
||||
SITE_STATE_ARCHIVED,
|
||||
SITE_STATE_MAINTENANCE,
|
||||
SITE_STATE_SUSPENDED,
|
||||
} from "./types/types.js";
|
||||
Reference in New Issue
Block a user