@parra/parra-js-sdk 0.3.172 → 0.3.173

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,95 @@ 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 MailTemplateVersion {
2379
+ id: string;
2380
+ created_at: string;
2381
+ updated_at: string;
2382
+ deleted_at?: string | null;
2383
+ tenant_id: string;
2384
+ status: MailTemplateVersionStatus;
2385
+ version: string;
2386
+ title: string | null;
2387
+ description?: string | null;
2388
+ slug?: string | null;
2389
+ mail_template_id: string;
2390
+ text_content?: string | null;
2391
+ json_content?: string | null;
2392
+ html_content?: string | null;
2393
+ }
2394
+ export interface UpdateMailTemplateVersionRequestBody {
2395
+ title?: string | null;
2396
+ version?: string | null;
2397
+ text_content?: string | null;
2398
+ json_content?: string | null;
2399
+ html_content?: string | null;
2400
+ }
2312
2401
  export interface UpdatePolicyDocumentRequestBody {
2313
2402
  title?: string | null;
2314
2403
  url?: string | null;
@@ -2739,6 +2828,22 @@ declare class ParraAPI {
2739
2828
  getMailSenderByIdForTenantById: (tenant_id: string, mail_sender_id: string, options?: Options) => Promise<MailSender>;
2740
2829
  updateMailSenderByIdForTenantById: (tenant_id: string, mail_sender_id: string, body?: UpdateMailSenderRequestBody, options?: Options) => Promise<MailSender>;
2741
2830
  deleteMailSenderByIdForTenantById: (tenant_id: string, mail_sender_id: string, options?: Options) => Promise<Response>;
2831
+ createMailTemplateForTenantById: (tenant_id: string, body: CreateMailTemplateRequestBody, options?: Options) => Promise<MailTemplate>;
2832
+ paginateMailTemplatesForTenantById: (tenant_id: string, query?: {
2833
+ $select?: string;
2834
+ $top?: number;
2835
+ $skip?: number;
2836
+ $orderby?: string;
2837
+ $filter?: string;
2838
+ $expand?: string;
2839
+ $search?: string;
2840
+ }, options?: Options) => Promise<MailTemplateCollectionResponse>;
2841
+ getMailTemplateByIdForTenantById: (tenant_id: string, mail_template_id: string, options?: Options) => Promise<MailTemplate>;
2842
+ updateMailTemplateByIdForTenantById: (tenant_id: string, mail_template_id: string, body?: UpdateMailTemplateRequestBody, options?: Options) => Promise<MailTemplate>;
2843
+ deleteMailTemplateByIdForTenantById: (tenant_id: string, mail_template_id: string, options?: Options) => Promise<Response>;
2844
+ getMailTemplateVersionForTenantById: (tenant_id: string, mail_template_id: string, mail_template_version_id: string, options?: Options) => Promise<MailTemplateVersion>;
2845
+ updateMailTemplateVersionForTenantById: (tenant_id: string, mail_template_id: string, mail_template_version_id: string, body?: UpdateMailTemplateVersionRequestBody, options?: Options) => Promise<MailTemplateVersion>;
2846
+ publishMailTemplateVersionForTenantById: (tenant_id: string, mail_template_id: string, mail_template_version_id: string, body?: UpdateMailTemplateVersionRequestBody, options?: Options) => Promise<MailTemplateVersion>;
2742
2847
  createPolicyDocumentForTenantById: (tenant_id: string, body: CreatePolicyDocumentRequestBody, options?: Options) => Promise<PolicyDocument>;
2743
2848
  paginatePolicyDocumentsForTenantById: (tenant_id: string, query?: {
2744
2849
  $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,46 @@ 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.getMailTemplateVersionForTenantById = function (tenant_id, mail_template_id, mail_template_version_id, 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/").concat(mail_template_version_id), __assign({ method: "get" }, options));
1135
+ };
1136
+ this.updateMailTemplateVersionForTenantById = function (tenant_id, mail_template_id, mail_template_version_id, body, options) {
1137
+ if (options === void 0) { options = {}; }
1138
+ 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: {
1139
+ "content-type": "application/json",
1140
+ } }, options));
1141
+ };
1142
+ this.publishMailTemplateVersionForTenantById = 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, "/publish"), __assign({ method: "post", body: JSON.stringify(body), headers: {
1145
+ "content-type": "application/json",
1146
+ } }, options));
1147
+ };
1097
1148
  this.createPolicyDocumentForTenantById = function (tenant_id, body, options) {
1098
1149
  if (options === void 0) { options = {}; }
1099
1150
  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.173",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",