pingram 0.1.4-alpha.783 → 0.1.4-alpha.784
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/dist-esm/generated/src/apis/AccountApi.js +440 -0
- package/dist-esm/generated/src/apis/AddressesApi.js +180 -0
- package/dist-esm/generated/src/apis/ComponentsApi.js +348 -0
- package/dist-esm/generated/src/apis/DefaultApi.js +75 -0
- package/dist-esm/generated/src/apis/DomainsApi.js +179 -0
- package/dist-esm/generated/src/apis/EditorApi.js +75 -0
- package/dist-esm/generated/src/apis/EnvironmentsApi.js +184 -0
- package/dist-esm/generated/src/apis/HealthApi.js +42 -0
- package/dist-esm/generated/src/apis/InsightsApi.js +75 -0
- package/dist-esm/generated/src/apis/KeysApi.js +179 -0
- package/dist-esm/generated/src/apis/LogsApi.js +333 -0
- package/dist-esm/generated/src/apis/MembersApi.js +371 -0
- package/dist-esm/generated/src/apis/SenderApi.js +188 -0
- package/dist-esm/generated/src/apis/TemplatesApi.js +423 -0
- package/dist-esm/generated/src/apis/TypesApi.js +294 -0
- package/dist-esm/generated/src/apis/UserApi.js +512 -0
- package/dist-esm/generated/src/apis/UsersApi.js +203 -0
- package/dist-esm/generated/src/apis/index.js +19 -0
- package/dist-esm/generated/src/index.js +5 -0
- package/dist-esm/generated/src/models/AccountAddressesResponse.js +44 -0
- package/dist-esm/generated/src/models/AccountAddressesResponseAddressesInner.js +70 -0
- package/dist-esm/generated/src/models/AccountGetResponse.js +108 -0
- package/dist-esm/generated/src/models/AccountGetResponsePendingDowngradeUsageLimit.js +53 -0
- package/dist-esm/generated/src/models/AddressResponse.js +44 -0
- package/dist-esm/generated/src/models/AutoJoinGetResponse.js +47 -0
- package/dist-esm/generated/src/models/AutoJoinPostResponse.js +47 -0
- package/dist-esm/generated/src/models/AutoJoinRequestBody.js +43 -0
- package/dist-esm/generated/src/models/BeeTokenV2.js +47 -0
- package/dist-esm/generated/src/models/BillingPostRequestBody.js +51 -0
- package/dist-esm/generated/src/models/BillingPostResponseBody.js +112 -0
- package/dist-esm/generated/src/models/BillingPostResponseBodyPendingDowngradeUsageLimit.js +53 -0
- package/dist-esm/generated/src/models/ChannelsEnum.js +50 -0
- package/dist-esm/generated/src/models/CreateAccountRequestBody.js +43 -0
- package/dist-esm/generated/src/models/CreateAccountResponse.js +47 -0
- package/dist-esm/generated/src/models/CreateAddressRequest.js +47 -0
- package/dist-esm/generated/src/models/CreateKeyRequest.js +58 -0
- package/dist-esm/generated/src/models/CreateKeyResponse.js +70 -0
- package/dist-esm/generated/src/models/DeleteKeyResponse.js +43 -0
- package/dist-esm/generated/src/models/DeleteUserResponse.js +43 -0
- package/dist-esm/generated/src/models/EmailAuthTokenPostRequest.js +41 -0
- package/dist-esm/generated/src/models/EmailComponentPatchRequest.js +47 -0
- package/dist-esm/generated/src/models/EmailComponentPostRequest.js +53 -0
- package/dist-esm/generated/src/models/EmailComponentResponse.js +88 -0
- package/dist-esm/generated/src/models/EmailComponentResponseReferencedByInner.js +52 -0
- package/dist-esm/generated/src/models/Environment.js +60 -0
- package/dist-esm/generated/src/models/EnvironmentCreateRequest.js +43 -0
- package/dist-esm/generated/src/models/EnvironmentPatchRequest.js +52 -0
- package/dist-esm/generated/src/models/GetAccountMetadataResponse.js +45 -0
- package/dist-esm/generated/src/models/GetAccountMetadataResponseUserAccountMetadata.js +53 -0
- package/dist-esm/generated/src/models/GetEmailComponentsResponseInner.js +88 -0
- package/dist-esm/generated/src/models/GetEnvironmentsResponseInner.js +60 -0
- package/dist-esm/generated/src/models/GetInappNotificationsResponse.js +44 -0
- package/dist-esm/generated/src/models/GetInappNotificationsResponseNotificationsInner.js +96 -0
- package/dist-esm/generated/src/models/GetInappNotificationsResponseNotificationsInnerDeliveryOptions.js +63 -0
- package/dist-esm/generated/src/models/GetInappNotificationsResponseNotificationsInnerDeliveryOptionsInstant.js +49 -0
- package/dist-esm/generated/src/models/GetInappNotificationsResponseNotificationsInnerDeliveryOptionsOff.js +43 -0
- package/dist-esm/generated/src/models/GetInappNotificationsResponseNotificationsInnerRepliesInner.js +47 -0
- package/dist-esm/generated/src/models/GetInappNotificationsResponseNotificationsInnerTemplate.js +62 -0
- package/dist-esm/generated/src/models/GetInappNotificationsResponseNotificationsInnerTemplateAnyOf.js +62 -0
- package/dist-esm/generated/src/models/GetKeysResponse.js +44 -0
- package/dist-esm/generated/src/models/GetKeysResponseKeysInner.js +80 -0
- package/dist-esm/generated/src/models/GetLogsResponse.js +46 -0
- package/dist-esm/generated/src/models/GetLogsResponseMessagesInner.js +100 -0
- package/dist-esm/generated/src/models/GetLogsResponseMessagesInnerAttachmentsInner.js +53 -0
- package/dist-esm/generated/src/models/GetMembersResponseInner.js +55 -0
- package/dist-esm/generated/src/models/GetMetricsResponseInner.js +67 -0
- package/dist-esm/generated/src/models/GetMetricsResponseInnerMessagesInner.js +43 -0
- package/dist-esm/generated/src/models/GetNotificationsResponseInner.js +84 -0
- package/dist-esm/generated/src/models/GetNotificationsResponseInnerDeduplication.js +43 -0
- package/dist-esm/generated/src/models/GetNotificationsResponseInnerOptions.js +69 -0
- package/dist-esm/generated/src/models/GetNotificationsResponseInnerOptionsEMAIL.js +85 -0
- package/dist-esm/generated/src/models/GetNotificationsResponseInnerOptionsEMAILDaily.js +45 -0
- package/dist-esm/generated/src/models/GetNotificationsResponseInnerOptionsEMAILMonthly.js +56 -0
- package/dist-esm/generated/src/models/GetNotificationsResponseInnerOptionsEMAILWeekly.js +47 -0
- package/dist-esm/generated/src/models/GetNotificationsResponseInnerTemplatesInner.js +48 -0
- package/dist-esm/generated/src/models/GetNotificationsResponseInnerThrottling.js +81 -0
- package/dist-esm/generated/src/models/GetSendersResponseInner.js +103 -0
- package/dist-esm/generated/src/models/GetTemplatesResponse.js +62 -0
- package/dist-esm/generated/src/models/GetUsersResponse.js +50 -0
- package/dist-esm/generated/src/models/GetUsersResponseUsersInner.js +81 -0
- package/dist-esm/generated/src/models/GetUsersResponseUsersInnerEmailSuppressionStatus.js +56 -0
- package/dist-esm/generated/src/models/GetUsersResponseUsersInnerPushTokensInner.js +63 -0
- package/dist-esm/generated/src/models/GetUsersResponseUsersInnerPushTokensInnerDevice.js +53 -0
- package/dist-esm/generated/src/models/GetUsersResponseUsersInnerSlackToken.js +93 -0
- package/dist-esm/generated/src/models/GetUsersResponseUsersInnerSlackTokenAuthedUser.js +51 -0
- package/dist-esm/generated/src/models/GetUsersResponseUsersInnerSlackTokenEnterprise.js +43 -0
- package/dist-esm/generated/src/models/GetUsersResponseUsersInnerSlackTokenIncomingWebhook.js +47 -0
- package/dist-esm/generated/src/models/GetUsersResponseUsersInnerSlackTokenResponseMetadata.js +51 -0
- package/dist-esm/generated/src/models/GetUsersResponseUsersInnerWebPushTokensInner.js +44 -0
- package/dist-esm/generated/src/models/GetUsersResponseUsersInnerWebPushTokensInnerSub.js +48 -0
- package/dist-esm/generated/src/models/GetUsersResponseUsersInnerWebPushTokensInnerSubKeys.js +47 -0
- package/dist-esm/generated/src/models/InAppNotificationPatchRequest.js +64 -0
- package/dist-esm/generated/src/models/InAppNotificationUnreadClearRequest.js +43 -0
- package/dist-esm/generated/src/models/InappUnreadCountResponse.js +43 -0
- package/dist-esm/generated/src/models/InboundRequestBody.js +31 -0
- package/dist-esm/generated/src/models/InboundResponseBody.js +58 -0
- package/dist-esm/generated/src/models/InboundResponseBodyResultsInner.js +70 -0
- package/dist-esm/generated/src/models/IngishtsPostRequest.js +73 -0
- package/dist-esm/generated/src/models/IngishtsPostRequestLabelOptions.js +41 -0
- package/dist-esm/generated/src/models/IngishtsPostRequestMetricDataQueriesInner.js +56 -0
- package/dist-esm/generated/src/models/IngishtsPostRequestMetricDataQueriesInnerMetricStat.js +84 -0
- package/dist-esm/generated/src/models/IngishtsPostRequestMetricDataQueriesInnerMetricStatMetric.js +50 -0
- package/dist-esm/generated/src/models/IngishtsPostRequestMetricDataQueriesInnerMetricStatMetricDimensionsInner.js +43 -0
- package/dist-esm/generated/src/models/IntercomWebhook.js +68 -0
- package/dist-esm/generated/src/models/IntercomWebhookData.js +44 -0
- package/dist-esm/generated/src/models/IntercomWebhookDataItem.js +114 -0
- package/dist-esm/generated/src/models/IntercomWebhookDataItemAnyOf.js +114 -0
- package/dist-esm/generated/src/models/IntercomWebhookDataItemAnyOfContacts.js +56 -0
- package/dist-esm/generated/src/models/IntercomWebhookDataItemAnyOfContactsContactsInner.js +49 -0
- package/dist-esm/generated/src/models/IntercomWebhookDataItemAnyOfSource.js +60 -0
- package/dist-esm/generated/src/models/IntercomWebhookDataItemAnyOfSourceAuthor.js +51 -0
- package/dist-esm/generated/src/models/InvitePostResponse.js +43 -0
- package/dist-esm/generated/src/models/LogQueryPostBody.js +67 -0
- package/dist-esm/generated/src/models/LogsBulkRequest.js +43 -0
- package/dist-esm/generated/src/models/LogsGetResponse.js +44 -0
- package/dist-esm/generated/src/models/LogsGetResponseLogsInner.js +832 -0
- package/dist-esm/generated/src/models/LogsQueryResponse.js +43 -0
- package/dist-esm/generated/src/models/LogsQueryResultResponse.js +54 -0
- package/dist-esm/generated/src/models/LogsRetentionResponse.js +43 -0
- package/dist-esm/generated/src/models/LogsTailResponse.js +44 -0
- package/dist-esm/generated/src/models/MemberInviteRequest.js +45 -0
- package/dist-esm/generated/src/models/MemberUpdateRequest.js +43 -0
- package/dist-esm/generated/src/models/MessageResponse.js +43 -0
- package/dist-esm/generated/src/models/Notification.js +84 -0
- package/dist-esm/generated/src/models/NotificationCreateRequest.js +56 -0
- package/dist-esm/generated/src/models/NotificationPatchRequest.js +67 -0
- package/dist-esm/generated/src/models/PostEmailTestRequest.js +65 -0
- package/dist-esm/generated/src/models/PostEmailTestResponse.js +45 -0
- package/dist-esm/generated/src/models/PostSendersRequestBody.js +43 -0
- package/dist-esm/generated/src/models/PostUserRequest.js +68 -0
- package/dist-esm/generated/src/models/SenderPostBody.js +110 -0
- package/dist-esm/generated/src/models/SenderPostBodyEmail.js +53 -0
- package/dist-esm/generated/src/models/SenderPostBodyInapp.js +47 -0
- package/dist-esm/generated/src/models/SenderPostBodyMobilePush.js +47 -0
- package/dist-esm/generated/src/models/SenderPostBodyOptions.js +54 -0
- package/dist-esm/generated/src/models/SenderPostBodyOptionsApn.js +53 -0
- package/dist-esm/generated/src/models/SenderPostBodyOptionsEmail.js +58 -0
- package/dist-esm/generated/src/models/SenderPostBodyOptionsEmailAttachmentsInner.js +53 -0
- package/dist-esm/generated/src/models/SenderPostBodyOptionsEmailAttachmentsInnerAnyOf.js +47 -0
- package/dist-esm/generated/src/models/SenderPostBodyOptionsEmailAttachmentsInnerAnyOf1.js +49 -0
- package/dist-esm/generated/src/models/SenderPostBodyOptionsFcm.js +44 -0
- package/dist-esm/generated/src/models/SenderPostBodyOptionsFcmAndroid.js +58 -0
- package/dist-esm/generated/src/models/SenderPostBodySlack.js +77 -0
- package/dist-esm/generated/src/models/SenderPostBodySlackMetadata.js +50 -0
- package/dist-esm/generated/src/models/SenderPostBodySlackMetadataEntitiesInner.js +58 -0
- package/dist-esm/generated/src/models/SenderPostBodySlackMetadataEntitiesInnerExternalRef.js +45 -0
- package/dist-esm/generated/src/models/SenderPostBodySms.js +46 -0
- package/dist-esm/generated/src/models/SenderPostBodySmsAutoReply.js +43 -0
- package/dist-esm/generated/src/models/SenderPostBodyTo.js +79 -0
- package/dist-esm/generated/src/models/SenderPostBodyUser.js +81 -0
- package/dist-esm/generated/src/models/SenderPostBodyWebPush.js +51 -0
- package/dist-esm/generated/src/models/SenderPostResponse.js +47 -0
- package/dist-esm/generated/src/models/SetDefaultTemplateRequest.js +59 -0
- package/dist-esm/generated/src/models/SlackInteractivityResponse.js +43 -0
- package/dist-esm/generated/src/models/SlackOauthRequest.js +47 -0
- package/dist-esm/generated/src/models/SuccessResponse.js +43 -0
- package/dist-esm/generated/src/models/SupabaseConfigureRequest.js +55 -0
- package/dist-esm/generated/src/models/SupabaseConfigureResponse.js +45 -0
- package/dist-esm/generated/src/models/SupabaseOAuthRequest.js +51 -0
- package/dist-esm/generated/src/models/SupabaseOAuthResponse.js +45 -0
- package/dist-esm/generated/src/models/SupabaseProjectsResponse.js +44 -0
- package/dist-esm/generated/src/models/SupabaseProjectsResponseProjectsInner.js +59 -0
- package/dist-esm/generated/src/models/SupabaseStatusResponse.js +51 -0
- package/dist-esm/generated/src/models/Template.js +62 -0
- package/dist-esm/generated/src/models/TemplatePatchRequest.js +67 -0
- package/dist-esm/generated/src/models/TemplatePatchRequestAnyOf.js +51 -0
- package/dist-esm/generated/src/models/TemplatePatchRequestAnyOf1.js +55 -0
- package/dist-esm/generated/src/models/TemplatePatchRequestAnyOf1Batch.js +51 -0
- package/dist-esm/generated/src/models/TemplatePatchRequestAnyOf1Instant.js +47 -0
- package/dist-esm/generated/src/models/TemplatePostRequest.js +85 -0
- package/dist-esm/generated/src/models/TemplatePostRequestBatch.js +51 -0
- package/dist-esm/generated/src/models/TemplatePostRequestInstant.js +47 -0
- package/dist-esm/generated/src/models/UpdateAddressRequest.js +47 -0
- package/dist-esm/generated/src/models/User.js +81 -0
- package/dist-esm/generated/src/models/UserSuppressionDeleteResponse.js +44 -0
- package/dist-esm/generated/src/models/WebhookResponse.js +49 -0
- package/dist-esm/generated/src/models/index.js +159 -0
- package/dist-esm/generated/src/runtime.js +328 -0
- package/dist-esm/index.js +6 -0
- package/dist-esm/src/client.js +158 -0
- package/dist-esm/src/index.js +44 -0
- package/dist-esm/src/testing.js +119 -0
- package/package.json +12 -4
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* NotificationAPI
|
|
5
|
+
* Internal API for notification delivery and management
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
import * as runtime from '../runtime';
|
|
15
|
+
import { AccountGetResponseFromJSON, BillingPostRequestBodyToJSON, BillingPostResponseBodyFromJSON, CreateAccountRequestBodyToJSON, CreateAccountResponseFromJSON, SupabaseConfigureRequestToJSON, SupabaseConfigureResponseFromJSON, SupabaseOAuthRequestToJSON, SupabaseOAuthResponseFromJSON, SupabaseProjectsResponseFromJSON, SupabaseStatusResponseFromJSON } from '../models/index';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export class AccountApi extends runtime.BaseAPI {
|
|
20
|
+
/**
|
|
21
|
+
* Configure SMTP settings for a Supabase project
|
|
22
|
+
*/
|
|
23
|
+
async configureSupabaseSMTPRaw(requestParameters, initOverrides) {
|
|
24
|
+
if (requestParameters['supabaseConfigureRequest'] == null) {
|
|
25
|
+
throw new runtime.RequiredError('supabaseConfigureRequest', 'Required parameter "supabaseConfigureRequest" was null or undefined when calling configureSupabaseSMTP().');
|
|
26
|
+
}
|
|
27
|
+
const queryParameters = {};
|
|
28
|
+
const headerParameters = {};
|
|
29
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
30
|
+
if (this.configuration &&
|
|
31
|
+
(this.configuration.username !== undefined ||
|
|
32
|
+
this.configuration.password !== undefined)) {
|
|
33
|
+
headerParameters['Authorization'] =
|
|
34
|
+
'Basic ' +
|
|
35
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
36
|
+
}
|
|
37
|
+
if (this.configuration &&
|
|
38
|
+
(this.configuration.username !== undefined ||
|
|
39
|
+
this.configuration.password !== undefined)) {
|
|
40
|
+
headerParameters['Authorization'] =
|
|
41
|
+
'Basic ' +
|
|
42
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
43
|
+
}
|
|
44
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
45
|
+
const token = this.configuration.accessToken;
|
|
46
|
+
const tokenString = await token('apiKey', []);
|
|
47
|
+
if (tokenString) {
|
|
48
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (this.configuration &&
|
|
52
|
+
(this.configuration.username !== undefined ||
|
|
53
|
+
this.configuration.password !== undefined)) {
|
|
54
|
+
headerParameters['Authorization'] =
|
|
55
|
+
'Basic ' +
|
|
56
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
57
|
+
}
|
|
58
|
+
let urlPath = `/account/supabase/configure`;
|
|
59
|
+
const response = await this.request({
|
|
60
|
+
path: urlPath,
|
|
61
|
+
method: 'POST',
|
|
62
|
+
headers: headerParameters,
|
|
63
|
+
query: queryParameters,
|
|
64
|
+
body: SupabaseConfigureRequestToJSON(requestParameters['supabaseConfigureRequest'])
|
|
65
|
+
}, initOverrides);
|
|
66
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SupabaseConfigureResponseFromJSON(jsonValue));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Configure SMTP settings for a Supabase project
|
|
70
|
+
*/
|
|
71
|
+
async configureSupabaseSMTP(supabaseConfigureRequest, initOverrides) {
|
|
72
|
+
const response = await this.configureSupabaseSMTPRaw({ supabaseConfigureRequest: supabaseConfigureRequest }, initOverrides);
|
|
73
|
+
return await response.value();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get account information for the authenticated user
|
|
77
|
+
*/
|
|
78
|
+
async getAccountDetailsRaw(initOverrides) {
|
|
79
|
+
const queryParameters = {};
|
|
80
|
+
const headerParameters = {};
|
|
81
|
+
if (this.configuration &&
|
|
82
|
+
(this.configuration.username !== undefined ||
|
|
83
|
+
this.configuration.password !== undefined)) {
|
|
84
|
+
headerParameters['Authorization'] =
|
|
85
|
+
'Basic ' +
|
|
86
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
87
|
+
}
|
|
88
|
+
if (this.configuration &&
|
|
89
|
+
(this.configuration.username !== undefined ||
|
|
90
|
+
this.configuration.password !== undefined)) {
|
|
91
|
+
headerParameters['Authorization'] =
|
|
92
|
+
'Basic ' +
|
|
93
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
94
|
+
}
|
|
95
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
96
|
+
const token = this.configuration.accessToken;
|
|
97
|
+
const tokenString = await token('apiKey', []);
|
|
98
|
+
if (tokenString) {
|
|
99
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (this.configuration &&
|
|
103
|
+
(this.configuration.username !== undefined ||
|
|
104
|
+
this.configuration.password !== undefined)) {
|
|
105
|
+
headerParameters['Authorization'] =
|
|
106
|
+
'Basic ' +
|
|
107
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
108
|
+
}
|
|
109
|
+
let urlPath = `/account`;
|
|
110
|
+
const response = await this.request({
|
|
111
|
+
path: urlPath,
|
|
112
|
+
method: 'GET',
|
|
113
|
+
headers: headerParameters,
|
|
114
|
+
query: queryParameters
|
|
115
|
+
}, initOverrides);
|
|
116
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AccountGetResponseFromJSON(jsonValue));
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Get account information for the authenticated user
|
|
120
|
+
*/
|
|
121
|
+
async getAccountDetails(initOverrides) {
|
|
122
|
+
const response = await this.getAccountDetailsRaw(initOverrides);
|
|
123
|
+
return await response.value();
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Get Supabase integration status for the account
|
|
127
|
+
*/
|
|
128
|
+
async getSupabaseStatusRaw(initOverrides) {
|
|
129
|
+
const queryParameters = {};
|
|
130
|
+
const headerParameters = {};
|
|
131
|
+
if (this.configuration &&
|
|
132
|
+
(this.configuration.username !== undefined ||
|
|
133
|
+
this.configuration.password !== undefined)) {
|
|
134
|
+
headerParameters['Authorization'] =
|
|
135
|
+
'Basic ' +
|
|
136
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
137
|
+
}
|
|
138
|
+
if (this.configuration &&
|
|
139
|
+
(this.configuration.username !== undefined ||
|
|
140
|
+
this.configuration.password !== undefined)) {
|
|
141
|
+
headerParameters['Authorization'] =
|
|
142
|
+
'Basic ' +
|
|
143
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
144
|
+
}
|
|
145
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
146
|
+
const token = this.configuration.accessToken;
|
|
147
|
+
const tokenString = await token('apiKey', []);
|
|
148
|
+
if (tokenString) {
|
|
149
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (this.configuration &&
|
|
153
|
+
(this.configuration.username !== undefined ||
|
|
154
|
+
this.configuration.password !== undefined)) {
|
|
155
|
+
headerParameters['Authorization'] =
|
|
156
|
+
'Basic ' +
|
|
157
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
158
|
+
}
|
|
159
|
+
let urlPath = `/account/supabase/status`;
|
|
160
|
+
const response = await this.request({
|
|
161
|
+
path: urlPath,
|
|
162
|
+
method: 'GET',
|
|
163
|
+
headers: headerParameters,
|
|
164
|
+
query: queryParameters
|
|
165
|
+
}, initOverrides);
|
|
166
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SupabaseStatusResponseFromJSON(jsonValue));
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Get Supabase integration status for the account
|
|
170
|
+
*/
|
|
171
|
+
async getSupabaseStatus(initOverrides) {
|
|
172
|
+
const response = await this.getSupabaseStatusRaw(initOverrides);
|
|
173
|
+
return await response.value();
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* List Supabase projects for the connected account
|
|
177
|
+
*/
|
|
178
|
+
async listSupabaseProjectsRaw(initOverrides) {
|
|
179
|
+
const queryParameters = {};
|
|
180
|
+
const headerParameters = {};
|
|
181
|
+
if (this.configuration &&
|
|
182
|
+
(this.configuration.username !== undefined ||
|
|
183
|
+
this.configuration.password !== undefined)) {
|
|
184
|
+
headerParameters['Authorization'] =
|
|
185
|
+
'Basic ' +
|
|
186
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
187
|
+
}
|
|
188
|
+
if (this.configuration &&
|
|
189
|
+
(this.configuration.username !== undefined ||
|
|
190
|
+
this.configuration.password !== undefined)) {
|
|
191
|
+
headerParameters['Authorization'] =
|
|
192
|
+
'Basic ' +
|
|
193
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
194
|
+
}
|
|
195
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
196
|
+
const token = this.configuration.accessToken;
|
|
197
|
+
const tokenString = await token('apiKey', []);
|
|
198
|
+
if (tokenString) {
|
|
199
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if (this.configuration &&
|
|
203
|
+
(this.configuration.username !== undefined ||
|
|
204
|
+
this.configuration.password !== undefined)) {
|
|
205
|
+
headerParameters['Authorization'] =
|
|
206
|
+
'Basic ' +
|
|
207
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
208
|
+
}
|
|
209
|
+
let urlPath = `/account/supabase/projects`;
|
|
210
|
+
const response = await this.request({
|
|
211
|
+
path: urlPath,
|
|
212
|
+
method: 'GET',
|
|
213
|
+
headers: headerParameters,
|
|
214
|
+
query: queryParameters
|
|
215
|
+
}, initOverrides);
|
|
216
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SupabaseProjectsResponseFromJSON(jsonValue));
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* List Supabase projects for the connected account
|
|
220
|
+
*/
|
|
221
|
+
async listSupabaseProjects(initOverrides) {
|
|
222
|
+
const response = await this.listSupabaseProjectsRaw(initOverrides);
|
|
223
|
+
return await response.value();
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Get or create Stripe customer and optionally create checkout session
|
|
227
|
+
*/
|
|
228
|
+
async prepareCheckoutSessionRaw(requestParameters, initOverrides) {
|
|
229
|
+
if (requestParameters['billingPostRequestBody'] == null) {
|
|
230
|
+
throw new runtime.RequiredError('billingPostRequestBody', 'Required parameter "billingPostRequestBody" was null or undefined when calling prepareCheckoutSession().');
|
|
231
|
+
}
|
|
232
|
+
const queryParameters = {};
|
|
233
|
+
const headerParameters = {};
|
|
234
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
235
|
+
if (this.configuration &&
|
|
236
|
+
(this.configuration.username !== undefined ||
|
|
237
|
+
this.configuration.password !== undefined)) {
|
|
238
|
+
headerParameters['Authorization'] =
|
|
239
|
+
'Basic ' +
|
|
240
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
241
|
+
}
|
|
242
|
+
if (this.configuration &&
|
|
243
|
+
(this.configuration.username !== undefined ||
|
|
244
|
+
this.configuration.password !== undefined)) {
|
|
245
|
+
headerParameters['Authorization'] =
|
|
246
|
+
'Basic ' +
|
|
247
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
248
|
+
}
|
|
249
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
250
|
+
const token = this.configuration.accessToken;
|
|
251
|
+
const tokenString = await token('apiKey', []);
|
|
252
|
+
if (tokenString) {
|
|
253
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (this.configuration &&
|
|
257
|
+
(this.configuration.username !== undefined ||
|
|
258
|
+
this.configuration.password !== undefined)) {
|
|
259
|
+
headerParameters['Authorization'] =
|
|
260
|
+
'Basic ' +
|
|
261
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
262
|
+
}
|
|
263
|
+
let urlPath = `/billing`;
|
|
264
|
+
const response = await this.request({
|
|
265
|
+
path: urlPath,
|
|
266
|
+
method: 'POST',
|
|
267
|
+
headers: headerParameters,
|
|
268
|
+
query: queryParameters,
|
|
269
|
+
body: BillingPostRequestBodyToJSON(requestParameters['billingPostRequestBody'])
|
|
270
|
+
}, initOverrides);
|
|
271
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => BillingPostResponseBodyFromJSON(jsonValue));
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Get or create Stripe customer and optionally create checkout session
|
|
275
|
+
*/
|
|
276
|
+
async prepareCheckoutSession(billingPostRequestBody, initOverrides) {
|
|
277
|
+
const response = await this.prepareCheckoutSessionRaw({ billingPostRequestBody: billingPostRequestBody }, initOverrides);
|
|
278
|
+
return await response.value();
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Revoke Supabase integration (removes stored tokens and project info)
|
|
282
|
+
*/
|
|
283
|
+
async revokeSupabaseRaw(initOverrides) {
|
|
284
|
+
const queryParameters = {};
|
|
285
|
+
const headerParameters = {};
|
|
286
|
+
if (this.configuration &&
|
|
287
|
+
(this.configuration.username !== undefined ||
|
|
288
|
+
this.configuration.password !== undefined)) {
|
|
289
|
+
headerParameters['Authorization'] =
|
|
290
|
+
'Basic ' +
|
|
291
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
292
|
+
}
|
|
293
|
+
if (this.configuration &&
|
|
294
|
+
(this.configuration.username !== undefined ||
|
|
295
|
+
this.configuration.password !== undefined)) {
|
|
296
|
+
headerParameters['Authorization'] =
|
|
297
|
+
'Basic ' +
|
|
298
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
299
|
+
}
|
|
300
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
301
|
+
const token = this.configuration.accessToken;
|
|
302
|
+
const tokenString = await token('apiKey', []);
|
|
303
|
+
if (tokenString) {
|
|
304
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (this.configuration &&
|
|
308
|
+
(this.configuration.username !== undefined ||
|
|
309
|
+
this.configuration.password !== undefined)) {
|
|
310
|
+
headerParameters['Authorization'] =
|
|
311
|
+
'Basic ' +
|
|
312
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
313
|
+
}
|
|
314
|
+
let urlPath = `/account/supabase`;
|
|
315
|
+
const response = await this.request({
|
|
316
|
+
path: urlPath,
|
|
317
|
+
method: 'DELETE',
|
|
318
|
+
headers: headerParameters,
|
|
319
|
+
query: queryParameters
|
|
320
|
+
}, initOverrides);
|
|
321
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SupabaseConfigureResponseFromJSON(jsonValue));
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Revoke Supabase integration (removes stored tokens and project info)
|
|
325
|
+
*/
|
|
326
|
+
async revokeSupabase(initOverrides) {
|
|
327
|
+
const response = await this.revokeSupabaseRaw(initOverrides);
|
|
328
|
+
return await response.value();
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Exchange Supabase OAuth authorization code for tokens
|
|
332
|
+
*/
|
|
333
|
+
async supabaseOAuthRaw(requestParameters, initOverrides) {
|
|
334
|
+
if (requestParameters['supabaseOAuthRequest'] == null) {
|
|
335
|
+
throw new runtime.RequiredError('supabaseOAuthRequest', 'Required parameter "supabaseOAuthRequest" was null or undefined when calling supabaseOAuth().');
|
|
336
|
+
}
|
|
337
|
+
const queryParameters = {};
|
|
338
|
+
const headerParameters = {};
|
|
339
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
340
|
+
if (this.configuration &&
|
|
341
|
+
(this.configuration.username !== undefined ||
|
|
342
|
+
this.configuration.password !== undefined)) {
|
|
343
|
+
headerParameters['Authorization'] =
|
|
344
|
+
'Basic ' +
|
|
345
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
346
|
+
}
|
|
347
|
+
if (this.configuration &&
|
|
348
|
+
(this.configuration.username !== undefined ||
|
|
349
|
+
this.configuration.password !== undefined)) {
|
|
350
|
+
headerParameters['Authorization'] =
|
|
351
|
+
'Basic ' +
|
|
352
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
353
|
+
}
|
|
354
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
355
|
+
const token = this.configuration.accessToken;
|
|
356
|
+
const tokenString = await token('apiKey', []);
|
|
357
|
+
if (tokenString) {
|
|
358
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
if (this.configuration &&
|
|
362
|
+
(this.configuration.username !== undefined ||
|
|
363
|
+
this.configuration.password !== undefined)) {
|
|
364
|
+
headerParameters['Authorization'] =
|
|
365
|
+
'Basic ' +
|
|
366
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
367
|
+
}
|
|
368
|
+
let urlPath = `/account/supabase/oauth`;
|
|
369
|
+
const response = await this.request({
|
|
370
|
+
path: urlPath,
|
|
371
|
+
method: 'POST',
|
|
372
|
+
headers: headerParameters,
|
|
373
|
+
query: queryParameters,
|
|
374
|
+
body: SupabaseOAuthRequestToJSON(requestParameters['supabaseOAuthRequest'])
|
|
375
|
+
}, initOverrides);
|
|
376
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SupabaseOAuthResponseFromJSON(jsonValue));
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Exchange Supabase OAuth authorization code for tokens
|
|
380
|
+
*/
|
|
381
|
+
async supabaseOAuth(supabaseOAuthRequest, initOverrides) {
|
|
382
|
+
const response = await this.supabaseOAuthRaw({ supabaseOAuthRequest: supabaseOAuthRequest }, initOverrides);
|
|
383
|
+
return await response.value();
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Create or update an account name
|
|
387
|
+
*/
|
|
388
|
+
async updateAccountRaw(requestParameters, initOverrides) {
|
|
389
|
+
if (requestParameters['createAccountRequestBody'] == null) {
|
|
390
|
+
throw new runtime.RequiredError('createAccountRequestBody', 'Required parameter "createAccountRequestBody" was null or undefined when calling updateAccount().');
|
|
391
|
+
}
|
|
392
|
+
const queryParameters = {};
|
|
393
|
+
const headerParameters = {};
|
|
394
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
395
|
+
if (this.configuration &&
|
|
396
|
+
(this.configuration.username !== undefined ||
|
|
397
|
+
this.configuration.password !== undefined)) {
|
|
398
|
+
headerParameters['Authorization'] =
|
|
399
|
+
'Basic ' +
|
|
400
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
401
|
+
}
|
|
402
|
+
if (this.configuration &&
|
|
403
|
+
(this.configuration.username !== undefined ||
|
|
404
|
+
this.configuration.password !== undefined)) {
|
|
405
|
+
headerParameters['Authorization'] =
|
|
406
|
+
'Basic ' +
|
|
407
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
408
|
+
}
|
|
409
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
410
|
+
const token = this.configuration.accessToken;
|
|
411
|
+
const tokenString = await token('apiKey', []);
|
|
412
|
+
if (tokenString) {
|
|
413
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
if (this.configuration &&
|
|
417
|
+
(this.configuration.username !== undefined ||
|
|
418
|
+
this.configuration.password !== undefined)) {
|
|
419
|
+
headerParameters['Authorization'] =
|
|
420
|
+
'Basic ' +
|
|
421
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
422
|
+
}
|
|
423
|
+
let urlPath = `/account`;
|
|
424
|
+
const response = await this.request({
|
|
425
|
+
path: urlPath,
|
|
426
|
+
method: 'POST',
|
|
427
|
+
headers: headerParameters,
|
|
428
|
+
query: queryParameters,
|
|
429
|
+
body: CreateAccountRequestBodyToJSON(requestParameters['createAccountRequestBody'])
|
|
430
|
+
}, initOverrides);
|
|
431
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CreateAccountResponseFromJSON(jsonValue));
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Create or update an account name
|
|
435
|
+
*/
|
|
436
|
+
async updateAccount(createAccountRequestBody, initOverrides) {
|
|
437
|
+
const response = await this.updateAccountRaw({ createAccountRequestBody: createAccountRequestBody }, initOverrides);
|
|
438
|
+
return await response.value();
|
|
439
|
+
}
|
|
440
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* NotificationAPI
|
|
5
|
+
* Internal API for notification delivery and management
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
import * as runtime from '../runtime';
|
|
15
|
+
import { AccountAddressesResponseFromJSON, AddressResponseFromJSON, CreateAddressRequestToJSON, UpdateAddressRequestToJSON } from '../models/index';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export class AddressesApi extends runtime.BaseAPI {
|
|
20
|
+
/**
|
|
21
|
+
* Create a new email address for inbound/outbound purposes. Each account can have one builtin address and many custom addresses. Custom addresses must belong to configured domains.
|
|
22
|
+
*/
|
|
23
|
+
async createAddressRaw(requestParameters, initOverrides) {
|
|
24
|
+
if (requestParameters['createAddressRequest'] == null) {
|
|
25
|
+
throw new runtime.RequiredError('createAddressRequest', 'Required parameter "createAddressRequest" was null or undefined when calling createAddress().');
|
|
26
|
+
}
|
|
27
|
+
const queryParameters = {};
|
|
28
|
+
const headerParameters = {};
|
|
29
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
30
|
+
if (this.configuration &&
|
|
31
|
+
(this.configuration.username !== undefined ||
|
|
32
|
+
this.configuration.password !== undefined)) {
|
|
33
|
+
headerParameters['Authorization'] =
|
|
34
|
+
'Basic ' +
|
|
35
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
36
|
+
}
|
|
37
|
+
if (this.configuration &&
|
|
38
|
+
(this.configuration.username !== undefined ||
|
|
39
|
+
this.configuration.password !== undefined)) {
|
|
40
|
+
headerParameters['Authorization'] =
|
|
41
|
+
'Basic ' +
|
|
42
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
43
|
+
}
|
|
44
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
45
|
+
const token = this.configuration.accessToken;
|
|
46
|
+
const tokenString = await token('apiKey', []);
|
|
47
|
+
if (tokenString) {
|
|
48
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (this.configuration &&
|
|
52
|
+
(this.configuration.username !== undefined ||
|
|
53
|
+
this.configuration.password !== undefined)) {
|
|
54
|
+
headerParameters['Authorization'] =
|
|
55
|
+
'Basic ' +
|
|
56
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
57
|
+
}
|
|
58
|
+
let urlPath = `/addresses`;
|
|
59
|
+
const response = await this.request({
|
|
60
|
+
path: urlPath,
|
|
61
|
+
method: 'POST',
|
|
62
|
+
headers: headerParameters,
|
|
63
|
+
query: queryParameters,
|
|
64
|
+
body: CreateAddressRequestToJSON(requestParameters['createAddressRequest'])
|
|
65
|
+
}, initOverrides);
|
|
66
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AddressResponseFromJSON(jsonValue));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create a new email address for inbound/outbound purposes. Each account can have one builtin address and many custom addresses. Custom addresses must belong to configured domains.
|
|
70
|
+
*/
|
|
71
|
+
async createAddress(createAddressRequest, initOverrides) {
|
|
72
|
+
const response = await this.createAddressRaw({ createAddressRequest: createAddressRequest }, initOverrides);
|
|
73
|
+
return await response.value();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Lists all email addresses the account has configured to send and receive emails. Custom addresses must belong to configured domains.
|
|
77
|
+
*/
|
|
78
|
+
async listAddressesRaw(initOverrides) {
|
|
79
|
+
const queryParameters = {};
|
|
80
|
+
const headerParameters = {};
|
|
81
|
+
if (this.configuration &&
|
|
82
|
+
(this.configuration.username !== undefined ||
|
|
83
|
+
this.configuration.password !== undefined)) {
|
|
84
|
+
headerParameters['Authorization'] =
|
|
85
|
+
'Basic ' +
|
|
86
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
87
|
+
}
|
|
88
|
+
if (this.configuration &&
|
|
89
|
+
(this.configuration.username !== undefined ||
|
|
90
|
+
this.configuration.password !== undefined)) {
|
|
91
|
+
headerParameters['Authorization'] =
|
|
92
|
+
'Basic ' +
|
|
93
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
94
|
+
}
|
|
95
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
96
|
+
const token = this.configuration.accessToken;
|
|
97
|
+
const tokenString = await token('apiKey', []);
|
|
98
|
+
if (tokenString) {
|
|
99
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (this.configuration &&
|
|
103
|
+
(this.configuration.username !== undefined ||
|
|
104
|
+
this.configuration.password !== undefined)) {
|
|
105
|
+
headerParameters['Authorization'] =
|
|
106
|
+
'Basic ' +
|
|
107
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
108
|
+
}
|
|
109
|
+
let urlPath = `/addresses`;
|
|
110
|
+
const response = await this.request({
|
|
111
|
+
path: urlPath,
|
|
112
|
+
method: 'GET',
|
|
113
|
+
headers: headerParameters,
|
|
114
|
+
query: queryParameters
|
|
115
|
+
}, initOverrides);
|
|
116
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AccountAddressesResponseFromJSON(jsonValue));
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Lists all email addresses the account has configured to send and receive emails. Custom addresses must belong to configured domains.
|
|
120
|
+
*/
|
|
121
|
+
async listAddresses(initOverrides) {
|
|
122
|
+
const response = await this.listAddressesRaw(initOverrides);
|
|
123
|
+
return await response.value();
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Update an existing address
|
|
127
|
+
*/
|
|
128
|
+
async updateAddressRaw(requestParameters, initOverrides) {
|
|
129
|
+
if (requestParameters['updateAddressRequest'] == null) {
|
|
130
|
+
throw new runtime.RequiredError('updateAddressRequest', 'Required parameter "updateAddressRequest" was null or undefined when calling updateAddress().');
|
|
131
|
+
}
|
|
132
|
+
const queryParameters = {};
|
|
133
|
+
const headerParameters = {};
|
|
134
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
135
|
+
if (this.configuration &&
|
|
136
|
+
(this.configuration.username !== undefined ||
|
|
137
|
+
this.configuration.password !== undefined)) {
|
|
138
|
+
headerParameters['Authorization'] =
|
|
139
|
+
'Basic ' +
|
|
140
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
141
|
+
}
|
|
142
|
+
if (this.configuration &&
|
|
143
|
+
(this.configuration.username !== undefined ||
|
|
144
|
+
this.configuration.password !== undefined)) {
|
|
145
|
+
headerParameters['Authorization'] =
|
|
146
|
+
'Basic ' +
|
|
147
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
148
|
+
}
|
|
149
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
150
|
+
const token = this.configuration.accessToken;
|
|
151
|
+
const tokenString = await token('apiKey', []);
|
|
152
|
+
if (tokenString) {
|
|
153
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (this.configuration &&
|
|
157
|
+
(this.configuration.username !== undefined ||
|
|
158
|
+
this.configuration.password !== undefined)) {
|
|
159
|
+
headerParameters['Authorization'] =
|
|
160
|
+
'Basic ' +
|
|
161
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
162
|
+
}
|
|
163
|
+
let urlPath = `/addresses`;
|
|
164
|
+
const response = await this.request({
|
|
165
|
+
path: urlPath,
|
|
166
|
+
method: 'PATCH',
|
|
167
|
+
headers: headerParameters,
|
|
168
|
+
query: queryParameters,
|
|
169
|
+
body: UpdateAddressRequestToJSON(requestParameters['updateAddressRequest'])
|
|
170
|
+
}, initOverrides);
|
|
171
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AddressResponseFromJSON(jsonValue));
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Update an existing address
|
|
175
|
+
*/
|
|
176
|
+
async updateAddress(updateAddressRequest, initOverrides) {
|
|
177
|
+
const response = await this.updateAddressRaw({ updateAddressRequest: updateAddressRequest }, initOverrides);
|
|
178
|
+
return await response.value();
|
|
179
|
+
}
|
|
180
|
+
}
|