@autofleet/element-pay 1.1.0 → 1.1.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/lib/index.cjs +3 -3
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +4 -1
- package/lib/index.d.ts +4 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`graphql-request`),l=require(`graphql-tag`);l=s(l);let u=require(`@autofleet/common-types/lib/pit-stop`);const
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`graphql-request`),l=require(`graphql-tag`);l=s(l);let u=require(`@msgpack/msgpack`),d=require(`@autofleet/common-types/lib/pit-stop`);const f=l.default`
|
|
2
2
|
mutation organizationCreate($input: OrganizationCreateInput!) {
|
|
3
3
|
organizationCreate(input: $input) {
|
|
4
4
|
id
|
|
@@ -18,7 +18,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
18
18
|
deletedAt
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
`,
|
|
21
|
+
`,p=l.default`
|
|
22
22
|
mutation entityCreate($input: EntityCreateInput!) {
|
|
23
23
|
entityCreate(input: $input) {
|
|
24
24
|
id
|
|
@@ -32,5 +32,5 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
32
32
|
updatedAt
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
`,
|
|
35
|
+
`,m=(e,t,n,r)=>e();function h(e,t=m){return{organizationCreate(n,r,i){return t(t=>e.request({document:f,variables:n,requestHeaders:{...r,...t},signal:i}),`organizationCreate`,`mutation`,n)},entityCreate(n,r,i){return t(t=>e.request({document:p,variables:n,requestHeaders:{...r,...t},signal:i}),`entityCreate`,`mutation`,n)}}}function g(e){return h(new c.GraphQLClient(e.endpoint,{headers:{"x-api-key":e.apiKey,"Content-Type":`application/json`}}))}const _=e=>(0,u.decode)(Buffer.from(e,`base64`)),v=e=>{let t=_(e);if(Buffer.isBuffer(t.ID)&&(t.ID=t.ID.toString(`hex`)),Buffer.isBuffer(t.ServiceLocation)){let e=t.ServiceLocation.toString(`utf8`);t.ServiceLocation=JSON.parse(e)}return t},y={EXXON:d.FUEL_BRANDS.EXXONMOBIL,MOBIL:d.FUEL_BRANDS.EXXONMOBIL,SHELL:d.FUEL_BRANDS.SHELL,SUNOCO:d.FUEL_BRANDS.SUNOCO},b=({serviceLocationEvent:e})=>{let t=e.ServiceLocation,{address:n,geocoded:r}=t;return{acceptElementPay:!0,address:[n.line1,n.line2,n.city,n.state,n.zip].filter(Boolean).join(`, `),externalId:t.id,name:t.name,brandName:y[t.provider.name]||null,lat:r.lat,lng:r.lng,directPayEnabled:!t.out_of_network,ttpEnabled:t.ttp_enabled,isActive:t.enabled&&!t.deleted_at}},x=e=>b({serviceLocationEvent:v(e)});exports.createElementPayClient=g,exports.serviceLocationPubSubMessageToFuelSupplier=x;
|
|
36
36
|
//# sourceMappingURL=index.cjs.map
|