@webiny/wcp 5.41.4 → 5.42.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/encryption.js.map +1 -1
- package/licenses.js.map +1 -1
- package/package.json +6 -13
package/encryption.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["encrypt","rawObject","Buffer","from","JSON","stringify","toString","Error","exports","decrypt","encryptedString","decryptedString","parse"],"sources":["encryption.ts"],"sourcesContent":["/**\n * For now, we're not doing actual encryption, just simple base64 encoding/decoding.\n * Potentially, we'll revisit this in the future and implement actual encryption.\n */\n\nexport const encrypt = <T = Record<string, any>>(rawObject: T): string => {\n try {\n return Buffer.from(JSON.stringify(rawObject), \"utf-8\").toString(\"base64\");\n } catch {\n throw new Error(\"Could not encrypt given data.\");\n }\n};\n\nexport const decrypt = <T = Record<string, any>>(encryptedString: string): T => {\n try {\n const decryptedString = Buffer.from(encryptedString, \"base64\").toString(\"utf-8\");\n return JSON.parse(decryptedString) as T;\n } catch {\n throw new Error(`Could not decrypt the given string (${encryptedString}).`);\n }\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;AAEO,MAAMA,OAAO,GAA6BC,SAAY,IAAa;EACtE,IAAI;IACA,OAAOC,MAAM,CAACC,IAAI,CAACC,IAAI,CAACC,SAAS,CAACJ,SAAS,CAAC,EAAE,OAAO,CAAC,CAACK,QAAQ,CAAC,QAAQ,CAAC;EAC7E,CAAC,CAAC,MAAM;IACJ,MAAM,IAAIC,KAAK,CAAC,+BAA+B,CAAC;EACpD;AACJ,CAAC;AAACC,OAAA,CAAAR,OAAA,GAAAA,OAAA;AAEK,MAAMS,OAAO,GAA6BC,eAAuB,IAAQ;EAC5E,IAAI;IACA,MAAMC,eAAe,GAAGT,MAAM,CAACC,IAAI,CAACO,eAAe,EAAE,QAAQ,CAAC,CAACJ,QAAQ,CAAC,OAAO,CAAC;IAChF,OAAOF,IAAI,CAACQ,KAAK,CAACD,eAAe,CAAC;EACtC,CAAC,CAAC,MAAM;IACJ,MAAM,IAAIJ,KAAK,
|
|
1
|
+
{"version":3,"names":["encrypt","rawObject","Buffer","from","JSON","stringify","toString","Error","exports","decrypt","encryptedString","decryptedString","parse"],"sources":["encryption.ts"],"sourcesContent":["/**\n * For now, we're not doing actual encryption, just simple base64 encoding/decoding.\n * Potentially, we'll revisit this in the future and implement actual encryption.\n */\n\nexport const encrypt = <T = Record<string, any>>(rawObject: T): string => {\n try {\n return Buffer.from(JSON.stringify(rawObject), \"utf-8\").toString(\"base64\");\n } catch {\n throw new Error(\"Could not encrypt given data.\");\n }\n};\n\nexport const decrypt = <T = Record<string, any>>(encryptedString: string): T => {\n try {\n const decryptedString = Buffer.from(encryptedString, \"base64\").toString(\"utf-8\");\n return JSON.parse(decryptedString) as T;\n } catch {\n throw new Error(`Could not decrypt the given string (${encryptedString}).`);\n }\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;AAEO,MAAMA,OAAO,GAA6BC,SAAY,IAAa;EACtE,IAAI;IACA,OAAOC,MAAM,CAACC,IAAI,CAACC,IAAI,CAACC,SAAS,CAACJ,SAAS,CAAC,EAAE,OAAO,CAAC,CAACK,QAAQ,CAAC,QAAQ,CAAC;EAC7E,CAAC,CAAC,MAAM;IACJ,MAAM,IAAIC,KAAK,CAAC,+BAA+B,CAAC;EACpD;AACJ,CAAC;AAACC,OAAA,CAAAR,OAAA,GAAAA,OAAA;AAEK,MAAMS,OAAO,GAA6BC,eAAuB,IAAQ;EAC5E,IAAI;IACA,MAAMC,eAAe,GAAGT,MAAM,CAACC,IAAI,CAACO,eAAe,EAAE,QAAQ,CAAC,CAACJ,QAAQ,CAAC,OAAO,CAAC;IAChF,OAAOF,IAAI,CAACQ,KAAK,CAACD,eAAe,CAAC;EACtC,CAAC,CAAC,MAAM;IACJ,MAAM,IAAIJ,KAAK,CAAC,uCAAuCG,eAAe,IAAI,CAAC;EAC/E;AACJ,CAAC;AAACF,OAAA,CAAAC,OAAA,GAAAA,OAAA","ignoreList":[]}
|
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","json","catch","e","console","warn","message","getWcpProjectLicense","params","process","env","WCP_PROJECT_LICENSE","fetchedLicense","license","decrypt","exports"],"sources":["licenses.ts"],"sourcesContent":["import fetch from \"node-fetch\";\nimport { 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 => response.json())\n .catch(e => {\n console.warn(\n `An error occurred while trying to retrieve the license for project \"${orgId}/${projectId}\": ${e.message}`\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,
|
|
1
|
+
{"version":3,"names":["_nodeFetch","_interopRequireDefault","require","_encryption","_urls","fetchWcpProjectLicense","orgId","projectId","projectEnvironmentApiKey","getLicenseEndpoint","getWcpApiUrl","encryptedLicense","fetch","headers","authorization","then","response","json","catch","e","console","warn","message","getWcpProjectLicense","params","process","env","WCP_PROJECT_LICENSE","fetchedLicense","license","decrypt","exports"],"sources":["licenses.ts"],"sourcesContent":["import fetch from \"node-fetch\";\nimport { 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 => response.json())\n .catch(e => {\n console.warn(\n `An error occurred while trying to retrieve the license for project \"${orgId}/${projectId}\": ${e.message}`\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,IAAIA,QAAQ,CAACC,IAAI,CAAC,CAAC,CAAC,CACjCC,KAAK,CAACC,CAAC,IAAI;IACRC,OAAO,CAACC,IAAI,CACR,uEAAuEf,KAAK,IAAIC,SAAS,MAAMY,CAAC,CAACG,OAAO,EAC5G,CAAC;IACD,OAAO,IAAI;EACf,CAAC,CAAC;EAEN,OAAOX,gBAAgB;AAC3B,CAAC;AAEM,MAAMY,oBAAoB,GAAG,MAAOC,MAAkC,IAAK;EAC9E,IAAIb,gBAAgB,GAAGc,OAAO,CAACC,GAAG,CAACC,mBAAmB;EACtD,IAAI,CAAChB,gBAAgB,EAAE;IACnB,MAAMiB,cAAc,GAAG,MAAMvB,sBAAsB,CAACmB,MAAM,CAAC;IAC3D,IAAII,cAAc,EAAE;MAChBjB,gBAAgB,GAAGiB,cAAc,CAACC,OAAO;IAC7C;EACJ;EAEA,IAAI,CAAClB,gBAAgB,EAAE;IACnB,OAAO,IAAI;EACf;EAEA,IAAI;IACA,OAAO,IAAAmB,mBAAO,EAA6BnB,gBAAgB,CAAC;EAChE,CAAC,CAAC,OAAOQ,CAAC,EAAE;IACR,MAAMZ,SAAS,GAAG,GAAGiB,MAAM,CAAClB,KAAK,IAAIkB,MAAM,CAACjB,SAAS,EAAE;IACvDa,OAAO,CAACC,IAAI,CACR,gFAAgFd,SAAS,MAAMY,CAAC,CAACG,OAAO,EAC5G,CAAC;IACD,OAAO,IAAI;EACf;AACJ,CAAC;AAACS,OAAA,CAAAR,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/wcp",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.42.0-beta.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,19 +11,12 @@
|
|
|
11
11
|
"author": "Webiny Ltd.",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"
|
|
15
|
-
"node-fetch": "2.7.0"
|
|
14
|
+
"node-fetch": "2.6.7"
|
|
16
15
|
},
|
|
17
16
|
"devDependencies": {
|
|
18
|
-
"@
|
|
19
|
-
"@
|
|
20
|
-
"
|
|
21
|
-
"@babel/plugin-transform-runtime": "7.24.3",
|
|
22
|
-
"@babel/preset-env": "7.24.3",
|
|
23
|
-
"@babel/preset-typescript": "7.24.1",
|
|
24
|
-
"@webiny/cli": "5.41.4",
|
|
25
|
-
"@webiny/project-utils": "5.41.4",
|
|
26
|
-
"rimraf": "5.0.5",
|
|
17
|
+
"@webiny/cli": "5.42.0-beta.0",
|
|
18
|
+
"@webiny/project-utils": "5.42.0-beta.0",
|
|
19
|
+
"rimraf": "6.0.1",
|
|
27
20
|
"ttypescript": "1.5.15",
|
|
28
21
|
"typescript": "4.9.5"
|
|
29
22
|
},
|
|
@@ -40,5 +33,5 @@
|
|
|
40
33
|
"__tests__"
|
|
41
34
|
]
|
|
42
35
|
},
|
|
43
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "ebf90f62ed3f28114ffdb012b7e5f80988af53d3"
|
|
44
37
|
}
|