@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.
- package/dist/generated/billing.d.ts +25 -19
- package/dist/generated/billing.js +1 -0
- package/package.json +1 -1
- package/proto/billing.proto +27 -22
- package/src/generated/billing.ts +40 -22
|
@@ -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
|
-
|
|
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:
|
|
58
|
-
checkQuota(request:
|
|
59
|
-
getBillingStatus(request:
|
|
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:
|
|
66
|
-
checkQuota(request:
|
|
67
|
-
getBillingStatus(request:
|
|
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
package/proto/billing.proto
CHANGED
|
@@ -4,26 +4,13 @@ import "google/protobuf/empty.proto";
|
|
|
4
4
|
package billing;
|
|
5
5
|
|
|
6
6
|
service BillingService {
|
|
7
|
-
rpc AssignWelcomeGrant(
|
|
8
|
-
rpc CheckQuota(
|
|
9
|
-
rpc GetBillingStatus(
|
|
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
|
|
61
|
-
string
|
|
62
|
-
string
|
|
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
|
-
|
|
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
|
}
|
package/src/generated/billing.ts
CHANGED
|
@@ -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
|
-
|
|
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:
|
|
82
|
+
assignWelcomeGrant(request: Empty, metadata?: Metadata): Observable<Empty>;
|
|
79
83
|
|
|
80
|
-
checkQuota(request:
|
|
84
|
+
checkQuota(request: Empty, metadata?: Metadata): Observable<Empty>;
|
|
81
85
|
|
|
82
|
-
getBillingStatus(request:
|
|
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:
|
|
104
|
+
assignWelcomeGrant(request: Empty, metadata?: Metadata): void;
|
|
96
105
|
|
|
97
|
-
checkQuota(request:
|
|
106
|
+
checkQuota(request: Empty, metadata?: Metadata): void;
|
|
98
107
|
|
|
99
108
|
getBillingStatus(
|
|
100
|
-
request:
|
|
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);
|