UNPKG

@adyen/adyen-salesforce-pwa

Version:

This NPM package enables you to go live fast with payments with Adyen as a payment service provider when building your Salesforce PWA Retail application.

3 lines 16.8 kB
#!/usr/bin/env node /*! For license information please see get-env.js.LICENSE.txt */ (()=>{var e={3965(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var o=["projectID","environmentID"];function i(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function s(r,n,o,i){var s=n&&n.prototype instanceof u?n:u,p=Object.create(s.prototype);return c(p,"_invoke",function(r,n,o){var i,c,s,u=0,p=o||[],f=!1,l={p:0,n:0,v:e,a:v,f:v.bind(e,4),d:function(t,r){return i=t,c=0,s=e,l.n=r,a}};function v(r,n){for(c=r,s=n,t=0;!f&&u&&!o&&t<p.length;t++){var o,i=p[t],v=l.p,d=i[2];r>3?(o=d===n)&&(s=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=v&&((o=r<2&&v<i[1])?(c=0,l.v=n,l.n=i[1]):v<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,l.n=d,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,p,d){if(u>1)throw TypeError("Generator is already running");for(f&&1===p&&v(p,d),c=p,s=d;(t=c<2?e:s)||!f;){i||(c?c<3?(c>1&&(l.n=-1),v(c,s)):l.n=s:l.v=s);try{if(u=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(f=l.n<0)?s:r.call(n,l))!==a)break}catch(t){i=e,c=1,s=t}finally{u=1}}return{value:t,done:f}}}(r,o,i),!0),p}var a={};function u(){}function p(){}function f(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(c(t={},n,function(){return this}),t),v=f.prototype=u.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,c(e,o,"GeneratorFunction")),e.prototype=Object.create(v),e}return p.prototype=f,c(v,"constructor",f),c(f,"constructor",p),p.displayName="GeneratorFunction",c(f,o,"GeneratorFunction"),c(v),c(v,o,"Generator"),c(v,n,function(){return this}),c(v,"toString",function(){return"[object Generator]"}),(i=function(){return{w:s,m:d}})()}function c(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}c=function(e,t,r,n){function i(t,r){c(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},c(e,t,r,n)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach(function(t){u(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function u(e,t,r){return(t=v(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e,t,r,n,o,i,c){try{var s=e[i](c),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,o)}function f(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function c(e){p(i,n,o,c,s,"next",e)}function s(e){p(i,n,o,c,s,"throw",e)}c(void 0)})}}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,v(n.key),n)}}function v(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}function d(e,t,r){return t=h(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,y()?Reflect.construct(t,r||[],h(e).constructor):t.apply(e,r))}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function(){return!!e})()}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}var g=function(e){function t(e){var r,n=e.projectID,i=e.environmentID,c=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,o);if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=d(this,t,[c]),!n)throw new Error("projectID is not defined in .env file");if(!i)throw new Error("environmentID is not defined in .env file");return r.projectID=n,r.environmentID=i,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}(t,e),r=t,n=[{key:"pushEnv",value:(s=f(i().m(function e(t){var r,n,o,c,s,u,p;return i().w(function(e){for(;;)switch(e.n){case 0:return r="api/projects/".concat(this.projectID,"/target/").concat(this.environmentID,"/env-var/"),(n=new URL(this.opts.origin)).pathname=r,s=a,u=a,p={},e.n=1,this.getHeaders();case 1:return o=s(u(p,e.v),{},{"Content-Type":"application/json",Accept:"application/json"}),e.n=2,this.opts.fetch(n.toString(),{env:t,method:"PATCH",headers:o});case 2:return c=e.v,e.n=3,this.throwForStatus(c);case 3:return e.a(2,c)}},e,this)})),function(e){return s.apply(this,arguments)})},{key:"getEnv",value:(c=f(i().m(function e(){var t,r,n,o,c,s,u;return i().w(function(e){for(;;)switch(e.n){case 0:return t="api/projects/".concat(this.projectID,"/target/").concat(this.environmentID,"/env-var/"),(r=new URL(this.opts.origin)).pathname=t,c=a,s=a,u={},e.n=1,this.getHeaders();case 1:return n=c(s(u,e.v),{},{Accept:"application/json"}),e.n=2,this.opts.fetch(r.toString(),{method:"GET",headers:n});case 2:return o=e.v,e.n=3,this.throwForStatus(o);case 3:return e.n=4,o.json();case 4:return e.a(2,e.v)}},e,this)})),function(){return c.apply(this,arguments)})}],n&&l(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,c,s}(r(2168).CloudAPIClient);e.exports.CloudAPIClientCustom=g},998(e,t,r){const n=r(9896),o=r(6928),i=r(857),c=r(6982),s=r(56).version,a=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;function u(e){console.log(`[dotenv@${s}][DEBUG] ${e}`)}function p(e){console.log(`[dotenv@${s}] ${e}`)}function f(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function l(e,t){let r;try{r=new URL(t)}catch(e){if("ERR_INVALID_URL"===e.code){const e=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw e.code="INVALID_DOTENV_KEY",e}throw e}const n=r.password;if(!n){const e=new Error("INVALID_DOTENV_KEY: Missing key part");throw e.code="INVALID_DOTENV_KEY",e}const o=r.searchParams.get("environment");if(!o){const e=new Error("INVALID_DOTENV_KEY: Missing environment part");throw e.code="INVALID_DOTENV_KEY",e}const i=`DOTENV_VAULT_${o.toUpperCase()}`,c=e.parsed[i];if(!c){const e=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${i} in your .env.vault file.`);throw e.code="NOT_FOUND_DOTENV_ENVIRONMENT",e}return{ciphertext:c,key:n}}function v(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(const r of e.path)n.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=o.resolve(process.cwd(),".env.vault");return n.existsSync(t)?t:null}function d(e){return"~"===e[0]?o.join(i.homedir(),e.slice(1)):e}const y={configDotenv:function(e){const t=o.resolve(process.cwd(),".env");let r="utf8";const i=Boolean(e&&e.debug),c=!e||!("quiet"in e)||e.quiet;e&&e.encoding?r=e.encoding:i&&u("No encoding is specified. UTF-8 is used by default");let s,a=[t];if(e&&e.path)if(Array.isArray(e.path)){a=[];for(const t of e.path)a.push(d(t))}else a=[d(e.path)];const f={};for(const t of a)try{const o=y.parse(n.readFileSync(t,{encoding:r}));y.populate(f,o,e)}catch(e){i&&u(`Failed to load ${t} ${e.message}`),s=e}let l=process.env;if(e&&null!=e.processEnv&&(l=e.processEnv),y.populate(l,f,e),i||!c){const e=Object.keys(f).length,t=[];for(const e of a)try{const r=o.relative(process.cwd(),e);t.push(r)}catch(t){i&&u(`Failed to load ${e} ${t.message}`),s=t}p(`injecting env (${e}) from ${t.join(",")}`)}return s?{parsed:f,error:s}:{parsed:f}},_configVault:function(e){const t=Boolean(e&&e.debug),r=!e||!("quiet"in e)||e.quiet;!t&&r||p("Loading env from encrypted .env.vault");const n=y._parseVault(e);let o=process.env;return e&&null!=e.processEnv&&(o=e.processEnv),y.populate(o,n,e),{parsed:n}},_parseVault:function(e){const t=v(e=e||{});e.path=t;const r=y.configDotenv(e);if(!r.parsed){const e=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw e.code="MISSING_DATA",e}const n=f(e).split(","),o=n.length;let i;for(let e=0;e<o;e++)try{const t=l(r,n[e].trim());i=y.decrypt(t.ciphertext,t.key);break}catch(t){if(e+1>=o)throw t}return y.parse(i)},config:function(e){if(0===f(e).length)return y.configDotenv(e);const t=v(e);return t?y._configVault(e):(r=`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`,console.log(`[dotenv@${s}][WARN] ${r}`),y.configDotenv(e));var r},decrypt:function(e,t){const r=Buffer.from(t.slice(-64),"hex");let n=Buffer.from(e,"base64");const o=n.subarray(0,12),i=n.subarray(-16);n=n.subarray(12,-16);try{const e=c.createDecipheriv("aes-256-gcm",r,o);return e.setAuthTag(i),`${e.update(n)}${e.final()}`}catch(e){const t=e instanceof RangeError,r="Invalid key length"===e.message,n="Unsupported state or unable to authenticate data"===e.message;if(t||r){const e=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw e.code="INVALID_DOTENV_KEY",e}if(n){const e=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw e.code="DECRYPTION_FAILED",e}throw e}},parse:function(e){const t={};let r,n=e.toString();for(n=n.replace(/\r\n?/gm,"\n");null!=(r=a.exec(n));){const e=r[1];let n=r[2]||"";n=n.trim();const o=n[0];n=n.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),'"'===o&&(n=n.replace(/\\n/g,"\n"),n=n.replace(/\\r/g,"\r")),t[e]=n}return t},populate:function(e,t,r={}){const n=Boolean(r&&r.debug),o=Boolean(r&&r.override);if("object"!=typeof t){const e=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw e.code="OBJECT_REQUIRED",e}for(const r of Object.keys(t))Object.prototype.hasOwnProperty.call(e,r)?(!0===o&&(e[r]=t[r]),n&&u(!0===o?`"${r}" is already defined and WAS overwritten`:`"${r}" is already defined and was NOT overwritten`)):e[r]=t[r]}};e.exports.configDotenv=y.configDotenv,e.exports._configVault=y._configVault,e.exports._parseVault=y._parseVault,e.exports.config=y.config,e.exports.decrypt=y.decrypt,e.exports.parse=y.parse,e.exports.populate=y.populate,e.exports=y},2168(e){"use strict";e.exports=require("@salesforce/pwa-kit-dev/utils/script-utils")},6982(e){"use strict";e.exports=require("crypto")},9896(e){"use strict";e.exports=require("fs")},857(e){"use strict";e.exports=require("os")},6928(e){"use strict";e.exports=require("path")},56(e){"use strict";e.exports=JSON.parse('{"name":"dotenv","version":"16.6.1","description":"Loads environment variables from .env file","main":"lib/main.js","types":"lib/main.d.ts","exports":{".":{"types":"./lib/main.d.ts","require":"./lib/main.js","default":"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},"scripts":{"dts-check":"tsc --project tests/types/tsconfig.json","lint":"standard","pretest":"npm run lint && npm run dts-check","test":"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov","prerelease":"npm test","release":"standard-version"},"repository":{"type":"git","url":"git://github.com/motdotla/dotenv.git"},"homepage":"https://github.com/motdotla/dotenv#readme","funding":"https://dotenvx.com","keywords":["dotenv","env",".env","environment","variables","config","settings"],"readmeFilename":"README.md","license":"BSD-2-Clause","devDependencies":{"@types/node":"^18.11.3","decache":"^4.6.2","sinon":"^14.0.1","standard":"^17.0.0","standard-version":"^9.5.0","tap":"^19.2.0","typescript":"^4.8.4"},"engines":{"node":">=12"},"browser":{"fs":false}}')}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}var n={};for(var o in(()=>{"use strict";function e(){var r,n,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.toStringTag||"@@toStringTag";function s(e,o,i,c){var s=o&&o.prototype instanceof u?o:u,p=Object.create(s.prototype);return t(p,"_invoke",function(e,t,o){var i,c,s,u=0,p=o||[],f=!1,l={p:0,n:0,v:r,a:v,f:v.bind(r,4),d:function(e,t){return i=e,c=0,s=r,l.n=t,a}};function v(e,t){for(c=e,s=t,n=0;!f&&u&&!o&&n<p.length;n++){var o,i=p[n],v=l.p,d=i[2];e>3?(o=d===t)&&(s=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=r):i[0]<=v&&((o=e<2&&v<i[1])?(c=0,l.v=t,l.n=i[1]):v<d&&(o=e<3||i[0]>t||t>d)&&(i[4]=e,i[5]=t,l.n=d,c=0))}if(o||e>1)return a;throw f=!0,t}return function(o,p,d){if(u>1)throw TypeError("Generator is already running");for(f&&1===p&&v(p,d),c=p,s=d;(n=c<2?r:s)||!f;){i||(c?c<3?(c>1&&(l.n=-1),v(c,s)):l.n=s:l.v=s);try{if(u=2,i){if(c||(o="next"),n=i[o]){if(!(n=n.call(i,s)))throw TypeError("iterator result is not an object");if(!n.done)return n;s=n.value,c<2&&(c=0)}else 1===c&&(n=i.return)&&n.call(i),c<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=r}else if((n=(f=l.n<0)?s:e.call(t,l))!==a)break}catch(e){i=r,c=1,s=e}finally{u=1}}return{value:n,done:f}}}(e,i,c),!0),p}var a={};function u(){}function p(){}function f(){}n=Object.getPrototypeOf;var l=[][i]?n(n([][i]())):(t(n={},i,function(){return this}),n),v=f.prototype=u.prototype=Object.create(l);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,t(e,c,"GeneratorFunction")),e.prototype=Object.create(v),e}return p.prototype=f,t(v,"constructor",f),t(f,"constructor",p),p.displayName="GeneratorFunction",t(f,c,"GeneratorFunction"),t(v),t(v,c,"Generator"),t(v,i,function(){return this}),t(v,"toString",function(){return"[object Generator]"}),(e=function(){return{w:s,m:d}})()}function t(e,r,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}t=function(e,r,n,o){function c(r,n){t(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n:(c("next",0),c("throw",1),c("return",2))},t(e,r,n,o)}function n(e,t,r,n,o,i,c){try{var s=e[i](c),a=s.value}catch(e){return void r(e)}s.done?t(a):Promise.resolve(a).then(n,o)}var o,i=r(2168),c=i.readCredentials,s=i.DEFAULT_CLOUD_ORIGIN,a=i.getCredentialsFile,u=r(3965).CloudAPIClientCustom,p=r(998);(o=e().m(function t(){var r,n,o,i,f,l;return e().w(function(e){for(;;)switch(e.n){case 0:if(!(r=p.config()).error){e.n=1;break}throw r.error;case 1:return n=r.parsed,e.n=2,c(a(s));case 2:return o=e.v,i={credentials:o,projectID:n.PROJECT_ID,environmentID:n.ENVIRONMENT_ID},f=new u(i),e.n=3,f.getEnv();case 3:((l=e.v).warnings||[]).forEach(function(e){return console.log(e)}),console.log("env vars fetched!",l);case 4:return e.a(2)}},t)}),function(){var e=this,t=arguments;return new Promise(function(r,i){var c=o.apply(e,t);function s(e){n(c,r,i,s,a,"next",e)}function a(e){n(c,r,i,s,a,"throw",e)}s(void 0)})})()})(),n)exports[o]=n[o];Object.defineProperty(exports,"__esModule",{value:!0})})();