@wenlarge/communication 1.3.6 → 1.3.8

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.
@@ -0,0 +1,139 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v1.181.2
4
+ // protoc v7.34.0
5
+ // source: billing.proto
6
+
7
+ /* eslint-disable */
8
+ import { Metadata } from "@grpc/grpc-js";
9
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
10
+ import { Observable } from "rxjs";
11
+ import { Empty } from "./google/protobuf/empty";
12
+
13
+ export const protobufPackage = "billing";
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
+ export interface GetBillingStatusResponse {
30
+ totalAllowance: number;
31
+ used: number;
32
+ remaining: number;
33
+ data: GrantInfo[];
34
+ }
35
+
36
+ export interface GrantInfo {
37
+ grantId: string;
38
+ grantType: string;
39
+ status: string;
40
+ nodeAllowance: number;
41
+ used: number;
42
+ validFrom: string;
43
+ validUntil: string;
44
+ }
45
+
46
+ export interface FindManyPlanResponse {
47
+ data: PlanInfo[];
48
+ }
49
+
50
+ export interface PlanInfo {
51
+ slug: string;
52
+ name: string;
53
+ includedNodeUnits: number;
54
+ billingInterval: string;
55
+ priceCents: number;
56
+ stripePriceId: string;
57
+ }
58
+
59
+ export interface CreateCheckoutSessionRequest {
60
+ companyId: string;
61
+ planSlug: string;
62
+ successUrl: string;
63
+ cancelUrl: string;
64
+ }
65
+
66
+ export interface CreateCheckoutSessionResponse {
67
+ checkoutUrl: string;
68
+ }
69
+
70
+ export interface CancelGrantRequest {
71
+ grantId: string;
72
+ companyId: string;
73
+ }
74
+
75
+ export const BILLING_PACKAGE_NAME = "billing";
76
+
77
+ export interface BillingServiceClient {
78
+ assignWelcomeGrant(request: AssignWelcomeGrantRequest, metadata?: Metadata): Observable<Empty>;
79
+
80
+ checkQuota(request: CheckQuotaRequest, metadata?: Metadata): Observable<Empty>;
81
+
82
+ getBillingStatus(request: GetBillingStatusRequest, metadata?: Metadata): Observable<GetBillingStatusResponse>;
83
+
84
+ findManyPlan(request: Empty, metadata?: Metadata): Observable<FindManyPlanResponse>;
85
+
86
+ createCheckoutSession(
87
+ request: CreateCheckoutSessionRequest,
88
+ metadata?: Metadata,
89
+ ): Observable<CreateCheckoutSessionResponse>;
90
+
91
+ cancelGrant(request: CancelGrantRequest, metadata?: Metadata): Observable<Empty>;
92
+ }
93
+
94
+ export interface BillingServiceController {
95
+ assignWelcomeGrant(request: AssignWelcomeGrantRequest, metadata?: Metadata): void;
96
+
97
+ checkQuota(request: CheckQuotaRequest, metadata?: Metadata): void;
98
+
99
+ getBillingStatus(
100
+ request: GetBillingStatusRequest,
101
+ metadata?: Metadata,
102
+ ): Promise<GetBillingStatusResponse> | Observable<GetBillingStatusResponse> | GetBillingStatusResponse;
103
+
104
+ findManyPlan(
105
+ request: Empty,
106
+ metadata?: Metadata,
107
+ ): Promise<FindManyPlanResponse> | Observable<FindManyPlanResponse> | FindManyPlanResponse;
108
+
109
+ createCheckoutSession(
110
+ request: CreateCheckoutSessionRequest,
111
+ metadata?: Metadata,
112
+ ): Promise<CreateCheckoutSessionResponse> | Observable<CreateCheckoutSessionResponse> | CreateCheckoutSessionResponse;
113
+
114
+ cancelGrant(request: CancelGrantRequest, metadata?: Metadata): void;
115
+ }
116
+
117
+ export function BillingServiceControllerMethods() {
118
+ return function (constructor: Function) {
119
+ const grpcMethods: string[] = [
120
+ "assignWelcomeGrant",
121
+ "checkQuota",
122
+ "getBillingStatus",
123
+ "findManyPlan",
124
+ "createCheckoutSession",
125
+ "cancelGrant",
126
+ ];
127
+ for (const method of grpcMethods) {
128
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
129
+ GrpcMethod("BillingService", method)(constructor.prototype[method], method, descriptor);
130
+ }
131
+ const grpcStreamMethods: string[] = [];
132
+ for (const method of grpcStreamMethods) {
133
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
134
+ GrpcStreamMethod("BillingService", method)(constructor.prototype[method], method, descriptor);
135
+ }
136
+ };
137
+ }
138
+
139
+ export const BILLING_SERVICE_NAME = "BillingService";
@@ -1,16 +1,16 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v1.181.2
4
- // protoc v6.33.1
5
- // source: common.proto
6
-
7
- /* eslint-disable */
8
-
9
- export const protobufPackage = "common";
10
-
11
- export interface PaginateRequest {
12
- skip: number;
13
- take: number;
14
- }
15
-
16
- export const COMMON_PACKAGE_NAME = "common";
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v1.181.2
4
+ // protoc v6.33.1
5
+ // source: common.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ export const protobufPackage = "common";
10
+
11
+ export interface PaginateRequest {
12
+ skip: number;
13
+ take: number;
14
+ }
15
+
16
+ export const COMMON_PACKAGE_NAME = "common";