(
key: IntegrationTaskKey,
params: UpsertCustomerParams
)
| 126 | } |
| 127 | |
| 128 | upsertCustomer( |
| 129 | key: IntegrationTaskKey, |
| 130 | params: UpsertCustomerParams |
| 131 | ): Promise<UpsertCustomerResponse> { |
| 132 | return this.runTask( |
| 133 | key, |
| 134 | async (client) => { |
| 135 | const response = await client.upsertCustomer(params); |
| 136 | |
| 137 | if (response.error) { |
| 138 | throw response.error; |
| 139 | } else { |
| 140 | return recursivelyRemoveTypenameProperties(response.data); |
| 141 | } |
| 142 | }, |
| 143 | { |
| 144 | name: "Upsert Customer", |
| 145 | params, |
| 146 | icon: "plain", |
| 147 | properties: [ |
| 148 | ...(params.identifier.customerId |
| 149 | ? [{ label: "Customer ID", text: params.identifier.customerId }] |
| 150 | : []), |
| 151 | ...(params.identifier.emailAddress |
| 152 | ? [{ label: "Email", text: params.identifier.emailAddress }] |
| 153 | : []), |
| 154 | ...(params.identifier.externalId |
| 155 | ? [{ label: "External ID", text: params.identifier.externalId }] |
| 156 | : []), |
| 157 | ], |
| 158 | } |
| 159 | ); |
| 160 | } |
| 161 | |
| 162 | upsertCustomTimelineEntry( |
| 163 | key: IntegrationTaskKey, |
no test coverage detected