@o2s/framework
v1.23.0
Published
Core O2S framework providing modules, SDK, and ApiConfig for building composable customer portals.
Downloads
1,414
Readme
@o2s/framework
Core O2S framework providing modules, SDK, and ApiConfig for building composable customer portals.
Installation
npm install @o2s/frameworkUsage
Modules
Import framework modules for domain services:
import { Tickets, CMS, Users, Articles, Orders, Products } from '@o2s/framework/modules';
// Use in your services
class MyService {
constructor(
private readonly ticketsService: Tickets.Service,
private readonly cmsService: CMS.Service,
) {}
}SDK
Use the SDK for type-safe API clients:
import { getSdk } from '@o2s/framework/sdk';
const sdk = getSdk({ apiUrl: 'https://your-api-url.com' });
// Fetch data
const tickets = await sdk.tickets.getTickets({}, accessToken);
const invoices = await sdk.invoices.getInvoiceList({}, accessToken);ApiConfig
Define your API configuration:
import { ApiConfig } from '@o2s/framework/modules';
import { Tickets, CMS } from '@o2s/configs.integrations';
export const AppConfig: ApiConfig = {
integrations: {
tickets: Tickets.TicketsIntegrationConfig,
cms: CMS.CmsIntegrationConfig,
},
};Available Modules
Tickets- Ticket managementCMS- Content managementUsers- User managementArticles- Article managementOrders- Order managementProducts- Product managementCarts- Shopping cartCustomers- Customer managementPayments- Payment processingCheckout- Checkout flowInvoices- Invoice managementNotifications- Notification managementOrganizations- Organization managementResources- Resource managementBillingAccounts- Billing account managementSearch- Search functionalityCache- CachingAuth- Authentication
Peer Dependencies
@nestjs/common^11@nestjs/core^11@nestjs/config^4.0.2@nestjs/axios^4.0.1rxjs^7
Related Packages
@o2s/configs.integrations- Integration configurations@o2s/utils.logger- Logging utilities
