@contentchef/contentchef-types 11.2.0-alpha.5 → 11.2.0-alpha.6

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.
@@ -31,7 +31,8 @@ export type ComponentRename = {
31
31
  */
32
32
  export type DefinitionRename = ComponentRename & {
33
33
  /**
34
- * The definition's own fragment holding the field, left out or null at the root
34
+ * The definition's own fragment holding the field, named as the definition has it before the save,
35
+ * left out or null at the root
35
36
  */
36
37
  fragment?: string | null;
37
38
  };
@@ -416,11 +417,29 @@ export type ComponentVersionViolation = {
416
417
  message: string;
417
418
  };
418
419
  /**
419
- * This type represent a rename a definition save may not declare: from a field the definition does not
420
- * have or the save still has, onto one the save does not have or the definition has already, a field in
421
- * two renames, or a `fragment` that is not one of the definition's own on both sides
420
+ * This type represent a rename a definition save may not declare
422
421
  */
423
- export type DefinitionRenameViolation = {
422
+ export type DefinitionRenameViolation =
423
+ /**
424
+ * A fragment rename from one that is not the definition's own or that the save still has, onto one the
425
+ * save does not have as its own or the definition has already, or a name in two fragment renames.
426
+ * Field renames are not judged until the fragment renames fit
427
+ */
428
+ {
429
+ /**
430
+ * The fragment's new name
431
+ */
432
+ fragment: string;
433
+ field: null;
434
+ code: 'definition.invalidFragmentRename';
435
+ message: string;
436
+ }
437
+ /**
438
+ * A field rename from a field the definition does not have or the save still has, onto one the save
439
+ * does not have or the definition has already, a field in two renames, or a `fragment` that is none of
440
+ * the definition's own kept or renamed by the save
441
+ */
442
+ | {
424
443
  /**
425
444
  * The rename's fragment, null at the root
426
445
  */
@@ -608,6 +627,7 @@ export type MigrationPreviewRequest = {
608
627
  id: ContentDefinitionId;
609
628
  schema: ContentDefinitionSchemaInput;
610
629
  renames?: DefinitionRename[];
630
+ fragmentRenames?: ComponentRename[];
611
631
  } | {
612
632
  id: ContentDefinitionId;
613
633
  adopt: {
@@ -683,6 +703,13 @@ export type GetMigrationPreviewResponse = {
683
703
  scanned: number;
684
704
  total: number;
685
705
  fields: MigrationPreviewField[];
706
+ /**
707
+ * The definition's own fragments renamed, and how many `oneFragmentOf` values take their new name;
708
+ * empty for a component
709
+ */
710
+ fragments: (ComponentRename & {
711
+ values: number;
712
+ })[];
686
713
  /**
687
714
  * The contents whose payload or translations would change
688
715
  */
@@ -1,6 +1,6 @@
1
1
  import { AuthorResponse } from './Author';
2
2
  import { PagedListResponse } from './common';
3
- import { DefinitionMigrationState, DefinitionRename, FieldChanges } from './Component';
3
+ import { ComponentRename, DefinitionMigrationState, DefinitionRename, FieldChanges } from './Component';
4
4
  import { ComponentMarker, ContentDefinitionSchema, ContentDefinitionSchemaInput, Field, I18NDictionary } from './ContentDefinitionSchema';
5
5
  import { Extension } from './Extension';
6
6
  /**
@@ -132,10 +132,17 @@ export type UpdateContentDefinitionRequest = {
132
132
  */
133
133
  bypassLinkedContentValidation?: boolean;
134
134
  /**
135
- * The fields the save gives another name, at the root or in one of the definition's own fragments, for
136
- * their values to follow. Undeclared, a rename is a removal and an addition, and the values are set aside
135
+ * The fields the save gives another name, at the root or in one of the definition's own fragments named
136
+ * as before the save, for their values to follow. Undeclared, a rename is a removal and an addition, and
137
+ * the values are set aside
137
138
  */
138
139
  renames?: DefinitionRename[];
140
+ /**
141
+ * The definition's own fragments the save gives another name: the fields using them move nothing, and
142
+ * the stored `oneFragmentOf` values take the new name. Undeclared, a fragment rename is a removal and an
143
+ * addition, and the values that no longer fit are set aside whole
144
+ */
145
+ fragmentRenames?: ComponentRename[];
139
146
  };
140
147
  /**
141
148
  * This type represent the model of a content definition
@@ -41,7 +41,8 @@ export type ComponentRename = {
41
41
  */
42
42
  export type DefinitionRename = ComponentRename & {
43
43
  /**
44
- * The definition's own fragment holding the field, left out or null at the root
44
+ * The definition's own fragment holding the field, named as the definition has it before the save,
45
+ * left out or null at the root
45
46
  */
46
47
  fragment?: string | null;
47
48
  };
@@ -439,22 +440,40 @@ export type ComponentVersionViolation = {
439
440
  };
440
441
 
441
442
  /**
442
- * This type represent a rename a definition save may not declare: from a field the definition does not
443
- * have or the save still has, onto one the save does not have or the definition has already, a field in
444
- * two renames, or a `fragment` that is not one of the definition's own on both sides
443
+ * This type represent a rename a definition save may not declare
445
444
  */
446
- export type DefinitionRenameViolation = {
445
+ export type DefinitionRenameViolation =
447
446
  /**
448
- * The rename's fragment, null at the root
447
+ * A fragment rename from one that is not the definition's own or that the save still has, onto one the
448
+ * save does not have as its own or the definition has already, or a name in two fragment renames.
449
+ * Field renames are not judged until the fragment renames fit
449
450
  */
450
- fragment: string | null;
451
+ | {
452
+ /**
453
+ * The fragment's new name
454
+ */
455
+ fragment: string;
456
+ field: null;
457
+ code: 'definition.invalidFragmentRename';
458
+ message: string;
459
+ }
451
460
  /**
452
- * The rename's `to`
461
+ * A field rename from a field the definition does not have or the save still has, onto one the save
462
+ * does not have or the definition has already, a field in two renames, or a `fragment` that is none of
463
+ * the definition's own kept or renamed by the save
453
464
  */
454
- field: string;
455
- code: 'definition.invalidRename';
456
- message: string;
457
- };
465
+ | {
466
+ /**
467
+ * The rename's fragment, null at the root
468
+ */
469
+ fragment: string | null;
470
+ /**
471
+ * The rename's `to`
472
+ */
473
+ field: string;
474
+ code: 'definition.invalidRename';
475
+ message: string;
476
+ };
458
477
 
459
478
  type ComponentErrorOf<T extends ComponentErrorTypes, D = {}> = { type: T; message: string } & D;
460
479
 
@@ -617,7 +636,12 @@ export type MigrationPreviewId = number;
617
636
  * declare, or the adoption about to be made
618
637
  */
619
638
  export type MigrationPreviewRequest =
620
- | { id: ContentDefinitionId; schema: ContentDefinitionSchemaInput; renames?: DefinitionRename[] }
639
+ | {
640
+ id: ContentDefinitionId;
641
+ schema: ContentDefinitionSchemaInput;
642
+ renames?: DefinitionRename[];
643
+ fragmentRenames?: ComponentRename[];
644
+ }
621
645
  | { id: ContentDefinitionId; adopt: { mnemonicId: string; version: number; renames?: ComponentRename[] } };
622
646
 
623
647
  /**
@@ -690,6 +714,11 @@ export type GetMigrationPreviewResponse = {
690
714
  scanned: number;
691
715
  total: number;
692
716
  fields: MigrationPreviewField[];
717
+ /**
718
+ * The definition's own fragments renamed, and how many `oneFragmentOf` values take their new name;
719
+ * empty for a component
720
+ */
721
+ fragments: (ComponentRename & { values: number })[];
693
722
  /**
694
723
  * The contents whose payload or translations would change
695
724
  */
@@ -1,6 +1,6 @@
1
1
  import { AuthorResponse } from './Author';
2
2
  import { PagedListResponse } from './common';
3
- import { DefinitionMigrationState, DefinitionRename, FieldChanges } from './Component';
3
+ import { ComponentRename, DefinitionMigrationState, DefinitionRename, FieldChanges } from './Component';
4
4
  import { ComponentMarker, ContentDefinitionSchema, ContentDefinitionSchemaInput, Field, I18NDictionary } from './ContentDefinitionSchema';
5
5
  import { Extension } from './Extension';
6
6
 
@@ -143,10 +143,17 @@ export type UpdateContentDefinitionRequest = {
143
143
  */
144
144
  bypassLinkedContentValidation?: boolean;
145
145
  /**
146
- * The fields the save gives another name, at the root or in one of the definition's own fragments, for
147
- * their values to follow. Undeclared, a rename is a removal and an addition, and the values are set aside
146
+ * The fields the save gives another name, at the root or in one of the definition's own fragments named
147
+ * as before the save, for their values to follow. Undeclared, a rename is a removal and an addition, and
148
+ * the values are set aside
148
149
  */
149
150
  renames?: DefinitionRename[];
151
+ /**
152
+ * The definition's own fragments the save gives another name: the fields using them move nothing, and
153
+ * the stored `oneFragmentOf` values take the new name. Undeclared, a fragment rename is a removal and an
154
+ * addition, and the values that no longer fit are set aside whole
155
+ */
156
+ fragmentRenames?: ComponentRename[];
150
157
  };
151
158
 
152
159
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentchef/contentchef-types",
3
- "version": "11.2.0-alpha.5",
3
+ "version": "11.2.0-alpha.6",
4
4
  "description": "ContentChef types",
5
5
  "author": "PierpaoloIannone <piannone@byte-code.com>",
6
6
  "homepage": "https://github.com/ContentChef/contentchef-management-js-client#readme",
@@ -34,5 +34,5 @@
34
34
  "devDependencies": {
35
35
  "typescript": "^5.9.3"
36
36
  },
37
- "gitHead": "ccaa9d0ae10d67701cf34df7ec127c3c40fefae4"
37
+ "gitHead": "e8292eac50e55b57a28d69b9128d46eb41d225a9"
38
38
  }