feat(core): Added type paths configuration for TypeScript, improved BelliniClient with optional API endpoint and publicationName, and refined imports with JavaScript extensions.

This commit is contained in:
2025-02-03 14:12:23 +01:00
parent 189b642721
commit f1b1bdb35a
11 changed files with 130 additions and 21 deletions

View File

@ -1,8 +1,9 @@
import * as plugins from './api.plugins.js';
export interface IBelliniClientOptions {
publicationName: string;
publicationName?: string;
smartstatePart?: plugins.smartstate.StatePart<any, IBelliniClientState>;
apiEndpoint?: string;
}
export interface IBelliniClientState {
@ -10,7 +11,6 @@ export interface IBelliniClientState {
}
export class BelliniClient {
private apiEndpoint = 'https://connect.api.global/bellini';
public smartstatePart: plugins.smartstate.StatePart<any, IBelliniClientState>;
public options: IBelliniClientOptions;
@ -42,7 +42,7 @@ export class BelliniClient {
await this.init();
const getArticles =
new plugins.typedrequest.TypedRequest<plugins.belliniInterfaces.IRequest_Any_Bellini_GetArticles>(
this.apiEndpoint,
this.options.apiEndpoint,
'getArticles',
);
const response = await getArticles.fire({

View File

@ -1,5 +1,5 @@
// @bellini scope
import * as belliniInterfaces from '@bellini/interfaces';
import * as belliniInterfaces from '@bellini.io/interfaces';
export { belliniInterfaces };