@enonic-types/lib-content 8.0.4-B1 → 8.0.4-B2

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.
Files changed (2) hide show
  1. package/content.d.ts +33 -3
  2. package/package.json +2 -2
package/content.d.ts CHANGED
@@ -41,7 +41,10 @@ export interface PatchableContent<Data extends Record<string, unknown> = Record<
41
41
  variantOf: string;
42
42
  attachments: Attachments;
43
43
  validationErrors: ValidationError[];
44
- type: Type;
44
+ /**
45
+ * Read-only. Available on the content passed to the patcher, but assigning it has no effect.
46
+ */
47
+ readonly type: Type;
45
48
  childOrder: string;
46
49
  originProject: string;
47
50
  originalParentPath: string;
@@ -429,9 +432,21 @@ export interface PublishContentParams {
429
432
  includeDependencies?: boolean;
430
433
  message?: string;
431
434
  }
435
+ export type PublishFailureReason = 'ALREADY_EXIST' | 'PARENT_NOT_FOUND' | 'ACCESS_DENIED' | 'INVALID' | 'NOT_READY';
436
+ export interface PublishFailure {
437
+ id: string;
438
+ reason: PublishFailureReason;
439
+ }
432
440
  export interface PublishContentResult {
433
441
  pushedContents: string[];
434
442
  failedContents: string[];
443
+ /**
444
+ * One entry per content the publish engine rejected, with the reason it was rejected.
445
+ *
446
+ * Keys that could not be resolved to any content never reach the engine and so have no reason;
447
+ * they are listed in `failedContents` only.
448
+ */
449
+ failed: PublishFailure[];
435
450
  }
436
451
  /**
437
452
  * This function publishes content from the draft branch to the master branch.
@@ -449,7 +464,10 @@ export interface PublishContentResult {
449
464
  * @param {boolean} [params.includeDependencies=true] Whether all related content should be included when publishing content.
450
465
  * @param {string} [params.message] Publish message.
451
466
  *
452
- * @returns {object} Status of the publish operation in JSON.
467
+ * @returns {object} Status of the publish operation in JSON. In addition to the `pushedContents` and `failedContents` id arrays,
468
+ * `failed` holds one `{id, reason}` entry per content the engine rejected, where reason is one of
469
+ * `ALREADY_EXIST`, `PARENT_NOT_FOUND`, `ACCESS_DENIED`, `INVALID` or `NOT_READY`. Keys that could not be resolved to any
470
+ * content never reach the engine and are listed in `failedContents` only.
453
471
  */
454
472
  export declare function publish(params: PublishContentParams): PublishContentResult;
455
473
  export interface UnpublishContentParams {
@@ -572,7 +590,11 @@ export interface ApplyPermissionsParams {
572
590
  addPermissions?: AccessControlEntry[];
573
591
  removePermissions?: AccessControlEntry[];
574
592
  }
575
- export type ApplyPermissionsResult = Record<string, BranchResult[]>;
593
+ export type ApplyPermissionsResult = Record<string, Permissions>;
594
+ /**
595
+ * @deprecated Never emitted by `applyPermissions`, which returns one `Permissions` object per content id.
596
+ * Kept only so existing imports keep resolving.
597
+ */
576
598
  export interface BranchResult {
577
599
  branch: string;
578
600
  permissions: AccessControlEntry[];
@@ -798,6 +820,14 @@ export interface ContentVersion {
798
820
  }
799
821
  export interface ContentVersionAction {
800
822
  operation: string;
823
+ /**
824
+ * Branch the operation was performed in.
825
+ */
826
+ origin?: string;
827
+ /**
828
+ * Version id of the editorial content this version originates from.
829
+ */
830
+ editorial?: string;
801
831
  user: string;
802
832
  opTime: string;
803
833
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enonic-types/lib-content",
3
- "version": "8.0.4-B1",
3
+ "version": "8.0.4-B2",
4
4
  "description": "Type definitions for lib-content.",
5
5
  "types": "content.d.ts",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/enonic/xp/tree/master#readme",
29
29
  "dependencies": {
30
- "@enonic-types/core": "8.0.4-B1"
30
+ "@enonic-types/core": "8.0.4-B2"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"