@seatflow/contracts 0.0.0-stage → 0.1.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.
@@ -0,0 +1,14 @@
1
+ export declare const protobufPackage = "google.protobuf";
2
+ export declare const protobufFileName = "google/protobuf/empty.proto";
3
+ /**
4
+ * A generic empty message that you can re-use to avoid defining duplicated
5
+ * empty messages in your APIs. A typical example is to use it as the request
6
+ * or the response type of an API method. For instance:
7
+ *
8
+ * service Foo {
9
+ * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
10
+ * }
11
+ */
12
+ export interface Empty {
13
+ }
14
+ export declare const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
@@ -0,0 +1,9 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.23.9
4
+ // protoc v7.36.2
5
+ // source: google/protobuf/empty.proto
6
+ /* eslint-disable */
7
+ export const protobufPackage = "google.protobuf";
8
+ export const protobufFileName = "google/protobuf/empty.proto";
9
+ export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
@@ -0,0 +1,42 @@
1
+ import type { Metadata } from "@grpc/grpc-js";
2
+ import { Observable } from "rxjs";
3
+ import { Empty } from "../../../google/protobuf/empty.js";
4
+ export declare const protobufPackage = "seatflow.auth.v1";
5
+ export declare const protobufFileName = "seatflow/auth/v1/auth.proto";
6
+ export interface RegisterRequest {
7
+ name: string;
8
+ email: string;
9
+ password: string;
10
+ }
11
+ export interface TokenResponse {
12
+ token: string;
13
+ }
14
+ export interface LoginRequest {
15
+ name: string;
16
+ email: string;
17
+ }
18
+ export interface UserIdentity {
19
+ userId: number;
20
+ email: string;
21
+ roles: string[];
22
+ tokenVersion: number;
23
+ }
24
+ export interface ChangePasswordRequest {
25
+ currentPassword: string;
26
+ newPassword: string;
27
+ }
28
+ export declare const SEATFLOW_AUTH_V1_PACKAGE_NAME = "seatflow.auth.v1";
29
+ export interface AuthServiceClient {
30
+ register(request: RegisterRequest, metadata: Metadata, ...rest: any): Observable<TokenResponse>;
31
+ login(request: LoginRequest, metadata: Metadata, ...rest: any): Observable<TokenResponse>;
32
+ validateToken(request: Empty, metadata: Metadata, ...rest: any): Observable<UserIdentity>;
33
+ changePassword(request: ChangePasswordRequest, metadata: Metadata, ...rest: any): Observable<Empty>;
34
+ }
35
+ export interface AuthServiceController {
36
+ register(request: RegisterRequest, metadata: Metadata, ...rest: any): Promise<TokenResponse> | Observable<TokenResponse> | TokenResponse;
37
+ login(request: LoginRequest, metadata: Metadata, ...rest: any): Promise<TokenResponse> | Observable<TokenResponse> | TokenResponse;
38
+ validateToken(request: Empty, metadata: Metadata, ...rest: any): Promise<UserIdentity> | Observable<UserIdentity> | UserIdentity;
39
+ changePassword(request: ChangePasswordRequest, metadata: Metadata, ...rest: any): void | Promise<void>;
40
+ }
41
+ export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
42
+ export declare const AUTH_SERVICE_NAME = "AuthService";
@@ -0,0 +1,26 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.23.9
4
+ // protoc v7.36.2
5
+ // source: seatflow/auth/v1/auth.proto
6
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
7
+ export const protobufPackage = "seatflow.auth.v1";
8
+ export const protobufFileName = "seatflow/auth/v1/auth.proto";
9
+ export const SEATFLOW_AUTH_V1_PACKAGE_NAME = "seatflow.auth.v1";
10
+ export function AuthServiceControllerMethods() {
11
+ return function (constructor) {
12
+ const grpcMethods = ["register", "login", "validateToken", "changePassword"];
13
+ for (const method of grpcMethods) {
14
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
15
+ GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
16
+ Object.defineProperty(constructor.prototype, method, descriptor);
17
+ }
18
+ const grpcStreamMethods = [];
19
+ for (const method of grpcStreamMethods) {
20
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
21
+ GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
22
+ Object.defineProperty(constructor.prototype, method, descriptor);
23
+ }
24
+ };
25
+ }
26
+ export const AUTH_SERVICE_NAME = "AuthService";
@@ -0,0 +1,5 @@
1
+ export * from './generated/seatflow/auth/v1/auth.js';
2
+ export declare const AUTH_GRPC_PACKAGE = "seatflow.auth.v1";
3
+ export declare const AUTH_GRPC_SERVICE = "AuthService";
4
+ export declare const AUTH_GRPC_CLIENT = "AUTH_GRPC_CLIENT";
5
+ export declare const AUTH_PROTO_PATH: string;
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ export * from './generated/seatflow/auth/v1/auth.js';
3
+ export const AUTH_GRPC_PACKAGE = 'seatflow.auth.v1';
4
+ export const AUTH_GRPC_SERVICE = 'AuthService';
5
+ export const AUTH_GRPC_CLIENT = 'AUTH_GRPC_CLIENT';
6
+ export const AUTH_PROTO_PATH = fileURLToPath(new URL('../proto/seatflow/auth/v1/auth.proto', import.meta.url));
package/package.json CHANGED
@@ -1,6 +1,44 @@
1
1
  {
2
2
  "name": "@seatflow/contracts",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "SeatFlow gRPC contracts",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "proto"
17
+ ],
18
+ "publishConfig": {
19
+ "access": "public"
20
+ },
21
+ "scripts": {
22
+ "generate": "protoc --plugin=protoc-gen-ts_proto=./node_modules/.bin/protoc-gen-ts_proto --proto_path=proto --ts_proto_out=src/generated --ts_proto_opt=nestJs=true,addGrpcMetadata=true,addNestjsRestParameter=true,esModuleInterop=true,importSuffix=.js proto/seatflow/auth/v1/auth.proto",
23
+ "build": "npm run generate && tsc -p tsconfig.json",
24
+ "prepack": "npm run build"
25
+ },
26
+ "peerDependencies": {
27
+ "@grpc/grpc-js": "^1.0.0",
28
+ "@nestjs/common": "^12.0.0",
29
+ "@nestjs/core": "^12.0.0",
30
+ "@nestjs/microservices": "^12.0.0",
31
+ "rxjs": "^7.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "@grpc/grpc-js": "^1.14.7",
35
+ "@nestjs/common": "^12.6.2",
36
+ "@nestjs/core": "^12.6.2",
37
+ "@nestjs/microservices": "^12.6.2",
38
+ "@types/node": "^24.19.4",
39
+ "reflect-metadata": "^0.2.2",
40
+ "rxjs": "^7.8.2",
41
+ "ts-proto": "^2.23.9",
42
+ "typescript": "^6.0.3"
43
+ }
44
+ }
@@ -0,0 +1,39 @@
1
+ syntax = "proto3";
2
+
3
+ package seatflow.auth.v1;
4
+
5
+ import "google/protobuf/empty.proto";
6
+
7
+ service AuthService {
8
+ rpc Register(RegisterRequest) returns (TokenResponse);
9
+ rpc Login(LoginRequest) returns (TokenResponse);
10
+ rpc ValidateToken(google.protobuf.Empty) returns (UserIdentity);
11
+ rpc ChangePassword(ChangePasswordRequest) returns (google.protobuf.Empty);
12
+ }
13
+
14
+ message RegisterRequest {
15
+ string name = 1;
16
+ string email = 2;
17
+ string password = 3;
18
+ }
19
+
20
+ message TokenResponse {
21
+ string token = 1;
22
+ }
23
+
24
+ message LoginRequest {
25
+ string name = 1;
26
+ string email = 2;
27
+ }
28
+
29
+ message UserIdentity {
30
+ int32 user_id = 1;
31
+ string email = 2;
32
+ repeated string roles = 3;
33
+ int32 token_version = 4;
34
+ }
35
+
36
+ message ChangePasswordRequest {
37
+ string current_password = 1;
38
+ string new_password = 2;
39
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.