@paroicms/public-server-lib 0.31.3 → 0.33.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.31.3",
3
+ "version": "0.33.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.27.1",
25
- "@paroicms/public-anywhere-lib": "0.21.1",
24
+ "@paroicms/internal-anywhere-lib": "1.28.0",
25
+ "@paroicms/public-anywhere-lib": "0.22.0",
26
26
  "@types/express": "~4.17.21"
27
27
  },
28
28
  "devDependencies": {
@@ -8,6 +8,7 @@ import type {
8
8
  ScSiteSchema,
9
9
  SiteIds,
10
10
  ThemeConf,
11
+ UpdateLabelingFieldValue,
11
12
  } from "@paroicms/public-anywhere-lib";
12
13
  import type Stream from "node:stream";
13
14
 
@@ -23,9 +24,14 @@ export interface PaHttpRequest {
23
24
  /** Contains the path and the query string. */
24
25
  relativeUrl: string;
25
26
  path: string;
26
- query: { [parameterName: string]: string | undefined };
27
+ query: PaUrlQuery;
27
28
  body: object | undefined;
28
29
  file: MulterFile | undefined;
30
+ cookies?: { [key: string]: string };
31
+ }
32
+
33
+ export interface PaUrlQuery {
34
+ [key: string]: undefined | string | PaUrlQuery | (string | PaUrlQuery)[];
29
35
  }
30
36
 
31
37
  export interface MulterFile {
@@ -52,6 +58,12 @@ export interface PaHttpResponse {
52
58
  status(code: number): this;
53
59
  append(field: string, value?: string[] | string): this;
54
60
  send(body?: Buffer | object | string | Stream): this;
61
+ cookie(
62
+ name: string,
63
+ value: string,
64
+ options?: { maxAge?: number; httpOnly?: boolean; secure?: boolean; path?: string },
65
+ ): this;
66
+ clearCookie(name: string, options?: { path?: string }): this;
55
67
  }
56
68
 
57
69
  export interface ParoiCmsPlugin {
@@ -266,13 +278,13 @@ export interface RunningInstanceConnector {
266
278
  fqdn: string,
267
279
  account: RiNewAccount,
268
280
  options?: { asContactEmail?: boolean },
269
- ): Promise<void>;
281
+ ): Promise<string>;
270
282
  updateSiteFields(fqdn: string, fields: RiFieldSetContent): Promise<void>;
271
- updateDocumentContent(
283
+ updateNodeContent(
272
284
  fqdn: string,
273
285
  options: {
274
286
  nodeId: string;
275
- content: RiDocumentContent;
287
+ content: RiNodeContent;
276
288
  },
277
289
  ): Promise<void>;
278
290
  addMultipleDocumentContents(
@@ -281,14 +293,14 @@ export interface RunningInstanceConnector {
281
293
  parentNodeId: string;
282
294
  contents: RiDocumentContent[];
283
295
  },
284
- ): Promise<void>;
296
+ ): Promise<ParsedNodelId[]>;
285
297
  addMultiplePartContents(
286
298
  fqdn: string,
287
299
  options: {
288
300
  parentNodeId: string;
289
301
  contents: RiPartContent[];
290
302
  },
291
- ): Promise<void>;
303
+ ): Promise<ParsedNodelId[]>;
292
304
  registerNewSite: (options: NewSiteOptions) => Promise<RegisteredSite>;
293
305
  removeSite: (fqdn: string) => Promise<void>;
294
306
  }
@@ -313,7 +325,6 @@ export interface RiExternalNewAccount {
313
325
  name: string;
314
326
  }
315
327
 
316
- /** "Nc" stands for Node Content. */
317
328
  export type RiNodeContent = RiDocumentContent | RiPartContent;
318
329
 
319
330
  export interface RiDocumentContent {
@@ -340,7 +351,8 @@ export type RiFieldContent =
340
351
  | RiBooleanContent
341
352
  | RiQuillDeltaContent
342
353
  | RiMediaContent
343
- | RiGalleryContent;
354
+ | RiGalleryContent
355
+ | RiLabelingContent;
344
356
 
345
357
  export type RiStringContent = RiFieldContentTemplate<"string", string>;
346
358
  export type RiNumberContent = RiFieldContentTemplate<"number", number>;
@@ -348,6 +360,7 @@ export type RiBooleanContent = RiFieldContentTemplate<"boolean", boolean>;
348
360
  export type RiQuillDeltaContent = RiFieldContentTemplate<"json", JsonFieldValue>;
349
361
  export type RiMediaContent = RiFieldContentTemplate<"media", RiMediaValue>;
350
362
  export type RiGalleryContent = RiFieldContentTemplate<"gallery", RiGalleryValue>;
363
+ export type RiLabelingContent = RiUnlocalizedFieldContent<"labeling", UpdateLabelingFieldValue>;
351
364
 
352
365
  export type RiFieldContentTemplate<T extends ScFieldDataType, V> =
353
366
  | RiLocalizedFieldContent<T, V>