pingram 1.0.1 → 1.0.2-alpha.873
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/generated/src/apis/WebhooksApi.d.ts +90 -0
- package/dist/generated/src/apis/WebhooksApi.js +211 -0
- package/dist/generated/src/apis/index.d.ts +1 -0
- package/dist/generated/src/apis/index.js +1 -0
- package/dist/generated/src/models/EventsWebhookResponse.d.ts +70 -0
- package/dist/generated/src/models/EventsWebhookResponse.js +86 -0
- package/dist/generated/src/models/EventsWebhookUpsertRequest.d.ts +64 -0
- package/dist/generated/src/models/EventsWebhookUpsertRequest.js +82 -0
- package/dist/generated/src/models/index.d.ts +2 -0
- package/dist/generated/src/models/index.js +2 -0
- package/dist/src/client.d.ts +2 -0
- package/dist/src/client.js +6 -3
- package/package.json +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { EventsWebhookResponse, EventsWebhookUpsertRequest } from '../models/index';
|
|
14
|
+
export interface UpsertEventsWebhookRequest {
|
|
15
|
+
eventsWebhookUpsertRequest: EventsWebhookUpsertRequest;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* WebhooksApi - interface
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
* @interface WebhooksApiInterface
|
|
22
|
+
*/
|
|
23
|
+
export interface WebhooksApiInterface {
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @summary Delete the events webhook configuration for the current account/environment.
|
|
27
|
+
* @param {*} [options] Override http request option.
|
|
28
|
+
* @throws {RequiredError}
|
|
29
|
+
* @memberof WebhooksApiInterface
|
|
30
|
+
*/
|
|
31
|
+
deleteEventsWebhookRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
32
|
+
/**
|
|
33
|
+
* Delete the events webhook configuration for the current account/environment.
|
|
34
|
+
*/
|
|
35
|
+
deleteEventsWebhook(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @summary Get the events webhook configuration for the current account/environment.
|
|
39
|
+
* @param {*} [options] Override http request option.
|
|
40
|
+
* @throws {RequiredError}
|
|
41
|
+
* @memberof WebhooksApiInterface
|
|
42
|
+
*/
|
|
43
|
+
getEventsWebhookRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EventsWebhookResponse>>;
|
|
44
|
+
/**
|
|
45
|
+
* Get the events webhook configuration for the current account/environment.
|
|
46
|
+
*/
|
|
47
|
+
getEventsWebhook(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EventsWebhookResponse>;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @summary Create or update the events webhook configuration for the current account/environment.
|
|
51
|
+
* @param {EventsWebhookUpsertRequest} eventsWebhookUpsertRequest
|
|
52
|
+
* @param {*} [options] Override http request option.
|
|
53
|
+
* @throws {RequiredError}
|
|
54
|
+
* @memberof WebhooksApiInterface
|
|
55
|
+
*/
|
|
56
|
+
upsertEventsWebhookRaw(requestParameters: UpsertEventsWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EventsWebhookResponse>>;
|
|
57
|
+
/**
|
|
58
|
+
* Create or update the events webhook configuration for the current account/environment.
|
|
59
|
+
*/
|
|
60
|
+
upsertEventsWebhook(eventsWebhookUpsertRequest: EventsWebhookUpsertRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EventsWebhookResponse>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
export declare class WebhooksApi extends runtime.BaseAPI implements WebhooksApiInterface {
|
|
66
|
+
/**
|
|
67
|
+
* Delete the events webhook configuration for the current account/environment.
|
|
68
|
+
*/
|
|
69
|
+
deleteEventsWebhookRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
70
|
+
/**
|
|
71
|
+
* Delete the events webhook configuration for the current account/environment.
|
|
72
|
+
*/
|
|
73
|
+
deleteEventsWebhook(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Get the events webhook configuration for the current account/environment.
|
|
76
|
+
*/
|
|
77
|
+
getEventsWebhookRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EventsWebhookResponse>>;
|
|
78
|
+
/**
|
|
79
|
+
* Get the events webhook configuration for the current account/environment.
|
|
80
|
+
*/
|
|
81
|
+
getEventsWebhook(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EventsWebhookResponse>;
|
|
82
|
+
/**
|
|
83
|
+
* Create or update the events webhook configuration for the current account/environment.
|
|
84
|
+
*/
|
|
85
|
+
upsertEventsWebhookRaw(requestParameters: UpsertEventsWebhookRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EventsWebhookResponse>>;
|
|
86
|
+
/**
|
|
87
|
+
* Create or update the events webhook configuration for the current account/environment.
|
|
88
|
+
*/
|
|
89
|
+
upsertEventsWebhook(eventsWebhookUpsertRequest: EventsWebhookUpsertRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EventsWebhookResponse>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
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
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
22
|
+
}) : (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
o[k2] = m[k];
|
|
25
|
+
}));
|
|
26
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
27
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
28
|
+
}) : function(o, v) {
|
|
29
|
+
o["default"] = v;
|
|
30
|
+
});
|
|
31
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
32
|
+
var ownKeys = function(o) {
|
|
33
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
34
|
+
var ar = [];
|
|
35
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
36
|
+
return ar;
|
|
37
|
+
};
|
|
38
|
+
return ownKeys(o);
|
|
39
|
+
};
|
|
40
|
+
return function (mod) {
|
|
41
|
+
if (mod && mod.__esModule) return mod;
|
|
42
|
+
var result = {};
|
|
43
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
44
|
+
__setModuleDefault(result, mod);
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
+
exports.WebhooksApi = void 0;
|
|
50
|
+
const runtime = __importStar(require("../runtime"));
|
|
51
|
+
const index_1 = require("../models/index");
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
class WebhooksApi extends runtime.BaseAPI {
|
|
56
|
+
/**
|
|
57
|
+
* Delete the events webhook configuration for the current account/environment.
|
|
58
|
+
*/
|
|
59
|
+
async deleteEventsWebhookRaw(initOverrides) {
|
|
60
|
+
const queryParameters = {};
|
|
61
|
+
const headerParameters = {};
|
|
62
|
+
if (this.configuration &&
|
|
63
|
+
(this.configuration.username !== undefined ||
|
|
64
|
+
this.configuration.password !== undefined)) {
|
|
65
|
+
headerParameters['Authorization'] =
|
|
66
|
+
'Basic ' +
|
|
67
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
68
|
+
}
|
|
69
|
+
if (this.configuration &&
|
|
70
|
+
(this.configuration.username !== undefined ||
|
|
71
|
+
this.configuration.password !== undefined)) {
|
|
72
|
+
headerParameters['Authorization'] =
|
|
73
|
+
'Basic ' +
|
|
74
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
75
|
+
}
|
|
76
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
77
|
+
const token = this.configuration.accessToken;
|
|
78
|
+
const tokenString = await token('apiKey', []);
|
|
79
|
+
if (tokenString) {
|
|
80
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (this.configuration &&
|
|
84
|
+
(this.configuration.username !== undefined ||
|
|
85
|
+
this.configuration.password !== undefined)) {
|
|
86
|
+
headerParameters['Authorization'] =
|
|
87
|
+
'Basic ' +
|
|
88
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
89
|
+
}
|
|
90
|
+
let urlPath = `/webhooks/events`;
|
|
91
|
+
const response = await this.request({
|
|
92
|
+
path: urlPath,
|
|
93
|
+
method: 'DELETE',
|
|
94
|
+
headers: headerParameters,
|
|
95
|
+
query: queryParameters
|
|
96
|
+
}, initOverrides);
|
|
97
|
+
return new runtime.VoidApiResponse(response);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Delete the events webhook configuration for the current account/environment.
|
|
101
|
+
*/
|
|
102
|
+
async deleteEventsWebhook(initOverrides) {
|
|
103
|
+
await this.deleteEventsWebhookRaw(initOverrides);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Get the events webhook configuration for the current account/environment.
|
|
107
|
+
*/
|
|
108
|
+
async getEventsWebhookRaw(initOverrides) {
|
|
109
|
+
const queryParameters = {};
|
|
110
|
+
const headerParameters = {};
|
|
111
|
+
if (this.configuration &&
|
|
112
|
+
(this.configuration.username !== undefined ||
|
|
113
|
+
this.configuration.password !== undefined)) {
|
|
114
|
+
headerParameters['Authorization'] =
|
|
115
|
+
'Basic ' +
|
|
116
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
117
|
+
}
|
|
118
|
+
if (this.configuration &&
|
|
119
|
+
(this.configuration.username !== undefined ||
|
|
120
|
+
this.configuration.password !== undefined)) {
|
|
121
|
+
headerParameters['Authorization'] =
|
|
122
|
+
'Basic ' +
|
|
123
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
124
|
+
}
|
|
125
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
126
|
+
const token = this.configuration.accessToken;
|
|
127
|
+
const tokenString = await token('apiKey', []);
|
|
128
|
+
if (tokenString) {
|
|
129
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (this.configuration &&
|
|
133
|
+
(this.configuration.username !== undefined ||
|
|
134
|
+
this.configuration.password !== undefined)) {
|
|
135
|
+
headerParameters['Authorization'] =
|
|
136
|
+
'Basic ' +
|
|
137
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
138
|
+
}
|
|
139
|
+
let urlPath = `/webhooks/events`;
|
|
140
|
+
const response = await this.request({
|
|
141
|
+
path: urlPath,
|
|
142
|
+
method: 'GET',
|
|
143
|
+
headers: headerParameters,
|
|
144
|
+
query: queryParameters
|
|
145
|
+
}, initOverrides);
|
|
146
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.EventsWebhookResponseFromJSON)(jsonValue));
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Get the events webhook configuration for the current account/environment.
|
|
150
|
+
*/
|
|
151
|
+
async getEventsWebhook(initOverrides) {
|
|
152
|
+
const response = await this.getEventsWebhookRaw(initOverrides);
|
|
153
|
+
return await response.value();
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Create or update the events webhook configuration for the current account/environment.
|
|
157
|
+
*/
|
|
158
|
+
async upsertEventsWebhookRaw(requestParameters, initOverrides) {
|
|
159
|
+
if (requestParameters['eventsWebhookUpsertRequest'] == null) {
|
|
160
|
+
throw new runtime.RequiredError('eventsWebhookUpsertRequest', 'Required parameter "eventsWebhookUpsertRequest" was null or undefined when calling upsertEventsWebhook().');
|
|
161
|
+
}
|
|
162
|
+
const queryParameters = {};
|
|
163
|
+
const headerParameters = {};
|
|
164
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
165
|
+
if (this.configuration &&
|
|
166
|
+
(this.configuration.username !== undefined ||
|
|
167
|
+
this.configuration.password !== undefined)) {
|
|
168
|
+
headerParameters['Authorization'] =
|
|
169
|
+
'Basic ' +
|
|
170
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
171
|
+
}
|
|
172
|
+
if (this.configuration &&
|
|
173
|
+
(this.configuration.username !== undefined ||
|
|
174
|
+
this.configuration.password !== undefined)) {
|
|
175
|
+
headerParameters['Authorization'] =
|
|
176
|
+
'Basic ' +
|
|
177
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
178
|
+
}
|
|
179
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
180
|
+
const token = this.configuration.accessToken;
|
|
181
|
+
const tokenString = await token('apiKey', []);
|
|
182
|
+
if (tokenString) {
|
|
183
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (this.configuration &&
|
|
187
|
+
(this.configuration.username !== undefined ||
|
|
188
|
+
this.configuration.password !== undefined)) {
|
|
189
|
+
headerParameters['Authorization'] =
|
|
190
|
+
'Basic ' +
|
|
191
|
+
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
192
|
+
}
|
|
193
|
+
let urlPath = `/webhooks/events`;
|
|
194
|
+
const response = await this.request({
|
|
195
|
+
path: urlPath,
|
|
196
|
+
method: 'PUT',
|
|
197
|
+
headers: headerParameters,
|
|
198
|
+
query: queryParameters,
|
|
199
|
+
body: (0, index_1.EventsWebhookUpsertRequestToJSON)(requestParameters['eventsWebhookUpsertRequest'])
|
|
200
|
+
}, initOverrides);
|
|
201
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.EventsWebhookResponseFromJSON)(jsonValue));
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Create or update the events webhook configuration for the current account/environment.
|
|
205
|
+
*/
|
|
206
|
+
async upsertEventsWebhook(eventsWebhookUpsertRequest, initOverrides) {
|
|
207
|
+
const response = await this.upsertEventsWebhookRaw({ eventsWebhookUpsertRequest: eventsWebhookUpsertRequest }, initOverrides);
|
|
208
|
+
return await response.value();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
exports.WebhooksApi = WebhooksApi;
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
* Events webhook configuration returned by the API.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface EventsWebhookResponse
|
|
16
|
+
*/
|
|
17
|
+
export interface EventsWebhookResponse {
|
|
18
|
+
/**
|
|
19
|
+
* Storage key in the format accountId:envId (currently accountId:accountId for account-scoped usage).
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof EventsWebhookResponse
|
|
22
|
+
*/
|
|
23
|
+
webhookId: string;
|
|
24
|
+
/**
|
|
25
|
+
* Destination URL that receives webhook event payloads.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof EventsWebhookResponse
|
|
28
|
+
*/
|
|
29
|
+
webhook: string;
|
|
30
|
+
/**
|
|
31
|
+
* List of subscribed event types for this webhook configuration.
|
|
32
|
+
* @type {Array<string>}
|
|
33
|
+
* @memberof EventsWebhookResponse
|
|
34
|
+
*/
|
|
35
|
+
events: Array<EventsWebhookResponseEventsEnum>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @export
|
|
39
|
+
* @enum {string}
|
|
40
|
+
*/
|
|
41
|
+
export declare enum EventsWebhookResponseEventsEnum {
|
|
42
|
+
EMAIL_OPEN = "EMAIL_OPEN",
|
|
43
|
+
EMAIL_CLICK = "EMAIL_CLICK",
|
|
44
|
+
EMAIL_FAILED = "EMAIL_FAILED",
|
|
45
|
+
EMAIL_DELIVERED = "EMAIL_DELIVERED",
|
|
46
|
+
EMAIL_UNSUBSCRIBE = "EMAIL_UNSUBSCRIBE",
|
|
47
|
+
EMAIL_INBOUND = "EMAIL_INBOUND",
|
|
48
|
+
INAPP_WEB_FAILED = "INAPP_WEB_FAILED",
|
|
49
|
+
INAPP_WEB_UNSUBSCRIBE = "INAPP_WEB_UNSUBSCRIBE",
|
|
50
|
+
SMS_DELIVERED = "SMS_DELIVERED",
|
|
51
|
+
SMS_FAILED = "SMS_FAILED",
|
|
52
|
+
SMS_UNSUBSCRIBE = "SMS_UNSUBSCRIBE",
|
|
53
|
+
SMS_INBOUND = "SMS_INBOUND",
|
|
54
|
+
PUSH_FAILED = "PUSH_FAILED",
|
|
55
|
+
PUSH_UNSUBSCRIBE = "PUSH_UNSUBSCRIBE",
|
|
56
|
+
CALL_FAILED = "CALL_FAILED",
|
|
57
|
+
CALL_UNSUBSCRIBE = "CALL_UNSUBSCRIBE",
|
|
58
|
+
WEB_PUSH_FAILED = "WEB_PUSH_FAILED",
|
|
59
|
+
WEB_PUSH_UNSUBSCRIBE = "WEB_PUSH_UNSUBSCRIBE",
|
|
60
|
+
SLACK_FAILED = "SLACK_FAILED",
|
|
61
|
+
SLACK_UNSUBSCRIBE = "SLACK_UNSUBSCRIBE"
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Check if a given object implements the EventsWebhookResponse interface.
|
|
65
|
+
*/
|
|
66
|
+
export declare function instanceOfEventsWebhookResponse(value: object): value is EventsWebhookResponse;
|
|
67
|
+
export declare function EventsWebhookResponseFromJSON(json: any): EventsWebhookResponse;
|
|
68
|
+
export declare function EventsWebhookResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): EventsWebhookResponse;
|
|
69
|
+
export declare function EventsWebhookResponseToJSON(json: any): EventsWebhookResponse;
|
|
70
|
+
export declare function EventsWebhookResponseToJSONTyped(value?: EventsWebhookResponse | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,86 @@
|
|
|
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.EventsWebhookResponseEventsEnum = void 0;
|
|
17
|
+
exports.instanceOfEventsWebhookResponse = instanceOfEventsWebhookResponse;
|
|
18
|
+
exports.EventsWebhookResponseFromJSON = EventsWebhookResponseFromJSON;
|
|
19
|
+
exports.EventsWebhookResponseFromJSONTyped = EventsWebhookResponseFromJSONTyped;
|
|
20
|
+
exports.EventsWebhookResponseToJSON = EventsWebhookResponseToJSON;
|
|
21
|
+
exports.EventsWebhookResponseToJSONTyped = EventsWebhookResponseToJSONTyped;
|
|
22
|
+
/**
|
|
23
|
+
* @export
|
|
24
|
+
* @enum {string}
|
|
25
|
+
*/
|
|
26
|
+
var EventsWebhookResponseEventsEnum;
|
|
27
|
+
(function (EventsWebhookResponseEventsEnum) {
|
|
28
|
+
EventsWebhookResponseEventsEnum["EMAIL_OPEN"] = "EMAIL_OPEN";
|
|
29
|
+
EventsWebhookResponseEventsEnum["EMAIL_CLICK"] = "EMAIL_CLICK";
|
|
30
|
+
EventsWebhookResponseEventsEnum["EMAIL_FAILED"] = "EMAIL_FAILED";
|
|
31
|
+
EventsWebhookResponseEventsEnum["EMAIL_DELIVERED"] = "EMAIL_DELIVERED";
|
|
32
|
+
EventsWebhookResponseEventsEnum["EMAIL_UNSUBSCRIBE"] = "EMAIL_UNSUBSCRIBE";
|
|
33
|
+
EventsWebhookResponseEventsEnum["EMAIL_INBOUND"] = "EMAIL_INBOUND";
|
|
34
|
+
EventsWebhookResponseEventsEnum["INAPP_WEB_FAILED"] = "INAPP_WEB_FAILED";
|
|
35
|
+
EventsWebhookResponseEventsEnum["INAPP_WEB_UNSUBSCRIBE"] = "INAPP_WEB_UNSUBSCRIBE";
|
|
36
|
+
EventsWebhookResponseEventsEnum["SMS_DELIVERED"] = "SMS_DELIVERED";
|
|
37
|
+
EventsWebhookResponseEventsEnum["SMS_FAILED"] = "SMS_FAILED";
|
|
38
|
+
EventsWebhookResponseEventsEnum["SMS_UNSUBSCRIBE"] = "SMS_UNSUBSCRIBE";
|
|
39
|
+
EventsWebhookResponseEventsEnum["SMS_INBOUND"] = "SMS_INBOUND";
|
|
40
|
+
EventsWebhookResponseEventsEnum["PUSH_FAILED"] = "PUSH_FAILED";
|
|
41
|
+
EventsWebhookResponseEventsEnum["PUSH_UNSUBSCRIBE"] = "PUSH_UNSUBSCRIBE";
|
|
42
|
+
EventsWebhookResponseEventsEnum["CALL_FAILED"] = "CALL_FAILED";
|
|
43
|
+
EventsWebhookResponseEventsEnum["CALL_UNSUBSCRIBE"] = "CALL_UNSUBSCRIBE";
|
|
44
|
+
EventsWebhookResponseEventsEnum["WEB_PUSH_FAILED"] = "WEB_PUSH_FAILED";
|
|
45
|
+
EventsWebhookResponseEventsEnum["WEB_PUSH_UNSUBSCRIBE"] = "WEB_PUSH_UNSUBSCRIBE";
|
|
46
|
+
EventsWebhookResponseEventsEnum["SLACK_FAILED"] = "SLACK_FAILED";
|
|
47
|
+
EventsWebhookResponseEventsEnum["SLACK_UNSUBSCRIBE"] = "SLACK_UNSUBSCRIBE";
|
|
48
|
+
})(EventsWebhookResponseEventsEnum || (exports.EventsWebhookResponseEventsEnum = EventsWebhookResponseEventsEnum = {}));
|
|
49
|
+
/**
|
|
50
|
+
* Check if a given object implements the EventsWebhookResponse interface.
|
|
51
|
+
*/
|
|
52
|
+
function instanceOfEventsWebhookResponse(value) {
|
|
53
|
+
if (!('webhookId' in value) || value['webhookId'] === undefined)
|
|
54
|
+
return false;
|
|
55
|
+
if (!('webhook' in value) || value['webhook'] === undefined)
|
|
56
|
+
return false;
|
|
57
|
+
if (!('events' in value) || value['events'] === undefined)
|
|
58
|
+
return false;
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
function EventsWebhookResponseFromJSON(json) {
|
|
62
|
+
return EventsWebhookResponseFromJSONTyped(json, false);
|
|
63
|
+
}
|
|
64
|
+
function EventsWebhookResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
65
|
+
if (json == null) {
|
|
66
|
+
return json;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
webhookId: json['webhookId'],
|
|
70
|
+
webhook: json['webhook'],
|
|
71
|
+
events: json['events']
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function EventsWebhookResponseToJSON(json) {
|
|
75
|
+
return EventsWebhookResponseToJSONTyped(json, false);
|
|
76
|
+
}
|
|
77
|
+
function EventsWebhookResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
78
|
+
if (value == null) {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
webhookId: value['webhookId'],
|
|
83
|
+
webhook: value['webhook'],
|
|
84
|
+
events: value['events']
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
* Request body for creating or updating the events webhook configuration.
|
|
14
|
+
* @export
|
|
15
|
+
* @interface EventsWebhookUpsertRequest
|
|
16
|
+
*/
|
|
17
|
+
export interface EventsWebhookUpsertRequest {
|
|
18
|
+
/**
|
|
19
|
+
* Destination URL that receives webhook event payloads. Must be a valid http(s) URL.
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof EventsWebhookUpsertRequest
|
|
22
|
+
*/
|
|
23
|
+
webhook: string;
|
|
24
|
+
/**
|
|
25
|
+
* List of event types that should be forwarded to the webhook URL.
|
|
26
|
+
* @type {Array<string>}
|
|
27
|
+
* @memberof EventsWebhookUpsertRequest
|
|
28
|
+
*/
|
|
29
|
+
events: Array<EventsWebhookUpsertRequestEventsEnum>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @export
|
|
33
|
+
* @enum {string}
|
|
34
|
+
*/
|
|
35
|
+
export declare enum EventsWebhookUpsertRequestEventsEnum {
|
|
36
|
+
EMAIL_OPEN = "EMAIL_OPEN",
|
|
37
|
+
EMAIL_CLICK = "EMAIL_CLICK",
|
|
38
|
+
EMAIL_FAILED = "EMAIL_FAILED",
|
|
39
|
+
EMAIL_DELIVERED = "EMAIL_DELIVERED",
|
|
40
|
+
EMAIL_UNSUBSCRIBE = "EMAIL_UNSUBSCRIBE",
|
|
41
|
+
EMAIL_INBOUND = "EMAIL_INBOUND",
|
|
42
|
+
INAPP_WEB_FAILED = "INAPP_WEB_FAILED",
|
|
43
|
+
INAPP_WEB_UNSUBSCRIBE = "INAPP_WEB_UNSUBSCRIBE",
|
|
44
|
+
SMS_DELIVERED = "SMS_DELIVERED",
|
|
45
|
+
SMS_FAILED = "SMS_FAILED",
|
|
46
|
+
SMS_UNSUBSCRIBE = "SMS_UNSUBSCRIBE",
|
|
47
|
+
SMS_INBOUND = "SMS_INBOUND",
|
|
48
|
+
PUSH_FAILED = "PUSH_FAILED",
|
|
49
|
+
PUSH_UNSUBSCRIBE = "PUSH_UNSUBSCRIBE",
|
|
50
|
+
CALL_FAILED = "CALL_FAILED",
|
|
51
|
+
CALL_UNSUBSCRIBE = "CALL_UNSUBSCRIBE",
|
|
52
|
+
WEB_PUSH_FAILED = "WEB_PUSH_FAILED",
|
|
53
|
+
WEB_PUSH_UNSUBSCRIBE = "WEB_PUSH_UNSUBSCRIBE",
|
|
54
|
+
SLACK_FAILED = "SLACK_FAILED",
|
|
55
|
+
SLACK_UNSUBSCRIBE = "SLACK_UNSUBSCRIBE"
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Check if a given object implements the EventsWebhookUpsertRequest interface.
|
|
59
|
+
*/
|
|
60
|
+
export declare function instanceOfEventsWebhookUpsertRequest(value: object): value is EventsWebhookUpsertRequest;
|
|
61
|
+
export declare function EventsWebhookUpsertRequestFromJSON(json: any): EventsWebhookUpsertRequest;
|
|
62
|
+
export declare function EventsWebhookUpsertRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): EventsWebhookUpsertRequest;
|
|
63
|
+
export declare function EventsWebhookUpsertRequestToJSON(json: any): EventsWebhookUpsertRequest;
|
|
64
|
+
export declare function EventsWebhookUpsertRequestToJSONTyped(value?: EventsWebhookUpsertRequest | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,82 @@
|
|
|
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.EventsWebhookUpsertRequestEventsEnum = void 0;
|
|
17
|
+
exports.instanceOfEventsWebhookUpsertRequest = instanceOfEventsWebhookUpsertRequest;
|
|
18
|
+
exports.EventsWebhookUpsertRequestFromJSON = EventsWebhookUpsertRequestFromJSON;
|
|
19
|
+
exports.EventsWebhookUpsertRequestFromJSONTyped = EventsWebhookUpsertRequestFromJSONTyped;
|
|
20
|
+
exports.EventsWebhookUpsertRequestToJSON = EventsWebhookUpsertRequestToJSON;
|
|
21
|
+
exports.EventsWebhookUpsertRequestToJSONTyped = EventsWebhookUpsertRequestToJSONTyped;
|
|
22
|
+
/**
|
|
23
|
+
* @export
|
|
24
|
+
* @enum {string}
|
|
25
|
+
*/
|
|
26
|
+
var EventsWebhookUpsertRequestEventsEnum;
|
|
27
|
+
(function (EventsWebhookUpsertRequestEventsEnum) {
|
|
28
|
+
EventsWebhookUpsertRequestEventsEnum["EMAIL_OPEN"] = "EMAIL_OPEN";
|
|
29
|
+
EventsWebhookUpsertRequestEventsEnum["EMAIL_CLICK"] = "EMAIL_CLICK";
|
|
30
|
+
EventsWebhookUpsertRequestEventsEnum["EMAIL_FAILED"] = "EMAIL_FAILED";
|
|
31
|
+
EventsWebhookUpsertRequestEventsEnum["EMAIL_DELIVERED"] = "EMAIL_DELIVERED";
|
|
32
|
+
EventsWebhookUpsertRequestEventsEnum["EMAIL_UNSUBSCRIBE"] = "EMAIL_UNSUBSCRIBE";
|
|
33
|
+
EventsWebhookUpsertRequestEventsEnum["EMAIL_INBOUND"] = "EMAIL_INBOUND";
|
|
34
|
+
EventsWebhookUpsertRequestEventsEnum["INAPP_WEB_FAILED"] = "INAPP_WEB_FAILED";
|
|
35
|
+
EventsWebhookUpsertRequestEventsEnum["INAPP_WEB_UNSUBSCRIBE"] = "INAPP_WEB_UNSUBSCRIBE";
|
|
36
|
+
EventsWebhookUpsertRequestEventsEnum["SMS_DELIVERED"] = "SMS_DELIVERED";
|
|
37
|
+
EventsWebhookUpsertRequestEventsEnum["SMS_FAILED"] = "SMS_FAILED";
|
|
38
|
+
EventsWebhookUpsertRequestEventsEnum["SMS_UNSUBSCRIBE"] = "SMS_UNSUBSCRIBE";
|
|
39
|
+
EventsWebhookUpsertRequestEventsEnum["SMS_INBOUND"] = "SMS_INBOUND";
|
|
40
|
+
EventsWebhookUpsertRequestEventsEnum["PUSH_FAILED"] = "PUSH_FAILED";
|
|
41
|
+
EventsWebhookUpsertRequestEventsEnum["PUSH_UNSUBSCRIBE"] = "PUSH_UNSUBSCRIBE";
|
|
42
|
+
EventsWebhookUpsertRequestEventsEnum["CALL_FAILED"] = "CALL_FAILED";
|
|
43
|
+
EventsWebhookUpsertRequestEventsEnum["CALL_UNSUBSCRIBE"] = "CALL_UNSUBSCRIBE";
|
|
44
|
+
EventsWebhookUpsertRequestEventsEnum["WEB_PUSH_FAILED"] = "WEB_PUSH_FAILED";
|
|
45
|
+
EventsWebhookUpsertRequestEventsEnum["WEB_PUSH_UNSUBSCRIBE"] = "WEB_PUSH_UNSUBSCRIBE";
|
|
46
|
+
EventsWebhookUpsertRequestEventsEnum["SLACK_FAILED"] = "SLACK_FAILED";
|
|
47
|
+
EventsWebhookUpsertRequestEventsEnum["SLACK_UNSUBSCRIBE"] = "SLACK_UNSUBSCRIBE";
|
|
48
|
+
})(EventsWebhookUpsertRequestEventsEnum || (exports.EventsWebhookUpsertRequestEventsEnum = EventsWebhookUpsertRequestEventsEnum = {}));
|
|
49
|
+
/**
|
|
50
|
+
* Check if a given object implements the EventsWebhookUpsertRequest interface.
|
|
51
|
+
*/
|
|
52
|
+
function instanceOfEventsWebhookUpsertRequest(value) {
|
|
53
|
+
if (!('webhook' in value) || value['webhook'] === undefined)
|
|
54
|
+
return false;
|
|
55
|
+
if (!('events' in value) || value['events'] === undefined)
|
|
56
|
+
return false;
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
function EventsWebhookUpsertRequestFromJSON(json) {
|
|
60
|
+
return EventsWebhookUpsertRequestFromJSONTyped(json, false);
|
|
61
|
+
}
|
|
62
|
+
function EventsWebhookUpsertRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
63
|
+
if (json == null) {
|
|
64
|
+
return json;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
webhook: json['webhook'],
|
|
68
|
+
events: json['events']
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function EventsWebhookUpsertRequestToJSON(json) {
|
|
72
|
+
return EventsWebhookUpsertRequestToJSONTyped(json, false);
|
|
73
|
+
}
|
|
74
|
+
function EventsWebhookUpsertRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
75
|
+
if (value == null) {
|
|
76
|
+
return value;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
webhook: value['webhook'],
|
|
80
|
+
events: value['events']
|
|
81
|
+
};
|
|
82
|
+
}
|
|
@@ -26,6 +26,8 @@ export * from './EmailComponentResponseReferencedByInner';
|
|
|
26
26
|
export * from './Environment';
|
|
27
27
|
export * from './EnvironmentCreateRequest';
|
|
28
28
|
export * from './EnvironmentPatchRequest';
|
|
29
|
+
export * from './EventsWebhookResponse';
|
|
30
|
+
export * from './EventsWebhookUpsertRequest';
|
|
29
31
|
export * from './GetAccountMetadataResponse';
|
|
30
32
|
export * from './GetAccountMetadataResponseUserAccountMetadata';
|
|
31
33
|
export * from './GetEmailComponentsResponseInner';
|
|
@@ -44,6 +44,8 @@ __exportStar(require("./EmailComponentResponseReferencedByInner"), exports);
|
|
|
44
44
|
__exportStar(require("./Environment"), exports);
|
|
45
45
|
__exportStar(require("./EnvironmentCreateRequest"), exports);
|
|
46
46
|
__exportStar(require("./EnvironmentPatchRequest"), exports);
|
|
47
|
+
__exportStar(require("./EventsWebhookResponse"), exports);
|
|
48
|
+
__exportStar(require("./EventsWebhookUpsertRequest"), exports);
|
|
47
49
|
__exportStar(require("./GetAccountMetadataResponse"), exports);
|
|
48
50
|
__exportStar(require("./GetAccountMetadataResponseUserAccountMetadata"), exports);
|
|
49
51
|
__exportStar(require("./GetEmailComponentsResponseInner"), exports);
|
package/dist/src/client.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { TemplatesApi } from '../generated/src';
|
|
|
19
19
|
import { TypesApi } from '../generated/src';
|
|
20
20
|
import { UserApi } from '../generated/src';
|
|
21
21
|
import { UsersApi } from '../generated/src';
|
|
22
|
+
import { WebhooksApi } from '../generated/src';
|
|
22
23
|
import { DefaultApi } from '../generated/src';
|
|
23
24
|
/**
|
|
24
25
|
* Supported Pingram regions
|
|
@@ -115,6 +116,7 @@ export declare class Pingram {
|
|
|
115
116
|
types: TypesApi;
|
|
116
117
|
user: UserApi;
|
|
117
118
|
users: UsersApi;
|
|
119
|
+
webhooks: WebhooksApi;
|
|
118
120
|
private defaultApi;
|
|
119
121
|
constructor(config: PingramConfig);
|
|
120
122
|
/**
|
package/dist/src/client.js
CHANGED
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.Pingram = void 0;
|
|
9
9
|
const src_1 = require("../generated/src");
|
|
10
10
|
// SDK version for User-Agent header (injected at codegen time)
|
|
11
|
-
const SDK_VERSION = '1.0.
|
|
11
|
+
const SDK_VERSION = '1.0.2';
|
|
12
12
|
const USER_AGENT = `pingram-node/${SDK_VERSION}`;
|
|
13
13
|
const src_2 = require("../generated/src");
|
|
14
14
|
const src_3 = require("../generated/src");
|
|
@@ -27,6 +27,7 @@ const src_15 = require("../generated/src");
|
|
|
27
27
|
const src_16 = require("../generated/src");
|
|
28
28
|
const src_17 = require("../generated/src");
|
|
29
29
|
const src_18 = require("../generated/src");
|
|
30
|
+
const src_19 = require("../generated/src");
|
|
30
31
|
const testing_1 = require("./testing");
|
|
31
32
|
/**
|
|
32
33
|
* Get the base URL for a given region
|
|
@@ -122,7 +123,8 @@ class Pingram {
|
|
|
122
123
|
this.types = new src_15.TypesApi(this.config);
|
|
123
124
|
this.user = new src_16.UserApi(this.config);
|
|
124
125
|
this.users = new src_17.UsersApi(this.config);
|
|
125
|
-
this.
|
|
126
|
+
this.webhooks = new src_18.WebhooksApi(this.config);
|
|
127
|
+
this.defaultApi = new src_19.DefaultApi(this.config);
|
|
126
128
|
}
|
|
127
129
|
/**
|
|
128
130
|
* Update the base URL (overrides region)
|
|
@@ -148,7 +150,8 @@ class Pingram {
|
|
|
148
150
|
this.types = new src_15.TypesApi(this.config);
|
|
149
151
|
this.user = new src_16.UserApi(this.config);
|
|
150
152
|
this.users = new src_17.UsersApi(this.config);
|
|
151
|
-
this.
|
|
153
|
+
this.webhooks = new src_18.WebhooksApi(this.config);
|
|
154
|
+
this.defaultApi = new src_19.DefaultApi(this.config);
|
|
152
155
|
}
|
|
153
156
|
/**
|
|
154
157
|
* send
|
package/package.json
CHANGED