@autofleet/element-pay 2.0.2 → 2.1.2
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 +24 -11
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +36 -1
- package/lib/index.d.ts +36 -1
- package/lib/index.js +32 -19
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
package/lib/index.d.cts
CHANGED
|
@@ -66,6 +66,7 @@ type ClientOnboardInput = {
|
|
|
66
66
|
integratorId?: InputMaybe$1<Scalars$1['ID']['input']>;
|
|
67
67
|
name: Scalars$1['String']['input'];
|
|
68
68
|
onboardedBy?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
69
|
+
phoneNumber?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
69
70
|
taxId?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
70
71
|
unitsId?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
71
72
|
useTspMetadata?: InputMaybe$1<Scalars$1['Boolean']['input']>;
|
|
@@ -204,6 +205,17 @@ declare enum UserStatus {
|
|
|
204
205
|
Onboarded = "ONBOARDED",
|
|
205
206
|
Unknown = "UNKNOWN",
|
|
206
207
|
}
|
|
208
|
+
type UserUpdateInput = {
|
|
209
|
+
additionalInfo?: InputMaybe$1<AdditionalInfoInput>;
|
|
210
|
+
email?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
211
|
+
employeeId?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
212
|
+
firstName?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
213
|
+
id: Scalars$1['ID']['input'];
|
|
214
|
+
lastName?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
215
|
+
loginType?: InputMaybe$1<LoginType>;
|
|
216
|
+
phoneNumber?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
217
|
+
role: RoleType;
|
|
218
|
+
};
|
|
207
219
|
type VehicleGroupCreateInput = {
|
|
208
220
|
description?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
209
221
|
driverEnteredOdometerEnabled?: InputMaybe$1<Scalars$1['Boolean']['input']>;
|
|
@@ -445,6 +457,23 @@ type UserCreateMutation = {
|
|
|
445
457
|
updatedAt?: string | null;
|
|
446
458
|
} | null;
|
|
447
459
|
};
|
|
460
|
+
type UserUpdateMutationVariables = Exact$1<{
|
|
461
|
+
input: UserUpdateInput;
|
|
462
|
+
}>;
|
|
463
|
+
type UserUpdateMutation = {
|
|
464
|
+
__typename?: 'Mutation';
|
|
465
|
+
userUpdate?: {
|
|
466
|
+
__typename?: 'User';
|
|
467
|
+
id?: string | null;
|
|
468
|
+
firstName?: string | null;
|
|
469
|
+
lastName?: string | null;
|
|
470
|
+
email?: string | null;
|
|
471
|
+
phoneNumber?: string | null;
|
|
472
|
+
employeeId?: string | null;
|
|
473
|
+
role?: RoleType | null;
|
|
474
|
+
status?: UserStatus | null;
|
|
475
|
+
} | null;
|
|
476
|
+
};
|
|
448
477
|
type VehicleGroupCreateMutationVariables = Exact$1<{
|
|
449
478
|
input: VehicleGroupCreateInput;
|
|
450
479
|
}>;
|
|
@@ -578,6 +607,7 @@ declare function getOrganizationSdk(config: ElementPayOrganizationConfig): {
|
|
|
578
607
|
entityGetExternalId(variables?: EntityGetExternalIdQueryVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<EntityGetExternalIdQuery>;
|
|
579
608
|
machineTokenizeUser(variables?: MachineTokenizeUserMutationVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<MachineTokenizeUserMutation>;
|
|
580
609
|
userCreate(variables: UserCreateMutationVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<UserCreateMutation>;
|
|
610
|
+
userUpdate(variables: UserUpdateMutationVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<UserUpdateMutation>;
|
|
581
611
|
vehicleGroupCreate(variables: VehicleGroupCreateMutationVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<VehicleGroupCreateMutation>;
|
|
582
612
|
vehicleGroupDriversAdd(variables: VehicleGroupDriversAddMutationVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<VehicleGroupDriversAddMutation>;
|
|
583
613
|
vehicleGroupVehiclesAdd(variables: VehicleGroupVehiclesAddMutationVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<VehicleGroupVehiclesAddMutation>;
|
|
@@ -777,6 +807,11 @@ interface RawService {
|
|
|
777
807
|
name: string;
|
|
778
808
|
};
|
|
779
809
|
}
|
|
810
|
+
interface RawAmenity {
|
|
811
|
+
id: string;
|
|
812
|
+
name: string;
|
|
813
|
+
description: string;
|
|
814
|
+
}
|
|
780
815
|
interface ServiceLocationFromEvent {
|
|
781
816
|
id: string;
|
|
782
817
|
provider_id: string;
|
|
@@ -794,7 +829,7 @@ interface ServiceLocationFromEvent {
|
|
|
794
829
|
lng: number;
|
|
795
830
|
lat: number;
|
|
796
831
|
};
|
|
797
|
-
amenities:
|
|
832
|
+
amenities: RawAmenity[] | null;
|
|
798
833
|
services: RawService[];
|
|
799
834
|
phone: string;
|
|
800
835
|
integration: string;
|
package/lib/index.d.ts
CHANGED
|
@@ -67,6 +67,7 @@ type ClientOnboardInput = {
|
|
|
67
67
|
integratorId?: InputMaybe$1<Scalars$1['ID']['input']>;
|
|
68
68
|
name: Scalars$1['String']['input'];
|
|
69
69
|
onboardedBy?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
70
|
+
phoneNumber?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
70
71
|
taxId?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
71
72
|
unitsId?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
72
73
|
useTspMetadata?: InputMaybe$1<Scalars$1['Boolean']['input']>;
|
|
@@ -205,6 +206,17 @@ declare enum UserStatus {
|
|
|
205
206
|
Onboarded = "ONBOARDED",
|
|
206
207
|
Unknown = "UNKNOWN",
|
|
207
208
|
}
|
|
209
|
+
type UserUpdateInput = {
|
|
210
|
+
additionalInfo?: InputMaybe$1<AdditionalInfoInput>;
|
|
211
|
+
email?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
212
|
+
employeeId?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
213
|
+
firstName?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
214
|
+
id: Scalars$1['ID']['input'];
|
|
215
|
+
lastName?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
216
|
+
loginType?: InputMaybe$1<LoginType>;
|
|
217
|
+
phoneNumber?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
218
|
+
role: RoleType;
|
|
219
|
+
};
|
|
208
220
|
type VehicleGroupCreateInput = {
|
|
209
221
|
description?: InputMaybe$1<Scalars$1['String']['input']>;
|
|
210
222
|
driverEnteredOdometerEnabled?: InputMaybe$1<Scalars$1['Boolean']['input']>;
|
|
@@ -446,6 +458,23 @@ type UserCreateMutation = {
|
|
|
446
458
|
updatedAt?: string | null;
|
|
447
459
|
} | null;
|
|
448
460
|
};
|
|
461
|
+
type UserUpdateMutationVariables = Exact$1<{
|
|
462
|
+
input: UserUpdateInput;
|
|
463
|
+
}>;
|
|
464
|
+
type UserUpdateMutation = {
|
|
465
|
+
__typename?: 'Mutation';
|
|
466
|
+
userUpdate?: {
|
|
467
|
+
__typename?: 'User';
|
|
468
|
+
id?: string | null;
|
|
469
|
+
firstName?: string | null;
|
|
470
|
+
lastName?: string | null;
|
|
471
|
+
email?: string | null;
|
|
472
|
+
phoneNumber?: string | null;
|
|
473
|
+
employeeId?: string | null;
|
|
474
|
+
role?: RoleType | null;
|
|
475
|
+
status?: UserStatus | null;
|
|
476
|
+
} | null;
|
|
477
|
+
};
|
|
449
478
|
type VehicleGroupCreateMutationVariables = Exact$1<{
|
|
450
479
|
input: VehicleGroupCreateInput;
|
|
451
480
|
}>;
|
|
@@ -579,6 +608,7 @@ declare function getOrganizationSdk(config: ElementPayOrganizationConfig): {
|
|
|
579
608
|
entityGetExternalId(variables?: EntityGetExternalIdQueryVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<EntityGetExternalIdQuery>;
|
|
580
609
|
machineTokenizeUser(variables?: MachineTokenizeUserMutationVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<MachineTokenizeUserMutation>;
|
|
581
610
|
userCreate(variables: UserCreateMutationVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<UserCreateMutation>;
|
|
611
|
+
userUpdate(variables: UserUpdateMutationVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<UserUpdateMutation>;
|
|
582
612
|
vehicleGroupCreate(variables: VehicleGroupCreateMutationVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<VehicleGroupCreateMutation>;
|
|
583
613
|
vehicleGroupDriversAdd(variables: VehicleGroupDriversAddMutationVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<VehicleGroupDriversAddMutation>;
|
|
584
614
|
vehicleGroupVehiclesAdd(variables: VehicleGroupVehiclesAddMutationVariables, requestHeaders?: HeadersInit | undefined, signal?: RequestInit["signal"]): Promise<VehicleGroupVehiclesAddMutation>;
|
|
@@ -778,6 +808,11 @@ interface RawService {
|
|
|
778
808
|
name: string;
|
|
779
809
|
};
|
|
780
810
|
}
|
|
811
|
+
interface RawAmenity {
|
|
812
|
+
id: string;
|
|
813
|
+
name: string;
|
|
814
|
+
description: string;
|
|
815
|
+
}
|
|
781
816
|
interface ServiceLocationFromEvent {
|
|
782
817
|
id: string;
|
|
783
818
|
provider_id: string;
|
|
@@ -795,7 +830,7 @@ interface ServiceLocationFromEvent {
|
|
|
795
830
|
lng: number;
|
|
796
831
|
lat: number;
|
|
797
832
|
};
|
|
798
|
-
amenities:
|
|
833
|
+
amenities: RawAmenity[] | null;
|
|
799
834
|
services: RawService[];
|
|
800
835
|
phone: string;
|
|
801
836
|
integration: string;
|
package/lib/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";import{decode as n}from"@msgpack/msgpack";import{FUEL_BRANDS as r}from"@autofleet/common-types/lib/pit-stop";const
|
|
1
|
+
import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";import{decode as n}from"@msgpack/msgpack";import{FUEL_BRANDS as r,FUEL_TYPES as i}from"@autofleet/common-types/lib/pit-stop";const a=t`
|
|
2
2
|
mutation apiKeyCreate($input: ApiKeyCreateInput!) {
|
|
3
3
|
apiKeyCreate(input: $input) {
|
|
4
4
|
apiKey
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
`,
|
|
7
|
+
`,o=t`
|
|
8
8
|
mutation clientOnboard($input: ClientOnboardInput!) {
|
|
9
9
|
clientOnboard(input: $input) {
|
|
10
10
|
id
|
|
@@ -15,7 +15,7 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
15
15
|
deletedAt
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
`,
|
|
18
|
+
`,s=t`
|
|
19
19
|
mutation organizationCreate($input: OrganizationCreateInput!) {
|
|
20
20
|
organizationCreate(input: $input) {
|
|
21
21
|
id
|
|
@@ -35,7 +35,7 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
35
35
|
deletedAt
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
`,
|
|
38
|
+
`,c=t`
|
|
39
39
|
mutation entityCreate($input: EntityCreateInput!) {
|
|
40
40
|
entityCreate(input: $input) {
|
|
41
41
|
id
|
|
@@ -49,7 +49,7 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
49
49
|
updatedAt
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
`,
|
|
52
|
+
`,l=t`
|
|
53
53
|
query entityGetExternalId($externalId: String) {
|
|
54
54
|
entity(externalId: $externalId) {
|
|
55
55
|
id
|
|
@@ -90,14 +90,14 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
`,
|
|
93
|
+
`,u=t`
|
|
94
94
|
mutation machineTokenizeUser($input: MachineTokenizeUserInput) {
|
|
95
95
|
machineTokenizeUser(input: $input) {
|
|
96
96
|
access_token
|
|
97
97
|
expires_in
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
`,
|
|
100
|
+
`,d=t`
|
|
101
101
|
mutation userCreate($input: UserCreateInput!) {
|
|
102
102
|
userCreate(input: $input) {
|
|
103
103
|
id
|
|
@@ -117,7 +117,20 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
117
117
|
updatedAt
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
`,
|
|
120
|
+
`,f=t`
|
|
121
|
+
mutation userUpdate($input: UserUpdateInput!) {
|
|
122
|
+
userUpdate(input: $input) {
|
|
123
|
+
id
|
|
124
|
+
firstName
|
|
125
|
+
lastName
|
|
126
|
+
email
|
|
127
|
+
phoneNumber
|
|
128
|
+
employeeId
|
|
129
|
+
role
|
|
130
|
+
status
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
`,p=t`
|
|
121
134
|
mutation vehicleGroupCreate($input: VehicleGroupCreateInput!) {
|
|
122
135
|
vehicleGroupCreate(input: $input) {
|
|
123
136
|
id
|
|
@@ -131,7 +144,7 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
131
144
|
updatedAt
|
|
132
145
|
}
|
|
133
146
|
}
|
|
134
|
-
`,
|
|
147
|
+
`,m=t`
|
|
135
148
|
mutation vehicleGroupDriversAdd($input: VehicleGroupDriversAddInput!) {
|
|
136
149
|
vehicleGroupDriversAdd(input: $input) {
|
|
137
150
|
id
|
|
@@ -144,7 +157,7 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
144
157
|
updatedAt
|
|
145
158
|
}
|
|
146
159
|
}
|
|
147
|
-
`,
|
|
160
|
+
`,h=t`
|
|
148
161
|
mutation vehicleGroupVehiclesAdd($input: VehicleGroupVehiclesAddInput!) {
|
|
149
162
|
vehicleGroupVehiclesAdd(input: $input) {
|
|
150
163
|
id
|
|
@@ -157,11 +170,11 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
157
170
|
updatedAt
|
|
158
171
|
}
|
|
159
172
|
}
|
|
160
|
-
`,
|
|
173
|
+
`,g=t`
|
|
161
174
|
mutation vehicleUpdate($input: VehicleUpdateInput!) {
|
|
162
175
|
vehicleUpdate(input: $input)
|
|
163
176
|
}
|
|
164
|
-
`,
|
|
177
|
+
`,_=t`
|
|
165
178
|
query vehiclesFilter($input: VehiclesFilterInput!) {
|
|
166
179
|
vehiclesFilter(input: $input) {
|
|
167
180
|
data {
|
|
@@ -175,7 +188,7 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
175
188
|
}
|
|
176
189
|
}
|
|
177
190
|
}
|
|
178
|
-
`,
|
|
191
|
+
`,v=t`
|
|
179
192
|
query vehicleGroupsFilter($input: VehicleGroupsFilterInput!) {
|
|
180
193
|
vehicleGroupsFilter(input: $input) {
|
|
181
194
|
data {
|
|
@@ -191,7 +204,7 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
191
204
|
}
|
|
192
205
|
}
|
|
193
206
|
}
|
|
194
|
-
`,
|
|
207
|
+
`,y=t`
|
|
195
208
|
mutation vehiclesOnboard($input: VehiclesOnboardInputList!) {
|
|
196
209
|
vehiclesOnboard(input: $input) {
|
|
197
210
|
vehicles {
|
|
@@ -203,7 +216,7 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
203
216
|
}
|
|
204
217
|
}
|
|
205
218
|
}
|
|
206
|
-
`,
|
|
219
|
+
`,b=(e,t,n,r)=>e();function x(e,t=b){return{apiKeyCreate(n,r,i){return t(t=>e.request({document:a,variables:n,requestHeaders:{...r,...t},signal:i}),`apiKeyCreate`,`mutation`,n)},clientOnboard(n,r,i){return t(t=>e.request({document:o,variables:n,requestHeaders:{...r,...t},signal:i}),`clientOnboard`,`mutation`,n)},organizationCreate(n,r,i){return t(t=>e.request({document:s,variables:n,requestHeaders:{...r,...t},signal:i}),`organizationCreate`,`mutation`,n)},entityCreate(n,r,i){return t(t=>e.request({document:c,variables:n,requestHeaders:{...r,...t},signal:i}),`entityCreate`,`mutation`,n)},entityGetExternalId(n,r,i){return t(t=>e.request({document:l,variables:n,requestHeaders:{...r,...t},signal:i}),`entityGetExternalId`,`query`,n)},machineTokenizeUser(n,r,i){return t(t=>e.request({document:u,variables:n,requestHeaders:{...r,...t},signal:i}),`machineTokenizeUser`,`mutation`,n)},userCreate(n,r,i){return t(t=>e.request({document:d,variables:n,requestHeaders:{...r,...t},signal:i}),`userCreate`,`mutation`,n)},userUpdate(n,r,i){return t(t=>e.request({document:f,variables:n,requestHeaders:{...r,...t},signal:i}),`userUpdate`,`mutation`,n)},vehicleGroupCreate(n,r,i){return t(t=>e.request({document:p,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupCreate`,`mutation`,n)},vehicleGroupDriversAdd(n,r,i){return t(t=>e.request({document:m,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupDriversAdd`,`mutation`,n)},vehicleGroupVehiclesAdd(n,r,i){return t(t=>e.request({document:h,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupVehiclesAdd`,`mutation`,n)},vehicleUpdate(n,r,i){return t(t=>e.request({document:g,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleUpdate`,`mutation`,n)},vehiclesFilter(n,r,i){return t(t=>e.request({document:_,variables:n,requestHeaders:{...r,...t},signal:i}),`vehiclesFilter`,`query`,n)},vehicleGroupsFilter(n,r,i){return t(t=>e.request({document:v,variables:n,requestHeaders:{...r,...t},signal:i}),`vehicleGroupsFilter`,`query`,n)},vehiclesOnboard(n,r,i){return t(t=>e.request({document:y,variables:n,requestHeaders:{...r,...t},signal:i}),`vehiclesOnboard`,`mutation`,n)}}}const S={int:`https://api-gateway.int.gocariq.com/`,stage:`https://api-gateway.stage.gocariq.com/`};function C(t){let n=t.environment??`stage`;return x(new e(t.endpoint??S[n],{headers:{"x-api-key":t.apiKey,"Content-Type":`application/json`}}))}const w=t`
|
|
207
220
|
mutation provisionCard($input: ProvisionCardInput!) {
|
|
208
221
|
provisionCard(input: $input) {
|
|
209
222
|
encryptedData
|
|
@@ -214,20 +227,20 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
214
227
|
cardNetwork
|
|
215
228
|
}
|
|
216
229
|
}
|
|
217
|
-
`,
|
|
230
|
+
`,T=t`
|
|
218
231
|
mutation provisionStatusUpdate($input: ProvisionStatusUpdateInput!) {
|
|
219
232
|
provisionStatusUpdate(input: $input) {
|
|
220
233
|
success
|
|
221
234
|
}
|
|
222
235
|
}
|
|
223
|
-
`,
|
|
236
|
+
`,E=t`
|
|
224
237
|
mutation servicePay($input: ServicePayInput!) {
|
|
225
238
|
servicePay(input: $input) {
|
|
226
239
|
requestId
|
|
227
240
|
transactionId
|
|
228
241
|
}
|
|
229
242
|
}
|
|
230
|
-
`,
|
|
243
|
+
`,D=t`
|
|
231
244
|
mutation ttpTokenization($input: TtpTokenizationInput!) {
|
|
232
245
|
ttpTokenization(input: $input) {
|
|
233
246
|
requestId
|
|
@@ -246,5 +259,5 @@ import{GraphQLClient as e}from"graphql-request";import t from"graphql-tag";impor
|
|
|
246
259
|
cardFlag
|
|
247
260
|
}
|
|
248
261
|
}
|
|
249
|
-
`,
|
|
262
|
+
`,O=(e,t,n,r)=>e();function k(e,t=O){return{provisionCard(n,r,i){return t(t=>e.request({document:w,variables:n,requestHeaders:{...r,...t},signal:i}),`provisionCard`,`mutation`,n)},provisionStatusUpdate(n,r,i){return t(t=>e.request({document:T,variables:n,requestHeaders:{...r,...t},signal:i}),`provisionStatusUpdate`,`mutation`,n)},servicePay(n,r,i){return t(t=>e.request({document:E,variables:n,requestHeaders:{...r,...t},signal:i}),`servicePay`,`mutation`,n)},ttpTokenization(n,r,i){return t(t=>e.request({document:D,variables:n,requestHeaders:{...r,...t},signal:i}),`ttpTokenization`,`mutation`,n)}}}function A(t){let n=t.environment??`stage`;return k(new e(t.endpoint??S[n],{headers:{Authorization:`Bearer ${t.accessToken}`,"Content-Type":`application/json`}}))}const j=e=>n(Buffer.from(e,`base64`)),M=e=>{let t=j(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},N={EXXON:r.EXXONMOBIL,MOBIL:r.EXXONMOBIL,SHELL:r.SHELL,SUNOCO:r.SUNOCO},P={REGULAR:i.UNLEADED_REGULAR,MID_GRADE_UNLEADED:i.UNLEADED_PLUS,"MID GRADE UNLEADED":i.UNLEADED_PLUS,UNLEADED_PREMIUM:i.UNLEADED_PREMIUM,"UNLEADED PREMIUM":i.UNLEADED_PREMIUM,DIESEL:i.DIESEL_REGULAR,DIESEL_PREMIUM:i.DIESEL_PREMIUM,"DIESEL PREMIUM":i.DIESEL_PREMIUM,OTHER_FUEL:i.OTHER_FUEL,"OTHER FUEL":i.OTHER_FUEL,HI_FLOW_DIESEL:i.HI_FLOW_DIESEL,"HI-FLOW DIESEL":i.HI_FLOW_DIESEL},F=e=>e.reduce((e,t)=>{let n=P[t.name];return n&&(e[n]=`0.0`),e},{}),I=e=>(e??[]).map(({name:e,description:t})=>({name:e,description:t})),L=e=>Object.entries(e.ExternalIdMap??{}).find(([,t])=>t===e.PriceApiId)?.[0],R=({serviceLocationEvent:e})=>{let t=e.ServiceLocation,{address:n,geocoded:r,services:i,amenities:a}=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:N[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,typesPrices:F(i),amenities:I(a),priceSourceId:e.PriceApiId,priceSourceType:L(e)}},z=e=>R({serviceLocationEvent:M(e)});export{C as getOrganizationSdk,A as getUserSdk,z as serviceLocationPubSubMessageToFuelSupplier};
|
|
250
263
|
//# sourceMappingURL=index.js.map
|