@webiny/api-aco 5.35.0 → 5.35.1-beta.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/createAcoModels.js +1 -9
- package/createAcoModels.js.map +1 -1
- package/folder/folder.gql.js +18 -4
- package/folder/folder.gql.js.map +1 -1
- package/package.json +30 -30
- package/record/record.gql.js +19 -5
- package/record/record.gql.js.map +1 -1
- package/utils/checkPermissions.d.ts +2 -0
- package/utils/checkPermissions.js +14 -0
- package/utils/checkPermissions.js.map +1 -0
- package/utils/resolve.d.ts +1 -1
- package/context/folders.d.ts +0 -2
- package/context/folders.js +0 -261
- package/context/folders.js.map +0 -1
- package/context/index.d.ts +0 -2
- package/context/index.js +0 -22
- package/context/index.js.map +0 -1
- package/context/links.d.ts +0 -2
- package/context/links.js +0 -270
- package/context/links.js.map +0 -1
- package/graphql/base.gql.d.ts +0 -3
- package/graphql/base.gql.js +0 -63
- package/graphql/base.gql.js.map +0 -1
- package/graphql/folders.gql.d.ts +0 -3
- package/graphql/folders.gql.js +0 -126
- package/graphql/folders.gql.js.map +0 -1
- package/graphql/index.d.ts +0 -1
- package/graphql/index.js +0 -15
- package/graphql/index.js.map +0 -1
- package/graphql/links.gql.d.ts +0 -3
- package/graphql/links.gql.js +0 -123
- package/graphql/links.gql.js.map +0 -1
- package/subscriptions/afterFolderDelete.d.ts +0 -3
- package/subscriptions/afterFolderDelete.js +0 -62
- package/subscriptions/afterFolderDelete.js.map +0 -1
- package/subscriptions/index.d.ts +0 -3
- package/subscriptions/index.js +0 -14
- package/subscriptions/index.js.map +0 -1
package/context/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.createContext = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _folders = require("./folders");
|
|
13
|
-
|
|
14
|
-
var _links = require("./links");
|
|
15
|
-
|
|
16
|
-
const createContext = async config => {
|
|
17
|
-
const linksContext = await (0, _links.createLinksContext)(config);
|
|
18
|
-
const folderContext = await (0, _folders.createFoldersContext)(config);
|
|
19
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, linksContext), folderContext);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
exports.createContext = createContext;
|
package/context/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","config","linksContext","createLinksContext","folderContext","createFoldersContext"],"sources":["index.ts"],"sourcesContent":["import { createFoldersContext } from \"./folders\";\nimport { createLinksContext } from \"./links\";\n\nimport { Folders, FoldersConfig } from \"~/types\";\n\nexport const createContext = async (config: FoldersConfig): Promise<Folders> => {\n const linksContext = await createLinksContext(config);\n const folderContext = await createFoldersContext(config);\n\n return {\n ...linksContext,\n ...folderContext\n };\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAIO,MAAMA,aAAa,GAAG,MAAOC,MAAP,IAAmD;EAC5E,MAAMC,YAAY,GAAG,MAAM,IAAAC,yBAAA,EAAmBF,MAAnB,CAA3B;EACA,MAAMG,aAAa,GAAG,MAAM,IAAAC,6BAAA,EAAqBJ,MAArB,CAA5B;EAEA,mEACOC,YADP,GAEOE,aAFP;AAIH,CARM"}
|
package/context/links.d.ts
DELETED
package/context/links.js
DELETED
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.createLinksContext = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _mdbid = _interopRequireDefault(require("mdbid"));
|
|
13
|
-
|
|
14
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
15
|
-
|
|
16
|
-
var _handlerGraphql = require("@webiny/handler-graphql");
|
|
17
|
-
|
|
18
|
-
var _pubsub = require("@webiny/pubsub");
|
|
19
|
-
|
|
20
|
-
var _joi = _interopRequireDefault(require("joi"));
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Package mdbid does not have types.
|
|
24
|
-
*/
|
|
25
|
-
// @ts-ignore
|
|
26
|
-
const requiredString = _joi.default.string().required();
|
|
27
|
-
|
|
28
|
-
const createSchema = _joi.default.object({
|
|
29
|
-
id: requiredString,
|
|
30
|
-
folderId: requiredString,
|
|
31
|
-
tenant: requiredString,
|
|
32
|
-
locale: requiredString
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const updateSchema = _joi.default.object({
|
|
36
|
-
folderId: requiredString
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const createLinksContext = async ({
|
|
40
|
-
getTenantId,
|
|
41
|
-
getLocaleCode,
|
|
42
|
-
getIdentity,
|
|
43
|
-
storageOperations
|
|
44
|
-
}) => {
|
|
45
|
-
// create
|
|
46
|
-
const onLinkBeforeCreate = (0, _pubsub.createTopic)("folders.onLinkBeforeCreate");
|
|
47
|
-
const onLinkAfterCreate = (0, _pubsub.createTopic)("folders.onLinkAfterCreate"); // update
|
|
48
|
-
|
|
49
|
-
const onLinkBeforeUpdate = (0, _pubsub.createTopic)("folders.onLinkBeforeUpdate");
|
|
50
|
-
const onLinkAfterUpdate = (0, _pubsub.createTopic)("folders.onLinkAfterUpdate"); // delete
|
|
51
|
-
|
|
52
|
-
const onLinkBeforeDelete = (0, _pubsub.createTopic)("folders.onLinkBeforeDelete");
|
|
53
|
-
const onLinkAfterDelete = (0, _pubsub.createTopic)("folders.onLinkAfterDelete"); // delete batch
|
|
54
|
-
|
|
55
|
-
const onLinkBeforeDeleteBatch = (0, _pubsub.createTopic)("folders.onLinkBeforeDeleteBatch");
|
|
56
|
-
const onLinkAfterDeleteBatch = (0, _pubsub.createTopic)("folders.onLinkAfterDeleteBatch");
|
|
57
|
-
return {
|
|
58
|
-
onLinkBeforeCreate,
|
|
59
|
-
onLinkAfterCreate,
|
|
60
|
-
onLinkBeforeUpdate,
|
|
61
|
-
onLinkAfterUpdate,
|
|
62
|
-
onLinkBeforeDelete,
|
|
63
|
-
onLinkAfterDelete,
|
|
64
|
-
onLinkBeforeDeleteBatch,
|
|
65
|
-
onLinkAfterDeleteBatch,
|
|
66
|
-
|
|
67
|
-
async getLink(id) {
|
|
68
|
-
const tenant = getTenantId();
|
|
69
|
-
const locale = getLocaleCode();
|
|
70
|
-
let link;
|
|
71
|
-
|
|
72
|
-
try {
|
|
73
|
-
link = await storageOperations.getLink({
|
|
74
|
-
tenant,
|
|
75
|
-
locale,
|
|
76
|
-
id
|
|
77
|
-
});
|
|
78
|
-
} catch (error) {
|
|
79
|
-
throw _error.default.from(error, {
|
|
80
|
-
message: "Could not get link.",
|
|
81
|
-
code: "GET_LINK_ERROR",
|
|
82
|
-
data: {
|
|
83
|
-
id
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (!link) {
|
|
89
|
-
throw new _handlerGraphql.NotFoundError(`Unable to find link with id: ${id}`);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
return link;
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
async listLinks({
|
|
96
|
-
where,
|
|
97
|
-
limit,
|
|
98
|
-
after
|
|
99
|
-
}) {
|
|
100
|
-
const tenant = getTenantId();
|
|
101
|
-
const locale = getLocaleCode();
|
|
102
|
-
|
|
103
|
-
try {
|
|
104
|
-
return await storageOperations.listLinks({
|
|
105
|
-
where: (0, _objectSpread2.default)({
|
|
106
|
-
tenant,
|
|
107
|
-
locale
|
|
108
|
-
}, where),
|
|
109
|
-
sort: ["createdOn_ASC"],
|
|
110
|
-
limit,
|
|
111
|
-
after
|
|
112
|
-
});
|
|
113
|
-
} catch (error) {
|
|
114
|
-
throw _error.default.from(error, {
|
|
115
|
-
message: "Could not list links.",
|
|
116
|
-
code: "LIST_LINKS_ERROR",
|
|
117
|
-
data: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, where), {}, {
|
|
118
|
-
limit,
|
|
119
|
-
after
|
|
120
|
-
})
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
async createLink(input) {
|
|
126
|
-
await createSchema.validate(input);
|
|
127
|
-
const tenant = getTenantId();
|
|
128
|
-
const locale = getLocaleCode();
|
|
129
|
-
const existing = await storageOperations.getLink({
|
|
130
|
-
tenant,
|
|
131
|
-
locale,
|
|
132
|
-
folderId: input.folderId,
|
|
133
|
-
id: input.id
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
if (existing) {
|
|
137
|
-
throw new _error.default(`Link with id "${input.id}" already exists.`, "LINK_EXISTS");
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const identity = getIdentity();
|
|
141
|
-
const link = (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
142
|
-
linkId: (0, _mdbid.default)(),
|
|
143
|
-
tenant,
|
|
144
|
-
locale
|
|
145
|
-
}, input), {}, {
|
|
146
|
-
webinyVersion: process.env.WEBINY_VERSION,
|
|
147
|
-
createdOn: new Date().toISOString(),
|
|
148
|
-
createdBy: {
|
|
149
|
-
id: identity.id,
|
|
150
|
-
displayName: identity.displayName,
|
|
151
|
-
type: identity.type
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
try {
|
|
156
|
-
await onLinkBeforeCreate.publish({
|
|
157
|
-
link
|
|
158
|
-
});
|
|
159
|
-
const result = await storageOperations.createLink({
|
|
160
|
-
link
|
|
161
|
-
});
|
|
162
|
-
await onLinkAfterCreate.publish({
|
|
163
|
-
link: result
|
|
164
|
-
});
|
|
165
|
-
return result;
|
|
166
|
-
} catch (error) {
|
|
167
|
-
throw _error.default.from(error, {
|
|
168
|
-
message: "Could not create link.",
|
|
169
|
-
code: "CREATE_LINK_ERROR",
|
|
170
|
-
data: (0, _objectSpread2.default)({}, input)
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
async updateLink(id, input) {
|
|
176
|
-
const tenant = getTenantId();
|
|
177
|
-
const locale = getLocaleCode();
|
|
178
|
-
const original = await storageOperations.getLink({
|
|
179
|
-
tenant,
|
|
180
|
-
locale,
|
|
181
|
-
id
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
if (!original) {
|
|
185
|
-
throw new _handlerGraphql.NotFoundError(`Link "${id}" was not found!`);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
await updateSchema.validate(input);
|
|
189
|
-
const link = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, original), input);
|
|
190
|
-
|
|
191
|
-
try {
|
|
192
|
-
await onLinkBeforeUpdate.publish({
|
|
193
|
-
link,
|
|
194
|
-
original
|
|
195
|
-
});
|
|
196
|
-
const result = await storageOperations.updateLink({
|
|
197
|
-
original,
|
|
198
|
-
link
|
|
199
|
-
});
|
|
200
|
-
await onLinkAfterUpdate.publish({
|
|
201
|
-
link: result,
|
|
202
|
-
original
|
|
203
|
-
});
|
|
204
|
-
return result;
|
|
205
|
-
} catch (error) {
|
|
206
|
-
throw new _error.default(error.message || "Could not update link.", error.code || "UPDATE_LINK_ERROR", {
|
|
207
|
-
link
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
async deleteLink(id) {
|
|
213
|
-
const tenant = getTenantId();
|
|
214
|
-
const locale = getLocaleCode();
|
|
215
|
-
const link = await storageOperations.getLink({
|
|
216
|
-
tenant,
|
|
217
|
-
locale,
|
|
218
|
-
id
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
if (!link) {
|
|
222
|
-
throw new _handlerGraphql.NotFoundError(`Link "${id}" was not found!`);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
try {
|
|
226
|
-
await onLinkBeforeDelete.publish({
|
|
227
|
-
link
|
|
228
|
-
});
|
|
229
|
-
const result = await storageOperations.deleteLink({
|
|
230
|
-
link
|
|
231
|
-
});
|
|
232
|
-
await onLinkAfterDelete.publish({
|
|
233
|
-
link
|
|
234
|
-
});
|
|
235
|
-
return result;
|
|
236
|
-
} catch (error) {
|
|
237
|
-
throw new _error.default(error.message || "Could not delete link.", error.code || "DELETE_LINK_ERROR", {
|
|
238
|
-
link
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
async deleteLinks(folderIds) {
|
|
244
|
-
const tenant = getTenantId();
|
|
245
|
-
const locale = getLocaleCode();
|
|
246
|
-
|
|
247
|
-
try {
|
|
248
|
-
await onLinkBeforeDeleteBatch.publish({
|
|
249
|
-
folderIds
|
|
250
|
-
});
|
|
251
|
-
const result = await storageOperations.deleteLinks({
|
|
252
|
-
tenant,
|
|
253
|
-
locale,
|
|
254
|
-
folderIds
|
|
255
|
-
});
|
|
256
|
-
await onLinkAfterDeleteBatch.publish({
|
|
257
|
-
folderIds
|
|
258
|
-
});
|
|
259
|
-
return result;
|
|
260
|
-
} catch (error) {
|
|
261
|
-
throw new _error.default(error.message || "Could not batch delete links.", error.code || "DELETE_LINKS_ERROR", {
|
|
262
|
-
folderIds
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
};
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
exports.createLinksContext = createLinksContext;
|
package/context/links.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["requiredString","joi","string","required","createSchema","object","id","folderId","tenant","locale","updateSchema","createLinksContext","getTenantId","getLocaleCode","getIdentity","storageOperations","onLinkBeforeCreate","createTopic","onLinkAfterCreate","onLinkBeforeUpdate","onLinkAfterUpdate","onLinkBeforeDelete","onLinkAfterDelete","onLinkBeforeDeleteBatch","onLinkAfterDeleteBatch","getLink","link","error","WebinyError","from","message","code","data","NotFoundError","listLinks","where","limit","after","sort","createLink","input","validate","existing","identity","linkId","mdbid","webinyVersion","process","env","WEBINY_VERSION","createdOn","Date","toISOString","createdBy","displayName","type","publish","result","updateLink","original","deleteLink","deleteLinks","folderIds"],"sources":["links.ts"],"sourcesContent":["/**\n * Package mdbid does not have types.\n */\n// @ts-ignore\nimport mdbid from \"mdbid\";\nimport WebinyError from \"@webiny/error\";\nimport { NotFoundError } from \"@webiny/handler-graphql\";\nimport { createTopic } from \"@webiny/pubsub\";\nimport joi from \"joi\";\n\nimport {\n FoldersConfig,\n ILinks,\n Link,\n LinkInput,\n ListLinksParams,\n ListLinksResponse,\n OnLinkAfterCreateTopicParams,\n OnLinkAfterDeleteBatchTopicParams,\n OnLinkAfterDeleteTopicParams,\n OnLinkAfterUpdateTopicParams,\n OnLinkBeforeCreateTopicParams,\n OnLinkBeforeDeleteBatchTopicParams,\n OnLinkBeforeDeleteTopicParams,\n OnLinkBeforeUpdateTopicParams\n} from \"~/types\";\n\nconst requiredString = joi.string().required();\n\nconst createSchema = joi.object({\n id: requiredString,\n folderId: requiredString,\n tenant: requiredString,\n locale: requiredString\n});\n\nconst updateSchema = joi.object({\n folderId: requiredString\n});\n\nexport const createLinksContext = async ({\n getTenantId,\n getLocaleCode,\n getIdentity,\n storageOperations\n}: FoldersConfig): Promise<ILinks> => {\n // create\n const onLinkBeforeCreate = createTopic<OnLinkBeforeCreateTopicParams>(\n \"folders.onLinkBeforeCreate\"\n );\n const onLinkAfterCreate = createTopic<OnLinkAfterCreateTopicParams>(\n \"folders.onLinkAfterCreate\"\n );\n // update\n const onLinkBeforeUpdate = createTopic<OnLinkBeforeUpdateTopicParams>(\n \"folders.onLinkBeforeUpdate\"\n );\n const onLinkAfterUpdate = createTopic<OnLinkAfterUpdateTopicParams>(\n \"folders.onLinkAfterUpdate\"\n );\n // delete\n const onLinkBeforeDelete = createTopic<OnLinkBeforeDeleteTopicParams>(\n \"folders.onLinkBeforeDelete\"\n );\n const onLinkAfterDelete = createTopic<OnLinkAfterDeleteTopicParams>(\n \"folders.onLinkAfterDelete\"\n );\n // delete batch\n const onLinkBeforeDeleteBatch = createTopic<OnLinkBeforeDeleteBatchTopicParams>(\n \"folders.onLinkBeforeDeleteBatch\"\n );\n const onLinkAfterDeleteBatch = createTopic<OnLinkAfterDeleteBatchTopicParams>(\n \"folders.onLinkAfterDeleteBatch\"\n );\n\n return {\n onLinkBeforeCreate,\n onLinkAfterCreate,\n onLinkBeforeUpdate,\n onLinkAfterUpdate,\n onLinkBeforeDelete,\n onLinkAfterDelete,\n onLinkBeforeDeleteBatch,\n onLinkAfterDeleteBatch,\n async getLink(id: string): Promise<Link> {\n const tenant = getTenantId();\n const locale = getLocaleCode();\n\n let link: Link | undefined;\n try {\n link = await storageOperations.getLink({ tenant, locale, id });\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Could not get link.\",\n code: \"GET_LINK_ERROR\",\n data: { id }\n });\n }\n if (!link) {\n throw new NotFoundError(`Unable to find link with id: ${id}`);\n }\n return link;\n },\n\n async listLinks({ where, limit, after }: ListLinksParams): Promise<ListLinksResponse> {\n const tenant = getTenantId();\n const locale = getLocaleCode();\n\n try {\n return await storageOperations.listLinks({\n where: { tenant, locale, ...where },\n sort: [\"createdOn_ASC\"],\n limit,\n after\n });\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Could not list links.\",\n code: \"LIST_LINKS_ERROR\",\n data: { ...where, limit, after }\n });\n }\n },\n\n async createLink(input: LinkInput): Promise<Link> {\n await createSchema.validate(input);\n\n const tenant = getTenantId();\n const locale = getLocaleCode();\n\n const existing = await storageOperations.getLink({\n tenant,\n locale,\n folderId: input.folderId,\n id: input.id\n });\n\n if (existing) {\n throw new WebinyError(`Link with id \"${input.id}\" already exists.`, \"LINK_EXISTS\");\n }\n\n const identity = getIdentity();\n\n const link: Link = {\n linkId: mdbid(),\n tenant,\n locale,\n ...input,\n webinyVersion: process.env.WEBINY_VERSION as string,\n createdOn: new Date().toISOString(),\n createdBy: {\n id: identity.id,\n displayName: identity.displayName,\n type: identity.type\n }\n };\n\n try {\n await onLinkBeforeCreate.publish({\n link\n });\n const result = await storageOperations.createLink({ link });\n await onLinkAfterCreate.publish({\n link: result\n });\n return result;\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Could not create link.\",\n code: \"CREATE_LINK_ERROR\",\n data: { ...input }\n });\n }\n },\n\n async updateLink(id: string, input: Record<string, any>): Promise<Link> {\n const tenant = getTenantId();\n const locale = getLocaleCode();\n\n const original = await storageOperations.getLink({ tenant, locale, id });\n\n if (!original) {\n throw new NotFoundError(`Link \"${id}\" was not found!`);\n }\n\n await updateSchema.validate(input);\n\n const link: Link = {\n ...original,\n ...input\n };\n\n try {\n await onLinkBeforeUpdate.publish({\n link,\n original\n });\n const result = await storageOperations.updateLink({ original, link });\n await onLinkAfterUpdate.publish({\n link: result,\n original\n });\n return result;\n } catch (error) {\n throw new WebinyError(\n error.message || \"Could not update link.\",\n error.code || \"UPDATE_LINK_ERROR\",\n {\n link\n }\n );\n }\n },\n\n async deleteLink(id: string): Promise<void> {\n const tenant = getTenantId();\n const locale = getLocaleCode();\n\n const link = await storageOperations.getLink({ tenant, locale, id });\n\n if (!link) {\n throw new NotFoundError(`Link \"${id}\" was not found!`);\n }\n\n try {\n await onLinkBeforeDelete.publish({\n link\n });\n const result = await storageOperations.deleteLink({ link });\n await onLinkAfterDelete.publish({\n link\n });\n return result;\n } catch (error) {\n throw new WebinyError(\n error.message || \"Could not delete link.\",\n error.code || \"DELETE_LINK_ERROR\",\n {\n link\n }\n );\n }\n },\n\n async deleteLinks(folderIds: string[]): Promise<void> {\n const tenant = getTenantId();\n const locale = getLocaleCode();\n\n try {\n await onLinkBeforeDeleteBatch.publish({\n folderIds\n });\n const result = await storageOperations.deleteLinks({ tenant, locale, folderIds });\n await onLinkAfterDeleteBatch.publish({\n folderIds\n });\n return result;\n } catch (error) {\n throw new WebinyError(\n error.message || \"Could not batch delete links.\",\n error.code || \"DELETE_LINKS_ERROR\",\n {\n folderIds\n }\n );\n }\n }\n };\n};\n"],"mappings":";;;;;;;;;;;AAIA;;AACA;;AACA;;AACA;;AACA;;AARA;AACA;AACA;AACA;AAwBA,MAAMA,cAAc,GAAGC,YAAA,CAAIC,MAAJ,GAAaC,QAAb,EAAvB;;AAEA,MAAMC,YAAY,GAAGH,YAAA,CAAII,MAAJ,CAAW;EAC5BC,EAAE,EAAEN,cADwB;EAE5BO,QAAQ,EAAEP,cAFkB;EAG5BQ,MAAM,EAAER,cAHoB;EAI5BS,MAAM,EAAET;AAJoB,CAAX,CAArB;;AAOA,MAAMU,YAAY,GAAGT,YAAA,CAAII,MAAJ,CAAW;EAC5BE,QAAQ,EAAEP;AADkB,CAAX,CAArB;;AAIO,MAAMW,kBAAkB,GAAG,OAAO;EACrCC,WADqC;EAErCC,aAFqC;EAGrCC,WAHqC;EAIrCC;AAJqC,CAAP,KAKI;EAClC;EACA,MAAMC,kBAAkB,GAAG,IAAAC,mBAAA,EACvB,4BADuB,CAA3B;EAGA,MAAMC,iBAAiB,GAAG,IAAAD,mBAAA,EACtB,2BADsB,CAA1B,CALkC,CAQlC;;EACA,MAAME,kBAAkB,GAAG,IAAAF,mBAAA,EACvB,4BADuB,CAA3B;EAGA,MAAMG,iBAAiB,GAAG,IAAAH,mBAAA,EACtB,2BADsB,CAA1B,CAZkC,CAelC;;EACA,MAAMI,kBAAkB,GAAG,IAAAJ,mBAAA,EACvB,4BADuB,CAA3B;EAGA,MAAMK,iBAAiB,GAAG,IAAAL,mBAAA,EACtB,2BADsB,CAA1B,CAnBkC,CAsBlC;;EACA,MAAMM,uBAAuB,GAAG,IAAAN,mB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UC,MAAV;UAAkBqD;QAAlB,CAA9B,CAArB;QACA,MAAMtC,sBAAsB,CAACgC,OAAvB,CAA+B;UACjCM;QADiC,CAA/B,CAAN;QAGA,OAAOL,MAAP;MACH,CATD,CASE,OAAO9B,KAAP,EAAc;QACZ,MAAM,IAAIC,cAAJ,CACFD,KAAK,CAACG,OAAN,IAAiB,+BADf,EAEFH,KAAK,CAACI,IAAN,IAAc,oBAFZ,EAGF;UACI+B;QADJ,CAHE,CAAN;MAOH;IACJ;;EA/LE,CAAP;AAiMH,CApOM"}
|
package/graphql/base.gql.d.ts
DELETED
package/graphql/base.gql.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.baseSchema = void 0;
|
|
7
|
-
|
|
8
|
-
var _plugins = require("@webiny/handler-graphql/plugins");
|
|
9
|
-
|
|
10
|
-
const emptyResolver = () => ({});
|
|
11
|
-
|
|
12
|
-
const baseSchema = new _plugins.GraphQLSchemaPlugin({
|
|
13
|
-
typeDefs:
|
|
14
|
-
/* GraphQL */
|
|
15
|
-
`
|
|
16
|
-
type FoldersQuery {
|
|
17
|
-
_empty: String
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
type FoldersMutation {
|
|
21
|
-
_empty: String
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
extend type Query {
|
|
25
|
-
folders: FoldersQuery
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
extend type Mutation {
|
|
29
|
-
folders: FoldersMutation
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
type FolderCreatedBy {
|
|
33
|
-
id: ID
|
|
34
|
-
displayName: String
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
type FolderError {
|
|
38
|
-
code: String
|
|
39
|
-
message: String
|
|
40
|
-
data: JSON
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
type FolderBooleanResponse {
|
|
44
|
-
data: Boolean
|
|
45
|
-
error: FolderError
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
type ListMeta {
|
|
49
|
-
cursor: String
|
|
50
|
-
totalCount: Int
|
|
51
|
-
hasMoreItems: Boolean
|
|
52
|
-
}
|
|
53
|
-
`,
|
|
54
|
-
resolvers: {
|
|
55
|
-
Query: {
|
|
56
|
-
folders: emptyResolver
|
|
57
|
-
},
|
|
58
|
-
Mutation: {
|
|
59
|
-
folders: emptyResolver
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
exports.baseSchema = baseSchema;
|
package/graphql/base.gql.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["emptyResolver","baseSchema","GraphQLSchemaPlugin","typeDefs","resolvers","Query","folders","Mutation"],"sources":["base.gql.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins\";\nimport { ACOContext } from \"~/types\";\n\nconst emptyResolver = () => ({});\n\nexport const baseSchema = new GraphQLSchemaPlugin<ACOContext>({\n typeDefs: /* GraphQL */ `\n type FoldersQuery {\n _empty: String\n }\n\n type FoldersMutation {\n _empty: String\n }\n\n extend type Query {\n folders: FoldersQuery\n }\n\n extend type Mutation {\n folders: FoldersMutation\n }\n\n type FolderCreatedBy {\n id: ID\n displayName: String\n }\n\n type FolderError {\n code: String\n message: String\n data: JSON\n }\n\n type FolderBooleanResponse {\n data: Boolean\n error: FolderError\n }\n\n type ListMeta {\n cursor: String\n totalCount: Int\n hasMoreItems: Boolean\n }\n `,\n resolvers: {\n Query: {\n folders: emptyResolver\n },\n Mutation: {\n folders: emptyResolver\n }\n }\n});\n"],"mappings":";;;;;;;AAAA;;AAGA,MAAMA,aAAa,GAAG,OAAO,EAAP,CAAtB;;AAEO,MAAMC,UAAU,GAAG,IAAIC,4BAAJ,CAAoC;EAC1DC,QAAQ;EAAE;EAAe;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAvC8D;EAwC1DC,SAAS,EAAE;IACPC,KAAK,EAAE;MACHC,OAAO,EAAEN;IADN,CADA;IAIPO,QAAQ,EAAE;MACND,OAAO,EAAEN;IADH;EAJH;AAxC+C,CAApC,CAAnB"}
|
package/graphql/folders.gql.d.ts
DELETED
package/graphql/folders.gql.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.foldersSchema = void 0;
|
|
7
|
-
|
|
8
|
-
var _responses = require("@webiny/handler-graphql/responses");
|
|
9
|
-
|
|
10
|
-
var _GraphQLSchemaPlugin = require("@webiny/handler-graphql/plugins/GraphQLSchemaPlugin");
|
|
11
|
-
|
|
12
|
-
const foldersSchema = new _GraphQLSchemaPlugin.GraphQLSchemaPlugin({
|
|
13
|
-
typeDefs:
|
|
14
|
-
/* GraphQL */
|
|
15
|
-
`
|
|
16
|
-
type Folder {
|
|
17
|
-
id: ID!
|
|
18
|
-
name: String!
|
|
19
|
-
slug: String!
|
|
20
|
-
type: String!
|
|
21
|
-
parentId: ID
|
|
22
|
-
createdOn: DateTime
|
|
23
|
-
createdBy: FolderCreatedBy
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
input FolderCreateInput {
|
|
27
|
-
name: String!
|
|
28
|
-
slug: String!
|
|
29
|
-
type: String!
|
|
30
|
-
parentId: ID
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
input FolderUpdateInput {
|
|
34
|
-
name: String
|
|
35
|
-
slug: String
|
|
36
|
-
parentId: ID
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
input FoldersListWhereInput {
|
|
40
|
-
type: String!
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
type FolderResponse {
|
|
44
|
-
data: Folder
|
|
45
|
-
error: FolderError
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
type FoldersListResponse {
|
|
49
|
-
data: [Folder]
|
|
50
|
-
error: FolderError
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
extend type FoldersQuery {
|
|
54
|
-
getFolder(id: ID!): FolderResponse
|
|
55
|
-
listFolders(where: FoldersListWhereInput!): FoldersListResponse
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
extend type FoldersMutation {
|
|
59
|
-
createFolder(data: FolderCreateInput!): FolderResponse
|
|
60
|
-
updateFolder(id: ID!, data: FolderUpdateInput!): FolderResponse
|
|
61
|
-
deleteFolder(id: ID!): FolderBooleanResponse
|
|
62
|
-
}
|
|
63
|
-
`,
|
|
64
|
-
resolvers: {
|
|
65
|
-
FoldersQuery: {
|
|
66
|
-
getFolder: async (_, {
|
|
67
|
-
id
|
|
68
|
-
}, context) => {
|
|
69
|
-
try {
|
|
70
|
-
const folder = await context.folders.getFolder({
|
|
71
|
-
id
|
|
72
|
-
});
|
|
73
|
-
return new _responses.Response(folder);
|
|
74
|
-
} catch (error) {
|
|
75
|
-
return new _responses.ErrorResponse(error);
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
listFolders: async (_, {
|
|
79
|
-
where
|
|
80
|
-
}, context) => {
|
|
81
|
-
try {
|
|
82
|
-
const folders = await context.folders.listFolders({
|
|
83
|
-
where
|
|
84
|
-
});
|
|
85
|
-
return new _responses.Response(folders);
|
|
86
|
-
} catch (error) {
|
|
87
|
-
return new _responses.ErrorResponse(error);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
FoldersMutation: {
|
|
92
|
-
createFolder: async (_, {
|
|
93
|
-
data
|
|
94
|
-
}, context) => {
|
|
95
|
-
try {
|
|
96
|
-
const folder = await context.folders.createFolder(data);
|
|
97
|
-
return new _responses.Response(folder);
|
|
98
|
-
} catch (error) {
|
|
99
|
-
return new _responses.ErrorResponse(error);
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
updateFolder: async (_, {
|
|
103
|
-
id,
|
|
104
|
-
data
|
|
105
|
-
}, context) => {
|
|
106
|
-
try {
|
|
107
|
-
const folder = await context.folders.updateFolder(id, data);
|
|
108
|
-
return new _responses.Response(folder);
|
|
109
|
-
} catch (error) {
|
|
110
|
-
return new _responses.ErrorResponse(error);
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
deleteFolder: async (_, {
|
|
114
|
-
id
|
|
115
|
-
}, context) => {
|
|
116
|
-
try {
|
|
117
|
-
await context.folders.deleteFolder(id);
|
|
118
|
-
return new _responses.Response(true);
|
|
119
|
-
} catch (error) {
|
|
120
|
-
return new _responses.ErrorResponse(error);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
exports.foldersSchema = foldersSchema;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["foldersSchema","GraphQLSchemaPlugin","typeDefs","resolvers","FoldersQuery","getFolder","_","id","context","folder","folders","Response","error","ErrorResponse","listFolders","where","FoldersMutation","createFolder","data","updateFolder","deleteFolder"],"sources":["folders.gql.ts"],"sourcesContent":["import { ErrorResponse, Response } from \"@webiny/handler-graphql/responses\";\nimport { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins/GraphQLSchemaPlugin\";\nimport { ACOContext } from \"~/types\";\n\nexport const foldersSchema = new GraphQLSchemaPlugin<ACOContext>({\n typeDefs: /* GraphQL */ `\n type Folder {\n id: ID!\n name: String!\n slug: String!\n type: String!\n parentId: ID\n createdOn: DateTime\n createdBy: FolderCreatedBy\n }\n\n input FolderCreateInput {\n name: String!\n slug: String!\n type: String!\n parentId: ID\n }\n\n input FolderUpdateInput {\n name: String\n slug: String\n parentId: ID\n }\n\n input FoldersListWhereInput {\n type: String!\n }\n\n type FolderResponse {\n data: Folder\n error: FolderError\n }\n\n type FoldersListResponse {\n data: [Folder]\n error: FolderError\n }\n\n extend type FoldersQuery {\n getFolder(id: ID!): FolderResponse\n listFolders(where: FoldersListWhereInput!): FoldersListResponse\n }\n\n extend type FoldersMutation {\n createFolder(data: FolderCreateInput!): FolderResponse\n updateFolder(id: ID!, data: FolderUpdateInput!): FolderResponse\n deleteFolder(id: ID!): FolderBooleanResponse\n }\n `,\n resolvers: {\n FoldersQuery: {\n getFolder: async (_, { id }, context) => {\n try {\n const folder = await context.folders.getFolder({ id });\n return new Response(folder);\n } catch (error) {\n return new ErrorResponse(error);\n }\n },\n listFolders: async (_, { where }, context) => {\n try {\n const folders = await context.folders.listFolders({ where });\n return new Response(folders);\n } catch (error) {\n return new ErrorResponse(error);\n }\n }\n },\n\n FoldersMutation: {\n createFolder: async (_, { data }, context) => {\n try {\n const folder = await context.folders.createFolder(data);\n return new Response(folder);\n } catch (error) {\n return new ErrorResponse(error);\n }\n },\n updateFolder: async (_, { id, data }, context) => {\n try {\n const folder = await context.folders.updateFolder(id, data);\n return new Response(folder);\n } catch (error) {\n return new ErrorResponse(error);\n }\n },\n deleteFolder: async (_, { id }, context) => {\n try {\n await context.folders.deleteFolder(id);\n return new Response(true);\n } catch (error) {\n return new ErrorResponse(error);\n }\n }\n }\n }\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AAGO,MAAMA,aAAa,GAAG,IAAIC,wCAAJ,CAAoC;EAC7DC,QAAQ;EAAE;EAAe;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAjDiE;EAk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CAA6BZ,EAA7B,EAAiCW,IAAjC,CAArB;UACA,OAAO,IAAIP,mBAAJ,CAAaF,MAAb,CAAP;QACH,CAHD,CAGE,OAAOG,KAAP,EAAc;UACZ,OAAO,IAAIC,wBAAJ,CAAkBD,KAAlB,CAAP;QACH;MACJ,CAhBY;MAiBbQ,YAAY,EAAE,OAAOd,CAAP,EAAU;QAAEC;MAAF,CAAV,EAAkBC,OAAlB,KAA8B;QACxC,IAAI;UACA,MAAMA,OAAO,CAACE,OAAR,CAAgBU,YAAhB,CAA6Bb,EAA7B,CAAN;UACA,OAAO,IAAII,mBAAJ,CAAa,IAAb,CAAP;QACH,CAHD,CAGE,OAAOC,KAAP,EAAc;UACZ,OAAO,IAAIC,wBAAJ,CAAkBD,KAAlB,CAAP;QACH;MACJ;IAxBY;EApBV;AAlDkD,CAApC,CAAtB"}
|
package/graphql/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const graphqlPlugins: import("@webiny/handler-graphql").GraphQLSchemaPlugin<import("../types").ACOContext>[];
|
package/graphql/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.graphqlPlugins = void 0;
|
|
7
|
-
|
|
8
|
-
var _base = require("./base.gql");
|
|
9
|
-
|
|
10
|
-
var _links = require("./links.gql");
|
|
11
|
-
|
|
12
|
-
var _folders = require("./folders.gql");
|
|
13
|
-
|
|
14
|
-
const graphqlPlugins = [_base.baseSchema, _links.linksSchema, _folders.foldersSchema];
|
|
15
|
-
exports.graphqlPlugins = graphqlPlugins;
|
package/graphql/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["graphqlPlugins","baseSchema","linksSchema","foldersSchema"],"sources":["index.ts"],"sourcesContent":["import { baseSchema } from \"./base.gql\";\nimport { linksSchema } from \"./links.gql\";\nimport { foldersSchema } from \"./folders.gql\";\n\nexport const graphqlPlugins = [baseSchema, linksSchema, foldersSchema];\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEO,MAAMA,cAAc,GAAG,CAACC,gBAAD,EAAaC,kBAAb,EAA0BC,sBAA1B,CAAvB"}
|
package/graphql/links.gql.d.ts
DELETED