@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/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
|
+
### `getOrganizationSdk(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 { getOrganizationSdk } from '@autofleet/element-pay';
|
|
15
22
|
|
|
16
|
-
const
|
|
17
|
-
endpoint: 'https://api.car-iq.example.com/graphql',
|
|
23
|
+
const sdk = getOrganizationSdk({
|
|
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
|
@@ -5,6 +5,17 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
`,p=l.default`
|
|
8
|
+
mutation clientOnboard($input: ClientOnboardInput!) {
|
|
9
|
+
clientOnboard(input: $input) {
|
|
10
|
+
id
|
|
11
|
+
name
|
|
12
|
+
externalId
|
|
13
|
+
insertedAt
|
|
14
|
+
updatedAt
|
|
15
|
+
deletedAt
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
`,m=l.default`
|
|
8
19
|
mutation organizationCreate($input: OrganizationCreateInput!) {
|
|
9
20
|
organizationCreate(input: $input) {
|
|
10
21
|
id
|
|
@@ -24,7 +35,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
24
35
|
deletedAt
|
|
25
36
|
}
|
|
26
37
|
}
|
|
27
|
-
`,
|
|
38
|
+
`,h=l.default`
|
|
28
39
|
mutation entityCreate($input: EntityCreateInput!) {
|
|
29
40
|
entityCreate(input: $input) {
|
|
30
41
|
id
|
|
@@ -37,17 +48,6 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
37
48
|
insertedAt
|
|
38
49
|
updatedAt
|
|
39
50
|
}
|
|
40
|
-
}
|
|
41
|
-
`,h=l.default`
|
|
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
|
`,g=l.default`
|
|
53
53
|
query entityGetExternalId($externalId: String) {
|
|
@@ -98,49 +98,6 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
`,v=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
|
-
}
|
|
111
|
-
`,y=l.default`
|
|
112
|
-
mutation provisionStatusUpdate($input: ProvisionStatusUpdateInput!) {
|
|
113
|
-
provisionStatusUpdate(input: $input) {
|
|
114
|
-
success
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
`,b=l.default`
|
|
118
|
-
mutation servicePay($input: ServicePayInput!) {
|
|
119
|
-
servicePay(input: $input) {
|
|
120
|
-
requestId
|
|
121
|
-
transactionId
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
`,x=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
|
-
`,S=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,11 +157,11 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
200
157
|
updatedAt
|
|
201
158
|
}
|
|
202
159
|
}
|
|
203
|
-
`,
|
|
160
|
+
`,S=l.default`
|
|
204
161
|
mutation vehicleUpdate($input: VehicleUpdateInput!) {
|
|
205
162
|
vehicleUpdate(input: $input)
|
|
206
163
|
}
|
|
207
|
-
`,
|
|
164
|
+
`,C=l.default`
|
|
208
165
|
query vehicleGroupsFilter($input: VehicleGroupsFilterInput!) {
|
|
209
166
|
vehicleGroupsFilter(input: $input) {
|
|
210
167
|
data {
|
|
@@ -220,7 +177,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
220
177
|
}
|
|
221
178
|
}
|
|
222
179
|
}
|
|
223
|
-
`,
|
|
180
|
+
`,w=l.default`
|
|
224
181
|
mutation vehiclesOnboard($input: VehiclesOnboardInputList!) {
|
|
225
182
|
vehiclesOnboard(input: $input) {
|
|
226
183
|
vehicles {
|
|
@@ -232,54 +189,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
232
189
|
}
|
|
233
190
|
}
|
|
234
191
|
}
|
|
235
|
-
`,
|
|
236
|
-
mutation apiKeyCreate($input: ApiKeyCreateInput!) {
|
|
237
|
-
apiKeyCreate(input: $input) {
|
|
238
|
-
apiKey
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
`,M=l.default`
|
|
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
|
-
`,ee=l.default`
|
|
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
|
-
`,N=l.default`
|
|
276
|
-
mutation machineTokenizeUser($input: MachineTokenizeUserInput) {
|
|
277
|
-
machineTokenizeUser(input: $input) {
|
|
278
|
-
access_token
|
|
279
|
-
expires_in
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
`,P=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`
|
|
283
193
|
mutation provisionCard($input: ProvisionCardInput!) {
|
|
284
194
|
provisionCard(input: $input) {
|
|
285
195
|
encryptedData
|
|
@@ -290,20 +200,20 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
290
200
|
cardNetwork
|
|
291
201
|
}
|
|
292
202
|
}
|
|
293
|
-
`,
|
|
203
|
+
`,A=l.default`
|
|
294
204
|
mutation provisionStatusUpdate($input: ProvisionStatusUpdateInput!) {
|
|
295
205
|
provisionStatusUpdate(input: $input) {
|
|
296
206
|
success
|
|
297
207
|
}
|
|
298
208
|
}
|
|
299
|
-
`,
|
|
209
|
+
`,j=l.default`
|
|
300
210
|
mutation servicePay($input: ServicePayInput!) {
|
|
301
211
|
servicePay(input: $input) {
|
|
302
212
|
requestId
|
|
303
213
|
transactionId
|
|
304
214
|
}
|
|
305
215
|
}
|
|
306
|
-
`,
|
|
216
|
+
`,M=l.default`
|
|
307
217
|
mutation ttpTokenization($input: TtpTokenizationInput!) {
|
|
308
218
|
ttpTokenization(input: $input) {
|
|
309
219
|
requestId
|
|
@@ -322,97 +232,5 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
322
232
|
cardFlag
|
|
323
233
|
}
|
|
324
234
|
}
|
|
325
|
-
`,R=
|
|
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
|
-
`,z=l.default`
|
|
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
|
-
`,B=l.default`
|
|
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
|
-
`,V=l.default`
|
|
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
|
-
`,H=l.default`
|
|
386
|
-
mutation vehicleUpdate($input: VehicleUpdateInput!) {
|
|
387
|
-
vehicleUpdate(input: $input)
|
|
388
|
-
}
|
|
389
|
-
`,U=l.default`
|
|
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
|
-
`,W=l.default`
|
|
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
|
-
`,G=(e,t,n,r)=>e();function K(e,t=G){return{apiKeyCreate(n,r,i){return t(t=>e.request({document:j,variables:n,requestHeaders:{...r,...t},signal:i}),`apiKeyCreate`,`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:ee,variables:n,requestHeaders:{...r,...t},signal:i}),`entityCreate`,`mutation`,n)},machineTokenizeUser(n,r,i){return t(t=>e.request({document:N,variables:n,requestHeaders:{...r,...t},signal:i}),`machineTokenizeUser`,`mutation`,n)},provisionCard(n,r,i){return t(t=>e.request({document:P,variables:n,requestHeaders:{...r,...t},signal:i}),`provisionCard`,`mutation`,n)},provisionStatusUpdate(n,r,i){return t(t=>e.request({document:F,variables:n,requestHeaders:{...r,...t},signal:i}),`provisionStatusUpdate`,`mutation`,n)},servicePay(n,r,i){return t(t=>e.request({document:I,variables:n,requestHeaders:{...r,...t},signal:i}),`servicePay`,`mutation`,n)},ttpTokenization(n,r,i){return t(t=>e.request({document:L,variables:n,requestHeaders:{...r,...t},signal:i}),`ttpTokenization`,`mutation`,n)},userCreate(n,r,i){return t(t=>e.request({document:R,variables:n,requestHeaders:{...r,...t},signal:i}),`userCreate`,`mutation`,n)},vehicleGroupCreate(n,r,i){return t(t=>e.request({document:z,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:V,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupVehiclesAdd`,`mutation`,n)},vehicleUpdate(n,r,i){return t(t=>e.request({document:H,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleUpdate`,`mutation`,n)},vehicleGroupsFilter(n,r,i){return t(t=>e.request({document:U,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 q={int:`https://api-gateway.int.gocariq.com/`,stage:`https://api-gateway.stage.gocariq.com/`};function J(e){let t=e.environment??`stage`,n=new c.GraphQLClient(e.endpoint??q[t],{headers:{"x-api-key":e.apiKey,"Content-Type":`application/json`}});if(t===`int`)return A(n);if(t===`stage`)return K(n);throw Error(`Unsupported environment`)}const Y=e=>(0,u.decode)(Buffer.from(e,`base64`)),X=e=>{let t=Y(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},Z={EXXON:d.FUEL_BRANDS.EXXONMOBIL,MOBIL:d.FUEL_BRANDS.EXXONMOBIL,SHELL:d.FUEL_BRANDS.SHELL,SUNOCO:d.FUEL_BRANDS.SUNOCO},Q=({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:Z[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}},$=e=>Q({serviceLocationEvent:X(e)});exports.createElementPayClient=J,exports.serviceLocationPubSubMessageToFuelSupplier=$;
|
|
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.getOrganizationSdk=O,exports.getUserSdk=F,exports.serviceLocationPubSubMessageToFuelSupplier=B;
|
|
418
236
|
//# sourceMappingURL=index.cjs.map
|