@webiny/api-headless-cms-ddb 0.0.0-unstable.bca7b3e350 → 0.0.0-unstable.c27f4d8a31
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/README.md +6 -20
- package/definitions/entry.d.ts +4 -5
- package/definitions/entry.js +6 -89
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +4 -5
- package/definitions/group.js +6 -63
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +4 -5
- package/definitions/model.js +6 -90
- package/definitions/model.js.map +1 -1
- package/definitions/table.d.ts +4 -6
- package/definitions/table.js +7 -28
- package/definitions/table.js.map +1 -1
- package/definitions/types.d.ts +60 -0
- package/definitions/types.js +3 -0
- package/definitions/types.js.map +1 -0
- package/dynamoDb/index.d.ts +1 -1
- package/dynamoDb/index.js +8 -20
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/path/locationFolderId.d.ts +2 -0
- package/dynamoDb/path/locationFolderId.js +34 -0
- package/dynamoDb/path/locationFolderId.js.map +1 -0
- package/dynamoDb/path/plainObject.d.ts +1 -1
- package/dynamoDb/path/plainObject.js +6 -20
- package/dynamoDb/path/plainObject.js.map +1 -1
- package/dynamoDb/storage/longText.js +13 -35
- package/dynamoDb/storage/longText.js.map +1 -1
- package/dynamoDb/storage/richText.js +27 -88
- package/dynamoDb/storage/richText.js.map +1 -1
- package/dynamoDb/transformValue/datetime.d.ts +1 -1
- package/dynamoDb/transformValue/datetime.js +7 -19
- package/dynamoDb/transformValue/datetime.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +47 -111
- package/index.js.map +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +16 -0
- package/operations/entry/dataLoader/DataLoaderCache.js +31 -0
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
- package/operations/entry/dataLoader/constants.d.ts +1 -0
- package/operations/entry/dataLoader/constants.js +4 -0
- package/operations/entry/dataLoader/constants.js.map +1 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js +19 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js +35 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +50 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +50 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
- package/operations/entry/dataLoader/getRevisionById.js +56 -0
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
- package/operations/entry/dataLoader/index.d.ts +8 -0
- package/operations/entry/dataLoader/index.js +19 -0
- package/operations/entry/dataLoader/index.js.map +1 -0
- package/operations/entry/dataLoader/types.d.ts +6 -0
- package/operations/entry/dataLoader/types.js +3 -0
- package/operations/entry/dataLoader/types.js.map +1 -0
- package/operations/entry/dataLoaders.d.ts +14 -30
- package/operations/entry/dataLoaders.js +58 -271
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/filtering/createExpressions.d.ts +5 -5
- package/operations/entry/filtering/createExpressions.js +30 -68
- package/operations/entry/filtering/createExpressions.js.map +1 -1
- package/operations/entry/filtering/createFields.d.ts +6 -4
- package/operations/entry/filtering/createFields.js +86 -103
- package/operations/entry/filtering/createFields.js.map +1 -1
- package/operations/entry/filtering/extractSort.d.ts +6 -6
- package/operations/entry/filtering/extractSort.js +39 -32
- package/operations/entry/filtering/extractSort.js.map +1 -1
- package/operations/entry/filtering/filter.d.ts +6 -6
- package/operations/entry/filtering/filter.js +36 -64
- package/operations/entry/filtering/filter.js.map +1 -1
- package/operations/entry/filtering/fullTextSearch.d.ts +3 -3
- package/operations/entry/filtering/fullTextSearch.js +6 -24
- package/operations/entry/filtering/fullTextSearch.js.map +1 -1
- package/operations/entry/filtering/getValue.js +5 -27
- package/operations/entry/filtering/getValue.js.map +1 -1
- package/operations/entry/filtering/index.d.ts +2 -2
- package/operations/entry/filtering/index.js +3 -20
- package/operations/entry/filtering/index.js.map +1 -1
- package/operations/entry/filtering/mapPlugins.d.ts +2 -2
- package/operations/entry/filtering/mapPlugins.js +4 -18
- package/operations/entry/filtering/mapPlugins.js.map +1 -1
- package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +2 -2
- package/operations/entry/filtering/plugins/defaultFilterCreate.js +9 -20
- package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +1 -1
- package/operations/entry/filtering/plugins/index.d.ts +1 -1
- package/operations/entry/filtering/plugins/index.js +7 -16
- package/operations/entry/filtering/plugins/index.js.map +1 -1
- package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +2 -2
- package/operations/entry/filtering/plugins/objectFilterCreate.js +16 -39
- package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -1
- package/operations/entry/filtering/plugins/refFilterCreate.d.ts +3 -2
- package/operations/entry/filtering/plugins/refFilterCreate.js +21 -36
- package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -1
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.d.ts +2 -0
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js +57 -0
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js.map +1 -0
- package/operations/entry/filtering/sort.d.ts +6 -6
- package/operations/entry/filtering/sort.js +17 -34
- package/operations/entry/filtering/sort.js.map +1 -1
- package/operations/entry/filtering/systemFields.d.ts +2 -4
- package/operations/entry/filtering/systemFields.js +102 -43
- package/operations/entry/filtering/systemFields.js.map +1 -1
- package/operations/entry/filtering/transform.d.ts +1 -1
- package/operations/entry/filtering/transform.js +2 -10
- package/operations/entry/filtering/transform.js.map +1 -1
- package/operations/entry/filtering/types.d.ts +3 -3
- package/operations/entry/filtering/types.js +2 -4
- package/operations/entry/filtering/types.js.map +1 -1
- package/operations/entry/filtering/values.d.ts +1 -1
- package/operations/entry/filtering/values.js +5 -17
- package/operations/entry/filtering/values.js.map +1 -1
- package/operations/entry/filtering/where.js +5 -15
- package/operations/entry/filtering/where.js.map +1 -1
- package/operations/entry/index.d.ts +3 -4
- package/operations/entry/index.js +732 -410
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.d.ts +40 -2
- package/operations/entry/keys.js +54 -47
- package/operations/entry/keys.js.map +1 -1
- package/operations/group/index.d.ts +4 -4
- package/operations/group/index.js +44 -91
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +3 -3
- package/operations/model/index.js +36 -70
- package/operations/model/index.js.map +1 -1
- package/package.json +22 -29
- package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +4 -3
- package/plugins/CmsEntryFieldFilterPathPlugin.js +14 -29
- package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -1
- package/plugins/CmsEntryFieldFilterPlugin.d.ts +10 -10
- package/plugins/CmsEntryFieldFilterPlugin.js +9 -19
- package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -1
- package/plugins/CmsEntryFieldSortingPlugin.d.ts +2 -2
- package/plugins/CmsEntryFieldSortingPlugin.js +5 -24
- package/plugins/CmsEntryFieldSortingPlugin.js.map +1 -1
- package/plugins/CmsFieldFilterValueTransformPlugin.d.ts +11 -0
- package/plugins/CmsFieldFilterValueTransformPlugin.js +16 -0
- package/plugins/CmsFieldFilterValueTransformPlugin.js.map +1 -0
- package/plugins/index.d.ts +4 -3
- package/plugins/index.js +5 -43
- package/plugins/index.js.map +1 -1
- package/types.d.ts +24 -19
- package/types.js +5 -13
- package/types.js.map +1 -1
- package/definitions/settings.d.ts +0 -9
- package/definitions/settings.js +0 -58
- package/definitions/settings.js.map +0 -1
- package/definitions/system.d.ts +0 -9
- package/definitions/system.js +0 -46
- package/definitions/system.js.map +0 -1
- package/dynamoDb/storage/date.d.ts +0 -3
- package/dynamoDb/storage/date.js +0 -109
- package/dynamoDb/storage/date.js.map +0 -1
- package/operations/entry/systemFields.d.ts +0 -2
- package/operations/entry/systemFields.js +0 -74
- package/operations/entry/systemFields.js.map +0 -1
- package/operations/settings/index.d.ts +0 -7
- package/operations/settings/index.js +0 -135
- package/operations/settings/index.js.map +0 -1
- package/operations/system/index.d.ts +0 -7
- package/operations/system/index.js +0 -99
- package/operations/system/index.js.map +0 -1
|
@@ -1,185 +1,138 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.createGroupsStorageOperations = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
13
|
-
|
|
14
|
-
var _get = require("@webiny/db-dynamodb/utils/get");
|
|
15
|
-
|
|
16
|
-
var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
|
|
17
|
-
|
|
18
|
-
var _query = require("@webiny/db-dynamodb/utils/query");
|
|
19
|
-
|
|
20
|
-
var _filter = require("@webiny/db-dynamodb/utils/filter");
|
|
21
|
-
|
|
22
|
-
var _ValueFilterPlugin = require("@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin");
|
|
23
|
-
|
|
24
|
-
var _sort = require("@webiny/db-dynamodb/utils/sort");
|
|
25
|
-
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { filterItems, sortItems, ValueFilterPlugin } from "@webiny/db-dynamodb";
|
|
26
3
|
const createPartitionKey = params => {
|
|
27
4
|
const {
|
|
28
|
-
tenant
|
|
29
|
-
locale
|
|
5
|
+
tenant
|
|
30
6
|
} = params;
|
|
31
|
-
return `T#${tenant}#
|
|
7
|
+
return `T#${tenant}#CMS#CMG`;
|
|
32
8
|
};
|
|
33
|
-
|
|
34
9
|
const createSortKeys = params => {
|
|
35
10
|
const {
|
|
36
11
|
id
|
|
37
12
|
} = params;
|
|
38
13
|
return id;
|
|
39
14
|
};
|
|
40
|
-
|
|
41
15
|
const createKeys = params => {
|
|
42
16
|
return {
|
|
43
17
|
PK: createPartitionKey(params),
|
|
44
|
-
SK: createSortKeys(params)
|
|
18
|
+
SK: createSortKeys(params),
|
|
19
|
+
GSI_TENANT: params.tenant
|
|
45
20
|
};
|
|
46
21
|
};
|
|
47
|
-
|
|
48
22
|
const createType = () => {
|
|
49
23
|
return "cms.group";
|
|
50
24
|
};
|
|
51
|
-
|
|
52
|
-
const createGroupsStorageOperations = params => {
|
|
25
|
+
export const createGroupsStorageOperations = params => {
|
|
53
26
|
const {
|
|
54
27
|
entity,
|
|
55
28
|
plugins
|
|
56
29
|
} = params;
|
|
57
|
-
const filteringPlugins = plugins.byType(
|
|
58
|
-
|
|
30
|
+
const filteringPlugins = plugins.byType(ValueFilterPlugin.type);
|
|
59
31
|
if (filteringPlugins.length === 0) {
|
|
60
|
-
throw new
|
|
32
|
+
throw new WebinyError("DynamoDB filtering plugins not loaded.", "MISSING_DYNAMODB_FILTERING_PLUGINS");
|
|
61
33
|
}
|
|
62
|
-
|
|
63
34
|
const create = async params => {
|
|
64
35
|
const {
|
|
65
36
|
group
|
|
66
37
|
} = params;
|
|
67
38
|
const keys = createKeys(group);
|
|
68
|
-
|
|
69
39
|
try {
|
|
70
|
-
await entity.put(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
40
|
+
await entity.put({
|
|
41
|
+
data: group,
|
|
42
|
+
TYPE: createType(),
|
|
43
|
+
...keys
|
|
44
|
+
});
|
|
74
45
|
} catch (ex) {
|
|
75
|
-
throw new
|
|
46
|
+
throw new WebinyError(ex.message || "Could not create group.", ex.code || "CREATE_GROUP_ERROR", {
|
|
76
47
|
error: ex,
|
|
77
48
|
group,
|
|
78
49
|
keys
|
|
79
50
|
});
|
|
80
51
|
}
|
|
81
52
|
};
|
|
82
|
-
|
|
83
53
|
const update = async params => {
|
|
84
54
|
const {
|
|
85
55
|
group
|
|
86
56
|
} = params;
|
|
87
57
|
const keys = createKeys(group);
|
|
88
|
-
|
|
89
58
|
try {
|
|
90
|
-
await entity.put(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
59
|
+
await entity.put({
|
|
60
|
+
data: group,
|
|
61
|
+
TYPE: createType(),
|
|
62
|
+
...keys
|
|
63
|
+
});
|
|
94
64
|
} catch (ex) {
|
|
95
|
-
throw new
|
|
65
|
+
throw new WebinyError(ex.message || "Could not update group.", ex.code || "UPDATE_GROUP_ERROR", {
|
|
96
66
|
error: ex,
|
|
97
67
|
group,
|
|
98
68
|
keys
|
|
99
69
|
});
|
|
100
70
|
}
|
|
101
71
|
};
|
|
102
|
-
|
|
103
72
|
const deleteGroup = async params => {
|
|
104
73
|
const {
|
|
105
74
|
group
|
|
106
|
-
} = params;
|
|
107
|
-
|
|
75
|
+
} = params;
|
|
108
76
|
const keys = createKeys(group);
|
|
109
|
-
|
|
110
77
|
try {
|
|
111
78
|
await entity.delete(keys);
|
|
112
|
-
return group;
|
|
113
79
|
} catch (ex) {
|
|
114
|
-
throw new
|
|
80
|
+
throw new WebinyError(ex.message || "Could not delete group.", ex.code || "DELETE_GROUP_ERROR", {
|
|
115
81
|
error: ex,
|
|
116
82
|
group,
|
|
117
83
|
keys
|
|
118
84
|
});
|
|
119
85
|
}
|
|
120
86
|
};
|
|
121
|
-
|
|
122
87
|
const get = async params => {
|
|
123
88
|
const keys = createKeys(params);
|
|
124
|
-
|
|
125
89
|
try {
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
keys
|
|
129
|
-
});
|
|
130
|
-
return (0, _cleanup.cleanupItem)(entity, group);
|
|
90
|
+
const result = await entity.get(keys);
|
|
91
|
+
return result?.data || null;
|
|
131
92
|
} catch (ex) {
|
|
132
|
-
throw new
|
|
133
|
-
error: ex
|
|
134
|
-
|
|
93
|
+
throw new WebinyError(ex.message || "Could not get group.", ex.code || "GET_GROUP_ERROR", {
|
|
94
|
+
error: ex,
|
|
95
|
+
...params,
|
|
135
96
|
keys
|
|
136
|
-
})
|
|
97
|
+
});
|
|
137
98
|
}
|
|
138
99
|
};
|
|
139
|
-
|
|
140
100
|
const list = async params => {
|
|
141
101
|
const {
|
|
142
102
|
sort,
|
|
143
103
|
where
|
|
144
104
|
} = params;
|
|
145
|
-
const queryAllParams = {
|
|
146
|
-
entity,
|
|
147
|
-
partitionKey: createPartitionKey(where),
|
|
148
|
-
options: {
|
|
149
|
-
gte: " "
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
105
|
let records = [];
|
|
153
|
-
|
|
154
106
|
try {
|
|
155
|
-
|
|
107
|
+
const ddbRecords = await entity.queryAll({
|
|
108
|
+
partitionKey: createPartitionKey(where),
|
|
109
|
+
options: {
|
|
110
|
+
gte: " "
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
records = ddbRecords.map(item => item.data);
|
|
156
114
|
} catch (ex) {
|
|
157
|
-
throw new
|
|
158
|
-
error: ex
|
|
159
|
-
|
|
115
|
+
throw new WebinyError(ex.message || "Could not list groups.", ex.code || "LIST_GROUP_ERROR", {
|
|
116
|
+
error: ex,
|
|
117
|
+
...params,
|
|
160
118
|
sort,
|
|
161
119
|
where
|
|
162
|
-
})
|
|
120
|
+
});
|
|
163
121
|
}
|
|
164
|
-
|
|
165
|
-
const filteredItems = (0, _filter.filterItems)({
|
|
122
|
+
const filteredItems = filterItems({
|
|
166
123
|
items: records,
|
|
167
124
|
where,
|
|
168
125
|
fields: [],
|
|
169
126
|
plugins
|
|
170
127
|
});
|
|
171
|
-
|
|
172
128
|
if (!sort || sort.length === 0) {
|
|
173
129
|
return filteredItems;
|
|
174
130
|
}
|
|
175
|
-
|
|
176
|
-
return (0, _sort.sortItems)({
|
|
131
|
+
return sortItems({
|
|
177
132
|
items: filteredItems,
|
|
178
|
-
sort
|
|
179
|
-
fields: []
|
|
133
|
+
sort
|
|
180
134
|
});
|
|
181
135
|
};
|
|
182
|
-
|
|
183
136
|
return {
|
|
184
137
|
create,
|
|
185
138
|
update,
|
|
@@ -189,4 +142,4 @@ const createGroupsStorageOperations = params => {
|
|
|
189
142
|
};
|
|
190
143
|
};
|
|
191
144
|
|
|
192
|
-
|
|
145
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createPartitionKey","params","tenant","
|
|
1
|
+
{"version":3,"names":["WebinyError","filterItems","sortItems","ValueFilterPlugin","createPartitionKey","params","tenant","createSortKeys","id","createKeys","PK","SK","GSI_TENANT","createType","createGroupsStorageOperations","entity","plugins","filteringPlugins","byType","type","length","create","group","keys","put","data","TYPE","ex","message","code","error","update","deleteGroup","delete","get","result","list","sort","where","records","ddbRecords","queryAll","partitionKey","options","gte","map","item","filteredItems","items","fields"],"sources":["index.ts"],"sourcesContent":["import type {\n CmsGroup,\n CmsGroupStorageOperations,\n CmsGroupStorageOperationsCreateParams,\n CmsGroupStorageOperationsDeleteParams,\n CmsGroupStorageOperationsGetParams,\n CmsGroupStorageOperationsListParams,\n CmsGroupStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport { filterItems, sortItems, ValueFilterPlugin } from \"@webiny/db-dynamodb\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { IGroupEntity } from \"~/definitions/types.js\";\n\ninterface PartitionKeyParams {\n tenant: string;\n}\nconst createPartitionKey = (params: PartitionKeyParams): string => {\n const { tenant } = params;\n return `T#${tenant}#CMS#CMG`;\n};\n\ninterface SortKeyParams {\n id: string;\n}\nconst createSortKeys = (params: SortKeyParams): string => {\n const { id } = params;\n return id;\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n GSI_TENANT: string;\n}\nconst createKeys = (params: PartitionKeyParams & SortKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKeys(params),\n GSI_TENANT: params.tenant\n };\n};\n\nconst createType = (): string => {\n return \"cms.group\";\n};\n\ninterface CreateGroupsStorageOperationsParams {\n entity: IGroupEntity;\n plugins: PluginsContainer;\n}\nexport const createGroupsStorageOperations = (\n params: CreateGroupsStorageOperationsParams\n): CmsGroupStorageOperations => {\n const { entity, plugins } = params;\n\n const filteringPlugins = plugins.byType<ValueFilterPlugin>(ValueFilterPlugin.type);\n if (filteringPlugins.length === 0) {\n throw new WebinyError(\n \"DynamoDB filtering plugins not loaded.\",\n \"MISSING_DYNAMODB_FILTERING_PLUGINS\"\n );\n }\n\n const create = async (params: CmsGroupStorageOperationsCreateParams) => {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await entity.put({\n data: group,\n TYPE: createType(),\n ...keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create group.\",\n ex.code || \"CREATE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const update = async (params: CmsGroupStorageOperationsUpdateParams) => {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await entity.put({\n data: group,\n TYPE: createType(),\n ...keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update group.\",\n ex.code || \"UPDATE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const deleteGroup = async (params: CmsGroupStorageOperationsDeleteParams) => {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await entity.delete(keys);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete group.\",\n ex.code || \"DELETE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const get = async (params: CmsGroupStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n const result = await entity.get(keys);\n\n return result?.data || null;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get group.\",\n ex.code || \"GET_GROUP_ERROR\",\n {\n error: ex,\n ...params,\n keys\n }\n );\n }\n };\n const list = async (params: CmsGroupStorageOperationsListParams) => {\n const { sort, where } = params;\n\n let records: CmsGroup[] = [];\n try {\n const ddbRecords = await entity.queryAll({\n partitionKey: createPartitionKey(where),\n options: {\n gte: \" \"\n }\n });\n records = ddbRecords.map(item => item.data);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list groups.\",\n ex.code || \"LIST_GROUP_ERROR\",\n {\n error: ex,\n ...params,\n sort,\n where\n }\n );\n }\n\n const filteredItems = filterItems({\n items: records,\n where,\n fields: [],\n plugins\n });\n if (!sort || sort.length === 0) {\n return filteredItems;\n }\n\n return sortItems({\n items: filteredItems,\n sort\n });\n };\n\n return {\n create,\n update,\n delete: deleteGroup,\n get,\n list\n };\n};\n"],"mappings":"AASA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,WAAW,EAAEC,SAAS,EAAEC,iBAAiB,QAAQ,qBAAqB;AAO/E,MAAMC,kBAAkB,GAAIC,MAA0B,IAAa;EAC/D,MAAM;IAAEC;EAAO,CAAC,GAAGD,MAAM;EACzB,OAAO,KAAKC,MAAM,UAAU;AAChC,CAAC;AAKD,MAAMC,cAAc,GAAIF,MAAqB,IAAa;EACtD,MAAM;IAAEG;EAAG,CAAC,GAAGH,MAAM;EACrB,OAAOG,EAAE;AACb,CAAC;AAOD,MAAMC,UAAU,GAAIJ,MAA0C,IAAW;EACrE,OAAO;IACHK,EAAE,EAAEN,kBAAkB,CAACC,MAAM,CAAC;IAC9BM,EAAE,EAAEJ,cAAc,CAACF,MAAM,CAAC;IAC1BO,UAAU,EAAEP,MAAM,CAACC;EACvB,CAAC;AACL,CAAC;AAED,MAAMO,UAAU,GAAGA,CAAA,KAAc;EAC7B,OAAO,WAAW;AACtB,CAAC;AAMD,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EAAEtC,kBAAkB,CAACkC,KAAK,CAAC;QACvCK,OAAO,EAAE;UACLC,GAAG,EAAE;QACT;MACJ,CAAC,CAAC;MACFL,OAAO,GAAGC,UAAU,CAACK,GAAG,CAACC,IAAI,IAAIA,IAAI,CAACrB,IAAI,CAAC;IAC/C,CAAC,CAAC,OAAOE,EAAE,EAAE;MACT,MAAM,IAAI3B,WAAW,CACjB2B,EAAE,CAACC,OAAO,IAAI,wBAAwB,EACtCD,EAAE,CAACE,IAAI,IAAI,kBAAkB,EAC7B;QACIC,KAAK,EAAEH,EAAE;QACT,GAAGtB,MAAM;QACTgC,IAAI;QACJC;MACJ,CACJ,CAAC;IACL;IAEA,MAAMS,aAAa,GAAG9C,WAAW,CAAC;MAC9B+C,KAAK,EAAET,OAAO;MACdD,KAAK;MACLW,MAAM,EAAE,EAAE;MACVjC;IACJ,CAAC,CAAC;IACF,IAAI,CAACqB,IAAI,IAAIA,IAAI,CAACjB,MAAM,KAAK,CAAC,EAAE;MAC5B,OAAO2B,aAAa;IACxB;IAEA,OAAO7C,SAAS,CAAC;MACb8C,KAAK,EAAED,aAAa;MACpBV;IACJ,CAAC,CAAC;EACN,CAAC;EAED,OAAO;IACHhB,MAAM;IACNU,MAAM;IACNE,MAAM,EAAED,WAAW;IACnBE,GAAG;IACHE;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CmsModelStorageOperations } from "@webiny/api-headless-cms/types";
|
|
2
|
-
import {
|
|
1
|
+
import type { CmsModelStorageOperations } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import type { IModelEntity } from "../../definitions/types.js";
|
|
3
3
|
interface CreateModelsStorageOperationsParams {
|
|
4
|
-
entity:
|
|
4
|
+
entity: IModelEntity;
|
|
5
5
|
}
|
|
6
6
|
export declare const createModelsStorageOperations: (params: CreateModelsStorageOperationsParams) => CmsModelStorageOperations;
|
|
7
7
|
export {};
|
|
@@ -1,155 +1,121 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.createModelsStorageOperations = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
13
|
-
|
|
14
|
-
var _get = require("@webiny/db-dynamodb/utils/get");
|
|
15
|
-
|
|
16
|
-
var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
|
|
17
|
-
|
|
18
|
-
var _query = require("@webiny/db-dynamodb/utils/query");
|
|
19
|
-
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { convertException } from "@webiny/utils";
|
|
20
3
|
const createPartitionKey = params => {
|
|
21
4
|
const {
|
|
22
|
-
tenant
|
|
23
|
-
locale
|
|
5
|
+
tenant
|
|
24
6
|
} = params;
|
|
25
|
-
|
|
26
7
|
if (!tenant) {
|
|
27
|
-
throw new
|
|
28
|
-
} else if (!locale) {
|
|
29
|
-
throw new _error.default(`Missing locale variable when creating model partitionKey.`);
|
|
8
|
+
throw new WebinyError(`Missing tenant variable when creating model partitionKey.`);
|
|
30
9
|
}
|
|
31
|
-
|
|
32
|
-
return `T#${tenant}#L#${locale}#CMS#CM`;
|
|
10
|
+
return `T#${tenant}#CMS#CM`;
|
|
33
11
|
};
|
|
34
|
-
|
|
35
12
|
const createSortKey = params => {
|
|
36
13
|
return params.modelId;
|
|
37
14
|
};
|
|
38
|
-
|
|
39
15
|
const createKeys = params => {
|
|
40
16
|
return {
|
|
41
17
|
PK: createPartitionKey(params),
|
|
42
|
-
SK: createSortKey(params)
|
|
18
|
+
SK: createSortKey(params),
|
|
19
|
+
GSI_TENANT: params.tenant
|
|
43
20
|
};
|
|
44
21
|
};
|
|
45
|
-
|
|
46
22
|
const createType = () => {
|
|
47
23
|
return "cms.model";
|
|
48
24
|
};
|
|
49
|
-
|
|
50
|
-
const createModelsStorageOperations = params => {
|
|
25
|
+
export const createModelsStorageOperations = params => {
|
|
51
26
|
const {
|
|
52
27
|
entity
|
|
53
28
|
} = params;
|
|
54
|
-
|
|
55
29
|
const create = async params => {
|
|
56
30
|
const {
|
|
57
31
|
model
|
|
58
32
|
} = params;
|
|
59
33
|
const keys = createKeys(model);
|
|
60
|
-
|
|
61
34
|
try {
|
|
62
|
-
await entity.put(
|
|
35
|
+
await entity.put({
|
|
36
|
+
data: model,
|
|
37
|
+
...keys,
|
|
63
38
|
TYPE: createType()
|
|
64
|
-
})
|
|
39
|
+
});
|
|
65
40
|
return model;
|
|
66
41
|
} catch (ex) {
|
|
67
|
-
throw new
|
|
68
|
-
error: ex,
|
|
42
|
+
throw new WebinyError(`Could not create CMS Content Model.`, "CREATE_MODEL_ERROR", {
|
|
43
|
+
error: convertException(ex),
|
|
69
44
|
model,
|
|
70
45
|
keys
|
|
71
46
|
});
|
|
72
47
|
}
|
|
73
48
|
};
|
|
74
|
-
|
|
75
49
|
const update = async params => {
|
|
76
50
|
const {
|
|
77
51
|
model
|
|
78
52
|
} = params;
|
|
79
53
|
const keys = createKeys(model);
|
|
80
|
-
|
|
81
54
|
try {
|
|
82
|
-
await entity.put(
|
|
55
|
+
await entity.put({
|
|
56
|
+
data: model,
|
|
57
|
+
...keys,
|
|
83
58
|
TYPE: createType()
|
|
84
|
-
})
|
|
59
|
+
});
|
|
85
60
|
return model;
|
|
86
61
|
} catch (ex) {
|
|
87
|
-
throw new
|
|
62
|
+
throw new WebinyError(ex.message || "Could not update model.", ex.code || "MODEL_UPDATE_ERROR", {
|
|
88
63
|
error: ex,
|
|
89
64
|
model,
|
|
90
65
|
keys
|
|
91
66
|
});
|
|
92
67
|
}
|
|
93
68
|
};
|
|
94
|
-
|
|
95
69
|
const deleteModel = async params => {
|
|
96
70
|
const {
|
|
97
71
|
model
|
|
98
72
|
} = params;
|
|
99
73
|
const keys = createKeys(model);
|
|
100
|
-
|
|
101
74
|
try {
|
|
102
75
|
await entity.delete(keys);
|
|
103
76
|
return model;
|
|
104
77
|
} catch (ex) {
|
|
105
|
-
throw new
|
|
78
|
+
throw new WebinyError(ex.message || "Could not delete model.", ex.code || "MODEL_DELETE_ERROR", {
|
|
106
79
|
error: ex,
|
|
107
80
|
model,
|
|
108
81
|
keys
|
|
109
82
|
});
|
|
110
83
|
}
|
|
111
84
|
};
|
|
112
|
-
|
|
113
85
|
const get = async params => {
|
|
114
86
|
const keys = createKeys(params);
|
|
115
|
-
|
|
116
87
|
try {
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
keys
|
|
120
|
-
});
|
|
121
|
-
return (0, _cleanup.cleanupItem)(entity, item);
|
|
88
|
+
const result = await entity.get(keys);
|
|
89
|
+
return result?.data || null;
|
|
122
90
|
} catch (ex) {
|
|
123
|
-
throw new
|
|
91
|
+
throw new WebinyError(ex.message || "Could not get model.", ex.code || "MODEL_GET_ERROR", {
|
|
124
92
|
error: ex,
|
|
125
93
|
keys
|
|
126
94
|
});
|
|
127
95
|
}
|
|
128
96
|
};
|
|
129
|
-
|
|
130
97
|
const list = async params => {
|
|
131
98
|
const {
|
|
132
99
|
where
|
|
133
100
|
} = params;
|
|
134
|
-
const
|
|
135
|
-
entity,
|
|
136
|
-
partitionKey: createPartitionKey(where),
|
|
137
|
-
options: {
|
|
138
|
-
gte: " "
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
|
|
101
|
+
const partitionKey = createPartitionKey(where);
|
|
142
102
|
try {
|
|
143
|
-
const
|
|
144
|
-
|
|
103
|
+
const result = await entity.queryAll({
|
|
104
|
+
partitionKey,
|
|
105
|
+
options: {
|
|
106
|
+
gte: " "
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
return result.map(item => {
|
|
110
|
+
return item.data;
|
|
111
|
+
});
|
|
145
112
|
} catch (ex) {
|
|
146
|
-
throw new
|
|
113
|
+
throw new WebinyError(ex.message || "Could not list models.", ex.code || "MODEL_LIST_ERROR", {
|
|
147
114
|
error: ex,
|
|
148
|
-
partitionKey
|
|
115
|
+
partitionKey
|
|
149
116
|
});
|
|
150
117
|
}
|
|
151
118
|
};
|
|
152
|
-
|
|
153
119
|
return {
|
|
154
120
|
create,
|
|
155
121
|
update,
|
|
@@ -159,4 +125,4 @@ const createModelsStorageOperations = params => {
|
|
|
159
125
|
};
|
|
160
126
|
};
|
|
161
127
|
|
|
162
|
-
|
|
128
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["WebinyError","convertException","createPartitionKey","params","tenant","createSortKey","modelId","createKeys","PK","SK","GSI_TENANT","createType","createModelsStorageOperations","entity","create","model","keys","put","data","TYPE","ex","error","update","message","code","deleteModel","delete","get","result","list","where","partitionKey","queryAll","options","gte","map","item"],"sources":["index.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type {\n CmsModelStorageOperations,\n CmsModelStorageOperationsCreateParams,\n CmsModelStorageOperationsDeleteParams,\n CmsModelStorageOperationsGetParams,\n CmsModelStorageOperationsListParams,\n CmsModelStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { convertException } from \"@webiny/utils\";\nimport type { IModelEntity } from \"~/definitions/types.js\";\n\ninterface PartitionKeysParams {\n tenant: string;\n}\nconst createPartitionKey = (params: PartitionKeysParams): string => {\n const { tenant } = params;\n if (!tenant) {\n throw new WebinyError(`Missing tenant variable when creating model partitionKey.`);\n }\n return `T#${tenant}#CMS#CM`;\n};\n\ninterface SortKeyParams {\n modelId: string;\n}\nconst createSortKey = (params: SortKeyParams): string => {\n return params.modelId;\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n GSI_TENANT: string;\n}\nconst createKeys = (params: PartitionKeysParams & SortKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKey(params),\n GSI_TENANT: params.tenant\n };\n};\n\nconst createType = (): string => {\n return \"cms.model\";\n};\n\ninterface CreateModelsStorageOperationsParams {\n entity: IModelEntity;\n}\nexport const createModelsStorageOperations = (\n params: CreateModelsStorageOperationsParams\n): CmsModelStorageOperations => {\n const { entity } = params;\n\n const create = async (params: CmsModelStorageOperationsCreateParams) => {\n const { model } = params;\n\n const keys = createKeys(model);\n\n try {\n await entity.put({\n data: model,\n ...keys,\n TYPE: createType()\n });\n return model;\n } catch (ex) {\n throw new WebinyError(`Could not create CMS Content Model.`, \"CREATE_MODEL_ERROR\", {\n error: convertException(ex),\n model,\n keys\n });\n }\n };\n\n const update = async (params: CmsModelStorageOperationsUpdateParams) => {\n const { model } = params;\n\n const keys = createKeys(model);\n\n try {\n await entity.put({\n data: model,\n ...keys,\n TYPE: createType()\n });\n return model;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update model.\",\n ex.code || \"MODEL_UPDATE_ERROR\",\n {\n error: ex,\n model,\n keys\n }\n );\n }\n };\n\n const deleteModel = async (params: CmsModelStorageOperationsDeleteParams) => {\n const { model } = params;\n const keys = createKeys(model);\n\n try {\n await entity.delete(keys);\n return model;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete model.\",\n ex.code || \"MODEL_DELETE_ERROR\",\n {\n error: ex,\n model,\n keys\n }\n );\n }\n };\n\n const get = async (params: CmsModelStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n const result = await entity.get(keys);\n return result?.data || null;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get model.\",\n ex.code || \"MODEL_GET_ERROR\",\n {\n error: ex,\n keys\n }\n );\n }\n };\n\n const list = async (params: CmsModelStorageOperationsListParams) => {\n const { where } = params;\n\n const partitionKey = createPartitionKey(where);\n\n try {\n const result = await entity.queryAll({\n partitionKey,\n options: {\n gte: \" \"\n }\n });\n return result.map(item => {\n return item.data;\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list models.\",\n ex.code || \"MODEL_LIST_ERROR\",\n {\n error: ex,\n partitionKey\n }\n );\n }\n };\n\n return {\n create,\n update,\n delete: deleteModel,\n get,\n list\n };\n};\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AASvC,SAASC,gBAAgB,QAAQ,eAAe;AAMhD,MAAMC,kBAAkB,GAAIC,MAA2B,IAAa;EAChE,MAAM;IAAEC;EAAO,CAAC,GAAGD,MAAM;EACzB,IAAI,CAACC,MAAM,EAAE;IACT,MAAM,IAAIJ,WAAW,CAAC,2DAA2D,CAAC;EACtF;EACA,OAAO,KAAKI,MAAM,SAAS;AAC/B,CAAC;AAKD,MAAMC,aAAa,GAAIF,MAAqB,IAAa;EACrD,OAAOA,MAAM,CAACG,OAAO;AACzB,CAAC;AAOD,MAAMC,UAAU,GAAIJ,MAA2C,IAAW;EACtE,OAAO;IACHK,EAAE,EAAEN,kBAAkB,CAACC,MAAM,CAAC;IAC9BM,EAAE,EAAEJ,aAAa,CAACF,MAAM,CAAC;IACzBO,UAAU,EAAEP,MAAM,CAACC;EACvB,CAAC;AACL,CAAC;AAED,MAAMO,UAAU,GAAGA,CAAA,KAAc;EAC7B,OAAO,WAAW;AACtB,CAAC;AAKD,OAAO,MAAMC,6BAA6B,GACtCT,MAA2C,IACf;EAC5B,MAAM;IAAEU;EAAO,CAAC,GAAGV,MAAM;EAEzB,MAAMW,MAAM,GAAG,MAAOX,MAA6C,IAAK;IACpE,MAAM;MAAEY;IAAM,CAAC,GAAGZ,MAAM;IAExB,MAAMa,IAAI,GAAGT,UAAU,CAACQ,KAAK,CAAC;IAE9B,IAAI;MACA,MAAMF,MAAM,CAACI,GAAG,CAAC;QACbC,IAAI,EAAEH,KAAK;QACX,GAAGC,IAAI;QACPG,IAAI,EAAER,UAAU,CAAC;MACrB,CAAC,CAAC;MACF,OAAOI,KAAK;IAChB,CAAC,CAAC,OAAOK,EAAE,EAAE;MACT,M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M,CAAC;IAE/B,IAAI;MACA,MAAMyB,MAAM,GAAG,MAAMf,MAAM,CAACc,GAAG,CAACX,IAAI,CAAC;MACrC,OAAOY,MAAM,EAAEV,IAAI,IAAI,IAAI;IAC/B,CAAC,CAAC,OAAOE,EAAE,EAAE;MACT,MAAM,IAAIpB,WAAW,CACjBoB,EAAE,CAACG,OAAO,IAAI,sBAAsB,EACpCH,EAAE,CAACI,IAAI,IAAI,iBAAiB,EAC5B;QACIH,KAAK,EAAED,EAAE;QACTJ;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,MAAMa,IAAI,GAAG,MAAO1B,MAA2C,IAAK;IAChE,MAAM;MAAE2B;IAAM,CAAC,GAAG3B,MAAM;IAExB,MAAM4B,YAAY,GAAG7B,kBAAkB,CAAC4B,KAAK,CAAC;IAE9C,IAAI;MACA,MAAMF,MAAM,GAAG,MAAMf,MAAM,CAACmB,QAAQ,CAAC;QACjCD,YAAY;QACZE,OAAO,EAAE;UACLC,GAAG,EAAE;QACT;MACJ,CAAC,CAAC;MACF,OAAON,MAAM,CAACO,GAAG,CAACC,IAAI,IAAI;QACtB,OAAOA,IAAI,CAAClB,IAAI;MACpB,CAAC,CAAC;IACN,CAAC,CAAC,OAAOE,EAAE,EAAE;MACT,MAAM,IAAIpB,WAAW,CACjBoB,EAAE,CAACG,OAAO,IAAI,wBAAwB,EACtCH,EAAE,CAACI,IAAI,IAAI,kBAAkB,EAC7B;QACIH,KAAK,EAAED,EAAE;QACTW;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,OAAO;IACHjB,MAAM;IACNQ,MAAM;IACNI,MAAM,EAAED,WAAW;IACnBE,GAAG;IACHE;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-ddb",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.c27f4d8a31",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"main": "index.js",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"@webiny/api-headless-cms",
|
|
7
8
|
"storage-operations",
|
|
8
9
|
"dynamodb",
|
|
10
|
+
"ddb",
|
|
9
11
|
"cms:ddb"
|
|
10
12
|
],
|
|
11
13
|
"repository": {
|
|
@@ -21,40 +23,31 @@
|
|
|
21
23
|
],
|
|
22
24
|
"license": "MIT",
|
|
23
25
|
"dependencies": {
|
|
24
|
-
"@
|
|
25
|
-
"@webiny/api-headless-cms": "0.0.0-unstable.
|
|
26
|
-
"@webiny/
|
|
27
|
-
"@webiny/
|
|
28
|
-
"@webiny/
|
|
29
|
-
"@webiny/
|
|
30
|
-
"
|
|
31
|
-
"dataloader": "2.2.
|
|
26
|
+
"@webiny/api": "0.0.0-unstable.c27f4d8a31",
|
|
27
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.c27f4d8a31",
|
|
28
|
+
"@webiny/aws-sdk": "0.0.0-unstable.c27f4d8a31",
|
|
29
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.c27f4d8a31",
|
|
30
|
+
"@webiny/error": "0.0.0-unstable.c27f4d8a31",
|
|
31
|
+
"@webiny/handler-db": "0.0.0-unstable.c27f4d8a31",
|
|
32
|
+
"@webiny/utils": "0.0.0-unstable.c27f4d8a31",
|
|
33
|
+
"dataloader": "2.2.3",
|
|
34
|
+
"dot-object": "2.1.5",
|
|
32
35
|
"dot-prop": "6.0.1",
|
|
33
|
-
"
|
|
34
|
-
"jsonpack": "1.1.5",
|
|
35
|
-
"lodash": "4.17.21"
|
|
36
|
+
"lodash": "4.17.23"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@webiny/
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"jest-dynalite": "^3.2.0",
|
|
47
|
-
"jest-environment-node": "^27.2.4",
|
|
48
|
-
"ttypescript": "^1.5.12",
|
|
49
|
-
"typescript": "4.7.4"
|
|
39
|
+
"@types/dot-object": "2.1.6",
|
|
40
|
+
"@types/jsonpack": "1.1.6",
|
|
41
|
+
"@webiny/build-tools": "0.0.0-unstable.c27f4d8a31",
|
|
42
|
+
"@webiny/plugins": "0.0.0-unstable.c27f4d8a31",
|
|
43
|
+
"@webiny/project-utils": "0.0.0-unstable.c27f4d8a31",
|
|
44
|
+
"jest-dynalite": "3.6.1",
|
|
45
|
+
"typescript": "5.9.3",
|
|
46
|
+
"vitest": "4.0.18"
|
|
50
47
|
},
|
|
51
48
|
"publishConfig": {
|
|
52
49
|
"access": "public",
|
|
53
50
|
"directory": "dist"
|
|
54
51
|
},
|
|
55
|
-
"
|
|
56
|
-
"build": "yarn webiny run build",
|
|
57
|
-
"watch": "yarn webiny run watch"
|
|
58
|
-
},
|
|
59
|
-
"gitHead": "bca7b3e35084d7012061bda0d3f08202fe611581"
|
|
52
|
+
"gitHead": "c27f4d8a31c3af1570817797441855292b6c1f20"
|
|
60
53
|
}
|