pingram 1.0.42-alpha.1732 → 1.0.42-alpha.1733

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.
@@ -10,10 +10,14 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { CreateAccountRequest, CreateAccountResponse, ListAccountsResponse } from '../models/index';
13
+ import type { AccountSummary, CreateAccountRequest, CreateAccountResponse, ListAccountsResponse, UpdateAccountRequest } from '../models/index';
14
14
  export interface CreateAccountOperationRequest {
15
15
  createAccountRequest: CreateAccountRequest;
16
16
  }
17
+ export interface UpdateAccountOperationRequest {
18
+ accountId: string;
19
+ updateAccountRequest: UpdateAccountRequest;
20
+ }
17
21
  /**
18
22
  * AccountsApi - interface
19
23
  *
@@ -47,6 +51,21 @@ export interface AccountsApiInterface {
47
51
  * List accounts the authenticated user can access
48
52
  */
49
53
  listAccounts(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListAccountsResponse>;
54
+ /**
55
+ * Change the display name of an account the caller can access. The name is the label shown in the dashboard and in account lists.
56
+ * @summary Change the display name of an account
57
+ * @param {string} accountId Account to rename
58
+ * @param {UpdateAccountRequest} updateAccountRequest
59
+ * @param {*} [options] Override http request option.
60
+ * @throws {RequiredError}
61
+ * @memberof AccountsApiInterface
62
+ */
63
+ updateAccountRaw(requestParameters: UpdateAccountOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountSummary>>;
64
+ /**
65
+ * Change the display name of an account the caller can access. The name is the label shown in the dashboard and in account lists.
66
+ * Change the display name of an account
67
+ */
68
+ updateAccount(accountId: string, updateAccountRequest: UpdateAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountSummary>;
50
69
  }
51
70
  /**
52
71
  *
@@ -70,4 +89,14 @@ export declare class AccountsApi extends runtime.BaseAPI implements AccountsApiI
70
89
  * List accounts the authenticated user can access
71
90
  */
72
91
  listAccounts(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListAccountsResponse>;
92
+ /**
93
+ * Change the display name of an account the caller can access. The name is the label shown in the dashboard and in account lists.
94
+ * Change the display name of an account
95
+ */
96
+ updateAccountRaw(requestParameters: UpdateAccountOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountSummary>>;
97
+ /**
98
+ * Change the display name of an account the caller can access. The name is the label shown in the dashboard and in account lists.
99
+ * Change the display name of an account
100
+ */
101
+ updateAccount(accountId: string, updateAccountRequest: UpdateAccountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountSummary>;
73
102
  }
@@ -160,5 +160,66 @@ class AccountsApi extends runtime.BaseAPI {
160
160
  const response = await this.listAccountsRaw(initOverrides);
161
161
  return await response.value();
162
162
  }
163
+ /**
164
+ * Change the display name of an account the caller can access. The name is the label shown in the dashboard and in account lists.
165
+ * Change the display name of an account
166
+ */
167
+ async updateAccountRaw(requestParameters, initOverrides) {
168
+ if (requestParameters['accountId'] == null) {
169
+ throw new runtime.RequiredError('accountId', 'Required parameter "accountId" was null or undefined when calling updateAccount().');
170
+ }
171
+ if (requestParameters['updateAccountRequest'] == null) {
172
+ throw new runtime.RequiredError('updateAccountRequest', 'Required parameter "updateAccountRequest" was null or undefined when calling updateAccount().');
173
+ }
174
+ const queryParameters = {};
175
+ const headerParameters = {};
176
+ headerParameters['Content-Type'] = 'application/json';
177
+ if (this.configuration &&
178
+ (this.configuration.username !== undefined ||
179
+ this.configuration.password !== undefined)) {
180
+ headerParameters['Authorization'] =
181
+ 'Basic ' +
182
+ btoa(this.configuration.username + ':' + this.configuration.password);
183
+ }
184
+ if (this.configuration &&
185
+ (this.configuration.username !== undefined ||
186
+ this.configuration.password !== undefined)) {
187
+ headerParameters['Authorization'] =
188
+ 'Basic ' +
189
+ btoa(this.configuration.username + ':' + this.configuration.password);
190
+ }
191
+ if (this.configuration && this.configuration.accessToken) {
192
+ const token = this.configuration.accessToken;
193
+ const tokenString = await token('apiKey', []);
194
+ if (tokenString) {
195
+ headerParameters['Authorization'] = `Bearer ${tokenString}`;
196
+ }
197
+ }
198
+ if (this.configuration &&
199
+ (this.configuration.username !== undefined ||
200
+ this.configuration.password !== undefined)) {
201
+ headerParameters['Authorization'] =
202
+ 'Basic ' +
203
+ btoa(this.configuration.username + ':' + this.configuration.password);
204
+ }
205
+ let urlPath = `/accounts/{accountId}`;
206
+ urlPath = urlPath.replace(`{${'accountId'}}`, encodeURIComponent(String(requestParameters['accountId'])));
207
+ const response = await this.request({
208
+ path: urlPath,
209
+ method: 'PATCH',
210
+ headers: headerParameters,
211
+ query: queryParameters,
212
+ body: (0, index_1.UpdateAccountRequestToJSON)(requestParameters['updateAccountRequest'])
213
+ }, initOverrides);
214
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AccountSummaryFromJSON)(jsonValue));
215
+ }
216
+ /**
217
+ * Change the display name of an account the caller can access. The name is the label shown in the dashboard and in account lists.
218
+ * Change the display name of an account
219
+ */
220
+ async updateAccount(accountId, updateAccountRequest, initOverrides) {
221
+ const response = await this.updateAccountRaw({ accountId: accountId, updateAccountRequest: updateAccountRequest }, initOverrides);
222
+ return await response.value();
223
+ }
163
224
  }
164
225
  exports.AccountsApi = AccountsApi;
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export type { AssignPaymentMethodOperationRequest, CancelSubscriptionOperationRequest, ConfigureSupabaseSMTPRequest, CreatePaymentMethodSetupOperationRequest, GetUsageHistoryRequest, ListInvoicesRequest, PrepareCheckoutSessionRequest, SupabaseOAuthOperationRequest, UpdateAccountSettingsRequest, UpdateBillingEmailOperationRequest, AccountApiInterface } from './AccountApi';
6
6
  export { AccountApi } from './AccountApi';
7
- export type { CreateAccountOperationRequest, AccountsApiInterface } from './AccountsApi';
7
+ export type { CreateAccountOperationRequest, UpdateAccountOperationRequest, AccountsApiInterface } from './AccountsApi';
8
8
  export { AccountsApi } from './AccountsApi';
9
9
  export type { DeleteRequest, ArchiveRequest, CancelRequest, CreateRequest as BroadcastsApi_CreateRequest, GetRequest, GetMetricsRequest, ListRequest as BroadcastsApi_ListRequest, ListRecipientsRequest, PauseRequest, ResumeRequest, ScheduleRequest, SendRequest as BroadcastsApi_SendRequest, UnarchiveRequest, UpdateRequest as BroadcastsApi_UpdateRequest, BroadcastsApiInterface } from './BroadcastsApi';
10
10
  export { BroadcastsApi } from './BroadcastsApi';
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Pingram
3
+ * Internal API for notification delivery and management
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * Summary of an account the user can access (GET /accounts).
14
+ * @export
15
+ * @interface AccountSummary
16
+ */
17
+ export interface AccountSummary {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof AccountSummary
22
+ */
23
+ accountId: string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof AccountSummary
28
+ */
29
+ name?: string;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof AccountSummary
34
+ */
35
+ accountType: AccountSummaryAccountTypeEnum;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof AccountSummary
40
+ */
41
+ createdAt: string;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof AccountSummary
46
+ */
47
+ status: AccountSummaryStatusEnum;
48
+ /**
49
+ *
50
+ * @type {number}
51
+ * @memberof AccountSummary
52
+ */
53
+ costCap: number;
54
+ }
55
+ /**
56
+ * @export
57
+ */
58
+ export declare const AccountSummaryAccountTypeEnum: {
59
+ readonly FREE: "free";
60
+ readonly PAID: "paid";
61
+ };
62
+ export type AccountSummaryAccountTypeEnum = (typeof AccountSummaryAccountTypeEnum)[keyof typeof AccountSummaryAccountTypeEnum];
63
+ /**
64
+ * @export
65
+ */
66
+ export declare const AccountSummaryStatusEnum: {
67
+ readonly VERIFIED: "verified";
68
+ readonly UNVERIFIED: "unverified";
69
+ readonly BLOCKED: "blocked";
70
+ };
71
+ export type AccountSummaryStatusEnum = (typeof AccountSummaryStatusEnum)[keyof typeof AccountSummaryStatusEnum];
72
+ /**
73
+ * Check if a given object implements the AccountSummary interface.
74
+ */
75
+ export declare function instanceOfAccountSummary(value: object): value is AccountSummary;
76
+ export declare function AccountSummaryFromJSON(json: any): AccountSummary;
77
+ export declare function AccountSummaryFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountSummary;
78
+ export declare function AccountSummaryToJSON(json: any): AccountSummary;
79
+ export declare function AccountSummaryToJSONTyped(value?: AccountSummary | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Pingram
6
+ * Internal API for notification delivery and management
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.AccountSummaryStatusEnum = exports.AccountSummaryAccountTypeEnum = void 0;
17
+ exports.instanceOfAccountSummary = instanceOfAccountSummary;
18
+ exports.AccountSummaryFromJSON = AccountSummaryFromJSON;
19
+ exports.AccountSummaryFromJSONTyped = AccountSummaryFromJSONTyped;
20
+ exports.AccountSummaryToJSON = AccountSummaryToJSON;
21
+ exports.AccountSummaryToJSONTyped = AccountSummaryToJSONTyped;
22
+ /**
23
+ * @export
24
+ */
25
+ exports.AccountSummaryAccountTypeEnum = {
26
+ FREE: 'free',
27
+ PAID: 'paid'
28
+ };
29
+ /**
30
+ * @export
31
+ */
32
+ exports.AccountSummaryStatusEnum = {
33
+ VERIFIED: 'verified',
34
+ UNVERIFIED: 'unverified',
35
+ BLOCKED: 'blocked'
36
+ };
37
+ /**
38
+ * Check if a given object implements the AccountSummary interface.
39
+ */
40
+ function instanceOfAccountSummary(value) {
41
+ if (!('accountId' in value) || value['accountId'] === undefined)
42
+ return false;
43
+ if (!('accountType' in value) || value['accountType'] === undefined)
44
+ return false;
45
+ if (!('createdAt' in value) || value['createdAt'] === undefined)
46
+ return false;
47
+ if (!('status' in value) || value['status'] === undefined)
48
+ return false;
49
+ if (!('costCap' in value) || value['costCap'] === undefined)
50
+ return false;
51
+ return true;
52
+ }
53
+ function AccountSummaryFromJSON(json) {
54
+ return AccountSummaryFromJSONTyped(json, false);
55
+ }
56
+ function AccountSummaryFromJSONTyped(json, ignoreDiscriminator) {
57
+ if (json == null) {
58
+ return json;
59
+ }
60
+ return {
61
+ accountId: json['accountId'],
62
+ name: json['name'] == null ? undefined : json['name'],
63
+ accountType: json['accountType'],
64
+ createdAt: json['createdAt'],
65
+ status: json['status'],
66
+ costCap: json['costCap']
67
+ };
68
+ }
69
+ function AccountSummaryToJSON(json) {
70
+ return AccountSummaryToJSONTyped(json, false);
71
+ }
72
+ function AccountSummaryToJSONTyped(value, ignoreDiscriminator = false) {
73
+ if (value == null) {
74
+ return value;
75
+ }
76
+ return {
77
+ accountId: value['accountId'],
78
+ name: value['name'],
79
+ accountType: value['accountType'],
80
+ createdAt: value['createdAt'],
81
+ status: value['status'],
82
+ costCap: value['costCap']
83
+ };
84
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Pingram
3
+ * Internal API for notification delivery and management
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * PATCH /accounts/{accountId} request: change the account display name.
14
+ * @export
15
+ * @interface UpdateAccountRequest
16
+ */
17
+ export interface UpdateAccountRequest {
18
+ /**
19
+ * Display name for this account.
20
+ * @type {string}
21
+ * @memberof UpdateAccountRequest
22
+ */
23
+ name: string;
24
+ }
25
+ /**
26
+ * Check if a given object implements the UpdateAccountRequest interface.
27
+ */
28
+ export declare function instanceOfUpdateAccountRequest(value: object): value is UpdateAccountRequest;
29
+ export declare function UpdateAccountRequestFromJSON(json: any): UpdateAccountRequest;
30
+ export declare function UpdateAccountRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateAccountRequest;
31
+ export declare function UpdateAccountRequestToJSON(json: any): UpdateAccountRequest;
32
+ export declare function UpdateAccountRequestToJSONTyped(value?: UpdateAccountRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Pingram
6
+ * Internal API for notification delivery and management
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfUpdateAccountRequest = instanceOfUpdateAccountRequest;
17
+ exports.UpdateAccountRequestFromJSON = UpdateAccountRequestFromJSON;
18
+ exports.UpdateAccountRequestFromJSONTyped = UpdateAccountRequestFromJSONTyped;
19
+ exports.UpdateAccountRequestToJSON = UpdateAccountRequestToJSON;
20
+ exports.UpdateAccountRequestToJSONTyped = UpdateAccountRequestToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the UpdateAccountRequest interface.
23
+ */
24
+ function instanceOfUpdateAccountRequest(value) {
25
+ if (!('name' in value) || value['name'] === undefined)
26
+ return false;
27
+ return true;
28
+ }
29
+ function UpdateAccountRequestFromJSON(json) {
30
+ return UpdateAccountRequestFromJSONTyped(json, false);
31
+ }
32
+ function UpdateAccountRequestFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ name: json['name']
38
+ };
39
+ }
40
+ function UpdateAccountRequestToJSON(json) {
41
+ return UpdateAccountRequestToJSONTyped(json, false);
42
+ }
43
+ function UpdateAccountRequestToJSONTyped(value, ignoreDiscriminator = false) {
44
+ if (value == null) {
45
+ return value;
46
+ }
47
+ return {
48
+ name: value['name']
49
+ };
50
+ }
@@ -5,6 +5,7 @@ export * from './AccountGetResponseBillingAlerts';
5
5
  export * from './AccountPatchRequest';
6
6
  export * from './AccountPaymentMethods';
7
7
  export * from './AccountPaymentMethodsPaymentMethodsInner';
8
+ export * from './AccountSummary';
8
9
  export * from './Agent';
9
10
  export * from './Agent1';
10
11
  export * from './AgentAgent';
@@ -323,6 +324,7 @@ export * from './TenDlcCampaignUpdateRequest';
323
324
  export * from './Transfer';
324
325
  export * from './Transfer1';
325
326
  export * from './TransferDestinationsInner';
327
+ export * from './UpdateAccountRequest';
326
328
  export * from './UpdateBillingEmailRequest';
327
329
  export * from './UpdateBroadcastRequest';
328
330
  export * from './User';
@@ -23,6 +23,7 @@ __exportStar(require("./AccountGetResponseBillingAlerts"), exports);
23
23
  __exportStar(require("./AccountPatchRequest"), exports);
24
24
  __exportStar(require("./AccountPaymentMethods"), exports);
25
25
  __exportStar(require("./AccountPaymentMethodsPaymentMethodsInner"), exports);
26
+ __exportStar(require("./AccountSummary"), exports);
26
27
  __exportStar(require("./Agent"), exports);
27
28
  __exportStar(require("./Agent1"), exports);
28
29
  __exportStar(require("./AgentAgent"), exports);
@@ -341,6 +342,7 @@ __exportStar(require("./TenDlcCampaignUpdateRequest"), exports);
341
342
  __exportStar(require("./Transfer"), exports);
342
343
  __exportStar(require("./Transfer1"), exports);
343
344
  __exportStar(require("./TransferDestinationsInner"), exports);
345
+ __exportStar(require("./UpdateAccountRequest"), exports);
344
346
  __exportStar(require("./UpdateBillingEmailRequest"), exports);
345
347
  __exportStar(require("./UpdateBroadcastRequest"), exports);
346
348
  __exportStar(require("./User"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pingram",
3
- "version": "1.0.42-alpha.1732",
3
+ "version": "1.0.42-alpha.1733",
4
4
  "description": "Official Node.js SDK for Pingram - Send notifications via Email, SMS, Push, In-App, and more",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",