@paroicms/public-server-lib 0.26.0 → 0.28.0
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 +3 -3
- package/types/backend-plugin-types.d.ts +55 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paroicms/public-server-lib",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "Common utilitaries for paroicms plugins (backend side).",
|
|
5
5
|
"author": "Paroi Team",
|
|
6
6
|
"repository": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@paroi/data-formatters-lib": "~0.4.0",
|
|
24
|
-
"@paroicms/internal-anywhere-lib": "1.
|
|
25
|
-
"@paroicms/public-anywhere-lib": "0.
|
|
24
|
+
"@paroicms/internal-anywhere-lib": "1.26.0",
|
|
25
|
+
"@paroicms/public-anywhere-lib": "0.20.0",
|
|
26
26
|
"@types/express": "~4.17.21"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
@@ -213,26 +213,31 @@ export interface SubDomainSitePackConf extends SitePackConfBase {
|
|
|
213
213
|
export interface RunningInstanceConnector {
|
|
214
214
|
getSitePackConf(packName: string): SitePackConf;
|
|
215
215
|
loadSiteSchemaAndIds(fqdn: string): Promise<SiteSchemaAndIds>;
|
|
216
|
-
|
|
216
|
+
createAccount(
|
|
217
|
+
fqdn: string,
|
|
218
|
+
account: RiNewAccount,
|
|
219
|
+
options?: { asContactEmail?: boolean },
|
|
220
|
+
): Promise<void>;
|
|
221
|
+
updateSiteFields(fqdn: string, fields: RiFieldSetContent): Promise<void>;
|
|
217
222
|
updateDocumentContent(
|
|
218
223
|
fqdn: string,
|
|
219
224
|
options: {
|
|
220
225
|
nodeId: string;
|
|
221
|
-
content:
|
|
226
|
+
content: RiDocumentContent;
|
|
222
227
|
},
|
|
223
228
|
): Promise<void>;
|
|
224
229
|
addMultipleDocumentContents(
|
|
225
230
|
fqdn: string,
|
|
226
231
|
options: {
|
|
227
232
|
parentNodeId: string;
|
|
228
|
-
contents:
|
|
233
|
+
contents: RiDocumentContent[];
|
|
229
234
|
},
|
|
230
235
|
): Promise<void>;
|
|
231
236
|
addMultiplePartContents(
|
|
232
237
|
fqdn: string,
|
|
233
238
|
options: {
|
|
234
239
|
parentNodeId: string;
|
|
235
|
-
contents:
|
|
240
|
+
contents: RiPartContent[];
|
|
236
241
|
},
|
|
237
242
|
): Promise<void>;
|
|
238
243
|
}
|
|
@@ -242,47 +247,62 @@ export interface SiteSchemaAndIds {
|
|
|
242
247
|
siteIds: SiteIds;
|
|
243
248
|
}
|
|
244
249
|
|
|
250
|
+
export type RiNewAccount = RiLocalNewAccount | RiExternalNewAccount;
|
|
251
|
+
|
|
252
|
+
export interface RiLocalNewAccount {
|
|
253
|
+
kind: "local";
|
|
254
|
+
email: string;
|
|
255
|
+
name: string;
|
|
256
|
+
password: string;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface RiExternalNewAccount {
|
|
260
|
+
kind: "google";
|
|
261
|
+
email: string;
|
|
262
|
+
name: string;
|
|
263
|
+
}
|
|
264
|
+
|
|
245
265
|
/** "Nc" stands for Node Content. */
|
|
246
|
-
export type
|
|
266
|
+
export type RiNodeContent = RiDocumentContent | RiPartContent;
|
|
247
267
|
|
|
248
|
-
export interface
|
|
268
|
+
export interface RiDocumentContent {
|
|
249
269
|
kind: "document";
|
|
250
270
|
typeName: string;
|
|
251
271
|
title?: { [language: string]: string };
|
|
252
|
-
featuredImage?:
|
|
253
|
-
fields:
|
|
272
|
+
featuredImage?: RiMediaValue;
|
|
273
|
+
fields: RiFieldSetContent;
|
|
254
274
|
}
|
|
255
275
|
|
|
256
|
-
export interface
|
|
276
|
+
export interface RiPartContent {
|
|
257
277
|
kind: "part";
|
|
258
278
|
typeName: string;
|
|
259
|
-
fields:
|
|
279
|
+
fields: RiFieldSetContent;
|
|
260
280
|
}
|
|
261
281
|
|
|
262
|
-
export interface
|
|
263
|
-
[fieldName: string]:
|
|
282
|
+
export interface RiFieldSetContent {
|
|
283
|
+
[fieldName: string]: RiFieldContent;
|
|
264
284
|
}
|
|
265
285
|
|
|
266
|
-
export type
|
|
267
|
-
|
|
|
268
|
-
|
|
|
269
|
-
|
|
|
270
|
-
|
|
|
271
|
-
|
|
|
272
|
-
|
|
|
273
|
-
|
|
274
|
-
export type
|
|
275
|
-
export type
|
|
276
|
-
export type
|
|
277
|
-
export type
|
|
278
|
-
export type
|
|
279
|
-
export type
|
|
280
|
-
|
|
281
|
-
export type
|
|
282
|
-
|
|
|
283
|
-
|
|
|
284
|
-
|
|
285
|
-
export interface
|
|
286
|
+
export type RiFieldContent =
|
|
287
|
+
| RiStringContent
|
|
288
|
+
| RiNumberContent
|
|
289
|
+
| RiBooleanContent
|
|
290
|
+
| RiQuillDeltaContent
|
|
291
|
+
| RiMediaContent
|
|
292
|
+
| RiGalleryContent;
|
|
293
|
+
|
|
294
|
+
export type RiStringContent = RiFieldContentTemplate<"string", string>;
|
|
295
|
+
export type RiNumberContent = RiFieldContentTemplate<"number", number>;
|
|
296
|
+
export type RiBooleanContent = RiFieldContentTemplate<"boolean", boolean>;
|
|
297
|
+
export type RiQuillDeltaContent = RiFieldContentTemplate<"quillDelta", QuillDeltaValue>;
|
|
298
|
+
export type RiMediaContent = RiFieldContentTemplate<"media", RiMediaValue>;
|
|
299
|
+
export type RiGalleryContent = RiFieldContentTemplate<"gallery", RiGalleryValue>;
|
|
300
|
+
|
|
301
|
+
export type RiFieldContentTemplate<T extends ScFieldDataType, V> =
|
|
302
|
+
| RiLocalizedFieldContent<T, V>
|
|
303
|
+
| RiUnlocalizedFieldContent<T, V>;
|
|
304
|
+
|
|
305
|
+
export interface RiLocalizedFieldContent<T extends ScFieldDataType, V> {
|
|
286
306
|
dataType: T;
|
|
287
307
|
localized: true;
|
|
288
308
|
value: {
|
|
@@ -290,17 +310,17 @@ export interface NcLocalizedFieldContent<T extends ScFieldDataType, V> {
|
|
|
290
310
|
};
|
|
291
311
|
}
|
|
292
312
|
|
|
293
|
-
export interface
|
|
313
|
+
export interface RiUnlocalizedFieldContent<T extends ScFieldDataType, V> {
|
|
294
314
|
dataType: T;
|
|
295
315
|
localized: false;
|
|
296
316
|
value: V | null;
|
|
297
317
|
}
|
|
298
318
|
|
|
299
|
-
export interface
|
|
319
|
+
export interface RiMediaValue {
|
|
300
320
|
file: string;
|
|
301
321
|
}
|
|
302
322
|
|
|
303
|
-
export interface
|
|
323
|
+
export interface RiGalleryValue {
|
|
304
324
|
files: string[];
|
|
305
325
|
}
|
|
306
326
|
|