@webiny/wcp 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.eb81deee7e

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.
@@ -1,19 +1,12 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getWcpProjectEnvironment = getWcpProjectEnvironment;
7
- var _encryption = require("./encryption");
1
+ import { decrypt } from "./encryption.js";
8
2
  function getWcpProjectEnvironment() {
9
- if (process.env.WCP_PROJECT_ENVIRONMENT) {
10
- try {
11
- return (0, _encryption.decrypt)(process.env.WCP_PROJECT_ENVIRONMENT);
12
- } catch {
13
- throw new Error("Could not decrypt WCP_PROJECT_ENVIRONMENT environment variable data.");
3
+ if (process.env.WCP_PROJECT_ENVIRONMENT) try {
4
+ return decrypt(process.env.WCP_PROJECT_ENVIRONMENT);
5
+ } catch {
6
+ throw new Error("Could not decrypt WCP_PROJECT_ENVIRONMENT environment variable data.");
14
7
  }
15
- }
16
- return null;
8
+ return null;
17
9
  }
10
+ export { getWcpProjectEnvironment };
18
11
 
19
12
  //# sourceMappingURL=getWcpProjectEnvironment.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_encryption","require","getWcpProjectEnvironment","process","env","WCP_PROJECT_ENVIRONMENT","decrypt","Error"],"sources":["getWcpProjectEnvironment.ts"],"sourcesContent":["import type { WcpProjectEnvironment } from \"~/types\";\nimport { decrypt } from \"~/encryption\";\n\nexport function getWcpProjectEnvironment(): WcpProjectEnvironment | null {\n if (process.env.WCP_PROJECT_ENVIRONMENT) {\n try {\n return decrypt<WcpProjectEnvironment>(process.env.WCP_PROJECT_ENVIRONMENT);\n } catch {\n throw new Error(\"Could not decrypt WCP_PROJECT_ENVIRONMENT environment variable data.\");\n }\n }\n return null;\n}\n"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEO,SAASC,wBAAwBA,CAAA,EAAiC;EACrE,IAAIC,OAAO,CAACC,GAAG,CAACC,uBAAuB,EAAE;IACrC,IAAI;MACA,OAAO,IAAAC,mBAAO,EAAwBH,OAAO,CAACC,GAAG,CAACC,uBAAuB,CAAC;IAC9E,CAAC,CAAC,MAAM;MACJ,MAAM,IAAIE,KAAK,CAAC,sEAAsE,CAAC;IAC3F;EACJ;EACA,OAAO,IAAI;AACf","ignoreList":[]}
1
+ {"version":3,"file":"getWcpProjectEnvironment.js","sources":["../src/getWcpProjectEnvironment.ts"],"sourcesContent":["import type { WcpProjectEnvironment } from \"./types.js\";\nimport { decrypt } from \"./encryption.js\";\n\nexport function getWcpProjectEnvironment(): WcpProjectEnvironment | null {\n if (process.env.WCP_PROJECT_ENVIRONMENT) {\n try {\n return decrypt<WcpProjectEnvironment>(process.env.WCP_PROJECT_ENVIRONMENT);\n } catch {\n throw new Error(\"Could not decrypt WCP_PROJECT_ENVIRONMENT environment variable data.\");\n }\n }\n return null;\n}\n"],"names":["getWcpProjectEnvironment","process","decrypt","Error"],"mappings":";AAGO,SAASA;IACZ,IAAIC,QAAQ,GAAG,CAAC,uBAAuB,EACnC,IAAI;QACA,OAAOC,QAA+BD,QAAQ,GAAG,CAAC,uBAAuB;IAC7E,EAAE,OAAM;QACJ,MAAM,IAAIE,MAAM;IACpB;IAEJ,OAAO;AACX"}
package/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export * from "./encryption";
2
- export * from "./licenses";
3
- export * from "./urls";
1
+ export * from "./encryption.js";
2
+ export * from "./licenses.js";
3
+ export * from "./urls.js";
4
4
  export * from "./License.js";
5
- export * from "./NullLicense";
6
- export * from "./getWcpProjectEnvironment";
5
+ export * from "./NullLicense.js";
6
+ export * from "./getWcpProjectEnvironment.js";
7
7
  export declare const WCP_FEATURE_LABEL: {
8
8
  seats: string;
9
9
  multiTenancy: string;
@@ -12,4 +12,6 @@ export declare const WCP_FEATURE_LABEL: {
12
12
  auditLogs: string;
13
13
  recordLocking: string;
14
14
  fileManager: string;
15
+ abTesting: string;
16
+ collaboration: string;
15
17
  };
package/index.js CHANGED
@@ -1,92 +1,20 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exportNames = {
7
- WCP_FEATURE_LABEL: true
8
- };
9
- exports.WCP_FEATURE_LABEL = void 0;
10
- var _encryption = require("./encryption");
11
- Object.keys(_encryption).forEach(function (key) {
12
- if (key === "default" || key === "__esModule") return;
13
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
14
- if (key in exports && exports[key] === _encryption[key]) return;
15
- Object.defineProperty(exports, key, {
16
- enumerable: true,
17
- get: function () {
18
- return _encryption[key];
19
- }
20
- });
21
- });
22
- var _licenses = require("./licenses");
23
- Object.keys(_licenses).forEach(function (key) {
24
- if (key === "default" || key === "__esModule") return;
25
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
26
- if (key in exports && exports[key] === _licenses[key]) return;
27
- Object.defineProperty(exports, key, {
28
- enumerable: true,
29
- get: function () {
30
- return _licenses[key];
31
- }
32
- });
33
- });
34
- var _urls = require("./urls");
35
- Object.keys(_urls).forEach(function (key) {
36
- if (key === "default" || key === "__esModule") return;
37
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
38
- if (key in exports && exports[key] === _urls[key]) return;
39
- Object.defineProperty(exports, key, {
40
- enumerable: true,
41
- get: function () {
42
- return _urls[key];
43
- }
44
- });
45
- });
46
- var _License = require("./License.js");
47
- Object.keys(_License).forEach(function (key) {
48
- if (key === "default" || key === "__esModule") return;
49
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
50
- if (key in exports && exports[key] === _License[key]) return;
51
- Object.defineProperty(exports, key, {
52
- enumerable: true,
53
- get: function () {
54
- return _License[key];
55
- }
56
- });
57
- });
58
- var _NullLicense = require("./NullLicense");
59
- Object.keys(_NullLicense).forEach(function (key) {
60
- if (key === "default" || key === "__esModule") return;
61
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
62
- if (key in exports && exports[key] === _NullLicense[key]) return;
63
- Object.defineProperty(exports, key, {
64
- enumerable: true,
65
- get: function () {
66
- return _NullLicense[key];
67
- }
68
- });
69
- });
70
- var _getWcpProjectEnvironment = require("./getWcpProjectEnvironment");
71
- Object.keys(_getWcpProjectEnvironment).forEach(function (key) {
72
- if (key === "default" || key === "__esModule") return;
73
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
74
- if (key in exports && exports[key] === _getWcpProjectEnvironment[key]) return;
75
- Object.defineProperty(exports, key, {
76
- enumerable: true,
77
- get: function () {
78
- return _getWcpProjectEnvironment[key];
79
- }
80
- });
81
- });
82
- const WCP_FEATURE_LABEL = exports.WCP_FEATURE_LABEL = {
83
- seats: "User Seats",
84
- multiTenancy: "Multi-tenancy",
85
- advancedPublishingWorkflow: "Advanced Publishing Workflow (APW)",
86
- advancedAccessControlLayer: "Advanced Access Control Layer (ACL)",
87
- auditLogs: "Audit Logs",
88
- recordLocking: "Record Locking",
89
- fileManager: "File Manager"
1
+ export * from "./encryption.js";
2
+ export * from "./licenses.js";
3
+ export * from "./urls.js";
4
+ export * from "./License.js";
5
+ export * from "./NullLicense.js";
6
+ export * from "./getWcpProjectEnvironment.js";
7
+ const WCP_FEATURE_LABEL = {
8
+ seats: "User Seats",
9
+ multiTenancy: "Multi-tenancy",
10
+ advancedPublishingWorkflow: "Advanced Publishing Workflow (APW)",
11
+ advancedAccessControlLayer: "Advanced Access Control Layer (ACL)",
12
+ auditLogs: "Audit Logs",
13
+ recordLocking: "Record Locking",
14
+ fileManager: "File Manager",
15
+ abTesting: "A/B Testing",
16
+ collaboration: "Collaboration"
90
17
  };
18
+ export { WCP_FEATURE_LABEL };
91
19
 
92
20
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_encryption","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_licenses","_urls","_License","_NullLicense","_getWcpProjectEnvironment","WCP_FEATURE_LABEL","seats","multiTenancy","advancedPublishingWorkflow","advancedAccessControlLayer","auditLogs","recordLocking","fileManager"],"sources":["index.ts"],"sourcesContent":["export * from \"./encryption\";\nexport * from \"./licenses\";\nexport * from \"./urls\";\nexport * from \"./License.js\";\nexport * from \"./NullLicense\";\nexport * from \"./getWcpProjectEnvironment\";\n\nexport const WCP_FEATURE_LABEL = {\n seats: \"User Seats\",\n multiTenancy: \"Multi-tenancy\",\n advancedPublishingWorkflow: \"Advanced Publishing Workflow (APW)\",\n advancedAccessControlLayer: \"Advanced Access Control Layer (ACL)\",\n auditLogs: \"Audit Logs\",\n recordLocking: \"Record Locking\",\n fileManager: \"File Manager\"\n};\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["export * from \"./encryption.js\";\nexport * from \"./licenses.js\";\nexport * from \"./urls.js\";\nexport * from \"./License.js\";\nexport * from \"./NullLicense.js\";\nexport * from \"./getWcpProjectEnvironment.js\";\n\nexport const WCP_FEATURE_LABEL = {\n seats: \"User Seats\",\n multiTenancy: \"Multi-tenancy\",\n advancedPublishingWorkflow: \"Advanced Publishing Workflow (APW)\",\n advancedAccessControlLayer: \"Advanced Access Control Layer (ACL)\",\n auditLogs: \"Audit Logs\",\n recordLocking: \"Record Locking\",\n fileManager: \"File Manager\",\n abTesting: \"A/B Testing\",\n collaboration: \"Collaboration\"\n};\n"],"names":["WCP_FEATURE_LABEL"],"mappings":";;;;;;AAOO,MAAMA,oBAAoB;IAC7B,OAAO;IACP,cAAc;IACd,4BAA4B;IAC5B,4BAA4B;IAC5B,WAAW;IACX,eAAe;IACf,aAAa;IACb,WAAW;IACX,eAAe;AACnB"}
package/licenses.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { DecryptedWcpProjectLicense } from "./types";
1
+ import type { DecryptedWcpProjectLicense } from "./types.js";
2
2
  interface GetWcpProjectLicenseParams {
3
3
  orgId: string;
4
4
  projectId: string;
package/licenses.js CHANGED
@@ -1,55 +1,36 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.getWcpProjectLicense = void 0;
8
- var _nodeFetch = _interopRequireDefault(require("node-fetch"));
9
- var _encryption = require("./encryption");
10
- var _urls = require("./urls");
11
- const fetchWcpProjectLicense = async ({
12
- orgId,
13
- projectId,
14
- projectEnvironmentApiKey
15
- }) => {
16
- // Fetch and decrypt the license.
17
- const getLicenseEndpoint = (0, _urls.getWcpApiUrl)(`/orgs/${orgId}/projects/${projectId}/license`);
18
- const encryptedLicense = await (0, _nodeFetch.default)(getLicenseEndpoint, {
19
- headers: {
20
- authorization: projectEnvironmentApiKey
21
- }
22
- }).then(response => {
23
- if (response.ok) {
24
- return response.json();
25
- }
26
- console.warn(`An error occurred while trying to retrieve the license for project "${orgId}/${projectId}": invalid response status (${response.status}, ${response.statusText})`, response);
27
- return null;
28
- }).catch(e => {
29
- console.warn(`An error occurred while trying to retrieve the license for project "${orgId}/${projectId}": ${e.message}`, e);
30
- return null;
31
- });
32
- return encryptedLicense;
1
+ import { decrypt } from "./encryption.js";
2
+ import { getWcpApiUrl } from "./urls.js";
3
+ const fetchWcpProjectLicense = async ({ orgId, projectId, projectEnvironmentApiKey })=>{
4
+ const getLicenseEndpoint = getWcpApiUrl(`/orgs/${orgId}/projects/${projectId}/license`);
5
+ const encryptedLicense = await fetch(getLicenseEndpoint, {
6
+ headers: {
7
+ authorization: projectEnvironmentApiKey
8
+ }
9
+ }).then((response)=>{
10
+ if (response.ok) return response.json();
11
+ console.warn(`An error occurred while trying to retrieve the license for project "${orgId}/${projectId}": invalid response status (${response.status}, ${response.statusText})`, response);
12
+ return null;
13
+ }).catch((e)=>{
14
+ console.warn(`An error occurred while trying to retrieve the license for project "${orgId}/${projectId}": ${e.message}`, e);
15
+ return null;
16
+ });
17
+ return encryptedLicense;
33
18
  };
34
- const getWcpProjectLicense = async params => {
35
- let encryptedLicense = process.env.WCP_PROJECT_LICENSE;
36
- if (!encryptedLicense) {
37
- const fetchedLicense = await fetchWcpProjectLicense(params);
38
- if (fetchedLicense) {
39
- encryptedLicense = fetchedLicense.license;
19
+ const getWcpProjectLicense = async (params)=>{
20
+ let encryptedLicense = process.env.WCP_PROJECT_LICENSE;
21
+ if (!encryptedLicense) {
22
+ const fetchedLicense = await fetchWcpProjectLicense(params);
23
+ if (fetchedLicense) encryptedLicense = fetchedLicense.license;
24
+ }
25
+ if (!encryptedLicense) return null;
26
+ try {
27
+ return decrypt(encryptedLicense);
28
+ } catch (e) {
29
+ const projectId = `${params.orgId}/${params.projectId}`;
30
+ console.warn(`An error occurred while trying to decrypt the retrieved license for project "${projectId}": ${e.message}`);
31
+ return null;
40
32
  }
41
- }
42
- if (!encryptedLicense) {
43
- return null;
44
- }
45
- try {
46
- return (0, _encryption.decrypt)(encryptedLicense);
47
- } catch (e) {
48
- const projectId = `${params.orgId}/${params.projectId}`;
49
- console.warn(`An error occurred while trying to decrypt the retrieved license for project "${projectId}": ${e.message}`);
50
- return null;
51
- }
52
33
  };
53
- exports.getWcpProjectLicense = getWcpProjectLicense;
34
+ export { getWcpProjectLicense };
54
35
 
55
36
  //# sourceMappingURL=licenses.js.map
package/licenses.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_nodeFetch","_interopRequireDefault","require","_encryption","_urls","fetchWcpProjectLicense","orgId","projectId","projectEnvironmentApiKey","getLicenseEndpoint","getWcpApiUrl","encryptedLicense","fetch","headers","authorization","then","response","ok","json","console","warn","status","statusText","catch","e","message","getWcpProjectLicense","params","process","env","WCP_PROJECT_LICENSE","fetchedLicense","license","decrypt","exports"],"sources":["licenses.ts"],"sourcesContent":["import fetch from \"node-fetch\";\nimport type { DecryptedWcpProjectLicense, EncryptedWcpProjectLicense } from \"./types\";\nimport { decrypt } from \"./encryption\";\nimport { getWcpApiUrl } from \"./urls\";\n\ninterface GetWcpProjectLicenseParams {\n orgId: string;\n projectId: string;\n projectEnvironmentApiKey: string;\n}\n\nconst fetchWcpProjectLicense = async ({\n orgId,\n projectId,\n projectEnvironmentApiKey\n}: GetWcpProjectLicenseParams) => {\n // Fetch and decrypt the license.\n const getLicenseEndpoint = getWcpApiUrl(`/orgs/${orgId}/projects/${projectId}/license`);\n\n const encryptedLicense: { license: EncryptedWcpProjectLicense } | null = await fetch(\n getLicenseEndpoint,\n {\n headers: { authorization: projectEnvironmentApiKey }\n }\n )\n .then(response => {\n if (response.ok) {\n return response.json();\n }\n\n console.warn(\n `An error occurred while trying to retrieve the license for project \"${orgId}/${projectId}\": invalid response status (${response.status}, ${response.statusText})`,\n response\n );\n\n return null;\n })\n .catch(e => {\n console.warn(\n `An error occurred while trying to retrieve the license for project \"${orgId}/${projectId}\": ${e.message}`,\n e\n );\n return null;\n });\n\n return encryptedLicense;\n};\n\nexport const getWcpProjectLicense = async (params: GetWcpProjectLicenseParams) => {\n let encryptedLicense = process.env.WCP_PROJECT_LICENSE;\n if (!encryptedLicense) {\n const fetchedLicense = await fetchWcpProjectLicense(params);\n if (fetchedLicense) {\n encryptedLicense = fetchedLicense.license;\n }\n }\n\n if (!encryptedLicense) {\n return null;\n }\n\n try {\n return decrypt<DecryptedWcpProjectLicense>(encryptedLicense);\n } catch (e) {\n const projectId = `${params.orgId}/${params.projectId}`;\n console.warn(\n `An error occurred while trying to decrypt the retrieved license for project \"${projectId}\": ${e.message}`\n );\n return null;\n }\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAQA,MAAMG,sBAAsB,GAAG,MAAAA,CAAO;EAClCC,KAAK;EACLC,SAAS;EACTC;AACwB,CAAC,KAAK;EAC9B;EACA,MAAMC,kBAAkB,GAAG,IAAAC,kBAAY,EAAC,SAASJ,KAAK,aAAaC,SAAS,UAAU,CAAC;EAEvF,MAAMI,gBAAgE,GAAG,MAAM,IAAAC,kBAAK,EAChFH,kBAAkB,EAClB;IACII,OAAO,EAAE;MAAEC,aAAa,EAAEN;IAAyB;EACvD,CACJ,CAAC,CACIO,IAAI,CAACC,QAAQ,IAAI;IACd,IAAIA,QAAQ,CAACC,EAAE,EAAE;MACb,OAAOD,QAAQ,CAACE,IAAI,CAAC,CAAC;IAC1B;IAEAC,OAAO,CAACC,IAAI,CACR,uEAAuEd,KAAK,IAAIC,SAAS,+BAA+BS,QAAQ,CAACK,MAAM,KAAKL,QAAQ,CAACM,UAAU,GAAG,EAClKN,QACJ,CAAC;IAED,OAAO,IAAI;EACf,CAAC,CAAC,CACDO,KAAK,CAACC,CAAC,IAAI;IACRL,OAAO,CAACC,IAAI,CACR,uEAAuEd,KAAK,IAAIC,SAAS,MAAMiB,CAAC,CAACC,OAAO,EAAE,EAC1GD,CACJ,CAAC;IACD,OAAO,IAAI;EACf,CAAC,CAAC;EAEN,OAAOb,gBAAgB;AAC3B,CAAC;AAEM,MAAMe,oBAAoB,GAAG,MAAOC,MAAkC,IAAK;EAC9E,IAAIhB,gBAAgB,GAAGiB,OAAO,CAACC,GAAG,CAACC,mBAAmB;EACtD,IAAI,CAACnB,gBAAgB,EAAE;IACnB,MAAMoB,cAAc,GAAG,MAAM1B,sBAAsB,CAACsB,MAAM,CAAC;IAC3D,IAAII,cAAc,EAAE;MAChBpB,gBAAgB,GAAGoB,cAAc,CAACC,OAAO;IAC7C;EACJ;EAEA,IAAI,CAACrB,gBAAgB,EAAE;IACnB,OAAO,IAAI;EACf;EAEA,IAAI;IACA,OAAO,IAAAsB,mBAAO,EAA6BtB,gBAAgB,CAAC;EAChE,CAAC,CAAC,OAAOa,CAAC,EAAE;IACR,MAAMjB,SAAS,GAAG,GAAGoB,MAAM,CAACrB,KAAK,IAAIqB,MAAM,CAACpB,SAAS,EAAE;IACvDY,OAAO,CAACC,IAAI,CACR,gFAAgFb,SAAS,MAAMiB,CAAC,CAACC,OAAO,EAC5G,CAAC;IACD,OAAO,IAAI;EACf;AACJ,CAAC;AAACS,OAAA,CAAAR,oBAAA,GAAAA,oBAAA","ignoreList":[]}
1
+ {"version":3,"file":"licenses.js","sources":["../src/licenses.ts"],"sourcesContent":["import type { DecryptedWcpProjectLicense, EncryptedWcpProjectLicense } from \"./types.js\";\nimport { decrypt } from \"./encryption.js\";\nimport { getWcpApiUrl } from \"./urls.js\";\n\ninterface GetWcpProjectLicenseParams {\n orgId: string;\n projectId: string;\n projectEnvironmentApiKey: string;\n}\n\nconst fetchWcpProjectLicense = async ({\n orgId,\n projectId,\n projectEnvironmentApiKey\n}: GetWcpProjectLicenseParams) => {\n // Fetch and decrypt the license.\n const getLicenseEndpoint = getWcpApiUrl(`/orgs/${orgId}/projects/${projectId}/license`);\n\n const encryptedLicense: { license: EncryptedWcpProjectLicense } | null = await fetch(\n getLicenseEndpoint,\n {\n headers: { authorization: projectEnvironmentApiKey }\n }\n )\n .then(response => {\n if (response.ok) {\n return response.json();\n }\n\n console.warn(\n `An error occurred while trying to retrieve the license for project \"${orgId}/${projectId}\": invalid response status (${response.status}, ${response.statusText})`,\n response\n );\n\n return null;\n })\n .catch(e => {\n console.warn(\n `An error occurred while trying to retrieve the license for project \"${orgId}/${projectId}\": ${e.message}`,\n e\n );\n return null;\n });\n\n return encryptedLicense;\n};\n\nexport const getWcpProjectLicense = async (params: GetWcpProjectLicenseParams) => {\n let encryptedLicense = process.env.WCP_PROJECT_LICENSE;\n if (!encryptedLicense) {\n const fetchedLicense = await fetchWcpProjectLicense(params);\n if (fetchedLicense) {\n encryptedLicense = fetchedLicense.license;\n }\n }\n\n if (!encryptedLicense) {\n return null;\n }\n\n try {\n return decrypt<DecryptedWcpProjectLicense>(encryptedLicense);\n } catch (e) {\n const projectId = `${params.orgId}/${params.projectId}`;\n console.warn(\n `An error occurred while trying to decrypt the retrieved license for project \"${projectId}\": ${e.message}`\n );\n return null;\n }\n};\n"],"names":["fetchWcpProjectLicense","orgId","projectId","projectEnvironmentApiKey","getLicenseEndpoint","getWcpApiUrl","encryptedLicense","fetch","response","console","e","getWcpProjectLicense","params","process","fetchedLicense","decrypt"],"mappings":";;AAUA,MAAMA,yBAAyB,OAAO,EAClCC,KAAK,EACLC,SAAS,EACTC,wBAAwB,EACC;IAEzB,MAAMC,qBAAqBC,aAAa,CAAC,MAAM,EAAEJ,MAAM,UAAU,EAAEC,UAAU,QAAQ,CAAC;IAEtF,MAAMI,mBAAmE,MAAMC,MAC3EH,oBACA;QACI,SAAS;YAAE,eAAeD;QAAyB;IACvD,GAEC,IAAI,CAACK,CAAAA;QACF,IAAIA,SAAS,EAAE,EACX,OAAOA,SAAS,IAAI;QAGxBC,QAAQ,IAAI,CACR,CAAC,oEAAoE,EAAER,MAAM,CAAC,EAAEC,UAAU,4BAA4B,EAAEM,SAAS,MAAM,CAAC,EAAE,EAAEA,SAAS,UAAU,CAAC,CAAC,CAAC,EAClKA;QAGJ,OAAO;IACX,GACC,KAAK,CAACE,CAAAA;QACHD,QAAQ,IAAI,CACR,CAAC,oEAAoE,EAAER,MAAM,CAAC,EAAEC,UAAU,GAAG,EAAEQ,EAAE,OAAO,EAAE,EAC1GA;QAEJ,OAAO;IACX;IAEJ,OAAOJ;AACX;AAEO,MAAMK,uBAAuB,OAAOC;IACvC,IAAIN,mBAAmBO,QAAQ,GAAG,CAAC,mBAAmB;IACtD,IAAI,CAACP,kBAAkB;QACnB,MAAMQ,iBAAiB,MAAMd,uBAAuBY;QACpD,IAAIE,gBACAR,mBAAmBQ,eAAe,OAAO;IAEjD;IAEA,IAAI,CAACR,kBACD,OAAO;IAGX,IAAI;QACA,OAAOS,QAAoCT;IAC/C,EAAE,OAAOI,GAAG;QACR,MAAMR,YAAY,GAAGU,OAAO,KAAK,CAAC,CAAC,EAAEA,OAAO,SAAS,EAAE;QACvDH,QAAQ,IAAI,CACR,CAAC,6EAA6E,EAAEP,UAAU,GAAG,EAAEQ,EAAE,OAAO,EAAE;QAE9G,OAAO;IACX;AACJ"}
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@webiny/wcp",
3
- "version": "0.0.0-unstable.eb196ccd2f",
4
- "main": "index.js",
3
+ "version": "0.0.0-unstable.eb81deee7e",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": "./index.js",
7
+ "./*": "./*"
8
+ },
5
9
  "repository": {
6
10
  "type": "git",
7
11
  "url": "https://github.com/webiny/webiny-js.git",
@@ -10,26 +14,20 @@
10
14
  "description": "A set of Webiny Control Panel (WCP)-related utilities.",
11
15
  "author": "Webiny Ltd.",
12
16
  "license": "MIT",
13
- "dependencies": {
14
- "node-fetch": "2.6.7"
15
- },
16
17
  "devDependencies": {
17
- "@webiny/project-utils": "0.0.0-unstable.eb196ccd2f",
18
- "rimraf": "6.0.1",
19
- "typescript": "5.3.3"
18
+ "@webiny/build-tools": "0.0.0-unstable.eb81deee7e",
19
+ "rimraf": "6.1.3",
20
+ "typescript": "7.0.2"
20
21
  },
21
22
  "publishConfig": {
22
- "access": "public",
23
- "directory": "dist"
24
- },
25
- "scripts": {
26
- "watch": "node ../cli/bin.js run watch",
27
- "build": "node ../cli/bin.js run build"
23
+ "access": "public"
28
24
  },
29
25
  "adio": {
30
26
  "ignoreDirs": [
31
27
  "__tests__"
32
28
  ]
33
29
  },
34
- "gitHead": "eb196ccd2f32296e10f7add6dd7220d4e3abece4"
30
+ "webiny": {
31
+ "publishFrom": "dist"
32
+ }
35
33
  }
@@ -1,2 +1,8 @@
1
- import type { DecryptedWcpProjectLicense } from "../types";
2
- export declare const createTestWcpLicense: () => DecryptedWcpProjectLicense;
1
+ import type { DecryptedWcpProjectLicense } from "../types.js";
2
+ interface LicenseOptions {
3
+ recordLocking?: boolean;
4
+ folderLevelPermissions?: boolean;
5
+ hcmsFieldPermissions?: boolean;
6
+ }
7
+ export declare const createTestWcpLicense: (options?: LicenseOptions) => DecryptedWcpProjectLicense;
8
+ export {};
@@ -1,57 +1,61 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createTestWcpLicense = void 0;
7
- var _types = require("../types");
8
- const createTestWcpLicense = () => {
9
- return {
10
- orgId: "org-id",
11
- projectId: "project-id",
12
- package: {
13
- features: {
14
- [_types.PROJECT_PACKAGE_FEATURE_NAME.AACL]: {
15
- enabled: true,
16
- options: {
17
- teams: true,
18
- folderLevelPermissions: true,
19
- privateFiles: true
20
- }
21
- },
22
- [_types.PROJECT_PACKAGE_FEATURE_NAME.MT]: {
23
- enabled: true,
24
- options: {
25
- maxCount: {
26
- type: _types.MT_OPTIONS_MAX_COUNT_TYPE.SEAT_BASED
1
+ import { MT_OPTIONS_MAX_COUNT_TYPE, PROJECT_PACKAGE_FEATURE_NAME } from "../types.js";
2
+ const createTestWcpLicense = (options)=>({
3
+ orgId: "org-id",
4
+ projectId: "project-id",
5
+ package: {
6
+ features: {
7
+ [PROJECT_PACKAGE_FEATURE_NAME.AACL]: {
8
+ enabled: true,
9
+ options: {
10
+ teams: true,
11
+ folderLevelPermissions: options?.folderLevelPermissions ?? true,
12
+ privateFiles: true,
13
+ hcmsFieldPermissions: options?.hcmsFieldPermissions ?? true
14
+ }
15
+ },
16
+ [PROJECT_PACKAGE_FEATURE_NAME.MT]: {
17
+ enabled: true,
18
+ options: {
19
+ maxCount: {
20
+ type: MT_OPTIONS_MAX_COUNT_TYPE.SEAT_BASED
21
+ }
22
+ }
23
+ },
24
+ [PROJECT_PACKAGE_FEATURE_NAME.APW]: {
25
+ enabled: true
26
+ },
27
+ [PROJECT_PACKAGE_FEATURE_NAME.AUDIT_LOGS]: {
28
+ enabled: false
29
+ },
30
+ [PROJECT_PACKAGE_FEATURE_NAME.RECORD_LOCKING]: {
31
+ enabled: options?.recordLocking ?? false
32
+ },
33
+ [PROJECT_PACKAGE_FEATURE_NAME.SEATS]: {
34
+ enabled: true,
35
+ options: {
36
+ maxCount: 100
37
+ }
38
+ },
39
+ [PROJECT_PACKAGE_FEATURE_NAME.FILE_MANAGER]: {
40
+ enabled: false,
41
+ options: {
42
+ threatDetection: false
43
+ }
44
+ },
45
+ [PROJECT_PACKAGE_FEATURE_NAME.AI_POWERUPS]: {
46
+ enabled: false,
47
+ options: {}
48
+ },
49
+ [PROJECT_PACKAGE_FEATURE_NAME.AB_TESTING]: {
50
+ enabled: false
51
+ },
52
+ [PROJECT_PACKAGE_FEATURE_NAME.COLLABORATION]: {
53
+ enabled: false,
54
+ options: {}
55
+ }
27
56
  }
28
- }
29
- },
30
- [_types.PROJECT_PACKAGE_FEATURE_NAME.APW]: {
31
- enabled: false
32
- },
33
- [_types.PROJECT_PACKAGE_FEATURE_NAME.AUDIT_LOGS]: {
34
- enabled: false
35
- },
36
- [_types.PROJECT_PACKAGE_FEATURE_NAME.RECORD_LOCKING]: {
37
- enabled: false
38
- },
39
- [_types.PROJECT_PACKAGE_FEATURE_NAME.SEATS]: {
40
- enabled: true,
41
- options: {
42
- maxCount: 100
43
- }
44
- },
45
- [_types.PROJECT_PACKAGE_FEATURE_NAME.FILE_MANAGER]: {
46
- enabled: false,
47
- options: {
48
- threatDetection: false
49
- }
50
57
  }
51
- }
52
- }
53
- };
54
- };
55
- exports.createTestWcpLicense = createTestWcpLicense;
58
+ });
59
+ export { createTestWcpLicense };
56
60
 
57
61
  //# sourceMappingURL=createTestWcpLicense.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require","createTestWcpLicense","orgId","projectId","package","features","PROJECT_PACKAGE_FEATURE_NAME","AACL","enabled","options","teams","folderLevelPermissions","privateFiles","MT","maxCount","type","MT_OPTIONS_MAX_COUNT_TYPE","SEAT_BASED","APW","AUDIT_LOGS","RECORD_LOCKING","SEATS","FILE_MANAGER","threatDetection","exports"],"sources":["createTestWcpLicense.ts"],"sourcesContent":["import type { DecryptedWcpProjectLicense } from \"~/types\";\nimport { MT_OPTIONS_MAX_COUNT_TYPE, PROJECT_PACKAGE_FEATURE_NAME } from \"~/types\";\n\nexport const createTestWcpLicense = (): DecryptedWcpProjectLicense => {\n return {\n orgId: \"org-id\",\n projectId: \"project-id\",\n package: {\n features: {\n [PROJECT_PACKAGE_FEATURE_NAME.AACL]: {\n enabled: true,\n options: {\n teams: true,\n folderLevelPermissions: true,\n privateFiles: true\n }\n },\n [PROJECT_PACKAGE_FEATURE_NAME.MT]: {\n enabled: true,\n options: {\n maxCount: {\n type: MT_OPTIONS_MAX_COUNT_TYPE.SEAT_BASED\n }\n }\n },\n [PROJECT_PACKAGE_FEATURE_NAME.APW]: {\n enabled: false\n },\n [PROJECT_PACKAGE_FEATURE_NAME.AUDIT_LOGS]: {\n enabled: false\n },\n [PROJECT_PACKAGE_FEATURE_NAME.RECORD_LOCKING]: {\n enabled: false\n },\n [PROJECT_PACKAGE_FEATURE_NAME.SEATS]: {\n enabled: true,\n options: {\n maxCount: 100\n }\n },\n [PROJECT_PACKAGE_FEATURE_NAME.FILE_MANAGER]: {\n enabled: false,\n options: {\n threatDetection: false\n }\n }\n }\n }\n };\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,oBAAoB,GAAGA,CAAA,KAAkC;EAClE,OAAO;IACHC,KAAK,EAAE,QAAQ;IACfC,SAAS,EAAE,YAAY;IACvBC,OAAO,EAAE;MACLC,QAAQ,EAAE;QACN,CAACC,mCAA4B,CAACC,IAAI,GAAG;UACjCC,OAAO,EAAE,IAAI;UACbC,OAAO,EAAE;YACLC,KAAK,EAAE,IAAI;YACXC,sBAAsB,EAAE,IAAI;YAC5BC,YAAY,EAAE;UAClB;QACJ,CAAC;QACD,CAACN,mCAA4B,CAACO,EAAE,GAAG;UAC/BL,OAAO,EAAE,IAAI;UACbC,OAAO,EAAE;YACLK,QAAQ,EAAE;cACNC,IAAI,EAAEC,gCAAyB,CAACC;YACpC;UACJ;QACJ,CAAC;QACD,CAACX,mCAA4B,CAACY,GAAG,GAAG;UAChCV,OAAO,EAAE;QACb,CAAC;QACD,CAACF,mCAA4B,CAACa,UAAU,GAAG;UACvCX,OAAO,EAAE;QACb,CAAC;QACD,CAACF,mCAA4B,CAACc,cAAc,GAAG;UAC3CZ,OAAO,EAAE;QACb,CAAC;QACD,CAACF,mCAA4B,CAACe,KAAK,GAAG;UAClCb,OAAO,EAAE,IAAI;UACbC,OAAO,EAAE;YACLK,QAAQ,EAAE;UACd;QACJ,CAAC;QACD,CAACR,mCAA4B,CAACgB,YAAY,GAAG;UACzCd,OAAO,EAAE,KAAK;UACdC,OAAO,EAAE;YACLc,eAAe,EAAE;UACrB;QACJ;MACJ;IACJ;EACJ,CAAC;AACL,CAAC;AAACC,OAAA,CAAAvB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
1
+ {"version":3,"file":"testing/createTestWcpLicense.js","sources":["../../src/testing/createTestWcpLicense.ts"],"sourcesContent":["import type { DecryptedWcpProjectLicense } from \"~/types.js\";\nimport { MT_OPTIONS_MAX_COUNT_TYPE, PROJECT_PACKAGE_FEATURE_NAME } from \"~/types.js\";\n\ninterface LicenseOptions {\n recordLocking?: boolean;\n folderLevelPermissions?: boolean;\n hcmsFieldPermissions?: boolean;\n}\n\nexport const createTestWcpLicense = (options?: LicenseOptions): DecryptedWcpProjectLicense => {\n return {\n orgId: \"org-id\",\n projectId: \"project-id\",\n package: {\n features: {\n [PROJECT_PACKAGE_FEATURE_NAME.AACL]: {\n enabled: true,\n options: {\n teams: true,\n folderLevelPermissions: options?.folderLevelPermissions ?? true,\n privateFiles: true,\n hcmsFieldPermissions: options?.hcmsFieldPermissions ?? true\n }\n },\n [PROJECT_PACKAGE_FEATURE_NAME.MT]: {\n enabled: true,\n options: {\n maxCount: {\n type: MT_OPTIONS_MAX_COUNT_TYPE.SEAT_BASED\n }\n }\n },\n [PROJECT_PACKAGE_FEATURE_NAME.APW]: {\n enabled: true\n },\n [PROJECT_PACKAGE_FEATURE_NAME.AUDIT_LOGS]: {\n enabled: false\n },\n [PROJECT_PACKAGE_FEATURE_NAME.RECORD_LOCKING]: {\n enabled: options?.recordLocking ?? false\n },\n [PROJECT_PACKAGE_FEATURE_NAME.SEATS]: {\n enabled: true,\n options: {\n maxCount: 100\n }\n },\n [PROJECT_PACKAGE_FEATURE_NAME.FILE_MANAGER]: {\n enabled: false,\n options: {\n threatDetection: false\n }\n },\n [PROJECT_PACKAGE_FEATURE_NAME.AI_POWERUPS]: {\n enabled: false,\n options: {}\n },\n [PROJECT_PACKAGE_FEATURE_NAME.AB_TESTING]: {\n enabled: false\n },\n [PROJECT_PACKAGE_FEATURE_NAME.COLLABORATION]: {\n enabled: false,\n options: {}\n }\n }\n }\n };\n};\n"],"names":["createTestWcpLicense","options","PROJECT_PACKAGE_FEATURE_NAME","MT_OPTIONS_MAX_COUNT_TYPE"],"mappings":";AASO,MAAMA,uBAAuB,CAACC,UAC1B;QACH,OAAO;QACP,WAAW;QACX,SAAS;YACL,UAAU;gBACN,CAACC,6BAA6B,IAAI,CAAC,EAAE;oBACjC,SAAS;oBACT,SAAS;wBACL,OAAO;wBACP,wBAAwBD,SAAS,0BAA0B;wBAC3D,cAAc;wBACd,sBAAsBA,SAAS,wBAAwB;oBAC3D;gBACJ;gBACA,CAACC,6BAA6B,EAAE,CAAC,EAAE;oBAC/B,SAAS;oBACT,SAAS;wBACL,UAAU;4BACN,MAAMC,0BAA0B,UAAU;wBAC9C;oBACJ;gBACJ;gBACA,CAACD,6BAA6B,GAAG,CAAC,EAAE;oBAChC,SAAS;gBACb;gBACA,CAACA,6BAA6B,UAAU,CAAC,EAAE;oBACvC,SAAS;gBACb;gBACA,CAACA,6BAA6B,cAAc,CAAC,EAAE;oBAC3C,SAASD,SAAS,iBAAiB;gBACvC;gBACA,CAACC,6BAA6B,KAAK,CAAC,EAAE;oBAClC,SAAS;oBACT,SAAS;wBACL,UAAU;oBACd;gBACJ;gBACA,CAACA,6BAA6B,YAAY,CAAC,EAAE;oBACzC,SAAS;oBACT,SAAS;wBACL,iBAAiB;oBACrB;gBACJ;gBACA,CAACA,6BAA6B,WAAW,CAAC,EAAE;oBACxC,SAAS;oBACT,SAAS,CAAC;gBACd;gBACA,CAACA,6BAA6B,UAAU,CAAC,EAAE;oBACvC,SAAS;gBACb;gBACA,CAACA,6BAA6B,aAAa,CAAC,EAAE;oBAC1C,SAAS;oBACT,SAAS,CAAC;gBACd;YACJ;QACJ;IACJ"}
package/types.d.ts CHANGED
@@ -1,11 +1,15 @@
1
- import type { WCP_FEATURE_LABEL } from "./index";
1
+ import type { WCP_FEATURE_LABEL } from "./index.js";
2
2
  export interface WcpProject {
3
3
  orgId: string;
4
4
  projectId: string;
5
+ package: {
6
+ features: ProjectPackageFeatures;
7
+ };
5
8
  }
6
9
  export interface ILicense {
7
10
  getRawLicense: () => DecryptedWcpProjectLicense | null;
8
11
  getProject(): WcpProject | null;
12
+ toDto(): DecryptedWcpProjectLicense | null;
9
13
  canUseFeature: (featureId: keyof typeof WCP_FEATURE_LABEL) => boolean;
10
14
  canUseAacl: () => boolean;
11
15
  canUseTeams: () => boolean;
@@ -14,6 +18,22 @@ export interface ILicense {
14
18
  canUseFileManagerThreatDetection: () => boolean;
15
19
  canUseFolderLevelPermissions: () => boolean;
16
20
  canUseRecordLocking: () => boolean;
21
+ canUseWorkflows: () => boolean;
22
+ canUseHcmsFieldPermissions: () => boolean;
23
+ canUseAiImageEnrichment: () => boolean;
24
+ canUseAiPageGeneration: () => boolean;
25
+ canUseAiPageTranslation: () => boolean;
26
+ canUseAiLexicalGeneration: () => boolean;
27
+ canUseAiAdminAssistant: () => boolean;
28
+ canUseAiEntryGeneration: () => boolean;
29
+ canUseAiEntryComparison: () => boolean;
30
+ canUseAiEntryTranslation: () => boolean;
31
+ canUseAbTesting: () => boolean;
32
+ canUseRemoteComponents: () => boolean;
33
+ canUseAiPowerups: () => boolean;
34
+ canUseCollaboration: () => boolean;
35
+ canUseComments: () => boolean;
36
+ canUseActivityLog: () => boolean;
17
37
  }
18
38
  export declare type WcpProjectEnvironment = {
19
39
  id: string;
@@ -33,14 +53,15 @@ export declare enum PROJECT_PACKAGE_FEATURE_NAME {
33
53
  AACL = "advancedAccessControlLayer",
34
54
  /**
35
55
  * @deprecated Use `AUDIT_LOGS` instead.
56
+ * TODO: remove oxlint disable when removing AL enum value.
36
57
  */
37
58
  AL = "auditLogs",
38
- /**
39
- * TODO: remove eslint disable when removing AL enum value.
40
- */
41
59
  AUDIT_LOGS = "auditLogs",
42
60
  RECORD_LOCKING = "recordLocking",
43
- FILE_MANAGER = "fileManager"
61
+ FILE_MANAGER = "fileManager",
62
+ AI_POWERUPS = "aiPowerups",
63
+ AB_TESTING = "abTesting",
64
+ COLLABORATION = "collaboration"
44
65
  }
45
66
  export declare enum MT_OPTIONS_MAX_COUNT_TYPE {
46
67
  SEAT_BASED = "seatBased",
@@ -77,17 +98,45 @@ export interface ProjectPackageFeatures {
77
98
  teams: boolean;
78
99
  privateFiles: boolean;
79
100
  folderLevelPermissions: boolean;
101
+ hcmsFieldPermissions: boolean;
80
102
  };
81
103
  };
82
- [PROJECT_PACKAGE_FEATURE_NAME.AL]: {
83
- enabled: boolean;
84
- };
85
104
  [PROJECT_PACKAGE_FEATURE_NAME.FILE_MANAGER]: {
86
105
  enabled: boolean;
87
106
  options: {
88
107
  threatDetection: boolean;
89
108
  };
90
109
  };
110
+ [PROJECT_PACKAGE_FEATURE_NAME.AI_POWERUPS]: {
111
+ enabled: boolean;
112
+ options: {
113
+ websiteBuilder?: {
114
+ pageGeneration?: boolean;
115
+ pageTranslation?: boolean;
116
+ };
117
+ fileManager?: {
118
+ imageEnrichment?: boolean;
119
+ };
120
+ lexicalGeneration?: boolean;
121
+ adminAssistant?: boolean;
122
+ remoteComponents?: boolean;
123
+ cms?: {
124
+ entryGeneration?: boolean;
125
+ entryComparison?: boolean;
126
+ entryTranslation?: boolean;
127
+ };
128
+ };
129
+ };
130
+ [PROJECT_PACKAGE_FEATURE_NAME.AB_TESTING]: {
131
+ enabled: boolean;
132
+ };
133
+ [PROJECT_PACKAGE_FEATURE_NAME.COLLABORATION]: {
134
+ enabled: boolean;
135
+ options: {
136
+ comments?: boolean;
137
+ activityLog?: boolean;
138
+ };
139
+ };
91
140
  }
92
141
  export interface DecryptedWcpProjectLicense {
93
142
  orgId: string;