@webiny/api-headless-cms-storage 6.6.0-alpha.0 → 6.6.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +20 -15
- package/__tests__/filtering/getValue.test.ts +0 -58
- package/__tests__/filtering/mocks/entry.noModel.ts +0 -110
- package/__tests__/path/plainObject.test.ts +0 -32
- package/__tests__/transforms/datetime.test.ts +0 -71
- package/dist/package.json +0 -30
- package/src/cms/storageHelpers.ts +0 -92
- package/src/features/FilterRegistriesFeature.ts +0 -40
- package/src/features/fieldFilterCreate/FieldFilterCreateRegistry.ts +0 -25
- package/src/features/fieldFilterCreate/abstractions.ts +0 -51
- package/src/features/fieldFilterPath/FieldFilterPathRegistry.ts +0 -13
- package/src/features/fieldFilterPath/abstractions.ts +0 -22
- package/src/features/fieldFilterValueTransform/FieldFilterValueTransformRegistry.ts +0 -15
- package/src/features/fieldFilterValueTransform/abstractions.ts +0 -21
- package/src/features/fieldSorting/FieldSortingRegistry.ts +0 -20
- package/src/features/fieldSorting/abstractions.ts +0 -49
- package/src/filtering/expressions/createExpressions.ts +0 -170
- package/src/filtering/fields/createFields.ts +0 -124
- package/src/filtering/fields/extractSort.ts +0 -97
- package/src/filtering/fields/systemFields.ts +0 -165
- package/src/filtering/fields/types.ts +0 -46
- package/src/filtering/filter.ts +0 -166
- package/src/filtering/fullTextSearch.ts +0 -40
- package/src/filtering/getValue.ts +0 -64
- package/src/filtering/mapPlugins.ts +0 -30
- package/src/filtering/plugins/defaultFilterCreate.ts +0 -36
- package/src/filtering/plugins/index.ts +0 -13
- package/src/filtering/plugins/objectFilterCreate.ts +0 -100
- package/src/filtering/plugins/refFilterCreate.ts +0 -83
- package/src/filtering/plugins/searchableJsonFilterCreate.ts +0 -78
- package/src/filtering/sort.ts +0 -79
- package/src/filtering/transform.ts +0 -11
- package/src/filtering/values.ts +0 -24
- package/src/filtering/where.ts +0 -24
- package/src/handlers/datetimeTransformHandler.ts +0 -52
- package/src/handlers/defaultFilterCreateHandler.ts +0 -31
- package/src/handlers/locationFolderIdPathHandler.ts +0 -24
- package/src/handlers/objectFilterCreateHandler.ts +0 -86
- package/src/handlers/plainObjectPathHandler.ts +0 -17
- package/src/handlers/refFilterCreateHandler.ts +0 -65
- package/src/handlers/searchableJsonFilterCreateHandler.ts +0 -61
- package/src/index.ts +0 -63
- package/src/path/locationFolderId.ts +0 -29
- package/src/path/plainObject.ts +0 -21
- package/src/plugins/CmsEntryFieldFilterPathPlugin.ts +0 -58
- package/src/plugins/CmsEntryFieldFilterPlugin.ts +0 -59
- package/src/plugins/CmsEntryFieldSortingPlugin.ts +0 -63
- package/src/plugins/CmsFieldFilterValueTransformPlugin.ts +0 -43
- package/src/plugins/index.ts +0 -10
- package/src/transforms/datetime.ts +0 -62
- package/tsconfig.build.json +0 -33
- package/tsconfig.json +0 -33
- package/vitest.config.ts +0 -5
- package/webiny.config.js +0 -8
- /package/{dist/LICENSE → LICENSE} +0 -0
- /package/{dist/README.md → README.md} +0 -0
- /package/{dist/cms → cms}/storageHelpers.d.ts +0 -0
- /package/{dist/cms → cms}/storageHelpers.js +0 -0
- /package/{dist/cms → cms}/storageHelpers.js.map +0 -0
- /package/{dist/features → features}/FilterRegistriesFeature.d.ts +0 -0
- /package/{dist/features → features}/FilterRegistriesFeature.js +0 -0
- /package/{dist/features → features}/FilterRegistriesFeature.js.map +0 -0
- /package/{dist/features → features}/fieldFilterCreate/FieldFilterCreateRegistry.d.ts +0 -0
- /package/{dist/features → features}/fieldFilterCreate/FieldFilterCreateRegistry.js +0 -0
- /package/{dist/features → features}/fieldFilterCreate/FieldFilterCreateRegistry.js.map +0 -0
- /package/{dist/features → features}/fieldFilterCreate/abstractions.d.ts +0 -0
- /package/{dist/features → features}/fieldFilterCreate/abstractions.js +0 -0
- /package/{dist/features → features}/fieldFilterCreate/abstractions.js.map +0 -0
- /package/{dist/features → features}/fieldFilterPath/FieldFilterPathRegistry.d.ts +0 -0
- /package/{dist/features → features}/fieldFilterPath/FieldFilterPathRegistry.js +0 -0
- /package/{dist/features → features}/fieldFilterPath/FieldFilterPathRegistry.js.map +0 -0
- /package/{dist/features → features}/fieldFilterPath/abstractions.d.ts +0 -0
- /package/{dist/features → features}/fieldFilterPath/abstractions.js +0 -0
- /package/{dist/features → features}/fieldFilterPath/abstractions.js.map +0 -0
- /package/{dist/features → features}/fieldFilterValueTransform/FieldFilterValueTransformRegistry.d.ts +0 -0
- /package/{dist/features → features}/fieldFilterValueTransform/FieldFilterValueTransformRegistry.js +0 -0
- /package/{dist/features → features}/fieldFilterValueTransform/FieldFilterValueTransformRegistry.js.map +0 -0
- /package/{dist/features → features}/fieldFilterValueTransform/abstractions.d.ts +0 -0
- /package/{dist/features → features}/fieldFilterValueTransform/abstractions.js +0 -0
- /package/{dist/features → features}/fieldFilterValueTransform/abstractions.js.map +0 -0
- /package/{dist/features → features}/fieldSorting/FieldSortingRegistry.d.ts +0 -0
- /package/{dist/features → features}/fieldSorting/FieldSortingRegistry.js +0 -0
- /package/{dist/features → features}/fieldSorting/FieldSortingRegistry.js.map +0 -0
- /package/{dist/features → features}/fieldSorting/abstractions.d.ts +0 -0
- /package/{dist/features → features}/fieldSorting/abstractions.js +0 -0
- /package/{dist/features → features}/fieldSorting/abstractions.js.map +0 -0
- /package/{dist/filtering → filtering}/expressions/createExpressions.d.ts +0 -0
- /package/{dist/filtering → filtering}/expressions/createExpressions.js +0 -0
- /package/{dist/filtering → filtering}/expressions/createExpressions.js.map +0 -0
- /package/{dist/filtering → filtering}/fields/createFields.d.ts +0 -0
- /package/{dist/filtering → filtering}/fields/createFields.js +0 -0
- /package/{dist/filtering → filtering}/fields/createFields.js.map +0 -0
- /package/{dist/filtering → filtering}/fields/extractSort.d.ts +0 -0
- /package/{dist/filtering → filtering}/fields/extractSort.js +0 -0
- /package/{dist/filtering → filtering}/fields/extractSort.js.map +0 -0
- /package/{dist/filtering → filtering}/fields/systemFields.d.ts +0 -0
- /package/{dist/filtering → filtering}/fields/systemFields.js +0 -0
- /package/{dist/filtering → filtering}/fields/systemFields.js.map +0 -0
- /package/{dist/filtering → filtering}/fields/types.d.ts +0 -0
- /package/{dist/filtering → filtering}/fields/types.js +0 -0
- /package/{dist/filtering → filtering}/filter.d.ts +0 -0
- /package/{dist/filtering → filtering}/filter.js +0 -0
- /package/{dist/filtering → filtering}/filter.js.map +0 -0
- /package/{dist/filtering → filtering}/fullTextSearch.d.ts +0 -0
- /package/{dist/filtering → filtering}/fullTextSearch.js +0 -0
- /package/{dist/filtering → filtering}/fullTextSearch.js.map +0 -0
- /package/{dist/filtering → filtering}/getValue.d.ts +0 -0
- /package/{dist/filtering → filtering}/getValue.js +0 -0
- /package/{dist/filtering → filtering}/getValue.js.map +0 -0
- /package/{dist/filtering → filtering}/mapPlugins.d.ts +0 -0
- /package/{dist/filtering → filtering}/mapPlugins.js +0 -0
- /package/{dist/filtering → filtering}/mapPlugins.js.map +0 -0
- /package/{dist/filtering → filtering}/plugins/defaultFilterCreate.d.ts +0 -0
- /package/{dist/filtering → filtering}/plugins/defaultFilterCreate.js +0 -0
- /package/{dist/filtering → filtering}/plugins/defaultFilterCreate.js.map +0 -0
- /package/{dist/filtering → filtering}/plugins/index.d.ts +0 -0
- /package/{dist/filtering → filtering}/plugins/index.js +0 -0
- /package/{dist/filtering → filtering}/plugins/index.js.map +0 -0
- /package/{dist/filtering → filtering}/plugins/objectFilterCreate.d.ts +0 -0
- /package/{dist/filtering → filtering}/plugins/objectFilterCreate.js +0 -0
- /package/{dist/filtering → filtering}/plugins/objectFilterCreate.js.map +0 -0
- /package/{dist/filtering → filtering}/plugins/refFilterCreate.d.ts +0 -0
- /package/{dist/filtering → filtering}/plugins/refFilterCreate.js +0 -0
- /package/{dist/filtering → filtering}/plugins/refFilterCreate.js.map +0 -0
- /package/{dist/filtering → filtering}/plugins/searchableJsonFilterCreate.d.ts +0 -0
- /package/{dist/filtering → filtering}/plugins/searchableJsonFilterCreate.js +0 -0
- /package/{dist/filtering → filtering}/plugins/searchableJsonFilterCreate.js.map +0 -0
- /package/{dist/filtering → filtering}/sort.d.ts +0 -0
- /package/{dist/filtering → filtering}/sort.js +0 -0
- /package/{dist/filtering → filtering}/sort.js.map +0 -0
- /package/{dist/filtering → filtering}/transform.d.ts +0 -0
- /package/{dist/filtering → filtering}/transform.js +0 -0
- /package/{dist/filtering → filtering}/transform.js.map +0 -0
- /package/{dist/filtering → filtering}/values.d.ts +0 -0
- /package/{dist/filtering → filtering}/values.js +0 -0
- /package/{dist/filtering → filtering}/values.js.map +0 -0
- /package/{dist/filtering → filtering}/where.d.ts +0 -0
- /package/{dist/filtering → filtering}/where.js +0 -0
- /package/{dist/filtering → filtering}/where.js.map +0 -0
- /package/{dist/handlers → handlers}/datetimeTransformHandler.d.ts +0 -0
- /package/{dist/handlers → handlers}/datetimeTransformHandler.js +0 -0
- /package/{dist/handlers → handlers}/datetimeTransformHandler.js.map +0 -0
- /package/{dist/handlers → handlers}/defaultFilterCreateHandler.d.ts +0 -0
- /package/{dist/handlers → handlers}/defaultFilterCreateHandler.js +0 -0
- /package/{dist/handlers → handlers}/defaultFilterCreateHandler.js.map +0 -0
- /package/{dist/handlers → handlers}/locationFolderIdPathHandler.d.ts +0 -0
- /package/{dist/handlers → handlers}/locationFolderIdPathHandler.js +0 -0
- /package/{dist/handlers → handlers}/locationFolderIdPathHandler.js.map +0 -0
- /package/{dist/handlers → handlers}/objectFilterCreateHandler.d.ts +0 -0
- /package/{dist/handlers → handlers}/objectFilterCreateHandler.js +0 -0
- /package/{dist/handlers → handlers}/objectFilterCreateHandler.js.map +0 -0
- /package/{dist/handlers → handlers}/plainObjectPathHandler.d.ts +0 -0
- /package/{dist/handlers → handlers}/plainObjectPathHandler.js +0 -0
- /package/{dist/handlers → handlers}/plainObjectPathHandler.js.map +0 -0
- /package/{dist/handlers → handlers}/refFilterCreateHandler.d.ts +0 -0
- /package/{dist/handlers → handlers}/refFilterCreateHandler.js +0 -0
- /package/{dist/handlers → handlers}/refFilterCreateHandler.js.map +0 -0
- /package/{dist/handlers → handlers}/searchableJsonFilterCreateHandler.d.ts +0 -0
- /package/{dist/handlers → handlers}/searchableJsonFilterCreateHandler.js +0 -0
- /package/{dist/handlers → handlers}/searchableJsonFilterCreateHandler.js.map +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/path → path}/locationFolderId.d.ts +0 -0
- /package/{dist/path → path}/locationFolderId.js +0 -0
- /package/{dist/path → path}/locationFolderId.js.map +0 -0
- /package/{dist/path → path}/plainObject.d.ts +0 -0
- /package/{dist/path → path}/plainObject.js +0 -0
- /package/{dist/path → path}/plainObject.js.map +0 -0
- /package/{dist/plugins → plugins}/CmsEntryFieldFilterPathPlugin.d.ts +0 -0
- /package/{dist/plugins → plugins}/CmsEntryFieldFilterPathPlugin.js +0 -0
- /package/{dist/plugins → plugins}/CmsEntryFieldFilterPathPlugin.js.map +0 -0
- /package/{dist/plugins → plugins}/CmsEntryFieldFilterPlugin.d.ts +0 -0
- /package/{dist/plugins → plugins}/CmsEntryFieldFilterPlugin.js +0 -0
- /package/{dist/plugins → plugins}/CmsEntryFieldFilterPlugin.js.map +0 -0
- /package/{dist/plugins → plugins}/CmsEntryFieldSortingPlugin.d.ts +0 -0
- /package/{dist/plugins → plugins}/CmsEntryFieldSortingPlugin.js +0 -0
- /package/{dist/plugins → plugins}/CmsEntryFieldSortingPlugin.js.map +0 -0
- /package/{dist/plugins → plugins}/CmsFieldFilterValueTransformPlugin.d.ts +0 -0
- /package/{dist/plugins → plugins}/CmsFieldFilterValueTransformPlugin.js +0 -0
- /package/{dist/plugins → plugins}/CmsFieldFilterValueTransformPlugin.js.map +0 -0
- /package/{dist/plugins → plugins}/index.d.ts +0 -0
- /package/{dist/plugins → plugins}/index.js +0 -0
- /package/{dist/transforms → transforms}/datetime.d.ts +0 -0
- /package/{dist/transforms → transforms}/datetime.js +0 -0
- /package/{dist/transforms → transforms}/datetime.js.map +0 -0
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import type { Field } from "~/filtering/fields/types.js";
|
|
3
|
-
import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
4
|
-
|
|
5
|
-
interface CmsEntryFieldSortingPluginCanUseParams {
|
|
6
|
-
model: CmsModel;
|
|
7
|
-
field?: Field;
|
|
8
|
-
fieldId: string;
|
|
9
|
-
order: "ASC" | "DESC";
|
|
10
|
-
/*
|
|
11
|
-
* Combination of fieldId and sortBy.
|
|
12
|
-
*
|
|
13
|
-
* example: id_ASC or createdBy_DESC
|
|
14
|
-
*/
|
|
15
|
-
sortBy: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface CmsEntryFieldSortingPluginCreateSortParams {
|
|
19
|
-
model: CmsModel;
|
|
20
|
-
fieldId: string;
|
|
21
|
-
order: "ASC" | "DESC";
|
|
22
|
-
sortBy: string;
|
|
23
|
-
fields: Record<string, Field>;
|
|
24
|
-
field?: Field;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
interface CmsEntryFieldSortingPluginCreateSortResult {
|
|
28
|
-
valuePath: string;
|
|
29
|
-
reverse: boolean;
|
|
30
|
-
fieldId: string;
|
|
31
|
-
field: Field;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface CmsEntryFieldSortingPluginConfig {
|
|
35
|
-
createSort: (
|
|
36
|
-
params: CmsEntryFieldSortingPluginCreateSortParams
|
|
37
|
-
) => CmsEntryFieldSortingPluginCreateSortResult;
|
|
38
|
-
canUse: (params: CmsEntryFieldSortingPluginCanUseParams) => boolean;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export class CmsEntryFieldSortingPlugin extends Plugin {
|
|
42
|
-
public static override readonly type: string = "cms.entry.field.sorting";
|
|
43
|
-
private readonly config: CmsEntryFieldSortingPluginConfig;
|
|
44
|
-
|
|
45
|
-
public constructor(config: CmsEntryFieldSortingPluginConfig) {
|
|
46
|
-
super();
|
|
47
|
-
this.config = config;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public canUse(params: CmsEntryFieldSortingPluginCanUseParams): boolean {
|
|
51
|
-
return this.config.canUse(params);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public createSort(
|
|
55
|
-
params: CmsEntryFieldSortingPluginCreateSortParams
|
|
56
|
-
): CmsEntryFieldSortingPluginCreateSortResult {
|
|
57
|
-
return this.config.createSort(params);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export const createCmsEntryFieldSortingPlugin = (config: CmsEntryFieldSortingPluginConfig) => {
|
|
62
|
-
return new CmsEntryFieldSortingPlugin(config);
|
|
63
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import type { CmsModelField } from "@webiny/api-headless-cms/types/index.js";
|
|
3
|
-
import type { Plugin as IPlugin } from "@webiny/plugins/types.js";
|
|
4
|
-
|
|
5
|
-
export interface CmsFieldFilterValueTransformParams {
|
|
6
|
-
/* A field which value we are transforming. */
|
|
7
|
-
field: Partial<CmsModelField> &
|
|
8
|
-
Pick<CmsModelField, "id" | "storageId" | "fieldId" | "settings">;
|
|
9
|
-
value: any;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface ICmsFieldFilterValueTransformPlugin extends IPlugin {
|
|
13
|
-
/* A plugin type. */
|
|
14
|
-
type: "cms-field-filter-value-transform";
|
|
15
|
-
/* A field type this plugin is for. */
|
|
16
|
-
fieldType: string;
|
|
17
|
-
/* Transform method which expect field definition and value to transform. */
|
|
18
|
-
transform: (params: CmsFieldFilterValueTransformParams) => any;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
type CmsFieldFilterValueTransformPluginParams = Omit<ICmsFieldFilterValueTransformPlugin, "type">;
|
|
22
|
-
|
|
23
|
-
export class CmsFieldFilterValueTransformPlugin
|
|
24
|
-
extends Plugin
|
|
25
|
-
implements Omit<ICmsFieldFilterValueTransformPlugin, "type">
|
|
26
|
-
{
|
|
27
|
-
public static override type = "cms-field-filter-value-transform";
|
|
28
|
-
|
|
29
|
-
private readonly config: CmsFieldFilterValueTransformPluginParams;
|
|
30
|
-
|
|
31
|
-
public get fieldType(): string {
|
|
32
|
-
return this.config.fieldType;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public get transform(): CmsFieldFilterValueTransformPluginParams["transform"] {
|
|
36
|
-
return this.config.transform;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public constructor(config: CmsFieldFilterValueTransformPluginParams) {
|
|
40
|
-
super();
|
|
41
|
-
this.config = config;
|
|
42
|
-
}
|
|
43
|
-
}
|
package/src/plugins/index.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { CmsEntryFieldFilterPathPlugin } from "./CmsEntryFieldFilterPathPlugin.js";
|
|
2
|
-
export type { CreatePathCallable } from "./CmsEntryFieldFilterPathPlugin.js";
|
|
3
|
-
export {
|
|
4
|
-
CmsEntryFieldSortingPlugin,
|
|
5
|
-
createCmsEntryFieldSortingPlugin
|
|
6
|
-
} from "./CmsEntryFieldSortingPlugin.js";
|
|
7
|
-
export { CmsEntryFieldFilterPlugin } from "./CmsEntryFieldFilterPlugin.js";
|
|
8
|
-
export type { CmsEntryFieldFilterPluginCreateResponse } from "./CmsEntryFieldFilterPlugin.js";
|
|
9
|
-
export { CmsFieldFilterValueTransformPlugin } from "./CmsFieldFilterValueTransformPlugin.js";
|
|
10
|
-
export type { ICmsFieldFilterValueTransformPlugin } from "./CmsFieldFilterValueTransformPlugin.js";
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/* File is @internal. */
|
|
2
|
-
import { parseISO } from "date-fns";
|
|
3
|
-
import {
|
|
4
|
-
CmsFieldFilterValueTransformPlugin,
|
|
5
|
-
CmsFieldFilterValueTransformParams
|
|
6
|
-
} from "../plugins/CmsFieldFilterValueTransformPlugin.js";
|
|
7
|
-
|
|
8
|
-
const transformTime = (value: any): number => {
|
|
9
|
-
if (value === undefined || value === null) {
|
|
10
|
-
throw new Error(`Time value is null or undefined.`);
|
|
11
|
-
} else if (typeof value === "boolean" || value === "" || Array.isArray(value)) {
|
|
12
|
-
throw new Error("Field value must be a string because field is defined as time.");
|
|
13
|
-
}
|
|
14
|
-
const converted = Number(`${value}`);
|
|
15
|
-
if (typeof value === "number" || isNaN(converted) === false) {
|
|
16
|
-
return Number(value);
|
|
17
|
-
} else if (typeof value !== "string") {
|
|
18
|
-
throw new Error("Field value must be a string because field is defined as time.");
|
|
19
|
-
}
|
|
20
|
-
/* This is for the time format, eg. 12:36:25 or 12:36:25.881. */
|
|
21
|
-
const [time, milliseconds = 0] = value.split(".");
|
|
22
|
-
const values = time.split(":").map(Number);
|
|
23
|
-
if (values.length < 2) {
|
|
24
|
-
throw new Error("Time must contain at least hours and minutes.");
|
|
25
|
-
}
|
|
26
|
-
const [hours, minutes, seconds = 0] = values;
|
|
27
|
-
return (hours * 60 * 60 + minutes * 60 + seconds) * 1000 + Number(milliseconds);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const transformDateTime = (value: any): number | null => {
|
|
31
|
-
if (value === null || value === undefined) {
|
|
32
|
-
return null;
|
|
33
|
-
} else if (typeof value === "string") {
|
|
34
|
-
const parsedDateTime = parseISO(value).getTime();
|
|
35
|
-
if (isNaN(parsedDateTime) === false) {
|
|
36
|
-
return parsedDateTime;
|
|
37
|
-
}
|
|
38
|
-
} else if (value instanceof Date || typeof (value as unknown as Date)?.getTime === "function") {
|
|
39
|
-
/* In this case we assume this is a date object, and we just get the time. */
|
|
40
|
-
return value.getTime();
|
|
41
|
-
}
|
|
42
|
-
/* No point in throwing an error here, as this would cause the entire transformation to fail. Instead, we just log a warning and return null. */
|
|
43
|
-
console.warn("Could not parse given dateTime value.", "PARSE_DATE_ERROR", {
|
|
44
|
-
value
|
|
45
|
-
});
|
|
46
|
-
return null;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const createDatetimeTransformValuePlugin = (): CmsFieldFilterValueTransformPlugin => {
|
|
50
|
-
return new CmsFieldFilterValueTransformPlugin({
|
|
51
|
-
name: "cms-field-value-filter-transform-datetime",
|
|
52
|
-
fieldType: "datetime",
|
|
53
|
-
/* Always transform into the milliseconds. */
|
|
54
|
-
transform: ({ field, value }: CmsFieldFilterValueTransformParams) => {
|
|
55
|
-
const { type } = field.settings || {};
|
|
56
|
-
if (type === "time") {
|
|
57
|
-
return transformTime(value);
|
|
58
|
-
}
|
|
59
|
-
return transformDateTime(value);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
};
|
package/tsconfig.build.json
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.build.json",
|
|
3
|
-
"include": ["src"],
|
|
4
|
-
"references": [
|
|
5
|
-
{ "path": "../api/tsconfig.build.json" },
|
|
6
|
-
{ "path": "../api-headless-cms/tsconfig.build.json" },
|
|
7
|
-
{ "path": "../db-utils/tsconfig.build.json" },
|
|
8
|
-
{ "path": "../error/tsconfig.build.json" },
|
|
9
|
-
{ "path": "../feature/tsconfig.build.json" },
|
|
10
|
-
{ "path": "../plugins/tsconfig.build.json" }
|
|
11
|
-
],
|
|
12
|
-
"compilerOptions": {
|
|
13
|
-
"rootDir": "./src",
|
|
14
|
-
"outDir": "./dist",
|
|
15
|
-
"declarationDir": "./dist",
|
|
16
|
-
"paths": {
|
|
17
|
-
"~/*": ["./src/*"],
|
|
18
|
-
"~tests/*": ["./__tests__/*"],
|
|
19
|
-
"@webiny/api/*": ["../api/src/*"],
|
|
20
|
-
"@webiny/api": ["../api/src"],
|
|
21
|
-
"@webiny/api-headless-cms/*": ["../api-headless-cms/src/*"],
|
|
22
|
-
"@webiny/api-headless-cms": ["../api-headless-cms/src"],
|
|
23
|
-
"@webiny/db-utils/*": ["../db-utils/src/*"],
|
|
24
|
-
"@webiny/db-utils": ["../db-utils/src"],
|
|
25
|
-
"@webiny/error/*": ["../error/src/*"],
|
|
26
|
-
"@webiny/error": ["../error/src"],
|
|
27
|
-
"@webiny/feature/*": ["../feature/src/*"],
|
|
28
|
-
"@webiny/feature": ["../feature/src"],
|
|
29
|
-
"@webiny/plugins/*": ["../plugins/src/*"],
|
|
30
|
-
"@webiny/plugins": ["../plugins/src"]
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
|
-
"include": ["src", "__tests__"],
|
|
4
|
-
"references": [
|
|
5
|
-
{ "path": "../api" },
|
|
6
|
-
{ "path": "../api-headless-cms" },
|
|
7
|
-
{ "path": "../db-utils" },
|
|
8
|
-
{ "path": "../error" },
|
|
9
|
-
{ "path": "../feature" },
|
|
10
|
-
{ "path": "../plugins" }
|
|
11
|
-
],
|
|
12
|
-
"compilerOptions": {
|
|
13
|
-
"rootDirs": ["./src", "./__tests__"],
|
|
14
|
-
"outDir": "./dist",
|
|
15
|
-
"declarationDir": "./dist",
|
|
16
|
-
"paths": {
|
|
17
|
-
"~/*": ["./src/*"],
|
|
18
|
-
"~tests/*": ["./__tests__/*"],
|
|
19
|
-
"@webiny/api/*": ["../api/src/*"],
|
|
20
|
-
"@webiny/api": ["../api/src"],
|
|
21
|
-
"@webiny/api-headless-cms/*": ["../api-headless-cms/src/*"],
|
|
22
|
-
"@webiny/api-headless-cms": ["../api-headless-cms/src"],
|
|
23
|
-
"@webiny/db-utils/*": ["../db-utils/src/*"],
|
|
24
|
-
"@webiny/db-utils": ["../db-utils/src"],
|
|
25
|
-
"@webiny/error/*": ["../error/src/*"],
|
|
26
|
-
"@webiny/error": ["../error/src"],
|
|
27
|
-
"@webiny/feature/*": ["../feature/src/*"],
|
|
28
|
-
"@webiny/feature": ["../feature/src"],
|
|
29
|
-
"@webiny/plugins/*": ["../plugins/src/*"],
|
|
30
|
-
"@webiny/plugins": ["../plugins/src"]
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
package/vitest.config.ts
DELETED
package/webiny.config.js
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{dist/features → features}/fieldFilterValueTransform/FieldFilterValueTransformRegistry.d.ts
RENAMED
|
File without changes
|
/package/{dist/features → features}/fieldFilterValueTransform/FieldFilterValueTransformRegistry.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|