@pushwoosh/rpc-v2-http-api-data 0.2.246 → 0.2.247

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/approvals.d.ts ADDED
@@ -0,0 +1,80 @@
1
+ import { RpcMethod } from './commonTypes';
2
+ export type ApprovalsService_Submit = RpcMethod<SubmitApprovalRequest, SubmitApprovalResponse>;
3
+ export type ApprovalsService_Approve = RpcMethod<ApproveRequest, ApproveResponse>;
4
+ export type ApprovalsService_Reject = RpcMethod<RejectRequest, RejectResponse>;
5
+ export type ApprovalsService_Cancel = RpcMethod<CancelApprovalRequest, CancelApprovalResponse>;
6
+ export type ApprovalsService_List = RpcMethod<ListApprovalsRequest, ListApprovalsResponse>;
7
+ export interface ApprovalsService {
8
+ /** Sends one content version of a push preset or email template for approval. The author submits, someone holding the ApproveMessages right decides; while the request is pending the version cannot be sent. */
9
+ Submit: ApprovalsService_Submit;
10
+ /** Approves a pending request, which makes exactly that content version sendable. Refused for the user who submitted it. */
11
+ Approve: ApprovalsService_Approve;
12
+ /** Rejects a pending request with a comment; the content stays unapproved and the author has to submit a new version. */
13
+ Reject: ApprovalsService_Reject;
14
+ /** Withdraws a pending request the caller submitted. */
15
+ Cancel: ApprovalsService_Cancel;
16
+ /** Lists approval requests of the account, newest first, optionally narrowed to one state or one content item. This is the approver inbox. */
17
+ List: ApprovalsService_List;
18
+ }
19
+ export type ApprovalState = 'APPROVAL_STATE_UNSPECIFIED' | 'APPROVAL_STATE_PENDING' | 'APPROVAL_STATE_APPROVED' | 'APPROVAL_STATE_REJECTED' | 'APPROVAL_STATE_CANCELLED';
20
+ export type ContentOwnerType = 'CONTENT_OWNER_TYPE_UNSPECIFIED' | 'CONTENT_OWNER_TYPE_PUSH_PRESET' | 'CONTENT_OWNER_TYPE_EMAIL_TEMPLATE';
21
+ export type ApprovalRequest = {
22
+ id: number;
23
+ application: string;
24
+ ownerType: ContentOwnerType;
25
+ /** Code of the content item the version belongs to. */
26
+ ownerCode: string;
27
+ contentVersionId: number;
28
+ /** Sequential number of that version within the content item. */
29
+ versionNo: number;
30
+ state: ApprovalState;
31
+ requestedBy: number;
32
+ decidedBy: number;
33
+ decidedAt: Date;
34
+ comment: string;
35
+ created: Date;
36
+ };
37
+ export type SubmitApprovalRequest = {
38
+ ownerType?: ContentOwnerType;
39
+ /** Code of the push preset or email template to send for approval. */
40
+ ownerCode?: string;
41
+ };
42
+ export type SubmitApprovalResponse = {
43
+ approval: ApprovalRequest;
44
+ };
45
+ export type ApproveRequest = {
46
+ id?: number;
47
+ /** Optional note for the author. */
48
+ comment?: string;
49
+ };
50
+ export type ApproveResponse = {
51
+ approval: ApprovalRequest;
52
+ };
53
+ export type RejectRequest = {
54
+ id?: number;
55
+ /** Why it was rejected; shown to the author. */
56
+ comment?: string;
57
+ };
58
+ export type RejectResponse = {
59
+ approval: ApprovalRequest;
60
+ };
61
+ export type CancelApprovalRequest = {
62
+ id?: number;
63
+ };
64
+ export type CancelApprovalResponse = {};
65
+ export type ListApprovalsRequest = {
66
+ /** Application code to narrow the list to; omit for the whole account. */
67
+ application?: string;
68
+ /** Keeps only requests in this state; omit for all states. */
69
+ state?: ApprovalState;
70
+ /** Keeps only requests for this content item. */
71
+ ownerCode?: string;
72
+ page?: number;
73
+ perPage?: number;
74
+ };
75
+ export type ListApprovalsResponse = {
76
+ approvals: ApprovalRequest[];
77
+ page: number;
78
+ perPage: number;
79
+ total: number;
80
+ };
package/approvals.js ADDED
@@ -0,0 +1,3 @@
1
+ /* eslint-disable */
2
+ /* Autogenerated code */
3
+ export {};
package/data.js CHANGED
@@ -7508,6 +7508,208 @@ export const data = {
7508
7508
  }
7509
7509
  }
7510
7510
  },
7511
+ "pushwoosh.rpc_v2.approvals.ApprovalsService": {
7512
+ "type": "S",
7513
+ "key": "approvals",
7514
+ "methods": {
7515
+ "Submit": {
7516
+ "request": "pushwoosh.rpc_v2.approvals.SubmitApprovalRequest",
7517
+ "response": "pushwoosh.rpc_v2.approvals.SubmitApprovalResponse",
7518
+ "method": "post",
7519
+ "path": "/api/approvals"
7520
+ },
7521
+ "Approve": {
7522
+ "request": "pushwoosh.rpc_v2.approvals.ApproveRequest",
7523
+ "response": "pushwoosh.rpc_v2.approvals.ApproveResponse",
7524
+ "method": "post",
7525
+ "path": "/api/approvals/{id}/approve"
7526
+ },
7527
+ "Reject": {
7528
+ "request": "pushwoosh.rpc_v2.approvals.RejectRequest",
7529
+ "response": "pushwoosh.rpc_v2.approvals.RejectResponse",
7530
+ "method": "post",
7531
+ "path": "/api/approvals/{id}/reject"
7532
+ },
7533
+ "Cancel": {
7534
+ "request": "pushwoosh.rpc_v2.approvals.CancelApprovalRequest",
7535
+ "response": "pushwoosh.rpc_v2.approvals.CancelApprovalResponse",
7536
+ "method": "post",
7537
+ "path": "/api/approvals/{id}/cancel"
7538
+ },
7539
+ "List": {
7540
+ "request": "pushwoosh.rpc_v2.approvals.ListApprovalsRequest",
7541
+ "response": "pushwoosh.rpc_v2.approvals.ListApprovalsResponse",
7542
+ "method": "get",
7543
+ "path": "/api/approvals"
7544
+ }
7545
+ }
7546
+ },
7547
+ "pushwoosh.rpc_v2.approvals.ApprovalState": {
7548
+ "type": "E",
7549
+ "values": [
7550
+ "APPROVAL_STATE_UNSPECIFIED",
7551
+ "APPROVAL_STATE_PENDING",
7552
+ "APPROVAL_STATE_APPROVED",
7553
+ "APPROVAL_STATE_REJECTED",
7554
+ "APPROVAL_STATE_CANCELLED"
7555
+ ]
7556
+ },
7557
+ "pushwoosh.rpc_v2.approvals.ContentOwnerType": {
7558
+ "type": "E",
7559
+ "values": [
7560
+ "CONTENT_OWNER_TYPE_UNSPECIFIED",
7561
+ "CONTENT_OWNER_TYPE_PUSH_PRESET",
7562
+ "CONTENT_OWNER_TYPE_EMAIL_TEMPLATE"
7563
+ ]
7564
+ },
7565
+ "pushwoosh.rpc_v2.approvals.ApprovalRequest": {
7566
+ "type": "I",
7567
+ "fields": {
7568
+ "id": {
7569
+ "type": "number"
7570
+ },
7571
+ "application": {
7572
+ "type": "string"
7573
+ },
7574
+ "ownerType": {
7575
+ "type": "pushwoosh.rpc_v2.approvals.ContentOwnerType"
7576
+ },
7577
+ "ownerCode": {
7578
+ "type": "string"
7579
+ },
7580
+ "contentVersionId": {
7581
+ "type": "number"
7582
+ },
7583
+ "versionNo": {
7584
+ "type": "number"
7585
+ },
7586
+ "state": {
7587
+ "type": "pushwoosh.rpc_v2.approvals.ApprovalState"
7588
+ },
7589
+ "requestedBy": {
7590
+ "type": "number"
7591
+ },
7592
+ "decidedBy": {
7593
+ "type": "number"
7594
+ },
7595
+ "decidedAt": {
7596
+ "type": "Date"
7597
+ },
7598
+ "comment": {
7599
+ "type": "string"
7600
+ },
7601
+ "created": {
7602
+ "type": "Date"
7603
+ }
7604
+ }
7605
+ },
7606
+ "pushwoosh.rpc_v2.approvals.SubmitApprovalRequest": {
7607
+ "type": "I",
7608
+ "fields": {
7609
+ "ownerType": {
7610
+ "type": "pushwoosh.rpc_v2.approvals.ContentOwnerType"
7611
+ },
7612
+ "ownerCode": {
7613
+ "type": "string"
7614
+ }
7615
+ }
7616
+ },
7617
+ "pushwoosh.rpc_v2.approvals.SubmitApprovalResponse": {
7618
+ "type": "I",
7619
+ "fields": {
7620
+ "approval": {
7621
+ "type": "pushwoosh.rpc_v2.approvals.ApprovalRequest"
7622
+ }
7623
+ }
7624
+ },
7625
+ "pushwoosh.rpc_v2.approvals.ApproveRequest": {
7626
+ "type": "I",
7627
+ "fields": {
7628
+ "id": {
7629
+ "type": "number"
7630
+ },
7631
+ "comment": {
7632
+ "type": "string"
7633
+ }
7634
+ }
7635
+ },
7636
+ "pushwoosh.rpc_v2.approvals.ApproveResponse": {
7637
+ "type": "I",
7638
+ "fields": {
7639
+ "approval": {
7640
+ "type": "pushwoosh.rpc_v2.approvals.ApprovalRequest"
7641
+ }
7642
+ }
7643
+ },
7644
+ "pushwoosh.rpc_v2.approvals.RejectRequest": {
7645
+ "type": "I",
7646
+ "fields": {
7647
+ "id": {
7648
+ "type": "number"
7649
+ },
7650
+ "comment": {
7651
+ "type": "string"
7652
+ }
7653
+ }
7654
+ },
7655
+ "pushwoosh.rpc_v2.approvals.RejectResponse": {
7656
+ "type": "I",
7657
+ "fields": {
7658
+ "approval": {
7659
+ "type": "pushwoosh.rpc_v2.approvals.ApprovalRequest"
7660
+ }
7661
+ }
7662
+ },
7663
+ "pushwoosh.rpc_v2.approvals.CancelApprovalRequest": {
7664
+ "type": "I",
7665
+ "fields": {
7666
+ "id": {
7667
+ "type": "number"
7668
+ }
7669
+ }
7670
+ },
7671
+ "pushwoosh.rpc_v2.approvals.CancelApprovalResponse": {
7672
+ "type": "I",
7673
+ "fields": {}
7674
+ },
7675
+ "pushwoosh.rpc_v2.approvals.ListApprovalsRequest": {
7676
+ "type": "I",
7677
+ "fields": {
7678
+ "application": {
7679
+ "type": "string"
7680
+ },
7681
+ "state": {
7682
+ "type": "pushwoosh.rpc_v2.approvals.ApprovalState"
7683
+ },
7684
+ "ownerCode": {
7685
+ "type": "string"
7686
+ },
7687
+ "page": {
7688
+ "type": "number"
7689
+ },
7690
+ "perPage": {
7691
+ "type": "number"
7692
+ }
7693
+ }
7694
+ },
7695
+ "pushwoosh.rpc_v2.approvals.ListApprovalsResponse": {
7696
+ "type": "I",
7697
+ "fields": {
7698
+ "approvals": {
7699
+ "type": "pushwoosh.rpc_v2.approvals.ApprovalRequest",
7700
+ "array": true
7701
+ },
7702
+ "page": {
7703
+ "type": "number"
7704
+ },
7705
+ "perPage": {
7706
+ "type": "number"
7707
+ },
7708
+ "total": {
7709
+ "type": "number"
7710
+ }
7711
+ }
7712
+ },
7511
7713
  "pushwoosh.rpc_v2.campaigns.CampaignsService": {
7512
7714
  "type": "S",
7513
7715
  "key": "campaigns",
package/index.d.ts CHANGED
@@ -16,6 +16,7 @@ import { ApplicationsControlGroupService as pushwoosh_rpc_v2_applications_contro
16
16
  import { ApplicationsGroupsService as pushwoosh_rpc_v2_applications_groups_ApplicationsGroupsService } from './applications_groups';
17
17
  import { ApplicationsInfoService as pushwoosh_rpc_v2_applications_info_ApplicationsInfoService } from './applications_info';
18
18
  import { ApplicationsStatisticsService as pushwoosh_rpc_v2_applications_statistics_ApplicationsStatisticsService } from './applications_statistics';
19
+ import { ApprovalsService as pushwoosh_rpc_v2_approvals_ApprovalsService } from './approvals';
19
20
  import { CampaignsService as pushwoosh_rpc_v2_campaigns_CampaignsService } from './campaigns';
20
21
  import { CatalogService as pushwoosh_rpc_v2_catalog_CatalogService } from './catalog';
21
22
  import { CategoriesService as pushwoosh_rpc_v2_categories_CategoriesService } from './categories';
@@ -87,6 +88,7 @@ export type API = {
87
88
  applicationsGroups: pushwoosh_rpc_v2_applications_groups_ApplicationsGroupsService;
88
89
  applicationsInfo: pushwoosh_rpc_v2_applications_info_ApplicationsInfoService;
89
90
  applicationsStatistics: pushwoosh_rpc_v2_applications_statistics_ApplicationsStatisticsService;
91
+ approvals: pushwoosh_rpc_v2_approvals_ApprovalsService;
90
92
  campaigns: pushwoosh_rpc_v2_campaigns_CampaignsService;
91
93
  catalog: pushwoosh_rpc_v2_catalog_CatalogService;
92
94
  categories: pushwoosh_rpc_v2_categories_CategoriesService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-v2-http-api-data",
3
- "version": "0.2.246",
3
+ "version": "0.2.247",
4
4
  "description": "RPC V2 HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",