@paroicms/public-server-lib 0.26.0 → 0.27.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paroicms/public-server-lib",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "Common utilitaries for paroicms plugins (backend side).",
5
5
  "author": "Paroi Team",
6
6
  "repository": {
@@ -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
- updateSiteFields(fqdn: string, fields: NcFieldSetContent): Promise<void>;
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: NcDocumentContent;
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: NcDocumentContent[];
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: NcPartContent[];
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 NcNodeContent = NcDocumentContent | NcPartContent;
266
+ export type RiNodeContent = RiDocumentContent | RiPartContent;
247
267
 
248
- export interface NcDocumentContent {
268
+ export interface RiDocumentContent {
249
269
  kind: "document";
250
270
  typeName: string;
251
271
  title?: { [language: string]: string };
252
- featuredImage?: NcMediaValue;
253
- fields: NcFieldSetContent;
272
+ featuredImage?: RiMediaValue;
273
+ fields: RiFieldSetContent;
254
274
  }
255
275
 
256
- export interface NcPartContent {
276
+ export interface RiPartContent {
257
277
  kind: "part";
258
278
  typeName: string;
259
- fields: NcFieldSetContent;
279
+ fields: RiFieldSetContent;
260
280
  }
261
281
 
262
- export interface NcFieldSetContent {
263
- [fieldName: string]: NcFieldContent;
282
+ export interface RiFieldSetContent {
283
+ [fieldName: string]: RiFieldContent;
264
284
  }
265
285
 
266
- export type NcFieldContent =
267
- | NcStringContent
268
- | NcNumberContent
269
- | NcBooleanContent
270
- | NcQuillDeltaContent
271
- | NcMediaContent
272
- | NcGalleryContent;
273
-
274
- export type NcStringContent = NcFieldContentTemplate<"string", string>;
275
- export type NcNumberContent = NcFieldContentTemplate<"number", number>;
276
- export type NcBooleanContent = NcFieldContentTemplate<"boolean", boolean>;
277
- export type NcQuillDeltaContent = NcFieldContentTemplate<"quillDelta", QuillDeltaValue>;
278
- export type NcMediaContent = NcFieldContentTemplate<"media", NcMediaValue>;
279
- export type NcGalleryContent = NcFieldContentTemplate<"gallery", NcGalleryValue>;
280
-
281
- export type NcFieldContentTemplate<T extends ScFieldDataType, V> =
282
- | NcLocalizedFieldContent<T, V>
283
- | NcUnlocalizedFieldContent<T, V>;
284
-
285
- export interface NcLocalizedFieldContent<T extends ScFieldDataType, V> {
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 NcUnlocalizedFieldContent<T extends ScFieldDataType, V> {
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 NcMediaValue {
319
+ export interface RiMediaValue {
300
320
  file: string;
301
321
  }
302
322
 
303
- export interface NcGalleryValue {
323
+ export interface RiGalleryValue {
304
324
  files: string[];
305
325
  }
306
326