@paroicms/public-server-lib 0.31.0 → 0.31.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paroicms/public-server-lib",
3
- "version": "0.31.0",
3
+ "version": "0.31.1",
4
4
  "description": "Common utilitaries for paroicms plugins (backend side).",
5
5
  "author": "Paroi Team",
6
6
  "repository": {
@@ -79,6 +79,7 @@ export interface BackendPluginInitService {
79
79
  registerHook(hookName: string, handler: BackendHookHandler, options?: { unique?: boolean }): void;
80
80
  setPublicApiHandler(handler: PublicApiHandler): void;
81
81
  addHeadTag(...htmlTags: string[]): void;
82
+ registeredSite: RegisteredSite;
82
83
  configuration: PluginConfiguration;
83
84
  pluginAssetsUrl: string;
84
85
  }
@@ -118,9 +119,9 @@ export interface BackendPluginService {
118
119
  validateRecaptchaResponse: (gRecaptchaResponse: string | undefined) => Promise<boolean>;
119
120
  sendMail: ({ subject, html, replyTo, to }: MailData) => Promise<void>;
120
121
  executeHook<T = unknown>(hookName: string, params?: any): T[];
122
+ registeredSite: RegisteredSite;
121
123
  configuration: PluginConfiguration;
122
124
  pluginAssetsUrl: string;
123
- registerNewSite: (options: NewSiteOptions) => Promise<Readonly<SiteConf>>;
124
125
  /** This is the connector of the running instance of ParoiCMS. */
125
126
  connector: RunningInstanceConnector;
126
127
  }
@@ -223,26 +224,23 @@ export interface PartialsParamsInput {
223
224
  offset: string;
224
225
  limit: string;
225
226
  }
226
- export interface SiteConf {
227
- fqdn: string;
228
- siteName: string;
229
- version?: string;
230
- siteDir: string;
231
- dataDir: string;
232
- cacheDir: string;
233
- backupDir: string;
234
- siteUrl: string;
235
- /**
236
- * This status can be mutated.
237
- */
238
- loadedOnce: boolean;
239
- redirectWww?: boolean;
240
- trusted: boolean;
227
+
228
+ export interface RegisteredSite {
229
+ readonly fqdn: string;
230
+ readonly siteName: string;
231
+ readonly version?: string;
232
+ readonly siteDir: string;
233
+ readonly dataDir: string;
234
+ readonly cacheDir: string;
235
+ readonly backupDir: string;
236
+ readonly siteUrl: string;
237
+ readonly redirectWww?: boolean;
238
+ readonly trusted: boolean;
241
239
  }
242
240
 
243
- export type SitePackConf = FqdnSitePackConf | SubDomainSitePackConf;
241
+ export type SitePackConfiguration = FqdnSitePackConfiguration | SubDomainSitePackConfiguration;
244
242
 
245
- export interface SitePackConfBase {
243
+ export interface SitePackConfigurationBase {
246
244
  packName: string;
247
245
  sitesDir?: string;
248
246
  dataDir: string;
@@ -252,17 +250,17 @@ export interface SitePackConfBase {
252
250
  trusted: boolean;
253
251
  }
254
252
 
255
- export interface FqdnSitePackConf extends SitePackConfBase {
253
+ export interface FqdnSitePackConfiguration extends SitePackConfigurationBase {
256
254
  serveOn: "fqdn";
257
255
  }
258
256
 
259
- export interface SubDomainSitePackConf extends SitePackConfBase {
257
+ export interface SubDomainSitePackConfiguration extends SitePackConfigurationBase {
260
258
  serveOn: "subDomain";
261
259
  parentDomain: string;
262
260
  }
263
261
 
264
262
  export interface RunningInstanceConnector {
265
- getSitePackConf(packName: string): SitePackConf;
263
+ getSitePackConf(packName: string): SitePackConfiguration;
266
264
  loadSiteSchemaAndIds(fqdn: string): Promise<SiteSchemaAndIds>;
267
265
  createAccount(
268
266
  fqdn: string,
@@ -291,6 +289,8 @@ export interface RunningInstanceConnector {
291
289
  contents: RiPartContent[];
292
290
  },
293
291
  ): Promise<void>;
292
+ registerNewSite: (options: NewSiteOptions) => Promise<RegisteredSite>;
293
+ removeSite: (fqdn: string) => Promise<void>;
294
294
  }
295
295
 
296
296
  export interface SiteSchemaAndIds {