@wenlarge/ostrol-communication 0.5.0

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.
Files changed (53) hide show
  1. package/dist/config/astro-engine-config.d.ts +1 -0
  2. package/dist/config/astro-engine-config.js +4 -0
  3. package/dist/config/astrology-config.d.ts +1 -0
  4. package/dist/config/astrology-config.js +4 -0
  5. package/dist/config/auth-config.d.ts +1 -0
  6. package/dist/config/auth-config.js +4 -0
  7. package/dist/config/billing-config.d.ts +1 -0
  8. package/dist/config/billing-config.js +4 -0
  9. package/dist/generated/astro_engine.d.ts +93 -0
  10. package/dist/generated/astro_engine.js +30 -0
  11. package/dist/generated/astrology.d.ts +92 -0
  12. package/dist/generated/astrology.js +50 -0
  13. package/dist/generated/auth.d.ts +131 -0
  14. package/dist/generated/auth.js +53 -0
  15. package/dist/generated/billing.d.ts +62 -0
  16. package/dist/generated/billing.js +41 -0
  17. package/dist/generated/common.d.ts +17 -0
  18. package/dist/generated/common.js +18 -0
  19. package/dist/generated/google/protobuf/empty.d.ts +13 -0
  20. package/dist/generated/google/protobuf/empty.js +11 -0
  21. package/dist/generated/google/protobuf/struct.d.ts +82 -0
  22. package/dist/generated/google/protobuf/struct.js +117 -0
  23. package/dist/grpc-client/grpc-client.module.d.ts +10 -0
  24. package/dist/grpc-client/grpc-client.module.js +68 -0
  25. package/dist/grpc-client/index.d.ts +1 -0
  26. package/dist/grpc-client/index.js +17 -0
  27. package/dist/helpers/helper.d.ts +12 -0
  28. package/dist/helpers/helper.js +31 -0
  29. package/dist/helpers/struct-to-json.d.ts +3 -0
  30. package/dist/helpers/struct-to-json.js +46 -0
  31. package/dist/index.d.ts +18 -0
  32. package/dist/index.js +69 -0
  33. package/dist/kafka/commit-kafka-offset.d.ts +16 -0
  34. package/dist/kafka/commit-kafka-offset.js +14 -0
  35. package/dist/kafka/kafka-topics.d.ts +13 -0
  36. package/dist/kafka/kafka-topics.js +19 -0
  37. package/dist/kafka/payloads.d.ts +67 -0
  38. package/dist/kafka/payloads.js +3 -0
  39. package/dist/pagination/cursor.d.ts +17 -0
  40. package/dist/pagination/cursor.js +42 -0
  41. package/package.json +49 -0
  42. package/proto/astro_engine.proto +60 -0
  43. package/proto/astrology.proto +78 -0
  44. package/proto/auth.proto +123 -0
  45. package/proto/billing.proto +56 -0
  46. package/proto/common.proto +17 -0
  47. package/src/generated/astro_engine.ts +144 -0
  48. package/src/generated/astrology.ts +135 -0
  49. package/src/generated/auth.ts +215 -0
  50. package/src/generated/billing.ts +117 -0
  51. package/src/generated/common.ts +28 -0
  52. package/src/generated/google/protobuf/empty.ts +23 -0
  53. package/src/generated/google/protobuf/struct.ts +179 -0
@@ -0,0 +1 @@
1
+ export declare const ASTRO_ENGINE_PROTO_PATH: string[];
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ASTRO_ENGINE_PROTO_PATH = void 0;
4
+ exports.ASTRO_ENGINE_PROTO_PATH = ["proto/astro_engine.proto"];
@@ -0,0 +1 @@
1
+ export declare const ASTROLOGY_PROTO_PATH: string[];
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ASTROLOGY_PROTO_PATH = void 0;
4
+ exports.ASTROLOGY_PROTO_PATH = ["proto/astrology.proto"];
@@ -0,0 +1 @@
1
+ export declare const AUTH_PROTO_PATH: string[];
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AUTH_PROTO_PATH = void 0;
4
+ exports.AUTH_PROTO_PATH = ["proto/auth.proto"];
@@ -0,0 +1 @@
1
+ export declare const BILLING_PROTO_PATH: string[];
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BILLING_PROTO_PATH = void 0;
4
+ exports.BILLING_PROTO_PATH = ["proto/billing.proto"];
@@ -0,0 +1,93 @@
1
+ import { Metadata } from "@grpc/grpc-js";
2
+ import { Observable } from "rxjs";
3
+ export declare const protobufPackage = "astro_engine";
4
+ export interface ComputeNatalRequest {
5
+ /** ISO 8601 */
6
+ birthAt: string;
7
+ lat: number;
8
+ lng: number;
9
+ }
10
+ export interface ComputeNatalResponse {
11
+ /** full chart */
12
+ rawData?: {
13
+ [key: string]: any;
14
+ } | undefined;
15
+ /** points cached for transit checks */
16
+ natalPoints?: {
17
+ [key: string]: any;
18
+ } | undefined;
19
+ /** IANA zone resolved from lat/lng, e.g. "Europe/Istanbul" */
20
+ timezone: string;
21
+ }
22
+ export interface ComputeTransitsRequest {
23
+ /** cached natal points */
24
+ natalPoints?: {
25
+ [key: string]: any;
26
+ } | undefined;
27
+ /** ISO 8601 moment to compute the sky for */
28
+ at: string;
29
+ }
30
+ export interface ComputeTransitsResponse {
31
+ /** current positions */
32
+ transits?: {
33
+ [key: string]: any;
34
+ } | undefined;
35
+ /** aspects-to-natal within orb */
36
+ aspects?: {
37
+ [key: string]: any;
38
+ } | undefined;
39
+ }
40
+ /**
41
+ * Deterministic forecast: every exact transit aspect to the natal points across
42
+ * [fromAt, toAt]. Drives the precomputed transit_event schedule.
43
+ */
44
+ export interface ForecastTransitsRequest {
45
+ natalPoints?: {
46
+ [key: string]: any;
47
+ } | undefined;
48
+ /** ISO 8601 */
49
+ fromAt: string;
50
+ /** ISO 8601 */
51
+ toAt: string;
52
+ }
53
+ export interface TransitAspect {
54
+ /** e.g. "mars" */
55
+ transitingBody: string;
56
+ /** e.g. "sun" */
57
+ natalPoint: string;
58
+ /** e.g. "conjunction" */
59
+ aspect: string;
60
+ /** ISO 8601 — trigger time */
61
+ exactAt: string;
62
+ orb: number;
63
+ }
64
+ export interface ForecastTransitsResponse {
65
+ events: TransitAspect[];
66
+ }
67
+ export declare const ASTRO_ENGINE_PACKAGE_NAME = "astro_engine";
68
+ /**
69
+ * Implemented by the PYTHON astro-engine service (Kerykeion). Pure compute:
70
+ * no DB, no Kafka, stateless. Called only by the astrology service's workers.
71
+ * astro-engine generates its stubs from THIS file via grpc_tools.protoc; it does
72
+ * not install the npm package. Complex outputs are returned as Struct (JSON) to
73
+ * avoid pinning a rigid schema onto Kerykeion's output shape.
74
+ */
75
+ export interface AstroEngineServiceClient {
76
+ computeNatal(request: ComputeNatalRequest, metadata?: Metadata): Observable<ComputeNatalResponse>;
77
+ computeTransits(request: ComputeTransitsRequest, metadata?: Metadata): Observable<ComputeTransitsResponse>;
78
+ forecastTransits(request: ForecastTransitsRequest, metadata?: Metadata): Observable<ForecastTransitsResponse>;
79
+ }
80
+ /**
81
+ * Implemented by the PYTHON astro-engine service (Kerykeion). Pure compute:
82
+ * no DB, no Kafka, stateless. Called only by the astrology service's workers.
83
+ * astro-engine generates its stubs from THIS file via grpc_tools.protoc; it does
84
+ * not install the npm package. Complex outputs are returned as Struct (JSON) to
85
+ * avoid pinning a rigid schema onto Kerykeion's output shape.
86
+ */
87
+ export interface AstroEngineServiceController {
88
+ computeNatal(request: ComputeNatalRequest, metadata?: Metadata): Promise<ComputeNatalResponse> | Observable<ComputeNatalResponse> | ComputeNatalResponse;
89
+ computeTransits(request: ComputeTransitsRequest, metadata?: Metadata): Promise<ComputeTransitsResponse> | Observable<ComputeTransitsResponse> | ComputeTransitsResponse;
90
+ forecastTransits(request: ForecastTransitsRequest, metadata?: Metadata): Promise<ForecastTransitsResponse> | Observable<ForecastTransitsResponse> | ForecastTransitsResponse;
91
+ }
92
+ export declare function AstroEngineServiceControllerMethods(): (constructor: Function) => void;
93
+ export declare const ASTRO_ENGINE_SERVICE_NAME = "AstroEngineService";
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v1.181.2
5
+ // protoc v3.21.5
6
+ // source: astro_engine.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ASTRO_ENGINE_SERVICE_NAME = exports.ASTRO_ENGINE_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.AstroEngineServiceControllerMethods = AstroEngineServiceControllerMethods;
10
+ const microservices_1 = require("@nestjs/microservices");
11
+ const protobufjs_1 = require("protobufjs");
12
+ const struct_1 = require("./google/protobuf/struct");
13
+ exports.protobufPackage = "astro_engine";
14
+ exports.ASTRO_ENGINE_PACKAGE_NAME = "astro_engine";
15
+ protobufjs_1.wrappers[".google.protobuf.Struct"] = { fromObject: struct_1.Struct.wrap, toObject: struct_1.Struct.unwrap };
16
+ function AstroEngineServiceControllerMethods() {
17
+ return function (constructor) {
18
+ const grpcMethods = ["computeNatal", "computeTransits", "forecastTransits"];
19
+ for (const method of grpcMethods) {
20
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
21
+ (0, microservices_1.GrpcMethod)("AstroEngineService", method)(constructor.prototype[method], method, descriptor);
22
+ }
23
+ const grpcStreamMethods = [];
24
+ for (const method of grpcStreamMethods) {
25
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
26
+ (0, microservices_1.GrpcStreamMethod)("AstroEngineService", method)(constructor.prototype[method], method, descriptor);
27
+ }
28
+ };
29
+ }
30
+ exports.ASTRO_ENGINE_SERVICE_NAME = "AstroEngineService";
@@ -0,0 +1,92 @@
1
+ import { Metadata } from "@grpc/grpc-js";
2
+ import { Observable } from "rxjs";
3
+ import { CursorRequest, Plan } from "./common";
4
+ export declare const protobufPackage = "astrology";
5
+ export declare enum PostType {
6
+ POST_TYPE_UNSPECIFIED = "POST_TYPE_UNSPECIFIED",
7
+ /** GENERAL - userId empty; canonical English post + per-language translation rows */
8
+ GENERAL = "GENERAL",
9
+ DAILY = "DAILY",
10
+ WEEKLY = "WEEKLY",
11
+ MONTHLY = "MONTHLY",
12
+ TRANSIT_ALERT = "TRANSIT_ALERT",
13
+ UNRECOGNIZED = "UNRECOGNIZED"
14
+ }
15
+ export declare enum CalculationStatus {
16
+ CALCULATION_STATUS_UNSPECIFIED = "CALCULATION_STATUS_UNSPECIFIED",
17
+ PENDING = "PENDING",
18
+ IN_PROGRESS = "IN_PROGRESS",
19
+ DONE = "DONE",
20
+ FAILED = "FAILED",
21
+ UNRECOGNIZED = "UNRECOGNIZED"
22
+ }
23
+ export interface Post {
24
+ id: string;
25
+ /** empty => general */
26
+ userId: string;
27
+ type: PostType;
28
+ title: string;
29
+ content: string;
30
+ /** general posts: "en"; personal posts: user's language at generation time */
31
+ language: string;
32
+ plan: Plan;
33
+ shouldNotify: boolean;
34
+ /** ISO 8601 */
35
+ publishedAt: string;
36
+ /** ISO 8601 */
37
+ createdAt: string;
38
+ /** translations: id of the canonical (English) post; empty on canonical/personal posts */
39
+ sourcePostId: string;
40
+ }
41
+ export interface NatalChart {
42
+ id: string;
43
+ userId: string;
44
+ rawData?: {
45
+ [key: string]: any;
46
+ } | undefined;
47
+ natalPoints?: {
48
+ [key: string]: any;
49
+ } | undefined;
50
+ status: CalculationStatus;
51
+ summary: string;
52
+ deepSummary: string;
53
+ personalityScores?: {
54
+ [key: string]: any;
55
+ } | undefined;
56
+ personalitySummary: string;
57
+ }
58
+ /** GENERAL feed: userId left empty. Personal types: userId set (caller). */
59
+ export interface FindManyPostRequest {
60
+ page?: CursorRequest | undefined;
61
+ type: PostType;
62
+ userId: string;
63
+ /** GENERAL only: language variant to return; empty => "en" */
64
+ language: string;
65
+ }
66
+ export interface FindManyPostResponse {
67
+ data: Post[];
68
+ nextCursor: string;
69
+ hasMore: boolean;
70
+ }
71
+ export interface FindFirstPostRequest {
72
+ /** canonical post id (GENERAL translations are addressed via their canonical id) */
73
+ id: string;
74
+ /** GENERAL only: preferred translation; falls back to the canonical post when absent */
75
+ language: string;
76
+ }
77
+ export interface GetNatalChartRequest {
78
+ userId: string;
79
+ }
80
+ export declare const ASTROLOGY_PACKAGE_NAME = "astrology";
81
+ export interface AstrologyServiceClient {
82
+ findManyPost(request: FindManyPostRequest, metadata?: Metadata): Observable<FindManyPostResponse>;
83
+ findFirstPost(request: FindFirstPostRequest, metadata?: Metadata): Observable<Post>;
84
+ getNatalChart(request: GetNatalChartRequest, metadata?: Metadata): Observable<NatalChart>;
85
+ }
86
+ export interface AstrologyServiceController {
87
+ findManyPost(request: FindManyPostRequest, metadata?: Metadata): Promise<FindManyPostResponse> | Observable<FindManyPostResponse> | FindManyPostResponse;
88
+ findFirstPost(request: FindFirstPostRequest, metadata?: Metadata): Promise<Post> | Observable<Post> | Post;
89
+ getNatalChart(request: GetNatalChartRequest, metadata?: Metadata): Promise<NatalChart> | Observable<NatalChart> | NatalChart;
90
+ }
91
+ export declare function AstrologyServiceControllerMethods(): (constructor: Function) => void;
92
+ export declare const ASTROLOGY_SERVICE_NAME = "AstrologyService";
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v1.181.2
5
+ // protoc v3.21.5
6
+ // source: astrology.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ASTROLOGY_SERVICE_NAME = exports.ASTROLOGY_PACKAGE_NAME = exports.CalculationStatus = exports.PostType = exports.protobufPackage = void 0;
9
+ exports.AstrologyServiceControllerMethods = AstrologyServiceControllerMethods;
10
+ const microservices_1 = require("@nestjs/microservices");
11
+ const protobufjs_1 = require("protobufjs");
12
+ const struct_1 = require("./google/protobuf/struct");
13
+ exports.protobufPackage = "astrology";
14
+ var PostType;
15
+ (function (PostType) {
16
+ PostType["POST_TYPE_UNSPECIFIED"] = "POST_TYPE_UNSPECIFIED";
17
+ /** GENERAL - userId empty; canonical English post + per-language translation rows */
18
+ PostType["GENERAL"] = "GENERAL";
19
+ PostType["DAILY"] = "DAILY";
20
+ PostType["WEEKLY"] = "WEEKLY";
21
+ PostType["MONTHLY"] = "MONTHLY";
22
+ PostType["TRANSIT_ALERT"] = "TRANSIT_ALERT";
23
+ PostType["UNRECOGNIZED"] = "UNRECOGNIZED";
24
+ })(PostType || (exports.PostType = PostType = {}));
25
+ var CalculationStatus;
26
+ (function (CalculationStatus) {
27
+ CalculationStatus["CALCULATION_STATUS_UNSPECIFIED"] = "CALCULATION_STATUS_UNSPECIFIED";
28
+ CalculationStatus["PENDING"] = "PENDING";
29
+ CalculationStatus["IN_PROGRESS"] = "IN_PROGRESS";
30
+ CalculationStatus["DONE"] = "DONE";
31
+ CalculationStatus["FAILED"] = "FAILED";
32
+ CalculationStatus["UNRECOGNIZED"] = "UNRECOGNIZED";
33
+ })(CalculationStatus || (exports.CalculationStatus = CalculationStatus = {}));
34
+ exports.ASTROLOGY_PACKAGE_NAME = "astrology";
35
+ protobufjs_1.wrappers[".google.protobuf.Struct"] = { fromObject: struct_1.Struct.wrap, toObject: struct_1.Struct.unwrap };
36
+ function AstrologyServiceControllerMethods() {
37
+ return function (constructor) {
38
+ const grpcMethods = ["findManyPost", "findFirstPost", "getNatalChart"];
39
+ for (const method of grpcMethods) {
40
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
41
+ (0, microservices_1.GrpcMethod)("AstrologyService", method)(constructor.prototype[method], method, descriptor);
42
+ }
43
+ const grpcStreamMethods = [];
44
+ for (const method of grpcStreamMethods) {
45
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
46
+ (0, microservices_1.GrpcStreamMethod)("AstrologyService", method)(constructor.prototype[method], method, descriptor);
47
+ }
48
+ };
49
+ }
50
+ exports.ASTROLOGY_SERVICE_NAME = "AstrologyService";
@@ -0,0 +1,131 @@
1
+ import { Metadata } from "@grpc/grpc-js";
2
+ import { Observable } from "rxjs";
3
+ import { Plan } from "./common";
4
+ import { Empty } from "./google/protobuf/empty";
5
+ export declare const protobufPackage = "auth";
6
+ export declare enum OAuthProvider {
7
+ OAUTH_PROVIDER_UNSPECIFIED = "OAUTH_PROVIDER_UNSPECIFIED",
8
+ GOOGLE = "GOOGLE",
9
+ MICROSOFT = "MICROSOFT",
10
+ UNRECOGNIZED = "UNRECOGNIZED"
11
+ }
12
+ export declare enum UserStatus {
13
+ USER_STATUS_UNSPECIFIED = "USER_STATUS_UNSPECIFIED",
14
+ ACTIVE = "ACTIVE",
15
+ SUSPENDED = "SUSPENDED",
16
+ DELETED = "DELETED",
17
+ UNRECOGNIZED = "UNRECOGNIZED"
18
+ }
19
+ export interface User {
20
+ id: string;
21
+ email: string;
22
+ emailVerified: boolean;
23
+ name: string;
24
+ /** ISO 8601, empty if unset */
25
+ birthAt: string;
26
+ /** BCP-47 */
27
+ language: string;
28
+ birthLat: number;
29
+ birthLng: number;
30
+ birthLocationName: string;
31
+ plan: Plan;
32
+ status: UserStatus;
33
+ linkedProviders: OAuthProvider[];
34
+ /**
35
+ * Current IANA timezone (device-reported, e.g. "Europe/Istanbul"), empty if
36
+ * unset. NOT the birth timezone — that stays server-derived from lat/lng.
37
+ */
38
+ timezone: string;
39
+ }
40
+ export interface AuthResponse {
41
+ /** RS256 JWT, short TTL */
42
+ accessToken: string;
43
+ /** revocable, Redis-backed */
44
+ refreshToken: string;
45
+ user?: User | undefined;
46
+ }
47
+ export interface RegisterRequest {
48
+ name: string;
49
+ email: string;
50
+ password: string;
51
+ language: string;
52
+ /** current IANA timezone (device-reported), optional */
53
+ timezone: string;
54
+ }
55
+ export interface LoginRequest {
56
+ email: string;
57
+ password: string;
58
+ }
59
+ export interface OAuthLoginRequest {
60
+ provider: OAuthProvider;
61
+ providerToken: string;
62
+ language: string;
63
+ /** current IANA timezone (device-reported), optional */
64
+ timezone: string;
65
+ }
66
+ export interface RefreshTokenRequest {
67
+ refreshToken: string;
68
+ }
69
+ export interface UpdateProfileRequest {
70
+ /**
71
+ * Partial update: every field except userId is `optional` so absence is
72
+ * distinguishable from proto3 defaults ("" / 0). Without presence tracking a
73
+ * language-only PATCH used to arrive with birthLat=0/birthLng=0 and silently
74
+ * overwrite the stored birth coordinates.
75
+ */
76
+ userId: string;
77
+ name?: string | undefined;
78
+ birthAt?: string | undefined;
79
+ birthLat?: number | undefined;
80
+ birthLng?: number | undefined;
81
+ birthLocationName?: string | undefined;
82
+ language?: string | undefined;
83
+ /** current IANA timezone; never triggers a natal recalc */
84
+ timezone?: string | undefined;
85
+ }
86
+ export interface OAuthLinkRequest {
87
+ userId: string;
88
+ provider: OAuthProvider;
89
+ providerToken: string;
90
+ }
91
+ export interface OAuthUnlinkRequest {
92
+ userId: string;
93
+ provider: OAuthProvider;
94
+ }
95
+ export interface GetUserRequest {
96
+ userId: string;
97
+ }
98
+ export interface UpdateUserPlanRequest {
99
+ userId: string;
100
+ plan: Plan;
101
+ }
102
+ export interface DeleteAccountRequest {
103
+ userId: string;
104
+ }
105
+ export declare const AUTH_PACKAGE_NAME = "auth";
106
+ export interface AuthServiceClient {
107
+ register(request: RegisterRequest, metadata?: Metadata): Observable<AuthResponse>;
108
+ login(request: LoginRequest, metadata?: Metadata): Observable<AuthResponse>;
109
+ oAuthLogin(request: OAuthLoginRequest, metadata?: Metadata): Observable<AuthResponse>;
110
+ refreshToken(request: RefreshTokenRequest, metadata?: Metadata): Observable<AuthResponse>;
111
+ updateProfile(request: UpdateProfileRequest, metadata?: Metadata): Observable<AuthResponse>;
112
+ oAuthLink(request: OAuthLinkRequest, metadata?: Metadata): Observable<Empty>;
113
+ oAuthUnlink(request: OAuthUnlinkRequest, metadata?: Metadata): Observable<Empty>;
114
+ getUser(request: GetUserRequest, metadata?: Metadata): Observable<User>;
115
+ updateUserPlan(request: UpdateUserPlanRequest, metadata?: Metadata): Observable<Empty>;
116
+ deleteAccount(request: DeleteAccountRequest, metadata?: Metadata): Observable<Empty>;
117
+ }
118
+ export interface AuthServiceController {
119
+ register(request: RegisterRequest, metadata?: Metadata): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
120
+ login(request: LoginRequest, metadata?: Metadata): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
121
+ oAuthLogin(request: OAuthLoginRequest, metadata?: Metadata): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
122
+ refreshToken(request: RefreshTokenRequest, metadata?: Metadata): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
123
+ updateProfile(request: UpdateProfileRequest, metadata?: Metadata): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
124
+ oAuthLink(request: OAuthLinkRequest, metadata?: Metadata): void;
125
+ oAuthUnlink(request: OAuthUnlinkRequest, metadata?: Metadata): void;
126
+ getUser(request: GetUserRequest, metadata?: Metadata): Promise<User> | Observable<User> | User;
127
+ updateUserPlan(request: UpdateUserPlanRequest, metadata?: Metadata): void;
128
+ deleteAccount(request: DeleteAccountRequest, metadata?: Metadata): void;
129
+ }
130
+ export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
131
+ export declare const AUTH_SERVICE_NAME = "AuthService";
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v1.181.2
5
+ // protoc v3.21.5
6
+ // source: auth.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.AUTH_SERVICE_NAME = exports.AUTH_PACKAGE_NAME = exports.UserStatus = exports.OAuthProvider = exports.protobufPackage = void 0;
9
+ exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
10
+ const microservices_1 = require("@nestjs/microservices");
11
+ exports.protobufPackage = "auth";
12
+ var OAuthProvider;
13
+ (function (OAuthProvider) {
14
+ OAuthProvider["OAUTH_PROVIDER_UNSPECIFIED"] = "OAUTH_PROVIDER_UNSPECIFIED";
15
+ OAuthProvider["GOOGLE"] = "GOOGLE";
16
+ OAuthProvider["MICROSOFT"] = "MICROSOFT";
17
+ OAuthProvider["UNRECOGNIZED"] = "UNRECOGNIZED";
18
+ })(OAuthProvider || (exports.OAuthProvider = OAuthProvider = {}));
19
+ var UserStatus;
20
+ (function (UserStatus) {
21
+ UserStatus["USER_STATUS_UNSPECIFIED"] = "USER_STATUS_UNSPECIFIED";
22
+ UserStatus["ACTIVE"] = "ACTIVE";
23
+ UserStatus["SUSPENDED"] = "SUSPENDED";
24
+ UserStatus["DELETED"] = "DELETED";
25
+ UserStatus["UNRECOGNIZED"] = "UNRECOGNIZED";
26
+ })(UserStatus || (exports.UserStatus = UserStatus = {}));
27
+ exports.AUTH_PACKAGE_NAME = "auth";
28
+ function AuthServiceControllerMethods() {
29
+ return function (constructor) {
30
+ const grpcMethods = [
31
+ "register",
32
+ "login",
33
+ "oAuthLogin",
34
+ "refreshToken",
35
+ "updateProfile",
36
+ "oAuthLink",
37
+ "oAuthUnlink",
38
+ "getUser",
39
+ "updateUserPlan",
40
+ "deleteAccount",
41
+ ];
42
+ for (const method of grpcMethods) {
43
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
44
+ (0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
45
+ }
46
+ const grpcStreamMethods = [];
47
+ for (const method of grpcStreamMethods) {
48
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
49
+ (0, microservices_1.GrpcStreamMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
50
+ }
51
+ };
52
+ }
53
+ exports.AUTH_SERVICE_NAME = "AuthService";
@@ -0,0 +1,62 @@
1
+ import { Metadata } from "@grpc/grpc-js";
2
+ import { Observable } from "rxjs";
3
+ import { Plan } from "./common";
4
+ import { Empty } from "./google/protobuf/empty";
5
+ export declare const protobufPackage = "billing";
6
+ export declare enum SubscriptionStatus {
7
+ SUBSCRIPTION_STATUS_UNSPECIFIED = "SUBSCRIPTION_STATUS_UNSPECIFIED",
8
+ ACTIVE = "ACTIVE",
9
+ PAST_DUE = "PAST_DUE",
10
+ CANCELLED = "CANCELLED",
11
+ EXPIRED = "EXPIRED",
12
+ UNRECOGNIZED = "UNRECOGNIZED"
13
+ }
14
+ export interface Subscription {
15
+ id: string;
16
+ userId: string;
17
+ plan: Plan;
18
+ status: SubscriptionStatus;
19
+ cancelAtPeriodEnd: boolean;
20
+ /** ISO 8601 */
21
+ currentPeriodStart: string;
22
+ /** ISO 8601 */
23
+ currentPeriodEnd: string;
24
+ }
25
+ export interface GetSubscriptionRequest {
26
+ userId: string;
27
+ }
28
+ export interface CreateCheckoutSessionRequest {
29
+ userId: string;
30
+ }
31
+ export interface CreatePortalSessionRequest {
32
+ userId: string;
33
+ }
34
+ export interface CheckoutSession {
35
+ /** Stripe checkout page */
36
+ checkoutUrl: string;
37
+ }
38
+ export interface PortalSession {
39
+ /** Stripe customer portal */
40
+ portalUrl: string;
41
+ }
42
+ export interface WebhookEventRequest {
43
+ /** raw Stripe webhook body */
44
+ payload: Uint8Array;
45
+ /** Stripe-Signature header */
46
+ signature: string;
47
+ }
48
+ export declare const BILLING_PACKAGE_NAME = "billing";
49
+ export interface BillingServiceClient {
50
+ getSubscription(request: GetSubscriptionRequest, metadata?: Metadata): Observable<Subscription>;
51
+ createCheckoutSession(request: CreateCheckoutSessionRequest, metadata?: Metadata): Observable<CheckoutSession>;
52
+ createPortalSession(request: CreatePortalSessionRequest, metadata?: Metadata): Observable<PortalSession>;
53
+ handleWebhookEvent(request: WebhookEventRequest, metadata?: Metadata): Observable<Empty>;
54
+ }
55
+ export interface BillingServiceController {
56
+ getSubscription(request: GetSubscriptionRequest, metadata?: Metadata): Promise<Subscription> | Observable<Subscription> | Subscription;
57
+ createCheckoutSession(request: CreateCheckoutSessionRequest, metadata?: Metadata): Promise<CheckoutSession> | Observable<CheckoutSession> | CheckoutSession;
58
+ createPortalSession(request: CreatePortalSessionRequest, metadata?: Metadata): Promise<PortalSession> | Observable<PortalSession> | PortalSession;
59
+ handleWebhookEvent(request: WebhookEventRequest, metadata?: Metadata): void;
60
+ }
61
+ export declare function BillingServiceControllerMethods(): (constructor: Function) => void;
62
+ export declare const BILLING_SERVICE_NAME = "BillingService";
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v1.181.2
5
+ // protoc v3.21.5
6
+ // source: billing.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.BILLING_SERVICE_NAME = exports.BILLING_PACKAGE_NAME = exports.SubscriptionStatus = exports.protobufPackage = void 0;
9
+ exports.BillingServiceControllerMethods = BillingServiceControllerMethods;
10
+ const microservices_1 = require("@nestjs/microservices");
11
+ exports.protobufPackage = "billing";
12
+ var SubscriptionStatus;
13
+ (function (SubscriptionStatus) {
14
+ SubscriptionStatus["SUBSCRIPTION_STATUS_UNSPECIFIED"] = "SUBSCRIPTION_STATUS_UNSPECIFIED";
15
+ SubscriptionStatus["ACTIVE"] = "ACTIVE";
16
+ SubscriptionStatus["PAST_DUE"] = "PAST_DUE";
17
+ SubscriptionStatus["CANCELLED"] = "CANCELLED";
18
+ SubscriptionStatus["EXPIRED"] = "EXPIRED";
19
+ SubscriptionStatus["UNRECOGNIZED"] = "UNRECOGNIZED";
20
+ })(SubscriptionStatus || (exports.SubscriptionStatus = SubscriptionStatus = {}));
21
+ exports.BILLING_PACKAGE_NAME = "billing";
22
+ function BillingServiceControllerMethods() {
23
+ return function (constructor) {
24
+ const grpcMethods = [
25
+ "getSubscription",
26
+ "createCheckoutSession",
27
+ "createPortalSession",
28
+ "handleWebhookEvent",
29
+ ];
30
+ for (const method of grpcMethods) {
31
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
32
+ (0, microservices_1.GrpcMethod)("BillingService", method)(constructor.prototype[method], method, descriptor);
33
+ }
34
+ const grpcStreamMethods = [];
35
+ for (const method of grpcStreamMethods) {
36
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
37
+ (0, microservices_1.GrpcStreamMethod)("BillingService", method)(constructor.prototype[method], method, descriptor);
38
+ }
39
+ };
40
+ }
41
+ exports.BILLING_SERVICE_NAME = "BillingService";
@@ -0,0 +1,17 @@
1
+ export declare const protobufPackage = "common";
2
+ export declare enum Plan {
3
+ PLAN_UNSPECIFIED = "PLAN_UNSPECIFIED",
4
+ FREE = "FREE",
5
+ PREMIUM = "PREMIUM",
6
+ UNRECOGNIZED = "UNRECOGNIZED"
7
+ }
8
+ /**
9
+ * Keyset (seek) cursor pagination request. `cursor` is an opaque base64 of the
10
+ * last row's sort key ({ v, id }); empty on the first page. `limit` is capped
11
+ * server-side (e.g. <= 50). See cursor.ts encode/decode helpers.
12
+ */
13
+ export interface CursorRequest {
14
+ cursor: string;
15
+ limit: number;
16
+ }
17
+ export declare const COMMON_PACKAGE_NAME = "common";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v1.181.2
5
+ // protoc v3.21.5
6
+ // source: common.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.COMMON_PACKAGE_NAME = exports.Plan = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ exports.protobufPackage = "common";
11
+ var Plan;
12
+ (function (Plan) {
13
+ Plan["PLAN_UNSPECIFIED"] = "PLAN_UNSPECIFIED";
14
+ Plan["FREE"] = "FREE";
15
+ Plan["PREMIUM"] = "PREMIUM";
16
+ Plan["UNRECOGNIZED"] = "UNRECOGNIZED";
17
+ })(Plan || (exports.Plan = Plan = {}));
18
+ exports.COMMON_PACKAGE_NAME = "common";
@@ -0,0 +1,13 @@
1
+ export declare const protobufPackage = "google.protobuf";
2
+ /**
3
+ * A generic empty message that you can re-use to avoid defining duplicated
4
+ * empty messages in your APIs. A typical example is to use it as the request
5
+ * or the response type of an API method. For instance:
6
+ *
7
+ * service Foo {
8
+ * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
9
+ * }
10
+ */
11
+ export interface Empty {
12
+ }
13
+ export declare const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v1.181.2
5
+ // protoc v3.21.5
6
+ // source: google/protobuf/empty.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.GOOGLE_PROTOBUF_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ exports.protobufPackage = "google.protobuf";
11
+ exports.GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";