@shock-cinema/contracts 1.0.4 → 1.0.6

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 @@
1
+ export * from './proto';
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./proto"), exports);
@@ -0,0 +1 @@
1
+ export * from './paths';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./paths"), exports);
@@ -0,0 +1,3 @@
1
+ export declare const PROTO_PATHS: {
2
+ readonly AUTH: string;
3
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROTO_PATHS = void 0;
4
+ const node_path_1 = require("node:path");
5
+ exports.PROTO_PATHS = {
6
+ AUTH: (0, node_path_1.join)(__dirname, '../../proto/auth.proto')
7
+ };
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v6.33.1
4
+ // protoc v3.21.12
5
5
  // source: google/protobuf/any.proto
6
6
 
7
7
  /* eslint-disable */
@@ -33,12 +33,8 @@ export const protobufPackage = "google.protobuf";
33
33
  * if (any.is(Foo.class)) {
34
34
  * foo = any.unpack(Foo.class);
35
35
  * }
36
- * // or ...
37
- * if (any.isSameTypeAs(Foo.getDefaultInstance())) {
38
- * foo = any.unpack(Foo.getDefaultInstance());
39
- * }
40
36
  *
41
- * Example 3: Pack and unpack a message in Python.
37
+ * Example 3: Pack and unpack a message in Python.
42
38
  *
43
39
  * foo = Foo(...)
44
40
  * any = Any()
@@ -48,7 +44,7 @@ export const protobufPackage = "google.protobuf";
48
44
  * any.Unpack(foo)
49
45
  * ...
50
46
  *
51
- * Example 4: Pack and unpack a message in Go
47
+ * Example 4: Pack and unpack a message in Go
52
48
  *
53
49
  * foo := &pb.Foo{...}
54
50
  * any, err := anypb.New(foo)
@@ -68,7 +64,7 @@ export const protobufPackage = "google.protobuf";
68
64
  * name "y.z".
69
65
  *
70
66
  * JSON
71
- * ====
67
+ *
72
68
  * The JSON representation of an `Any` value uses the regular
73
69
  * representation of the deserialized, embedded message, with an
74
70
  * additional field `@type` which contains the type URL. Example:
@@ -120,8 +116,7 @@ export interface Any {
120
116
  *
121
117
  * Note: this functionality is not currently available in the official
122
118
  * protobuf release, and it is not used for type URLs beginning with
123
- * type.googleapis.com. As of May 2023, there are no widely used type server
124
- * implementations and no plans to implement one.
119
+ * type.googleapis.com.
125
120
  *
126
121
  * Schemes other than `http`, `https` (or the empty scheme) might be
127
122
  * used with implementation specific semantics.
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v6.33.1
4
+ // protoc v3.21.12
5
5
  // source: google/protobuf/duration.proto
6
6
 
7
7
  /* eslint-disable */
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v6.33.1
4
+ // protoc v3.21.12
5
5
  // source: google/protobuf/empty.proto
6
6
 
7
7
  /* eslint-disable */
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v6.33.1
4
+ // protoc v3.21.12
5
5
  // source: google/protobuf/struct.proto
6
6
 
7
7
  /* eslint-disable */
@@ -13,7 +13,7 @@ export const protobufPackage = "google.protobuf";
13
13
  * `NullValue` is a singleton enumeration to represent the null value for the
14
14
  * `Value` type union.
15
15
  *
16
- * The JSON representation for `NullValue` is JSON `null`.
16
+ * The JSON representation for `NullValue` is JSON `null`.
17
17
  */
18
18
  export enum NullValue {
19
19
  /** NULL_VALUE - Null value. */
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v6.33.1
4
+ // protoc v3.21.12
5
5
  // source: google/protobuf/timestamp.proto
6
6
 
7
7
  /* eslint-disable */
@@ -96,21 +96,20 @@ export const protobufPackage = "google.protobuf";
96
96
  * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
97
97
  * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
98
98
  * the Joda Time's [`ISODateTimeFormat.dateTime()`](
99
- * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
99
+ * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
100
100
  * ) to obtain a formatter capable of generating timestamps in this format.
101
101
  */
102
102
  export interface Timestamp {
103
103
  /**
104
- * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
105
- * be between -315576000000 and 315576000000 inclusive (which corresponds to
106
- * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
104
+ * Represents seconds of UTC time since Unix epoch
105
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
106
+ * 9999-12-31T23:59:59Z inclusive.
107
107
  */
108
108
  seconds: number;
109
109
  /**
110
- * Non-negative fractions of a second at nanosecond resolution. This field is
111
- * the nanosecond portion of the duration, not an alternative to seconds.
112
- * Negative second values with fractions must still have non-negative nanos
113
- * values that count forward in time. Must be between 0 and 999,999,999
110
+ * Non-negative fractions of a second at nanosecond resolution. Negative
111
+ * second values with fractions must still have non-negative nanos values
112
+ * that count forward in time. Must be from 0 to 999,999,999
114
113
  * inclusive.
115
114
  */
116
115
  nanos: number;
package/gen/test.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.10.1
4
- // protoc v6.33.1
4
+ // protoc v3.21.12
5
5
  // source: test.proto
6
6
 
7
7
  /* eslint-disable */
package/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "@shock-cinema/contracts",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
5
7
  "scripts": {
8
+ "build": "tsc -p tsconfig.build.json",
6
9
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
10
  },
8
11
  "files": [
9
- "proto",
10
- "gen"
12
+ "dist",
13
+ "gen",
14
+ "proto"
11
15
  ],
12
16
  "publishConfig": {
13
17
  "access": "public"
@@ -16,5 +20,9 @@
16
20
  "@nestjs/microservices": "^11.1.11",
17
21
  "rxjs": "^7.8.2",
18
22
  "ts-proto": "^2.8.3"
23
+ },
24
+ "devDependencies": {
25
+ "@types/node": "^25.0.3",
26
+ "typescript": "^5.9.3"
19
27
  }
20
28
  }
@@ -0,0 +1,43 @@
1
+ syntax = "proto3";
2
+
3
+ package test.v1;
4
+
5
+ import "google/protobuf/empty.proto";
6
+ import "google/protobuf/timestamp.proto";
7
+ import "google/protobuf/duration.proto";
8
+ import "google/protobuf/struct.proto";
9
+ import "google/protobuf/any.proto";
10
+
11
+ service TestService {
12
+ rpc Ping (google.protobuf.Empty) returns (PingResponse);
13
+ }
14
+
15
+ message PingResponse {
16
+
17
+ }
18
+
19
+ message UserSession {
20
+ string id = 1;
21
+ google.protobuf.Timestamp created_at = 2;
22
+ google.protobuf.Duration duration = 3;
23
+ }
24
+
25
+ message UserProfile {
26
+ string id = 1;
27
+ int32 age = 2;
28
+ double rating = 3;
29
+ bool verified = 4;
30
+ repeated string roles = 5;
31
+ map<string, string> meta = 6;
32
+ Status status = 7;
33
+ oneof contact {
34
+ string phone = 8;
35
+ string email = 9;
36
+ }
37
+ }
38
+
39
+ enum Status {
40
+ STATUS_UNKNOWN = 0;
41
+ STATUS_ACTIVE = 1;
42
+ STATUS_BANNED = 2;
43
+ }