@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 +1 -1
- package/types/backend-plugin-types.d.ts +21 -21
package/package.json
CHANGED
|
@@ -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
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
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
|
|
241
|
+
export type SitePackConfiguration = FqdnSitePackConfiguration | SubDomainSitePackConfiguration;
|
|
244
242
|
|
|
245
|
-
export interface
|
|
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
|
|
253
|
+
export interface FqdnSitePackConfiguration extends SitePackConfigurationBase {
|
|
256
254
|
serveOn: "fqdn";
|
|
257
255
|
}
|
|
258
256
|
|
|
259
|
-
export interface
|
|
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):
|
|
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 {
|