@lumina-cinema/contracts 1.0.9 → 1.1.1

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 './otp-requested.interface';
@@ -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("./otp-requested.interface"), exports);
@@ -0,0 +1,5 @@
1
+ export interface OtpRequestedEvent {
2
+ identifier: string;
3
+ type: string;
4
+ code: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './auth';
@@ -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("./auth"), exports);
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './proto';
2
+ export * from './events';
package/dist/index.js CHANGED
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./proto"), exports);
18
+ __exportStar(require("./events"), exports);
package/gen/auth.ts CHANGED
@@ -11,63 +11,63 @@ import { Empty } from "./google/protobuf/empty";
11
11
 
12
12
  export const protobufPackage = "auth.v1";
13
13
 
14
- /** / Request to send an OTP to an identifier (email/phone). */
14
+ /** Request to send an OTP to an identifier (email/phone). */
15
15
  export interface SendOtpRequest {
16
- /** / Target identifier to deliver OTP to (e.g. "+31612345678" or "user@example.com"). */
16
+ /** Target identifier to deliver OTP to (e.g. "+31612345678" or "user@example.com"). */
17
17
  identifier: string;
18
- /** / Identifier/delivery type. Recommended values: "phone" or "email". */
18
+ /** Identifier/delivery type. Recommended values: "phone" or "email". */
19
19
  type: string;
20
20
  }
21
21
 
22
- /** / Send OTP result. */
22
+ /** Send OTP result. */
23
23
  export interface SendOtpResponse {
24
- /** / True if the OTP was accepted for delivery (does not necessarily guarantee delivery). */
24
+ /** True if the OTP was accepted for delivery (does not necessarily guarantee delivery). */
25
25
  ok: boolean;
26
26
  }
27
27
 
28
- /** / Request to verify an OTP for an identifier. */
28
+ /** Request to verify an OTP for an identifier. */
29
29
  export interface VerifyOtpRequest {
30
- /** / Identifier that received the OTP (must match the identifier used in SendOtp). */
30
+ /** Identifier that received the OTP (must match the identifier used in SendOtp). */
31
31
  identifier: string;
32
- /** / Identifier type used for delivery. Recommended values: "phone" or "email". */
32
+ /** Identifier type used for delivery. Recommended values: "phone" or "email". */
33
33
  type: string;
34
- /** / OTP code entered by the user. */
34
+ /** OTP code entered by the user. */
35
35
  code: string;
36
36
  }
37
37
 
38
- /** / Successful OTP verification response. */
38
+ /** Successful OTP verification response. */
39
39
  export interface VerifyOtpResponse {
40
- /** / Short-lived access token. */
40
+ /** Short-lived access token. */
41
41
  accessToken: string;
42
- /** / Long-lived refresh token used to obtain new access tokens. */
42
+ /** Long-lived refresh token used to obtain new access tokens. */
43
43
  refreshToken: string;
44
44
  }
45
45
 
46
- /** / Request to refresh tokens. */
46
+ /** Request to refresh tokens. */
47
47
  export interface RefreshRequest {
48
- /** / Refresh token previously issued by the service. */
48
+ /** Refresh token previously issued by the service. */
49
49
  refreshToken: string;
50
50
  }
51
51
 
52
- /** / Response containing a new token pair. */
52
+ /** Response containing a new token pair. */
53
53
  export interface RefreshResponse {
54
- /** / New access token. */
54
+ /** New access token. */
55
55
  accessToken: string;
56
- /** / New refresh token (may be rotated on each refresh). */
56
+ /** New refresh token (may be rotated on each refresh). */
57
57
  refreshToken: string;
58
58
  }
59
59
 
60
- /** / Telegram initialization response. */
60
+ /** Telegram initialization response. */
61
61
  export interface TelegramInitResponse {
62
- /** / Telegram OAuth authorization URL to open in the client. */
62
+ /** Telegram OAuth authorization URL to open in the client. */
63
63
  url: string;
64
64
  }
65
65
 
66
- /** / Telegram verification request. */
66
+ /** Telegram verification request. */
67
67
  export interface TelegramVerifyRequest {
68
68
  /**
69
- * / Raw query parameters returned by Telegram (must include `hash` and `auth_date`).
70
- * / The service validates signature and freshness.
69
+ * Raw query parameters returned by Telegram (must include `hash` and `auth_date`).
70
+ * The service validates signature and freshness.
71
71
  */
72
72
  query: { [key: string]: string };
73
73
  }
@@ -78,47 +78,47 @@ export interface TelegramVerifyRequest_QueryEntry {
78
78
  }
79
79
 
80
80
  /**
81
- * / Telegram verification result.
82
- * / The response depends on whether the account is fully linked.
81
+ * Telegram verification result.
82
+ * The response depends on whether the account is fully linked.
83
83
  */
84
84
  export interface TelegramVerifyResponse {
85
- /** / Bot deep link to continue/complete the flow (e.g. provide phone, confirm consent). */
85
+ /** Bot deep link to continue/complete the flow (e.g. provide phone, confirm consent). */
86
86
  url?:
87
87
  | string
88
88
  | undefined;
89
- /** / Access token issued when Telegram login can be completed immediately. */
89
+ /** Access token issued when Telegram login can be completed immediately. */
90
90
  accessToken?:
91
91
  | string
92
92
  | undefined;
93
- /** / Refresh token issued when Telegram login can be completed immediately. */
93
+ /** Refresh token issued when Telegram login can be completed immediately. */
94
94
  refreshToken?: string | undefined;
95
95
  }
96
96
 
97
- /** / Request to complete Telegram login by providing additional data. */
97
+ /** Request to complete Telegram login by providing additional data. */
98
98
  export interface TelegramCompleteRequest {
99
- /** / Telegram session identifier obtained from the bot deep link. */
99
+ /** Telegram session identifier obtained from the bot deep link. */
100
100
  sessionId: string;
101
- /** / Phone number to bind to the Telegram session (recommended E.164 format). */
101
+ /** Phone number to bind to the Telegram session (recommended E.164 format). */
102
102
  phone: string;
103
103
  }
104
104
 
105
- /** / Telegram completion response. */
105
+ /** Telegram completion response. */
106
106
  export interface TelegramCompleteResponse {
107
- /** / Session identifier that can be consumed to exchange for tokens. */
107
+ /** Session identifier that can be consumed to exchange for tokens. */
108
108
  sessionId: string;
109
109
  }
110
110
 
111
- /** / Request to exchange a completed Telegram session for tokens. */
111
+ /** Request to exchange a completed Telegram session for tokens. */
112
112
  export interface TelegramConsumeRequest {
113
- /** / Session identifier from TelegramCompleteResponse. */
113
+ /** Session identifier from TelegramCompleteResponse. */
114
114
  sessionId: string;
115
115
  }
116
116
 
117
- /** / Token pair returned after consuming a Telegram session. */
117
+ /** Token pair returned after consuming a Telegram session. */
118
118
  export interface TelegramConsumeResponse {
119
- /** / Access token. */
119
+ /** Access token. */
120
120
  accessToken: string;
121
- /** / Refresh token. */
121
+ /** Refresh token. */
122
122
  refreshToken: string;
123
123
  }
124
124
 
@@ -126,41 +126,41 @@ export const AUTH_V1_PACKAGE_NAME = "auth.v1";
126
126
 
127
127
  export interface AuthServiceClient {
128
128
  /**
129
- * / Sends a one-time password (OTP) to the specified identifier (email/phone).
130
- * / The identifier format and delivery channel are defined by `type`.
129
+ * Sends a one-time password (OTP) to the specified identifier (email/phone).
130
+ * The identifier format and delivery channel are defined by `type`.
131
131
  */
132
132
 
133
133
  sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
134
134
 
135
135
  /**
136
- * / Verifies the OTP provided by the user.
137
- * / On success returns a new access/refresh token pair.
136
+ * Verifies the OTP provided by the user.
137
+ * On success returns a new access/refresh token pair.
138
138
  */
139
139
 
140
140
  verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
141
141
 
142
- /** / Exchanges a valid refresh token for a new access/refresh token pair. */
142
+ /** Exchanges a valid refresh token for a new access/refresh token pair. */
143
143
 
144
144
  refresh(request: RefreshRequest): Observable<RefreshResponse>;
145
145
 
146
- /** / Initializes Telegram login flow and returns a Telegram authorization URL. */
146
+ /** Initializes Telegram login flow and returns a Telegram authorization URL. */
147
147
 
148
148
  telegramInit(request: Empty): Observable<TelegramInitResponse>;
149
149
 
150
150
  /**
151
- * / Verifies Telegram login payload (signature + auth_date) and starts/continues the flow.
152
- * / Depending on the user state, may return tokens immediately or a bot deep link to complete signup.
151
+ * Verifies Telegram login payload (signature + auth_date) and starts/continues the flow.
152
+ * Depending on the user state, may return tokens immediately or a bot deep link to complete signup.
153
153
  */
154
154
 
155
155
  telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
156
156
 
157
- /** / Completes Telegram login flow by binding a phone number to the Telegram session. */
157
+ /** Completes Telegram login flow by binding a phone number to the Telegram session. */
158
158
 
159
159
  telegramComplete(request: TelegramCompleteRequest): Observable<TelegramCompleteResponse>;
160
160
 
161
161
  /**
162
- * / Consumes a completed Telegram session and returns access/refresh tokens.
163
- * / Intended to be called once per session_id.
162
+ * Consumes a completed Telegram session and returns access/refresh tokens.
163
+ * Intended to be called once per session_id.
164
164
  */
165
165
 
166
166
  telegramConsume(request: TelegramConsumeRequest): Observable<TelegramConsumeResponse>;
@@ -168,45 +168,45 @@ export interface AuthServiceClient {
168
168
 
169
169
  export interface AuthServiceController {
170
170
  /**
171
- * / Sends a one-time password (OTP) to the specified identifier (email/phone).
172
- * / The identifier format and delivery channel are defined by `type`.
171
+ * Sends a one-time password (OTP) to the specified identifier (email/phone).
172
+ * The identifier format and delivery channel are defined by `type`.
173
173
  */
174
174
 
175
175
  sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
176
176
 
177
177
  /**
178
- * / Verifies the OTP provided by the user.
179
- * / On success returns a new access/refresh token pair.
178
+ * Verifies the OTP provided by the user.
179
+ * On success returns a new access/refresh token pair.
180
180
  */
181
181
 
182
182
  verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
183
183
 
184
- /** / Exchanges a valid refresh token for a new access/refresh token pair. */
184
+ /** Exchanges a valid refresh token for a new access/refresh token pair. */
185
185
 
186
186
  refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
187
187
 
188
- /** / Initializes Telegram login flow and returns a Telegram authorization URL. */
188
+ /** Initializes Telegram login flow and returns a Telegram authorization URL. */
189
189
 
190
190
  telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
191
191
 
192
192
  /**
193
- * / Verifies Telegram login payload (signature + auth_date) and starts/continues the flow.
194
- * / Depending on the user state, may return tokens immediately or a bot deep link to complete signup.
193
+ * Verifies Telegram login payload (signature + auth_date) and starts/continues the flow.
194
+ * Depending on the user state, may return tokens immediately or a bot deep link to complete signup.
195
195
  */
196
196
 
197
197
  telegramVerify(
198
198
  request: TelegramVerifyRequest,
199
199
  ): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
200
200
 
201
- /** / Completes Telegram login flow by binding a phone number to the Telegram session. */
201
+ /** Completes Telegram login flow by binding a phone number to the Telegram session. */
202
202
 
203
203
  telegramComplete(
204
204
  request: TelegramCompleteRequest,
205
205
  ): Promise<TelegramCompleteResponse> | Observable<TelegramCompleteResponse> | TelegramCompleteResponse;
206
206
 
207
207
  /**
208
- * / Consumes a completed Telegram session and returns access/refresh tokens.
209
- * / Intended to be called once per session_id.
208
+ * Consumes a completed Telegram session and returns access/refresh tokens.
209
+ * Intended to be called once per session_id.
210
210
  */
211
211
 
212
212
  telegramConsume(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumina-cinema/contracts",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "description": "Protobuf definitions and generated Typescript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/auth.proto CHANGED
@@ -5,137 +5,137 @@ package auth.v1;
5
5
  import "google/protobuf/empty.proto";
6
6
 
7
7
  service AuthService {
8
- /// Sends a one-time password (OTP) to the specified identifier (email/phone).
9
- /// The identifier format and delivery channel are defined by `type`.
8
+ // Sends a one-time password (OTP) to the specified identifier (email/phone).
9
+ // The identifier format and delivery channel are defined by `type`.
10
10
  rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
11
11
 
12
- /// Verifies the OTP provided by the user.
13
- /// On success returns a new access/refresh token pair.
12
+ // Verifies the OTP provided by the user.
13
+ // On success returns a new access/refresh token pair.
14
14
  rpc VerifyOtp(VerifyOtpRequest) returns (VerifyOtpResponse);
15
15
 
16
- /// Exchanges a valid refresh token for a new access/refresh token pair.
16
+ // Exchanges a valid refresh token for a new access/refresh token pair.
17
17
  rpc Refresh(RefreshRequest) returns (RefreshResponse);
18
18
 
19
- /// Initializes Telegram login flow and returns a Telegram authorization URL.
19
+ // Initializes Telegram login flow and returns a Telegram authorization URL.
20
20
  rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
21
21
 
22
- /// Verifies Telegram login payload (signature + auth_date) and starts/continues the flow.
23
- /// Depending on the user state, may return tokens immediately or a bot deep link to complete signup.
22
+ // Verifies Telegram login payload (signature + auth_date) and starts/continues the flow.
23
+ // Depending on the user state, may return tokens immediately or a bot deep link to complete signup.
24
24
  rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
25
25
 
26
- /// Completes Telegram login flow by binding a phone number to the Telegram session.
26
+ // Completes Telegram login flow by binding a phone number to the Telegram session.
27
27
  rpc TelegramComplete (TelegramCompleteRequest) returns (TelegramCompleteResponse);
28
28
 
29
- /// Consumes a completed Telegram session and returns access/refresh tokens.
30
- /// Intended to be called once per session_id.
29
+ // Consumes a completed Telegram session and returns access/refresh tokens.
30
+ // Intended to be called once per session_id.
31
31
  rpc TelegramConsume (TelegramConsumeRequest) returns (TelegramConsumeResponse);
32
32
  }
33
33
 
34
- /// Request to send an OTP to an identifier (email/phone).
34
+ // Request to send an OTP to an identifier (email/phone).
35
35
  message SendOtpRequest {
36
- /// Target identifier to deliver OTP to (e.g. "+31612345678" or "user@example.com").
36
+ // Target identifier to deliver OTP to (e.g. "+31612345678" or "user@example.com").
37
37
  string identifier = 1;
38
38
 
39
- /// Identifier/delivery type. Recommended values: "phone" or "email".
39
+ // Identifier/delivery type. Recommended values: "phone" or "email".
40
40
  string type = 2;
41
41
  }
42
42
 
43
- /// Send OTP result.
43
+ // Send OTP result.
44
44
  message SendOtpResponse {
45
- /// True if the OTP was accepted for delivery (does not necessarily guarantee delivery).
45
+ // True if the OTP was accepted for delivery (does not necessarily guarantee delivery).
46
46
  bool ok = 1;
47
47
  }
48
48
 
49
- /// Request to verify an OTP for an identifier.
49
+ // Request to verify an OTP for an identifier.
50
50
  message VerifyOtpRequest {
51
- /// Identifier that received the OTP (must match the identifier used in SendOtp).
51
+ // Identifier that received the OTP (must match the identifier used in SendOtp).
52
52
  string identifier = 1;
53
53
 
54
- /// Identifier type used for delivery. Recommended values: "phone" or "email".
54
+ // Identifier type used for delivery. Recommended values: "phone" or "email".
55
55
  string type = 2;
56
56
 
57
- /// OTP code entered by the user.
57
+ // OTP code entered by the user.
58
58
  string code = 3;
59
59
  }
60
60
 
61
- /// Successful OTP verification response.
61
+ // Successful OTP verification response.
62
62
  message VerifyOtpResponse {
63
- /// Short-lived access token.
63
+ // Short-lived access token.
64
64
  string access_token = 1;
65
65
 
66
- /// Long-lived refresh token used to obtain new access tokens.
66
+ // Long-lived refresh token used to obtain new access tokens.
67
67
  string refresh_token = 2;
68
68
  }
69
69
 
70
- /// Request to refresh tokens.
70
+ // Request to refresh tokens.
71
71
  message RefreshRequest {
72
- /// Refresh token previously issued by the service.
72
+ // Refresh token previously issued by the service.
73
73
  string refresh_token = 1;
74
74
  }
75
75
 
76
- /// Response containing a new token pair.
76
+ // Response containing a new token pair.
77
77
  message RefreshResponse {
78
- /// New access token.
78
+ // New access token.
79
79
  string access_token = 1;
80
80
 
81
- /// New refresh token (may be rotated on each refresh).
81
+ // New refresh token (may be rotated on each refresh).
82
82
  string refresh_token = 2;
83
83
  }
84
84
 
85
- /// Telegram initialization response.
85
+ // Telegram initialization response.
86
86
  message TelegramInitResponse {
87
- /// Telegram OAuth authorization URL to open in the client.
87
+ // Telegram OAuth authorization URL to open in the client.
88
88
  string url = 1;
89
89
  }
90
90
 
91
- /// Telegram verification request.
91
+ // Telegram verification request.
92
92
  message TelegramVerifyRequest {
93
- /// Raw query parameters returned by Telegram (must include `hash` and `auth_date`).
94
- /// The service validates signature and freshness.
93
+ // Raw query parameters returned by Telegram (must include `hash` and `auth_date`).
94
+ // The service validates signature and freshness.
95
95
  map<string, string> query = 1;
96
96
  }
97
97
 
98
- /// Telegram verification result.
99
- /// The response depends on whether the account is fully linked.
98
+ // Telegram verification result.
99
+ // The response depends on whether the account is fully linked.
100
100
  message TelegramVerifyResponse {
101
101
  oneof result {
102
- /// Bot deep link to continue/complete the flow (e.g. provide phone, confirm consent).
102
+ // Bot deep link to continue/complete the flow (e.g. provide phone, confirm consent).
103
103
  string url = 1;
104
104
 
105
- /// Access token issued when Telegram login can be completed immediately.
105
+ // Access token issued when Telegram login can be completed immediately.
106
106
  string access_token = 2;
107
107
 
108
- /// Refresh token issued when Telegram login can be completed immediately.
108
+ // Refresh token issued when Telegram login can be completed immediately.
109
109
  string refresh_token = 3;
110
110
  }
111
111
  }
112
112
 
113
- /// Request to complete Telegram login by providing additional data.
113
+ // Request to complete Telegram login by providing additional data.
114
114
  message TelegramCompleteRequest {
115
- /// Telegram session identifier obtained from the bot deep link.
115
+ // Telegram session identifier obtained from the bot deep link.
116
116
  string session_id = 1;
117
117
 
118
- /// Phone number to bind to the Telegram session (recommended E.164 format).
118
+ // Phone number to bind to the Telegram session (recommended E.164 format).
119
119
  string phone = 2;
120
120
  }
121
121
 
122
- /// Telegram completion response.
122
+ // Telegram completion response.
123
123
  message TelegramCompleteResponse {
124
- /// Session identifier that can be consumed to exchange for tokens.
124
+ // Session identifier that can be consumed to exchange for tokens.
125
125
  string session_id = 1;
126
126
  }
127
127
 
128
- /// Request to exchange a completed Telegram session for tokens.
128
+ // Request to exchange a completed Telegram session for tokens.
129
129
  message TelegramConsumeRequest {
130
- /// Session identifier from TelegramCompleteResponse.
130
+ // Session identifier from TelegramCompleteResponse.
131
131
  string session_id = 1;
132
132
  }
133
133
 
134
- /// Token pair returned after consuming a Telegram session.
134
+ // Token pair returned after consuming a Telegram session.
135
135
  message TelegramConsumeResponse {
136
- /// Access token.
136
+ // Access token.
137
137
  string access_token = 1;
138
138
 
139
- /// Refresh token.
139
+ // Refresh token.
140
140
  string refresh_token = 2;
141
141
  }