jr-common-micro 1.1.93 → 1.1.94
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.
- package/dist/proto/micro/v1/index.d.ts +1 -0
- package/dist/proto/micro/v1/index.js +2 -1
- package/dist/proto/micro/v1/subscription/index.d.ts +3 -0
- package/dist/proto/micro/v1/subscription/index.js +7 -0
- package/dist/proto/micro/v1/subscription/services_connect.d.ts +56 -0
- package/dist/proto/micro/v1/subscription/services_connect.js +59 -0
- package/dist/proto/micro/v1/subscription/services_nest.d.ts +28 -0
- package/dist/proto/micro/v1/subscription/services_nest.js +31 -0
- package/dist/proto/micro/v1/subscription/subscription_messages_nest.d.ts +75 -0
- package/dist/proto/micro/v1/subscription/subscription_messages_nest.js +5 -0
- package/dist/proto/micro/v1/subscription/subscription_messages_pb.d.ts +163 -0
- package/dist/proto/micro/v1/subscription/subscription_messages_pb.js +358 -0
- package/dist/proto/micro/v1/user/services_connect.d.ts +7 -1
- package/dist/proto/micro/v1/user/services_connect.js +6 -0
- package/dist/proto/micro/v1/user/services_nest.d.ts +3 -1
- package/dist/proto/micro/v1/user/services_nest.js +1 -0
- package/dist/proto/micro/v1/user/user_messages_nest.d.ts +6 -0
- package/dist/proto/micro/v1/user/user_messages_pb.d.ts +14 -0
- package/dist/proto/micro/v1/user/user_messages_pb.js +32 -1
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.js +2 -1
- package/dist/utils/entitlements.d.ts +16 -0
- package/dist/utils/entitlements.js +41 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -1
- package/package.json +1 -1
- package/proto/micro/v1/subscription/services.proto +28 -0
- package/proto/micro/v1/subscription/subscription_messages.proto +112 -0
- package/proto/micro/v1/user/services.proto +2 -0
- package/proto/micro/v1/user/user_messages.proto +11 -0
|
@@ -8,5 +8,6 @@ export * as news from './news';
|
|
|
8
8
|
export * as notification from './notification';
|
|
9
9
|
export * as portfolio from './portfolio';
|
|
10
10
|
export * as puppeteer from './puppeteer';
|
|
11
|
+
export * as subscription from './subscription';
|
|
11
12
|
export * as user from './user';
|
|
12
13
|
export * as voice from './voice';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.voice = exports.user = exports.puppeteer = exports.portfolio = exports.notification = exports.news = exports.media = exports.general_nest = exports.education = exports.data = exports.coin = exports.chat = void 0;
|
|
3
|
+
exports.voice = exports.user = exports.subscription = exports.puppeteer = exports.portfolio = exports.notification = exports.news = exports.media = exports.general_nest = exports.education = exports.data = exports.coin = exports.chat = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
exports.chat = tslib_1.__importStar(require("./chat"));
|
|
6
6
|
exports.coin = tslib_1.__importStar(require("./coin"));
|
|
@@ -12,5 +12,6 @@ exports.news = tslib_1.__importStar(require("./news"));
|
|
|
12
12
|
exports.notification = tslib_1.__importStar(require("./notification"));
|
|
13
13
|
exports.portfolio = tslib_1.__importStar(require("./portfolio"));
|
|
14
14
|
exports.puppeteer = tslib_1.__importStar(require("./puppeteer"));
|
|
15
|
+
exports.subscription = tslib_1.__importStar(require("./subscription"));
|
|
15
16
|
exports.user = tslib_1.__importStar(require("./user"));
|
|
16
17
|
exports.voice = tslib_1.__importStar(require("./voice"));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subscription_messages_nest = exports.services_nest = exports.services_connect = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
exports.services_connect = tslib_1.__importStar(require("./services_connect"));
|
|
6
|
+
exports.services_nest = tslib_1.__importStar(require("./services_nest"));
|
|
7
|
+
exports.subscription_messages_nest = tslib_1.__importStar(require("./subscription_messages_nest"));
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ByIdRequest, EmptyRequest, EmptyResponse } from "../general_pb.js";
|
|
2
|
+
import { EntitlementsByIdsRequest, EntitlementsListResponse, SubscriptionAdminResponse, SubscriptionGrantRequest, SubscriptionMeResponse, SubscriptionRevokeRequest, SubscriptionWebhookRequest } from "./subscription_messages_pb.js";
|
|
3
|
+
import { MethodKind } from "@bufbuild/protobuf";
|
|
4
|
+
export declare const PSubscriptionService: {
|
|
5
|
+
readonly typeName: "micro.v1.subscription.PSubscriptionService";
|
|
6
|
+
readonly methods: {
|
|
7
|
+
readonly me: {
|
|
8
|
+
readonly name: "Me";
|
|
9
|
+
readonly I: typeof EmptyRequest;
|
|
10
|
+
readonly O: typeof SubscriptionMeResponse;
|
|
11
|
+
readonly kind: MethodKind.ServerStreaming;
|
|
12
|
+
};
|
|
13
|
+
readonly sync: {
|
|
14
|
+
readonly name: "Sync";
|
|
15
|
+
readonly I: typeof EmptyRequest;
|
|
16
|
+
readonly O: typeof SubscriptionMeResponse;
|
|
17
|
+
readonly kind: MethodKind.ServerStreaming;
|
|
18
|
+
};
|
|
19
|
+
readonly entitlementsByIds: {
|
|
20
|
+
readonly name: "EntitlementsByIds";
|
|
21
|
+
readonly I: typeof EntitlementsByIdsRequest;
|
|
22
|
+
readonly O: typeof EntitlementsListResponse;
|
|
23
|
+
readonly kind: MethodKind.ServerStreaming;
|
|
24
|
+
};
|
|
25
|
+
readonly webhook: {
|
|
26
|
+
readonly name: "Webhook";
|
|
27
|
+
readonly I: typeof SubscriptionWebhookRequest;
|
|
28
|
+
readonly O: typeof EmptyResponse;
|
|
29
|
+
readonly kind: MethodKind.ServerStreaming;
|
|
30
|
+
};
|
|
31
|
+
readonly adminRead: {
|
|
32
|
+
readonly name: "AdminRead";
|
|
33
|
+
readonly I: typeof ByIdRequest;
|
|
34
|
+
readonly O: typeof SubscriptionAdminResponse;
|
|
35
|
+
readonly kind: MethodKind.ServerStreaming;
|
|
36
|
+
};
|
|
37
|
+
readonly adminGrant: {
|
|
38
|
+
readonly name: "AdminGrant";
|
|
39
|
+
readonly I: typeof SubscriptionGrantRequest;
|
|
40
|
+
readonly O: typeof SubscriptionAdminResponse;
|
|
41
|
+
readonly kind: MethodKind.ServerStreaming;
|
|
42
|
+
};
|
|
43
|
+
readonly adminRevoke: {
|
|
44
|
+
readonly name: "AdminRevoke";
|
|
45
|
+
readonly I: typeof SubscriptionRevokeRequest;
|
|
46
|
+
readonly O: typeof SubscriptionAdminResponse;
|
|
47
|
+
readonly kind: MethodKind.ServerStreaming;
|
|
48
|
+
};
|
|
49
|
+
readonly removeUserData: {
|
|
50
|
+
readonly name: "RemoveUserData";
|
|
51
|
+
readonly I: typeof ByIdRequest;
|
|
52
|
+
readonly O: typeof EmptyResponse;
|
|
53
|
+
readonly kind: MethodKind.ServerStreaming;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PSubscriptionService = void 0;
|
|
4
|
+
const general_pb_js_1 = require("../general_pb.js");
|
|
5
|
+
const subscription_messages_pb_js_1 = require("./subscription_messages_pb.js");
|
|
6
|
+
const protobuf_1 = require("@bufbuild/protobuf");
|
|
7
|
+
exports.PSubscriptionService = {
|
|
8
|
+
typeName: "micro.v1.subscription.PSubscriptionService",
|
|
9
|
+
methods: {
|
|
10
|
+
me: {
|
|
11
|
+
name: "Me",
|
|
12
|
+
I: general_pb_js_1.EmptyRequest,
|
|
13
|
+
O: subscription_messages_pb_js_1.SubscriptionMeResponse,
|
|
14
|
+
kind: protobuf_1.MethodKind.ServerStreaming,
|
|
15
|
+
},
|
|
16
|
+
sync: {
|
|
17
|
+
name: "Sync",
|
|
18
|
+
I: general_pb_js_1.EmptyRequest,
|
|
19
|
+
O: subscription_messages_pb_js_1.SubscriptionMeResponse,
|
|
20
|
+
kind: protobuf_1.MethodKind.ServerStreaming,
|
|
21
|
+
},
|
|
22
|
+
entitlementsByIds: {
|
|
23
|
+
name: "EntitlementsByIds",
|
|
24
|
+
I: subscription_messages_pb_js_1.EntitlementsByIdsRequest,
|
|
25
|
+
O: subscription_messages_pb_js_1.EntitlementsListResponse,
|
|
26
|
+
kind: protobuf_1.MethodKind.ServerStreaming,
|
|
27
|
+
},
|
|
28
|
+
webhook: {
|
|
29
|
+
name: "Webhook",
|
|
30
|
+
I: subscription_messages_pb_js_1.SubscriptionWebhookRequest,
|
|
31
|
+
O: general_pb_js_1.EmptyResponse,
|
|
32
|
+
kind: protobuf_1.MethodKind.ServerStreaming,
|
|
33
|
+
},
|
|
34
|
+
adminRead: {
|
|
35
|
+
name: "AdminRead",
|
|
36
|
+
I: general_pb_js_1.ByIdRequest,
|
|
37
|
+
O: subscription_messages_pb_js_1.SubscriptionAdminResponse,
|
|
38
|
+
kind: protobuf_1.MethodKind.ServerStreaming,
|
|
39
|
+
},
|
|
40
|
+
adminGrant: {
|
|
41
|
+
name: "AdminGrant",
|
|
42
|
+
I: subscription_messages_pb_js_1.SubscriptionGrantRequest,
|
|
43
|
+
O: subscription_messages_pb_js_1.SubscriptionAdminResponse,
|
|
44
|
+
kind: protobuf_1.MethodKind.ServerStreaming,
|
|
45
|
+
},
|
|
46
|
+
adminRevoke: {
|
|
47
|
+
name: "AdminRevoke",
|
|
48
|
+
I: subscription_messages_pb_js_1.SubscriptionRevokeRequest,
|
|
49
|
+
O: subscription_messages_pb_js_1.SubscriptionAdminResponse,
|
|
50
|
+
kind: protobuf_1.MethodKind.ServerStreaming,
|
|
51
|
+
},
|
|
52
|
+
removeUserData: {
|
|
53
|
+
name: "RemoveUserData",
|
|
54
|
+
I: general_pb_js_1.ByIdRequest,
|
|
55
|
+
O: general_pb_js_1.EmptyResponse,
|
|
56
|
+
kind: protobuf_1.MethodKind.ServerStreaming,
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Metadata } from "@grpc/grpc-js";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
import { ByIdRequest, EmptyRequest, EmptyResponse } from "../general_nest";
|
|
4
|
+
import { EntitlementsByIdsRequest, EntitlementsListResponse, SubscriptionAdminResponse, SubscriptionGrantRequest, SubscriptionMeResponse, SubscriptionRevokeRequest, SubscriptionWebhookRequest } from "./subscription_messages_nest";
|
|
5
|
+
export declare const protobufPackage = "micro.v1.subscription";
|
|
6
|
+
export declare const MICRO_V1_SUBSCRIPTION_PACKAGE_NAME = "micro.v1.subscription";
|
|
7
|
+
export interface PSubscriptionServiceClient {
|
|
8
|
+
me(request: EmptyRequest, metadata?: Metadata): Observable<SubscriptionMeResponse>;
|
|
9
|
+
sync(request: EmptyRequest, metadata?: Metadata): Observable<SubscriptionMeResponse>;
|
|
10
|
+
entitlementsByIds(request: EntitlementsByIdsRequest, metadata?: Metadata): Observable<EntitlementsListResponse>;
|
|
11
|
+
webhook(request: SubscriptionWebhookRequest, metadata?: Metadata): Observable<EmptyResponse>;
|
|
12
|
+
adminRead(request: ByIdRequest, metadata?: Metadata): Observable<SubscriptionAdminResponse>;
|
|
13
|
+
adminGrant(request: SubscriptionGrantRequest, metadata?: Metadata): Observable<SubscriptionAdminResponse>;
|
|
14
|
+
adminRevoke(request: SubscriptionRevokeRequest, metadata?: Metadata): Observable<SubscriptionAdminResponse>;
|
|
15
|
+
removeUserData(request: ByIdRequest, metadata?: Metadata): Observable<EmptyResponse>;
|
|
16
|
+
}
|
|
17
|
+
export interface PSubscriptionServiceController {
|
|
18
|
+
me(request: EmptyRequest, metadata?: Metadata): Observable<SubscriptionMeResponse>;
|
|
19
|
+
sync(request: EmptyRequest, metadata?: Metadata): Observable<SubscriptionMeResponse>;
|
|
20
|
+
entitlementsByIds(request: EntitlementsByIdsRequest, metadata?: Metadata): Observable<EntitlementsListResponse>;
|
|
21
|
+
webhook(request: SubscriptionWebhookRequest, metadata?: Metadata): Observable<EmptyResponse>;
|
|
22
|
+
adminRead(request: ByIdRequest, metadata?: Metadata): Observable<SubscriptionAdminResponse>;
|
|
23
|
+
adminGrant(request: SubscriptionGrantRequest, metadata?: Metadata): Observable<SubscriptionAdminResponse>;
|
|
24
|
+
adminRevoke(request: SubscriptionRevokeRequest, metadata?: Metadata): Observable<SubscriptionAdminResponse>;
|
|
25
|
+
removeUserData(request: ByIdRequest, metadata?: Metadata): Observable<EmptyResponse>;
|
|
26
|
+
}
|
|
27
|
+
export declare function PSubscriptionServiceControllerMethods(): (constructor: Function) => void;
|
|
28
|
+
export declare const P_SUBSCRIPTION_SERVICE_NAME = "PSubscriptionService";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.P_SUBSCRIPTION_SERVICE_NAME = exports.MICRO_V1_SUBSCRIPTION_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
4
|
+
exports.PSubscriptionServiceControllerMethods = PSubscriptionServiceControllerMethods;
|
|
5
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
6
|
+
exports.protobufPackage = "micro.v1.subscription";
|
|
7
|
+
exports.MICRO_V1_SUBSCRIPTION_PACKAGE_NAME = "micro.v1.subscription";
|
|
8
|
+
function PSubscriptionServiceControllerMethods() {
|
|
9
|
+
return function (constructor) {
|
|
10
|
+
const grpcMethods = [
|
|
11
|
+
"me",
|
|
12
|
+
"sync",
|
|
13
|
+
"entitlementsByIds",
|
|
14
|
+
"webhook",
|
|
15
|
+
"adminRead",
|
|
16
|
+
"adminGrant",
|
|
17
|
+
"adminRevoke",
|
|
18
|
+
"removeUserData",
|
|
19
|
+
];
|
|
20
|
+
for (const method of grpcMethods) {
|
|
21
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
22
|
+
(0, microservices_1.GrpcMethod)("PSubscriptionService", method)(constructor.prototype[method], method, descriptor);
|
|
23
|
+
}
|
|
24
|
+
const grpcStreamMethods = [];
|
|
25
|
+
for (const method of grpcStreamMethods) {
|
|
26
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
27
|
+
(0, microservices_1.GrpcStreamMethod)("PSubscriptionService", method)(constructor.prototype[method], method, descriptor);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
exports.P_SUBSCRIPTION_SERVICE_NAME = "PSubscriptionService";
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ResponseStatus } from "../general_nest";
|
|
2
|
+
export declare const protobufPackage = "micro.v1.subscription";
|
|
3
|
+
export interface SubscriptionInfo {
|
|
4
|
+
plan: string;
|
|
5
|
+
status: string;
|
|
6
|
+
product_id: string;
|
|
7
|
+
store: string;
|
|
8
|
+
environment: string;
|
|
9
|
+
period_type: string;
|
|
10
|
+
purchased_at: string;
|
|
11
|
+
original_purchase_at: string;
|
|
12
|
+
expires_at: string;
|
|
13
|
+
grace_until: string;
|
|
14
|
+
access_until: string;
|
|
15
|
+
auto_renew: boolean;
|
|
16
|
+
ownership_type: string;
|
|
17
|
+
auto_resume_at: string;
|
|
18
|
+
management_url: string;
|
|
19
|
+
}
|
|
20
|
+
export interface EntitlementInfo {
|
|
21
|
+
key: string;
|
|
22
|
+
expires_at: string;
|
|
23
|
+
plan: string;
|
|
24
|
+
source: string;
|
|
25
|
+
}
|
|
26
|
+
export interface SubscriptionMeResponse {
|
|
27
|
+
status: ResponseStatus | undefined;
|
|
28
|
+
subscription?: SubscriptionInfo | undefined;
|
|
29
|
+
entitlements: EntitlementInfo[];
|
|
30
|
+
synced_at: string;
|
|
31
|
+
}
|
|
32
|
+
export interface EntitlementsByIdsRequest {
|
|
33
|
+
user_ids: string[];
|
|
34
|
+
}
|
|
35
|
+
export interface UserEntitlements {
|
|
36
|
+
user_id: string;
|
|
37
|
+
entitlements: EntitlementInfo[];
|
|
38
|
+
}
|
|
39
|
+
export interface EntitlementsListResponse {
|
|
40
|
+
status: ResponseStatus | undefined;
|
|
41
|
+
data: UserEntitlements[];
|
|
42
|
+
}
|
|
43
|
+
export interface SubscriptionWebhookRequest {
|
|
44
|
+
authorization: string;
|
|
45
|
+
signature: string;
|
|
46
|
+
raw_body: string;
|
|
47
|
+
}
|
|
48
|
+
export interface SubscriptionEventInfo {
|
|
49
|
+
id: string;
|
|
50
|
+
type: string;
|
|
51
|
+
store: string;
|
|
52
|
+
product_id: string;
|
|
53
|
+
environment: string;
|
|
54
|
+
received_at: string;
|
|
55
|
+
processed_at: string;
|
|
56
|
+
error: string;
|
|
57
|
+
}
|
|
58
|
+
export interface SubscriptionAdminResponse {
|
|
59
|
+
status: ResponseStatus | undefined;
|
|
60
|
+
subscriptions: SubscriptionInfo[];
|
|
61
|
+
entitlements: EntitlementInfo[];
|
|
62
|
+
events: SubscriptionEventInfo[];
|
|
63
|
+
synced_at: string;
|
|
64
|
+
}
|
|
65
|
+
export interface SubscriptionGrantRequest {
|
|
66
|
+
user_id: string;
|
|
67
|
+
plan: string;
|
|
68
|
+
duration: string;
|
|
69
|
+
note: string;
|
|
70
|
+
}
|
|
71
|
+
export interface SubscriptionRevokeRequest {
|
|
72
|
+
user_id: string;
|
|
73
|
+
plan: string;
|
|
74
|
+
}
|
|
75
|
+
export declare const MICRO_V1_SUBSCRIPTION_PACKAGE_NAME = "micro.v1.subscription";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MICRO_V1_SUBSCRIPTION_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
4
|
+
exports.protobufPackage = "micro.v1.subscription";
|
|
5
|
+
exports.MICRO_V1_SUBSCRIPTION_PACKAGE_NAME = "micro.v1.subscription";
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
|
|
2
|
+
import { Message, proto3 } from "@bufbuild/protobuf";
|
|
3
|
+
import { ResponseStatus } from "../general_pb.js";
|
|
4
|
+
export declare class SubscriptionInfo extends Message<SubscriptionInfo> {
|
|
5
|
+
plan: string;
|
|
6
|
+
status: string;
|
|
7
|
+
productId: string;
|
|
8
|
+
store: string;
|
|
9
|
+
environment: string;
|
|
10
|
+
periodType: string;
|
|
11
|
+
purchasedAt: string;
|
|
12
|
+
originalPurchaseAt: string;
|
|
13
|
+
expiresAt: string;
|
|
14
|
+
graceUntil: string;
|
|
15
|
+
accessUntil: string;
|
|
16
|
+
autoRenew: boolean;
|
|
17
|
+
ownershipType: string;
|
|
18
|
+
autoResumeAt: string;
|
|
19
|
+
managementUrl: string;
|
|
20
|
+
constructor(data?: PartialMessage<SubscriptionInfo>);
|
|
21
|
+
static readonly runtime: typeof proto3;
|
|
22
|
+
static readonly typeName = "micro.v1.subscription.SubscriptionInfo";
|
|
23
|
+
static readonly fields: FieldList;
|
|
24
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SubscriptionInfo;
|
|
25
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SubscriptionInfo;
|
|
26
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SubscriptionInfo;
|
|
27
|
+
static equals(a: SubscriptionInfo | PlainMessage<SubscriptionInfo> | undefined, b: SubscriptionInfo | PlainMessage<SubscriptionInfo> | undefined): boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare class EntitlementInfo extends Message<EntitlementInfo> {
|
|
30
|
+
key: string;
|
|
31
|
+
expiresAt: string;
|
|
32
|
+
plan: string;
|
|
33
|
+
source: string;
|
|
34
|
+
constructor(data?: PartialMessage<EntitlementInfo>);
|
|
35
|
+
static readonly runtime: typeof proto3;
|
|
36
|
+
static readonly typeName = "micro.v1.subscription.EntitlementInfo";
|
|
37
|
+
static readonly fields: FieldList;
|
|
38
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EntitlementInfo;
|
|
39
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EntitlementInfo;
|
|
40
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EntitlementInfo;
|
|
41
|
+
static equals(a: EntitlementInfo | PlainMessage<EntitlementInfo> | undefined, b: EntitlementInfo | PlainMessage<EntitlementInfo> | undefined): boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare class SubscriptionMeResponse extends Message<SubscriptionMeResponse> {
|
|
44
|
+
status?: ResponseStatus;
|
|
45
|
+
subscription?: SubscriptionInfo;
|
|
46
|
+
entitlements: EntitlementInfo[];
|
|
47
|
+
syncedAt: string;
|
|
48
|
+
constructor(data?: PartialMessage<SubscriptionMeResponse>);
|
|
49
|
+
static readonly runtime: typeof proto3;
|
|
50
|
+
static readonly typeName = "micro.v1.subscription.SubscriptionMeResponse";
|
|
51
|
+
static readonly fields: FieldList;
|
|
52
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SubscriptionMeResponse;
|
|
53
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SubscriptionMeResponse;
|
|
54
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SubscriptionMeResponse;
|
|
55
|
+
static equals(a: SubscriptionMeResponse | PlainMessage<SubscriptionMeResponse> | undefined, b: SubscriptionMeResponse | PlainMessage<SubscriptionMeResponse> | undefined): boolean;
|
|
56
|
+
}
|
|
57
|
+
export declare class EntitlementsByIdsRequest extends Message<EntitlementsByIdsRequest> {
|
|
58
|
+
userIds: string[];
|
|
59
|
+
constructor(data?: PartialMessage<EntitlementsByIdsRequest>);
|
|
60
|
+
static readonly runtime: typeof proto3;
|
|
61
|
+
static readonly typeName = "micro.v1.subscription.EntitlementsByIdsRequest";
|
|
62
|
+
static readonly fields: FieldList;
|
|
63
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EntitlementsByIdsRequest;
|
|
64
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EntitlementsByIdsRequest;
|
|
65
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EntitlementsByIdsRequest;
|
|
66
|
+
static equals(a: EntitlementsByIdsRequest | PlainMessage<EntitlementsByIdsRequest> | undefined, b: EntitlementsByIdsRequest | PlainMessage<EntitlementsByIdsRequest> | undefined): boolean;
|
|
67
|
+
}
|
|
68
|
+
export declare class UserEntitlements extends Message<UserEntitlements> {
|
|
69
|
+
userId: string;
|
|
70
|
+
entitlements: EntitlementInfo[];
|
|
71
|
+
constructor(data?: PartialMessage<UserEntitlements>);
|
|
72
|
+
static readonly runtime: typeof proto3;
|
|
73
|
+
static readonly typeName = "micro.v1.subscription.UserEntitlements";
|
|
74
|
+
static readonly fields: FieldList;
|
|
75
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): UserEntitlements;
|
|
76
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): UserEntitlements;
|
|
77
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UserEntitlements;
|
|
78
|
+
static equals(a: UserEntitlements | PlainMessage<UserEntitlements> | undefined, b: UserEntitlements | PlainMessage<UserEntitlements> | undefined): boolean;
|
|
79
|
+
}
|
|
80
|
+
export declare class EntitlementsListResponse extends Message<EntitlementsListResponse> {
|
|
81
|
+
status?: ResponseStatus;
|
|
82
|
+
data: UserEntitlements[];
|
|
83
|
+
constructor(data?: PartialMessage<EntitlementsListResponse>);
|
|
84
|
+
static readonly runtime: typeof proto3;
|
|
85
|
+
static readonly typeName = "micro.v1.subscription.EntitlementsListResponse";
|
|
86
|
+
static readonly fields: FieldList;
|
|
87
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EntitlementsListResponse;
|
|
88
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EntitlementsListResponse;
|
|
89
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EntitlementsListResponse;
|
|
90
|
+
static equals(a: EntitlementsListResponse | PlainMessage<EntitlementsListResponse> | undefined, b: EntitlementsListResponse | PlainMessage<EntitlementsListResponse> | undefined): boolean;
|
|
91
|
+
}
|
|
92
|
+
export declare class SubscriptionWebhookRequest extends Message<SubscriptionWebhookRequest> {
|
|
93
|
+
authorization: string;
|
|
94
|
+
signature: string;
|
|
95
|
+
rawBody: string;
|
|
96
|
+
constructor(data?: PartialMessage<SubscriptionWebhookRequest>);
|
|
97
|
+
static readonly runtime: typeof proto3;
|
|
98
|
+
static readonly typeName = "micro.v1.subscription.SubscriptionWebhookRequest";
|
|
99
|
+
static readonly fields: FieldList;
|
|
100
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SubscriptionWebhookRequest;
|
|
101
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SubscriptionWebhookRequest;
|
|
102
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SubscriptionWebhookRequest;
|
|
103
|
+
static equals(a: SubscriptionWebhookRequest | PlainMessage<SubscriptionWebhookRequest> | undefined, b: SubscriptionWebhookRequest | PlainMessage<SubscriptionWebhookRequest> | undefined): boolean;
|
|
104
|
+
}
|
|
105
|
+
export declare class SubscriptionEventInfo extends Message<SubscriptionEventInfo> {
|
|
106
|
+
id: string;
|
|
107
|
+
type: string;
|
|
108
|
+
store: string;
|
|
109
|
+
productId: string;
|
|
110
|
+
environment: string;
|
|
111
|
+
receivedAt: string;
|
|
112
|
+
processedAt: string;
|
|
113
|
+
error: string;
|
|
114
|
+
constructor(data?: PartialMessage<SubscriptionEventInfo>);
|
|
115
|
+
static readonly runtime: typeof proto3;
|
|
116
|
+
static readonly typeName = "micro.v1.subscription.SubscriptionEventInfo";
|
|
117
|
+
static readonly fields: FieldList;
|
|
118
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SubscriptionEventInfo;
|
|
119
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SubscriptionEventInfo;
|
|
120
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SubscriptionEventInfo;
|
|
121
|
+
static equals(a: SubscriptionEventInfo | PlainMessage<SubscriptionEventInfo> | undefined, b: SubscriptionEventInfo | PlainMessage<SubscriptionEventInfo> | undefined): boolean;
|
|
122
|
+
}
|
|
123
|
+
export declare class SubscriptionAdminResponse extends Message<SubscriptionAdminResponse> {
|
|
124
|
+
status?: ResponseStatus;
|
|
125
|
+
subscriptions: SubscriptionInfo[];
|
|
126
|
+
entitlements: EntitlementInfo[];
|
|
127
|
+
events: SubscriptionEventInfo[];
|
|
128
|
+
syncedAt: string;
|
|
129
|
+
constructor(data?: PartialMessage<SubscriptionAdminResponse>);
|
|
130
|
+
static readonly runtime: typeof proto3;
|
|
131
|
+
static readonly typeName = "micro.v1.subscription.SubscriptionAdminResponse";
|
|
132
|
+
static readonly fields: FieldList;
|
|
133
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SubscriptionAdminResponse;
|
|
134
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SubscriptionAdminResponse;
|
|
135
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SubscriptionAdminResponse;
|
|
136
|
+
static equals(a: SubscriptionAdminResponse | PlainMessage<SubscriptionAdminResponse> | undefined, b: SubscriptionAdminResponse | PlainMessage<SubscriptionAdminResponse> | undefined): boolean;
|
|
137
|
+
}
|
|
138
|
+
export declare class SubscriptionGrantRequest extends Message<SubscriptionGrantRequest> {
|
|
139
|
+
userId: string;
|
|
140
|
+
plan: string;
|
|
141
|
+
duration: string;
|
|
142
|
+
note: string;
|
|
143
|
+
constructor(data?: PartialMessage<SubscriptionGrantRequest>);
|
|
144
|
+
static readonly runtime: typeof proto3;
|
|
145
|
+
static readonly typeName = "micro.v1.subscription.SubscriptionGrantRequest";
|
|
146
|
+
static readonly fields: FieldList;
|
|
147
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SubscriptionGrantRequest;
|
|
148
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SubscriptionGrantRequest;
|
|
149
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SubscriptionGrantRequest;
|
|
150
|
+
static equals(a: SubscriptionGrantRequest | PlainMessage<SubscriptionGrantRequest> | undefined, b: SubscriptionGrantRequest | PlainMessage<SubscriptionGrantRequest> | undefined): boolean;
|
|
151
|
+
}
|
|
152
|
+
export declare class SubscriptionRevokeRequest extends Message<SubscriptionRevokeRequest> {
|
|
153
|
+
userId: string;
|
|
154
|
+
plan: string;
|
|
155
|
+
constructor(data?: PartialMessage<SubscriptionRevokeRequest>);
|
|
156
|
+
static readonly runtime: typeof proto3;
|
|
157
|
+
static readonly typeName = "micro.v1.subscription.SubscriptionRevokeRequest";
|
|
158
|
+
static readonly fields: FieldList;
|
|
159
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SubscriptionRevokeRequest;
|
|
160
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SubscriptionRevokeRequest;
|
|
161
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SubscriptionRevokeRequest;
|
|
162
|
+
static equals(a: SubscriptionRevokeRequest | PlainMessage<SubscriptionRevokeRequest> | undefined, b: SubscriptionRevokeRequest | PlainMessage<SubscriptionRevokeRequest> | undefined): boolean;
|
|
163
|
+
}
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriptionRevokeRequest = exports.SubscriptionGrantRequest = exports.SubscriptionAdminResponse = exports.SubscriptionEventInfo = exports.SubscriptionWebhookRequest = exports.EntitlementsListResponse = exports.UserEntitlements = exports.EntitlementsByIdsRequest = exports.SubscriptionMeResponse = exports.EntitlementInfo = exports.SubscriptionInfo = void 0;
|
|
4
|
+
const protobuf_1 = require("@bufbuild/protobuf");
|
|
5
|
+
const general_pb_js_1 = require("../general_pb.js");
|
|
6
|
+
class SubscriptionInfo extends protobuf_1.Message {
|
|
7
|
+
plan = "";
|
|
8
|
+
status = "";
|
|
9
|
+
productId = "";
|
|
10
|
+
store = "";
|
|
11
|
+
environment = "";
|
|
12
|
+
periodType = "";
|
|
13
|
+
purchasedAt = "";
|
|
14
|
+
originalPurchaseAt = "";
|
|
15
|
+
expiresAt = "";
|
|
16
|
+
graceUntil = "";
|
|
17
|
+
accessUntil = "";
|
|
18
|
+
autoRenew = false;
|
|
19
|
+
ownershipType = "";
|
|
20
|
+
autoResumeAt = "";
|
|
21
|
+
managementUrl = "";
|
|
22
|
+
constructor(data) {
|
|
23
|
+
super();
|
|
24
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
25
|
+
}
|
|
26
|
+
static runtime = protobuf_1.proto3;
|
|
27
|
+
static typeName = "micro.v1.subscription.SubscriptionInfo";
|
|
28
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
29
|
+
{ no: 1, name: "plan", kind: "scalar", T: 9 },
|
|
30
|
+
{ no: 2, name: "status", kind: "scalar", T: 9 },
|
|
31
|
+
{ no: 3, name: "product_id", kind: "scalar", T: 9 },
|
|
32
|
+
{ no: 4, name: "store", kind: "scalar", T: 9 },
|
|
33
|
+
{ no: 5, name: "environment", kind: "scalar", T: 9 },
|
|
34
|
+
{ no: 6, name: "period_type", kind: "scalar", T: 9 },
|
|
35
|
+
{ no: 7, name: "purchased_at", kind: "scalar", T: 9 },
|
|
36
|
+
{ no: 8, name: "original_purchase_at", kind: "scalar", T: 9 },
|
|
37
|
+
{ no: 9, name: "expires_at", kind: "scalar", T: 9 },
|
|
38
|
+
{ no: 10, name: "grace_until", kind: "scalar", T: 9 },
|
|
39
|
+
{ no: 11, name: "access_until", kind: "scalar", T: 9 },
|
|
40
|
+
{ no: 12, name: "auto_renew", kind: "scalar", T: 8 },
|
|
41
|
+
{ no: 13, name: "ownership_type", kind: "scalar", T: 9 },
|
|
42
|
+
{ no: 14, name: "auto_resume_at", kind: "scalar", T: 9 },
|
|
43
|
+
{ no: 15, name: "management_url", kind: "scalar", T: 9 },
|
|
44
|
+
]);
|
|
45
|
+
static fromBinary(bytes, options) {
|
|
46
|
+
return new SubscriptionInfo().fromBinary(bytes, options);
|
|
47
|
+
}
|
|
48
|
+
static fromJson(jsonValue, options) {
|
|
49
|
+
return new SubscriptionInfo().fromJson(jsonValue, options);
|
|
50
|
+
}
|
|
51
|
+
static fromJsonString(jsonString, options) {
|
|
52
|
+
return new SubscriptionInfo().fromJsonString(jsonString, options);
|
|
53
|
+
}
|
|
54
|
+
static equals(a, b) {
|
|
55
|
+
return protobuf_1.proto3.util.equals(SubscriptionInfo, a, b);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.SubscriptionInfo = SubscriptionInfo;
|
|
59
|
+
class EntitlementInfo extends protobuf_1.Message {
|
|
60
|
+
key = "";
|
|
61
|
+
expiresAt = "";
|
|
62
|
+
plan = "";
|
|
63
|
+
source = "";
|
|
64
|
+
constructor(data) {
|
|
65
|
+
super();
|
|
66
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
67
|
+
}
|
|
68
|
+
static runtime = protobuf_1.proto3;
|
|
69
|
+
static typeName = "micro.v1.subscription.EntitlementInfo";
|
|
70
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
71
|
+
{ no: 1, name: "key", kind: "scalar", T: 9 },
|
|
72
|
+
{ no: 2, name: "expires_at", kind: "scalar", T: 9 },
|
|
73
|
+
{ no: 3, name: "plan", kind: "scalar", T: 9 },
|
|
74
|
+
{ no: 4, name: "source", kind: "scalar", T: 9 },
|
|
75
|
+
]);
|
|
76
|
+
static fromBinary(bytes, options) {
|
|
77
|
+
return new EntitlementInfo().fromBinary(bytes, options);
|
|
78
|
+
}
|
|
79
|
+
static fromJson(jsonValue, options) {
|
|
80
|
+
return new EntitlementInfo().fromJson(jsonValue, options);
|
|
81
|
+
}
|
|
82
|
+
static fromJsonString(jsonString, options) {
|
|
83
|
+
return new EntitlementInfo().fromJsonString(jsonString, options);
|
|
84
|
+
}
|
|
85
|
+
static equals(a, b) {
|
|
86
|
+
return protobuf_1.proto3.util.equals(EntitlementInfo, a, b);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.EntitlementInfo = EntitlementInfo;
|
|
90
|
+
class SubscriptionMeResponse extends protobuf_1.Message {
|
|
91
|
+
status;
|
|
92
|
+
subscription;
|
|
93
|
+
entitlements = [];
|
|
94
|
+
syncedAt = "";
|
|
95
|
+
constructor(data) {
|
|
96
|
+
super();
|
|
97
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
98
|
+
}
|
|
99
|
+
static runtime = protobuf_1.proto3;
|
|
100
|
+
static typeName = "micro.v1.subscription.SubscriptionMeResponse";
|
|
101
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
102
|
+
{ no: 1, name: "status", kind: "message", T: general_pb_js_1.ResponseStatus },
|
|
103
|
+
{ no: 2, name: "subscription", kind: "message", T: SubscriptionInfo, opt: true },
|
|
104
|
+
{ no: 3, name: "entitlements", kind: "message", T: EntitlementInfo, repeated: true },
|
|
105
|
+
{ no: 4, name: "synced_at", kind: "scalar", T: 9 },
|
|
106
|
+
]);
|
|
107
|
+
static fromBinary(bytes, options) {
|
|
108
|
+
return new SubscriptionMeResponse().fromBinary(bytes, options);
|
|
109
|
+
}
|
|
110
|
+
static fromJson(jsonValue, options) {
|
|
111
|
+
return new SubscriptionMeResponse().fromJson(jsonValue, options);
|
|
112
|
+
}
|
|
113
|
+
static fromJsonString(jsonString, options) {
|
|
114
|
+
return new SubscriptionMeResponse().fromJsonString(jsonString, options);
|
|
115
|
+
}
|
|
116
|
+
static equals(a, b) {
|
|
117
|
+
return protobuf_1.proto3.util.equals(SubscriptionMeResponse, a, b);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.SubscriptionMeResponse = SubscriptionMeResponse;
|
|
121
|
+
class EntitlementsByIdsRequest extends protobuf_1.Message {
|
|
122
|
+
userIds = [];
|
|
123
|
+
constructor(data) {
|
|
124
|
+
super();
|
|
125
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
126
|
+
}
|
|
127
|
+
static runtime = protobuf_1.proto3;
|
|
128
|
+
static typeName = "micro.v1.subscription.EntitlementsByIdsRequest";
|
|
129
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
130
|
+
{ no: 1, name: "user_ids", kind: "scalar", T: 9, repeated: true },
|
|
131
|
+
]);
|
|
132
|
+
static fromBinary(bytes, options) {
|
|
133
|
+
return new EntitlementsByIdsRequest().fromBinary(bytes, options);
|
|
134
|
+
}
|
|
135
|
+
static fromJson(jsonValue, options) {
|
|
136
|
+
return new EntitlementsByIdsRequest().fromJson(jsonValue, options);
|
|
137
|
+
}
|
|
138
|
+
static fromJsonString(jsonString, options) {
|
|
139
|
+
return new EntitlementsByIdsRequest().fromJsonString(jsonString, options);
|
|
140
|
+
}
|
|
141
|
+
static equals(a, b) {
|
|
142
|
+
return protobuf_1.proto3.util.equals(EntitlementsByIdsRequest, a, b);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
exports.EntitlementsByIdsRequest = EntitlementsByIdsRequest;
|
|
146
|
+
class UserEntitlements extends protobuf_1.Message {
|
|
147
|
+
userId = "";
|
|
148
|
+
entitlements = [];
|
|
149
|
+
constructor(data) {
|
|
150
|
+
super();
|
|
151
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
152
|
+
}
|
|
153
|
+
static runtime = protobuf_1.proto3;
|
|
154
|
+
static typeName = "micro.v1.subscription.UserEntitlements";
|
|
155
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
156
|
+
{ no: 1, name: "user_id", kind: "scalar", T: 9 },
|
|
157
|
+
{ no: 2, name: "entitlements", kind: "message", T: EntitlementInfo, repeated: true },
|
|
158
|
+
]);
|
|
159
|
+
static fromBinary(bytes, options) {
|
|
160
|
+
return new UserEntitlements().fromBinary(bytes, options);
|
|
161
|
+
}
|
|
162
|
+
static fromJson(jsonValue, options) {
|
|
163
|
+
return new UserEntitlements().fromJson(jsonValue, options);
|
|
164
|
+
}
|
|
165
|
+
static fromJsonString(jsonString, options) {
|
|
166
|
+
return new UserEntitlements().fromJsonString(jsonString, options);
|
|
167
|
+
}
|
|
168
|
+
static equals(a, b) {
|
|
169
|
+
return protobuf_1.proto3.util.equals(UserEntitlements, a, b);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
exports.UserEntitlements = UserEntitlements;
|
|
173
|
+
class EntitlementsListResponse extends protobuf_1.Message {
|
|
174
|
+
status;
|
|
175
|
+
data = [];
|
|
176
|
+
constructor(data) {
|
|
177
|
+
super();
|
|
178
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
179
|
+
}
|
|
180
|
+
static runtime = protobuf_1.proto3;
|
|
181
|
+
static typeName = "micro.v1.subscription.EntitlementsListResponse";
|
|
182
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
183
|
+
{ no: 1, name: "status", kind: "message", T: general_pb_js_1.ResponseStatus },
|
|
184
|
+
{ no: 2, name: "data", kind: "message", T: UserEntitlements, repeated: true },
|
|
185
|
+
]);
|
|
186
|
+
static fromBinary(bytes, options) {
|
|
187
|
+
return new EntitlementsListResponse().fromBinary(bytes, options);
|
|
188
|
+
}
|
|
189
|
+
static fromJson(jsonValue, options) {
|
|
190
|
+
return new EntitlementsListResponse().fromJson(jsonValue, options);
|
|
191
|
+
}
|
|
192
|
+
static fromJsonString(jsonString, options) {
|
|
193
|
+
return new EntitlementsListResponse().fromJsonString(jsonString, options);
|
|
194
|
+
}
|
|
195
|
+
static equals(a, b) {
|
|
196
|
+
return protobuf_1.proto3.util.equals(EntitlementsListResponse, a, b);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports.EntitlementsListResponse = EntitlementsListResponse;
|
|
200
|
+
class SubscriptionWebhookRequest extends protobuf_1.Message {
|
|
201
|
+
authorization = "";
|
|
202
|
+
signature = "";
|
|
203
|
+
rawBody = "";
|
|
204
|
+
constructor(data) {
|
|
205
|
+
super();
|
|
206
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
207
|
+
}
|
|
208
|
+
static runtime = protobuf_1.proto3;
|
|
209
|
+
static typeName = "micro.v1.subscription.SubscriptionWebhookRequest";
|
|
210
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
211
|
+
{ no: 1, name: "authorization", kind: "scalar", T: 9 },
|
|
212
|
+
{ no: 2, name: "signature", kind: "scalar", T: 9 },
|
|
213
|
+
{ no: 3, name: "raw_body", kind: "scalar", T: 9 },
|
|
214
|
+
]);
|
|
215
|
+
static fromBinary(bytes, options) {
|
|
216
|
+
return new SubscriptionWebhookRequest().fromBinary(bytes, options);
|
|
217
|
+
}
|
|
218
|
+
static fromJson(jsonValue, options) {
|
|
219
|
+
return new SubscriptionWebhookRequest().fromJson(jsonValue, options);
|
|
220
|
+
}
|
|
221
|
+
static fromJsonString(jsonString, options) {
|
|
222
|
+
return new SubscriptionWebhookRequest().fromJsonString(jsonString, options);
|
|
223
|
+
}
|
|
224
|
+
static equals(a, b) {
|
|
225
|
+
return protobuf_1.proto3.util.equals(SubscriptionWebhookRequest, a, b);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
exports.SubscriptionWebhookRequest = SubscriptionWebhookRequest;
|
|
229
|
+
class SubscriptionEventInfo extends protobuf_1.Message {
|
|
230
|
+
id = "";
|
|
231
|
+
type = "";
|
|
232
|
+
store = "";
|
|
233
|
+
productId = "";
|
|
234
|
+
environment = "";
|
|
235
|
+
receivedAt = "";
|
|
236
|
+
processedAt = "";
|
|
237
|
+
error = "";
|
|
238
|
+
constructor(data) {
|
|
239
|
+
super();
|
|
240
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
241
|
+
}
|
|
242
|
+
static runtime = protobuf_1.proto3;
|
|
243
|
+
static typeName = "micro.v1.subscription.SubscriptionEventInfo";
|
|
244
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
245
|
+
{ no: 1, name: "id", kind: "scalar", T: 9 },
|
|
246
|
+
{ no: 2, name: "type", kind: "scalar", T: 9 },
|
|
247
|
+
{ no: 3, name: "store", kind: "scalar", T: 9 },
|
|
248
|
+
{ no: 4, name: "product_id", kind: "scalar", T: 9 },
|
|
249
|
+
{ no: 5, name: "environment", kind: "scalar", T: 9 },
|
|
250
|
+
{ no: 6, name: "received_at", kind: "scalar", T: 9 },
|
|
251
|
+
{ no: 7, name: "processed_at", kind: "scalar", T: 9 },
|
|
252
|
+
{ no: 8, name: "error", kind: "scalar", T: 9 },
|
|
253
|
+
]);
|
|
254
|
+
static fromBinary(bytes, options) {
|
|
255
|
+
return new SubscriptionEventInfo().fromBinary(bytes, options);
|
|
256
|
+
}
|
|
257
|
+
static fromJson(jsonValue, options) {
|
|
258
|
+
return new SubscriptionEventInfo().fromJson(jsonValue, options);
|
|
259
|
+
}
|
|
260
|
+
static fromJsonString(jsonString, options) {
|
|
261
|
+
return new SubscriptionEventInfo().fromJsonString(jsonString, options);
|
|
262
|
+
}
|
|
263
|
+
static equals(a, b) {
|
|
264
|
+
return protobuf_1.proto3.util.equals(SubscriptionEventInfo, a, b);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
exports.SubscriptionEventInfo = SubscriptionEventInfo;
|
|
268
|
+
class SubscriptionAdminResponse extends protobuf_1.Message {
|
|
269
|
+
status;
|
|
270
|
+
subscriptions = [];
|
|
271
|
+
entitlements = [];
|
|
272
|
+
events = [];
|
|
273
|
+
syncedAt = "";
|
|
274
|
+
constructor(data) {
|
|
275
|
+
super();
|
|
276
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
277
|
+
}
|
|
278
|
+
static runtime = protobuf_1.proto3;
|
|
279
|
+
static typeName = "micro.v1.subscription.SubscriptionAdminResponse";
|
|
280
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
281
|
+
{ no: 1, name: "status", kind: "message", T: general_pb_js_1.ResponseStatus },
|
|
282
|
+
{ no: 2, name: "subscriptions", kind: "message", T: SubscriptionInfo, repeated: true },
|
|
283
|
+
{ no: 3, name: "entitlements", kind: "message", T: EntitlementInfo, repeated: true },
|
|
284
|
+
{ no: 4, name: "events", kind: "message", T: SubscriptionEventInfo, repeated: true },
|
|
285
|
+
{ no: 5, name: "synced_at", kind: "scalar", T: 9 },
|
|
286
|
+
]);
|
|
287
|
+
static fromBinary(bytes, options) {
|
|
288
|
+
return new SubscriptionAdminResponse().fromBinary(bytes, options);
|
|
289
|
+
}
|
|
290
|
+
static fromJson(jsonValue, options) {
|
|
291
|
+
return new SubscriptionAdminResponse().fromJson(jsonValue, options);
|
|
292
|
+
}
|
|
293
|
+
static fromJsonString(jsonString, options) {
|
|
294
|
+
return new SubscriptionAdminResponse().fromJsonString(jsonString, options);
|
|
295
|
+
}
|
|
296
|
+
static equals(a, b) {
|
|
297
|
+
return protobuf_1.proto3.util.equals(SubscriptionAdminResponse, a, b);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
exports.SubscriptionAdminResponse = SubscriptionAdminResponse;
|
|
301
|
+
class SubscriptionGrantRequest extends protobuf_1.Message {
|
|
302
|
+
userId = "";
|
|
303
|
+
plan = "";
|
|
304
|
+
duration = "";
|
|
305
|
+
note = "";
|
|
306
|
+
constructor(data) {
|
|
307
|
+
super();
|
|
308
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
309
|
+
}
|
|
310
|
+
static runtime = protobuf_1.proto3;
|
|
311
|
+
static typeName = "micro.v1.subscription.SubscriptionGrantRequest";
|
|
312
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
313
|
+
{ no: 1, name: "user_id", kind: "scalar", T: 9 },
|
|
314
|
+
{ no: 2, name: "plan", kind: "scalar", T: 9 },
|
|
315
|
+
{ no: 3, name: "duration", kind: "scalar", T: 9 },
|
|
316
|
+
{ no: 4, name: "note", kind: "scalar", T: 9 },
|
|
317
|
+
]);
|
|
318
|
+
static fromBinary(bytes, options) {
|
|
319
|
+
return new SubscriptionGrantRequest().fromBinary(bytes, options);
|
|
320
|
+
}
|
|
321
|
+
static fromJson(jsonValue, options) {
|
|
322
|
+
return new SubscriptionGrantRequest().fromJson(jsonValue, options);
|
|
323
|
+
}
|
|
324
|
+
static fromJsonString(jsonString, options) {
|
|
325
|
+
return new SubscriptionGrantRequest().fromJsonString(jsonString, options);
|
|
326
|
+
}
|
|
327
|
+
static equals(a, b) {
|
|
328
|
+
return protobuf_1.proto3.util.equals(SubscriptionGrantRequest, a, b);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
exports.SubscriptionGrantRequest = SubscriptionGrantRequest;
|
|
332
|
+
class SubscriptionRevokeRequest extends protobuf_1.Message {
|
|
333
|
+
userId = "";
|
|
334
|
+
plan = "";
|
|
335
|
+
constructor(data) {
|
|
336
|
+
super();
|
|
337
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
338
|
+
}
|
|
339
|
+
static runtime = protobuf_1.proto3;
|
|
340
|
+
static typeName = "micro.v1.subscription.SubscriptionRevokeRequest";
|
|
341
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
342
|
+
{ no: 1, name: "user_id", kind: "scalar", T: 9 },
|
|
343
|
+
{ no: 2, name: "plan", kind: "scalar", T: 9 },
|
|
344
|
+
]);
|
|
345
|
+
static fromBinary(bytes, options) {
|
|
346
|
+
return new SubscriptionRevokeRequest().fromBinary(bytes, options);
|
|
347
|
+
}
|
|
348
|
+
static fromJson(jsonValue, options) {
|
|
349
|
+
return new SubscriptionRevokeRequest().fromJson(jsonValue, options);
|
|
350
|
+
}
|
|
351
|
+
static fromJsonString(jsonString, options) {
|
|
352
|
+
return new SubscriptionRevokeRequest().fromJsonString(jsonString, options);
|
|
353
|
+
}
|
|
354
|
+
static equals(a, b) {
|
|
355
|
+
return protobuf_1.proto3.util.equals(SubscriptionRevokeRequest, a, b);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
exports.SubscriptionRevokeRequest = SubscriptionRevokeRequest;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppleRequest, GoogleRequest, LoginRequest, LoginResponse, LostPasswordChangePasswordRequest, LostPasswordChangePasswordResponse, LostPasswordHashCheckRequest, LostPasswordHashCheckResponse, LostPasswordStartRequest, LostPasswordStartResponse, RegisterRequest, RegisterResponse, RemoveUserDataRequest, ResendVerificationEmailRequest, ResendVerificationEmailResponse, TfaRequest, TfaResponse, UserVerificationRequest, UserVerificationResponse, VerifyTokenRequest, VerifyTokenResponse } from "./auth_messages_pb.js";
|
|
2
2
|
import { MethodKind } from "@bufbuild/protobuf";
|
|
3
3
|
import { ByIdRequest, EmptyRequest, EmptyResponse, PaginateFromRequest, PaginateRequest } from "../general_pb.js";
|
|
4
|
-
import { BetaCodePaginateResponse, BetaCodeSingleResponse, BetaCodeStoreRequest, BetaCodeUpdateRequest, ContactPaginationResponse, ContactRequest, ContactResponse, PreviewResponse, PublicUserPreviewResponse, UpdatePasswordRequest, UserAdminStoreRequest, UserBadgeSetRequest, UserBadgesResponse, UserPaginationResponse, UserSingleResponse, UserUpdateRequest } from "./user_messages_pb.js";
|
|
4
|
+
import { BetaCodePaginateResponse, BetaCodeSingleResponse, BetaCodeStoreRequest, BetaCodeUpdateRequest, ContactPaginationResponse, ContactRequest, ContactResponse, PreviewResponse, PublicUserPreviewResponse, SubscriptionBadgeRequest, UpdatePasswordRequest, UserAdminStoreRequest, UserBadgeSetRequest, UserBadgesResponse, UserPaginationResponse, UserSingleResponse, UserUpdateRequest } from "./user_messages_pb.js";
|
|
5
5
|
import { SiteSettingsRequest, SiteSettingsResponse } from "./site_settings_messages_pb.js";
|
|
6
6
|
import { AvatarPhotoResponse, AvatarPhotoSetRequest, ClaimUsernameRequest, FollowRequest, LikeRequest, ProfileByUsernameRequest, ProfileIdListResponse, ProfileListResponse, ProfilesByIdsRequest, ProfileSingleResponse, ProfileUpdateRequest, SearchProfilesRequest, UsernameAvailableRequest, UsernameAvailableResponse } from "./profile_messages_pb.js";
|
|
7
7
|
import { RoleAdminStoreRequest, RoleAdminUpdateRequest, RolePaginationResponse, RoleSingleResponse } from "./authorization_messages_pb.js";
|
|
@@ -289,6 +289,12 @@ export declare const PProfileService: {
|
|
|
289
289
|
readonly O: typeof ProfileListResponse;
|
|
290
290
|
readonly kind: MethodKind.ServerStreaming;
|
|
291
291
|
};
|
|
292
|
+
readonly setSubscriptionBadge: {
|
|
293
|
+
readonly name: "SetSubscriptionBadge";
|
|
294
|
+
readonly I: typeof SubscriptionBadgeRequest;
|
|
295
|
+
readonly O: typeof UserBadgesResponse;
|
|
296
|
+
readonly kind: MethodKind.ServerStreaming;
|
|
297
|
+
};
|
|
292
298
|
};
|
|
293
299
|
};
|
|
294
300
|
export declare const PUserAdminService: {
|
|
@@ -292,6 +292,12 @@ exports.PProfileService = {
|
|
|
292
292
|
O: profile_messages_pb_js_1.ProfileListResponse,
|
|
293
293
|
kind: protobuf_1.MethodKind.ServerStreaming,
|
|
294
294
|
},
|
|
295
|
+
setSubscriptionBadge: {
|
|
296
|
+
name: "SetSubscriptionBadge",
|
|
297
|
+
I: user_messages_pb_js_1.SubscriptionBadgeRequest,
|
|
298
|
+
O: user_messages_pb_js_1.UserBadgesResponse,
|
|
299
|
+
kind: protobuf_1.MethodKind.ServerStreaming,
|
|
300
|
+
},
|
|
295
301
|
}
|
|
296
302
|
};
|
|
297
303
|
exports.PUserAdminService = {
|
|
@@ -5,7 +5,7 @@ import { AppleRequest, GoogleRequest, LoginRequest, LoginResponse, LostPasswordC
|
|
|
5
5
|
import { RoleAdminStoreRequest, RoleAdminUpdateRequest, RolePaginationResponse, RoleSingleResponse } from "./authorization_messages_nest";
|
|
6
6
|
import { AvatarPhotoResponse, AvatarPhotoSetRequest, ClaimUsernameRequest, FollowRequest, LikeRequest, ProfileByUsernameRequest, ProfileIdListResponse, ProfileListResponse, ProfilesByIdsRequest, ProfileSingleResponse, ProfileUpdateRequest, SearchProfilesRequest, UsernameAvailableRequest, UsernameAvailableResponse } from "./profile_messages_nest";
|
|
7
7
|
import { SiteSettingsRequest, SiteSettingsResponse } from "./site_settings_messages_nest";
|
|
8
|
-
import { BetaCodePaginateResponse, BetaCodeSingleResponse, BetaCodeStoreRequest, BetaCodeUpdateRequest, ContactPaginationResponse, ContactRequest, ContactResponse, PreviewResponse, PublicUserPreviewResponse, UpdatePasswordRequest, UserAdminStoreRequest, UserBadgeSetRequest, UserBadgesResponse, UserPaginationResponse, UserSingleResponse, UserUpdateRequest } from "./user_messages_nest";
|
|
8
|
+
import { BetaCodePaginateResponse, BetaCodeSingleResponse, BetaCodeStoreRequest, BetaCodeUpdateRequest, ContactPaginationResponse, ContactRequest, ContactResponse, PreviewResponse, PublicUserPreviewResponse, SubscriptionBadgeRequest, UpdatePasswordRequest, UserAdminStoreRequest, UserBadgeSetRequest, UserBadgesResponse, UserPaginationResponse, UserSingleResponse, UserUpdateRequest } from "./user_messages_nest";
|
|
9
9
|
export declare const protobufPackage = "micro.v1.user";
|
|
10
10
|
export declare const MICRO_V1_USER_PACKAGE_NAME = "micro.v1.user";
|
|
11
11
|
export interface PAuthServiceClient {
|
|
@@ -117,6 +117,7 @@ export interface PProfileServiceClient {
|
|
|
117
117
|
followers(request: PaginateRequest, metadata?: Metadata): Observable<ProfileListResponse>;
|
|
118
118
|
profilesByIds(request: ProfilesByIdsRequest, metadata?: Metadata): Observable<ProfileListResponse>;
|
|
119
119
|
following(request: PaginateRequest, metadata?: Metadata): Observable<ProfileListResponse>;
|
|
120
|
+
setSubscriptionBadge(request: SubscriptionBadgeRequest, metadata?: Metadata): Observable<UserBadgesResponse>;
|
|
120
121
|
}
|
|
121
122
|
export interface PProfileServiceController {
|
|
122
123
|
usernameAvailable(request: UsernameAvailableRequest, metadata?: Metadata): Observable<UsernameAvailableResponse>;
|
|
@@ -135,6 +136,7 @@ export interface PProfileServiceController {
|
|
|
135
136
|
followers(request: PaginateRequest, metadata?: Metadata): Observable<ProfileListResponse>;
|
|
136
137
|
profilesByIds(request: ProfilesByIdsRequest, metadata?: Metadata): Observable<ProfileListResponse>;
|
|
137
138
|
following(request: PaginateRequest, metadata?: Metadata): Observable<ProfileListResponse>;
|
|
139
|
+
setSubscriptionBadge(request: SubscriptionBadgeRequest, metadata?: Metadata): Observable<UserBadgesResponse>;
|
|
138
140
|
}
|
|
139
141
|
export declare function PProfileServiceControllerMethods(): (constructor: Function) => void;
|
|
140
142
|
export declare const P_PROFILE_SERVICE_NAME = "PProfileService";
|
|
@@ -151,6 +151,7 @@ function PProfileServiceControllerMethods() {
|
|
|
151
151
|
"followers",
|
|
152
152
|
"profilesByIds",
|
|
153
153
|
"following",
|
|
154
|
+
"setSubscriptionBadge",
|
|
154
155
|
];
|
|
155
156
|
for (const method of grpcMethods) {
|
|
156
157
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
@@ -33,6 +33,12 @@ export interface UserBadgesResponse {
|
|
|
33
33
|
status: ResponseStatus | undefined;
|
|
34
34
|
badges: string[];
|
|
35
35
|
}
|
|
36
|
+
export interface SubscriptionBadgeRequest {
|
|
37
|
+
user_id: string;
|
|
38
|
+
badge: string;
|
|
39
|
+
active: boolean;
|
|
40
|
+
expires_at: string;
|
|
41
|
+
}
|
|
36
42
|
export interface UserProfileDto {
|
|
37
43
|
id: string;
|
|
38
44
|
user_id: string;
|
|
@@ -57,6 +57,20 @@ export declare class UserBadgesResponse extends Message<UserBadgesResponse> {
|
|
|
57
57
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UserBadgesResponse;
|
|
58
58
|
static equals(a: UserBadgesResponse | PlainMessage<UserBadgesResponse> | undefined, b: UserBadgesResponse | PlainMessage<UserBadgesResponse> | undefined): boolean;
|
|
59
59
|
}
|
|
60
|
+
export declare class SubscriptionBadgeRequest extends Message<SubscriptionBadgeRequest> {
|
|
61
|
+
userId: string;
|
|
62
|
+
badge: string;
|
|
63
|
+
active: boolean;
|
|
64
|
+
expiresAt: string;
|
|
65
|
+
constructor(data?: PartialMessage<SubscriptionBadgeRequest>);
|
|
66
|
+
static readonly runtime: typeof proto3;
|
|
67
|
+
static readonly typeName = "micro.v1.user.SubscriptionBadgeRequest";
|
|
68
|
+
static readonly fields: FieldList;
|
|
69
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SubscriptionBadgeRequest;
|
|
70
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SubscriptionBadgeRequest;
|
|
71
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SubscriptionBadgeRequest;
|
|
72
|
+
static equals(a: SubscriptionBadgeRequest | PlainMessage<SubscriptionBadgeRequest> | undefined, b: SubscriptionBadgeRequest | PlainMessage<SubscriptionBadgeRequest> | undefined): boolean;
|
|
73
|
+
}
|
|
60
74
|
export declare class UserProfileDto extends Message<UserProfileDto> {
|
|
61
75
|
id: string;
|
|
62
76
|
userId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PublicUserPreviewResponse = exports.PublicUserPreviewDto = exports.removeUserDataRequest = exports.ContactDto = exports.ContactResponse = exports.ContactRequest = exports.BetaCodePaginateResponse = exports.BetaCodeUpdateRequest = exports.BetaCodeSingleResponse = exports.BetaCodeDto = exports.BetaCodeStoreRequest = exports.UserProfileAdminStoreRequest = exports.UserAdminStoreRequest = exports.PreviewResponse = exports.PreviewDto = exports.ContactPaginationResponse = exports.UserPaginationResponse = exports.UserSingleResponse = exports.UserUpdateRequest = exports.UpdatePasswordRequest = exports.UserStoreRequest = exports.UserProfileDto = exports.UserBadgesResponse = exports.UserBadgeSetRequest = exports.UserDto = exports.TfaSelectionEnum = void 0;
|
|
3
|
+
exports.PublicUserPreviewResponse = exports.PublicUserPreviewDto = exports.removeUserDataRequest = exports.ContactDto = exports.ContactResponse = exports.ContactRequest = exports.BetaCodePaginateResponse = exports.BetaCodeUpdateRequest = exports.BetaCodeSingleResponse = exports.BetaCodeDto = exports.BetaCodeStoreRequest = exports.UserProfileAdminStoreRequest = exports.UserAdminStoreRequest = exports.PreviewResponse = exports.PreviewDto = exports.ContactPaginationResponse = exports.UserPaginationResponse = exports.UserSingleResponse = exports.UserUpdateRequest = exports.UpdatePasswordRequest = exports.UserStoreRequest = exports.UserProfileDto = exports.SubscriptionBadgeRequest = exports.UserBadgesResponse = exports.UserBadgeSetRequest = exports.UserDto = exports.TfaSelectionEnum = void 0;
|
|
4
4
|
const protobuf_1 = require("@bufbuild/protobuf");
|
|
5
5
|
const general_pb_js_1 = require("../general_pb.js");
|
|
6
6
|
const authorization_messages_pb_js_1 = require("./authorization_messages_pb.js");
|
|
@@ -124,6 +124,37 @@ class UserBadgesResponse extends protobuf_1.Message {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
exports.UserBadgesResponse = UserBadgesResponse;
|
|
127
|
+
class SubscriptionBadgeRequest extends protobuf_1.Message {
|
|
128
|
+
userId = "";
|
|
129
|
+
badge = "";
|
|
130
|
+
active = false;
|
|
131
|
+
expiresAt = "";
|
|
132
|
+
constructor(data) {
|
|
133
|
+
super();
|
|
134
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
135
|
+
}
|
|
136
|
+
static runtime = protobuf_1.proto3;
|
|
137
|
+
static typeName = "micro.v1.user.SubscriptionBadgeRequest";
|
|
138
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
139
|
+
{ no: 1, name: "user_id", kind: "scalar", T: 9 },
|
|
140
|
+
{ no: 2, name: "badge", kind: "scalar", T: 9 },
|
|
141
|
+
{ no: 3, name: "active", kind: "scalar", T: 8 },
|
|
142
|
+
{ no: 4, name: "expires_at", kind: "scalar", T: 9 },
|
|
143
|
+
]);
|
|
144
|
+
static fromBinary(bytes, options) {
|
|
145
|
+
return new SubscriptionBadgeRequest().fromBinary(bytes, options);
|
|
146
|
+
}
|
|
147
|
+
static fromJson(jsonValue, options) {
|
|
148
|
+
return new SubscriptionBadgeRequest().fromJson(jsonValue, options);
|
|
149
|
+
}
|
|
150
|
+
static fromJsonString(jsonString, options) {
|
|
151
|
+
return new SubscriptionBadgeRequest().fromJsonString(jsonString, options);
|
|
152
|
+
}
|
|
153
|
+
static equals(a, b) {
|
|
154
|
+
return protobuf_1.proto3.util.equals(SubscriptionBadgeRequest, a, b);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
exports.SubscriptionBadgeRequest = SubscriptionBadgeRequest;
|
|
127
158
|
class UserProfileDto extends protobuf_1.Message {
|
|
128
159
|
id = "";
|
|
129
160
|
userId = "";
|
|
@@ -9,6 +9,7 @@ export declare const PUPPETEER_MICRO = "PUPPETEER_MICRO";
|
|
|
9
9
|
export declare const MEDIA_MICRO = "MEDIA_MICRO";
|
|
10
10
|
export declare const CHAT_MICRO = "CHAT_MICRO";
|
|
11
11
|
export declare const VOICE_MICRO = "VOICE_MICRO";
|
|
12
|
+
export declare const SUBSCRIPTION_MICRO = "SUBSCRIPTION_MICRO";
|
|
12
13
|
export declare const X_INTERNAL_HASH = "x-internal-hash";
|
|
13
14
|
export declare const FILTER_SEPARATOR = "_|_";
|
|
14
15
|
export declare const KAFKA_KEYS: {
|
package/dist/utils/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MEDIA_UPLOADS_PATH = exports.KEYS = exports.KAFKA_KEYS = exports.FILTER_SEPARATOR = exports.X_INTERNAL_HASH = exports.VOICE_MICRO = exports.CHAT_MICRO = exports.MEDIA_MICRO = exports.PUPPETEER_MICRO = exports.EDUCATION_MICRO = exports.DATA_MICRO = exports.PORTFOLIO_MICRO = exports.USER_MICRO = exports.NOTIFICATION_MICRO = exports.NEWS_MICRO = exports.COIN_MICRO = void 0;
|
|
3
|
+
exports.MEDIA_UPLOADS_PATH = exports.KEYS = exports.KAFKA_KEYS = exports.FILTER_SEPARATOR = exports.X_INTERNAL_HASH = exports.SUBSCRIPTION_MICRO = exports.VOICE_MICRO = exports.CHAT_MICRO = exports.MEDIA_MICRO = exports.PUPPETEER_MICRO = exports.EDUCATION_MICRO = exports.DATA_MICRO = exports.PORTFOLIO_MICRO = exports.USER_MICRO = exports.NOTIFICATION_MICRO = exports.NEWS_MICRO = exports.COIN_MICRO = void 0;
|
|
4
4
|
exports.COIN_MICRO = 'COIN_MICRO';
|
|
5
5
|
exports.NEWS_MICRO = 'NEWS_MICRO';
|
|
6
6
|
exports.NOTIFICATION_MICRO = 'NOTIFICATION_MICRO';
|
|
@@ -12,6 +12,7 @@ exports.PUPPETEER_MICRO = 'PUPPETEER_MICRO';
|
|
|
12
12
|
exports.MEDIA_MICRO = 'MEDIA_MICRO';
|
|
13
13
|
exports.CHAT_MICRO = 'CHAT_MICRO';
|
|
14
14
|
exports.VOICE_MICRO = 'VOICE_MICRO';
|
|
15
|
+
exports.SUBSCRIPTION_MICRO = 'SUBSCRIPTION_MICRO';
|
|
15
16
|
exports.X_INTERNAL_HASH = 'x-internal-hash';
|
|
16
17
|
exports.FILTER_SEPARATOR = '_|_';
|
|
17
18
|
exports.KAFKA_KEYS = {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BadgeKey } from './badges';
|
|
2
|
+
export declare const PLAN_CODES: readonly ["premium"];
|
|
3
|
+
export type PlanCode = (typeof PLAN_CODES)[number];
|
|
4
|
+
export declare const FEATURE_KEYS: readonly ["badge.premium", "chat.premium_group", "data.premium"];
|
|
5
|
+
export type FeatureKey = (typeof FEATURE_KEYS)[number];
|
|
6
|
+
export declare const PLAN_FEATURES: Record<PlanCode, readonly FeatureKey[]>;
|
|
7
|
+
export declare const PLAN_BADGE: Record<PlanCode, BadgeKey | null>;
|
|
8
|
+
export declare function isPlanCode(value: string): value is PlanCode;
|
|
9
|
+
export declare function isFeatureKey(value: string): value is FeatureKey;
|
|
10
|
+
export type EntitlementMap = Partial<Record<FeatureKey, Date | null>>;
|
|
11
|
+
export declare function hasEntitlement(entitlements: EntitlementMap | undefined, key: FeatureKey, now?: Date): boolean;
|
|
12
|
+
export declare function entitlementMapFromWire(items: readonly {
|
|
13
|
+
key: string;
|
|
14
|
+
expires_at?: string;
|
|
15
|
+
}[] | undefined): EntitlementMap;
|
|
16
|
+
export declare const ENTITLEMENT_CHANGED_CHANNEL = "subscription:entitlement-changed";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ENTITLEMENT_CHANGED_CHANNEL = exports.PLAN_BADGE = exports.PLAN_FEATURES = exports.FEATURE_KEYS = exports.PLAN_CODES = void 0;
|
|
4
|
+
exports.isPlanCode = isPlanCode;
|
|
5
|
+
exports.isFeatureKey = isFeatureKey;
|
|
6
|
+
exports.hasEntitlement = hasEntitlement;
|
|
7
|
+
exports.entitlementMapFromWire = entitlementMapFromWire;
|
|
8
|
+
exports.PLAN_CODES = ['premium'];
|
|
9
|
+
exports.FEATURE_KEYS = [
|
|
10
|
+
'badge.premium',
|
|
11
|
+
'chat.premium_group',
|
|
12
|
+
'data.premium',
|
|
13
|
+
];
|
|
14
|
+
exports.PLAN_FEATURES = {
|
|
15
|
+
premium: ['badge.premium', 'chat.premium_group', 'data.premium'],
|
|
16
|
+
};
|
|
17
|
+
exports.PLAN_BADGE = {
|
|
18
|
+
premium: 'premium',
|
|
19
|
+
};
|
|
20
|
+
function isPlanCode(value) {
|
|
21
|
+
return exports.PLAN_CODES.includes(value);
|
|
22
|
+
}
|
|
23
|
+
function isFeatureKey(value) {
|
|
24
|
+
return exports.FEATURE_KEYS.includes(value);
|
|
25
|
+
}
|
|
26
|
+
function hasEntitlement(entitlements, key, now = new Date()) {
|
|
27
|
+
if (!entitlements || !(key in entitlements))
|
|
28
|
+
return false;
|
|
29
|
+
const until = entitlements[key];
|
|
30
|
+
return until === null || until === undefined || until.getTime() > now.getTime();
|
|
31
|
+
}
|
|
32
|
+
function entitlementMapFromWire(items) {
|
|
33
|
+
const map = {};
|
|
34
|
+
for (const item of items ?? []) {
|
|
35
|
+
if (!isFeatureKey(item.key))
|
|
36
|
+
continue;
|
|
37
|
+
map[item.key] = item.expires_at ? new Date(item.expires_at) : null;
|
|
38
|
+
}
|
|
39
|
+
return map;
|
|
40
|
+
}
|
|
41
|
+
exports.ENTITLEMENT_CHANGED_CHANNEL = 'subscription:entitlement-changed';
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * as badges from './badges';
|
|
2
2
|
export * as constants from './constants';
|
|
3
|
+
export * as entitlements from './entitlements';
|
|
3
4
|
export * as functions from './functions';
|
|
4
5
|
export * as logger_names from './logger_names';
|
|
5
6
|
export * as puppeteer_constants from './puppeteer_constants';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.walk_sync = exports.types = exports.puppeteer_constants = exports.logger_names = exports.functions = exports.constants = exports.badges = void 0;
|
|
3
|
+
exports.walk_sync = exports.types = exports.puppeteer_constants = exports.logger_names = exports.functions = exports.entitlements = exports.constants = exports.badges = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
exports.badges = tslib_1.__importStar(require("./badges"));
|
|
6
6
|
exports.constants = tslib_1.__importStar(require("./constants"));
|
|
7
|
+
exports.entitlements = tslib_1.__importStar(require("./entitlements"));
|
|
7
8
|
exports.functions = tslib_1.__importStar(require("./functions"));
|
|
8
9
|
exports.logger_names = tslib_1.__importStar(require("./logger_names"));
|
|
9
10
|
exports.puppeteer_constants = tslib_1.__importStar(require("./puppeteer_constants"));
|
package/package.json
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package micro.v1.subscription;
|
|
4
|
+
|
|
5
|
+
import "micro/v1/general.proto";
|
|
6
|
+
import "micro/v1/subscription/subscription_messages.proto";
|
|
7
|
+
|
|
8
|
+
// Paid plans. The store side (receipts, renewals, refunds) is handled by
|
|
9
|
+
// RevenueCat; this service turns its view of a customer into our own
|
|
10
|
+
// entitlement rows, which every other service reads. Nothing else talks to
|
|
11
|
+
// the store.
|
|
12
|
+
service PSubscriptionService {
|
|
13
|
+
// The caller's plan and entitlements as we know them (no store call).
|
|
14
|
+
rpc Me(EmptyRequest) returns(stream SubscriptionMeResponse) {}
|
|
15
|
+
// The caller just bought or restored: pull the store's view now instead
|
|
16
|
+
// of waiting for the webhook. Rate-limited per person.
|
|
17
|
+
rpc Sync(EmptyRequest) returns(stream SubscriptionMeResponse) {}
|
|
18
|
+
// Service-to-service: entitlements of many users at once (chat/data).
|
|
19
|
+
rpc EntitlementsByIds(EntitlementsByIdsRequest) returns(stream EntitlementsListResponse) {}
|
|
20
|
+
// RevenueCat webhook, forwarded by the gateway with its raw body.
|
|
21
|
+
rpc Webhook(SubscriptionWebhookRequest) returns(stream EmptyResponse) {}
|
|
22
|
+
// Support tools.
|
|
23
|
+
rpc AdminRead(ByIdRequest) returns(stream SubscriptionAdminResponse) {}
|
|
24
|
+
rpc AdminGrant(SubscriptionGrantRequest) returns(stream SubscriptionAdminResponse) {}
|
|
25
|
+
rpc AdminRevoke(SubscriptionRevokeRequest) returns(stream SubscriptionAdminResponse) {}
|
|
26
|
+
// Account deletion parity with every other micro.
|
|
27
|
+
rpc RemoveUserData(ByIdRequest) returns(stream EmptyResponse) {}
|
|
28
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package micro.v1.subscription;
|
|
4
|
+
|
|
5
|
+
import "micro/v1/general.proto";
|
|
6
|
+
|
|
7
|
+
// A person's standing on one plan. `plan` is the RevenueCat entitlement
|
|
8
|
+
// identifier (premium); the feature keys it unlocks live in jr-common
|
|
9
|
+
// utils/entitlements.
|
|
10
|
+
message SubscriptionInfo {
|
|
11
|
+
string plan = 1;
|
|
12
|
+
// active | cancelled (renewal off, access until expires_at) | grace
|
|
13
|
+
// (payment failed, access until grace_until) | paused | expired | refunded
|
|
14
|
+
string status = 2;
|
|
15
|
+
string product_id = 3;
|
|
16
|
+
// app_store | play_store | promotional | stripe ...
|
|
17
|
+
string store = 4;
|
|
18
|
+
// production | sandbox
|
|
19
|
+
string environment = 5;
|
|
20
|
+
// normal | trial | intro | promotional | prepaid
|
|
21
|
+
string period_type = 6;
|
|
22
|
+
// RFC 3339, UTC. Empty when unknown.
|
|
23
|
+
string purchased_at = 7;
|
|
24
|
+
string original_purchase_at = 8;
|
|
25
|
+
string expires_at = 9;
|
|
26
|
+
string grace_until = 10;
|
|
27
|
+
// Until when the person keeps the features (expires_at or grace_until).
|
|
28
|
+
string access_until = 11;
|
|
29
|
+
bool auto_renew = 12;
|
|
30
|
+
// purchased | family_shared
|
|
31
|
+
string ownership_type = 13;
|
|
32
|
+
// Google pause: when billing resumes.
|
|
33
|
+
string auto_resume_at = 14;
|
|
34
|
+
// Store page where the person manages the subscription (may be empty).
|
|
35
|
+
string management_url = 15;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// One unlocked feature. `key` is a catalogue key such as badge.premium;
|
|
39
|
+
// `expires_at` empty means no end date (manual grants).
|
|
40
|
+
message EntitlementInfo {
|
|
41
|
+
string key = 1;
|
|
42
|
+
string expires_at = 2;
|
|
43
|
+
string plan = 3;
|
|
44
|
+
// subscription | promotional
|
|
45
|
+
string source = 4;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message SubscriptionMeResponse {
|
|
49
|
+
ResponseStatus status = 1;
|
|
50
|
+
optional SubscriptionInfo subscription = 2;
|
|
51
|
+
repeated EntitlementInfo entitlements = 3;
|
|
52
|
+
// When the store was last consulted for this person (RFC 3339).
|
|
53
|
+
string synced_at = 4;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message EntitlementsByIdsRequest {
|
|
57
|
+
repeated string user_ids = 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message UserEntitlements {
|
|
61
|
+
string user_id = 1;
|
|
62
|
+
repeated EntitlementInfo entitlements = 2;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
message EntitlementsListResponse {
|
|
66
|
+
ResponseStatus status = 1;
|
|
67
|
+
repeated UserEntitlements data = 2;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// The webhook exactly as RevenueCat sent it. The body stays raw so the
|
|
71
|
+
// HMAC signature can be checked over the original bytes.
|
|
72
|
+
message SubscriptionWebhookRequest {
|
|
73
|
+
string authorization = 1;
|
|
74
|
+
string signature = 2;
|
|
75
|
+
string raw_body = 3;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
message SubscriptionEventInfo {
|
|
79
|
+
string id = 1;
|
|
80
|
+
string type = 2;
|
|
81
|
+
string store = 3;
|
|
82
|
+
string product_id = 4;
|
|
83
|
+
string environment = 5;
|
|
84
|
+
string received_at = 6;
|
|
85
|
+
string processed_at = 7;
|
|
86
|
+
string error = 8;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
message SubscriptionAdminResponse {
|
|
90
|
+
ResponseStatus status = 1;
|
|
91
|
+
repeated SubscriptionInfo subscriptions = 2;
|
|
92
|
+
repeated EntitlementInfo entitlements = 3;
|
|
93
|
+
// Newest first, capped.
|
|
94
|
+
repeated SubscriptionEventInfo events = 4;
|
|
95
|
+
string synced_at = 5;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Support: give a plan for a while without a purchase (goes through the
|
|
99
|
+
// store layer as a promotional entitlement, so it is visible everywhere).
|
|
100
|
+
// duration: daily | three_day | weekly | monthly | two_month | three_month
|
|
101
|
+
// | six_month | yearly | lifetime
|
|
102
|
+
message SubscriptionGrantRequest {
|
|
103
|
+
string user_id = 1;
|
|
104
|
+
string plan = 2;
|
|
105
|
+
string duration = 3;
|
|
106
|
+
string note = 4;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
message SubscriptionRevokeRequest {
|
|
110
|
+
string user_id = 1;
|
|
111
|
+
string plan = 2;
|
|
112
|
+
}
|
|
@@ -76,6 +76,8 @@ service PProfileService {
|
|
|
76
76
|
rpc Followers(PaginateRequest) returns(stream ProfileListResponse) {}
|
|
77
77
|
rpc ProfilesByIds(ProfilesByIdsRequest) returns(stream ProfileListResponse) {}
|
|
78
78
|
rpc Following(PaginateRequest) returns(stream ProfileListResponse) {}
|
|
79
|
+
// Service-to-service only (internal hash, no user token).
|
|
80
|
+
rpc SetSubscriptionBadge(SubscriptionBadgeRequest) returns(stream UserBadgesResponse) {}
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
// Admin
|
|
@@ -49,6 +49,17 @@ message UserBadgesResponse {
|
|
|
49
49
|
repeated string badges = 2;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
// Internal (subscription service): keep a plan's badge in step with the
|
|
53
|
+
// plan. active=true (re)grants with source=subscription until expires_at
|
|
54
|
+
// (RFC 3339, empty = open-ended); active=false revokes it. Never touches
|
|
55
|
+
// badges granted by hand.
|
|
56
|
+
message SubscriptionBadgeRequest {
|
|
57
|
+
string user_id = 1;
|
|
58
|
+
string badge = 2;
|
|
59
|
+
bool active = 3;
|
|
60
|
+
string expires_at = 4;
|
|
61
|
+
}
|
|
62
|
+
|
|
52
63
|
enum TfaSelectionEnum { nothing = 0; sms = 1; authenticator = 2; }
|
|
53
64
|
|
|
54
65
|
message UserProfileDto {
|