@parra/parra-js-sdk 0.3.172 → 0.3.174

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.
@@ -2309,6 +2309,102 @@ export interface UpdateMailSenderRequestBody {
2309
2309
  from_address?: string;
2310
2310
  reply_to?: string | null;
2311
2311
  }
2312
+ export interface CreateMailTemplateRequestBody {
2313
+ title: string;
2314
+ description?: string | null;
2315
+ slug?: string | null;
2316
+ sender_id: string;
2317
+ connected_app_connection_id: string;
2318
+ }
2319
+ export declare enum MailTemplateStatus {
2320
+ live = "live",
2321
+ draft = "draft"
2322
+ }
2323
+ export declare enum MailTemplateVersionStatus {
2324
+ pristine = "pristine",
2325
+ draft = "draft",
2326
+ published = "published"
2327
+ }
2328
+ export interface MailTemplateVersionStub {
2329
+ id: string;
2330
+ created_at: string;
2331
+ updated_at: string;
2332
+ deleted_at?: string | null;
2333
+ tenant_id: string;
2334
+ status: MailTemplateVersionStatus;
2335
+ version: string;
2336
+ title: string | null;
2337
+ description?: string | null;
2338
+ slug?: string | null;
2339
+ }
2340
+ export interface MailTemplateCollectionStub {
2341
+ id: string;
2342
+ created_at: string;
2343
+ updated_at: string;
2344
+ deleted_at?: string | null;
2345
+ tenant_id: string;
2346
+ title: string;
2347
+ description?: string | null;
2348
+ slug?: string | null;
2349
+ status: MailTemplateStatus;
2350
+ versions: Array<MailTemplateVersionStub>;
2351
+ }
2352
+ export interface MailTemplate {
2353
+ id: string;
2354
+ created_at: string;
2355
+ updated_at: string;
2356
+ deleted_at?: string | null;
2357
+ tenant_id: string;
2358
+ title: string;
2359
+ description?: string | null;
2360
+ slug?: string | null;
2361
+ status: MailTemplateStatus;
2362
+ versions: Array<MailTemplateVersionStub>;
2363
+ }
2364
+ export interface MailTemplateCollectionResponse {
2365
+ page: number;
2366
+ page_count: number;
2367
+ page_size: number;
2368
+ total_count: number;
2369
+ data: Array<MailTemplateCollectionStub>;
2370
+ }
2371
+ export interface UpdateMailTemplateRequestBody {
2372
+ title?: string;
2373
+ description?: string | null;
2374
+ slug?: string | null;
2375
+ sender_id?: string;
2376
+ connected_app_connection_id?: string;
2377
+ }
2378
+ export interface CreateMailTemplateVersionRequestBody {
2379
+ title: string;
2380
+ version: string;
2381
+ text_content?: string | null;
2382
+ json_content?: string | null;
2383
+ html_content?: string | null;
2384
+ }
2385
+ export interface MailTemplateVersion {
2386
+ id: string;
2387
+ created_at: string;
2388
+ updated_at: string;
2389
+ deleted_at?: string | null;
2390
+ tenant_id: string;
2391
+ status: MailTemplateVersionStatus;
2392
+ version: string;
2393
+ title: string | null;
2394
+ description?: string | null;
2395
+ slug?: string | null;
2396
+ mail_template_id: string;
2397
+ text_content?: string | null;
2398
+ json_content?: string | null;
2399
+ html_content?: string | null;
2400
+ }
2401
+ export interface UpdateMailTemplateVersionRequestBody {
2402
+ title?: string;
2403
+ version?: string;
2404
+ text_content?: string | null;
2405
+ json_content?: string | null;
2406
+ html_content?: string | null;
2407
+ }
2312
2408
  export interface UpdatePolicyDocumentRequestBody {
2313
2409
  title?: string | null;
2314
2410
  url?: string | null;
@@ -2739,6 +2835,24 @@ declare class ParraAPI {
2739
2835
  getMailSenderByIdForTenantById: (tenant_id: string, mail_sender_id: string, options?: Options) => Promise<MailSender>;
2740
2836
  updateMailSenderByIdForTenantById: (tenant_id: string, mail_sender_id: string, body?: UpdateMailSenderRequestBody, options?: Options) => Promise<MailSender>;
2741
2837
  deleteMailSenderByIdForTenantById: (tenant_id: string, mail_sender_id: string, options?: Options) => Promise<Response>;
2838
+ createMailTemplateForTenantById: (tenant_id: string, body: CreateMailTemplateRequestBody, options?: Options) => Promise<MailTemplate>;
2839
+ paginateMailTemplatesForTenantById: (tenant_id: string, query?: {
2840
+ $select?: string;
2841
+ $top?: number;
2842
+ $skip?: number;
2843
+ $orderby?: string;
2844
+ $filter?: string;
2845
+ $expand?: string;
2846
+ $search?: string;
2847
+ }, options?: Options) => Promise<MailTemplateCollectionResponse>;
2848
+ getMailTemplateByIdForTenantById: (tenant_id: string, mail_template_id: string, options?: Options) => Promise<MailTemplate>;
2849
+ updateMailTemplateByIdForTenantById: (tenant_id: string, mail_template_id: string, body?: UpdateMailTemplateRequestBody, options?: Options) => Promise<MailTemplate>;
2850
+ deleteMailTemplateByIdForTenantById: (tenant_id: string, mail_template_id: string, options?: Options) => Promise<Response>;
2851
+ createVersionForMailTemplateByIdForTenantById: (tenant_id: string, mail_template_id: string, body: CreateMailTemplateVersionRequestBody, options?: Options) => Promise<MailTemplateVersion>;
2852
+ getMailTemplateVersionForTenantById: (tenant_id: string, mail_template_id: string, mail_template_version_id: string, options?: Options) => Promise<MailTemplateVersion>;
2853
+ updateMailTemplateVersionForTenantById: (tenant_id: string, mail_template_id: string, mail_template_version_id: string, body?: UpdateMailTemplateVersionRequestBody, options?: Options) => Promise<MailTemplateVersion>;
2854
+ deleteMailTemplateVersionForTenantById: (tenant_id: string, mail_template_id: string, mail_template_version_id: string, options?: Options) => Promise<Response>;
2855
+ publishMailTemplateVersionForTenantById: (tenant_id: string, mail_template_id: string, mail_template_version_id: string, body?: UpdateMailTemplateVersionRequestBody, options?: Options) => Promise<MailTemplateVersion>;
2742
2856
  createPolicyDocumentForTenantById: (tenant_id: string, body: CreatePolicyDocumentRequestBody, options?: Options) => Promise<PolicyDocument>;
2743
2857
  paginatePolicyDocumentsForTenantById: (tenant_id: string, query?: {
2744
2858
  $select?: string;
package/dist/ParraAPI.js CHANGED
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.PolicyDocumentVersionStatus = exports.PolicyDocumentStatus = exports.IntegrationScope = exports.IntegrationConnectionStatus = exports.IntegrationType = exports.ConnectedAppConnectionStatus = exports.ConnectedAppType = exports.TenantOnboardingGoal = exports.ApplicationType = exports.RefreshTokenRotationType = exports.RefreshTokenExpirationType = exports.JwtAlgorithm = exports.GrantType = exports.PasswordlessStrategy = exports.ApnsPushType = exports.ApnsEnvironment = exports.ChannelType = exports.AppVersionStatus = exports.TicketDisplayStatus = exports.UserNoteStatus = exports.TemplateType = exports.CampaignStatus = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CardItemDisplayType = exports.CardItemType = exports.QuestionKind = exports.QuestionType = exports.FeedbackFormFieldType = exports.SubscriptionStatus = exports.Currency = exports.Interval = exports.IdentityType = exports.PolicyDocumentType = exports.DomainStatus = exports.DomainType = exports.ReleaseType = exports.ReleaseStatus = exports.TicketIconType = exports.TicketPriority = exports.TicketStatus = exports.TicketType = void 0;
14
+ exports.PolicyDocumentVersionStatus = exports.PolicyDocumentStatus = exports.MailTemplateVersionStatus = exports.MailTemplateStatus = exports.IntegrationScope = exports.IntegrationConnectionStatus = exports.IntegrationType = exports.ConnectedAppConnectionStatus = exports.ConnectedAppType = exports.TenantOnboardingGoal = exports.ApplicationType = exports.RefreshTokenRotationType = exports.RefreshTokenExpirationType = exports.JwtAlgorithm = exports.GrantType = exports.PasswordlessStrategy = exports.ApnsPushType = exports.ApnsEnvironment = exports.ChannelType = exports.AppVersionStatus = exports.TicketDisplayStatus = exports.UserNoteStatus = exports.TemplateType = exports.CampaignStatus = exports.CampaignActionDisplayType = exports.CampaignActionType = exports.CardItemDisplayType = exports.CardItemType = exports.QuestionKind = exports.QuestionType = exports.FeedbackFormFieldType = exports.SubscriptionStatus = exports.Currency = exports.Interval = exports.IdentityType = exports.PolicyDocumentType = exports.DomainStatus = exports.DomainType = exports.ReleaseType = exports.ReleaseStatus = exports.TicketIconType = exports.TicketPriority = exports.TicketStatus = exports.TicketType = void 0;
15
15
  var TicketType;
16
16
  (function (TicketType) {
17
17
  TicketType["bug"] = "bug";
@@ -278,6 +278,17 @@ var IntegrationScope;
278
278
  IntegrationScope["collection"] = "collection";
279
279
  IntegrationScope["resource"] = "resource";
280
280
  })(IntegrationScope || (exports.IntegrationScope = IntegrationScope = {}));
281
+ var MailTemplateStatus;
282
+ (function (MailTemplateStatus) {
283
+ MailTemplateStatus["live"] = "live";
284
+ MailTemplateStatus["draft"] = "draft";
285
+ })(MailTemplateStatus || (exports.MailTemplateStatus = MailTemplateStatus = {}));
286
+ var MailTemplateVersionStatus;
287
+ (function (MailTemplateVersionStatus) {
288
+ MailTemplateVersionStatus["pristine"] = "pristine";
289
+ MailTemplateVersionStatus["draft"] = "draft";
290
+ MailTemplateVersionStatus["published"] = "published";
291
+ })(MailTemplateVersionStatus || (exports.MailTemplateVersionStatus = MailTemplateVersionStatus = {}));
281
292
  var PolicyDocumentStatus;
282
293
  (function (PolicyDocumentStatus) {
283
294
  PolicyDocumentStatus["live"] = "live";
@@ -1094,6 +1105,56 @@ var ParraAPI = /** @class */ (function () {
1094
1105
  if (options === void 0) { options = {}; }
1095
1106
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/mail/senders/").concat(mail_sender_id), __assign({ method: "delete" }, options));
1096
1107
  };
1108
+ this.createMailTemplateForTenantById = function (tenant_id, body, options) {
1109
+ if (options === void 0) { options = {}; }
1110
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/mail/templates"), __assign({ method: "post", body: JSON.stringify(body), headers: {
1111
+ "content-type": "application/json",
1112
+ } }, options));
1113
+ };
1114
+ this.paginateMailTemplatesForTenantById = function (tenant_id, query, options) {
1115
+ if (options === void 0) { options = {}; }
1116
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/mail/templates"), __assign({ method: "get", query: query }, options));
1117
+ };
1118
+ this.getMailTemplateByIdForTenantById = function (tenant_id, mail_template_id, options) {
1119
+ if (options === void 0) { options = {}; }
1120
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/mail/templates/").concat(mail_template_id), __assign({ method: "get" }, options));
1121
+ };
1122
+ this.updateMailTemplateByIdForTenantById = function (tenant_id, mail_template_id, body, options) {
1123
+ if (options === void 0) { options = {}; }
1124
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/mail/templates/").concat(mail_template_id), __assign({ method: "put", body: JSON.stringify(body), headers: {
1125
+ "content-type": "application/json",
1126
+ } }, options));
1127
+ };
1128
+ this.deleteMailTemplateByIdForTenantById = function (tenant_id, mail_template_id, options) {
1129
+ if (options === void 0) { options = {}; }
1130
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/mail/templates/").concat(mail_template_id), __assign({ method: "delete" }, options));
1131
+ };
1132
+ this.createVersionForMailTemplateByIdForTenantById = function (tenant_id, mail_template_id, body, options) {
1133
+ if (options === void 0) { options = {}; }
1134
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/mail/templates/").concat(mail_template_id, "/versions"), __assign({ method: "post", body: JSON.stringify(body), headers: {
1135
+ "content-type": "application/json",
1136
+ } }, options));
1137
+ };
1138
+ this.getMailTemplateVersionForTenantById = function (tenant_id, mail_template_id, mail_template_version_id, options) {
1139
+ if (options === void 0) { options = {}; }
1140
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/mail/templates/").concat(mail_template_id, "/versions/").concat(mail_template_version_id), __assign({ method: "get" }, options));
1141
+ };
1142
+ this.updateMailTemplateVersionForTenantById = function (tenant_id, mail_template_id, mail_template_version_id, body, options) {
1143
+ if (options === void 0) { options = {}; }
1144
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/mail/templates/").concat(mail_template_id, "/versions/").concat(mail_template_version_id), __assign({ method: "put", body: JSON.stringify(body), headers: {
1145
+ "content-type": "application/json",
1146
+ } }, options));
1147
+ };
1148
+ this.deleteMailTemplateVersionForTenantById = function (tenant_id, mail_template_id, mail_template_version_id, options) {
1149
+ if (options === void 0) { options = {}; }
1150
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/mail/templates/").concat(mail_template_id, "/versions/").concat(mail_template_version_id), __assign({ method: "delete" }, options));
1151
+ };
1152
+ this.publishMailTemplateVersionForTenantById = function (tenant_id, mail_template_id, mail_template_version_id, body, options) {
1153
+ if (options === void 0) { options = {}; }
1154
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/mail/templates/").concat(mail_template_id, "/versions/").concat(mail_template_version_id, "/publish"), __assign({ method: "post", body: JSON.stringify(body), headers: {
1155
+ "content-type": "application/json",
1156
+ } }, options));
1157
+ };
1097
1158
  this.createPolicyDocumentForTenantById = function (tenant_id, body, options) {
1098
1159
  if (options === void 0) { options = {}; }
1099
1160
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/policy-documents"), __assign({ method: "post", body: JSON.stringify(body), headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.3.172",
3
+ "version": "0.3.174",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",