@autofleet/element-pay 1.1.3-dev.0 → 2.0.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 +94 -24
- package/lib/index.cjs +30 -315
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +289 -1154
- package/lib/index.d.ts +290 -1154
- package/lib/index.js +24 -309
- package/lib/index.js.map +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -1,45 +1,115 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @autofleet/element-pay
|
|
2
2
|
|
|
3
|
-
GraphQL client for the Element Pay third-party
|
|
3
|
+
GraphQL client for the Element Pay third-party provider. Exposes two authenticated SDK factories (organization-scoped and user-scoped) and a PubSub message transformer for service-location events.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Environments
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
| Key | Endpoint |
|
|
8
|
+
|---------|--------------------------------------------|
|
|
9
|
+
| `int` | `https://api-gateway.int.gocariq.com/` |
|
|
10
|
+
| `stage` | `https://api-gateway.stage.gocariq.com/` |
|
|
11
|
+
|
|
12
|
+
Default environment: `stage`.
|
|
13
|
+
|
|
14
|
+
## API
|
|
15
|
+
|
|
16
|
+
### `getOrganizaionSdk(config)`
|
|
10
17
|
|
|
11
|
-
|
|
18
|
+
Returns a GraphQL SDK authenticated with an API key (organization-level operations).
|
|
12
19
|
|
|
13
20
|
```ts
|
|
14
|
-
import {
|
|
21
|
+
import { getOrganizaionSdk } from '@autofleet/element-pay';
|
|
15
22
|
|
|
16
|
-
const
|
|
17
|
-
endpoint: 'https://api.car-iq.example.com/graphql',
|
|
23
|
+
const sdk = getOrganizaionSdk({
|
|
18
24
|
apiKey: 'your-api-key',
|
|
25
|
+
environment: 'int', // optional, defaults to 'stage'
|
|
26
|
+
// endpoint: 'https://custom-endpoint/' // optional override
|
|
19
27
|
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Config:**
|
|
31
|
+
|
|
32
|
+
| Field | Type | Required | Description |
|
|
33
|
+
|---------------|------------------------|----------|------------------------------------|
|
|
34
|
+
| `apiKey` | `string` | Yes | Sent as `x-api-key` header |
|
|
35
|
+
| `environment` | `'int' \| 'stage'` | No | Defaults to `'stage'` |
|
|
36
|
+
| `endpoint` | `string` | No | Overrides environment endpoint |
|
|
37
|
+
|
|
38
|
+
**Available mutations/queries** (from `src/graphql/organization/`):
|
|
39
|
+
- `createOrganization`
|
|
40
|
+
- `entityCreate`
|
|
41
|
+
- `apiKeyCreate`
|
|
42
|
+
- `clientOnboarding`
|
|
43
|
+
- `machineTokenizeUser`
|
|
44
|
+
- `userCreate`
|
|
45
|
+
- `vehicleGroupCreate`
|
|
46
|
+
- `vehicleGroupDriversAdd`
|
|
47
|
+
- `vehicleGroupVehiclesAdd`
|
|
48
|
+
- `vehiclesOnboard`
|
|
49
|
+
- `entityGetExternalId`
|
|
50
|
+
- `vehicleUpdate`
|
|
51
|
+
- `vehiclesGroupFilter`
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### `getUserSdk(config)`
|
|
20
56
|
|
|
21
|
-
|
|
22
|
-
await client.organizationCreate({ input: { ... } });
|
|
57
|
+
Returns a GraphQL SDK authenticated with a user access token (user-level operations).
|
|
23
58
|
|
|
24
|
-
|
|
25
|
-
|
|
59
|
+
```ts
|
|
60
|
+
import { getUserSdk } from '@autofleet/element-pay';
|
|
61
|
+
|
|
62
|
+
const sdk = getUserSdk({
|
|
63
|
+
accessToken: 'bearer-token',
|
|
64
|
+
environment: 'int', // optional, defaults to 'stage'
|
|
65
|
+
// endpoint: 'https://custom-endpoint/' // optional override
|
|
66
|
+
});
|
|
26
67
|
```
|
|
27
68
|
|
|
28
|
-
|
|
69
|
+
**Config:**
|
|
70
|
+
|
|
71
|
+
| Field | Type | Required | Description |
|
|
72
|
+
|---------------|------------------------|----------|------------------------------------|
|
|
73
|
+
| `accessToken` | `string` | Yes | Sent as `Authorization: Bearer` |
|
|
74
|
+
| `environment` | `'int' \| 'stage'` | No | Defaults to `'stage'` |
|
|
75
|
+
| `endpoint` | `string` | No | Overrides environment endpoint |
|
|
76
|
+
|
|
77
|
+
**Available mutations/queries** (from `src/graphql/user/`):
|
|
78
|
+
- `servicePay`
|
|
79
|
+
- `provisionCard`
|
|
80
|
+
- `provisionStatusUpdate`
|
|
81
|
+
- `ttpTokenization`
|
|
29
82
|
|
|
30
|
-
|
|
83
|
+
---
|
|
31
84
|
|
|
32
|
-
|
|
85
|
+
### `serviceLocationPubSubMessageToFuelSupplier(message)`
|
|
86
|
+
|
|
87
|
+
Decodes a msgpack-encoded PubSub message containing a `ServiceLocationEvent` and transforms it into a partial `FuelSupplier` object.
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
import { serviceLocationPubSubMessageToFuelSupplier } from '@autofleet/element-pay';
|
|
91
|
+
|
|
92
|
+
const fuelSupplier = serviceLocationPubSubMessageToFuelSupplier(rawPubSubMessage);
|
|
93
|
+
// Returns: Partial<FuelSupplier>
|
|
94
|
+
```
|
|
33
95
|
|
|
34
|
-
|
|
35
|
-
|---|---|---|
|
|
36
|
-
| `endpoint` | `string` | Element Pay GraphQL endpoint URL |
|
|
37
|
-
| `apiKey` | `string` | API key sent as `x-api-key` header |
|
|
96
|
+
**Mapped fields:**
|
|
38
97
|
|
|
39
|
-
|
|
98
|
+
| Output field | Source |
|
|
99
|
+
|---------------------|---------------------------------------------|
|
|
100
|
+
| `acceptElementPay` | Always `true` |
|
|
101
|
+
| `address` | Joined from address fields |
|
|
102
|
+
| `externalId` | `ServiceLocation.id` |
|
|
103
|
+
| `name` | `ServiceLocation.name` |
|
|
104
|
+
| `brandName` | Mapped from `provider.name` via consts |
|
|
105
|
+
| `lat` / `lng` | `ServiceLocation.geocoded` |
|
|
106
|
+
| `directPayEnabled` | `!out_of_network` |
|
|
107
|
+
| `ttpEnabled` | `ServiceLocation.ttp_enabled` |
|
|
108
|
+
| `isActive` | `enabled && !deleted_at` |
|
|
40
109
|
|
|
41
|
-
|
|
110
|
+
## Codegen
|
|
42
111
|
|
|
43
112
|
```bash
|
|
44
|
-
npm
|
|
113
|
+
npm codegen:user # regenerates src/generated/user/sdk.ts
|
|
114
|
+
npm codegen:organization # regenerates src/generated/organization/sdk.ts
|
|
45
115
|
```
|
package/lib/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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
|
|
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 apiKeyCreate($input: ApiKeyCreateInput!) {
|
|
3
3
|
apiKeyCreate(input: $input) {
|
|
4
4
|
apiKey
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
`,
|
|
7
|
+
`,p=l.default`
|
|
8
8
|
mutation clientOnboard($input: ClientOnboardInput!) {
|
|
9
9
|
clientOnboard(input: $input) {
|
|
10
10
|
id
|
|
@@ -15,7 +15,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
15
15
|
deletedAt
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
18
|
+
`,m=l.default`
|
|
19
19
|
mutation organizationCreate($input: OrganizationCreateInput!) {
|
|
20
20
|
organizationCreate(input: $input) {
|
|
21
21
|
id
|
|
@@ -35,7 +35,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
35
35
|
deletedAt
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
`,
|
|
38
|
+
`,h=l.default`
|
|
39
39
|
mutation entityCreate($input: EntityCreateInput!) {
|
|
40
40
|
entityCreate(input: $input) {
|
|
41
41
|
id
|
|
@@ -49,7 +49,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
49
49
|
updatedAt
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
`,
|
|
52
|
+
`,g=l.default`
|
|
53
53
|
query entityGetExternalId($externalId: String) {
|
|
54
54
|
entity(externalId: $externalId) {
|
|
55
55
|
id
|
|
@@ -90,57 +90,14 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
`,
|
|
93
|
+
`,_=l.default`
|
|
94
94
|
mutation machineTokenizeUser($input: MachineTokenizeUserInput) {
|
|
95
95
|
machineTokenizeUser(input: $input) {
|
|
96
96
|
access_token
|
|
97
97
|
expires_in
|
|
98
98
|
}
|
|
99
|
-
}
|
|
100
|
-
`,_=l.default`
|
|
101
|
-
mutation provisionCard($input: ProvisionCardInput!) {
|
|
102
|
-
provisionCard(input: $input) {
|
|
103
|
-
encryptedData
|
|
104
|
-
activationData
|
|
105
|
-
publicKey
|
|
106
|
-
lastFourDigits
|
|
107
|
-
displayName
|
|
108
|
-
cardNetwork
|
|
109
|
-
}
|
|
110
99
|
}
|
|
111
100
|
`,v=l.default`
|
|
112
|
-
mutation provisionStatusUpdate($input: ProvisionStatusUpdateInput!) {
|
|
113
|
-
provisionStatusUpdate(input: $input) {
|
|
114
|
-
success
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
`,y=l.default`
|
|
118
|
-
mutation servicePay($input: ServicePayInput!) {
|
|
119
|
-
servicePay(input: $input) {
|
|
120
|
-
requestId
|
|
121
|
-
transactionId
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
`,b=l.default`
|
|
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
|
-
`,x=l.default`
|
|
144
101
|
mutation userCreate($input: UserCreateInput!) {
|
|
145
102
|
userCreate(input: $input) {
|
|
146
103
|
id
|
|
@@ -160,7 +117,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
160
117
|
updatedAt
|
|
161
118
|
}
|
|
162
119
|
}
|
|
163
|
-
`,
|
|
120
|
+
`,y=l.default`
|
|
164
121
|
mutation vehicleGroupCreate($input: VehicleGroupCreateInput!) {
|
|
165
122
|
vehicleGroupCreate(input: $input) {
|
|
166
123
|
id
|
|
@@ -174,7 +131,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
174
131
|
updatedAt
|
|
175
132
|
}
|
|
176
133
|
}
|
|
177
|
-
`,
|
|
134
|
+
`,b=l.default`
|
|
178
135
|
mutation vehicleGroupDriversAdd($input: VehicleGroupDriversAddInput!) {
|
|
179
136
|
vehicleGroupDriversAdd(input: $input) {
|
|
180
137
|
id
|
|
@@ -187,7 +144,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
187
144
|
updatedAt
|
|
188
145
|
}
|
|
189
146
|
}
|
|
190
|
-
`,
|
|
147
|
+
`,x=l.default`
|
|
191
148
|
mutation vehicleGroupVehiclesAdd($input: VehicleGroupVehiclesAddInput!) {
|
|
192
149
|
vehicleGroupVehiclesAdd(input: $input) {
|
|
193
150
|
id
|
|
@@ -200,150 +157,27 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
200
157
|
updatedAt
|
|
201
158
|
}
|
|
202
159
|
}
|
|
203
|
-
`,
|
|
204
|
-
mutation
|
|
205
|
-
|
|
206
|
-
|
|
160
|
+
`,S=l.default`
|
|
161
|
+
mutation vehicleUpdate($input: VehicleUpdateInput!) {
|
|
162
|
+
vehicleUpdate(input: $input)
|
|
163
|
+
}
|
|
164
|
+
`,C=l.default`
|
|
165
|
+
query vehicleGroupsFilter($input: VehicleGroupsFilterInput!) {
|
|
166
|
+
vehicleGroupsFilter(input: $input) {
|
|
167
|
+
data {
|
|
207
168
|
id
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
error
|
|
169
|
+
name
|
|
170
|
+
description
|
|
171
|
+
externalId
|
|
212
172
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
apiKeyCreate(input: $input) {
|
|
218
|
-
apiKey
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
`,k=l.default`
|
|
222
|
-
mutation organizationCreate($input: OrganizationCreateInput!) {
|
|
223
|
-
organizationCreate(input: $input) {
|
|
224
|
-
id
|
|
225
|
-
name
|
|
226
|
-
address {
|
|
227
|
-
line1
|
|
228
|
-
line2
|
|
229
|
-
city
|
|
230
|
-
state
|
|
231
|
-
country
|
|
232
|
-
zip
|
|
173
|
+
meta {
|
|
174
|
+
limit
|
|
175
|
+
offset
|
|
176
|
+
total
|
|
233
177
|
}
|
|
234
|
-
onboardedAt
|
|
235
|
-
onboardedBy
|
|
236
|
-
insertedAt
|
|
237
|
-
updatedAt
|
|
238
|
-
deletedAt
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
`,A=l.default`
|
|
242
|
-
mutation entityCreate($input: EntityCreateInput!) {
|
|
243
|
-
entityCreate(input: $input) {
|
|
244
|
-
id
|
|
245
|
-
name
|
|
246
|
-
description
|
|
247
|
-
externalId
|
|
248
|
-
parentId
|
|
249
|
-
hasFinance
|
|
250
|
-
funding
|
|
251
|
-
insertedAt
|
|
252
|
-
updatedAt
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
`,j=l.default`
|
|
256
|
-
mutation machineTokenizeUser($input: MachineTokenizeUserInput) {
|
|
257
|
-
machineTokenizeUser(input: $input) {
|
|
258
|
-
access_token
|
|
259
|
-
expires_in
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
`,M=l.default`
|
|
263
|
-
mutation provisionCard($input: ProvisionCardInput!) {
|
|
264
|
-
provisionCard(input: $input) {
|
|
265
|
-
encryptedData
|
|
266
|
-
activationData
|
|
267
|
-
publicKey
|
|
268
|
-
lastFourDigits
|
|
269
|
-
displayName
|
|
270
|
-
cardNetwork
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
`,N=l.default`
|
|
274
|
-
mutation provisionStatusUpdate($input: ProvisionStatusUpdateInput!) {
|
|
275
|
-
provisionStatusUpdate(input: $input) {
|
|
276
|
-
success
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
`,P=l.default`
|
|
280
|
-
mutation servicePay($input: ServicePayInput!) {
|
|
281
|
-
servicePay(input: $input) {
|
|
282
|
-
requestId
|
|
283
|
-
transactionId
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
`,F=l.default`
|
|
287
|
-
mutation userCreate($input: UserCreateInput!) {
|
|
288
|
-
userCreate(input: $input) {
|
|
289
|
-
id
|
|
290
|
-
firstName
|
|
291
|
-
lastName
|
|
292
|
-
middleName
|
|
293
|
-
fullName
|
|
294
|
-
email
|
|
295
|
-
phoneNumber
|
|
296
|
-
employeeId
|
|
297
|
-
role
|
|
298
|
-
status
|
|
299
|
-
loginType
|
|
300
|
-
externalId
|
|
301
|
-
organizationId
|
|
302
|
-
insertedAt
|
|
303
|
-
updatedAt
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
`,te=l.default`
|
|
307
|
-
mutation vehicleGroupCreate($input: VehicleGroupCreateInput!) {
|
|
308
|
-
vehicleGroupCreate(input: $input) {
|
|
309
|
-
id
|
|
310
|
-
code
|
|
311
|
-
name
|
|
312
|
-
description
|
|
313
|
-
externalId
|
|
314
|
-
driverCount
|
|
315
|
-
vehicleCount
|
|
316
|
-
insertedAt
|
|
317
|
-
updatedAt
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
`,I=l.default`
|
|
321
|
-
mutation vehicleGroupDriversAdd($input: VehicleGroupDriversAddInput!) {
|
|
322
|
-
vehicleGroupDriversAdd(input: $input) {
|
|
323
|
-
id
|
|
324
|
-
name
|
|
325
|
-
description
|
|
326
|
-
externalId
|
|
327
|
-
driverCount
|
|
328
|
-
vehicleCount
|
|
329
|
-
insertedAt
|
|
330
|
-
updatedAt
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
`,L=l.default`
|
|
334
|
-
mutation vehicleGroupVehiclesAdd($input: VehicleGroupVehiclesAddInput!) {
|
|
335
|
-
vehicleGroupVehiclesAdd(input: $input) {
|
|
336
|
-
id
|
|
337
|
-
name
|
|
338
|
-
description
|
|
339
|
-
externalId
|
|
340
|
-
driverCount
|
|
341
|
-
vehicleCount
|
|
342
|
-
insertedAt
|
|
343
|
-
updatedAt
|
|
344
178
|
}
|
|
345
179
|
}
|
|
346
|
-
`,
|
|
180
|
+
`,w=l.default`
|
|
347
181
|
mutation vehiclesOnboard($input: VehiclesOnboardInputList!) {
|
|
348
182
|
vehiclesOnboard(input: $input) {
|
|
349
183
|
vehicles {
|
|
@@ -355,54 +189,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
355
189
|
}
|
|
356
190
|
}
|
|
357
191
|
}
|
|
358
|
-
`,
|
|
359
|
-
mutation apiKeyCreate($input: ApiKeyCreateInput!) {
|
|
360
|
-
apiKeyCreate(input: $input) {
|
|
361
|
-
apiKey
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
`,H=l.default`
|
|
365
|
-
mutation organizationCreate($input: OrganizationCreateInput!) {
|
|
366
|
-
organizationCreate(input: $input) {
|
|
367
|
-
id
|
|
368
|
-
name
|
|
369
|
-
address {
|
|
370
|
-
line1
|
|
371
|
-
line2
|
|
372
|
-
city
|
|
373
|
-
state
|
|
374
|
-
country
|
|
375
|
-
zip
|
|
376
|
-
}
|
|
377
|
-
onboardedAt
|
|
378
|
-
onboardedBy
|
|
379
|
-
insertedAt
|
|
380
|
-
updatedAt
|
|
381
|
-
deletedAt
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
`,U=l.default`
|
|
385
|
-
mutation entityCreate($input: EntityCreateInput!) {
|
|
386
|
-
entityCreate(input: $input) {
|
|
387
|
-
id
|
|
388
|
-
name
|
|
389
|
-
description
|
|
390
|
-
externalId
|
|
391
|
-
parentId
|
|
392
|
-
hasFinance
|
|
393
|
-
funding
|
|
394
|
-
insertedAt
|
|
395
|
-
updatedAt
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
`,W=l.default`
|
|
399
|
-
mutation machineTokenizeUser($input: MachineTokenizeUserInput) {
|
|
400
|
-
machineTokenizeUser(input: $input) {
|
|
401
|
-
access_token
|
|
402
|
-
expires_in
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
`,G=l.default`
|
|
192
|
+
`,T=(e,t,n,r)=>e();function E(e,t=T){return{apiKeyCreate(n,r,i){return t(t=>e.request({document:f,variables:n,requestHeaders:{...r,...t},signal:i}),`apiKeyCreate`,`mutation`,n)},clientOnboard(n,r,i){return t(t=>e.request({document:p,variables:n,requestHeaders:{...r,...t},signal:i}),`clientOnboard`,`mutation`,n)},organizationCreate(n,r,i){return t(t=>e.request({document:m,variables:n,requestHeaders:{...r,...t},signal:i}),`organizationCreate`,`mutation`,n)},entityCreate(n,r,i){return t(t=>e.request({document:h,variables:n,requestHeaders:{...r,...t},signal:i}),`entityCreate`,`mutation`,n)},entityGetExternalId(n,r,i){return t(t=>e.request({document:g,variables:n,requestHeaders:{...r,...t},signal:i}),`entityGetExternalId`,`query`,n)},machineTokenizeUser(n,r,i){return t(t=>e.request({document:_,variables:n,requestHeaders:{...r,...t},signal:i}),`machineTokenizeUser`,`mutation`,n)},userCreate(n,r,i){return t(t=>e.request({document:v,variables:n,requestHeaders:{...r,...t},signal:i}),`userCreate`,`mutation`,n)},vehicleGroupCreate(n,r,i){return t(t=>e.request({document:y,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupCreate`,`mutation`,n)},vehicleGroupDriversAdd(n,r,i){return t(t=>e.request({document:b,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupDriversAdd`,`mutation`,n)},vehicleGroupVehiclesAdd(n,r,i){return t(t=>e.request({document:x,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupVehiclesAdd`,`mutation`,n)},vehicleUpdate(n,r,i){return t(t=>e.request({document:S,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleUpdate`,`mutation`,n)},vehicleGroupsFilter(n,r,i){return t(t=>e.request({document:C,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupsFilter`,`query`,n)},vehiclesOnboard(n,r,i){return t(t=>e.request({document:w,variables:n,requestHeaders:{...r,...t},signal:i}),`vehiclesOnboard`,`mutation`,n)}}}const D={int:`https://api-gateway.int.gocariq.com/`,stage:`https://api-gateway.stage.gocariq.com/`};function O(e){let t=e.environment??`stage`;return E(new c.GraphQLClient(e.endpoint??D[t],{headers:{"x-api-key":e.apiKey,"Content-Type":`application/json`}}))}const k=l.default`
|
|
406
193
|
mutation provisionCard($input: ProvisionCardInput!) {
|
|
407
194
|
provisionCard(input: $input) {
|
|
408
195
|
encryptedData
|
|
@@ -413,20 +200,20 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
413
200
|
cardNetwork
|
|
414
201
|
}
|
|
415
202
|
}
|
|
416
|
-
`,
|
|
203
|
+
`,A=l.default`
|
|
417
204
|
mutation provisionStatusUpdate($input: ProvisionStatusUpdateInput!) {
|
|
418
205
|
provisionStatusUpdate(input: $input) {
|
|
419
206
|
success
|
|
420
207
|
}
|
|
421
208
|
}
|
|
422
|
-
`,
|
|
209
|
+
`,j=l.default`
|
|
423
210
|
mutation servicePay($input: ServicePayInput!) {
|
|
424
211
|
servicePay(input: $input) {
|
|
425
212
|
requestId
|
|
426
213
|
transactionId
|
|
427
214
|
}
|
|
428
215
|
}
|
|
429
|
-
`,
|
|
216
|
+
`,M=l.default`
|
|
430
217
|
mutation ttpTokenization($input: TtpTokenizationInput!) {
|
|
431
218
|
ttpTokenization(input: $input) {
|
|
432
219
|
requestId
|
|
@@ -445,77 +232,5 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
445
232
|
cardFlag
|
|
446
233
|
}
|
|
447
234
|
}
|
|
448
|
-
`,
|
|
449
|
-
mutation userCreate($input: UserCreateInput!) {
|
|
450
|
-
userCreate(input: $input) {
|
|
451
|
-
id
|
|
452
|
-
firstName
|
|
453
|
-
lastName
|
|
454
|
-
middleName
|
|
455
|
-
fullName
|
|
456
|
-
email
|
|
457
|
-
phoneNumber
|
|
458
|
-
employeeId
|
|
459
|
-
role
|
|
460
|
-
status
|
|
461
|
-
loginType
|
|
462
|
-
externalId
|
|
463
|
-
organizationId
|
|
464
|
-
insertedAt
|
|
465
|
-
updatedAt
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
`,X=l.default`
|
|
469
|
-
mutation vehicleGroupCreate($input: VehicleGroupCreateInput!) {
|
|
470
|
-
vehicleGroupCreate(input: $input) {
|
|
471
|
-
id
|
|
472
|
-
code
|
|
473
|
-
name
|
|
474
|
-
description
|
|
475
|
-
externalId
|
|
476
|
-
driverCount
|
|
477
|
-
vehicleCount
|
|
478
|
-
insertedAt
|
|
479
|
-
updatedAt
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
`,Z=l.default`
|
|
483
|
-
mutation vehicleGroupDriversAdd($input: VehicleGroupDriversAddInput!) {
|
|
484
|
-
vehicleGroupDriversAdd(input: $input) {
|
|
485
|
-
id
|
|
486
|
-
name
|
|
487
|
-
description
|
|
488
|
-
externalId
|
|
489
|
-
driverCount
|
|
490
|
-
vehicleCount
|
|
491
|
-
insertedAt
|
|
492
|
-
updatedAt
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
`,Q=l.default`
|
|
496
|
-
mutation vehicleGroupVehiclesAdd($input: VehicleGroupVehiclesAddInput!) {
|
|
497
|
-
vehicleGroupVehiclesAdd(input: $input) {
|
|
498
|
-
id
|
|
499
|
-
name
|
|
500
|
-
description
|
|
501
|
-
externalId
|
|
502
|
-
driverCount
|
|
503
|
-
vehicleCount
|
|
504
|
-
insertedAt
|
|
505
|
-
updatedAt
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
`,ne=l.default`
|
|
509
|
-
mutation vehiclesOnboard($input: VehiclesOnboardInputList!) {
|
|
510
|
-
vehiclesOnboard(input: $input) {
|
|
511
|
-
vehicles {
|
|
512
|
-
id
|
|
513
|
-
vin
|
|
514
|
-
vehicleGroupId
|
|
515
|
-
success
|
|
516
|
-
error
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
`,re=(e,t,n,r)=>e();function ie(e,t=re){return{apiKeyCreate(n,r,i){return t(t=>e.request({document:V,variables:n,requestHeaders:{...r,...t},signal:i}),`apiKeyCreate`,`mutation`,n)},organizationCreate(n,r,i){return t(t=>e.request({document:H,variables:n,requestHeaders:{...r,...t},signal:i}),`organizationCreate`,`mutation`,n)},entityCreate(n,r,i){return t(t=>e.request({document:U,variables:n,requestHeaders:{...r,...t},signal:i}),`entityCreate`,`mutation`,n)},machineTokenizeUser(n,r,i){return t(t=>e.request({document:W,variables:n,requestHeaders:{...r,...t},signal:i}),`machineTokenizeUser`,`mutation`,n)},provisionCard(n,r,i){return t(t=>e.request({document:G,variables:n,requestHeaders:{...r,...t},signal:i}),`provisionCard`,`mutation`,n)},provisionStatusUpdate(n,r,i){return t(t=>e.request({document:K,variables:n,requestHeaders:{...r,...t},signal:i}),`provisionStatusUpdate`,`mutation`,n)},servicePay(n,r,i){return t(t=>e.request({document:q,variables:n,requestHeaders:{...r,...t},signal:i}),`servicePay`,`mutation`,n)},ttpTokenization(n,r,i){return t(t=>e.request({document:J,variables:n,requestHeaders:{...r,...t},signal:i}),`ttpTokenization`,`mutation`,n)},userCreate(n,r,i){return t(t=>e.request({document:Y,variables:n,requestHeaders:{...r,...t},signal:i}),`userCreate`,`mutation`,n)},vehicleGroupCreate(n,r,i){return t(t=>e.request({document:X,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupCreate`,`mutation`,n)},vehicleGroupDriversAdd(n,r,i){return t(t=>e.request({document:Z,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupDriversAdd`,`mutation`,n)},vehicleGroupVehiclesAdd(n,r,i){return t(t=>e.request({document:Q,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupVehiclesAdd`,`mutation`,n)},vehiclesOnboard(n,r,i){return t(t=>e.request({document:ne,variables:n,requestHeaders:{...r,...t},signal:i}),`vehiclesOnboard`,`mutation`,n)}}}const ae={int:`https://api-gateway.int.gocariq.com/`,prod:`https://api-gateway.prod.gocariq.com/`,stage:`https://api-gateway.stage.gocariq.com/`};function oe(e){let t=e.environment??`prod`,n=new c.GraphQLClient(e.endpoint??ae[t],{headers:{"x-api-key":e.apiKey,"Content-Type":`application/json`}});return t===`int`?D(n):t===`stage`?ie(n):B(n)}const $=e=>(0,u.decode)(Buffer.from(e,`base64`)),se=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},ce={EXXON:d.FUEL_BRANDS.EXXONMOBIL,MOBIL:d.FUEL_BRANDS.EXXONMOBIL,SHELL:d.FUEL_BRANDS.SHELL,SUNOCO:d.FUEL_BRANDS.SUNOCO},le=({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:ce[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}},ue=e=>le({serviceLocationEvent:se(e)});exports.createElementPayClient=oe,exports.serviceLocationPubSubMessageToFuelSupplier=ue;
|
|
235
|
+
`,N=(e,t,n,r)=>e();function P(e,t=N){return{provisionCard(n,r,i){return t(t=>e.request({document:k,variables:n,requestHeaders:{...r,...t},signal:i}),`provisionCard`,`mutation`,n)},provisionStatusUpdate(n,r,i){return t(t=>e.request({document:A,variables:n,requestHeaders:{...r,...t},signal:i}),`provisionStatusUpdate`,`mutation`,n)},servicePay(n,r,i){return t(t=>e.request({document:j,variables:n,requestHeaders:{...r,...t},signal:i}),`servicePay`,`mutation`,n)},ttpTokenization(n,r,i){return t(t=>e.request({document:M,variables:n,requestHeaders:{...r,...t},signal:i}),`ttpTokenization`,`mutation`,n)}}}function F(e){let t=e.environment??`stage`;return P(new c.GraphQLClient(e.endpoint??D[t],{headers:{Authorization:`Bearer ${e.accessToken}`,"Content-Type":`application/json`}}))}const I=e=>(0,u.decode)(Buffer.from(e,`base64`)),L=e=>{let t=I(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},R={EXXON:d.FUEL_BRANDS.EXXONMOBIL,MOBIL:d.FUEL_BRANDS.EXXONMOBIL,SHELL:d.FUEL_BRANDS.SHELL,SUNOCO:d.FUEL_BRANDS.SUNOCO},z=({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:R[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}},B=e=>z({serviceLocationEvent:L(e)});exports.getOrganizaionSdk=O,exports.getUserSdk=F,exports.serviceLocationPubSubMessageToFuelSupplier=B;
|
|
521
236
|
//# sourceMappingURL=index.cjs.map
|