@webiny/api-website-builder 6.0.0-rc.2 → 6.0.0-rc.3
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/domain/permissions.d.ts +4 -12
- package/domain/permissions.js +1 -3
- package/domain/permissions.js.map +1 -1
- package/features/installer/ApiKeyInstaller.d.ts +1 -3
- package/features/installer/ApiKeyInstaller.js +8 -12
- package/features/installer/ApiKeyInstaller.js.map +1 -1
- package/package.json +17 -17
package/domain/permissions.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { Permissions } from "@webiny/api-core/features/security/permissions/index.js";
|
|
2
2
|
declare const schema: {
|
|
3
3
|
readonly prefix: "wb";
|
|
4
|
-
readonly fullAccess:
|
|
5
|
-
readonly name: "wb.*";
|
|
6
|
-
};
|
|
4
|
+
readonly fullAccess: true;
|
|
7
5
|
readonly entities: readonly [{
|
|
8
6
|
readonly id: "page";
|
|
9
7
|
readonly permission: "wb.page";
|
|
@@ -34,9 +32,7 @@ type WbSchema = typeof schema;
|
|
|
34
32
|
export declare const WbPermissions: {
|
|
35
33
|
Abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/security/permissions/types").PermissionsTyped<{
|
|
36
34
|
readonly prefix: "wb";
|
|
37
|
-
readonly fullAccess:
|
|
38
|
-
readonly name: "wb.*";
|
|
39
|
-
};
|
|
35
|
+
readonly fullAccess: true;
|
|
40
36
|
readonly entities: readonly [{
|
|
41
37
|
readonly id: "page";
|
|
42
38
|
readonly permission: "wb.page";
|
|
@@ -65,9 +61,7 @@ export declare const WbPermissions: {
|
|
|
65
61
|
}>>;
|
|
66
62
|
Implementation: import("@webiny/di").Constructor<import("@webiny/api-core/features/security/permissions/types").PermissionsTyped<{
|
|
67
63
|
readonly prefix: "wb";
|
|
68
|
-
readonly fullAccess:
|
|
69
|
-
readonly name: "wb.*";
|
|
70
|
-
};
|
|
64
|
+
readonly fullAccess: true;
|
|
71
65
|
readonly entities: readonly [{
|
|
72
66
|
readonly id: "page";
|
|
73
67
|
readonly permission: "wb.page";
|
|
@@ -96,9 +90,7 @@ export declare const WbPermissions: {
|
|
|
96
90
|
}>> & {
|
|
97
91
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/security/permissions/types").PermissionsTyped<{
|
|
98
92
|
readonly prefix: "wb";
|
|
99
|
-
readonly fullAccess:
|
|
100
|
-
readonly name: "wb.*";
|
|
101
|
-
};
|
|
93
|
+
readonly fullAccess: true;
|
|
102
94
|
readonly entities: readonly [{
|
|
103
95
|
readonly id: "page";
|
|
104
96
|
readonly permission: "wb.page";
|
package/domain/permissions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createPermissions","schema","prefix","fullAccess","
|
|
1
|
+
{"version":3,"names":["createPermissions","schema","prefix","fullAccess","entities","id","permission","scopes","actions","name","WbPermissions"],"sources":["permissions.ts"],"sourcesContent":["import { createPermissions } from \"@webiny/api-core/features/security/permissions/index.js\";\nimport type { Permissions } from \"@webiny/api-core/features/security/permissions/index.js\";\n\nconst schema = {\n prefix: \"wb\",\n fullAccess: true,\n entities: [\n {\n id: \"page\",\n permission: \"wb.page\",\n scopes: [\"full\", \"own\"],\n actions: [{ name: \"rwd\" }, { name: \"pw\" }]\n },\n {\n id: \"redirect\",\n permission: \"wb.redirect\",\n scopes: [\"full\", \"own\"],\n actions: [{ name: \"rwd\" }]\n },\n {\n id: \"settings\",\n permission: \"wb.settings\",\n scopes: [\"full\"]\n },\n {\n id: \"integrations\",\n permission: \"wb.integrations\",\n scopes: [\"full\"]\n }\n ]\n} as const;\n\ntype WbSchema = typeof schema;\n\nexport const WbPermissions = createPermissions(schema);\n\nexport namespace WbPermissions {\n export type Interface = Permissions<WbSchema>;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,yDAAyD;AAG3F,MAAMC,MAAM,GAAG;EACXC,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,IAAI;EAChBC,QAAQ,EAAE,CACN;IACIC,EAAE,EAAE,MAAM;IACVC,UAAU,EAAE,SAAS;IACrBC,MAAM,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;IACvBC,OAAO,EAAE,CAAC;MAAEC,IAAI,EAAE;IAAM,CAAC,EAAE;MAAEA,IAAI,EAAE;IAAK,CAAC;EAC7C,CAAC,EACD;IACIJ,EAAE,EAAE,UAAU;IACdC,UAAU,EAAE,aAAa;IACzBC,MAAM,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;IACvBC,OAAO,EAAE,CAAC;MAAEC,IAAI,EAAE;IAAM,CAAC;EAC7B,CAAC,EACD;IACIJ,EAAE,EAAE,UAAU;IACdC,UAAU,EAAE,aAAa;IACzBC,MAAM,EAAE,CAAC,MAAM;EACnB,CAAC,EACD;IACIF,EAAE,EAAE,cAAc;IAClBC,UAAU,EAAE,iBAAiB;IAC7BC,MAAM,EAAE,CAAC,MAAM;EACnB,CAAC;AAET,CAAU;AAIV,OAAO,MAAMG,aAAa,GAAGV,iBAAiB,CAACC,MAAM,CAAC","ignoreList":[]}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { AppInstaller } from "@webiny/api-core/features/InstallTenant";
|
|
2
2
|
import { CreateApiKeyUseCase } from "@webiny/api-core/features/security/apiKeys/CreateApiKey/index.js";
|
|
3
3
|
import { DeleteApiKeyUseCase } from "@webiny/api-core/features/security/apiKeys/DeleteApiKey/index.js";
|
|
4
|
-
import { WcpContext } from "@webiny/api-core/features/wcp/WcpContext/index.js";
|
|
5
4
|
declare class ApiKeyInstallerImpl implements AppInstaller.Interface {
|
|
6
|
-
private wcpContext;
|
|
7
5
|
private createApiKey;
|
|
8
6
|
private deleteApiKey;
|
|
9
7
|
readonly alwaysRun = true;
|
|
10
8
|
readonly appName = "WebsiteBuilder";
|
|
11
9
|
readonly dependsOn: never[];
|
|
12
10
|
private apiKey;
|
|
13
|
-
constructor(
|
|
11
|
+
constructor(createApiKey: CreateApiKeyUseCase.Interface, deleteApiKey: DeleteApiKeyUseCase.Interface);
|
|
14
12
|
install(): Promise<void>;
|
|
15
13
|
uninstall(): Promise<void>;
|
|
16
14
|
}
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
import { AppInstaller } from "@webiny/api-core/features/InstallTenant";
|
|
2
2
|
import { CreateApiKeyUseCase } from "@webiny/api-core/features/security/apiKeys/CreateApiKey/index.js";
|
|
3
3
|
import { DeleteApiKeyUseCase } from "@webiny/api-core/features/security/apiKeys/DeleteApiKey/index.js";
|
|
4
|
-
import { WcpContext } from "@webiny/api-core/features/wcp/WcpContext/index.js";
|
|
5
4
|
class ApiKeyInstallerImpl {
|
|
6
5
|
alwaysRun = true;
|
|
7
6
|
appName = "WebsiteBuilder";
|
|
8
7
|
dependsOn = [];
|
|
9
8
|
apiKey = undefined;
|
|
10
|
-
constructor(
|
|
11
|
-
this.wcpContext = wcpContext;
|
|
9
|
+
constructor(createApiKey, deleteApiKey) {
|
|
12
10
|
this.createApiKey = createApiKey;
|
|
13
11
|
this.deleteApiKey = deleteApiKey;
|
|
14
12
|
}
|
|
15
13
|
async install() {
|
|
16
|
-
const aacl = this.wcpContext.canUseAacl();
|
|
17
|
-
const permissions = aacl ? [{
|
|
18
|
-
name: "wb.page",
|
|
19
|
-
rwd: "r"
|
|
20
|
-
}] : [{
|
|
21
|
-
name: "wb.*"
|
|
22
|
-
}];
|
|
23
14
|
const result = await this.createApiKey.execute({
|
|
24
15
|
name: "Website Builder",
|
|
25
16
|
description: "Integrate Next.js or custom frontend with Website Builder.",
|
|
26
17
|
slug: "website-builder",
|
|
27
|
-
permissions
|
|
18
|
+
permissions: [{
|
|
19
|
+
name: "$wb.readonly"
|
|
20
|
+
}, {
|
|
21
|
+
name: "wb.page",
|
|
22
|
+
rwd: "r"
|
|
23
|
+
}]
|
|
28
24
|
});
|
|
29
25
|
if (result.isOk()) {
|
|
30
26
|
this.apiKey = result.value;
|
|
@@ -38,7 +34,7 @@ class ApiKeyInstallerImpl {
|
|
|
38
34
|
}
|
|
39
35
|
export const ApiKeyInstaller = AppInstaller.createImplementation({
|
|
40
36
|
implementation: ApiKeyInstallerImpl,
|
|
41
|
-
dependencies: [
|
|
37
|
+
dependencies: [CreateApiKeyUseCase, DeleteApiKeyUseCase]
|
|
42
38
|
});
|
|
43
39
|
|
|
44
40
|
//# sourceMappingURL=ApiKeyInstaller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AppInstaller","CreateApiKeyUseCase","DeleteApiKeyUseCase","
|
|
1
|
+
{"version":3,"names":["AppInstaller","CreateApiKeyUseCase","DeleteApiKeyUseCase","ApiKeyInstallerImpl","alwaysRun","appName","dependsOn","apiKey","undefined","constructor","createApiKey","deleteApiKey","install","result","execute","name","description","slug","permissions","rwd","isOk","value","uninstall","id","ApiKeyInstaller","createImplementation","implementation","dependencies"],"sources":["ApiKeyInstaller.ts"],"sourcesContent":["import { AppInstaller } from \"@webiny/api-core/features/InstallTenant\";\nimport { CreateApiKeyUseCase } from \"@webiny/api-core/features/security/apiKeys/CreateApiKey/index.js\";\nimport { DeleteApiKeyUseCase } from \"@webiny/api-core/features/security/apiKeys/DeleteApiKey/index.js\";\nimport type { ApiKey } from \"@webiny/api-core/types/security.js\";\n\nclass ApiKeyInstallerImpl implements AppInstaller.Interface {\n readonly alwaysRun = true;\n readonly appName = \"WebsiteBuilder\";\n readonly dependsOn = [];\n private apiKey: ApiKey | undefined = undefined;\n\n constructor(\n private createApiKey: CreateApiKeyUseCase.Interface,\n private deleteApiKey: DeleteApiKeyUseCase.Interface\n ) {}\n\n async install(): Promise<void> {\n const result = await this.createApiKey.execute({\n name: \"Website Builder\",\n description: \"Integrate Next.js or custom frontend with Website Builder.\",\n slug: \"website-builder\",\n permissions: [{ name: \"$wb.readonly\" }, { name: \"wb.page\", rwd: \"r\" }]\n });\n\n if (result.isOk()) {\n this.apiKey = result.value;\n }\n }\n\n async uninstall(): Promise<void> {\n if (this.apiKey) {\n await this.deleteApiKey.execute(this.apiKey.id);\n }\n }\n}\n\nexport const ApiKeyInstaller = AppInstaller.createImplementation({\n implementation: ApiKeyInstallerImpl,\n dependencies: [CreateApiKeyUseCase, DeleteApiKeyUseCase]\n});\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,yCAAyC;AACtE,SAASC,mBAAmB,QAAQ,kEAAkE;AACtG,SAASC,mBAAmB,QAAQ,kEAAkE;AAGtG,MAAMC,mBAAmB,CAAmC;EAC/CC,SAAS,GAAG,IAAI;EAChBC,OAAO,GAAG,gBAAgB;EAC1BC,SAAS,GAAG,EAAE;EACfC,MAAM,GAAuBC,SAAS;EAE9CC,WAAWA,CACCC,YAA2C,EAC3CC,YAA2C,EACrD;IAAA,KAFUD,YAA2C,GAA3CA,YAA2C;IAAA,KAC3CC,YAA2C,GAA3CA,YAA2C;EACpD;EAEH,MAAMC,OAAOA,CAAA,EAAkB;IAC3B,MAAMC,MAAM,GAAG,MAAM,IAAI,CAACH,YAAY,CAACI,OAAO,CAAC;MAC3CC,IAAI,EAAE,iBAAiB;MACvBC,WAAW,EAAE,4DAA4D;MACzEC,IAAI,EAAE,iBAAiB;MACvBC,WAAW,EAAE,CAAC;QAAEH,IAAI,EAAE;MAAe,CAAC,EAAE;QAAEA,IAAI,EAAE,SAAS;QAAEI,GAAG,EAAE;MAAI,CAAC;IACzE,CAAC,CAAC;IAEF,IAAIN,MAAM,CAACO,IAAI,CAAC,CAAC,EAAE;MACf,IAAI,CAACb,MAAM,GAAGM,MAAM,CAACQ,KAAK;IAC9B;EACJ;EAEA,MAAMC,SAASA,CAAA,EAAkB;IAC7B,IAAI,IAAI,CAACf,MAAM,EAAE;MACb,MAAM,IAAI,CAACI,YAAY,CAACG,OAAO,CAAC,IAAI,CAACP,MAAM,CAACgB,EAAE,CAAC;IACnD;EACJ;AACJ;AAEA,OAAO,MAAMC,eAAe,GAAGxB,YAAY,CAACyB,oBAAoB,CAAC;EAC7DC,cAAc,EAAEvB,mBAAmB;EACnCwB,YAAY,EAAE,CAAC1B,mBAAmB,EAAEC,mBAAmB;AAC3D,CAAC,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-website-builder",
|
|
3
|
-
"version": "6.0.0-rc.
|
|
3
|
+
"version": "6.0.0-rc.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -19,29 +19,29 @@
|
|
|
19
19
|
"directory": "dist"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@webiny/api": "6.0.0-rc.
|
|
23
|
-
"@webiny/api-core": "6.0.0-rc.
|
|
24
|
-
"@webiny/api-headless-cms": "6.0.0-rc.
|
|
25
|
-
"@webiny/feature": "6.0.0-rc.
|
|
26
|
-
"@webiny/handler": "6.0.0-rc.
|
|
27
|
-
"@webiny/handler-graphql": "6.0.0-rc.
|
|
28
|
-
"@webiny/tenant-manager": "6.0.0-rc.
|
|
22
|
+
"@webiny/api": "6.0.0-rc.3",
|
|
23
|
+
"@webiny/api-core": "6.0.0-rc.3",
|
|
24
|
+
"@webiny/api-headless-cms": "6.0.0-rc.3",
|
|
25
|
+
"@webiny/feature": "6.0.0-rc.3",
|
|
26
|
+
"@webiny/handler": "6.0.0-rc.3",
|
|
27
|
+
"@webiny/handler-graphql": "6.0.0-rc.3",
|
|
28
|
+
"@webiny/tenant-manager": "6.0.0-rc.3",
|
|
29
29
|
"lodash": "4.17.23"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@webiny/api-core-ddb": "6.0.0-rc.
|
|
33
|
-
"@webiny/api-file-manager-s3": "6.0.0-rc.
|
|
34
|
-
"@webiny/build-tools": "6.0.0-rc.
|
|
35
|
-
"@webiny/handler-aws": "6.0.0-rc.
|
|
36
|
-
"@webiny/plugins": "6.0.0-rc.
|
|
37
|
-
"@webiny/project-utils": "6.0.0-rc.
|
|
38
|
-
"@webiny/tasks": "6.0.0-rc.
|
|
39
|
-
"@webiny/wcp": "6.0.0-rc.
|
|
32
|
+
"@webiny/api-core-ddb": "6.0.0-rc.3",
|
|
33
|
+
"@webiny/api-file-manager-s3": "6.0.0-rc.3",
|
|
34
|
+
"@webiny/build-tools": "6.0.0-rc.3",
|
|
35
|
+
"@webiny/handler-aws": "6.0.0-rc.3",
|
|
36
|
+
"@webiny/plugins": "6.0.0-rc.3",
|
|
37
|
+
"@webiny/project-utils": "6.0.0-rc.3",
|
|
38
|
+
"@webiny/tasks": "6.0.0-rc.3",
|
|
39
|
+
"@webiny/wcp": "6.0.0-rc.3",
|
|
40
40
|
"graphql": "16.13.0",
|
|
41
41
|
"prettier": "3.6.2",
|
|
42
42
|
"rimraf": "6.1.3",
|
|
43
43
|
"typescript": "5.9.3",
|
|
44
44
|
"vitest": "4.0.18"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "228fe25e1a17f248d566bce1c33d11c291955513"
|
|
47
47
|
}
|