@wenlarge/communication 1.4.1 → 1.4.3

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.
@@ -2,17 +2,6 @@ import { Metadata } from "@grpc/grpc-js";
2
2
  import { Observable } from "rxjs";
3
3
  import { Empty } from "./google/protobuf/empty";
4
4
  export declare const protobufPackage = "billing";
5
- export interface AssignWelcomeGrantRequest {
6
- companyId: string;
7
- }
8
- export interface CheckQuotaRequest {
9
- companyId: string;
10
- workflowId: string;
11
- nodeId: string;
12
- }
13
- export interface GetBillingStatusRequest {
14
- companyId: string;
15
- }
16
5
  export interface GetBillingStatusResponse {
17
6
  totalAllowance: number;
18
7
  used: number;
@@ -40,7 +29,6 @@ export interface PlanInfo {
40
29
  stripePriceId: string;
41
30
  }
42
31
  export interface CreateCheckoutSessionRequest {
43
- companyId: string;
44
32
  planSlug: string;
45
33
  successUrl: string;
46
34
  cancelUrl: string;
@@ -50,24 +38,42 @@ export interface CreateCheckoutSessionResponse {
50
38
  }
51
39
  export interface CancelGrantRequest {
52
40
  grantId: string;
53
- companyId: string;
41
+ }
42
+ export interface FindManyEntitlementGrantRequest {
43
+ skip: number;
44
+ take: number;
45
+ }
46
+ export interface FindManyEntitlementGrantResponse {
47
+ data: EntitlementGrantInfo[];
48
+ total: number;
49
+ }
50
+ export interface EntitlementGrantInfo {
51
+ grantId: string;
52
+ grantType: string;
53
+ status: string;
54
+ nodeAllowance: number;
55
+ used: number;
56
+ validFrom: string;
57
+ validUntil: string;
54
58
  }
55
59
  export declare const BILLING_PACKAGE_NAME = "billing";
56
60
  export interface BillingServiceClient {
57
- assignWelcomeGrant(request: AssignWelcomeGrantRequest, metadata?: Metadata): Observable<Empty>;
58
- checkQuota(request: CheckQuotaRequest, metadata?: Metadata): Observable<Empty>;
59
- getBillingStatus(request: GetBillingStatusRequest, metadata?: Metadata): Observable<GetBillingStatusResponse>;
61
+ assignWelcomeGrant(request: Empty, metadata?: Metadata): Observable<Empty>;
62
+ checkQuota(request: Empty, metadata?: Metadata): Observable<Empty>;
63
+ getBillingStatus(request: Empty, metadata?: Metadata): Observable<GetBillingStatusResponse>;
60
64
  findManyPlan(request: Empty, metadata?: Metadata): Observable<FindManyPlanResponse>;
61
65
  createCheckoutSession(request: CreateCheckoutSessionRequest, metadata?: Metadata): Observable<CreateCheckoutSessionResponse>;
62
66
  cancelGrant(request: CancelGrantRequest, metadata?: Metadata): Observable<Empty>;
67
+ findManyEntitlementGrant(request: FindManyEntitlementGrantRequest, metadata?: Metadata): Observable<FindManyEntitlementGrantResponse>;
63
68
  }
64
69
  export interface BillingServiceController {
65
- assignWelcomeGrant(request: AssignWelcomeGrantRequest, metadata?: Metadata): void;
66
- checkQuota(request: CheckQuotaRequest, metadata?: Metadata): void;
67
- getBillingStatus(request: GetBillingStatusRequest, metadata?: Metadata): Promise<GetBillingStatusResponse> | Observable<GetBillingStatusResponse> | GetBillingStatusResponse;
70
+ assignWelcomeGrant(request: Empty, metadata?: Metadata): void;
71
+ checkQuota(request: Empty, metadata?: Metadata): void;
72
+ getBillingStatus(request: Empty, metadata?: Metadata): Promise<GetBillingStatusResponse> | Observable<GetBillingStatusResponse> | GetBillingStatusResponse;
68
73
  findManyPlan(request: Empty, metadata?: Metadata): Promise<FindManyPlanResponse> | Observable<FindManyPlanResponse> | FindManyPlanResponse;
69
74
  createCheckoutSession(request: CreateCheckoutSessionRequest, metadata?: Metadata): Promise<CreateCheckoutSessionResponse> | Observable<CreateCheckoutSessionResponse> | CreateCheckoutSessionResponse;
70
75
  cancelGrant(request: CancelGrantRequest, metadata?: Metadata): void;
76
+ findManyEntitlementGrant(request: FindManyEntitlementGrantRequest, metadata?: Metadata): Promise<FindManyEntitlementGrantResponse> | Observable<FindManyEntitlementGrantResponse> | FindManyEntitlementGrantResponse;
71
77
  }
72
78
  export declare function BillingServiceControllerMethods(): (constructor: Function) => void;
73
79
  export declare const BILLING_SERVICE_NAME = "BillingService";
@@ -19,6 +19,7 @@ function BillingServiceControllerMethods() {
19
19
  "findManyPlan",
20
20
  "createCheckoutSession",
21
21
  "cancelGrant",
22
+ "findManyEntitlementGrant",
22
23
  ];
23
24
  for (const method of grpcMethods) {
24
25
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenlarge/communication",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "Shared gRPC proto interfaces and generated clients for Wenlarge microservices.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -4,26 +4,13 @@ import "google/protobuf/empty.proto";
4
4
  package billing;
5
5
 
6
6
  service BillingService {
7
- rpc AssignWelcomeGrant(AssignWelcomeGrantRequest) returns (google.protobuf.Empty);
8
- rpc CheckQuota(CheckQuotaRequest) returns (google.protobuf.Empty);
9
- rpc GetBillingStatus(GetBillingStatusRequest) returns (GetBillingStatusResponse);
7
+ rpc AssignWelcomeGrant(google.protobuf.Empty) returns (google.protobuf.Empty);
8
+ rpc CheckQuota(google.protobuf.Empty) returns (google.protobuf.Empty);
9
+ rpc GetBillingStatus(google.protobuf.Empty) returns (GetBillingStatusResponse);
10
10
  rpc FindManyPlan (google.protobuf.Empty) returns (FindManyPlanResponse);
11
11
  rpc CreateCheckoutSession(CreateCheckoutSessionRequest) returns (CreateCheckoutSessionResponse);
12
12
  rpc CancelGrant(CancelGrantRequest) returns (google.protobuf.Empty);
13
- }
14
-
15
- message AssignWelcomeGrantRequest {
16
- string companyId = 1;
17
- }
18
-
19
- message CheckQuotaRequest {
20
- string companyId = 1;
21
- string workflowId = 2;
22
- string nodeId = 3;
23
- }
24
-
25
- message GetBillingStatusRequest {
26
- string companyId = 1;
13
+ rpc FindManyEntitlementGrant(FindManyEntitlementGrantRequest) returns (FindManyEntitlementGrantResponse);
27
14
  }
28
15
 
29
16
  message GetBillingStatusResponse {
@@ -57,10 +44,9 @@ message PlanInfo {
57
44
  }
58
45
 
59
46
  message CreateCheckoutSessionRequest {
60
- string companyId = 1;
61
- string planSlug = 2;
62
- string successUrl = 3;
63
- string cancelUrl = 4;
47
+ string planSlug = 1;
48
+ string successUrl = 2;
49
+ string cancelUrl = 3;
64
50
  }
65
51
 
66
52
  message CreateCheckoutSessionResponse {
@@ -69,5 +55,24 @@ message CreateCheckoutSessionResponse {
69
55
 
70
56
  message CancelGrantRequest {
71
57
  string grantId = 1;
72
- string companyId = 2;
58
+ }
59
+
60
+ message FindManyEntitlementGrantRequest {
61
+ int32 skip = 1;
62
+ int32 take = 2;
63
+ }
64
+
65
+ message FindManyEntitlementGrantResponse {
66
+ repeated EntitlementGrantInfo data = 1;
67
+ int32 total = 2;
68
+ }
69
+
70
+ message EntitlementGrantInfo {
71
+ string grantId = 1;
72
+ string grantType = 2;
73
+ string status = 3;
74
+ int32 nodeAllowance = 4;
75
+ int32 used = 5;
76
+ string validFrom = 6;
77
+ string validUntil = 7;
73
78
  }
@@ -12,20 +12,6 @@ import { Empty } from "./google/protobuf/empty";
12
12
 
13
13
  export const protobufPackage = "billing";
14
14
 
15
- export interface AssignWelcomeGrantRequest {
16
- companyId: string;
17
- }
18
-
19
- export interface CheckQuotaRequest {
20
- companyId: string;
21
- workflowId: string;
22
- nodeId: string;
23
- }
24
-
25
- export interface GetBillingStatusRequest {
26
- companyId: string;
27
- }
28
-
29
15
  export interface GetBillingStatusResponse {
30
16
  totalAllowance: number;
31
17
  used: number;
@@ -57,7 +43,6 @@ export interface PlanInfo {
57
43
  }
58
44
 
59
45
  export interface CreateCheckoutSessionRequest {
60
- companyId: string;
61
46
  planSlug: string;
62
47
  successUrl: string;
63
48
  cancelUrl: string;
@@ -69,17 +54,36 @@ export interface CreateCheckoutSessionResponse {
69
54
 
70
55
  export interface CancelGrantRequest {
71
56
  grantId: string;
72
- companyId: string;
57
+ }
58
+
59
+ export interface FindManyEntitlementGrantRequest {
60
+ skip: number;
61
+ take: number;
62
+ }
63
+
64
+ export interface FindManyEntitlementGrantResponse {
65
+ data: EntitlementGrantInfo[];
66
+ total: number;
67
+ }
68
+
69
+ export interface EntitlementGrantInfo {
70
+ grantId: string;
71
+ grantType: string;
72
+ status: string;
73
+ nodeAllowance: number;
74
+ used: number;
75
+ validFrom: string;
76
+ validUntil: string;
73
77
  }
74
78
 
75
79
  export const BILLING_PACKAGE_NAME = "billing";
76
80
 
77
81
  export interface BillingServiceClient {
78
- assignWelcomeGrant(request: AssignWelcomeGrantRequest, metadata?: Metadata): Observable<Empty>;
82
+ assignWelcomeGrant(request: Empty, metadata?: Metadata): Observable<Empty>;
79
83
 
80
- checkQuota(request: CheckQuotaRequest, metadata?: Metadata): Observable<Empty>;
84
+ checkQuota(request: Empty, metadata?: Metadata): Observable<Empty>;
81
85
 
82
- getBillingStatus(request: GetBillingStatusRequest, metadata?: Metadata): Observable<GetBillingStatusResponse>;
86
+ getBillingStatus(request: Empty, metadata?: Metadata): Observable<GetBillingStatusResponse>;
83
87
 
84
88
  findManyPlan(request: Empty, metadata?: Metadata): Observable<FindManyPlanResponse>;
85
89
 
@@ -89,15 +93,20 @@ export interface BillingServiceClient {
89
93
  ): Observable<CreateCheckoutSessionResponse>;
90
94
 
91
95
  cancelGrant(request: CancelGrantRequest, metadata?: Metadata): Observable<Empty>;
96
+
97
+ findManyEntitlementGrant(
98
+ request: FindManyEntitlementGrantRequest,
99
+ metadata?: Metadata,
100
+ ): Observable<FindManyEntitlementGrantResponse>;
92
101
  }
93
102
 
94
103
  export interface BillingServiceController {
95
- assignWelcomeGrant(request: AssignWelcomeGrantRequest, metadata?: Metadata): void;
104
+ assignWelcomeGrant(request: Empty, metadata?: Metadata): void;
96
105
 
97
- checkQuota(request: CheckQuotaRequest, metadata?: Metadata): void;
106
+ checkQuota(request: Empty, metadata?: Metadata): void;
98
107
 
99
108
  getBillingStatus(
100
- request: GetBillingStatusRequest,
109
+ request: Empty,
101
110
  metadata?: Metadata,
102
111
  ): Promise<GetBillingStatusResponse> | Observable<GetBillingStatusResponse> | GetBillingStatusResponse;
103
112
 
@@ -112,6 +121,14 @@ export interface BillingServiceController {
112
121
  ): Promise<CreateCheckoutSessionResponse> | Observable<CreateCheckoutSessionResponse> | CreateCheckoutSessionResponse;
113
122
 
114
123
  cancelGrant(request: CancelGrantRequest, metadata?: Metadata): void;
124
+
125
+ findManyEntitlementGrant(
126
+ request: FindManyEntitlementGrantRequest,
127
+ metadata?: Metadata,
128
+ ):
129
+ | Promise<FindManyEntitlementGrantResponse>
130
+ | Observable<FindManyEntitlementGrantResponse>
131
+ | FindManyEntitlementGrantResponse;
115
132
  }
116
133
 
117
134
  export function BillingServiceControllerMethods() {
@@ -123,6 +140,7 @@ export function BillingServiceControllerMethods() {
123
140
  "findManyPlan",
124
141
  "createCheckoutSession",
125
142
  "cancelGrant",
143
+ "findManyEntitlementGrant",
126
144
  ];
127
145
  for (const method of grpcMethods) {
128
146
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);