@barupost/contracts 0.0.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.
Files changed (56) hide show
  1. package/dist/events/account/email-changed.interface.d.ts +4 -0
  2. package/dist/events/account/email-changed.interface.js +2 -0
  3. package/dist/events/account/index.d.ts +2 -0
  4. package/dist/events/account/index.js +18 -0
  5. package/dist/events/account/phone-changed.interface.d.ts +4 -0
  6. package/dist/events/account/phone-changed.interface.js +2 -0
  7. package/dist/events/auth/index.d.ts +1 -0
  8. package/dist/events/auth/index.js +17 -0
  9. package/dist/events/auth/otp-requested.interface.d.ts +5 -0
  10. package/dist/events/auth/otp-requested.interface.js +2 -0
  11. package/dist/events/index.d.ts +2 -0
  12. package/dist/events/index.js +18 -0
  13. package/dist/generated/account.d.ts +70 -0
  14. package/dist/generated/account.js +45 -0
  15. package/dist/generated/auth.d.ts +83 -0
  16. package/dist/generated/auth.js +34 -0
  17. package/dist/generated/google/protobuf/empty.d.ts +13 -0
  18. package/dist/generated/google/protobuf/empty.js +11 -0
  19. package/dist/generated/google/protobuf/timestamp.d.ts +109 -0
  20. package/dist/generated/google/protobuf/timestamp.js +11 -0
  21. package/dist/generated/index.d.ts +6 -0
  22. package/dist/generated/index.js +22 -0
  23. package/dist/generated/media.d.ts +124 -0
  24. package/dist/generated/media.js +35 -0
  25. package/dist/generated/posts.d.ts +259 -0
  26. package/dist/generated/posts.js +57 -0
  27. package/dist/generated/session.d.ts +56 -0
  28. package/dist/generated/session.js +32 -0
  29. package/dist/generated/users.d.ts +87 -0
  30. package/dist/generated/users.js +40 -0
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.js +19 -0
  33. package/dist/proto/index.d.ts +1 -0
  34. package/dist/proto/index.js +17 -0
  35. package/dist/proto/paths.d.ts +8 -0
  36. package/dist/proto/paths.js +12 -0
  37. package/gen/go/.gitkeep +0 -0
  38. package/gen/go/media/media.pb.go +1545 -0
  39. package/gen/go/media/media_grpc.pb.go +342 -0
  40. package/gen/ts/.gitkeep +0 -0
  41. package/gen/ts/account.ts +133 -0
  42. package/gen/ts/auth.ts +135 -0
  43. package/gen/ts/google/protobuf/empty.ts +23 -0
  44. package/gen/ts/google/protobuf/struct.ts +197 -0
  45. package/gen/ts/google/protobuf/timestamp.ts +119 -0
  46. package/gen/ts/media.ts +205 -0
  47. package/gen/ts/posts.ts +417 -0
  48. package/gen/ts/session.ts +110 -0
  49. package/gen/ts/users.ts +140 -0
  50. package/package.json +28 -0
  51. package/proto/account.proto +75 -0
  52. package/proto/auth.proto +91 -0
  53. package/proto/media.proto +120 -0
  54. package/proto/posts.proto +270 -0
  55. package/proto/session.proto +61 -0
  56. package/proto/users.proto +105 -0
@@ -0,0 +1,4 @@
1
+ export interface EmailChangedEvent {
2
+ email: string;
3
+ code: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './email-changed.interface';
2
+ export * from './phone-changed.interface';
@@ -0,0 +1,18 @@
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("./email-changed.interface"), exports);
18
+ __exportStar(require("./phone-changed.interface"), exports);
@@ -0,0 +1,4 @@
1
+ export interface PhoneChangedEvent {
2
+ phone: string;
3
+ code: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,2 @@
1
+ export * from "./account";
2
+ export * from "./auth";
@@ -0,0 +1,18 @@
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("./account"), exports);
18
+ __exportStar(require("./auth"), exports);
@@ -0,0 +1,70 @@
1
+ import { Observable } from "rxjs";
2
+ export declare enum Role {
3
+ GUEST = 0,
4
+ USER = 1,
5
+ PREMIUM = 2,
6
+ EDITOR = 3,
7
+ SUPPORT = 4,
8
+ MODERATOR = 5,
9
+ ADMIN = 6,
10
+ SUPERADMIN = 7,
11
+ UNRECOGNIZED = -1
12
+ }
13
+ export interface GetAccountRequest {
14
+ id: string;
15
+ }
16
+ export interface GetAccountResponse {
17
+ id: string;
18
+ phone: string;
19
+ email: string;
20
+ isPhoneVerified: boolean;
21
+ isEmailVerified: boolean;
22
+ role: Role;
23
+ }
24
+ export interface InitEmailChangeRequest {
25
+ email: string;
26
+ userId: string;
27
+ }
28
+ export interface InitEmailChangeResponse {
29
+ ok: boolean;
30
+ }
31
+ export interface ConfirmEmailChangeRequest {
32
+ email: string;
33
+ code: string;
34
+ userId: string;
35
+ }
36
+ export interface ConfirmEmailChangeResponse {
37
+ ok: boolean;
38
+ }
39
+ export interface InitPhoneChangeRequest {
40
+ phone: string;
41
+ userId: string;
42
+ }
43
+ export interface InitPhoneChangeResponse {
44
+ ok: boolean;
45
+ }
46
+ export interface ConfirmPhoneChangeRequest {
47
+ phone: string;
48
+ code: string;
49
+ userId: string;
50
+ }
51
+ export interface ConfirmPhoneChangeResponse {
52
+ ok: boolean;
53
+ }
54
+ export declare const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
55
+ export interface AccountServiceClient {
56
+ getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
57
+ initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
58
+ confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
59
+ initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
60
+ confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
61
+ }
62
+ export interface AccountServiceController {
63
+ getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
64
+ initEmailChange(request: InitEmailChangeRequest): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
65
+ confirmEmailChange(request: ConfirmEmailChangeRequest): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
66
+ initPhoneChange(request: InitPhoneChangeRequest): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
67
+ confirmPhoneChange(request: ConfirmPhoneChangeRequest): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
68
+ }
69
+ export declare function AccountServiceControllerMethods(): (constructor: Function) => void;
70
+ export declare const ACCOUNT_SERVICE_NAME = "AccountService";
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.2
5
+ // protoc v6.33.2
6
+ // source: account.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ACCOUNT_SERVICE_NAME = exports.ACCOUNT_V1_PACKAGE_NAME = exports.Role = void 0;
9
+ exports.AccountServiceControllerMethods = AccountServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ var Role;
13
+ (function (Role) {
14
+ Role[Role["GUEST"] = 0] = "GUEST";
15
+ Role[Role["USER"] = 1] = "USER";
16
+ Role[Role["PREMIUM"] = 2] = "PREMIUM";
17
+ Role[Role["EDITOR"] = 3] = "EDITOR";
18
+ Role[Role["SUPPORT"] = 4] = "SUPPORT";
19
+ Role[Role["MODERATOR"] = 5] = "MODERATOR";
20
+ Role[Role["ADMIN"] = 6] = "ADMIN";
21
+ Role[Role["SUPERADMIN"] = 7] = "SUPERADMIN";
22
+ Role[Role["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
23
+ })(Role || (exports.Role = Role = {}));
24
+ exports.ACCOUNT_V1_PACKAGE_NAME = "account.v1";
25
+ function AccountServiceControllerMethods() {
26
+ return function (constructor) {
27
+ const grpcMethods = [
28
+ "getAccount",
29
+ "initEmailChange",
30
+ "confirmEmailChange",
31
+ "initPhoneChange",
32
+ "confirmPhoneChange",
33
+ ];
34
+ for (const method of grpcMethods) {
35
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
36
+ (0, microservices_1.GrpcMethod)("AccountService", method)(constructor.prototype[method], method, descriptor);
37
+ }
38
+ const grpcStreamMethods = [];
39
+ for (const method of grpcStreamMethods) {
40
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
41
+ (0, microservices_1.GrpcStreamMethod)("AccountService", method)(constructor.prototype[method], method, descriptor);
42
+ }
43
+ };
44
+ }
45
+ exports.ACCOUNT_SERVICE_NAME = "AccountService";
@@ -0,0 +1,83 @@
1
+ import { Observable } from "rxjs";
2
+ import { Empty } from "./google/protobuf/empty";
3
+ export interface SendOtpRequest {
4
+ identifier: string;
5
+ type: string;
6
+ }
7
+ export interface SendOtpResponse {
8
+ ok: boolean;
9
+ }
10
+ export interface VerifyOtpRequest {
11
+ identifier: string;
12
+ type: string;
13
+ code: string;
14
+ sessionMetadata: SessionMetadata | undefined;
15
+ }
16
+ export interface VerifyOtpResponse {
17
+ accessToken: string;
18
+ refreshToken: string;
19
+ sessionToken: string;
20
+ }
21
+ export interface RefreshRequest {
22
+ refreshToken: string;
23
+ sessionToken: string;
24
+ }
25
+ export interface RefreshResponse {
26
+ accessToken: string;
27
+ refreshToken: string;
28
+ }
29
+ export interface LogoutRequest {
30
+ sessionToken: string;
31
+ }
32
+ export interface LogoutResponse {
33
+ ok: boolean;
34
+ }
35
+ export interface VkInitResponse {
36
+ url: string;
37
+ }
38
+ export interface VkVerifyRequest {
39
+ code: string;
40
+ state: string;
41
+ deviceId: string;
42
+ metadata: SessionMetadata | undefined;
43
+ }
44
+ export interface VkVerifyResponse {
45
+ accessToken: string;
46
+ refreshToken: string;
47
+ sessionToken: string;
48
+ }
49
+ export interface SessionMetadata {
50
+ location: LocationInfo | undefined;
51
+ device: DeviceInfo | undefined;
52
+ ip: string;
53
+ }
54
+ export interface LocationInfo {
55
+ country: string;
56
+ city: string;
57
+ latidute: number;
58
+ longitude: number;
59
+ }
60
+ export interface DeviceInfo {
61
+ browser: string;
62
+ os: string;
63
+ type: string;
64
+ }
65
+ export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
66
+ export interface AuthServiceClient {
67
+ sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
68
+ verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
69
+ refresh(request: RefreshRequest): Observable<RefreshResponse>;
70
+ logout(request: LogoutRequest): Observable<LogoutResponse>;
71
+ vkInit(request: Empty): Observable<VkInitResponse>;
72
+ vkVerify(request: VkVerifyRequest): Observable<VkVerifyResponse>;
73
+ }
74
+ export interface AuthServiceController {
75
+ sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
76
+ verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
77
+ refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
78
+ logout(request: LogoutRequest): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
79
+ vkInit(request: Empty): Promise<VkInitResponse> | Observable<VkInitResponse> | VkInitResponse;
80
+ vkVerify(request: VkVerifyRequest): Promise<VkVerifyResponse> | Observable<VkVerifyResponse> | VkVerifyResponse;
81
+ }
82
+ export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
83
+ export declare const AUTH_SERVICE_NAME = "AuthService";
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.2
5
+ // protoc v6.33.2
6
+ // source: auth.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.AUTH_SERVICE_NAME = exports.AUTH_V1_PACKAGE_NAME = void 0;
9
+ exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
13
+ function AuthServiceControllerMethods() {
14
+ return function (constructor) {
15
+ const grpcMethods = [
16
+ "sendOtp",
17
+ "verifyOtp",
18
+ "refresh",
19
+ "logout",
20
+ "vkInit",
21
+ "vkVerify",
22
+ ];
23
+ for (const method of grpcMethods) {
24
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
25
+ (0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
26
+ }
27
+ const grpcStreamMethods = [];
28
+ for (const method of grpcStreamMethods) {
29
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
30
+ (0, microservices_1.GrpcStreamMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
31
+ }
32
+ };
33
+ }
34
+ exports.AUTH_SERVICE_NAME = "AuthService";
@@ -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 v2.11.0
5
+ // protoc v6.33.2
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";
@@ -0,0 +1,109 @@
1
+ export declare const protobufPackage = "google.protobuf";
2
+ /**
3
+ * A Timestamp represents a point in time independent of any time zone or local
4
+ * calendar, encoded as a count of seconds and fractions of seconds at
5
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
6
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
7
+ * Gregorian calendar backwards to year one.
8
+ *
9
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
10
+ * second table is needed for interpretation, using a [24-hour linear
11
+ * smear](https://developers.google.com/time/smear).
12
+ *
13
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
14
+ * restricting to that range, we ensure that we can convert to and from [RFC
15
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
16
+ *
17
+ * # Examples
18
+ *
19
+ * Example 1: Compute Timestamp from POSIX `time()`.
20
+ *
21
+ * Timestamp timestamp;
22
+ * timestamp.set_seconds(time(NULL));
23
+ * timestamp.set_nanos(0);
24
+ *
25
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
26
+ *
27
+ * struct timeval tv;
28
+ * gettimeofday(&tv, NULL);
29
+ *
30
+ * Timestamp timestamp;
31
+ * timestamp.set_seconds(tv.tv_sec);
32
+ * timestamp.set_nanos(tv.tv_usec * 1000);
33
+ *
34
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
35
+ *
36
+ * FILETIME ft;
37
+ * GetSystemTimeAsFileTime(&ft);
38
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
39
+ *
40
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
41
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
42
+ * Timestamp timestamp;
43
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
44
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
45
+ *
46
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
47
+ *
48
+ * long millis = System.currentTimeMillis();
49
+ *
50
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
51
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
52
+ *
53
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
54
+ *
55
+ * Instant now = Instant.now();
56
+ *
57
+ * Timestamp timestamp =
58
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
59
+ * .setNanos(now.getNano()).build();
60
+ *
61
+ * Example 6: Compute Timestamp from current time in Python.
62
+ *
63
+ * timestamp = Timestamp()
64
+ * timestamp.GetCurrentTime()
65
+ *
66
+ * # JSON Mapping
67
+ *
68
+ * In JSON format, the Timestamp type is encoded as a string in the
69
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
70
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
71
+ * where {year} is always expressed using four digits while {month}, {day},
72
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
73
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
74
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
75
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
76
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
77
+ * able to accept both UTC and other timezones (as indicated by an offset).
78
+ *
79
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
80
+ * 01:30 UTC on January 15, 2017.
81
+ *
82
+ * In JavaScript, one can convert a Date object to this format using the
83
+ * standard
84
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
85
+ * method. In Python, a standard `datetime.datetime` object can be converted
86
+ * to this format using
87
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
88
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
89
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
90
+ * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
91
+ * ) to obtain a formatter capable of generating timestamps in this format.
92
+ */
93
+ export interface Timestamp {
94
+ /**
95
+ * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
96
+ * be between -315576000000 and 315576000000 inclusive (which corresponds to
97
+ * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
98
+ */
99
+ seconds: number;
100
+ /**
101
+ * Non-negative fractions of a second at nanosecond resolution. This field is
102
+ * the nanosecond portion of the duration, not an alternative to seconds.
103
+ * Negative second values with fractions must still have non-negative nanos
104
+ * values that count forward in time. Must be between 0 and 999,999,999
105
+ * inclusive.
106
+ */
107
+ nanos: number;
108
+ }
109
+ 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 v2.11.0
5
+ // protoc v6.33.2
6
+ // source: google/protobuf/timestamp.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";
@@ -0,0 +1,6 @@
1
+ export * from "./account";
2
+ export * from "./auth";
3
+ export * from "./media";
4
+ export * from "./posts";
5
+ export * from "./session";
6
+ export * from "./users";
@@ -0,0 +1,22 @@
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("./account"), exports);
18
+ __exportStar(require("./auth"), exports);
19
+ __exportStar(require("./media"), exports);
20
+ __exportStar(require("./posts"), exports);
21
+ __exportStar(require("./session"), exports);
22
+ __exportStar(require("./users"), exports);
@@ -0,0 +1,124 @@
1
+ import { Observable } from "rxjs";
2
+ export interface UploadRequest {
3
+ fileName: string;
4
+ folder: string;
5
+ contentType: string;
6
+ data: Uint8Array;
7
+ resizeWidth?: number | undefined;
8
+ resizeHeight?: number | undefined;
9
+ watermark?: boolean | undefined;
10
+ }
11
+ export interface UploadResponse {
12
+ key: string;
13
+ }
14
+ export interface GetRequest {
15
+ key: string;
16
+ }
17
+ export interface GetResponse {
18
+ data: Uint8Array;
19
+ contentType: string;
20
+ }
21
+ export interface DeleteRequest {
22
+ key: string;
23
+ }
24
+ export interface DeleteResponse {
25
+ ok: boolean;
26
+ }
27
+ /** === Presigned Urls === */
28
+ export interface GetPresignedUrlsRequest {
29
+ files: FileUploadInfo[];
30
+ }
31
+ export interface FileUploadInfo {
32
+ fileName: string;
33
+ folder: string;
34
+ contentType: string;
35
+ /** Размер файла в байтах */
36
+ size: number;
37
+ }
38
+ export interface GetPresignedUrlsResponse {
39
+ urls: PresignedUrlInfo[];
40
+ }
41
+ export interface PresignedUrlInfo {
42
+ /** Идентификатор файла (file0, file1, ...) */
43
+ field: string;
44
+ /** Presigned Url для загрузки */
45
+ url: string;
46
+ /** HTTP метод (PUT) */
47
+ method: string;
48
+ /** Максимальный размер в байтах */
49
+ sizeLimit: number;
50
+ /** Content-Type для загрузки */
51
+ contentType: string;
52
+ }
53
+ /** === Multipart Upload === */
54
+ export interface CreateMultipartUploadRequest {
55
+ fileName: string;
56
+ folder: string;
57
+ contentType: string;
58
+ }
59
+ export interface CreateMultipartUploadResponse {
60
+ uploadId: string;
61
+ /** S3 key для файла */
62
+ key: string;
63
+ }
64
+ export interface GetPresignedPartUrlsRequest {
65
+ uploadId: string;
66
+ key: string;
67
+ /** Количество частей */
68
+ partCount: number;
69
+ contentType: string;
70
+ }
71
+ export interface GetPresignedPartUrlsResponse {
72
+ parts: PresignedPartUrl[];
73
+ }
74
+ export interface PresignedPartUrl {
75
+ /** Номер части (начинается с 1) */
76
+ partNumber: number;
77
+ /** Presigned Url для загрузки части */
78
+ url: string;
79
+ /** HTTP метод (PUT) */
80
+ method: string;
81
+ }
82
+ export interface CompleteMultipartUploadRequest {
83
+ uploadId: string;
84
+ key: string;
85
+ /** Список загруженных частей с ETag */
86
+ parts: CompletedPart[];
87
+ }
88
+ export interface CompletedPart {
89
+ partNumber: number;
90
+ /** ETag полученный после загрузки части */
91
+ etag: string;
92
+ }
93
+ export interface CompleteMultipartUploadResponse {
94
+ ok: boolean;
95
+ /** Финальный S3 key */
96
+ key: string;
97
+ /** Публичный Url файла */
98
+ url: string;
99
+ }
100
+ export declare const MEDIA_V1_PACKAGE_NAME = "media.v1";
101
+ export interface MediaServiceClient {
102
+ /** Существующие методы */
103
+ upload(request: UploadRequest): Observable<UploadResponse>;
104
+ get(request: GetRequest): Observable<GetResponse>;
105
+ delete(request: DeleteRequest): Observable<DeleteResponse>;
106
+ /** Новые методы для presigned Urls */
107
+ getPresignedUrls(request: GetPresignedUrlsRequest): Observable<GetPresignedUrlsResponse>;
108
+ createMultipartUpload(request: CreateMultipartUploadRequest): Observable<CreateMultipartUploadResponse>;
109
+ getPresignedPartUrls(request: GetPresignedPartUrlsRequest): Observable<GetPresignedPartUrlsResponse>;
110
+ completeMultipartUpload(request: CompleteMultipartUploadRequest): Observable<CompleteMultipartUploadResponse>;
111
+ }
112
+ export interface MediaServiceController {
113
+ /** Существующие методы */
114
+ upload(request: UploadRequest): Promise<UploadResponse> | Observable<UploadResponse> | UploadResponse;
115
+ get(request: GetRequest): Promise<GetResponse> | Observable<GetResponse> | GetResponse;
116
+ delete(request: DeleteRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
117
+ /** Новые методы для presigned Urls */
118
+ getPresignedUrls(request: GetPresignedUrlsRequest): Promise<GetPresignedUrlsResponse> | Observable<GetPresignedUrlsResponse> | GetPresignedUrlsResponse;
119
+ createMultipartUpload(request: CreateMultipartUploadRequest): Promise<CreateMultipartUploadResponse> | Observable<CreateMultipartUploadResponse> | CreateMultipartUploadResponse;
120
+ getPresignedPartUrls(request: GetPresignedPartUrlsRequest): Promise<GetPresignedPartUrlsResponse> | Observable<GetPresignedPartUrlsResponse> | GetPresignedPartUrlsResponse;
121
+ completeMultipartUpload(request: CompleteMultipartUploadRequest): Promise<CompleteMultipartUploadResponse> | Observable<CompleteMultipartUploadResponse> | CompleteMultipartUploadResponse;
122
+ }
123
+ export declare function MediaServiceControllerMethods(): (constructor: Function) => void;
124
+ export declare const MEDIA_SERVICE_NAME = "MediaService";