@autofleet/element-pay 1.1.3 → 2.0.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/README.md +94 -24
- package/lib/index.cjs +23 -205
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +142 -672
- package/lib/index.d.ts +142 -672
- package/lib/index.js +23 -205
- package/lib/index.js.map +1 -1
- package/package.json +3 -4
package/lib/index.js
CHANGED
|
@@ -5,6 +5,17 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
`,a=t`
|
|
8
|
+
mutation clientOnboard($input: ClientOnboardInput!) {
|
|
9
|
+
clientOnboard(input: $input) {
|
|
10
|
+
id
|
|
11
|
+
name
|
|
12
|
+
externalId
|
|
13
|
+
insertedAt
|
|
14
|
+
updatedAt
|
|
15
|
+
deletedAt
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`,o=t`
|
|
8
19
|
mutation organizationCreate($input: OrganizationCreateInput!) {
|
|
9
20
|
organizationCreate(input: $input) {
|
|
10
21
|
id
|
|
@@ -24,7 +35,7 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
24
35
|
deletedAt
|
|
25
36
|
}
|
|
26
37
|
}
|
|
27
|
-
`,
|
|
38
|
+
`,s=t`
|
|
28
39
|
mutation entityCreate($input: EntityCreateInput!) {
|
|
29
40
|
entityCreate(input: $input) {
|
|
30
41
|
id
|
|
@@ -37,17 +48,6 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
37
48
|
insertedAt
|
|
38
49
|
updatedAt
|
|
39
50
|
}
|
|
40
|
-
}
|
|
41
|
-
`,s=t`
|
|
42
|
-
mutation clientOnboard($input: ClientOnboardInput!) {
|
|
43
|
-
clientOnboard(input: $input) {
|
|
44
|
-
id
|
|
45
|
-
name
|
|
46
|
-
externalId
|
|
47
|
-
insertedAt
|
|
48
|
-
updatedAt
|
|
49
|
-
deletedAt
|
|
50
|
-
}
|
|
51
51
|
}
|
|
52
52
|
`,c=t`
|
|
53
53
|
query entityGetExternalId($externalId: String) {
|
|
@@ -98,49 +98,6 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
`,u=t`
|
|
101
|
-
mutation provisionCard($input: ProvisionCardInput!) {
|
|
102
|
-
provisionCard(input: $input) {
|
|
103
|
-
encryptedData
|
|
104
|
-
activationData
|
|
105
|
-
publicKey
|
|
106
|
-
lastFourDigits
|
|
107
|
-
displayName
|
|
108
|
-
cardNetwork
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
`,d=t`
|
|
112
|
-
mutation provisionStatusUpdate($input: ProvisionStatusUpdateInput!) {
|
|
113
|
-
provisionStatusUpdate(input: $input) {
|
|
114
|
-
success
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
`,f=t`
|
|
118
|
-
mutation servicePay($input: ServicePayInput!) {
|
|
119
|
-
servicePay(input: $input) {
|
|
120
|
-
requestId
|
|
121
|
-
transactionId
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
`,p=t`
|
|
125
|
-
mutation ttpTokenization($input: TtpTokenizationInput!) {
|
|
126
|
-
ttpTokenization(input: $input) {
|
|
127
|
-
requestId
|
|
128
|
-
success
|
|
129
|
-
paymentProviderAccountId
|
|
130
|
-
deviceAccountId
|
|
131
|
-
programSupports {
|
|
132
|
-
isCloseLoopSupported
|
|
133
|
-
isDcSupported
|
|
134
|
-
isPhysicalCardSupported
|
|
135
|
-
isTtpSupported
|
|
136
|
-
isUsingInternalProgram
|
|
137
|
-
}
|
|
138
|
-
lastFourDigits
|
|
139
|
-
displayName
|
|
140
|
-
cardFlag
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
`,m=t`
|
|
144
101
|
mutation userCreate($input: UserCreateInput!) {
|
|
145
102
|
userCreate(input: $input) {
|
|
146
103
|
id
|
|
@@ -160,7 +117,7 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
160
117
|
updatedAt
|
|
161
118
|
}
|
|
162
119
|
}
|
|
163
|
-
`,
|
|
120
|
+
`,d=t`
|
|
164
121
|
mutation vehicleGroupCreate($input: VehicleGroupCreateInput!) {
|
|
165
122
|
vehicleGroupCreate(input: $input) {
|
|
166
123
|
id
|
|
@@ -174,7 +131,7 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
174
131
|
updatedAt
|
|
175
132
|
}
|
|
176
133
|
}
|
|
177
|
-
`,
|
|
134
|
+
`,f=t`
|
|
178
135
|
mutation vehicleGroupDriversAdd($input: VehicleGroupDriversAddInput!) {
|
|
179
136
|
vehicleGroupDriversAdd(input: $input) {
|
|
180
137
|
id
|
|
@@ -187,7 +144,7 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
187
144
|
updatedAt
|
|
188
145
|
}
|
|
189
146
|
}
|
|
190
|
-
`,
|
|
147
|
+
`,p=t`
|
|
191
148
|
mutation vehicleGroupVehiclesAdd($input: VehicleGroupVehiclesAddInput!) {
|
|
192
149
|
vehicleGroupVehiclesAdd(input: $input) {
|
|
193
150
|
id
|
|
@@ -200,11 +157,11 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
200
157
|
updatedAt
|
|
201
158
|
}
|
|
202
159
|
}
|
|
203
|
-
`,
|
|
160
|
+
`,m=t`
|
|
204
161
|
mutation vehicleUpdate($input: VehicleUpdateInput!) {
|
|
205
162
|
vehicleUpdate(input: $input)
|
|
206
163
|
}
|
|
207
|
-
`,
|
|
164
|
+
`,h=t`
|
|
208
165
|
query vehicleGroupsFilter($input: VehicleGroupsFilterInput!) {
|
|
209
166
|
vehicleGroupsFilter(input: $input) {
|
|
210
167
|
data {
|
|
@@ -220,7 +177,7 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
220
177
|
}
|
|
221
178
|
}
|
|
222
179
|
}
|
|
223
|
-
`,
|
|
180
|
+
`,g=t`
|
|
224
181
|
mutation vehiclesOnboard($input: VehiclesOnboardInputList!) {
|
|
225
182
|
vehiclesOnboard(input: $input) {
|
|
226
183
|
vehicles {
|
|
@@ -232,54 +189,7 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
232
189
|
}
|
|
233
190
|
}
|
|
234
191
|
}
|
|
235
|
-
`,
|
|
236
|
-
mutation apiKeyCreate($input: ApiKeyCreateInput!) {
|
|
237
|
-
apiKeyCreate(input: $input) {
|
|
238
|
-
apiKey
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
`,w=t`
|
|
242
|
-
mutation organizationCreate($input: OrganizationCreateInput!) {
|
|
243
|
-
organizationCreate(input: $input) {
|
|
244
|
-
id
|
|
245
|
-
name
|
|
246
|
-
address {
|
|
247
|
-
line1
|
|
248
|
-
line2
|
|
249
|
-
city
|
|
250
|
-
state
|
|
251
|
-
country
|
|
252
|
-
zip
|
|
253
|
-
}
|
|
254
|
-
onboardedAt
|
|
255
|
-
onboardedBy
|
|
256
|
-
insertedAt
|
|
257
|
-
updatedAt
|
|
258
|
-
deletedAt
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
`,T=t`
|
|
262
|
-
mutation entityCreate($input: EntityCreateInput!) {
|
|
263
|
-
entityCreate(input: $input) {
|
|
264
|
-
id
|
|
265
|
-
name
|
|
266
|
-
description
|
|
267
|
-
externalId
|
|
268
|
-
parentId
|
|
269
|
-
hasFinance
|
|
270
|
-
funding
|
|
271
|
-
insertedAt
|
|
272
|
-
updatedAt
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
`,E=t`
|
|
276
|
-
mutation machineTokenizeUser($input: MachineTokenizeUserInput) {
|
|
277
|
-
machineTokenizeUser(input: $input) {
|
|
278
|
-
access_token
|
|
279
|
-
expires_in
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
`,D=t`
|
|
192
|
+
`,_=(e,t,n,r)=>e();function v(e,t=_){return{apiKeyCreate(n,r,a){return t(t=>e.request({document:i,variables:n,requestHeaders:{...r,...t},signal:a}),`apiKeyCreate`,`mutation`,n)},clientOnboard(n,r,i){return t(t=>e.request({document:a,variables:n,requestHeaders:{...r,...t},signal:i}),`clientOnboard`,`mutation`,n)},organizationCreate(n,r,i){return t(t=>e.request({document:o,variables:n,requestHeaders:{...r,...t},signal:i}),`organizationCreate`,`mutation`,n)},entityCreate(n,r,i){return t(t=>e.request({document:s,variables:n,requestHeaders:{...r,...t},signal:i}),`entityCreate`,`mutation`,n)},entityGetExternalId(n,r,i){return t(t=>e.request({document:c,variables:n,requestHeaders:{...r,...t},signal:i}),`entityGetExternalId`,`query`,n)},machineTokenizeUser(n,r,i){return t(t=>e.request({document:l,variables:n,requestHeaders:{...r,...t},signal:i}),`machineTokenizeUser`,`mutation`,n)},userCreate(n,r,i){return t(t=>e.request({document:u,variables:n,requestHeaders:{...r,...t},signal:i}),`userCreate`,`mutation`,n)},vehicleGroupCreate(n,r,i){return t(t=>e.request({document:d,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupCreate`,`mutation`,n)},vehicleGroupDriversAdd(n,r,i){return t(t=>e.request({document:f,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupDriversAdd`,`mutation`,n)},vehicleGroupVehiclesAdd(n,r,i){return t(t=>e.request({document:p,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupVehiclesAdd`,`mutation`,n)},vehicleUpdate(n,r,i){return t(t=>e.request({document:m,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleUpdate`,`mutation`,n)},vehicleGroupsFilter(n,r,i){return t(t=>e.request({document:h,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupsFilter`,`query`,n)},vehiclesOnboard(n,r,i){return t(t=>e.request({document:g,variables:n,requestHeaders:{...r,...t},signal:i}),`vehiclesOnboard`,`mutation`,n)}}}const y={int:`https://api-gateway.int.gocariq.com/`,stage:`https://api-gateway.stage.gocariq.com/`};function b(t){let n=t.environment??`stage`;return v(new e(t.endpoint??y[n],{headers:{"x-api-key":t.apiKey,"Content-Type":`application/json`}}))}const x=t`
|
|
283
193
|
mutation provisionCard($input: ProvisionCardInput!) {
|
|
284
194
|
provisionCard(input: $input) {
|
|
285
195
|
encryptedData
|
|
@@ -290,20 +200,20 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
290
200
|
cardNetwork
|
|
291
201
|
}
|
|
292
202
|
}
|
|
293
|
-
`,
|
|
203
|
+
`,S=t`
|
|
294
204
|
mutation provisionStatusUpdate($input: ProvisionStatusUpdateInput!) {
|
|
295
205
|
provisionStatusUpdate(input: $input) {
|
|
296
206
|
success
|
|
297
207
|
}
|
|
298
208
|
}
|
|
299
|
-
`,
|
|
209
|
+
`,C=t`
|
|
300
210
|
mutation servicePay($input: ServicePayInput!) {
|
|
301
211
|
servicePay(input: $input) {
|
|
302
212
|
requestId
|
|
303
213
|
transactionId
|
|
304
214
|
}
|
|
305
215
|
}
|
|
306
|
-
`,
|
|
216
|
+
`,w=t`
|
|
307
217
|
mutation ttpTokenization($input: TtpTokenizationInput!) {
|
|
308
218
|
ttpTokenization(input: $input) {
|
|
309
219
|
requestId
|
|
@@ -322,97 +232,5 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
322
232
|
cardFlag
|
|
323
233
|
}
|
|
324
234
|
}
|
|
325
|
-
`,j=t`
|
|
326
|
-
mutation userCreate($input: UserCreateInput!) {
|
|
327
|
-
userCreate(input: $input) {
|
|
328
|
-
id
|
|
329
|
-
firstName
|
|
330
|
-
lastName
|
|
331
|
-
middleName
|
|
332
|
-
fullName
|
|
333
|
-
email
|
|
334
|
-
phoneNumber
|
|
335
|
-
employeeId
|
|
336
|
-
role
|
|
337
|
-
status
|
|
338
|
-
loginType
|
|
339
|
-
externalId
|
|
340
|
-
organizationId
|
|
341
|
-
insertedAt
|
|
342
|
-
updatedAt
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
`,M=t`
|
|
346
|
-
mutation vehicleGroupCreate($input: VehicleGroupCreateInput!) {
|
|
347
|
-
vehicleGroupCreate(input: $input) {
|
|
348
|
-
id
|
|
349
|
-
code
|
|
350
|
-
name
|
|
351
|
-
description
|
|
352
|
-
externalId
|
|
353
|
-
driverCount
|
|
354
|
-
vehicleCount
|
|
355
|
-
insertedAt
|
|
356
|
-
updatedAt
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
`,N=t`
|
|
360
|
-
mutation vehicleGroupDriversAdd($input: VehicleGroupDriversAddInput!) {
|
|
361
|
-
vehicleGroupDriversAdd(input: $input) {
|
|
362
|
-
id
|
|
363
|
-
name
|
|
364
|
-
description
|
|
365
|
-
externalId
|
|
366
|
-
driverCount
|
|
367
|
-
vehicleCount
|
|
368
|
-
insertedAt
|
|
369
|
-
updatedAt
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
`,P=t`
|
|
373
|
-
mutation vehicleGroupVehiclesAdd($input: VehicleGroupVehiclesAddInput!) {
|
|
374
|
-
vehicleGroupVehiclesAdd(input: $input) {
|
|
375
|
-
id
|
|
376
|
-
name
|
|
377
|
-
description
|
|
378
|
-
externalId
|
|
379
|
-
driverCount
|
|
380
|
-
vehicleCount
|
|
381
|
-
insertedAt
|
|
382
|
-
updatedAt
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
`,F=t`
|
|
386
|
-
mutation vehicleUpdate($input: VehicleUpdateInput!) {
|
|
387
|
-
vehicleUpdate(input: $input)
|
|
388
|
-
}
|
|
389
|
-
`,I=t`
|
|
390
|
-
query vehicleGroupsFilter($input: VehicleGroupsFilterInput!) {
|
|
391
|
-
vehicleGroupsFilter(input: $input) {
|
|
392
|
-
data {
|
|
393
|
-
id
|
|
394
|
-
name
|
|
395
|
-
description
|
|
396
|
-
externalId
|
|
397
|
-
}
|
|
398
|
-
meta {
|
|
399
|
-
limit
|
|
400
|
-
offset
|
|
401
|
-
total
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
`,L=t`
|
|
406
|
-
mutation vehiclesOnboard($input: VehiclesOnboardInputList!) {
|
|
407
|
-
vehiclesOnboard(input: $input) {
|
|
408
|
-
vehicles {
|
|
409
|
-
id
|
|
410
|
-
vin
|
|
411
|
-
vehicleGroupId
|
|
412
|
-
success
|
|
413
|
-
error
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
`,R=(e,t,n,r)=>e();function z(e,t=R){return{apiKeyCreate(n,r,i){return t(t=>e.request({document:C,variables:n,requestHeaders:{...r,...t},signal:i}),`apiKeyCreate`,`mutation`,n)},organizationCreate(n,r,i){return t(t=>e.request({document:w,variables:n,requestHeaders:{...r,...t},signal:i}),`organizationCreate`,`mutation`,n)},entityCreate(n,r,i){return t(t=>e.request({document:T,variables:n,requestHeaders:{...r,...t},signal:i}),`entityCreate`,`mutation`,n)},machineTokenizeUser(n,r,i){return t(t=>e.request({document:E,variables:n,requestHeaders:{...r,...t},signal:i}),`machineTokenizeUser`,`mutation`,n)},provisionCard(n,r,i){return t(t=>e.request({document:D,variables:n,requestHeaders:{...r,...t},signal:i}),`provisionCard`,`mutation`,n)},provisionStatusUpdate(n,r,i){return t(t=>e.request({document:O,variables:n,requestHeaders:{...r,...t},signal:i}),`provisionStatusUpdate`,`mutation`,n)},servicePay(n,r,i){return t(t=>e.request({document:k,variables:n,requestHeaders:{...r,...t},signal:i}),`servicePay`,`mutation`,n)},ttpTokenization(n,r,i){return t(t=>e.request({document:A,variables:n,requestHeaders:{...r,...t},signal:i}),`ttpTokenization`,`mutation`,n)},userCreate(n,r,i){return t(t=>e.request({document:j,variables:n,requestHeaders:{...r,...t},signal:i}),`userCreate`,`mutation`,n)},vehicleGroupCreate(n,r,i){return t(t=>e.request({document:M,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupCreate`,`mutation`,n)},vehicleGroupDriversAdd(n,r,i){return t(t=>e.request({document:N,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupDriversAdd`,`mutation`,n)},vehicleGroupVehiclesAdd(n,r,i){return t(t=>e.request({document:P,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupVehiclesAdd`,`mutation`,n)},vehicleUpdate(n,r,i){return t(t=>e.request({document:F,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleUpdate`,`mutation`,n)},vehicleGroupsFilter(n,r,i){return t(t=>e.request({document:I,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupsFilter`,`query`,n)},vehiclesOnboard(n,r,i){return t(t=>e.request({document:L,variables:n,requestHeaders:{...r,...t},signal:i}),`vehiclesOnboard`,`mutation`,n)}}}const B={int:`https://api-gateway.int.gocariq.com/`,stage:`https://api-gateway.stage.gocariq.com/`};function V(t){let n=t.environment??`stage`,r=new e(t.endpoint??B[n],{headers:{"x-api-key":t.apiKey,"Content-Type":`application/json`}});if(n===`int`)return S(r);if(n===`stage`)return z(r);throw Error(`Unsupported environment`)}const H=e=>n(Buffer.from(e,`base64`)),U=e=>{let t=H(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},W={EXXON:r.EXXONMOBIL,MOBIL:r.EXXONMOBIL,SHELL:r.SHELL,SUNOCO:r.SUNOCO},G=({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:W[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}},K=e=>G({serviceLocationEvent:U(e)});export{V as createElementPayClient,K as serviceLocationPubSubMessageToFuelSupplier};
|
|
235
|
+
`,T=(e,t,n,r)=>e();function E(e,t=T){return{provisionCard(n,r,i){return t(t=>e.request({document:x,variables:n,requestHeaders:{...r,...t},signal:i}),`provisionCard`,`mutation`,n)},provisionStatusUpdate(n,r,i){return t(t=>e.request({document:S,variables:n,requestHeaders:{...r,...t},signal:i}),`provisionStatusUpdate`,`mutation`,n)},servicePay(n,r,i){return t(t=>e.request({document:C,variables:n,requestHeaders:{...r,...t},signal:i}),`servicePay`,`mutation`,n)},ttpTokenization(n,r,i){return t(t=>e.request({document:w,variables:n,requestHeaders:{...r,...t},signal:i}),`ttpTokenization`,`mutation`,n)}}}function D(t){let n=t.environment??`stage`;return E(new e(t.endpoint??y[n],{headers:{Authorization:`Bearer ${t.accessToken}`,"Content-Type":`application/json`}}))}const O=e=>n(Buffer.from(e,`base64`)),k=e=>{let t=O(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},A={EXXON:r.EXXONMOBIL,MOBIL:r.EXXONMOBIL,SHELL:r.SHELL,SUNOCO:r.SUNOCO},j=({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:A[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}},M=e=>j({serviceLocationEvent:k(e)});export{b as getOrganizationSdk,D as getUserSdk,M as serviceLocationPubSubMessageToFuelSupplier};
|
|
418
236
|
//# sourceMappingURL=index.js.map
|