@autofleet/element-pay 1.0.4 → 1.1.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/README.md CHANGED
@@ -41,5 +41,5 @@ Returns a typed GraphQL SDK client for the Element Pay API.
41
41
  The SDK is generated from GraphQL schema definitions. To regenerate:
42
42
 
43
43
  ```bash
44
- pnpm codegen --filter @autofleet/element-pay
44
+ npm run codegen
45
45
  ```
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);const u=l.default`
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 d=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
- `,d=l.default`
21
+ `,f=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
- `,f=(e,t,n,r)=>e();function p(e,t=f){return{organizationCreate(n,r,i){return t(t=>e.request({document:u,variables:n,requestHeaders:{...r,...t},signal:i}),`organizationCreate`,`mutation`,n)},entityCreate(n,r,i){return t(t=>e.request({document:d,variables:n,requestHeaders:{...r,...t},signal:i}),`entityCreate`,`mutation`,n)}}}function m(e){return p(new c.GraphQLClient(e.endpoint,{headers:{"x-api-key":e.apiKey,"Content-Type":`application/json`}}))}exports.createElementPayClient=m;
35
+ `,p=(e,t,n,r)=>e();function m(e,t=p){return{organizationCreate(n,r,i){return t(t=>e.request({document:d,variables:n,requestHeaders:{...r,...t},signal:i}),`organizationCreate`,`mutation`,n)},entityCreate(n,r,i){return t(t=>e.request({document:f,variables:n,requestHeaders:{...r,...t},signal:i}),`entityCreate`,`mutation`,n)}}}function h(e){return m(new c.GraphQLClient(e.endpoint,{headers:{"x-api-key":e.apiKey,"Content-Type":`application/json`}}))}const g={EXXON:u.FUEL_BRANDS.EXXONMOBIL,MOBIL:u.FUEL_BRANDS.EXXONMOBIL,SHELL:u.FUEL_BRANDS.SHELL,SUNOCO:u.FUEL_BRANDS.SUNOCO},_=({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:g[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}};exports.createElementPayClient=h,exports.serviceLocationEventToFuelSupplier=_;
36
36
  //# sourceMappingURL=index.cjs.map