@parra/parra-js-sdk 0.2.91 → 0.2.92

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.
@@ -296,6 +296,34 @@ export interface AppAreaCollectionResponse {
296
296
  data: Array<AppArea>;
297
297
  }
298
298
  export declare type AppAreaListResponse = Array<AppArea>;
299
+ export interface UpdateCampaignRequestBody {
300
+ name: string;
301
+ description?: string | null;
302
+ }
303
+ export interface CreateCampaignRequestBody {
304
+ name: string;
305
+ description?: string | null;
306
+ }
307
+ export interface Campaign {
308
+ id: string;
309
+ created_at: string;
310
+ updated_at: string;
311
+ deleted_at?: string | null;
312
+ tenant_id: string;
313
+ name: string;
314
+ description?: string | null;
315
+ published_at?: string | null;
316
+ start_at?: string | null;
317
+ end_at?: string | null;
318
+ }
319
+ export interface CampaignCollectionResponse {
320
+ page: number;
321
+ page_count: number;
322
+ page_size: number;
323
+ total_count: number;
324
+ data: Array<Campaign>;
325
+ }
326
+ export declare type CampaignListResponse = Array<Campaign>;
299
327
  export interface FormResponse {
300
328
  }
301
329
  export interface Form {
@@ -508,7 +536,7 @@ export interface ImageQuestionMetricsOption {
508
536
  export interface Event {
509
537
  name: string;
510
538
  created_at: string | null;
511
- event_properties?: Map<string, any> | null;
539
+ metadata?: Map<string, any> | null;
512
540
  }
513
541
  export interface Session {
514
542
  user_properties?: Map<string, any> | null;
@@ -690,6 +718,19 @@ declare class ParraAPI {
690
718
  getAppAreaById: (tenant_id: string, app_area_id: string) => Promise<AppArea>;
691
719
  updateAppAreaById: (tenant_id: string, app_area_id: string, body?: UpdateAppAreaRequestBody | undefined) => Promise<AppArea>;
692
720
  deleteAppAreaById: (tenant_id: string, app_area_id: string) => Promise<Response>;
721
+ createCampaign: (tenant_id: string, body?: CreateCampaignRequestBody | undefined) => Promise<Campaign>;
722
+ paginateCampaignsForTenantById: (tenant_id: string, query?: {
723
+ $select?: string | undefined;
724
+ $top?: number | undefined;
725
+ $skip?: number | undefined;
726
+ $orderby?: string | undefined;
727
+ $filter?: string | undefined;
728
+ $expand?: string | undefined;
729
+ $search?: string | undefined;
730
+ } | undefined) => Promise<CampaignListResponse>;
731
+ getCampaignById: (tenant_id: string, campaign_id: string) => Promise<Campaign>;
732
+ updateCampaignById: (tenant_id: string, campaign_id: string, body?: UpdateCampaignRequestBody | undefined) => Promise<Campaign>;
733
+ deleteCampaignById: (tenant_id: string, campaign_id: string) => Promise<Response>;
693
734
  getCards: (query?: {
694
735
  app_area_id?: string | undefined;
695
736
  } | undefined) => Promise<CardsResponse>;
package/dist/ParraAPI.js CHANGED
@@ -245,6 +245,40 @@ var ParraAPI = /** @class */ (function () {
245
245
  method: "delete",
246
246
  });
247
247
  };
248
+ this.createCampaign = function (tenant_id, body) {
249
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns"), {
250
+ method: "post",
251
+ body: JSON.stringify(body),
252
+ headers: {
253
+ "content-type": "application/json",
254
+ },
255
+ });
256
+ };
257
+ this.paginateCampaignsForTenantById = function (tenant_id, query) {
258
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns"), {
259
+ method: "get",
260
+ query: query,
261
+ });
262
+ };
263
+ this.getCampaignById = function (tenant_id, campaign_id) {
264
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id), {
265
+ method: "get",
266
+ });
267
+ };
268
+ this.updateCampaignById = function (tenant_id, campaign_id, body) {
269
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id), {
270
+ method: "put",
271
+ body: JSON.stringify(body),
272
+ headers: {
273
+ "content-type": "application/json",
274
+ },
275
+ });
276
+ };
277
+ this.deleteCampaignById = function (tenant_id, campaign_id) {
278
+ return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/campaigns/").concat(campaign_id), {
279
+ method: "delete",
280
+ });
281
+ };
248
282
  this.getCards = function (query) {
249
283
  return _this.http.execute("".concat(_this.options.baseUrl, "/v1/cards"), {
250
284
  method: "get",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parra/parra-js-sdk",
3
- "version": "0.2.91",
3
+ "version": "0.2.92",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",