pingram 1.0.0 → 1.0.1-alpha.866
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/TemplatesApi.d.ts +0 -28
- package/dist/generated/src/apis/TemplatesApi.js +0 -66
- package/dist/generated/src/models/GetTemplatesListResponseInner.d.ts +0 -6
- package/dist/generated/src/models/GetTemplatesListResponseInner.js +0 -2
- package/dist/generated/src/models/GetTemplatesListResponseInnerAnyOf.d.ts +0 -6
- package/dist/generated/src/models/GetTemplatesListResponseInnerAnyOf.js +2 -4
- package/dist/generated/src/models/GetTemplatesResponse.d.ts +0 -6
- package/dist/generated/src/models/GetTemplatesResponse.js +0 -2
- package/dist/generated/src/models/TemplatePatchRequest.d.ts +0 -6
- package/dist/generated/src/models/TemplatePatchRequest.js +0 -2
- package/dist/generated/src/models/TemplatePostRequest.d.ts +0 -6
- package/dist/generated/src/models/TemplatePostRequest.js +0 -2
- package/dist/src/client.js +1 -1
- package/package.json +1 -1
|
@@ -26,11 +26,6 @@ export interface GetTemplateRequest {
|
|
|
26
26
|
channel: string;
|
|
27
27
|
templateId: string;
|
|
28
28
|
}
|
|
29
|
-
export interface InitiateMigrationRequest {
|
|
30
|
-
notificationId: string;
|
|
31
|
-
channel: string;
|
|
32
|
-
templateId: string;
|
|
33
|
-
}
|
|
34
29
|
export interface ListTemplatesRequest {
|
|
35
30
|
notificationId: string;
|
|
36
31
|
channel: string;
|
|
@@ -98,21 +93,6 @@ export interface TemplatesApiInterface {
|
|
|
98
93
|
* Get a single template by ID
|
|
99
94
|
*/
|
|
100
95
|
getTemplate(notificationId: string, channel: string, templateId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetTemplatesResponse>;
|
|
101
|
-
/**
|
|
102
|
-
*
|
|
103
|
-
* @summary Initiate AI-powered template migration from complex to simple HTML
|
|
104
|
-
* @param {string} notificationId Notification ID
|
|
105
|
-
* @param {string} channel Channel type
|
|
106
|
-
* @param {string} templateId Template ID
|
|
107
|
-
* @param {*} [options] Override http request option.
|
|
108
|
-
* @throws {RequiredError}
|
|
109
|
-
* @memberof TemplatesApiInterface
|
|
110
|
-
*/
|
|
111
|
-
initiateMigrationRaw(requestParameters: InitiateMigrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Template>>;
|
|
112
|
-
/**
|
|
113
|
-
* Initiate AI-powered template migration from complex to simple HTML
|
|
114
|
-
*/
|
|
115
|
-
initiateMigration(notificationId: string, channel: string, templateId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Template>;
|
|
116
96
|
/**
|
|
117
97
|
*
|
|
118
98
|
* @summary List all templates for a notification and channel
|
|
@@ -187,14 +167,6 @@ export declare class TemplatesApi extends runtime.BaseAPI implements TemplatesAp
|
|
|
187
167
|
* Get a single template by ID
|
|
188
168
|
*/
|
|
189
169
|
getTemplate(notificationId: string, channel: string, templateId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetTemplatesResponse>;
|
|
190
|
-
/**
|
|
191
|
-
* Initiate AI-powered template migration from complex to simple HTML
|
|
192
|
-
*/
|
|
193
|
-
initiateMigrationRaw(requestParameters: InitiateMigrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Template>>;
|
|
194
|
-
/**
|
|
195
|
-
* Initiate AI-powered template migration from complex to simple HTML
|
|
196
|
-
*/
|
|
197
|
-
initiateMigration(notificationId: string, channel: string, templateId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Template>;
|
|
198
170
|
/**
|
|
199
171
|
* List all templates for a notification and channel
|
|
200
172
|
*/
|
|
@@ -251,72 +251,6 @@ class TemplatesApi extends runtime.BaseAPI {
|
|
|
251
251
|
}, initOverrides);
|
|
252
252
|
return await response.value();
|
|
253
253
|
}
|
|
254
|
-
/**
|
|
255
|
-
* Initiate AI-powered template migration from complex to simple HTML
|
|
256
|
-
*/
|
|
257
|
-
async initiateMigrationRaw(requestParameters, initOverrides) {
|
|
258
|
-
if (requestParameters['notificationId'] == null) {
|
|
259
|
-
throw new runtime.RequiredError('notificationId', 'Required parameter "notificationId" was null or undefined when calling initiateMigration().');
|
|
260
|
-
}
|
|
261
|
-
if (requestParameters['channel'] == null) {
|
|
262
|
-
throw new runtime.RequiredError('channel', 'Required parameter "channel" was null or undefined when calling initiateMigration().');
|
|
263
|
-
}
|
|
264
|
-
if (requestParameters['templateId'] == null) {
|
|
265
|
-
throw new runtime.RequiredError('templateId', 'Required parameter "templateId" was null or undefined when calling initiateMigration().');
|
|
266
|
-
}
|
|
267
|
-
const queryParameters = {};
|
|
268
|
-
const headerParameters = {};
|
|
269
|
-
if (this.configuration &&
|
|
270
|
-
(this.configuration.username !== undefined ||
|
|
271
|
-
this.configuration.password !== undefined)) {
|
|
272
|
-
headerParameters['Authorization'] =
|
|
273
|
-
'Basic ' +
|
|
274
|
-
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
275
|
-
}
|
|
276
|
-
if (this.configuration &&
|
|
277
|
-
(this.configuration.username !== undefined ||
|
|
278
|
-
this.configuration.password !== undefined)) {
|
|
279
|
-
headerParameters['Authorization'] =
|
|
280
|
-
'Basic ' +
|
|
281
|
-
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
282
|
-
}
|
|
283
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
284
|
-
const token = this.configuration.accessToken;
|
|
285
|
-
const tokenString = await token('apiKey', []);
|
|
286
|
-
if (tokenString) {
|
|
287
|
-
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
if (this.configuration &&
|
|
291
|
-
(this.configuration.username !== undefined ||
|
|
292
|
-
this.configuration.password !== undefined)) {
|
|
293
|
-
headerParameters['Authorization'] =
|
|
294
|
-
'Basic ' +
|
|
295
|
-
btoa(this.configuration.username + ':' + this.configuration.password);
|
|
296
|
-
}
|
|
297
|
-
let urlPath = `/notifications/{notificationId}/{channel}/templates/{templateId}/migrate`;
|
|
298
|
-
urlPath = urlPath.replace(`{${'notificationId'}}`, encodeURIComponent(String(requestParameters['notificationId'])));
|
|
299
|
-
urlPath = urlPath.replace(`{${'channel'}}`, encodeURIComponent(String(requestParameters['channel'])));
|
|
300
|
-
urlPath = urlPath.replace(`{${'templateId'}}`, encodeURIComponent(String(requestParameters['templateId'])));
|
|
301
|
-
const response = await this.request({
|
|
302
|
-
path: urlPath,
|
|
303
|
-
method: 'POST',
|
|
304
|
-
headers: headerParameters,
|
|
305
|
-
query: queryParameters
|
|
306
|
-
}, initOverrides);
|
|
307
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TemplateFromJSON)(jsonValue));
|
|
308
|
-
}
|
|
309
|
-
/**
|
|
310
|
-
* Initiate AI-powered template migration from complex to simple HTML
|
|
311
|
-
*/
|
|
312
|
-
async initiateMigration(notificationId, channel, templateId, initOverrides) {
|
|
313
|
-
const response = await this.initiateMigrationRaw({
|
|
314
|
-
notificationId: notificationId,
|
|
315
|
-
channel: channel,
|
|
316
|
-
templateId: templateId
|
|
317
|
-
}, initOverrides);
|
|
318
|
-
return await response.value();
|
|
319
|
-
}
|
|
320
254
|
/**
|
|
321
255
|
* List all templates for a notification and channel
|
|
322
256
|
*/
|
|
@@ -92,12 +92,6 @@ export interface GetTemplatesListResponseInner {
|
|
|
92
92
|
* @memberof GetTemplatesListResponseInner
|
|
93
93
|
*/
|
|
94
94
|
senderEmail: string;
|
|
95
|
-
/**
|
|
96
|
-
*
|
|
97
|
-
* @type {string}
|
|
98
|
-
* @memberof GetTemplatesListResponseInner
|
|
99
|
-
*/
|
|
100
|
-
migration?: string;
|
|
101
95
|
/**
|
|
102
96
|
*
|
|
103
97
|
* @type {string}
|
|
@@ -91,7 +91,6 @@ function GetTemplatesListResponseInnerFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
91
91
|
subject: json['subject'],
|
|
92
92
|
senderName: json['senderName'],
|
|
93
93
|
senderEmail: json['senderEmail'],
|
|
94
|
-
migration: json['migration'] == null ? undefined : json['migration'],
|
|
95
94
|
title: json['title'],
|
|
96
95
|
redirectURL: json['redirectURL'],
|
|
97
96
|
imageURL: json['imageURL'],
|
|
@@ -135,7 +134,6 @@ function GetTemplatesListResponseInnerToJSONTyped(value, ignoreDiscriminator = f
|
|
|
135
134
|
subject: value['subject'],
|
|
136
135
|
senderName: value['senderName'],
|
|
137
136
|
senderEmail: value['senderEmail'],
|
|
138
|
-
migration: value['migration'],
|
|
139
137
|
title: value['title'],
|
|
140
138
|
redirectURL: value['redirectURL'],
|
|
141
139
|
imageURL: value['imageURL'],
|
|
@@ -90,12 +90,6 @@ export interface GetTemplatesListResponseInnerAnyOf {
|
|
|
90
90
|
* @memberof GetTemplatesListResponseInnerAnyOf
|
|
91
91
|
*/
|
|
92
92
|
senderEmail: string;
|
|
93
|
-
/**
|
|
94
|
-
*
|
|
95
|
-
* @type {string}
|
|
96
|
-
* @memberof GetTemplatesListResponseInnerAnyOf
|
|
97
|
-
*/
|
|
98
|
-
migration?: string;
|
|
99
93
|
}
|
|
100
94
|
/**
|
|
101
95
|
* Check if a given object implements the GetTemplatesListResponseInnerAnyOf interface.
|
|
@@ -64,8 +64,7 @@ function GetTemplatesListResponseInnerAnyOfFromJSONTyped(json, ignoreDiscriminat
|
|
|
64
64
|
internal: json['internal'],
|
|
65
65
|
subject: json['subject'],
|
|
66
66
|
senderName: json['senderName'],
|
|
67
|
-
senderEmail: json['senderEmail']
|
|
68
|
-
migration: json['migration'] == null ? undefined : json['migration']
|
|
67
|
+
senderEmail: json['senderEmail']
|
|
69
68
|
};
|
|
70
69
|
}
|
|
71
70
|
function GetTemplatesListResponseInnerAnyOfToJSON(json) {
|
|
@@ -87,7 +86,6 @@ function GetTemplatesListResponseInnerAnyOfToJSONTyped(value, ignoreDiscriminato
|
|
|
87
86
|
internal: value['internal'],
|
|
88
87
|
subject: value['subject'],
|
|
89
88
|
senderName: value['senderName'],
|
|
90
|
-
senderEmail: value['senderEmail']
|
|
91
|
-
migration: value['migration']
|
|
89
|
+
senderEmail: value['senderEmail']
|
|
92
90
|
};
|
|
93
91
|
}
|
|
@@ -91,7 +91,6 @@ function GetTemplatesResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
91
91
|
subject: json['subject'],
|
|
92
92
|
senderName: json['senderName'],
|
|
93
93
|
senderEmail: json['senderEmail'],
|
|
94
|
-
migration: json['migration'] == null ? undefined : json['migration'],
|
|
95
94
|
title: json['title'],
|
|
96
95
|
redirectURL: json['redirectURL'],
|
|
97
96
|
imageURL: json['imageURL'],
|
|
@@ -135,7 +134,6 @@ function GetTemplatesResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
135
134
|
subject: value['subject'],
|
|
136
135
|
senderName: value['senderName'],
|
|
137
136
|
senderEmail: value['senderEmail'],
|
|
138
|
-
migration: value['migration'],
|
|
139
137
|
title: value['title'],
|
|
140
138
|
redirectURL: value['redirectURL'],
|
|
141
139
|
imageURL: value['imageURL'],
|
|
@@ -53,12 +53,6 @@ export interface TemplatePatchRequest {
|
|
|
53
53
|
* @memberof TemplatePatchRequest
|
|
54
54
|
*/
|
|
55
55
|
senderEmail?: string;
|
|
56
|
-
/**
|
|
57
|
-
* Migration metadata (e.g. from template migration).
|
|
58
|
-
* @type {string}
|
|
59
|
-
* @memberof TemplatePatchRequest
|
|
60
|
-
*/
|
|
61
|
-
migration?: string;
|
|
62
56
|
/**
|
|
63
57
|
* Notification title (in-app).
|
|
64
58
|
* @type {string}
|
|
@@ -40,7 +40,6 @@ function TemplatePatchRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
40
40
|
subject: json['subject'] == null ? undefined : json['subject'],
|
|
41
41
|
senderName: json['senderName'] == null ? undefined : json['senderName'],
|
|
42
42
|
senderEmail: json['senderEmail'] == null ? undefined : json['senderEmail'],
|
|
43
|
-
migration: json['migration'] == null ? undefined : json['migration'],
|
|
44
43
|
title: json['title'] == null ? undefined : json['title'],
|
|
45
44
|
redirectURL: json['redirectURL'] == null ? undefined : json['redirectURL'],
|
|
46
45
|
imageURL: json['imageURL'] == null ? undefined : json['imageURL'],
|
|
@@ -72,7 +71,6 @@ function TemplatePatchRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
72
71
|
subject: value['subject'],
|
|
73
72
|
senderName: value['senderName'],
|
|
74
73
|
senderEmail: value['senderEmail'],
|
|
75
|
-
migration: value['migration'],
|
|
76
74
|
title: value['title'],
|
|
77
75
|
redirectURL: value['redirectURL'],
|
|
78
76
|
imageURL: value['imageURL'],
|
|
@@ -59,12 +59,6 @@ export interface TemplatePostRequest {
|
|
|
59
59
|
* @memberof TemplatePostRequest
|
|
60
60
|
*/
|
|
61
61
|
senderEmail?: string;
|
|
62
|
-
/**
|
|
63
|
-
* Migration metadata (e.g. from template migration).
|
|
64
|
-
* @type {string}
|
|
65
|
-
* @memberof TemplatePostRequest
|
|
66
|
-
*/
|
|
67
|
-
migration?: string;
|
|
68
62
|
/**
|
|
69
63
|
* Notification title (in-app).
|
|
70
64
|
* @type {string}
|
|
@@ -43,7 +43,6 @@ function TemplatePostRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
43
43
|
subject: json['subject'] == null ? undefined : json['subject'],
|
|
44
44
|
senderName: json['senderName'] == null ? undefined : json['senderName'],
|
|
45
45
|
senderEmail: json['senderEmail'] == null ? undefined : json['senderEmail'],
|
|
46
|
-
migration: json['migration'] == null ? undefined : json['migration'],
|
|
47
46
|
title: json['title'] == null ? undefined : json['title'],
|
|
48
47
|
redirectURL: json['redirectURL'] == null ? undefined : json['redirectURL'],
|
|
49
48
|
imageURL: json['imageURL'] == null ? undefined : json['imageURL'],
|
|
@@ -76,7 +75,6 @@ function TemplatePostRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
76
75
|
subject: value['subject'],
|
|
77
76
|
senderName: value['senderName'],
|
|
78
77
|
senderEmail: value['senderEmail'],
|
|
79
|
-
migration: value['migration'],
|
|
80
78
|
title: value['title'],
|
|
81
79
|
redirectURL: value['redirectURL'],
|
|
82
80
|
imageURL: value['imageURL'],
|
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.1';
|
|
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");
|
package/package.json
CHANGED