@webiny/api-aco 5.36.2 → 5.37.0-beta.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/apps/AcoApp.d.ts +16 -0
- package/apps/AcoApp.js +108 -0
- package/apps/AcoApp.js.map +1 -0
- package/apps/AcoApps.d.ts +10 -0
- package/apps/AcoApps.js +76 -0
- package/apps/AcoApps.js.map +1 -0
- package/apps/app.gql.d.ts +3 -0
- package/apps/app.gql.js +58 -0
- package/apps/app.gql.js.map +1 -0
- package/apps/index.d.ts +2 -0
- package/apps/index.js +27 -0
- package/apps/index.js.map +1 -0
- package/createAcoContext.js +50 -13
- package/createAcoContext.js.map +1 -1
- package/createAcoGraphQL.d.ts +2 -2
- package/createAcoGraphQL.js +34 -5
- package/createAcoGraphQL.js.map +1 -1
- package/createAcoHooks.js.map +1 -1
- package/createAcoModels.js +0 -15
- package/createAcoModels.js.map +1 -1
- package/createAcoStorageOperations.js.map +1 -1
- package/{createAcoFields.d.ts → fields/index.d.ts} +1 -1
- package/fields/index.js +12 -0
- package/fields/index.js.map +1 -0
- package/fields/location.d.ts +2 -0
- package/fields/location.js +44 -0
- package/fields/location.js.map +1 -0
- package/folder/folder.crud.js +18 -0
- package/folder/folder.crud.js.map +1 -1
- package/folder/folder.gql.js +1 -1
- package/folder/folder.gql.js.map +1 -1
- package/folder/folder.model.js +0 -18
- package/folder/folder.model.js.map +1 -1
- package/folder/folder.so.js.map +1 -1
- package/folder/folder.types.d.ts +8 -2
- package/folder/folder.types.js.map +1 -1
- package/folder/onFolderBeforeDelete.hook.js +21 -9
- package/folder/onFolderBeforeDelete.hook.js.map +1 -1
- package/index.d.ts +3 -1
- package/index.js +31 -3
- package/index.js.map +1 -1
- package/package.json +29 -27
- package/plugins/AcoAppModifierPlugin.d.ts +43 -0
- package/plugins/AcoAppModifierPlugin.js +59 -0
- package/plugins/AcoAppModifierPlugin.js.map +1 -0
- package/plugins/AcoAppRegisterPlugin.d.ts +8 -0
- package/plugins/AcoAppRegisterPlugin.js +22 -0
- package/plugins/AcoAppRegisterPlugin.js.map +1 -0
- package/plugins/index.d.ts +2 -0
- package/plugins/index.js +27 -0
- package/plugins/index.js.map +1 -0
- package/record/graphql/createAppResolvers.d.ts +14 -0
- package/record/graphql/createAppResolvers.js +108 -0
- package/record/graphql/createAppResolvers.js.map +1 -0
- package/record/graphql/createAppSchema.d.ts +9 -0
- package/record/graphql/createAppSchema.js +142 -0
- package/record/graphql/createAppSchema.js.map +1 -0
- package/record/record.crud.js +45 -14
- package/record/record.crud.js.map +1 -1
- package/record/record.gql.d.ts +8 -3
- package/record/record.gql.js +36 -182
- package/record/record.gql.js.map +1 -1
- package/record/record.model.d.ts +7 -1
- package/record/record.model.js +34 -10
- package/record/record.model.js.map +1 -1
- package/record/record.so.js +55 -44
- package/record/record.so.js.map +1 -1
- package/record/record.types.d.ts +49 -15
- package/record/record.types.js.map +1 -1
- package/types.d.ts +45 -3
- package/types.js +10 -4
- package/types.js.map +1 -1
- package/utils/acoRecordId.js.map +1 -1
- package/utils/checkPermissions.js.map +1 -1
- package/utils/createListSort.js.map +1 -1
- package/utils/createModelField.js.map +1 -1
- package/utils/createOperationsWrapper.js.map +1 -1
- package/utils/fieldResolver.js.map +1 -1
- package/utils/getFieldValues.d.ts +2 -2
- package/utils/getFieldValues.js +1 -1
- package/utils/getFieldValues.js.map +1 -1
- package/utils/getFolderAndItsAncestors.d.ts +7 -0
- package/utils/getFolderAndItsAncestors.js +48 -0
- package/utils/getFolderAndItsAncestors.js.map +1 -0
- package/utils/isInstallationPending.js.map +1 -1
- package/utils/modelFactory.js.map +1 -1
- package/utils/resolve.d.ts +2 -1
- package/utils/resolve.js +11 -2
- package/utils/resolve.js.map +1 -1
- package/createAcoCrud.d.ts +0 -2
- package/createAcoCrud.js +0 -17
- package/createAcoCrud.js.map +0 -1
- package/createAcoFields.js +0 -40
- package/createAcoFields.js.map +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createAcoAppModifier = exports.AcoAppModifierPlugin = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _plugins = require("@webiny/plugins");
|
|
10
|
+
const createModifier = ({
|
|
11
|
+
app,
|
|
12
|
+
context
|
|
13
|
+
}) => {
|
|
14
|
+
return {
|
|
15
|
+
app,
|
|
16
|
+
context,
|
|
17
|
+
addField: field => {
|
|
18
|
+
app.addField(field);
|
|
19
|
+
},
|
|
20
|
+
removeField: id => {
|
|
21
|
+
app.removeField(id);
|
|
22
|
+
},
|
|
23
|
+
modifyField: (id, cb) => {
|
|
24
|
+
app.modifyField(id, cb);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
class AcoAppModifierPlugin extends _plugins.Plugin {
|
|
29
|
+
constructor(params) {
|
|
30
|
+
super();
|
|
31
|
+
(0, _defineProperty2.default)(this, "params", void 0);
|
|
32
|
+
this.params = params;
|
|
33
|
+
}
|
|
34
|
+
static create(params) {
|
|
35
|
+
return new AcoAppModifierPlugin(params);
|
|
36
|
+
}
|
|
37
|
+
canUse(app) {
|
|
38
|
+
return app.name === this.params.name;
|
|
39
|
+
}
|
|
40
|
+
async modify(params) {
|
|
41
|
+
const {
|
|
42
|
+
app,
|
|
43
|
+
context
|
|
44
|
+
} = params;
|
|
45
|
+
return this.params.cb(createModifier({
|
|
46
|
+
app,
|
|
47
|
+
context
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.AcoAppModifierPlugin = AcoAppModifierPlugin;
|
|
52
|
+
(0, _defineProperty2.default)(AcoAppModifierPlugin, "type", "aco.app.modifier");
|
|
53
|
+
const createAcoAppModifier = (name, cb) => {
|
|
54
|
+
return AcoAppModifierPlugin.create({
|
|
55
|
+
name,
|
|
56
|
+
cb
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
exports.createAcoAppModifier = createAcoAppModifier;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_plugins","require","createModifier","app","context","addField","field","removeField","id","modifyField","cb","AcoAppModifierPlugin","Plugin","constructor","params","_defineProperty2","default","create","canUse","name","modify","exports","createAcoAppModifier"],"sources":["AcoAppModifierPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n AcoContext,\n IAcoApp,\n IAcoAppAddFieldCallable,\n IAcoAppModifyFieldCallable,\n IAcoAppRemoveFieldCallable\n} from \"~/types\";\nimport { Context } from \"@webiny/handler/types\";\n\nexport interface AcoAppModifierPluginModifyParams<T extends Context = AcoContext> {\n app: IAcoApp;\n context: T;\n}\n\nexport interface AcoAppModifierPluginParamsCallable<T extends Context = AcoContext> {\n (params: AppModifier<T>): Promise<void> | void;\n}\n\nexport interface AcoAppModifierPluginParams<T extends Context = AcoContext> {\n name: string;\n cb: AcoAppModifierPluginParamsCallable<T>;\n}\n\nexport interface AppModifier<T extends Context = AcoContext> {\n /**\n * We can access the app if really required.\n * @internal\n */\n app: IAcoApp;\n /**\n * We can access the context if really required.\n * @internal\n */\n context: T;\n addField: IAcoAppAddFieldCallable;\n removeField: IAcoAppRemoveFieldCallable;\n modifyField: IAcoAppModifyFieldCallable;\n}\n\nexport interface AppModifierParams<T extends Context = AcoContext> {\n app: IAcoApp;\n context: T;\n}\n\nconst createModifier = <T extends Context>({\n app,\n context\n}: AppModifierParams<T>): AppModifier<T> => {\n return {\n app,\n context,\n addField: field => {\n app.addField(field);\n },\n removeField: id => {\n app.removeField(id);\n },\n modifyField: (id, cb) => {\n app.modifyField(id, cb);\n }\n };\n};\n\nexport class AcoAppModifierPlugin<T extends Context = Context> extends Plugin {\n public static override readonly type: string = \"aco.app.modifier\";\n\n private readonly params: AcoAppModifierPluginParams<T>;\n\n private constructor(params: AcoAppModifierPluginParams<T>) {\n super();\n this.params = params;\n }\n\n public static create<C extends Context = AcoContext>(params: AcoAppModifierPluginParams<C>) {\n return new AcoAppModifierPlugin<C>(params);\n }\n\n public canUse(app: IAcoApp): boolean {\n return app.name === this.params.name;\n }\n\n public async modify(params: AcoAppModifierPluginModifyParams<T>): Promise<void> {\n const { app, context } = params;\n return this.params.cb(\n createModifier<T>({\n app,\n context\n })\n );\n }\n}\n\nexport type CreateAcoAppModifierCallable<T extends Context = AcoContext> =\n AcoAppModifierPluginParamsCallable<T>;\n\nexport const createAcoAppModifier = <T extends Context = AcoContext>(\n name: string,\n cb: CreateAcoAppModifierCallable<T>\n) => {\n return AcoAppModifierPlugin.create<T>({\n name,\n cb\n });\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA6CA,MAAMC,cAAc,GAAGA,CAAoB;EACvCC,GAAG;EACHC;AACkB,CAAC,KAAqB;EACxC,OAAO;IACHD,GAAG;IACHC,OAAO;IACPC,QAAQ,EAAEC,KAAK,IAAI;MACfH,GAAG,CAACE,QAAQ,CAACC,KAAK,CAAC;IACvB,CAAC;IACDC,WAAW,EAAEC,EAAE,IAAI;MACfL,GAAG,CAACI,WAAW,CAACC,EAAE,CAAC;IACvB,CAAC;IACDC,WAAW,EAAEA,CAACD,EAAE,EAAEE,EAAE,KAAK;MACrBP,GAAG,CAACM,WAAW,CAACD,EAAE,EAAEE,EAAE,CAAC;IAC3B;EACJ,CAAC;AACL,CAAC;AAEM,MAAMC,oBAAoB,SAAsCC,eAAM,CAAC;EAKlEC,WAAWA,CAACC,MAAqC,EAAE;IACvD,KAAK,CAAC,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IACR,IAAI,CAACF,MAAM,GAAGA,MAAM;EACxB;EAEA,OAAcG,MAAMA,CAAiCH,MAAqC,EAAE;IACxF,OAAO,IAAIH,oBAAoB,CAAIG,MAAM,CAAC;EAC9C;EAEOI,MAAMA,CAACf,GAAY,EAAW;IACjC,OAAOA,GAAG,CAACgB,IAAI,KAAK,IAAI,CAACL,MAAM,CAACK,IAAI;EACxC;EAEA,MAAaC,MAAMA,CAACN,MAA2C,EAAiB;IAC5E,MAAM;MAAEX,GAAG;MAAEC;IAAQ,CAAC,GAAGU,MAAM;IAC/B,OAAO,IAAI,CAACA,MAAM,CAACJ,EAAE,CACjBR,cAAc,CAAI;MACdC,GAAG;MACHC;IACJ,CAAC,CACL,CAAC;EACL;AACJ;AAACiB,OAAA,CAAAV,oBAAA,GAAAA,oBAAA;AAAA,IAAAI,gBAAA,CAAAC,OAAA,EA3BYL,oBAAoB,UACkB,kBAAkB;AA+B9D,MAAMW,oBAAoB,GAAGA,CAChCH,IAAY,EACZT,EAAmC,KAClC;EACD,OAAOC,oBAAoB,CAACM,MAAM,CAAI;IAClCE,IAAI;IACJT;EACJ,CAAC,CAAC;AACN,CAAC;AAACW,OAAA,CAAAC,oBAAA,GAAAA,oBAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Plugin } from "@webiny/plugins";
|
|
2
|
+
import { IAcoAppRegisterParams } from "../types";
|
|
3
|
+
export declare class AcoAppRegisterPlugin extends Plugin {
|
|
4
|
+
static type: string;
|
|
5
|
+
readonly app: IAcoAppRegisterParams;
|
|
6
|
+
constructor(app: IAcoAppRegisterParams);
|
|
7
|
+
}
|
|
8
|
+
export declare const registerAcoApp: (app: IAcoAppRegisterParams) => AcoAppRegisterPlugin;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.registerAcoApp = exports.AcoAppRegisterPlugin = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _plugins = require("@webiny/plugins");
|
|
10
|
+
class AcoAppRegisterPlugin extends _plugins.Plugin {
|
|
11
|
+
constructor(app) {
|
|
12
|
+
super();
|
|
13
|
+
(0, _defineProperty2.default)(this, "app", void 0);
|
|
14
|
+
this.app = app;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.AcoAppRegisterPlugin = AcoAppRegisterPlugin;
|
|
18
|
+
(0, _defineProperty2.default)(AcoAppRegisterPlugin, "type", "aco.apps.create.app");
|
|
19
|
+
const registerAcoApp = app => {
|
|
20
|
+
return new AcoAppRegisterPlugin(app);
|
|
21
|
+
};
|
|
22
|
+
exports.registerAcoApp = registerAcoApp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_plugins","require","AcoAppRegisterPlugin","Plugin","constructor","app","_defineProperty2","default","exports","registerAcoApp"],"sources":["AcoAppRegisterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { IAcoAppRegisterParams } from \"~/types\";\n\nexport class AcoAppRegisterPlugin extends Plugin {\n public static override type = \"aco.apps.create.app\";\n public readonly app: IAcoAppRegisterParams;\n\n public constructor(app: IAcoAppRegisterParams) {\n super();\n this.app = app;\n }\n}\n\nexport const registerAcoApp = (app: IAcoAppRegisterParams) => {\n return new AcoAppRegisterPlugin(app);\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGO,MAAMC,oBAAoB,SAASC,eAAM,CAAC;EAItCC,WAAWA,CAACC,GAA0B,EAAE;IAC3C,KAAK,CAAC,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IACR,IAAI,CAACF,GAAG,GAAGA,GAAG;EAClB;AACJ;AAACG,OAAA,CAAAN,oBAAA,GAAAA,oBAAA;AAAA,IAAAI,gBAAA,CAAAC,OAAA,EARYL,oBAAoB,UACC,qBAAqB;AAShD,MAAMO,cAAc,GAAIJ,GAA0B,IAAK;EAC1D,OAAO,IAAIH,oBAAoB,CAACG,GAAG,CAAC;AACxC,CAAC;AAACG,OAAA,CAAAC,cAAA,GAAAA,cAAA"}
|
package/plugins/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _AcoAppRegisterPlugin = require("./AcoAppRegisterPlugin");
|
|
7
|
+
Object.keys(_AcoAppRegisterPlugin).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _AcoAppRegisterPlugin[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _AcoAppRegisterPlugin[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _AcoAppModifierPlugin = require("./AcoAppModifierPlugin");
|
|
18
|
+
Object.keys(_AcoAppModifierPlugin).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _AcoAppModifierPlugin[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _AcoAppModifierPlugin[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_AcoAppRegisterPlugin","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_AcoAppModifierPlugin"],"sources":["index.ts"],"sourcesContent":["export * from \"./AcoAppRegisterPlugin\";\nexport * from \"./AcoAppModifierPlugin\";\n"],"mappings":";;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,qBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,qBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,qBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,qBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,qBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,qBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,qBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CmsFieldTypePlugins, CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
+
import { IAcoApp } from "../../types";
|
|
3
|
+
interface Params {
|
|
4
|
+
app: IAcoApp;
|
|
5
|
+
models: CmsModel[];
|
|
6
|
+
plugins: CmsFieldTypePlugins;
|
|
7
|
+
}
|
|
8
|
+
interface Resolvers {
|
|
9
|
+
SearchQuery: Record<string, any>;
|
|
10
|
+
SearchMutation: Record<string, any>;
|
|
11
|
+
[key: string]: Record<string, any>;
|
|
12
|
+
}
|
|
13
|
+
export declare const createAppResolvers: (params: Params) => Resolvers;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createAppResolvers = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _createFieldResolvers = require("@webiny/api-headless-cms/graphql/schema/createFieldResolvers");
|
|
10
|
+
var _resolve = require("../../utils/resolve");
|
|
11
|
+
var _utils = require("@webiny/utils");
|
|
12
|
+
var _acoRecordId = require("../../utils/acoRecordId");
|
|
13
|
+
var _checkPermissions = require("../../utils/checkPermissions");
|
|
14
|
+
const createAppResolvers = params => {
|
|
15
|
+
const {
|
|
16
|
+
app,
|
|
17
|
+
models,
|
|
18
|
+
plugins
|
|
19
|
+
} = params;
|
|
20
|
+
const model = app.model;
|
|
21
|
+
const apiName = model.singularApiName;
|
|
22
|
+
const createFieldResolvers = (0, _createFieldResolvers.createFieldResolversFactory)({
|
|
23
|
+
endpointType: "manage",
|
|
24
|
+
models,
|
|
25
|
+
model,
|
|
26
|
+
fieldTypePlugins: plugins
|
|
27
|
+
});
|
|
28
|
+
const fieldResolvers = createFieldResolvers({
|
|
29
|
+
graphQLType: apiName,
|
|
30
|
+
fields: app.model.fields,
|
|
31
|
+
isRoot: true,
|
|
32
|
+
extraResolvers: {
|
|
33
|
+
id: entry => {
|
|
34
|
+
const {
|
|
35
|
+
id
|
|
36
|
+
} = (0, _utils.parseIdentifier)(entry.id);
|
|
37
|
+
return (0, _acoRecordId.removeAcoRecordPrefix)(id);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const resolvers = {
|
|
42
|
+
SearchQuery: {
|
|
43
|
+
[`get${apiName}`]: async (_, args, context) => {
|
|
44
|
+
return (0, _resolve.resolve)(() => {
|
|
45
|
+
(0, _checkPermissions.checkPermissions)(context);
|
|
46
|
+
return app.search.get(args.id);
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
[`list${apiName}`]: async (_, args, context) => {
|
|
50
|
+
return (0, _resolve.resolveList)(() => {
|
|
51
|
+
(0, _checkPermissions.checkPermissions)(context);
|
|
52
|
+
return app.search.list(args);
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
[`list${apiName}Tags`]: async (_, args, context) => {
|
|
56
|
+
return (0, _resolve.resolveList)(() => {
|
|
57
|
+
(0, _checkPermissions.checkPermissions)(context);
|
|
58
|
+
return app.search.listTags(args);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
SearchMutation: {
|
|
63
|
+
[`create${apiName}`]: async (_, args, context) => {
|
|
64
|
+
return (0, _resolve.resolve)(() => {
|
|
65
|
+
var _args$data;
|
|
66
|
+
(0, _checkPermissions.checkPermissions)(context);
|
|
67
|
+
const {
|
|
68
|
+
id
|
|
69
|
+
} = (0, _utils.parseIdentifier)((_args$data = args.data) === null || _args$data === void 0 ? void 0 : _args$data.id);
|
|
70
|
+
return app.search.create((0, _objectSpread2.default)((0, _objectSpread2.default)({}, args.data), {}, {
|
|
71
|
+
id
|
|
72
|
+
}));
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
[`update${apiName}`]: async (_, args, context) => {
|
|
76
|
+
return (0, _resolve.resolve)(() => {
|
|
77
|
+
(0, _checkPermissions.checkPermissions)(context);
|
|
78
|
+
const {
|
|
79
|
+
id
|
|
80
|
+
} = (0, _utils.parseIdentifier)(args.id);
|
|
81
|
+
return app.search.update(id, args.data || {});
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
[`move${apiName}`]: async (_, args, context) => {
|
|
85
|
+
return (0, _resolve.resolve)(() => {
|
|
86
|
+
(0, _checkPermissions.checkPermissions)(context);
|
|
87
|
+
const {
|
|
88
|
+
id
|
|
89
|
+
} = (0, _utils.parseIdentifier)(args.id);
|
|
90
|
+
return app.search.move(id, args.folderId);
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
[`delete${apiName}`]: async (_, args, context) => {
|
|
94
|
+
return (0, _resolve.resolve)(() => {
|
|
95
|
+
(0, _checkPermissions.checkPermissions)(context);
|
|
96
|
+
const {
|
|
97
|
+
id
|
|
98
|
+
} = (0, _utils.parseIdentifier)(args.id);
|
|
99
|
+
return app.search.delete(id);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
Object.assign(resolvers, fieldResolvers);
|
|
105
|
+
delete resolvers[apiName].entryId;
|
|
106
|
+
return resolvers;
|
|
107
|
+
};
|
|
108
|
+
exports.createAppResolvers = createAppResolvers;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_createFieldResolvers","require","_resolve","_utils","_acoRecordId","_checkPermissions","createAppResolvers","params","app","models","plugins","model","apiName","singularApiName","createFieldResolvers","createFieldResolversFactory","endpointType","fieldTypePlugins","fieldResolvers","graphQLType","fields","isRoot","extraResolvers","id","entry","parseIdentifier","removeAcoRecordPrefix","resolvers","SearchQuery","_","args","context","resolve","checkPermissions","search","get","resolveList","list","listTags","SearchMutation","_args$data","data","create","_objectSpread2","default","update","move","folderId","delete","Object","assign","entryId","exports"],"sources":["createAppResolvers.ts"],"sourcesContent":["import { CmsEntry, CmsFieldTypePlugins, CmsModel } from \"@webiny/api-headless-cms/types\";\nimport { createFieldResolversFactory } from \"@webiny/api-headless-cms/graphql/schema/createFieldResolvers\";\nimport { AcoContext, IAcoApp } from \"~/types\";\nimport { resolve, resolveList } from \"~/utils/resolve\";\nimport { parseIdentifier } from \"@webiny/utils\";\nimport { removeAcoRecordPrefix } from \"~/utils/acoRecordId\";\nimport { checkPermissions } from \"~/utils/checkPermissions\";\n\ninterface Params {\n app: IAcoApp;\n models: CmsModel[];\n plugins: CmsFieldTypePlugins;\n}\n\ninterface Resolvers {\n SearchQuery: Record<string, any>;\n SearchMutation: Record<string, any>;\n [key: string]: Record<string, any>;\n}\n\nexport const createAppResolvers = (params: Params): Resolvers => {\n const { app, models, plugins } = params;\n\n const model = app.model;\n const apiName = model.singularApiName;\n\n const createFieldResolvers = createFieldResolversFactory({\n endpointType: \"manage\",\n models,\n model,\n fieldTypePlugins: plugins\n });\n\n const fieldResolvers = createFieldResolvers({\n graphQLType: apiName,\n fields: app.model.fields,\n isRoot: true,\n extraResolvers: {\n id: (entry: CmsEntry) => {\n const { id } = parseIdentifier(entry.id);\n return removeAcoRecordPrefix(id);\n }\n }\n });\n\n const resolvers: Resolvers = {\n SearchQuery: {\n [`get${apiName}`]: async (_: unknown, args: any, context: AcoContext) => {\n return resolve(() => {\n checkPermissions(context);\n return app.search.get(args.id);\n });\n },\n [`list${apiName}`]: async (_: unknown, args: any, context: AcoContext) => {\n return resolveList(() => {\n checkPermissions(context);\n return app.search.list(args);\n });\n },\n [`list${apiName}Tags`]: async (_: unknown, args: any, context: AcoContext) => {\n return resolveList(() => {\n checkPermissions(context);\n return app.search.listTags(args);\n });\n }\n },\n SearchMutation: {\n [`create${apiName}`]: async (_: unknown, args: any, context: AcoContext) => {\n return resolve(() => {\n checkPermissions(context);\n const { id } = parseIdentifier(args.data?.id);\n return app.search.create({\n ...args.data,\n id\n });\n });\n },\n [`update${apiName}`]: async (_: unknown, args: any, context: AcoContext) => {\n return resolve(() => {\n checkPermissions(context);\n const { id } = parseIdentifier(args.id);\n return app.search.update(id, args.data || {});\n });\n },\n [`move${apiName}`]: async (_: unknown, args: any, context: AcoContext) => {\n return resolve(() => {\n checkPermissions(context);\n const { id } = parseIdentifier(args.id);\n return app.search.move(id, args.folderId);\n });\n },\n [`delete${apiName}`]: async (_: unknown, args: any, context: AcoContext) => {\n return resolve(() => {\n checkPermissions(context);\n const { id } = parseIdentifier(args.id);\n return app.search.delete(id);\n });\n }\n }\n };\n\n Object.assign(resolvers, fieldResolvers);\n delete resolvers[apiName].entryId;\n\n return resolvers;\n};\n"],"mappings":";;;;;;;;AACA,IAAAA,qBAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA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,CAAC;MACD,CAAE,OAAM7B,OAAQ,EAAC,GAAG,OAAOiB,CAAU,EAAEC,IAAS,EAAEC,OAAmB,KAAK;QACtE,OAAO,IAAAC,gBAAO,EAAC,MAAM;UACjB,IAAAC,kCAAgB,EAACF,OAAO,CAAC;UACzB,MAAM;YAAER;UAAG,CAAC,GAAG,IAAAE,sBAAe,EAACK,IAAI,CAACP,EAAE,CAAC;UACvC,OAAOf,GAAG,CAAC0B,MAAM,CAACY,IAAI,CAACvB,EAAE,EAAEO,IAAI,CAACiB,QAAQ,CAAC;QAC7C,CAAC,CAAC;MACN,CAAC;MACD,CAAE,SAAQnC,OAAQ,EAAC,GAAG,OAAOiB,CAAU,EAAEC,IAAS,EAAEC,OAAmB,KAAK;QACxE,OAAO,IAAAC,gBAAO,EAAC,MAAM;UACjB,IAAAC,kCAAgB,EAACF,OAAO,CAAC;UACzB,MAAM;YAAER;UAAG,CAAC,GAAG,IAAAE,sBAAe,EAACK,IAAI,CAACP,EAAE,CAAC;UACvC,OAAOf,GAAG,CAAC0B,MAAM,CAACc,MAAM,CAACzB,EAAE,CAAC;QAChC,CAAC,CAAC;MACN;IACJ;EACJ,CAAC;EAED0B,MAAM,CAACC,MAAM,CAACvB,SAAS,EAAET,cAAc,CAAC;EACxC,OAAOS,SAAS,CAACf,OAAO,CAAC,CAACuC,OAAO;EAEjC,OAAOxB,SAAS;AACpB,CAAC;AAACyB,OAAA,CAAA9C,kBAAA,GAAAA,kBAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CmsFieldTypePlugins, CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
+
import { IAcoApp } from "../../types";
|
|
3
|
+
interface Params {
|
|
4
|
+
app: IAcoApp;
|
|
5
|
+
models: CmsModel[];
|
|
6
|
+
plugins: CmsFieldTypePlugins;
|
|
7
|
+
}
|
|
8
|
+
export declare const createAppSchema: (params: Params) => string;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createAppSchema = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _renderFields = require("@webiny/api-headless-cms/utils/renderFields");
|
|
10
|
+
var _renderInputFields = require("@webiny/api-headless-cms/utils/renderInputFields");
|
|
11
|
+
var _renderListFilterFields = require("@webiny/api-headless-cms/utils/renderListFilterFields");
|
|
12
|
+
var _renderSortEnum = require("@webiny/api-headless-cms/utils/renderSortEnum");
|
|
13
|
+
const removeFieldRequiredValidation = field => {
|
|
14
|
+
if (field.validation) {
|
|
15
|
+
field.validation = field.validation.filter(validation => validation.name !== "required");
|
|
16
|
+
}
|
|
17
|
+
if (field.listValidation) {
|
|
18
|
+
field.listValidation = field.listValidation.filter(v => v.name !== "required");
|
|
19
|
+
}
|
|
20
|
+
return field;
|
|
21
|
+
};
|
|
22
|
+
const createUpdateFields = fields => {
|
|
23
|
+
return fields.reduce((collection, field) => {
|
|
24
|
+
if (["type"].includes(field.fieldId)) {
|
|
25
|
+
return collection;
|
|
26
|
+
} else if (field.fieldId === "tags") {
|
|
27
|
+
collection.push(field);
|
|
28
|
+
return collection;
|
|
29
|
+
}
|
|
30
|
+
collection.push(removeFieldRequiredValidation((0, _objectSpread2.default)({}, field)));
|
|
31
|
+
return collection;
|
|
32
|
+
}, []);
|
|
33
|
+
};
|
|
34
|
+
const createAppSchema = params => {
|
|
35
|
+
const {
|
|
36
|
+
app,
|
|
37
|
+
models,
|
|
38
|
+
plugins: fieldTypePlugins
|
|
39
|
+
} = params;
|
|
40
|
+
const {
|
|
41
|
+
model
|
|
42
|
+
} = app;
|
|
43
|
+
const {
|
|
44
|
+
singularApiName: apiName,
|
|
45
|
+
fields
|
|
46
|
+
} = model;
|
|
47
|
+
const fieldTypes = (0, _renderFields.renderFields)({
|
|
48
|
+
models,
|
|
49
|
+
model,
|
|
50
|
+
fields,
|
|
51
|
+
type: "manage",
|
|
52
|
+
fieldTypePlugins
|
|
53
|
+
});
|
|
54
|
+
const inputCreateFields = (0, _renderInputFields.renderInputFields)({
|
|
55
|
+
models,
|
|
56
|
+
model,
|
|
57
|
+
fields,
|
|
58
|
+
fieldTypePlugins
|
|
59
|
+
});
|
|
60
|
+
const inputUpdateFields = (0, _renderInputFields.renderInputFields)({
|
|
61
|
+
models,
|
|
62
|
+
model,
|
|
63
|
+
fields: createUpdateFields(fields),
|
|
64
|
+
fieldTypePlugins
|
|
65
|
+
});
|
|
66
|
+
const listFilterFieldsRender = (0, _renderListFilterFields.renderListFilterFields)({
|
|
67
|
+
model,
|
|
68
|
+
fields: model.fields,
|
|
69
|
+
type: "manage",
|
|
70
|
+
fieldTypePlugins
|
|
71
|
+
});
|
|
72
|
+
const sortEnumRender = (0, _renderSortEnum.renderSortEnum)({
|
|
73
|
+
model,
|
|
74
|
+
fields: model.fields,
|
|
75
|
+
fieldTypePlugins
|
|
76
|
+
});
|
|
77
|
+
return (/* GraphQL */`
|
|
78
|
+
${fieldTypes.map(f => f.typeDefs).join("\n")}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
type ${apiName} {
|
|
82
|
+
id: ID!
|
|
83
|
+
savedOn: DateTime!
|
|
84
|
+
createdOn: DateTime!
|
|
85
|
+
createdBy: AcoUser!
|
|
86
|
+
${fieldTypes.map(f => f.fields).join("\n")}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
${inputCreateFields.map(f => f.typeDefs).join("\n")}
|
|
90
|
+
|
|
91
|
+
input ${apiName}CreateInput {
|
|
92
|
+
id: ID
|
|
93
|
+
${inputCreateFields.map(f => f.fields).join("\n")}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
input ${apiName}UpdateInput {
|
|
97
|
+
${inputUpdateFields.map(f => f.fields).join("\n")}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
type ${apiName}Response {
|
|
101
|
+
data: ${apiName}
|
|
102
|
+
error: AcoError
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
input ${apiName}ListWhereInput {
|
|
106
|
+
${listFilterFieldsRender}
|
|
107
|
+
AND: [${apiName}ListWhereInput!]
|
|
108
|
+
OR: [${apiName}ListWhereInput!]
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
type ${apiName}ListResponse {
|
|
112
|
+
data: [${apiName}!]
|
|
113
|
+
error: AcoError
|
|
114
|
+
meta: AcoMeta
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
enum ${apiName}ListSorter {
|
|
118
|
+
${sortEnumRender}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
extend type SearchQuery {
|
|
122
|
+
get${apiName}(id: ID!): ${apiName}Response!
|
|
123
|
+
list${apiName}(
|
|
124
|
+
where: ${apiName}ListWhereInput
|
|
125
|
+
search: String
|
|
126
|
+
limit: Int
|
|
127
|
+
after: String
|
|
128
|
+
sort: [${apiName}ListSorter!]
|
|
129
|
+
): ${apiName}ListResponse!
|
|
130
|
+
list${apiName}Tags(where: AcoSearchRecordTagListWhereInput): AcoSearchRecordTagListResponse!
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
extend type SearchMutation {
|
|
134
|
+
create${apiName}(data: ${apiName}CreateInput!): ${apiName}Response!
|
|
135
|
+
update${apiName}(id: ID!, data: ${apiName}UpdateInput!): ${apiName}Response!
|
|
136
|
+
move${apiName}(id: ID!, folderId: ID!): AcoSearchRecordMoveResponse!
|
|
137
|
+
delete${apiName}(id: ID!): AcoBooleanResponse!
|
|
138
|
+
}
|
|
139
|
+
`
|
|
140
|
+
);
|
|
141
|
+
};
|
|
142
|
+
exports.createAppSchema = createAppSchema;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_renderFields","require","_renderInputFields","_renderListFilterFields","_renderSortEnum","removeFieldRequiredValidation","field","validation","filter","name","listValidation","v","createUpdateFields","fields","reduce","collection","includes","fieldId","push","_objectSpread2","default","createAppSchema","params","app","models","plugins","fieldTypePlugins","model","singularApiName","apiName","fieldTypes","renderFields","type","inputCreateFields","renderInputFields","inputUpdateFields","listFilterFieldsRender","renderListFilterFields","sortEnumRender","renderSortEnum","map","f","typeDefs","join","exports"],"sources":["createAppSchema.ts"],"sourcesContent":["import { CmsFieldTypePlugins, CmsModel, CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport { renderFields } from \"@webiny/api-headless-cms/utils/renderFields\";\nimport { renderInputFields } from \"@webiny/api-headless-cms/utils/renderInputFields\";\nimport { IAcoApp } from \"~/types\";\nimport { renderListFilterFields } from \"@webiny/api-headless-cms/utils/renderListFilterFields\";\nimport { renderSortEnum } from \"@webiny/api-headless-cms/utils/renderSortEnum\";\n\ninterface Params {\n app: IAcoApp;\n models: CmsModel[];\n plugins: CmsFieldTypePlugins;\n}\n\nconst removeFieldRequiredValidation = (field: CmsModelField) => {\n if (field.validation) {\n field.validation = field.validation.filter(validation => validation.name !== \"required\");\n }\n if (field.listValidation) {\n field.listValidation = field.listValidation.filter(v => v.name !== \"required\");\n }\n return field;\n};\n\nconst createUpdateFields = (fields: CmsModelField[]): CmsModelField[] => {\n return fields.reduce<CmsModelField[]>((collection, field) => {\n if ([\"type\"].includes(field.fieldId)) {\n return collection;\n } else if (field.fieldId === \"tags\") {\n collection.push(field);\n return collection;\n }\n collection.push(removeFieldRequiredValidation({ ...field }));\n return collection;\n }, []);\n};\n\nexport const createAppSchema = (params: Params): string => {\n const { app, models, plugins: fieldTypePlugins } = params;\n const { model } = app;\n const { singularApiName: apiName, fields } = model;\n\n const fieldTypes = renderFields({\n models,\n model,\n fields,\n type: \"manage\",\n fieldTypePlugins\n });\n const inputCreateFields = renderInputFields({\n models,\n model,\n fields,\n fieldTypePlugins\n });\n const inputUpdateFields = renderInputFields({\n models,\n model,\n fields: createUpdateFields(fields),\n fieldTypePlugins\n });\n const listFilterFieldsRender = renderListFilterFields({\n model,\n fields: model.fields,\n type: \"manage\",\n fieldTypePlugins\n });\n\n const sortEnumRender = renderSortEnum({\n model,\n fields: model.fields,\n fieldTypePlugins\n });\n\n return /* GraphQL */ `\n ${fieldTypes.map(f => f.typeDefs).join(\"\\n\")}\n\n\n type ${apiName} {\n id: ID!\n savedOn: DateTime!\n createdOn: DateTime!\n createdBy: AcoUser!\n ${fieldTypes.map(f => f.fields).join(\"\\n\")}\n }\n\n ${inputCreateFields.map(f => f.typeDefs).join(\"\\n\")}\n\n input ${apiName}CreateInput {\n id: ID\n ${inputCreateFields.map(f => f.fields).join(\"\\n\")}\n }\n\n input ${apiName}UpdateInput {\n ${inputUpdateFields.map(f => f.fields).join(\"\\n\")}\n }\n\n type ${apiName}Response {\n data: ${apiName}\n error: AcoError\n }\n\n input ${apiName}ListWhereInput {\n ${listFilterFieldsRender}\n AND: [${apiName}ListWhereInput!]\n OR: [${apiName}ListWhereInput!]\n }\n\n type ${apiName}ListResponse {\n data: [${apiName}!]\n error: AcoError\n meta: AcoMeta\n }\n\n enum ${apiName}ListSorter {\n ${sortEnumRender}\n }\n\n extend type SearchQuery {\n get${apiName}(id: ID!): ${apiName}Response!\n list${apiName}(\n where: ${apiName}ListWhereInput\n search: String\n limit: Int\n after: String\n sort: [${apiName}ListSorter!]\n ): ${apiName}ListResponse!\n list${apiName}Tags(where: AcoSearchRecordTagListWhereInput): AcoSearchRecordTagListResponse!\n }\n\n extend type SearchMutation {\n create${apiName}(data: ${apiName}CreateInput!): ${apiName}Response!\n update${apiName}(id: ID!, data: ${apiName}UpdateInput!): ${apiName}Response!\n move${apiName}(id: ID!, folderId: ID!): AcoSearchRecordMoveResponse!\n delete${apiName}(id: ID!): AcoBooleanResponse!\n }\n `;\n};\n"],"mappings":";;;;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAEA,IAAAE,uBAAA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,CAAC,IAAIA,CAAC,CAAC5B,MAAM,CAAC,CAAC8B,IAAI,CAAC,IAAI,CAAE;AAC9D;AACA;AACA,eAAed,OAAQ;AACvB,oBAAoBA,OAAQ;AAC5B;AACA;AACA;AACA,gBAAgBA,OAAQ;AACxB,cAAcO,sBAAuB;AACrC,oBAAoBP,OAAQ;AAC5B,mBAAmBA,OAAQ;AAC3B;AACA;AACA,eAAeA,OAAQ;AACvB,qBAAqBA,OAAQ;AAC7B;AACA;AACA;AACA;AACA,eAAeA,OAAQ;AACvB,cAAcS,cAAe;AAC7B;AACA;AACA;AACA,iBAAiBT,OAAQ,cAAaA,OAAQ;AAC9C,kBAAkBA,OAAQ;AAC1B,yBAAyBA,OAAQ;AACjC;AACA;AACA;AACA,yBAAyBA,OAAQ;AACjC,iBAAiBA,OAAQ;AACzB,kBAAkBA,OAAQ;AAC1B;AACA;AACA;AACA,oBAAoBA,OAAQ,UAASA,OAAQ,kBAAiBA,OAAQ;AACtE,oBAAoBA,OAAQ,mBAAkBA,OAAQ,kBAAiBA,OAAQ;AAC/E,kBAAkBA,OAAQ;AAC1B,oBAAoBA,OAAQ;AAC5B;AACA;EAAK;AACL,CAAC;AAACe,OAAA,CAAAvB,eAAA,GAAAA,eAAA"}
|
package/record/record.crud.js
CHANGED
|
@@ -14,6 +14,9 @@ const createSearchRecordCrudMethods = ({
|
|
|
14
14
|
// update
|
|
15
15
|
const onSearchRecordBeforeUpdate = (0, _pubsub.createTopic)("aco.onSearchRecordBeforeUpdate");
|
|
16
16
|
const onSearchRecordAfterUpdate = (0, _pubsub.createTopic)("aco.onSearchRecordAfterUpdate");
|
|
17
|
+
// move
|
|
18
|
+
const onSearchRecordBeforeMove = (0, _pubsub.createTopic)("aco.onSearchRecordBeforeMove");
|
|
19
|
+
const onSearchRecordAfterMove = (0, _pubsub.createTopic)("aco.onSearchRecordAfterMove");
|
|
17
20
|
// delete
|
|
18
21
|
const onSearchRecordBeforeDelete = (0, _pubsub.createTopic)("aco.onSearchRecordBeforeDelete");
|
|
19
22
|
const onSearchRecordAfterDelete = (0, _pubsub.createTopic)("aco.onSearchRecordAfterDelete");
|
|
@@ -25,44 +28,50 @@ const createSearchRecordCrudMethods = ({
|
|
|
25
28
|
onSearchRecordAfterCreate,
|
|
26
29
|
onSearchRecordBeforeUpdate,
|
|
27
30
|
onSearchRecordAfterUpdate,
|
|
31
|
+
onSearchRecordBeforeMove,
|
|
32
|
+
onSearchRecordAfterMove,
|
|
28
33
|
onSearchRecordBeforeDelete,
|
|
29
34
|
onSearchRecordAfterDelete,
|
|
30
|
-
async get(id) {
|
|
31
|
-
return storageOperations.getRecord({
|
|
35
|
+
async get(model, id) {
|
|
36
|
+
return storageOperations.getRecord(model, {
|
|
32
37
|
id
|
|
33
38
|
});
|
|
34
39
|
},
|
|
35
|
-
async list(params) {
|
|
36
|
-
return storageOperations.listRecords(params);
|
|
40
|
+
async list(model, params) {
|
|
41
|
+
return storageOperations.listRecords(model, params);
|
|
37
42
|
},
|
|
38
|
-
async create(data) {
|
|
43
|
+
async create(model, data) {
|
|
39
44
|
await onSearchRecordBeforeCreate.publish({
|
|
45
|
+
model,
|
|
40
46
|
input: data
|
|
41
47
|
});
|
|
42
|
-
const record = await storageOperations.createRecord({
|
|
48
|
+
const record = await storageOperations.createRecord(model, {
|
|
43
49
|
data
|
|
44
50
|
});
|
|
45
51
|
await onSearchRecordAfterCreate.publish({
|
|
52
|
+
model,
|
|
46
53
|
record
|
|
47
54
|
});
|
|
48
55
|
return record;
|
|
49
56
|
},
|
|
50
|
-
async update(id, data) {
|
|
51
|
-
const original = await storageOperations.getRecord({
|
|
57
|
+
async update(model, id, data) {
|
|
58
|
+
const original = await storageOperations.getRecord(model, {
|
|
52
59
|
id
|
|
53
60
|
});
|
|
54
61
|
await onSearchRecordBeforeUpdate.publish({
|
|
62
|
+
model,
|
|
55
63
|
original,
|
|
56
64
|
input: {
|
|
57
65
|
id,
|
|
58
66
|
data
|
|
59
67
|
}
|
|
60
68
|
});
|
|
61
|
-
const record = await storageOperations.updateRecord({
|
|
69
|
+
const record = await storageOperations.updateRecord(model, {
|
|
62
70
|
id,
|
|
63
71
|
data
|
|
64
72
|
});
|
|
65
73
|
await onSearchRecordAfterUpdate.publish({
|
|
74
|
+
model,
|
|
66
75
|
original,
|
|
67
76
|
input: {
|
|
68
77
|
id,
|
|
@@ -72,23 +81,45 @@ const createSearchRecordCrudMethods = ({
|
|
|
72
81
|
});
|
|
73
82
|
return record;
|
|
74
83
|
},
|
|
75
|
-
async
|
|
76
|
-
const
|
|
84
|
+
async move(model, id, folderId) {
|
|
85
|
+
const original = await storageOperations.getRecord(model, {
|
|
86
|
+
id
|
|
87
|
+
});
|
|
88
|
+
await onSearchRecordBeforeMove.publish({
|
|
89
|
+
model,
|
|
90
|
+
original,
|
|
91
|
+
folderId
|
|
92
|
+
});
|
|
93
|
+
const result = await storageOperations.moveRecord(model, {
|
|
94
|
+
id,
|
|
95
|
+
folderId
|
|
96
|
+
});
|
|
97
|
+
await onSearchRecordAfterMove.publish({
|
|
98
|
+
model,
|
|
99
|
+
original,
|
|
100
|
+
folderId
|
|
101
|
+
});
|
|
102
|
+
return result;
|
|
103
|
+
},
|
|
104
|
+
async delete(model, id) {
|
|
105
|
+
const record = await storageOperations.getRecord(model, {
|
|
77
106
|
id
|
|
78
107
|
});
|
|
79
108
|
await onSearchRecordBeforeDelete.publish({
|
|
109
|
+
model,
|
|
80
110
|
record
|
|
81
111
|
});
|
|
82
|
-
await storageOperations.deleteRecord({
|
|
112
|
+
await storageOperations.deleteRecord(model, {
|
|
83
113
|
id
|
|
84
114
|
});
|
|
85
115
|
await onSearchRecordAfterDelete.publish({
|
|
116
|
+
model,
|
|
86
117
|
record
|
|
87
118
|
});
|
|
88
119
|
return true;
|
|
89
120
|
},
|
|
90
|
-
async listTags(params) {
|
|
91
|
-
return storageOperations.listTags(params);
|
|
121
|
+
async listTags(model, params) {
|
|
122
|
+
return storageOperations.listTags(model, params);
|
|
92
123
|
}
|
|
93
124
|
};
|
|
94
125
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSearchRecordCrudMethods","storageOperations","onSearchRecordBeforeCreate","createTopic","onSearchRecordAfterCreate","onSearchRecordBeforeUpdate","onSearchRecordAfterUpdate","onSearchRecordBeforeDelete","onSearchRecordAfterDelete","get","id","getRecord","list","params","listRecords","create","data","publish","input","record","createRecord","update","original","updateRecord","delete","deleteRecord","listTags"],"sources":["record.crud.ts"],"sourcesContent":["import { createTopic } from \"@webiny/pubsub\";\
|
|
1
|
+
{"version":3,"names":["_pubsub","require","createSearchRecordCrudMethods","storageOperations","onSearchRecordBeforeCreate","createTopic","onSearchRecordAfterCreate","onSearchRecordBeforeUpdate","onSearchRecordAfterUpdate","onSearchRecordBeforeMove","onSearchRecordAfterMove","onSearchRecordBeforeDelete","onSearchRecordAfterDelete","get","model","id","getRecord","list","params","listRecords","create","data","publish","input","record","createRecord","update","original","updateRecord","move","folderId","result","moveRecord","delete","deleteRecord","listTags","exports"],"sources":["record.crud.ts"],"sourcesContent":["import { createTopic } from \"@webiny/pubsub\";\nimport {\n CreateAcoParams,\n OnSearchRecordAfterMoveTopicParams,\n OnSearchRecordBeforeMoveTopicParams\n} from \"~/types\";\nimport {\n AcoSearchRecordCrud,\n OnSearchRecordAfterCreateTopicParams,\n OnSearchRecordAfterDeleteTopicParams,\n OnSearchRecordAfterUpdateTopicParams,\n OnSearchRecordBeforeCreateTopicParams,\n OnSearchRecordBeforeDeleteTopicParams,\n OnSearchRecordBeforeUpdateTopicParams\n} from \"./record.types\";\n\nexport const createSearchRecordCrudMethods = ({\n storageOperations\n}: CreateAcoParams): AcoSearchRecordCrud => {\n // create\n const onSearchRecordBeforeCreate = createTopic<OnSearchRecordBeforeCreateTopicParams>(\n \"aco.onSearchRecordBeforeCreate\"\n );\n const onSearchRecordAfterCreate = createTopic<OnSearchRecordAfterCreateTopicParams>(\n \"aco.onSearchRecordAfterCreate\"\n );\n // update\n const onSearchRecordBeforeUpdate = createTopic<OnSearchRecordBeforeUpdateTopicParams>(\n \"aco.onSearchRecordBeforeUpdate\"\n );\n const onSearchRecordAfterUpdate = createTopic<OnSearchRecordAfterUpdateTopicParams>(\n \"aco.onSearchRecordAfterUpdate\"\n );\n // move\n const onSearchRecordBeforeMove = createTopic<OnSearchRecordBeforeMoveTopicParams>(\n \"aco.onSearchRecordBeforeMove\"\n );\n const onSearchRecordAfterMove = createTopic<OnSearchRecordAfterMoveTopicParams>(\n \"aco.onSearchRecordAfterMove\"\n );\n // delete\n const onSearchRecordBeforeDelete = createTopic<OnSearchRecordBeforeDeleteTopicParams>(\n \"aco.onSearchRecordBeforeDelete\"\n );\n const onSearchRecordAfterDelete = createTopic<OnSearchRecordAfterDeleteTopicParams>(\n \"aco.onSearchRecordAfterDelete\"\n );\n\n return {\n /**\n * Lifecycle events\n */\n onSearchRecordBeforeCreate,\n onSearchRecordAfterCreate,\n onSearchRecordBeforeUpdate,\n onSearchRecordAfterUpdate,\n onSearchRecordBeforeMove,\n onSearchRecordAfterMove,\n onSearchRecordBeforeDelete,\n onSearchRecordAfterDelete,\n async get(model, id) {\n return storageOperations.getRecord(model, { id });\n },\n async list(model, params) {\n return storageOperations.listRecords(model, params);\n },\n async create(model, data) {\n await onSearchRecordBeforeCreate.publish({ model, input: data });\n const record = await storageOperations.createRecord(model, { data });\n await onSearchRecordAfterCreate.publish({ model, record });\n return record;\n },\n async update(model, id, data) {\n const original = await storageOperations.getRecord(model, { id });\n await onSearchRecordBeforeUpdate.publish({ model, original, input: { id, data } });\n const record = await storageOperations.updateRecord(model, { id, data });\n await onSearchRecordAfterUpdate.publish({\n model,\n original,\n input: { id, data },\n record\n });\n return record;\n },\n async move(model, id, folderId) {\n const original = await storageOperations.getRecord(model, { id });\n await onSearchRecordBeforeMove.publish({ model, original, folderId });\n const result = await storageOperations.moveRecord(model, {\n id,\n folderId\n });\n await onSearchRecordAfterMove.publish({\n model,\n original,\n folderId\n });\n return result;\n },\n async delete(model, id: string) {\n const record = await storageOperations.getRecord(model, { id });\n await onSearchRecordBeforeDelete.publish({ model, record });\n await storageOperations.deleteRecord(model, { id });\n await onSearchRecordAfterDelete.publish({ model, record });\n return true;\n },\n async listTags(model, params) {\n return storageOperations.listTags(model, params);\n }\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAgBO,MAAMC,6BAA6B,GAAGA,CAAC;EAC1CC;AACa,CAAC,KAA0B;EACxC;EACA,MAAMC,0BAA0B,GAAG,IAAAC,mBAAW,EAC1C,gCACJ,CAAC;EACD,MAAMC,yBAAyB,GAAG,IAAAD,mBAAW,EACzC,+BACJ,CAAC;EACD;EACA,MAAME,0BAA0B,GAAG,IAAAF,mBAAW,EAC1C,gCACJ,CAAC;EACD,MAAMG,yBAAyB,GAAG,IAAAH,mBAAW,EACzC,+BACJ,CAAC;EACD;EACA,MAAMI,wBAAwB,GAAG,IAAAJ,mBAAW,EACxC,8BACJ,CAAC;EACD,MAAMK,uBAAuB,GAAG,IAAAL,mBAAW,EACvC,6BACJ,CAAC;EACD;EACA,MAAMM,0BAA0B,GAAG,IAAAN,mBAAW,EAC1C,gCACJ,CAAC;EACD,MAAMO,yBAAyB,GAAG,IAAAP,mBAAW,EACzC,+BACJ,CAAC;EAED,OAAO;IACH;AACR;AACA;IACQD,0BAA0B;IAC1BE,yBAAyB;IACzBC,0BAA0B;IAC1BC,yBAAyB;IACzBC,wBAAwB;IACxBC,uBAAuB;IACvBC,0BAA0B;IAC1BC,yBAAyB;IACzB,MAAMC,GAAGA,CAACC,KAAK,EAAEC,EAAE,EAAE;MACjB,OAAOZ,iBAAiB,CAACa,SAAS,CAACF,KAAK,EAAE;QAAEC;MAAG,CAAC,CAAC;IACrD,CAAC;IACD,MAAME,IAAIA,CAACH,KAAK,EAAEI,MAAM,EAAE;MACtB,OAAOf,iBAAiB,CAACgB,WAAW,CAACL,KAAK,EAAEI,MAAM,CAAC;IACvD,CAAC;IACD,MAAME,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AClB,KAAK,EAAE;QACrDC,EAAE;QACFe;MACJ,CAAC,CAAC;MACF,MAAMpB,uBAAuB,CAACY,OAAO,CAAC;QAClCR,KAAK;QACLa,QAAQ;QACRG;MACJ,CAAC,CAAC;MACF,OAAOC,MAAM;IACjB,CAAC;IACD,MAAME,MAAMA,CAACnB,KAAK,EAAEC,EAAU,EAAE;MAC5B,MAAMS,MAAM,GAAG,MAAMrB,iBAAiB,CAACa,SAAS,CAACF,KAAK,EAAE;QAAEC;MAAG,CAAC,CAAC;MAC/D,MAAMJ,0BAA0B,CAACW,OAAO,CAAC;QAAER,KAAK;QAAEU;MAAO,CAAC,CAAC;MAC3D,MAAMrB,iBAAiB,CAAC+B,YAAY,CAACpB,KAAK,EAAE;QAAEC;MAAG,CAAC,CAAC;MACnD,MAAMH,yBAAyB,CAACU,OAAO,CAAC;QAAER,KAAK;QAAEU;MAAO,CAAC,CAAC;MAC1D,OAAO,IAAI;IACf,CAAC;IACD,MAAMW,QAAQA,CAACrB,KAAK,EAAEI,MAAM,EAAE;MAC1B,OAAOf,iBAAiB,CAACgC,QAAQ,CAACrB,KAAK,EAAEI,MAAM,CAAC;IACpD;EACJ,CAAC;AACL,CAAC;AAACkB,OAAA,CAAAlC,6BAAA,GAAAA,6BAAA"}
|
package/record/record.gql.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { AcoContext, IAcoApp } from "../types";
|
|
2
|
+
import { GraphQLSchemaPlugin } from "@webiny/handler-graphql";
|
|
3
|
+
interface Params {
|
|
4
|
+
context: AcoContext;
|
|
5
|
+
app: IAcoApp;
|
|
6
|
+
}
|
|
7
|
+
export declare const createSchema: (params: Params) => Promise<GraphQLSchemaPlugin<import("@webiny/api/types").Context>>;
|
|
8
|
+
export {};
|