@relyio/sdk 0.12.0 → 0.13.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/CHANGELOG.md +84 -0
- package/dist/{chunk-3DRDHXLY.js → chunk-3NPPMGB6.js} +435 -23
- package/dist/{chunk-FRJEUAAF.js → chunk-6NGJXLOR.js} +22 -11
- package/dist/{chunk-DXCVO6M5.cjs → chunk-DEDIJKHY.cjs} +22 -11
- package/dist/{chunk-POEEDYFM.js → chunk-EW23SZPX.js} +7 -2
- package/dist/{chunk-3MSFWXQL.cjs → chunk-FOSM4LMM.cjs} +7 -2
- package/dist/{chunk-FI5VIF4M.cjs → chunk-Z6GLWSSD.cjs} +442 -22
- package/dist/client/index.cjs +3 -3
- package/dist/client/index.d.cts +4 -5
- package/dist/client/index.d.ts +4 -5
- package/dist/client/index.js +1 -1
- package/dist/{define-schema-mrEZbY1h.d.ts → define-schema-UHViXKiv.d.ts} +2 -219
- package/dist/{define-schema-DgctHlI2.d.cts → define-schema-sWJ8Zn7C.d.cts} +2 -219
- package/dist/{include-paths-CL4gHv6I.d.cts → include-paths-Bs5FhNw2.d.cts} +2191 -108
- package/dist/{include-paths-CrJNTsMl.d.ts → include-paths-Cb7iPCW2.d.ts} +2191 -108
- package/dist/index--_u1nPHv.d.cts +507 -0
- package/dist/index-8DozAWsA.d.ts +507 -0
- package/dist/{index-BrvEg6-A.d.cts → index-BT0L8xJj.d.cts} +41 -53
- package/dist/{index-Pw0onkJe.d.ts → index-CPjJ25R4.d.ts} +41 -53
- package/dist/index.cjs +119 -112
- package/dist/index.d.cts +39 -70
- package/dist/index.d.ts +39 -70
- package/dist/index.js +5 -29
- package/dist/markdown/index.cjs +13750 -0
- package/dist/markdown/index.d.cts +111 -0
- package/dist/markdown/index.d.ts +111 -0
- package/dist/markdown/index.js +13742 -0
- package/dist/rich-text/index.cjs +26 -6
- package/dist/rich-text/index.d.cts +3 -148
- package/dist/rich-text/index.d.ts +3 -148
- package/dist/rich-text/index.js +1 -1
- package/dist/rich-text.d-BWc-5gX1.d.cts +326 -0
- package/dist/rich-text.d-BWc-5gX1.d.ts +326 -0
- package/dist/schema/index.cjs +34 -34
- package/dist/schema/index.d.cts +9 -178
- package/dist/schema/index.d.ts +9 -178
- package/dist/schema/index.js +1 -1
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.ts +2 -3
- package/package.json +14 -3
- package/dist/index-B9RfZVF1.d.ts +0 -861
- package/dist/index-b-AkfTUv.d.cts +0 -861
- package/dist/rich-text.d-rKmpgdGd.d.cts +0 -200
- package/dist/rich-text.d-rKmpgdGd.d.ts +0 -200
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ao as ContentTypeDefinition, av as SingletonContentTypeDefinition, aB as SettingsGroupDefinition, be as WorkflowDefinition, bs as ViewDefinition, aG as AssetTypeDefinition, aq as InferContentType } from './include-paths-Cb7iPCW2.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Query definition matching @relyio/schema QueryDefinitionSchema
|
|
@@ -659,223 +659,6 @@ declare function isBuiltInRole(roleId: string): roleId is BuiltInRole;
|
|
|
659
659
|
*/
|
|
660
660
|
declare function getBuiltInRoleActions(roleId: BuiltInRole): readonly RoleAction[];
|
|
661
661
|
|
|
662
|
-
/**
|
|
663
|
-
* View definitions for SDK schema
|
|
664
|
-
*
|
|
665
|
-
* Views define pre-configured entry list configurations with filters,
|
|
666
|
-
* columns, and metadata display settings.
|
|
667
|
-
*/
|
|
668
|
-
/**
|
|
669
|
-
* View scope defines which content types a view applies to.
|
|
670
|
-
*
|
|
671
|
-
* When using `contentTypes` (plural) or `all`, the view displays entries
|
|
672
|
-
* from multiple content types. In this case:
|
|
673
|
-
*
|
|
674
|
-
* - Columns/fields may only exist on some content types
|
|
675
|
-
* - For entries where a field doesn't exist, the UI displays "—"
|
|
676
|
-
* - System fields (id, status, createdAt, updatedAt) exist on all entries
|
|
677
|
-
* - Filters on non-existent fields are skipped for that entry type
|
|
678
|
-
*
|
|
679
|
-
* Example display:
|
|
680
|
-
* | Content Type | title | author | productCode |
|
|
681
|
-
* |--------------|-------|--------|-------------|
|
|
682
|
-
* | post | ✓ | ✓ | — |
|
|
683
|
-
* | product | ✓ | — | ✓ |
|
|
684
|
-
*/
|
|
685
|
-
/**
|
|
686
|
-
* Scope for a single content type
|
|
687
|
-
*/
|
|
688
|
-
interface ContentTypeScopeConfig {
|
|
689
|
-
type: 'contentType';
|
|
690
|
-
contentType: string;
|
|
691
|
-
}
|
|
692
|
-
/**
|
|
693
|
-
* Scope for multiple content types
|
|
694
|
-
*
|
|
695
|
-
* Fields not present on all content types will show "—" in the UI
|
|
696
|
-
*/
|
|
697
|
-
interface ContentTypesScopeConfig {
|
|
698
|
-
type: 'contentTypes';
|
|
699
|
-
contentTypes: string[];
|
|
700
|
-
}
|
|
701
|
-
/**
|
|
702
|
-
* Scope for an entry type (content, singleton, settings, asset)
|
|
703
|
-
*/
|
|
704
|
-
interface EntryTypeScopeConfig {
|
|
705
|
-
type: 'entryType';
|
|
706
|
-
entryType: 'content' | 'singleton' | 'settings' | 'asset';
|
|
707
|
-
}
|
|
708
|
-
/**
|
|
709
|
-
* Scope for all content
|
|
710
|
-
*
|
|
711
|
-
* Fields not present on all content types will show "—" in the UI
|
|
712
|
-
*/
|
|
713
|
-
interface AllScopeConfig {
|
|
714
|
-
type: 'all';
|
|
715
|
-
}
|
|
716
|
-
/**
|
|
717
|
-
* View scope options
|
|
718
|
-
*/
|
|
719
|
-
type ViewScopeConfig = ContentTypeScopeConfig | ContentTypesScopeConfig | EntryTypeScopeConfig | AllScopeConfig;
|
|
720
|
-
/**
|
|
721
|
-
* The operators a view filter may name: the schema's `FILTER_OPERATORS`, which deploy parses a view
|
|
722
|
-
* with and the read core compiles every one of.
|
|
723
|
-
*
|
|
724
|
-
* This list used to be its own: ten of its names — `doesNotContain`, `isNotEmpty`, `isOnOrBefore`,
|
|
725
|
-
* `isOnOrAfter`, `tomorrow`, `lastWeek`, `lastMonth`, `includesAll`, `includesAny`, `excludes` —
|
|
726
|
-
* are none the schema declares, so a view naming one was refused at deploy, and six the schema does
|
|
727
|
-
* declare — `notContains`, `notIncludes`, `isOn`, `isBetween`, `thisYear`, `hasValue` — could not be
|
|
728
|
-
* written here, so a view pulled by `relyio generate-types` that named one did not compile.
|
|
729
|
-
* `@relyio/codegen-typescript`'s `src/__tests__/sdk-definition-config.types.ts` holds the two to each
|
|
730
|
-
* other (REL-1457).
|
|
731
|
-
*/
|
|
732
|
-
type ViewFilterOperator = 'is' | 'isNot' | 'contains' | 'notContains' | 'startsWith' | 'endsWith' | 'isAnyOf' | 'isNoneOf' | 'includes' | 'notIncludes' | 'isTrue' | 'isFalse' | 'equals' | 'notEquals' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between' | 'isOn' | 'isBefore' | 'isAfter' | 'isBetween' | 'inTheLast' | 'inTheNext' | 'today' | 'yesterday' | 'thisWeek' | 'thisMonth' | 'thisYear' | 'isEmpty' | 'hasValue';
|
|
733
|
-
/** A span of time back or forward from now, for `inTheLast` and `inTheNext`. */
|
|
734
|
-
interface ViewFilterRelativeDate {
|
|
735
|
-
amount: number;
|
|
736
|
-
unit: 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'years';
|
|
737
|
-
}
|
|
738
|
-
/** What a filter compares against: the schema's `FilterValueSchema`. */
|
|
739
|
-
type ViewFilterValue = string | number | boolean | null | (string | number)[] | {
|
|
740
|
-
from: string | number | Date;
|
|
741
|
-
to: string | number | Date;
|
|
742
|
-
} | ViewFilterRelativeDate | Date;
|
|
743
|
-
/**
|
|
744
|
-
* One filter of a view: a field, an operator and the value it compares with.
|
|
745
|
-
*/
|
|
746
|
-
interface ViewFilterCondition {
|
|
747
|
-
/**
|
|
748
|
-
* The Property to filter on, as the Studio's entry list names it: `fields.<id>` for a field your
|
|
749
|
-
* schema declares (`fields.seo.title` for a field of an object's value), `_metadata.<id>` for a system
|
|
750
|
-
* field — `_metadata.status`, `_metadata.createdAt`, `_metadata.updatedAt`. So a field called
|
|
751
|
-
* `status` (`fields.status`) and the entry's own lifecycle (`_metadata.status`) are both
|
|
752
|
-
* filterable.
|
|
753
|
-
*/
|
|
754
|
-
field: string;
|
|
755
|
-
/**
|
|
756
|
-
* Filter operator
|
|
757
|
-
*/
|
|
758
|
-
operator: ViewFilterOperator;
|
|
759
|
-
/**
|
|
760
|
-
* Filter value (optional for some operators like isEmpty)
|
|
761
|
-
*/
|
|
762
|
-
value?: ViewFilterValue;
|
|
763
|
-
}
|
|
764
|
-
/**
|
|
765
|
-
* A view's filter. A view's filters are a flat list joined by AND — the Filters the Studio's entry
|
|
766
|
-
* list takes, each drawn as a Chip — so there is no filter group: an OR within one field is
|
|
767
|
-
* `isAnyOf`. RelyIO refuses a group by name when you deploy.
|
|
768
|
-
*/
|
|
769
|
-
type ViewFilter = ViewFilterCondition;
|
|
770
|
-
/**
|
|
771
|
-
* View definition configuration
|
|
772
|
-
*/
|
|
773
|
-
interface ViewConfig {
|
|
774
|
-
/**
|
|
775
|
-
* Display name for the view
|
|
776
|
-
*/
|
|
777
|
-
name: string;
|
|
778
|
-
/**
|
|
779
|
-
* URL-friendly slug for the view, used in Studio URLs like /studio/views/:slug. Absent, the
|
|
780
|
-
* platform derives one from the id when it reads the schema.
|
|
781
|
-
*/
|
|
782
|
-
slug?: string;
|
|
783
|
-
/**
|
|
784
|
-
* Optional description for the view
|
|
785
|
-
*/
|
|
786
|
-
description?: string;
|
|
787
|
-
/**
|
|
788
|
-
* Icon (emoji or icon name) for the view
|
|
789
|
-
*/
|
|
790
|
-
icon?: string;
|
|
791
|
-
/**
|
|
792
|
-
* Color for the view in the sidebar
|
|
793
|
-
*/
|
|
794
|
-
color?: string;
|
|
795
|
-
/**
|
|
796
|
-
* View scope - what content types this view applies to
|
|
797
|
-
*/
|
|
798
|
-
scope: ViewScopeConfig;
|
|
799
|
-
/**
|
|
800
|
-
* Filter conditions (optional), combined with AND. A flat list: an OR within one field is
|
|
801
|
-
* `isAnyOf`, and there is no filter group.
|
|
802
|
-
*
|
|
803
|
-
* Deploy judges each against the entries the view lists: the field must be one they can be
|
|
804
|
-
* narrowed by, and it must offer the operator — a boolean field takes `is` with `true` or
|
|
805
|
-
* `false`, for example, not `isTrue`.
|
|
806
|
-
*/
|
|
807
|
-
filters?: ViewFilter[];
|
|
808
|
-
/**
|
|
809
|
-
* Column field IDs to display (optional)
|
|
810
|
-
* If not specified, uses default columns
|
|
811
|
-
*/
|
|
812
|
-
columns?: string[];
|
|
813
|
-
/**
|
|
814
|
-
* Metadata field IDs to show under title (max 3)
|
|
815
|
-
*/
|
|
816
|
-
metadataFields?: string[];
|
|
817
|
-
/**
|
|
818
|
-
* Default sort (optional). `field` names the Property to sort by, as a filter names one —
|
|
819
|
-
* `fields.<id>` or `_metadata.<id>` — and deploy refuses one the view's entries cannot be sorted
|
|
820
|
-
* by. `columns` and `metadataFields` are display settings and name field IDs as written.
|
|
821
|
-
*/
|
|
822
|
-
sort?: {
|
|
823
|
-
field: string;
|
|
824
|
-
direction: 'asc' | 'desc';
|
|
825
|
-
};
|
|
826
|
-
/**
|
|
827
|
-
* Sort order in the sidebar (lower = higher priority)
|
|
828
|
-
*/
|
|
829
|
-
sortOrder?: number;
|
|
830
|
-
}
|
|
831
|
-
/**
|
|
832
|
-
* Complete view definition with ID
|
|
833
|
-
*/
|
|
834
|
-
interface ViewDefinition extends ViewConfig {
|
|
835
|
-
/**
|
|
836
|
-
* Internal tag for type discrimination
|
|
837
|
-
*/
|
|
838
|
-
readonly _tag: 'view';
|
|
839
|
-
/**
|
|
840
|
-
* Unique view ID (must start with a letter)
|
|
841
|
-
*/
|
|
842
|
-
readonly id: string;
|
|
843
|
-
}
|
|
844
|
-
/**
|
|
845
|
-
* Define a schema view
|
|
846
|
-
*
|
|
847
|
-
* Views are pre-configured entry list displays with filters,
|
|
848
|
-
* columns, and metadata settings.
|
|
849
|
-
*
|
|
850
|
-
* @example
|
|
851
|
-
* const featuredPosts = defineView('featuredPosts', {
|
|
852
|
-
* name: 'Featured Posts',
|
|
853
|
-
* description: 'Blog posts marked as featured',
|
|
854
|
-
* icon: '📝',
|
|
855
|
-
* scope: { type: 'contentType', contentType: 'post' },
|
|
856
|
-
* filters: [
|
|
857
|
-
* { field: 'fields.featured', operator: 'is', value: true }
|
|
858
|
-
* ],
|
|
859
|
-
* columns: ['title', 'author', 'publishedAt'],
|
|
860
|
-
* metadataFields: ['category', 'views'],
|
|
861
|
-
* sort: { field: '_metadata.publishedAt', direction: 'desc' }
|
|
862
|
-
* })
|
|
863
|
-
*
|
|
864
|
-
* @example
|
|
865
|
-
* const archivedContent = defineView('archivedContent', {
|
|
866
|
-
* name: 'Archived',
|
|
867
|
-
* scope: { type: 'all' },
|
|
868
|
-
* filters: [
|
|
869
|
-
* { field: '_metadata.status', operator: 'is', value: 'archived' }
|
|
870
|
-
* ]
|
|
871
|
-
* })
|
|
872
|
-
*
|
|
873
|
-
* @param id - Unique view ID (must start with a letter)
|
|
874
|
-
* @param config - View configuration
|
|
875
|
-
* @returns View definition object
|
|
876
|
-
*/
|
|
877
|
-
declare function defineView(id: string, config: ViewConfig): ViewDefinition;
|
|
878
|
-
|
|
879
662
|
/**
|
|
880
663
|
* Schema definition matching @relyio/schema SchemaDefinitionSchema
|
|
881
664
|
*
|
|
@@ -1031,4 +814,4 @@ type SchemaAssetTypeNames<T extends AnySchemaDefinition> = NonNullable<T['assetT
|
|
|
1031
814
|
*/
|
|
1032
815
|
type SchemaLocaleCodes<T extends AnySchemaDefinition> = NonNullable<T['locales']> extends readonly LocaleDefinition[] ? NonNullable<T['locales']>[number]['code'] : never;
|
|
1033
816
|
|
|
1034
|
-
export { type
|
|
817
|
+
export { type CachePolicyObject as $, type RoleDefinition as A, BUILT_IN_ROLES as B, defineQuery as C, type QueryDefinition as D, type QueryType as E, type FieldVisibility as F, type FullTextSearch as G, type FetchBlock as H, type AggregateBlock as I, type SearchBlock as J, type WhereValue as K, type LocaleOptions as L, type WhereOperator as M, type HavingOperator as N, type QueryScalar as O, type SortCondition as P, type QueryConfig as Q, ROLE_ACTIONS as R, type SchemaConfig as S, type TextDirection as T, type SortDirection as U, type IncludeDefinition as V, type WhereCondition as W, type IncludeRelationship as X, type SelectMapping as Y, type FilterDefinition as Z, type CachePolicy as _, type SchemaDefinition as a, type IncludeSubQuery as a0, type IncludeSubQueries as a1, type Parameterizable as a2, type QueryParameter as a3, type QueryParameterType as a4, type QueryCardinality as a5, type InferQueryResponse as a6, type InferQueryParams as a7, type FilterOperator as a8, type SchemaContentTypeNames as b, type SchemaSingletonNames as c, defineSchema as d, type SchemaQueryNames as e, type SchemaLocaleCodes as f, type SchemaSettingsGroupNames as g, type SchemaAssetTypeNames as h, type SchemaEntry as i, type SchemaEntryOf as j, defineLocale as k, isLocaleDefinition as l, getLocaleCodes as m, findDefaultLocale as n, getActiveLocales as o, buildFallbackChain as p, type LocaleDefinition as q, defineRole as r, isRoleDefinition as s, isBuiltInRole as t, getBuiltInRoleActions as u, BUILT_IN_ROLE_ACTIONS as v, type BuiltInRole as w, type RoleAction as x, type ResourcePermission as y, type RoleConfig as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ao as ContentTypeDefinition, av as SingletonContentTypeDefinition, aB as SettingsGroupDefinition, be as WorkflowDefinition, bs as ViewDefinition, aG as AssetTypeDefinition, aq as InferContentType } from './include-paths-Bs5FhNw2.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Query definition matching @relyio/schema QueryDefinitionSchema
|
|
@@ -659,223 +659,6 @@ declare function isBuiltInRole(roleId: string): roleId is BuiltInRole;
|
|
|
659
659
|
*/
|
|
660
660
|
declare function getBuiltInRoleActions(roleId: BuiltInRole): readonly RoleAction[];
|
|
661
661
|
|
|
662
|
-
/**
|
|
663
|
-
* View definitions for SDK schema
|
|
664
|
-
*
|
|
665
|
-
* Views define pre-configured entry list configurations with filters,
|
|
666
|
-
* columns, and metadata display settings.
|
|
667
|
-
*/
|
|
668
|
-
/**
|
|
669
|
-
* View scope defines which content types a view applies to.
|
|
670
|
-
*
|
|
671
|
-
* When using `contentTypes` (plural) or `all`, the view displays entries
|
|
672
|
-
* from multiple content types. In this case:
|
|
673
|
-
*
|
|
674
|
-
* - Columns/fields may only exist on some content types
|
|
675
|
-
* - For entries where a field doesn't exist, the UI displays "—"
|
|
676
|
-
* - System fields (id, status, createdAt, updatedAt) exist on all entries
|
|
677
|
-
* - Filters on non-existent fields are skipped for that entry type
|
|
678
|
-
*
|
|
679
|
-
* Example display:
|
|
680
|
-
* | Content Type | title | author | productCode |
|
|
681
|
-
* |--------------|-------|--------|-------------|
|
|
682
|
-
* | post | ✓ | ✓ | — |
|
|
683
|
-
* | product | ✓ | — | ✓ |
|
|
684
|
-
*/
|
|
685
|
-
/**
|
|
686
|
-
* Scope for a single content type
|
|
687
|
-
*/
|
|
688
|
-
interface ContentTypeScopeConfig {
|
|
689
|
-
type: 'contentType';
|
|
690
|
-
contentType: string;
|
|
691
|
-
}
|
|
692
|
-
/**
|
|
693
|
-
* Scope for multiple content types
|
|
694
|
-
*
|
|
695
|
-
* Fields not present on all content types will show "—" in the UI
|
|
696
|
-
*/
|
|
697
|
-
interface ContentTypesScopeConfig {
|
|
698
|
-
type: 'contentTypes';
|
|
699
|
-
contentTypes: string[];
|
|
700
|
-
}
|
|
701
|
-
/**
|
|
702
|
-
* Scope for an entry type (content, singleton, settings, asset)
|
|
703
|
-
*/
|
|
704
|
-
interface EntryTypeScopeConfig {
|
|
705
|
-
type: 'entryType';
|
|
706
|
-
entryType: 'content' | 'singleton' | 'settings' | 'asset';
|
|
707
|
-
}
|
|
708
|
-
/**
|
|
709
|
-
* Scope for all content
|
|
710
|
-
*
|
|
711
|
-
* Fields not present on all content types will show "—" in the UI
|
|
712
|
-
*/
|
|
713
|
-
interface AllScopeConfig {
|
|
714
|
-
type: 'all';
|
|
715
|
-
}
|
|
716
|
-
/**
|
|
717
|
-
* View scope options
|
|
718
|
-
*/
|
|
719
|
-
type ViewScopeConfig = ContentTypeScopeConfig | ContentTypesScopeConfig | EntryTypeScopeConfig | AllScopeConfig;
|
|
720
|
-
/**
|
|
721
|
-
* The operators a view filter may name: the schema's `FILTER_OPERATORS`, which deploy parses a view
|
|
722
|
-
* with and the read core compiles every one of.
|
|
723
|
-
*
|
|
724
|
-
* This list used to be its own: ten of its names — `doesNotContain`, `isNotEmpty`, `isOnOrBefore`,
|
|
725
|
-
* `isOnOrAfter`, `tomorrow`, `lastWeek`, `lastMonth`, `includesAll`, `includesAny`, `excludes` —
|
|
726
|
-
* are none the schema declares, so a view naming one was refused at deploy, and six the schema does
|
|
727
|
-
* declare — `notContains`, `notIncludes`, `isOn`, `isBetween`, `thisYear`, `hasValue` — could not be
|
|
728
|
-
* written here, so a view pulled by `relyio generate-types` that named one did not compile.
|
|
729
|
-
* `@relyio/codegen-typescript`'s `src/__tests__/sdk-definition-config.types.ts` holds the two to each
|
|
730
|
-
* other (REL-1457).
|
|
731
|
-
*/
|
|
732
|
-
type ViewFilterOperator = 'is' | 'isNot' | 'contains' | 'notContains' | 'startsWith' | 'endsWith' | 'isAnyOf' | 'isNoneOf' | 'includes' | 'notIncludes' | 'isTrue' | 'isFalse' | 'equals' | 'notEquals' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between' | 'isOn' | 'isBefore' | 'isAfter' | 'isBetween' | 'inTheLast' | 'inTheNext' | 'today' | 'yesterday' | 'thisWeek' | 'thisMonth' | 'thisYear' | 'isEmpty' | 'hasValue';
|
|
733
|
-
/** A span of time back or forward from now, for `inTheLast` and `inTheNext`. */
|
|
734
|
-
interface ViewFilterRelativeDate {
|
|
735
|
-
amount: number;
|
|
736
|
-
unit: 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'years';
|
|
737
|
-
}
|
|
738
|
-
/** What a filter compares against: the schema's `FilterValueSchema`. */
|
|
739
|
-
type ViewFilterValue = string | number | boolean | null | (string | number)[] | {
|
|
740
|
-
from: string | number | Date;
|
|
741
|
-
to: string | number | Date;
|
|
742
|
-
} | ViewFilterRelativeDate | Date;
|
|
743
|
-
/**
|
|
744
|
-
* One filter of a view: a field, an operator and the value it compares with.
|
|
745
|
-
*/
|
|
746
|
-
interface ViewFilterCondition {
|
|
747
|
-
/**
|
|
748
|
-
* The Property to filter on, as the Studio's entry list names it: `fields.<id>` for a field your
|
|
749
|
-
* schema declares (`fields.seo.title` for a field of an object's value), `_metadata.<id>` for a system
|
|
750
|
-
* field — `_metadata.status`, `_metadata.createdAt`, `_metadata.updatedAt`. So a field called
|
|
751
|
-
* `status` (`fields.status`) and the entry's own lifecycle (`_metadata.status`) are both
|
|
752
|
-
* filterable.
|
|
753
|
-
*/
|
|
754
|
-
field: string;
|
|
755
|
-
/**
|
|
756
|
-
* Filter operator
|
|
757
|
-
*/
|
|
758
|
-
operator: ViewFilterOperator;
|
|
759
|
-
/**
|
|
760
|
-
* Filter value (optional for some operators like isEmpty)
|
|
761
|
-
*/
|
|
762
|
-
value?: ViewFilterValue;
|
|
763
|
-
}
|
|
764
|
-
/**
|
|
765
|
-
* A view's filter. A view's filters are a flat list joined by AND — the Filters the Studio's entry
|
|
766
|
-
* list takes, each drawn as a Chip — so there is no filter group: an OR within one field is
|
|
767
|
-
* `isAnyOf`. RelyIO refuses a group by name when you deploy.
|
|
768
|
-
*/
|
|
769
|
-
type ViewFilter = ViewFilterCondition;
|
|
770
|
-
/**
|
|
771
|
-
* View definition configuration
|
|
772
|
-
*/
|
|
773
|
-
interface ViewConfig {
|
|
774
|
-
/**
|
|
775
|
-
* Display name for the view
|
|
776
|
-
*/
|
|
777
|
-
name: string;
|
|
778
|
-
/**
|
|
779
|
-
* URL-friendly slug for the view, used in Studio URLs like /studio/views/:slug. Absent, the
|
|
780
|
-
* platform derives one from the id when it reads the schema.
|
|
781
|
-
*/
|
|
782
|
-
slug?: string;
|
|
783
|
-
/**
|
|
784
|
-
* Optional description for the view
|
|
785
|
-
*/
|
|
786
|
-
description?: string;
|
|
787
|
-
/**
|
|
788
|
-
* Icon (emoji or icon name) for the view
|
|
789
|
-
*/
|
|
790
|
-
icon?: string;
|
|
791
|
-
/**
|
|
792
|
-
* Color for the view in the sidebar
|
|
793
|
-
*/
|
|
794
|
-
color?: string;
|
|
795
|
-
/**
|
|
796
|
-
* View scope - what content types this view applies to
|
|
797
|
-
*/
|
|
798
|
-
scope: ViewScopeConfig;
|
|
799
|
-
/**
|
|
800
|
-
* Filter conditions (optional), combined with AND. A flat list: an OR within one field is
|
|
801
|
-
* `isAnyOf`, and there is no filter group.
|
|
802
|
-
*
|
|
803
|
-
* Deploy judges each against the entries the view lists: the field must be one they can be
|
|
804
|
-
* narrowed by, and it must offer the operator — a boolean field takes `is` with `true` or
|
|
805
|
-
* `false`, for example, not `isTrue`.
|
|
806
|
-
*/
|
|
807
|
-
filters?: ViewFilter[];
|
|
808
|
-
/**
|
|
809
|
-
* Column field IDs to display (optional)
|
|
810
|
-
* If not specified, uses default columns
|
|
811
|
-
*/
|
|
812
|
-
columns?: string[];
|
|
813
|
-
/**
|
|
814
|
-
* Metadata field IDs to show under title (max 3)
|
|
815
|
-
*/
|
|
816
|
-
metadataFields?: string[];
|
|
817
|
-
/**
|
|
818
|
-
* Default sort (optional). `field` names the Property to sort by, as a filter names one —
|
|
819
|
-
* `fields.<id>` or `_metadata.<id>` — and deploy refuses one the view's entries cannot be sorted
|
|
820
|
-
* by. `columns` and `metadataFields` are display settings and name field IDs as written.
|
|
821
|
-
*/
|
|
822
|
-
sort?: {
|
|
823
|
-
field: string;
|
|
824
|
-
direction: 'asc' | 'desc';
|
|
825
|
-
};
|
|
826
|
-
/**
|
|
827
|
-
* Sort order in the sidebar (lower = higher priority)
|
|
828
|
-
*/
|
|
829
|
-
sortOrder?: number;
|
|
830
|
-
}
|
|
831
|
-
/**
|
|
832
|
-
* Complete view definition with ID
|
|
833
|
-
*/
|
|
834
|
-
interface ViewDefinition extends ViewConfig {
|
|
835
|
-
/**
|
|
836
|
-
* Internal tag for type discrimination
|
|
837
|
-
*/
|
|
838
|
-
readonly _tag: 'view';
|
|
839
|
-
/**
|
|
840
|
-
* Unique view ID (must start with a letter)
|
|
841
|
-
*/
|
|
842
|
-
readonly id: string;
|
|
843
|
-
}
|
|
844
|
-
/**
|
|
845
|
-
* Define a schema view
|
|
846
|
-
*
|
|
847
|
-
* Views are pre-configured entry list displays with filters,
|
|
848
|
-
* columns, and metadata settings.
|
|
849
|
-
*
|
|
850
|
-
* @example
|
|
851
|
-
* const featuredPosts = defineView('featuredPosts', {
|
|
852
|
-
* name: 'Featured Posts',
|
|
853
|
-
* description: 'Blog posts marked as featured',
|
|
854
|
-
* icon: '📝',
|
|
855
|
-
* scope: { type: 'contentType', contentType: 'post' },
|
|
856
|
-
* filters: [
|
|
857
|
-
* { field: 'fields.featured', operator: 'is', value: true }
|
|
858
|
-
* ],
|
|
859
|
-
* columns: ['title', 'author', 'publishedAt'],
|
|
860
|
-
* metadataFields: ['category', 'views'],
|
|
861
|
-
* sort: { field: '_metadata.publishedAt', direction: 'desc' }
|
|
862
|
-
* })
|
|
863
|
-
*
|
|
864
|
-
* @example
|
|
865
|
-
* const archivedContent = defineView('archivedContent', {
|
|
866
|
-
* name: 'Archived',
|
|
867
|
-
* scope: { type: 'all' },
|
|
868
|
-
* filters: [
|
|
869
|
-
* { field: '_metadata.status', operator: 'is', value: 'archived' }
|
|
870
|
-
* ]
|
|
871
|
-
* })
|
|
872
|
-
*
|
|
873
|
-
* @param id - Unique view ID (must start with a letter)
|
|
874
|
-
* @param config - View configuration
|
|
875
|
-
* @returns View definition object
|
|
876
|
-
*/
|
|
877
|
-
declare function defineView(id: string, config: ViewConfig): ViewDefinition;
|
|
878
|
-
|
|
879
662
|
/**
|
|
880
663
|
* Schema definition matching @relyio/schema SchemaDefinitionSchema
|
|
881
664
|
*
|
|
@@ -1031,4 +814,4 @@ type SchemaAssetTypeNames<T extends AnySchemaDefinition> = NonNullable<T['assetT
|
|
|
1031
814
|
*/
|
|
1032
815
|
type SchemaLocaleCodes<T extends AnySchemaDefinition> = NonNullable<T['locales']> extends readonly LocaleDefinition[] ? NonNullable<T['locales']>[number]['code'] : never;
|
|
1033
816
|
|
|
1034
|
-
export { type
|
|
817
|
+
export { type CachePolicyObject as $, type RoleDefinition as A, BUILT_IN_ROLES as B, defineQuery as C, type QueryDefinition as D, type QueryType as E, type FieldVisibility as F, type FullTextSearch as G, type FetchBlock as H, type AggregateBlock as I, type SearchBlock as J, type WhereValue as K, type LocaleOptions as L, type WhereOperator as M, type HavingOperator as N, type QueryScalar as O, type SortCondition as P, type QueryConfig as Q, ROLE_ACTIONS as R, type SchemaConfig as S, type TextDirection as T, type SortDirection as U, type IncludeDefinition as V, type WhereCondition as W, type IncludeRelationship as X, type SelectMapping as Y, type FilterDefinition as Z, type CachePolicy as _, type SchemaDefinition as a, type IncludeSubQuery as a0, type IncludeSubQueries as a1, type Parameterizable as a2, type QueryParameter as a3, type QueryParameterType as a4, type QueryCardinality as a5, type InferQueryResponse as a6, type InferQueryParams as a7, type FilterOperator as a8, type SchemaContentTypeNames as b, type SchemaSingletonNames as c, defineSchema as d, type SchemaQueryNames as e, type SchemaLocaleCodes as f, type SchemaSettingsGroupNames as g, type SchemaAssetTypeNames as h, type SchemaEntry as i, type SchemaEntryOf as j, defineLocale as k, isLocaleDefinition as l, getLocaleCodes as m, findDefaultLocale as n, getActiveLocales as o, buildFallbackChain as p, type LocaleDefinition as q, defineRole as r, isRoleDefinition as s, isBuiltInRole as t, getBuiltInRoleActions as u, BUILT_IN_ROLE_ACTIONS as v, type BuiltInRole as w, type RoleAction as x, type ResourcePermission as y, type RoleConfig as z };
|