@outlyapp/contracts 1.0.1 → 1.0.4

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.
@@ -1,2 +1,18 @@
1
- export declare const protobufPackage = "";
2
- export declare const _PACKAGE_NAME = "";
1
+ import _m0 from "protobufjs/minimal";
2
+ export declare const protobufPackage = "auth";
3
+ export interface AuthRequest {
4
+ email: string;
5
+ password: string;
6
+ }
7
+ export interface AuthResponse {
8
+ token: string;
9
+ }
10
+ export declare const AUTH_PACKAGE_NAME = "auth";
11
+ export declare const AuthRequest: {
12
+ encode(message: AuthRequest, writer?: _m0.Writer): _m0.Writer;
13
+ decode(input: _m0.Reader | Uint8Array, length?: number): AuthRequest;
14
+ };
15
+ export declare const AuthResponse: {
16
+ encode(message: AuthResponse, writer?: _m0.Writer): _m0.Writer;
17
+ decode(input: _m0.Reader | Uint8Array, length?: number): AuthResponse;
18
+ };
package/dist/auth/auth.js CHANGED
@@ -4,5 +4,79 @@
4
4
  // protoc v6.33.4
5
5
  // source: auth/auth.proto
6
6
  /* eslint-disable */
7
- export const protobufPackage = "";
8
- export const _PACKAGE_NAME = "";
7
+ import _m0 from "protobufjs/minimal";
8
+ export const protobufPackage = "auth";
9
+ export const AUTH_PACKAGE_NAME = "auth";
10
+ function createBaseAuthRequest() {
11
+ return { email: "", password: "" };
12
+ }
13
+ export const AuthRequest = {
14
+ encode(message, writer = _m0.Writer.create()) {
15
+ if (message.email !== "") {
16
+ writer.uint32(10).string(message.email);
17
+ }
18
+ if (message.password !== "") {
19
+ writer.uint32(18).string(message.password);
20
+ }
21
+ return writer;
22
+ },
23
+ decode(input, length) {
24
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
25
+ let end = length === undefined ? reader.len : reader.pos + length;
26
+ const message = createBaseAuthRequest();
27
+ while (reader.pos < end) {
28
+ const tag = reader.uint32();
29
+ switch (tag >>> 3) {
30
+ case 1:
31
+ if (tag !== 10) {
32
+ break;
33
+ }
34
+ message.email = reader.string();
35
+ continue;
36
+ case 2:
37
+ if (tag !== 18) {
38
+ break;
39
+ }
40
+ message.password = reader.string();
41
+ continue;
42
+ }
43
+ if ((tag & 7) === 4 || tag === 0) {
44
+ break;
45
+ }
46
+ reader.skipType(tag & 7);
47
+ }
48
+ return message;
49
+ },
50
+ };
51
+ function createBaseAuthResponse() {
52
+ return { token: "" };
53
+ }
54
+ export const AuthResponse = {
55
+ encode(message, writer = _m0.Writer.create()) {
56
+ if (message.token !== "") {
57
+ writer.uint32(10).string(message.token);
58
+ }
59
+ return writer;
60
+ },
61
+ decode(input, length) {
62
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
63
+ let end = length === undefined ? reader.len : reader.pos + length;
64
+ const message = createBaseAuthResponse();
65
+ while (reader.pos < end) {
66
+ const tag = reader.uint32();
67
+ switch (tag >>> 3) {
68
+ case 1:
69
+ if (tag !== 10) {
70
+ break;
71
+ }
72
+ message.token = reader.string();
73
+ continue;
74
+ }
75
+ if ((tag & 7) === 4 || tag === 0) {
76
+ break;
77
+ }
78
+ reader.skipType(tag & 7);
79
+ }
80
+ return message;
81
+ },
82
+ };
@@ -0,0 +1,12 @@
1
+ syntax = "proto3";
2
+
3
+ package auth; // <--- add this
4
+
5
+ message AuthRequest {
6
+ string email = 1;
7
+ string password = 2;
8
+ }
9
+
10
+ message AuthResponse {
11
+ string token = 1;
12
+ }
@@ -0,0 +1,4 @@
1
+ export declare const authDescriptor: {
2
+ readonly package: "auth";
3
+ readonly protoPath: string;
4
+ };
@@ -0,0 +1,5 @@
1
+ import { AUTH_PROTO_PATH } from "../paths";
2
+ export const authDescriptor = {
3
+ package: "auth",
4
+ protoPath: AUTH_PROTO_PATH
5
+ };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,7 @@
1
1
  export * as auth from "./auth/auth";
2
+ export { authDescriptor } from "./auth/descriptor";
2
3
  export * as listings from "./listings/listings";
4
+ export { listingsDescriptor } from "./listings/descriptor";
3
5
  export * as users from "./users/users";
6
+ export { usersDescriptor } from "./users/descriptor";
7
+ export * from "./paths";
package/dist/index.js CHANGED
@@ -1,3 +1,7 @@
1
1
  export * as auth from "./auth/auth";
2
+ export { authDescriptor } from "./auth/descriptor";
2
3
  export * as listings from "./listings/listings";
4
+ export { listingsDescriptor } from "./listings/descriptor";
3
5
  export * as users from "./users/users";
6
+ export { usersDescriptor } from "./users/descriptor";
7
+ export * from "./paths";
@@ -0,0 +1,4 @@
1
+ export declare const listingsDescriptor: {
2
+ readonly package: "listings";
3
+ readonly protoPath: string;
4
+ };
@@ -0,0 +1,5 @@
1
+ import { LISTINGS_PROTO_PATH } from "../paths";
2
+ export const listingsDescriptor = {
3
+ package: "listings",
4
+ protoPath: LISTINGS_PROTO_PATH
5
+ };
@@ -1,2 +1,18 @@
1
- export declare const protobufPackage = "";
2
- export declare const _PACKAGE_NAME = "";
1
+ import _m0 from "protobufjs/minimal";
2
+ export declare const protobufPackage = "listings";
3
+ export interface listings {
4
+ email: string;
5
+ password: string;
6
+ }
7
+ export interface AuthResponse {
8
+ token: string;
9
+ }
10
+ export declare const LISTINGS_PACKAGE_NAME = "listings";
11
+ export declare const listings: {
12
+ encode(message: listings, writer?: _m0.Writer): _m0.Writer;
13
+ decode(input: _m0.Reader | Uint8Array, length?: number): listings;
14
+ };
15
+ export declare const AuthResponse: {
16
+ encode(message: AuthResponse, writer?: _m0.Writer): _m0.Writer;
17
+ decode(input: _m0.Reader | Uint8Array, length?: number): AuthResponse;
18
+ };
@@ -4,5 +4,79 @@
4
4
  // protoc v6.33.4
5
5
  // source: listings/listings.proto
6
6
  /* eslint-disable */
7
- export const protobufPackage = "";
8
- export const _PACKAGE_NAME = "";
7
+ import _m0 from "protobufjs/minimal";
8
+ export const protobufPackage = "listings";
9
+ export const LISTINGS_PACKAGE_NAME = "listings";
10
+ function createBaselistings() {
11
+ return { email: "", password: "" };
12
+ }
13
+ export const listings = {
14
+ encode(message, writer = _m0.Writer.create()) {
15
+ if (message.email !== "") {
16
+ writer.uint32(10).string(message.email);
17
+ }
18
+ if (message.password !== "") {
19
+ writer.uint32(18).string(message.password);
20
+ }
21
+ return writer;
22
+ },
23
+ decode(input, length) {
24
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
25
+ let end = length === undefined ? reader.len : reader.pos + length;
26
+ const message = createBaselistings();
27
+ while (reader.pos < end) {
28
+ const tag = reader.uint32();
29
+ switch (tag >>> 3) {
30
+ case 1:
31
+ if (tag !== 10) {
32
+ break;
33
+ }
34
+ message.email = reader.string();
35
+ continue;
36
+ case 2:
37
+ if (tag !== 18) {
38
+ break;
39
+ }
40
+ message.password = reader.string();
41
+ continue;
42
+ }
43
+ if ((tag & 7) === 4 || tag === 0) {
44
+ break;
45
+ }
46
+ reader.skipType(tag & 7);
47
+ }
48
+ return message;
49
+ },
50
+ };
51
+ function createBaseAuthResponse() {
52
+ return { token: "" };
53
+ }
54
+ export const AuthResponse = {
55
+ encode(message, writer = _m0.Writer.create()) {
56
+ if (message.token !== "") {
57
+ writer.uint32(10).string(message.token);
58
+ }
59
+ return writer;
60
+ },
61
+ decode(input, length) {
62
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
63
+ let end = length === undefined ? reader.len : reader.pos + length;
64
+ const message = createBaseAuthResponse();
65
+ while (reader.pos < end) {
66
+ const tag = reader.uint32();
67
+ switch (tag >>> 3) {
68
+ case 1:
69
+ if (tag !== 10) {
70
+ break;
71
+ }
72
+ message.token = reader.string();
73
+ continue;
74
+ }
75
+ if ((tag & 7) === 4 || tag === 0) {
76
+ break;
77
+ }
78
+ reader.skipType(tag & 7);
79
+ }
80
+ return message;
81
+ },
82
+ };
@@ -0,0 +1,12 @@
1
+ syntax = "proto3";
2
+
3
+ package listings;
4
+
5
+ message listings {
6
+ string email = 1;
7
+ string password = 2;
8
+ }
9
+
10
+ message AuthResponse {
11
+ string token = 1;
12
+ }
package/dist/paths.js CHANGED
@@ -1,4 +1,3 @@
1
- import { join } from "path";
2
- export const AUTH_PROTO_PATH = join(__dirname, "auth/auth.proto");
3
- export const LISTINGS_PROTO_PATH = join(__dirname, "listings/listings.proto");
4
- export const USERS_PROTO_PATH = join(__dirname, "users/users.proto");
1
+ export const AUTH_PROTO_PATH = new URL("../auth/auth.proto", import.meta.url).pathname;
2
+ export const LISTINGS_PROTO_PATH = new URL("../listings/listings.proto", import.meta.url).pathname;
3
+ export const USERS_PROTO_PATH = new URL("../users/users.proto", import.meta.url).pathname;
@@ -0,0 +1,5 @@
1
+ export declare const usersDescriptor: {
2
+ readonly package: "users";
3
+ readonly service: "UsersService";
4
+ readonly protoPath: string;
5
+ };
@@ -0,0 +1,6 @@
1
+ import { USERS_PROTO_PATH } from "../paths";
2
+ export const usersDescriptor = {
3
+ package: "users",
4
+ service: "UsersService",
5
+ protoPath: USERS_PROTO_PATH
6
+ };
package/package.json CHANGED
@@ -1,18 +1,23 @@
1
1
  {
2
2
  "name": "@outlyapp/contracts",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "private": false,
5
5
  "type": "module",
6
- "files": ["dist"],
7
- "main": "dist/index.js",
8
- "types": "dist/index.d.ts",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
9
11
  "publishConfig": {
10
- "access": "public"
11
- },
12
- "scripts": {
13
- "build": "node scripts/gen.js && tsc -p tsconfig.json",
14
- "publish:contracts": "pnpm build && npm publish"
15
- },
12
+ "access": "public"
13
+ },
14
+ "scripts": {
15
+ "clean": "rm -rf generated dist",
16
+ "gen": "node scripts/gen.js",
17
+ "build": "tsc -p tsconfig.build.json",
18
+ "prepare": "pnpm clean && pnpm gen && pnpm build",
19
+ "release": "git add . && git commit -m 'chore: update generated contracts' && npm version patch && npm publish --access public"
20
+ },
16
21
  "devDependencies": {
17
22
  "protobufjs": "^7.0.0",
18
23
  "ts-proto": "^1.173.0",
@@ -23,4 +28,4 @@
23
28
  "@nestjs/microservices": "^11.1.14",
24
29
  "rxjs": "^7.8.2"
25
30
  }
26
- }
31
+ }