@contentchef/contentchef-types 11.2.0-alpha.3 → 11.2.0-alpha.5
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/dist/api/Component.d.ts +119 -10
- package/dist/api/Component.js +1 -0
- package/dist/api/Content.d.ts +11 -4
- package/dist/api/ContentDefinition.d.ts +6 -1
- package/dist/api/PublishedContent.d.ts +310 -1
- package/dist/api/PublishedContent.js +39 -1
- package/lib/api/Component.ts +125 -12
- package/lib/api/Content.ts +11 -4
- package/lib/api/ContentDefinition.ts +6 -1
- package/lib/api/PublishedContent.ts +323 -1
- package/package.json +2 -2
package/dist/api/Component.d.ts
CHANGED
|
@@ -24,6 +24,17 @@ export type ComponentRename = {
|
|
|
24
24
|
from: string;
|
|
25
25
|
to: string;
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* This type represent a field of a definition's root, or of one of its own fragments, that a save gives
|
|
29
|
+
* another name, so that its values and translations follow. Unlike a version's rename, the type may
|
|
30
|
+
* change: the values are then checked against the field they move to
|
|
31
|
+
*/
|
|
32
|
+
export type DefinitionRename = ComponentRename & {
|
|
33
|
+
/**
|
|
34
|
+
* The definition's own fragment holding the field, left out or null at the root
|
|
35
|
+
*/
|
|
36
|
+
fragment?: string | null;
|
|
37
|
+
};
|
|
27
38
|
/**
|
|
28
39
|
* This type represent field names, by what happened to them between two versions of a fragment.
|
|
29
40
|
* A field whose type changed is `changed`; a renamed field is in `renamed`, and in neither `added` nor
|
|
@@ -366,6 +377,7 @@ export declare enum ComponentErrorTypes {
|
|
|
366
377
|
noFragmentToPromote = "NoFragmentToPromote",
|
|
367
378
|
definitionMigrating = "DefinitionMigrating",
|
|
368
379
|
oneMigrationPerSave = "OneMigrationPerSave",
|
|
380
|
+
definitionRenamesRefused = "DefinitionRenamesRefused",
|
|
369
381
|
migrationPreviewNotFound = "MigrationPreviewNotFound",
|
|
370
382
|
invalidComparison = "InvalidComparison",
|
|
371
383
|
fieldNotFound = "FieldNotFound",
|
|
@@ -403,6 +415,23 @@ export type ComponentVersionViolation = {
|
|
|
403
415
|
code: string;
|
|
404
416
|
message: string;
|
|
405
417
|
};
|
|
418
|
+
/**
|
|
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
|
|
422
|
+
*/
|
|
423
|
+
export type DefinitionRenameViolation = {
|
|
424
|
+
/**
|
|
425
|
+
* The rename's fragment, null at the root
|
|
426
|
+
*/
|
|
427
|
+
fragment: string | null;
|
|
428
|
+
/**
|
|
429
|
+
* The rename's `to`
|
|
430
|
+
*/
|
|
431
|
+
field: string;
|
|
432
|
+
code: 'definition.invalidRename';
|
|
433
|
+
message: string;
|
|
434
|
+
};
|
|
406
435
|
type ComponentErrorOf<T extends ComponentErrorTypes, D = {}> = {
|
|
407
436
|
type: T;
|
|
408
437
|
message: string;
|
|
@@ -458,11 +487,14 @@ export type ComponentError = ComponentErrorOf<ComponentErrorTypes.componentNotFo
|
|
|
458
487
|
*/
|
|
459
488
|
| ComponentErrorOf<ComponentErrorTypes.definitionMigrating, DefinitionMigrationState>
|
|
460
489
|
/**
|
|
461
|
-
* A save that would migrate the values of more than one component
|
|
462
|
-
* has finished
|
|
490
|
+
* A save that would migrate the values of more than one component, or of a component and of the
|
|
491
|
+
* definition's own fields (`ownFields`): save one, then the other once its migration has finished
|
|
463
492
|
*/
|
|
464
493
|
| ComponentErrorOf<ComponentErrorTypes.oneMigrationPerSave, {
|
|
465
494
|
mnemonicIds: string[];
|
|
495
|
+
ownFields: boolean;
|
|
496
|
+
}> | ComponentErrorOf<ComponentErrorTypes.definitionRenamesRefused, {
|
|
497
|
+
violations: DefinitionRenameViolation[];
|
|
466
498
|
}> | ComponentErrorOf<ComponentErrorTypes.migrationPreviewNotFound, {
|
|
467
499
|
id: MigrationPreviewId;
|
|
468
500
|
}>
|
|
@@ -482,8 +514,9 @@ export type ComponentError = ComponentErrorOf<ComponentErrorTypes.componentNotFo
|
|
|
482
514
|
* This type represent where a definition's contents stand, as the get content definition, update content
|
|
483
515
|
* definition and get migration API requests answer it
|
|
484
516
|
*
|
|
485
|
-
* An upgrade
|
|
486
|
-
* migrates its contents in the background, one migration at a
|
|
517
|
+
* An upgrade, an adoption, or a save of the definition's own fields that renames, removes or retypes
|
|
518
|
+
* fields bumps the definition's revision and migrates its contents in the background, one migration at a
|
|
519
|
+
* time per definition
|
|
487
520
|
*/
|
|
488
521
|
export type DefinitionMigrationState = {
|
|
489
522
|
/**
|
|
@@ -517,9 +550,13 @@ export type SetAsideValue = {
|
|
|
517
550
|
*/
|
|
518
551
|
revision: number;
|
|
519
552
|
/**
|
|
520
|
-
* The component it was a value of
|
|
553
|
+
* The component it was a value of, null for a value of the definition's own fields
|
|
521
554
|
*/
|
|
522
|
-
mnemonicId: string;
|
|
555
|
+
mnemonicId: string | null;
|
|
556
|
+
/**
|
|
557
|
+
* The definition's own fragment it was in, null at the root and for a component's value
|
|
558
|
+
*/
|
|
559
|
+
fragment: string | null;
|
|
523
560
|
/**
|
|
524
561
|
* Where it was, in the key format translation entries use, with the names the payload has now:
|
|
525
562
|
* `pic.credit`, `gallery.$k1.width`
|
|
@@ -564,11 +601,13 @@ export type SetAsideResolution = {
|
|
|
564
601
|
export type MigrationPreviewId = number;
|
|
565
602
|
/**
|
|
566
603
|
* This type represent the data needed to make a migration preview API request: the definition, and the
|
|
567
|
-
* schema about to be saved with the update content definition API request
|
|
604
|
+
* schema about to be saved with the update content definition API request with the renames it will
|
|
605
|
+
* declare, or the adoption about to be made
|
|
568
606
|
*/
|
|
569
607
|
export type MigrationPreviewRequest = {
|
|
570
608
|
id: ContentDefinitionId;
|
|
571
609
|
schema: ContentDefinitionSchemaInput;
|
|
610
|
+
renames?: DefinitionRename[];
|
|
572
611
|
} | {
|
|
573
612
|
id: ContentDefinitionId;
|
|
574
613
|
adopt: {
|
|
@@ -595,6 +634,10 @@ export type GetMigrationPreviewRequest = {
|
|
|
595
634
|
* values move or are checked
|
|
596
635
|
*/
|
|
597
636
|
export type MigrationPreviewField = {
|
|
637
|
+
/**
|
|
638
|
+
* The definition's own fragment holding the field, null at the root and for a component's field
|
|
639
|
+
*/
|
|
640
|
+
fragment: string | null;
|
|
598
641
|
field: string;
|
|
599
642
|
outcome: 'renamed' | 'changed' | 'removed';
|
|
600
643
|
/**
|
|
@@ -624,12 +667,15 @@ export type MigrationPreviewField = {
|
|
|
624
667
|
export type GetMigrationPreviewResponse = {
|
|
625
668
|
id: MigrationPreviewId;
|
|
626
669
|
definitionId: ContentDefinitionId;
|
|
627
|
-
mnemonicId: string;
|
|
628
670
|
/**
|
|
629
|
-
*
|
|
671
|
+
* The component, null for a save changing the definition's own fields, as `from` and `to`
|
|
672
|
+
*/
|
|
673
|
+
mnemonicId: string | null;
|
|
674
|
+
/**
|
|
675
|
+
* Null for an adoption, and for the definition's own fields
|
|
630
676
|
*/
|
|
631
677
|
from: number | null;
|
|
632
|
-
to: number;
|
|
678
|
+
to: number | null;
|
|
633
679
|
status: 'running' | 'done';
|
|
634
680
|
/**
|
|
635
681
|
* The contents walked so far, out of `total`
|
|
@@ -672,4 +718,67 @@ export type ResumeMigrationRequest = {
|
|
|
672
718
|
* This type represent the response of a resume migration API request
|
|
673
719
|
*/
|
|
674
720
|
export type ResumeMigrationResponse = DefinitionMigrationState;
|
|
721
|
+
/**
|
|
722
|
+
* This type represent the data needed to make a get set aside API request
|
|
723
|
+
*/
|
|
724
|
+
export type GetSetAsideRequest = {
|
|
725
|
+
/**
|
|
726
|
+
* The content definition unique id
|
|
727
|
+
*/
|
|
728
|
+
id: ContentDefinitionId;
|
|
729
|
+
};
|
|
730
|
+
/**
|
|
731
|
+
* This type represent what a definition's contents hold set aside for one field by one revision
|
|
732
|
+
*/
|
|
733
|
+
export type SetAsideGroup = {
|
|
734
|
+
revision: number;
|
|
735
|
+
/**
|
|
736
|
+
* The component, null for the definition's own fields
|
|
737
|
+
*/
|
|
738
|
+
mnemonicId: string | null;
|
|
739
|
+
/**
|
|
740
|
+
* The definition's own fragment, null at the root and for a component's field
|
|
741
|
+
*/
|
|
742
|
+
fragment: string | null;
|
|
743
|
+
/**
|
|
744
|
+
* The field's name as the version it came from had it
|
|
745
|
+
*/
|
|
746
|
+
field: string;
|
|
747
|
+
reason: 'removed' | 'changed';
|
|
748
|
+
/**
|
|
749
|
+
* The contents holding such values
|
|
750
|
+
*/
|
|
751
|
+
contents: number;
|
|
752
|
+
values: number;
|
|
753
|
+
};
|
|
754
|
+
/**
|
|
755
|
+
* This type represent the response of a get set aside API request, by revision, then fragment, then field,
|
|
756
|
+
* components' values included
|
|
757
|
+
*/
|
|
758
|
+
export type GetSetAsideResponse = SetAsideGroup[];
|
|
759
|
+
/**
|
|
760
|
+
* This type represent the data needed to make a discard set aside API request: one group as the get set
|
|
761
|
+
* aside API request answers it
|
|
762
|
+
*/
|
|
763
|
+
export type DiscardSetAsideRequest = {
|
|
764
|
+
/**
|
|
765
|
+
* The content definition unique id
|
|
766
|
+
*/
|
|
767
|
+
id: ContentDefinitionId;
|
|
768
|
+
revision: number;
|
|
769
|
+
fragment?: string | null;
|
|
770
|
+
field: string;
|
|
771
|
+
/**
|
|
772
|
+
* Where the previous call stopped, its `next`
|
|
773
|
+
*/
|
|
774
|
+
after?: number;
|
|
775
|
+
};
|
|
776
|
+
/**
|
|
777
|
+
* This type represent the response of a discard set aside API request. A call works for about five
|
|
778
|
+
* seconds: call again with `after: next` until `next` is null
|
|
779
|
+
*/
|
|
780
|
+
export type DiscardSetAsideResponse = {
|
|
781
|
+
discarded: number;
|
|
782
|
+
next: number | null;
|
|
783
|
+
};
|
|
675
784
|
export {};
|
package/dist/api/Component.js
CHANGED
|
@@ -27,6 +27,7 @@ var ComponentErrorTypes;
|
|
|
27
27
|
ComponentErrorTypes["noFragmentToPromote"] = "NoFragmentToPromote";
|
|
28
28
|
ComponentErrorTypes["definitionMigrating"] = "DefinitionMigrating";
|
|
29
29
|
ComponentErrorTypes["oneMigrationPerSave"] = "OneMigrationPerSave";
|
|
30
|
+
ComponentErrorTypes["definitionRenamesRefused"] = "DefinitionRenamesRefused";
|
|
30
31
|
ComponentErrorTypes["migrationPreviewNotFound"] = "MigrationPreviewNotFound";
|
|
31
32
|
ComponentErrorTypes["invalidComparison"] = "InvalidComparison";
|
|
32
33
|
ComponentErrorTypes["fieldNotFound"] = "FieldNotFound";
|
package/dist/api/Content.d.ts
CHANGED
|
@@ -1083,7 +1083,8 @@ export type RestoreViolations = {
|
|
|
1083
1083
|
violations: ContentConstraintViolation[];
|
|
1084
1084
|
}[];
|
|
1085
1085
|
/**
|
|
1086
|
-
*
|
|
1086
|
+
* @deprecated Always empty: what the migrations since set aside no longer keeps a version from being
|
|
1087
|
+
* restored, see [[GetContentHistoryEntryResponse.setAside]]
|
|
1087
1088
|
*/
|
|
1088
1089
|
setAside: {
|
|
1089
1090
|
path: string;
|
|
@@ -1104,13 +1105,19 @@ export type GetContentHistoryEntryResponse = ContentHistoryEntry & {
|
|
|
1104
1105
|
restorable: boolean;
|
|
1105
1106
|
violations: RestoreViolations;
|
|
1106
1107
|
/**
|
|
1107
|
-
* Values of fields removed from the definition by hand
|
|
1108
|
-
* entries. They are left out of `payload` and `translations`, as a save leaves them
|
|
1109
|
-
* keep the version from being restored
|
|
1108
|
+
* Values of fields removed from the definition by hand, before saves migrated contents, `path` in the key
|
|
1109
|
+
* format of translation entries. They are left out of `payload` and `translations`, as a save leaves them
|
|
1110
|
+
* out, so they do not keep the version from being restored
|
|
1110
1111
|
*/
|
|
1111
1112
|
dropped: {
|
|
1112
1113
|
path: string;
|
|
1113
1114
|
}[];
|
|
1115
|
+
/**
|
|
1116
|
+
* Values the migrations since set aside, removed or retyped fields of a component or of the definition.
|
|
1117
|
+
* They are left out of `payload` and `translations`, and a restore writes them beside the content, once,
|
|
1118
|
+
* for a person to move or discard
|
|
1119
|
+
*/
|
|
1120
|
+
setAside: SetAsideValue[];
|
|
1114
1121
|
};
|
|
1115
1122
|
/**
|
|
1116
1123
|
* This type represent the data needed to make a restore content API request
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AuthorResponse } from './Author';
|
|
2
2
|
import { PagedListResponse } from './common';
|
|
3
|
-
import { DefinitionMigrationState, FieldChanges } from './Component';
|
|
3
|
+
import { DefinitionMigrationState, DefinitionRename, FieldChanges } from './Component';
|
|
4
4
|
import { ComponentMarker, ContentDefinitionSchema, ContentDefinitionSchemaInput, Field, I18NDictionary } from './ContentDefinitionSchema';
|
|
5
5
|
import { Extension } from './Extension';
|
|
6
6
|
/**
|
|
@@ -131,6 +131,11 @@ export type UpdateContentDefinitionRequest = {
|
|
|
131
131
|
* will bypass content definition mnemonicId validation for every linked-content field
|
|
132
132
|
*/
|
|
133
133
|
bypassLinkedContentValidation?: boolean;
|
|
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
|
|
137
|
+
*/
|
|
138
|
+
renames?: DefinitionRename[];
|
|
134
139
|
};
|
|
135
140
|
/**
|
|
136
141
|
* This type represent the model of a content definition
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentId, LocalizationSettings } from "./Content";
|
|
1
|
+
import { ContentId, LocalizationSettings, SortDirection } from "./Content";
|
|
2
2
|
import { AuthorResponse } from "./Author";
|
|
3
3
|
import { ContentRepositoryId } from "./ContentRepository";
|
|
4
4
|
import { ContentTranslationStatus } from "./ContentTranslation";
|
|
@@ -452,3 +452,312 @@ export type ListReleaseItemsV2Response = PagedListResponse<ReleaseItemGroup> & {
|
|
|
452
452
|
* This type represent the response of a get published content API request
|
|
453
453
|
*/
|
|
454
454
|
export type GetPublishedContentResponse = PublishedContentResponse | undefined;
|
|
455
|
+
/**
|
|
456
|
+
* This enum represent how the items of [[PropFilters]] combine
|
|
457
|
+
*/
|
|
458
|
+
export declare enum LogicalOperators {
|
|
459
|
+
AND = "AND",
|
|
460
|
+
OR = "OR"
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* This enum represent how a [[PropFilterItem]] compares an indexed field with its value. The `_IC`
|
|
464
|
+
* variants ignore case
|
|
465
|
+
*/
|
|
466
|
+
export declare enum ConditionOperators {
|
|
467
|
+
CONTAINS = "CONTAINS",
|
|
468
|
+
CONTAINS_IC = "CONTAINS_IC",
|
|
469
|
+
EQUALS = "EQUALS",
|
|
470
|
+
EQUALS_IC = "EQUALS_IC",
|
|
471
|
+
IN = "IN",
|
|
472
|
+
IN_IC = "IN_IC",
|
|
473
|
+
STARTS_WITH = "STARTS_WITH",
|
|
474
|
+
STARTS_WITH_IC = "STARTS_WITH_IC"
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* This type represent one condition over an indexed field of a published content, as the delivery API
|
|
478
|
+
* takes it
|
|
479
|
+
*/
|
|
480
|
+
export type PropFilterItem = {
|
|
481
|
+
field: string;
|
|
482
|
+
operator: ConditionOperators;
|
|
483
|
+
/**
|
|
484
|
+
* An array for [[ConditionOperators.IN]] and [[ConditionOperators.IN_IC]]
|
|
485
|
+
*/
|
|
486
|
+
value: string | string[];
|
|
487
|
+
};
|
|
488
|
+
/**
|
|
489
|
+
* This type represent the delivery API's property filters, over the indexed fields of a published content
|
|
490
|
+
*/
|
|
491
|
+
export type PropFilters = {
|
|
492
|
+
condition: LogicalOperators;
|
|
493
|
+
/**
|
|
494
|
+
* From 1 to 10
|
|
495
|
+
*/
|
|
496
|
+
items: PropFilterItem[];
|
|
497
|
+
};
|
|
498
|
+
/**
|
|
499
|
+
* This type represent which date of a content's online window has to fall within a timeline's range:
|
|
500
|
+
* `overlap`, online at some point of it, `starts`, its online date, or `ends`, its offline date
|
|
501
|
+
*/
|
|
502
|
+
export type TimelineMatch = "overlap" | "starts" | "ends";
|
|
503
|
+
/**
|
|
504
|
+
* This type represent the range and filters of the timeline API requests. Every filter given applies,
|
|
505
|
+
* together, and a list filter matches a content that has one of its values
|
|
506
|
+
*/
|
|
507
|
+
export type TimelineFilters = {
|
|
508
|
+
/**
|
|
509
|
+
* The range's start, as an ISO 8601 string. With `from` equal to `to`, what is online at that instant
|
|
510
|
+
*/
|
|
511
|
+
from: string;
|
|
512
|
+
/**
|
|
513
|
+
* The range's end, as an ISO 8601 string, not before `from` and at most 400 days after it
|
|
514
|
+
*/
|
|
515
|
+
to: string;
|
|
516
|
+
/**
|
|
517
|
+
* `overlap` by default
|
|
518
|
+
*/
|
|
519
|
+
match?: TimelineMatch;
|
|
520
|
+
/**
|
|
521
|
+
* Whether the contents with neither date, online all the time, are left out, by default, or included
|
|
522
|
+
*/
|
|
523
|
+
undated?: "exclude" | "include";
|
|
524
|
+
/**
|
|
525
|
+
* From 2 to 100 characters, matched anywhere in the name, the public id or the external identifier,
|
|
526
|
+
* ignoring case
|
|
527
|
+
*/
|
|
528
|
+
search?: string;
|
|
529
|
+
/**
|
|
530
|
+
* Up to 500
|
|
531
|
+
*/
|
|
532
|
+
publicIds?: string[];
|
|
533
|
+
/**
|
|
534
|
+
* Up to 500
|
|
535
|
+
*/
|
|
536
|
+
contentIds?: ContentId[];
|
|
537
|
+
/**
|
|
538
|
+
* Content definition mnemonic ids, up to 100
|
|
539
|
+
*/
|
|
540
|
+
definitions?: string[];
|
|
541
|
+
/**
|
|
542
|
+
* Content repository mnemonic ids, up to 100
|
|
543
|
+
*/
|
|
544
|
+
repositories?: string[];
|
|
545
|
+
/**
|
|
546
|
+
* Up to 100
|
|
547
|
+
*/
|
|
548
|
+
channels?: string[];
|
|
549
|
+
/**
|
|
550
|
+
* Up to 100
|
|
551
|
+
*/
|
|
552
|
+
tags?: string[];
|
|
553
|
+
/**
|
|
554
|
+
* Up to 100
|
|
555
|
+
*/
|
|
556
|
+
locales?: string[];
|
|
557
|
+
propFilters?: PropFilters;
|
|
558
|
+
};
|
|
559
|
+
/**
|
|
560
|
+
* This type represent a version of a content on the timeline: `live`, the one delivery serves, or
|
|
561
|
+
* `pending`, the one published to stage and not promoted yet
|
|
562
|
+
*/
|
|
563
|
+
export type TimelineVersionKind = "live" | "pending";
|
|
564
|
+
/**
|
|
565
|
+
* This type represent what the timeline can be sorted by. With both versions, a content sorts by the
|
|
566
|
+
* earlier online date, the later offline date and the latest publish of the two
|
|
567
|
+
*/
|
|
568
|
+
export type TimelineSort = "onlineDate" | "offlineDate" | "name" | "publicId" | "definition" | "lastPublished";
|
|
569
|
+
/**
|
|
570
|
+
* This type represent the data needed to make a list timeline API request
|
|
571
|
+
*/
|
|
572
|
+
export type ListTimelineRequest = TimelineFilters & {
|
|
573
|
+
/**
|
|
574
|
+
* Both by default
|
|
575
|
+
*/
|
|
576
|
+
versions?: TimelineVersionKind[];
|
|
577
|
+
/**
|
|
578
|
+
* `onlineDate` by default
|
|
579
|
+
*/
|
|
580
|
+
sort?: TimelineSort;
|
|
581
|
+
/**
|
|
582
|
+
* Ascending by default
|
|
583
|
+
*/
|
|
584
|
+
order?: SortDirection;
|
|
585
|
+
/**
|
|
586
|
+
* true counts the filtered contents per definition, repository, channel, tag and locale
|
|
587
|
+
*/
|
|
588
|
+
facets?: boolean;
|
|
589
|
+
/**
|
|
590
|
+
* 0 by default
|
|
591
|
+
*/
|
|
592
|
+
skip?: number;
|
|
593
|
+
/**
|
|
594
|
+
* 50 by default, at most 200, counted in contents
|
|
595
|
+
*/
|
|
596
|
+
take?: number;
|
|
597
|
+
};
|
|
598
|
+
/**
|
|
599
|
+
* This type represent one version of a content on the timeline, as its default locale has it
|
|
600
|
+
*/
|
|
601
|
+
export type TimelineVersion = {
|
|
602
|
+
version: number;
|
|
603
|
+
/**
|
|
604
|
+
* As an ISO 8601 string, null without one
|
|
605
|
+
*/
|
|
606
|
+
onlineDate: string | null;
|
|
607
|
+
/**
|
|
608
|
+
* As an ISO 8601 string, null without one
|
|
609
|
+
*/
|
|
610
|
+
offlineDate: string | null;
|
|
611
|
+
/**
|
|
612
|
+
* When the version was published to stage, as an ISO 8601 string
|
|
613
|
+
*/
|
|
614
|
+
publishedDate: string;
|
|
615
|
+
channels: string[];
|
|
616
|
+
tags: string[];
|
|
617
|
+
/**
|
|
618
|
+
* Every locale of the version
|
|
619
|
+
*/
|
|
620
|
+
locales: string[];
|
|
621
|
+
};
|
|
622
|
+
/**
|
|
623
|
+
* This type represent a content on the timeline, with each of its versions asked for
|
|
624
|
+
*/
|
|
625
|
+
export type TimelineItem = {
|
|
626
|
+
contentId: ContentId;
|
|
627
|
+
/**
|
|
628
|
+
* The pending version's when there is one, as `name` and `externalIdentifier`
|
|
629
|
+
*/
|
|
630
|
+
publicId: string;
|
|
631
|
+
name: string;
|
|
632
|
+
externalIdentifier: string | null;
|
|
633
|
+
/**
|
|
634
|
+
* The content definition mnemonic id
|
|
635
|
+
*/
|
|
636
|
+
definition: string;
|
|
637
|
+
/**
|
|
638
|
+
* The content repository mnemonic id
|
|
639
|
+
*/
|
|
640
|
+
repository: string;
|
|
641
|
+
/**
|
|
642
|
+
* null for a content only in stage
|
|
643
|
+
*/
|
|
644
|
+
live: TimelineVersion | null;
|
|
645
|
+
/**
|
|
646
|
+
* null for a content whose staged version is the live one
|
|
647
|
+
*/
|
|
648
|
+
pending: TimelineVersion | null;
|
|
649
|
+
};
|
|
650
|
+
/**
|
|
651
|
+
* This type represent, per value, how many of the filtered contents have it. A content with two versions
|
|
652
|
+
* counts once per value either has
|
|
653
|
+
*/
|
|
654
|
+
export type TimelineFacets = {
|
|
655
|
+
definitions: {
|
|
656
|
+
[mnemonicId: string]: number;
|
|
657
|
+
};
|
|
658
|
+
repositories: {
|
|
659
|
+
[mnemonicId: string]: number;
|
|
660
|
+
};
|
|
661
|
+
channels: {
|
|
662
|
+
[channel: string]: number;
|
|
663
|
+
};
|
|
664
|
+
tags: {
|
|
665
|
+
[tag: string]: number;
|
|
666
|
+
};
|
|
667
|
+
locales: {
|
|
668
|
+
[locale: string]: number;
|
|
669
|
+
};
|
|
670
|
+
};
|
|
671
|
+
/**
|
|
672
|
+
* This type represent the response of a list timeline API request
|
|
673
|
+
*/
|
|
674
|
+
export type ListTimelineResponse = {
|
|
675
|
+
items: TimelineItem[];
|
|
676
|
+
total: number;
|
|
677
|
+
/**
|
|
678
|
+
* The contents with neither date, whether `undated` excludes them or not
|
|
679
|
+
*/
|
|
680
|
+
undated: number;
|
|
681
|
+
/**
|
|
682
|
+
* Only when asked for
|
|
683
|
+
*/
|
|
684
|
+
facets?: TimelineFacets;
|
|
685
|
+
};
|
|
686
|
+
/**
|
|
687
|
+
* This type represent the size of a timeline summary's buckets. A week starts on Monday
|
|
688
|
+
*/
|
|
689
|
+
export type TimelineBucket = "day" | "week" | "month";
|
|
690
|
+
/**
|
|
691
|
+
* This type represent what a timeline summary counts: `live`, what delivery serves, or `afterRelease`,
|
|
692
|
+
* what it would serve were the staged versions promoted
|
|
693
|
+
*/
|
|
694
|
+
export type TimelineState = "live" | "afterRelease";
|
|
695
|
+
/**
|
|
696
|
+
* This type represent the data needed to make a get timeline summary API request
|
|
697
|
+
*/
|
|
698
|
+
export type GetTimelineSummaryRequest = TimelineFilters & {
|
|
699
|
+
bucket: TimelineBucket;
|
|
700
|
+
/**
|
|
701
|
+
* An IANA time zone, `UTC` by default: buckets start at its midnights
|
|
702
|
+
*/
|
|
703
|
+
timeZone?: string;
|
|
704
|
+
/**
|
|
705
|
+
* `live` by default
|
|
706
|
+
*/
|
|
707
|
+
state?: TimelineState;
|
|
708
|
+
};
|
|
709
|
+
/**
|
|
710
|
+
* This type represent the counts of one bucket of a timeline summary
|
|
711
|
+
*/
|
|
712
|
+
export type TimelineBucketCount = {
|
|
713
|
+
/**
|
|
714
|
+
* The bucket's first day in the time zone, as `YYYY-MM-DD`
|
|
715
|
+
*/
|
|
716
|
+
date: string;
|
|
717
|
+
/**
|
|
718
|
+
* The bucket's start, as an ISO 8601 string in UTC
|
|
719
|
+
*/
|
|
720
|
+
from: string;
|
|
721
|
+
/**
|
|
722
|
+
* The bucket's end, as an ISO 8601 string in UTC
|
|
723
|
+
*/
|
|
724
|
+
to: string;
|
|
725
|
+
/**
|
|
726
|
+
* The contents online at some point of the bucket
|
|
727
|
+
*/
|
|
728
|
+
online: number;
|
|
729
|
+
/**
|
|
730
|
+
* The contents whose online date falls within the bucket
|
|
731
|
+
*/
|
|
732
|
+
comingOnline: number;
|
|
733
|
+
/**
|
|
734
|
+
* The contents whose offline date falls within the bucket
|
|
735
|
+
*/
|
|
736
|
+
goingOffline: number;
|
|
737
|
+
};
|
|
738
|
+
/**
|
|
739
|
+
* This type represent the response of a get timeline summary API request: one entry per bucket, from the
|
|
740
|
+
* one holding `from` to the one holding `to`
|
|
741
|
+
*/
|
|
742
|
+
export type GetTimelineSummaryResponse = TimelineBucketCount[];
|
|
743
|
+
/**
|
|
744
|
+
* Thin enum represent the error types of the timeline API requests. Each is the `type` of a
|
|
745
|
+
* `RequestError`, whose `details` is a [[TimelineError]]
|
|
746
|
+
*/
|
|
747
|
+
export declare enum TimelineErrorTypes {
|
|
748
|
+
/**
|
|
749
|
+
* `to` before `from`, a range over 400 days, or an unknown time zone
|
|
750
|
+
*/
|
|
751
|
+
invalidTimelineQuery = "InvalidTimelineQuery",
|
|
752
|
+
/**
|
|
753
|
+
* The query took over 4 seconds and was stopped: narrow the range or the filters
|
|
754
|
+
*/
|
|
755
|
+
timelineTooSlow = "TimelineTooSlow"
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* This type represent the `details` of a `RequestError` whose `type` is one of [[TimelineErrorTypes]]
|
|
759
|
+
*/
|
|
760
|
+
export type TimelineError = {
|
|
761
|
+
type: TimelineErrorTypes;
|
|
762
|
+
message: string;
|
|
763
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DateFilterOperator = void 0;
|
|
3
|
+
exports.TimelineErrorTypes = exports.ConditionOperators = exports.LogicalOperators = exports.DateFilterOperator = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* This enum represent the comparison operators available to a release item date filter
|
|
6
6
|
*/
|
|
@@ -9,3 +9,41 @@ var DateFilterOperator;
|
|
|
9
9
|
DateFilterOperator["lte"] = "lte";
|
|
10
10
|
DateFilterOperator["gte"] = "gte";
|
|
11
11
|
})(DateFilterOperator || (exports.DateFilterOperator = DateFilterOperator = {}));
|
|
12
|
+
/**
|
|
13
|
+
* This enum represent how the items of [[PropFilters]] combine
|
|
14
|
+
*/
|
|
15
|
+
var LogicalOperators;
|
|
16
|
+
(function (LogicalOperators) {
|
|
17
|
+
LogicalOperators["AND"] = "AND";
|
|
18
|
+
LogicalOperators["OR"] = "OR";
|
|
19
|
+
})(LogicalOperators || (exports.LogicalOperators = LogicalOperators = {}));
|
|
20
|
+
/**
|
|
21
|
+
* This enum represent how a [[PropFilterItem]] compares an indexed field with its value. The `_IC`
|
|
22
|
+
* variants ignore case
|
|
23
|
+
*/
|
|
24
|
+
var ConditionOperators;
|
|
25
|
+
(function (ConditionOperators) {
|
|
26
|
+
ConditionOperators["CONTAINS"] = "CONTAINS";
|
|
27
|
+
ConditionOperators["CONTAINS_IC"] = "CONTAINS_IC";
|
|
28
|
+
ConditionOperators["EQUALS"] = "EQUALS";
|
|
29
|
+
ConditionOperators["EQUALS_IC"] = "EQUALS_IC";
|
|
30
|
+
ConditionOperators["IN"] = "IN";
|
|
31
|
+
ConditionOperators["IN_IC"] = "IN_IC";
|
|
32
|
+
ConditionOperators["STARTS_WITH"] = "STARTS_WITH";
|
|
33
|
+
ConditionOperators["STARTS_WITH_IC"] = "STARTS_WITH_IC";
|
|
34
|
+
})(ConditionOperators || (exports.ConditionOperators = ConditionOperators = {}));
|
|
35
|
+
/**
|
|
36
|
+
* Thin enum represent the error types of the timeline API requests. Each is the `type` of a
|
|
37
|
+
* `RequestError`, whose `details` is a [[TimelineError]]
|
|
38
|
+
*/
|
|
39
|
+
var TimelineErrorTypes;
|
|
40
|
+
(function (TimelineErrorTypes) {
|
|
41
|
+
/**
|
|
42
|
+
* `to` before `from`, a range over 400 days, or an unknown time zone
|
|
43
|
+
*/
|
|
44
|
+
TimelineErrorTypes["invalidTimelineQuery"] = "InvalidTimelineQuery";
|
|
45
|
+
/**
|
|
46
|
+
* The query took over 4 seconds and was stopped: narrow the range or the filters
|
|
47
|
+
*/
|
|
48
|
+
TimelineErrorTypes["timelineTooSlow"] = "TimelineTooSlow";
|
|
49
|
+
})(TimelineErrorTypes || (exports.TimelineErrorTypes = TimelineErrorTypes = {}));
|
package/lib/api/Component.ts
CHANGED
|
@@ -34,6 +34,18 @@ export type ComponentRename = {
|
|
|
34
34
|
to: string;
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* This type represent a field of a definition's root, or of one of its own fragments, that a save gives
|
|
39
|
+
* another name, so that its values and translations follow. Unlike a version's rename, the type may
|
|
40
|
+
* change: the values are then checked against the field they move to
|
|
41
|
+
*/
|
|
42
|
+
export type DefinitionRename = ComponentRename & {
|
|
43
|
+
/**
|
|
44
|
+
* The definition's own fragment holding the field, left out or null at the root
|
|
45
|
+
*/
|
|
46
|
+
fragment?: string | null;
|
|
47
|
+
};
|
|
48
|
+
|
|
37
49
|
/**
|
|
38
50
|
* This type represent field names, by what happened to them between two versions of a fragment.
|
|
39
51
|
* A field whose type changed is `changed`; a renamed field is in `renamed`, and in neither `added` nor
|
|
@@ -385,6 +397,7 @@ export enum ComponentErrorTypes {
|
|
|
385
397
|
noFragmentToPromote = 'NoFragmentToPromote',
|
|
386
398
|
definitionMigrating = 'DefinitionMigrating',
|
|
387
399
|
oneMigrationPerSave = 'OneMigrationPerSave',
|
|
400
|
+
definitionRenamesRefused = 'DefinitionRenamesRefused',
|
|
388
401
|
migrationPreviewNotFound = 'MigrationPreviewNotFound',
|
|
389
402
|
invalidComparison = 'InvalidComparison',
|
|
390
403
|
fieldNotFound = 'FieldNotFound',
|
|
@@ -425,6 +438,24 @@ export type ComponentVersionViolation = {
|
|
|
425
438
|
message: string;
|
|
426
439
|
};
|
|
427
440
|
|
|
441
|
+
/**
|
|
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
|
|
445
|
+
*/
|
|
446
|
+
export type DefinitionRenameViolation = {
|
|
447
|
+
/**
|
|
448
|
+
* The rename's fragment, null at the root
|
|
449
|
+
*/
|
|
450
|
+
fragment: string | null;
|
|
451
|
+
/**
|
|
452
|
+
* The rename's `to`
|
|
453
|
+
*/
|
|
454
|
+
field: string;
|
|
455
|
+
code: 'definition.invalidRename';
|
|
456
|
+
message: string;
|
|
457
|
+
};
|
|
458
|
+
|
|
428
459
|
type ComponentErrorOf<T extends ComponentErrorTypes, D = {}> = { type: T; message: string } & D;
|
|
429
460
|
|
|
430
461
|
/**
|
|
@@ -469,10 +500,11 @@ export type ComponentError =
|
|
|
469
500
|
*/
|
|
470
501
|
| ComponentErrorOf<ComponentErrorTypes.definitionMigrating, DefinitionMigrationState>
|
|
471
502
|
/**
|
|
472
|
-
* A save that would migrate the values of more than one component
|
|
473
|
-
* has finished
|
|
503
|
+
* A save that would migrate the values of more than one component, or of a component and of the
|
|
504
|
+
* definition's own fields (`ownFields`): save one, then the other once its migration has finished
|
|
474
505
|
*/
|
|
475
|
-
| ComponentErrorOf<ComponentErrorTypes.oneMigrationPerSave, { mnemonicIds: string[] }>
|
|
506
|
+
| ComponentErrorOf<ComponentErrorTypes.oneMigrationPerSave, { mnemonicIds: string[]; ownFields: boolean }>
|
|
507
|
+
| ComponentErrorOf<ComponentErrorTypes.definitionRenamesRefused, { violations: DefinitionRenameViolation[] }>
|
|
476
508
|
| ComponentErrorOf<ComponentErrorTypes.migrationPreviewNotFound, { id: MigrationPreviewId }>
|
|
477
509
|
/**
|
|
478
510
|
* A side of a compare component fields API request that is none of the kinds it takes
|
|
@@ -491,8 +523,9 @@ export type ComponentError =
|
|
|
491
523
|
* This type represent where a definition's contents stand, as the get content definition, update content
|
|
492
524
|
* definition and get migration API requests answer it
|
|
493
525
|
*
|
|
494
|
-
* An upgrade
|
|
495
|
-
* migrates its contents in the background, one migration at a
|
|
526
|
+
* An upgrade, an adoption, or a save of the definition's own fields that renames, removes or retypes
|
|
527
|
+
* fields bumps the definition's revision and migrates its contents in the background, one migration at a
|
|
528
|
+
* time per definition
|
|
496
529
|
*/
|
|
497
530
|
export type DefinitionMigrationState = {
|
|
498
531
|
/**
|
|
@@ -528,9 +561,13 @@ export type SetAsideValue = {
|
|
|
528
561
|
*/
|
|
529
562
|
revision: number;
|
|
530
563
|
/**
|
|
531
|
-
* The component it was a value of
|
|
564
|
+
* The component it was a value of, null for a value of the definition's own fields
|
|
532
565
|
*/
|
|
533
|
-
mnemonicId: string;
|
|
566
|
+
mnemonicId: string | null;
|
|
567
|
+
/**
|
|
568
|
+
* The definition's own fragment it was in, null at the root and for a component's value
|
|
569
|
+
*/
|
|
570
|
+
fragment: string | null;
|
|
534
571
|
/**
|
|
535
572
|
* Where it was, in the key format translation entries use, with the names the payload has now:
|
|
536
573
|
* `pic.credit`, `gallery.$k1.width`
|
|
@@ -576,10 +613,11 @@ export type MigrationPreviewId = number;
|
|
|
576
613
|
|
|
577
614
|
/**
|
|
578
615
|
* This type represent the data needed to make a migration preview API request: the definition, and the
|
|
579
|
-
* schema about to be saved with the update content definition API request
|
|
616
|
+
* schema about to be saved with the update content definition API request with the renames it will
|
|
617
|
+
* declare, or the adoption about to be made
|
|
580
618
|
*/
|
|
581
619
|
export type MigrationPreviewRequest =
|
|
582
|
-
| { id: ContentDefinitionId; schema: ContentDefinitionSchemaInput }
|
|
620
|
+
| { id: ContentDefinitionId; schema: ContentDefinitionSchemaInput; renames?: DefinitionRename[] }
|
|
583
621
|
| { id: ContentDefinitionId; adopt: { mnemonicId: string; version: number; renames?: ComponentRename[] } };
|
|
584
622
|
|
|
585
623
|
/**
|
|
@@ -602,6 +640,10 @@ export type GetMigrationPreviewRequest = {
|
|
|
602
640
|
* values move or are checked
|
|
603
641
|
*/
|
|
604
642
|
export type MigrationPreviewField = {
|
|
643
|
+
/**
|
|
644
|
+
* The definition's own fragment holding the field, null at the root and for a component's field
|
|
645
|
+
*/
|
|
646
|
+
fragment: string | null;
|
|
605
647
|
field: string;
|
|
606
648
|
outcome: 'renamed' | 'changed' | 'removed';
|
|
607
649
|
/**
|
|
@@ -632,12 +674,15 @@ export type MigrationPreviewField = {
|
|
|
632
674
|
export type GetMigrationPreviewResponse = {
|
|
633
675
|
id: MigrationPreviewId;
|
|
634
676
|
definitionId: ContentDefinitionId;
|
|
635
|
-
mnemonicId: string;
|
|
636
677
|
/**
|
|
637
|
-
*
|
|
678
|
+
* The component, null for a save changing the definition's own fields, as `from` and `to`
|
|
679
|
+
*/
|
|
680
|
+
mnemonicId: string | null;
|
|
681
|
+
/**
|
|
682
|
+
* Null for an adoption, and for the definition's own fields
|
|
638
683
|
*/
|
|
639
684
|
from: number | null;
|
|
640
|
-
to: number;
|
|
685
|
+
to: number | null;
|
|
641
686
|
status: 'running' | 'done';
|
|
642
687
|
/**
|
|
643
688
|
* The contents walked so far, out of `total`
|
|
@@ -684,3 +729,71 @@ export type ResumeMigrationRequest = {
|
|
|
684
729
|
* This type represent the response of a resume migration API request
|
|
685
730
|
*/
|
|
686
731
|
export type ResumeMigrationResponse = DefinitionMigrationState;
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* This type represent the data needed to make a get set aside API request
|
|
735
|
+
*/
|
|
736
|
+
export type GetSetAsideRequest = {
|
|
737
|
+
/**
|
|
738
|
+
* The content definition unique id
|
|
739
|
+
*/
|
|
740
|
+
id: ContentDefinitionId;
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* This type represent what a definition's contents hold set aside for one field by one revision
|
|
745
|
+
*/
|
|
746
|
+
export type SetAsideGroup = {
|
|
747
|
+
revision: number;
|
|
748
|
+
/**
|
|
749
|
+
* The component, null for the definition's own fields
|
|
750
|
+
*/
|
|
751
|
+
mnemonicId: string | null;
|
|
752
|
+
/**
|
|
753
|
+
* The definition's own fragment, null at the root and for a component's field
|
|
754
|
+
*/
|
|
755
|
+
fragment: string | null;
|
|
756
|
+
/**
|
|
757
|
+
* The field's name as the version it came from had it
|
|
758
|
+
*/
|
|
759
|
+
field: string;
|
|
760
|
+
reason: 'removed' | 'changed';
|
|
761
|
+
/**
|
|
762
|
+
* The contents holding such values
|
|
763
|
+
*/
|
|
764
|
+
contents: number;
|
|
765
|
+
values: number;
|
|
766
|
+
};
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* This type represent the response of a get set aside API request, by revision, then fragment, then field,
|
|
770
|
+
* components' values included
|
|
771
|
+
*/
|
|
772
|
+
export type GetSetAsideResponse = SetAsideGroup[];
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* This type represent the data needed to make a discard set aside API request: one group as the get set
|
|
776
|
+
* aside API request answers it
|
|
777
|
+
*/
|
|
778
|
+
export type DiscardSetAsideRequest = {
|
|
779
|
+
/**
|
|
780
|
+
* The content definition unique id
|
|
781
|
+
*/
|
|
782
|
+
id: ContentDefinitionId;
|
|
783
|
+
revision: number;
|
|
784
|
+
fragment?: string | null;
|
|
785
|
+
field: string;
|
|
786
|
+
/**
|
|
787
|
+
* Where the previous call stopped, its `next`
|
|
788
|
+
*/
|
|
789
|
+
after?: number;
|
|
790
|
+
};
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* This type represent the response of a discard set aside API request. A call works for about five
|
|
794
|
+
* seconds: call again with `after: next` until `next` is null
|
|
795
|
+
*/
|
|
796
|
+
export type DiscardSetAsideResponse = {
|
|
797
|
+
discarded: number;
|
|
798
|
+
next: number | null;
|
|
799
|
+
};
|
package/lib/api/Content.ts
CHANGED
|
@@ -1165,7 +1165,8 @@ export type RestoreViolations = {
|
|
|
1165
1165
|
*/
|
|
1166
1166
|
translations: { locale: string; violations: ContentConstraintViolation[] }[];
|
|
1167
1167
|
/**
|
|
1168
|
-
*
|
|
1168
|
+
* @deprecated Always empty: what the migrations since set aside no longer keeps a version from being
|
|
1169
|
+
* restored, see [[GetContentHistoryEntryResponse.setAside]]
|
|
1169
1170
|
*/
|
|
1170
1171
|
setAside: { path: string; reason: "removed" | "changed" }[];
|
|
1171
1172
|
};
|
|
@@ -1181,11 +1182,17 @@ export type GetContentHistoryEntryResponse = ContentHistoryEntry & {
|
|
|
1181
1182
|
restorable: boolean;
|
|
1182
1183
|
violations: RestoreViolations;
|
|
1183
1184
|
/**
|
|
1184
|
-
* Values of fields removed from the definition by hand
|
|
1185
|
-
* entries. They are left out of `payload` and `translations`, as a save leaves them
|
|
1186
|
-
* keep the version from being restored
|
|
1185
|
+
* Values of fields removed from the definition by hand, before saves migrated contents, `path` in the key
|
|
1186
|
+
* format of translation entries. They are left out of `payload` and `translations`, as a save leaves them
|
|
1187
|
+
* out, so they do not keep the version from being restored
|
|
1187
1188
|
*/
|
|
1188
1189
|
dropped: { path: string }[];
|
|
1190
|
+
/**
|
|
1191
|
+
* Values the migrations since set aside, removed or retyped fields of a component or of the definition.
|
|
1192
|
+
* They are left out of `payload` and `translations`, and a restore writes them beside the content, once,
|
|
1193
|
+
* for a person to move or discard
|
|
1194
|
+
*/
|
|
1195
|
+
setAside: SetAsideValue[];
|
|
1189
1196
|
};
|
|
1190
1197
|
|
|
1191
1198
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AuthorResponse } from './Author';
|
|
2
2
|
import { PagedListResponse } from './common';
|
|
3
|
-
import { DefinitionMigrationState, FieldChanges } from './Component';
|
|
3
|
+
import { DefinitionMigrationState, DefinitionRename, FieldChanges } from './Component';
|
|
4
4
|
import { ComponentMarker, ContentDefinitionSchema, ContentDefinitionSchemaInput, Field, I18NDictionary } from './ContentDefinitionSchema';
|
|
5
5
|
import { Extension } from './Extension';
|
|
6
6
|
|
|
@@ -142,6 +142,11 @@ export type UpdateContentDefinitionRequest = {
|
|
|
142
142
|
* will bypass content definition mnemonicId validation for every linked-content field
|
|
143
143
|
*/
|
|
144
144
|
bypassLinkedContentValidation?: boolean;
|
|
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
|
|
148
|
+
*/
|
|
149
|
+
renames?: DefinitionRename[];
|
|
145
150
|
};
|
|
146
151
|
|
|
147
152
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContentId, LocalizationSettings } from "./Content";
|
|
1
|
+
import { ContentId, LocalizationSettings, SortDirection } from "./Content";
|
|
2
2
|
import { AuthorResponse } from "./Author";
|
|
3
3
|
import { ContentRepositoryId } from "./ContentRepository";
|
|
4
4
|
import { ContentTranslationStatus } from "./ContentTranslation";
|
|
@@ -477,3 +477,325 @@ export type ListReleaseItemsV2Response = PagedListResponse<ReleaseItemGroup> & {
|
|
|
477
477
|
* This type represent the response of a get published content API request
|
|
478
478
|
*/
|
|
479
479
|
export type GetPublishedContentResponse = PublishedContentResponse | undefined;
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* This enum represent how the items of [[PropFilters]] combine
|
|
483
|
+
*/
|
|
484
|
+
export enum LogicalOperators {
|
|
485
|
+
AND = "AND",
|
|
486
|
+
OR = "OR",
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/**
|
|
490
|
+
* This enum represent how a [[PropFilterItem]] compares an indexed field with its value. The `_IC`
|
|
491
|
+
* variants ignore case
|
|
492
|
+
*/
|
|
493
|
+
export enum ConditionOperators {
|
|
494
|
+
CONTAINS = "CONTAINS",
|
|
495
|
+
CONTAINS_IC = "CONTAINS_IC",
|
|
496
|
+
EQUALS = "EQUALS",
|
|
497
|
+
EQUALS_IC = "EQUALS_IC",
|
|
498
|
+
IN = "IN",
|
|
499
|
+
IN_IC = "IN_IC",
|
|
500
|
+
STARTS_WITH = "STARTS_WITH",
|
|
501
|
+
STARTS_WITH_IC = "STARTS_WITH_IC",
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* This type represent one condition over an indexed field of a published content, as the delivery API
|
|
506
|
+
* takes it
|
|
507
|
+
*/
|
|
508
|
+
export type PropFilterItem = {
|
|
509
|
+
field: string;
|
|
510
|
+
operator: ConditionOperators;
|
|
511
|
+
/**
|
|
512
|
+
* An array for [[ConditionOperators.IN]] and [[ConditionOperators.IN_IC]]
|
|
513
|
+
*/
|
|
514
|
+
value: string | string[];
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* This type represent the delivery API's property filters, over the indexed fields of a published content
|
|
519
|
+
*/
|
|
520
|
+
export type PropFilters = {
|
|
521
|
+
condition: LogicalOperators;
|
|
522
|
+
/**
|
|
523
|
+
* From 1 to 10
|
|
524
|
+
*/
|
|
525
|
+
items: PropFilterItem[];
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* This type represent which date of a content's online window has to fall within a timeline's range:
|
|
530
|
+
* `overlap`, online at some point of it, `starts`, its online date, or `ends`, its offline date
|
|
531
|
+
*/
|
|
532
|
+
export type TimelineMatch = "overlap" | "starts" | "ends";
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* This type represent the range and filters of the timeline API requests. Every filter given applies,
|
|
536
|
+
* together, and a list filter matches a content that has one of its values
|
|
537
|
+
*/
|
|
538
|
+
export type TimelineFilters = {
|
|
539
|
+
/**
|
|
540
|
+
* The range's start, as an ISO 8601 string. With `from` equal to `to`, what is online at that instant
|
|
541
|
+
*/
|
|
542
|
+
from: string;
|
|
543
|
+
/**
|
|
544
|
+
* The range's end, as an ISO 8601 string, not before `from` and at most 400 days after it
|
|
545
|
+
*/
|
|
546
|
+
to: string;
|
|
547
|
+
/**
|
|
548
|
+
* `overlap` by default
|
|
549
|
+
*/
|
|
550
|
+
match?: TimelineMatch;
|
|
551
|
+
/**
|
|
552
|
+
* Whether the contents with neither date, online all the time, are left out, by default, or included
|
|
553
|
+
*/
|
|
554
|
+
undated?: "exclude" | "include";
|
|
555
|
+
/**
|
|
556
|
+
* From 2 to 100 characters, matched anywhere in the name, the public id or the external identifier,
|
|
557
|
+
* ignoring case
|
|
558
|
+
*/
|
|
559
|
+
search?: string;
|
|
560
|
+
/**
|
|
561
|
+
* Up to 500
|
|
562
|
+
*/
|
|
563
|
+
publicIds?: string[];
|
|
564
|
+
/**
|
|
565
|
+
* Up to 500
|
|
566
|
+
*/
|
|
567
|
+
contentIds?: ContentId[];
|
|
568
|
+
/**
|
|
569
|
+
* Content definition mnemonic ids, up to 100
|
|
570
|
+
*/
|
|
571
|
+
definitions?: string[];
|
|
572
|
+
/**
|
|
573
|
+
* Content repository mnemonic ids, up to 100
|
|
574
|
+
*/
|
|
575
|
+
repositories?: string[];
|
|
576
|
+
/**
|
|
577
|
+
* Up to 100
|
|
578
|
+
*/
|
|
579
|
+
channels?: string[];
|
|
580
|
+
/**
|
|
581
|
+
* Up to 100
|
|
582
|
+
*/
|
|
583
|
+
tags?: string[];
|
|
584
|
+
/**
|
|
585
|
+
* Up to 100
|
|
586
|
+
*/
|
|
587
|
+
locales?: string[];
|
|
588
|
+
propFilters?: PropFilters;
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* This type represent a version of a content on the timeline: `live`, the one delivery serves, or
|
|
593
|
+
* `pending`, the one published to stage and not promoted yet
|
|
594
|
+
*/
|
|
595
|
+
export type TimelineVersionKind = "live" | "pending";
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* This type represent what the timeline can be sorted by. With both versions, a content sorts by the
|
|
599
|
+
* earlier online date, the later offline date and the latest publish of the two
|
|
600
|
+
*/
|
|
601
|
+
export type TimelineSort =
|
|
602
|
+
| "onlineDate"
|
|
603
|
+
| "offlineDate"
|
|
604
|
+
| "name"
|
|
605
|
+
| "publicId"
|
|
606
|
+
| "definition"
|
|
607
|
+
| "lastPublished";
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* This type represent the data needed to make a list timeline API request
|
|
611
|
+
*/
|
|
612
|
+
export type ListTimelineRequest = TimelineFilters & {
|
|
613
|
+
/**
|
|
614
|
+
* Both by default
|
|
615
|
+
*/
|
|
616
|
+
versions?: TimelineVersionKind[];
|
|
617
|
+
/**
|
|
618
|
+
* `onlineDate` by default
|
|
619
|
+
*/
|
|
620
|
+
sort?: TimelineSort;
|
|
621
|
+
/**
|
|
622
|
+
* Ascending by default
|
|
623
|
+
*/
|
|
624
|
+
order?: SortDirection;
|
|
625
|
+
/**
|
|
626
|
+
* true counts the filtered contents per definition, repository, channel, tag and locale
|
|
627
|
+
*/
|
|
628
|
+
facets?: boolean;
|
|
629
|
+
/**
|
|
630
|
+
* 0 by default
|
|
631
|
+
*/
|
|
632
|
+
skip?: number;
|
|
633
|
+
/**
|
|
634
|
+
* 50 by default, at most 200, counted in contents
|
|
635
|
+
*/
|
|
636
|
+
take?: number;
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* This type represent one version of a content on the timeline, as its default locale has it
|
|
641
|
+
*/
|
|
642
|
+
export type TimelineVersion = {
|
|
643
|
+
version: number;
|
|
644
|
+
/**
|
|
645
|
+
* As an ISO 8601 string, null without one
|
|
646
|
+
*/
|
|
647
|
+
onlineDate: string | null;
|
|
648
|
+
/**
|
|
649
|
+
* As an ISO 8601 string, null without one
|
|
650
|
+
*/
|
|
651
|
+
offlineDate: string | null;
|
|
652
|
+
/**
|
|
653
|
+
* When the version was published to stage, as an ISO 8601 string
|
|
654
|
+
*/
|
|
655
|
+
publishedDate: string;
|
|
656
|
+
channels: string[];
|
|
657
|
+
tags: string[];
|
|
658
|
+
/**
|
|
659
|
+
* Every locale of the version
|
|
660
|
+
*/
|
|
661
|
+
locales: string[];
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* This type represent a content on the timeline, with each of its versions asked for
|
|
666
|
+
*/
|
|
667
|
+
export type TimelineItem = {
|
|
668
|
+
contentId: ContentId;
|
|
669
|
+
/**
|
|
670
|
+
* The pending version's when there is one, as `name` and `externalIdentifier`
|
|
671
|
+
*/
|
|
672
|
+
publicId: string;
|
|
673
|
+
name: string;
|
|
674
|
+
externalIdentifier: string | null;
|
|
675
|
+
/**
|
|
676
|
+
* The content definition mnemonic id
|
|
677
|
+
*/
|
|
678
|
+
definition: string;
|
|
679
|
+
/**
|
|
680
|
+
* The content repository mnemonic id
|
|
681
|
+
*/
|
|
682
|
+
repository: string;
|
|
683
|
+
/**
|
|
684
|
+
* null for a content only in stage
|
|
685
|
+
*/
|
|
686
|
+
live: TimelineVersion | null;
|
|
687
|
+
/**
|
|
688
|
+
* null for a content whose staged version is the live one
|
|
689
|
+
*/
|
|
690
|
+
pending: TimelineVersion | null;
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* This type represent, per value, how many of the filtered contents have it. A content with two versions
|
|
695
|
+
* counts once per value either has
|
|
696
|
+
*/
|
|
697
|
+
export type TimelineFacets = {
|
|
698
|
+
definitions: { [mnemonicId: string]: number };
|
|
699
|
+
repositories: { [mnemonicId: string]: number };
|
|
700
|
+
channels: { [channel: string]: number };
|
|
701
|
+
tags: { [tag: string]: number };
|
|
702
|
+
locales: { [locale: string]: number };
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* This type represent the response of a list timeline API request
|
|
707
|
+
*/
|
|
708
|
+
export type ListTimelineResponse = {
|
|
709
|
+
items: TimelineItem[];
|
|
710
|
+
total: number;
|
|
711
|
+
/**
|
|
712
|
+
* The contents with neither date, whether `undated` excludes them or not
|
|
713
|
+
*/
|
|
714
|
+
undated: number;
|
|
715
|
+
/**
|
|
716
|
+
* Only when asked for
|
|
717
|
+
*/
|
|
718
|
+
facets?: TimelineFacets;
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* This type represent the size of a timeline summary's buckets. A week starts on Monday
|
|
723
|
+
*/
|
|
724
|
+
export type TimelineBucket = "day" | "week" | "month";
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* This type represent what a timeline summary counts: `live`, what delivery serves, or `afterRelease`,
|
|
728
|
+
* what it would serve were the staged versions promoted
|
|
729
|
+
*/
|
|
730
|
+
export type TimelineState = "live" | "afterRelease";
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* This type represent the data needed to make a get timeline summary API request
|
|
734
|
+
*/
|
|
735
|
+
export type GetTimelineSummaryRequest = TimelineFilters & {
|
|
736
|
+
bucket: TimelineBucket;
|
|
737
|
+
/**
|
|
738
|
+
* An IANA time zone, `UTC` by default: buckets start at its midnights
|
|
739
|
+
*/
|
|
740
|
+
timeZone?: string;
|
|
741
|
+
/**
|
|
742
|
+
* `live` by default
|
|
743
|
+
*/
|
|
744
|
+
state?: TimelineState;
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* This type represent the counts of one bucket of a timeline summary
|
|
749
|
+
*/
|
|
750
|
+
export type TimelineBucketCount = {
|
|
751
|
+
/**
|
|
752
|
+
* The bucket's first day in the time zone, as `YYYY-MM-DD`
|
|
753
|
+
*/
|
|
754
|
+
date: string;
|
|
755
|
+
/**
|
|
756
|
+
* The bucket's start, as an ISO 8601 string in UTC
|
|
757
|
+
*/
|
|
758
|
+
from: string;
|
|
759
|
+
/**
|
|
760
|
+
* The bucket's end, as an ISO 8601 string in UTC
|
|
761
|
+
*/
|
|
762
|
+
to: string;
|
|
763
|
+
/**
|
|
764
|
+
* The contents online at some point of the bucket
|
|
765
|
+
*/
|
|
766
|
+
online: number;
|
|
767
|
+
/**
|
|
768
|
+
* The contents whose online date falls within the bucket
|
|
769
|
+
*/
|
|
770
|
+
comingOnline: number;
|
|
771
|
+
/**
|
|
772
|
+
* The contents whose offline date falls within the bucket
|
|
773
|
+
*/
|
|
774
|
+
goingOffline: number;
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* This type represent the response of a get timeline summary API request: one entry per bucket, from the
|
|
779
|
+
* one holding `from` to the one holding `to`
|
|
780
|
+
*/
|
|
781
|
+
export type GetTimelineSummaryResponse = TimelineBucketCount[];
|
|
782
|
+
|
|
783
|
+
/**
|
|
784
|
+
* Thin enum represent the error types of the timeline API requests. Each is the `type` of a
|
|
785
|
+
* `RequestError`, whose `details` is a [[TimelineError]]
|
|
786
|
+
*/
|
|
787
|
+
export enum TimelineErrorTypes {
|
|
788
|
+
/**
|
|
789
|
+
* `to` before `from`, a range over 400 days, or an unknown time zone
|
|
790
|
+
*/
|
|
791
|
+
invalidTimelineQuery = "InvalidTimelineQuery",
|
|
792
|
+
/**
|
|
793
|
+
* The query took over 4 seconds and was stopped: narrow the range or the filters
|
|
794
|
+
*/
|
|
795
|
+
timelineTooSlow = "TimelineTooSlow",
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* This type represent the `details` of a `RequestError` whose `type` is one of [[TimelineErrorTypes]]
|
|
800
|
+
*/
|
|
801
|
+
export type TimelineError = { type: TimelineErrorTypes; message: string };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentchef/contentchef-types",
|
|
3
|
-
"version": "11.2.0-alpha.
|
|
3
|
+
"version": "11.2.0-alpha.5",
|
|
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": "
|
|
37
|
+
"gitHead": "ccaa9d0ae10d67701cf34df7ec127c3c40fefae4"
|
|
38
38
|
}
|