@umapi/contracts 1.0.30 → 1.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ export declare enum ApiKeyStatus {
2
+ ACTIVE = "active",
3
+ REVOKED = "revoked"
4
+ }
5
+ export declare class ApiKeyIdentityDto {
6
+ id: string;
7
+ hash: string;
8
+ userId: string;
9
+ service: string;
10
+ scopes: string[];
11
+ status: ApiKeyStatus;
12
+ createdAt: string;
13
+ lastUsedAt?: string;
14
+ expiresAt?: string;
15
+ description?: string;
16
+ }
17
+ export declare class CreateApiKeyDto {
18
+ userId: string;
19
+ service: string;
20
+ scopes: string[];
21
+ description?: string;
22
+ expiresAt?: string;
23
+ }
24
+ export declare class RotateApiKeyDto {
25
+ scopes?: string[];
26
+ expiresAt?: string;
27
+ }
28
+ //# sourceMappingURL=api-key.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-key.dto.d.ts","sourceRoot":"","sources":["../../src/dto/api-key.dto.ts"],"names":[],"mappings":"AAGA,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED,qBAAa,iBAAiB;IAG5B,EAAE,EAAG,MAAM,CAAC;IAIZ,IAAI,EAAG,MAAM,CAAC;IAId,MAAM,EAAG,MAAM,CAAC;IAIhB,OAAO,EAAG,MAAM,CAAC;IAIjB,MAAM,EAAG,MAAM,EAAE,CAAC;IAIlB,MAAM,EAAG,YAAY,CAAC;IAItB,SAAS,EAAG,MAAM,CAAC;IAKnB,UAAU,CAAC,EAAE,MAAM,CAAC;IAKpB,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,eAAe;IAG1B,MAAM,EAAG,MAAM,CAAC;IAIhB,OAAO,EAAG,MAAM,CAAC;IAIjB,MAAM,EAAG,MAAM,EAAE,CAAC;IAKlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,eAAe;IAI1B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAKlB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RotateApiKeyDto = exports.CreateApiKeyDto = exports.ApiKeyIdentityDto = exports.ApiKeyStatus = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const swagger_1 = require("@nestjs/swagger");
15
+ var ApiKeyStatus;
16
+ (function (ApiKeyStatus) {
17
+ ApiKeyStatus["ACTIVE"] = "active";
18
+ ApiKeyStatus["REVOKED"] = "revoked";
19
+ })(ApiKeyStatus || (exports.ApiKeyStatus = ApiKeyStatus = {}));
20
+ class ApiKeyIdentityDto {
21
+ }
22
+ exports.ApiKeyIdentityDto = ApiKeyIdentityDto;
23
+ __decorate([
24
+ (0, swagger_1.ApiProperty)({ description: 'ID API-ключа' }),
25
+ (0, class_validator_1.IsString)(),
26
+ __metadata("design:type", String)
27
+ ], ApiKeyIdentityDto.prototype, "id", void 0);
28
+ __decorate([
29
+ (0, swagger_1.ApiProperty)({ description: 'Хэш API-ключа' }),
30
+ (0, class_validator_1.IsString)(),
31
+ __metadata("design:type", String)
32
+ ], ApiKeyIdentityDto.prototype, "hash", void 0);
33
+ __decorate([
34
+ (0, swagger_1.ApiProperty)({ description: 'ID пользователя' }),
35
+ (0, class_validator_1.IsString)(),
36
+ __metadata("design:type", String)
37
+ ], ApiKeyIdentityDto.prototype, "userId", void 0);
38
+ __decorate([
39
+ (0, swagger_1.ApiProperty)({ description: 'Сервис, к которому привязан ключ' }),
40
+ (0, class_validator_1.IsString)(),
41
+ __metadata("design:type", String)
42
+ ], ApiKeyIdentityDto.prototype, "service", void 0);
43
+ __decorate([
44
+ (0, swagger_1.ApiProperty)({ description: 'Scope\'ы ключа' }),
45
+ (0, class_validator_1.IsArray)(),
46
+ __metadata("design:type", Array)
47
+ ], ApiKeyIdentityDto.prototype, "scopes", void 0);
48
+ __decorate([
49
+ (0, swagger_1.ApiProperty)({ description: 'Статус ключа' }),
50
+ (0, class_validator_1.IsEnum)(ApiKeyStatus),
51
+ __metadata("design:type", String)
52
+ ], ApiKeyIdentityDto.prototype, "status", void 0);
53
+ __decorate([
54
+ (0, swagger_1.ApiProperty)({ description: 'Дата создания' }),
55
+ (0, class_validator_1.IsDateString)(),
56
+ __metadata("design:type", String)
57
+ ], ApiKeyIdentityDto.prototype, "createdAt", void 0);
58
+ __decorate([
59
+ (0, swagger_1.ApiProperty)({ description: 'Дата последнего использования' }),
60
+ (0, class_validator_1.IsDateString)(),
61
+ (0, class_validator_1.IsOptional)(),
62
+ __metadata("design:type", String)
63
+ ], ApiKeyIdentityDto.prototype, "lastUsedAt", void 0);
64
+ __decorate([
65
+ (0, swagger_1.ApiProperty)({ description: 'Дата истечения' }),
66
+ (0, class_validator_1.IsDateString)(),
67
+ (0, class_validator_1.IsOptional)(),
68
+ __metadata("design:type", String)
69
+ ], ApiKeyIdentityDto.prototype, "expiresAt", void 0);
70
+ __decorate([
71
+ (0, swagger_1.ApiProperty)({ description: 'Описание ключа' }),
72
+ (0, class_validator_1.IsString)(),
73
+ (0, class_validator_1.IsOptional)(),
74
+ __metadata("design:type", String)
75
+ ], ApiKeyIdentityDto.prototype, "description", void 0);
76
+ class CreateApiKeyDto {
77
+ }
78
+ exports.CreateApiKeyDto = CreateApiKeyDto;
79
+ __decorate([
80
+ (0, swagger_1.ApiProperty)({ description: 'ID пользователя' }),
81
+ (0, class_validator_1.IsString)(),
82
+ __metadata("design:type", String)
83
+ ], CreateApiKeyDto.prototype, "userId", void 0);
84
+ __decorate([
85
+ (0, swagger_1.ApiProperty)({ description: 'Сервис' }),
86
+ (0, class_validator_1.IsString)(),
87
+ __metadata("design:type", String)
88
+ ], CreateApiKeyDto.prototype, "service", void 0);
89
+ __decorate([
90
+ (0, swagger_1.ApiProperty)({ description: 'Scope\'ы' }),
91
+ (0, class_validator_1.IsArray)(),
92
+ __metadata("design:type", Array)
93
+ ], CreateApiKeyDto.prototype, "scopes", void 0);
94
+ __decorate([
95
+ (0, swagger_1.ApiProperty)({ description: 'Описание' }),
96
+ (0, class_validator_1.IsString)(),
97
+ (0, class_validator_1.IsOptional)(),
98
+ __metadata("design:type", String)
99
+ ], CreateApiKeyDto.prototype, "description", void 0);
100
+ __decorate([
101
+ (0, swagger_1.ApiProperty)({ description: 'Дата истечения' }),
102
+ (0, class_validator_1.IsDateString)(),
103
+ (0, class_validator_1.IsOptional)(),
104
+ __metadata("design:type", String)
105
+ ], CreateApiKeyDto.prototype, "expiresAt", void 0);
106
+ class RotateApiKeyDto {
107
+ }
108
+ exports.RotateApiKeyDto = RotateApiKeyDto;
109
+ __decorate([
110
+ (0, swagger_1.ApiProperty)({ description: 'Новые scope\'ы' }),
111
+ (0, class_validator_1.IsArray)(),
112
+ (0, class_validator_1.IsOptional)(),
113
+ __metadata("design:type", Array)
114
+ ], RotateApiKeyDto.prototype, "scopes", void 0);
115
+ __decorate([
116
+ (0, swagger_1.ApiProperty)({ description: 'Новая дата истечения' }),
117
+ (0, class_validator_1.IsDateString)(),
118
+ (0, class_validator_1.IsOptional)(),
119
+ __metadata("design:type", String)
120
+ ], RotateApiKeyDto.prototype, "expiresAt", void 0);
121
+ //# sourceMappingURL=api-key.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-key.dto.js","sourceRoot":"","sources":["../../src/dto/api-key.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiG;AACjG,6CAA8C;AAE9C,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;AACrB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAED,MAAa,iBAAiB;CA2C7B;AA3CD,8CA2CC;AAxCC;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;IAC5C,IAAA,0BAAQ,GAAE;;6CACC;AAIZ;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;IAC7C,IAAA,0BAAQ,GAAE;;+CACG;AAId;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IAC/C,IAAA,0BAAQ,GAAE;;iDACK;AAIhB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;IAChE,IAAA,0BAAQ,GAAE;;kDACM;AAIjB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAC9C,IAAA,yBAAO,GAAE;;iDACQ;AAIlB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;IAC5C,IAAA,wBAAM,EAAC,YAAY,CAAC;;iDACC;AAItB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;IAC7C,IAAA,8BAAY,GAAE;;oDACI;AAKnB;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAC7D,IAAA,8BAAY,GAAE;IACd,IAAA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'./bind-identifier-success-resp
17
17
  export { ConfirmNewIdentifierRequestDto } from './confirm-new-identifier-request.dto';
18
18
  export { UpdateProfileDto } from './update-profile.dto';
19
19
  export { GetProfileResponseDto } from './get-profile-response.dto';
20
+ export { SubscriptionPlanDto, FeatureDto } from './subscription-plan.dto';
21
+ export { UserSubscriptionDto, SubscriptionStatus } from './user-subscription.dto';
22
+ export { ApiKeyIdentityDto, CreateApiKeyDto, RotateApiKeyDto, ApiKeyStatus } from './api-key.dto';
20
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CA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E,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
package/dist/dto/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetProfileResponseDto = exports.UpdateProfileDto = exports.ConfirmNewIdentifierRequestDto = exports.BindIdentifierSuccessResponseDto = exports.BindIdentifierResponseDto = exports.BindIdentifierRequestDto = exports.UserResponseDto = exports.UserRequestDto = exports.TokensResponseDto = exports.ServiceResponseSuccessDto = exports.ServiceResponseErrorDto = exports.RefreshTokensResponseDto = exports.RefreshTokenRequestDto = exports.OtpVerifyRequestDto = exports.OtpResponseDto = exports.OtpRequestDto = exports.HealthResponseDto = exports.HealthResponseServiceDto = exports.AppInfoServiceResponseDto = exports.AppInfoResponseDto = void 0;
3
+ exports.ApiKeyStatus = exports.RotateApiKeyDto = exports.CreateApiKeyDto = exports.ApiKeyIdentityDto = exports.SubscriptionStatus = exports.UserSubscriptionDto = exports.FeatureDto = exports.SubscriptionPlanDto = exports.GetProfileResponseDto = exports.UpdateProfileDto = exports.ConfirmNewIdentifierRequestDto = exports.BindIdentifierSuccessResponseDto = exports.BindIdentifierResponseDto = exports.BindIdentifierRequestDto = exports.UserResponseDto = exports.UserRequestDto = exports.TokensResponseDto = exports.ServiceResponseSuccessDto = exports.ServiceResponseErrorDto = exports.RefreshTokensResponseDto = exports.RefreshTokenRequestDto = exports.OtpVerifyRequestDto = exports.OtpResponseDto = exports.OtpRequestDto = exports.HealthResponseDto = exports.HealthResponseServiceDto = exports.AppInfoServiceResponseDto = exports.AppInfoResponseDto = void 0;
4
4
  var app_info_response_dto_1 = require("./app-info-response.dto");
5
5
  Object.defineProperty(exports, "AppInfoResponseDto", { enumerable: true, get: function () { return app_info_response_dto_1.AppInfoResponseDto; } });
6
6
  var app_info_service_response_dto_1 = require("./app-info-service-response.dto");
@@ -40,4 +40,15 @@ var update_profile_dto_1 = require("./update-profile.dto");
40
40
  Object.defineProperty(exports, "UpdateProfileDto", { enumerable: true, get: function () { return update_profile_dto_1.UpdateProfileDto; } });
41
41
  var get_profile_response_dto_1 = require("./get-profile-response.dto");
42
42
  Object.defineProperty(exports, "GetProfileResponseDto", { enumerable: true, get: function () { return get_profile_response_dto_1.GetProfileResponseDto; } });
43
+ var subscription_plan_dto_1 = require("./subscription-plan.dto");
44
+ Object.defineProperty(exports, "SubscriptionPlanDto", { enumerable: true, get: function () { return subscription_plan_dto_1.SubscriptionPlanDto; } });
45
+ Object.defineProperty(exports, "FeatureDto", { enumerable: true, get: function () { return subscription_plan_dto_1.FeatureDto; } });
46
+ var user_subscription_dto_1 = require("./user-subscription.dto");
47
+ Object.defineProperty(exports, "UserSubscriptionDto", { enumerable: true, get: function () { return user_subscription_dto_1.UserSubscriptionDto; } });
48
+ Object.defineProperty(exports, "SubscriptionStatus", { enumerable: true, get: function () { return user_subscription_dto_1.SubscriptionStatus; } });
49
+ var api_key_dto_1 = require("./api-key.dto");
50
+ Object.defineProperty(exports, "ApiKeyIdentityDto", { enumerable: true, get: function () { return api_key_dto_1.ApiKeyIdentityDto; } });
51
+ Object.defineProperty(exports, "CreateApiKeyDto", { enumerable: true, get: function () { return api_key_dto_1.CreateApiKeyDto; } });
52
+ Object.defineProperty(exports, "RotateApiKeyDto", { enumerable: true, get: function () { return api_key_dto_1.RotateApiKeyDto; } });
53
+ Object.defineProperty(exports, "ApiKeyStatus", { enumerable: true, get: function () { return api_key_dto_1.ApiKeyStatus; } });
43
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":";;;AAAA,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAC3B,iFAA4E;AAAnE,0IAAA,yBAAyB,OAAA;AAClC,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAC/B,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,+DAA6G;AAAnF,+HAAA,uBAAuB,OAAA;AAAE,iIAAA,yBAAyB,OAAA;AAC5E,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,yDAAsD;AAA7C,oHAAA,eAAe,OAAA;AACxB,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA;AAClC,+FAA0F;AAAjF,wJAAA,gCAAgC,OAAA;AACzC,2FAAsF;AAA7E,oJAAA,8BAA8B,OAAA;AACvC,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AACzB,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dto/index.ts"],"names":[],"mappings":";;;AAAA,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAC3B,iFAA4E;AAAnE,0IAAA,yBAAyB,OAAA;AAClC,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,mEAA+D;AAAtD,6HAAA,mBAAmB,OAAA;AAC5B,yEAAqE;AAA5D,mIAAA,sBAAsB,OAAA;AAC/B,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,+DAA6G;AAAnF,+HAAA,uBAAuB,OAAA;AAAE,iIAAA,yBAAyB,OAAA;AAC5E,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,uDAAoD;AAA3C,kHAAA,cAAc,OAAA;AACvB,yDAAsD;AAA7C,oHAAA,eAAe,OAAA;AACxB,6EAAyE;AAAhE,uIAAA,wBAAwB,OAAA;AACjC,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA;AAClC,+FAA0F;AAAjF,wJAAA,gCAAgC,OAAA;AACzC,2FAAsF;AAA7E,oJAAA,8BAA8B,OAAA;AACvC,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AACzB,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,iEAA0E;AAAjE,4HAAA,mBAAmB,OAAA;AAAE,mHAAA,UAAU,OAAA;AACxC,iEAAkF;AAAzE,4HAAA,mBAAmB,OAAA;AAAE,2HAAA,kBAAkB,OAAA;AAChD,6CAAkG;AAAzF,gHAAA,iBAAiB,OAAA;AAAE,8GAAA,eAAe,OAAA;AAAE,8GAAA,eAAe,OAAA;AAAE,2GAAA,YAAY,OAAA"}
@@ -0,0 +1,18 @@
1
+ export declare class FeatureDto {
2
+ name: string;
3
+ limit: number;
4
+ unit?: string;
5
+ }
6
+ export declare class SubscriptionPlanDto {
7
+ id: string;
8
+ name: string;
9
+ description: string;
10
+ price: number;
11
+ currency: string;
12
+ billingPeriod: string;
13
+ service: string;
14
+ features: FeatureDto[];
15
+ isActive: boolean;
16
+ metadata?: Record<string, any>;
17
+ }
18
+ //# sourceMappingURL=subscription-plan.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-plan.dto.d.ts","sourceRoot":"","sources":["../../src/dto/subscription-plan.dto.ts"],"names":[],"mappings":"AAIA,qBAAa,UAAU;IAGrB,IAAI,EAAG,MAAM,CAAC;IAId,KAAK,EAAG,MAAM,CAAC;IAKf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,mBAAmB;IAG9B,EAAE,EAAG,MAAM,CAAC;IAIZ,IAAI,EAAG,MAAM,CAAC;IAId,WAAW,EAAG,MAAM,CAAC;IAIrB,KAAK,EAAG,MAAM,CAAC;IAIf,QAAQ,EAAG,MAAM,CAAC;IAIlB,aAAa,EAAG,MAAM,CAAC;IAIvB,OAAO,EAAG,MAAM,CAAC;IAMjB,QAAQ,EAAG,UAAU,EAAE,CAAC;IAIxB,QAAQ,EAAG,OAAO,CAAC;IAInB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC"}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SubscriptionPlanDto = exports.FeatureDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const class_transformer_1 = require("class-transformer");
15
+ const swagger_1 = require("@nestjs/swagger");
16
+ class FeatureDto {
17
+ }
18
+ exports.FeatureDto = FeatureDto;
19
+ __decorate([
20
+ (0, swagger_1.ApiProperty)({ description: 'Название фичи' }),
21
+ (0, class_validator_1.IsString)(),
22
+ __metadata("design:type", String)
23
+ ], FeatureDto.prototype, "name", void 0);
24
+ __decorate([
25
+ (0, swagger_1.ApiProperty)({ description: 'Значение лимита (-1 для бесконечного)' }),
26
+ (0, class_validator_1.IsNumber)(),
27
+ __metadata("design:type", Number)
28
+ ], FeatureDto.prototype, "limit", void 0);
29
+ __decorate([
30
+ (0, swagger_1.ApiProperty)({ description: 'Единица измерения' }),
31
+ (0, class_validator_1.IsString)(),
32
+ (0, class_validator_1.IsOptional)(),
33
+ __metadata("design:type", String)
34
+ ], FeatureDto.prototype, "unit", void 0);
35
+ class SubscriptionPlanDto {
36
+ }
37
+ exports.SubscriptionPlanDto = SubscriptionPlanDto;
38
+ __decorate([
39
+ (0, swagger_1.ApiProperty)({ description: 'ID тарифа' }),
40
+ (0, class_validator_1.IsString)(),
41
+ __metadata("design:type", String)
42
+ ], SubscriptionPlanDto.prototype, "id", void 0);
43
+ __decorate([
44
+ (0, swagger_1.ApiProperty)({ description: 'Название тарифа' }),
45
+ (0, class_validator_1.IsString)(),
46
+ __metadata("design:type", String)
47
+ ], SubscriptionPlanDto.prototype, "name", void 0);
48
+ __decorate([
49
+ (0, swagger_1.ApiProperty)({ description: 'Описание тарифа' }),
50
+ (0, class_validator_1.IsString)(),
51
+ __metadata("design:type", String)
52
+ ], SubscriptionPlanDto.prototype, "description", void 0);
53
+ __decorate([
54
+ (0, swagger_1.ApiProperty)({ description: 'Цена в центах' }),
55
+ (0, class_validator_1.IsNumber)(),
56
+ __metadata("design:type", Number)
57
+ ], SubscriptionPlanDto.prototype, "price", void 0);
58
+ __decorate([
59
+ (0, swagger_1.ApiProperty)({ description: 'Валюта' }),
60
+ (0, class_validator_1.IsString)(),
61
+ __metadata("design:type", String)
62
+ ], SubscriptionPlanDto.prototype, "currency", void 0);
63
+ __decorate([
64
+ (0, swagger_1.ApiProperty)({ description: 'Период оплаты (day/month/year)' }),
65
+ (0, class_validator_1.IsString)(),
66
+ __metadata("design:type", String)
67
+ ], SubscriptionPlanDto.prototype, "billingPeriod", void 0);
68
+ __decorate([
69
+ (0, swagger_1.ApiProperty)({ description: 'Сервис, к которому относится тариф' }),
70
+ (0, class_validator_1.IsString)(),
71
+ __metadata("design:type", String)
72
+ ], SubscriptionPlanDto.prototype, "service", void 0);
73
+ __decorate([
74
+ (0, swagger_1.ApiProperty)({ description: 'Фичи тарифа' }),
75
+ (0, class_validator_1.IsArray)(),
76
+ (0, class_validator_1.ValidateNested)({ each: true }),
77
+ (0, class_transformer_1.Type)(() => FeatureDto),
78
+ __metadata("design:type", Array)
79
+ ], SubscriptionPlanDto.prototype, "features", void 0);
80
+ __decorate([
81
+ (0, swagger_1.ApiProperty)({ description: 'Активен ли тариф' }),
82
+ (0, class_validator_1.IsBoolean)(),
83
+ __metadata("design:type", Boolean)
84
+ ], SubscriptionPlanDto.prototype, "isActive", void 0);
85
+ __decorate([
86
+ (0, swagger_1.ApiProperty)({ description: 'Метаданные тарифа' }),
87
+ (0, class_validator_1.IsOptional)(),
88
+ __metadata("design:type", Object)
89
+ ], SubscriptionPlanDto.prototype, "metadata", void 0);
90
+ //# sourceMappingURL=subscription-plan.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-plan.dto.js","sourceRoot":"","sources":["../../src/dto/subscription-plan.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAqG;AACrG,yDAAyC;AACzC,6CAA8C;AAE9C,MAAa,UAAU;CAatB;AAbD,gCAaC;AAVC;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;IAC7C,IAAA,0BAAQ,GAAE;;wCACG;AAId;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;IACrE,IAAA,0BAAQ,GAAE;;yCACI;AAKf;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACjD,IAAA,0BAAQ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qDACkB"}
@@ -0,0 +1,18 @@
1
+ export declare enum SubscriptionStatus {
2
+ ACTIVE = "active",
3
+ PAUSED = "paused",
4
+ CANCELED = "canceled",
5
+ EXPIRED = "expired"
6
+ }
7
+ export declare class UserSubscriptionDto {
8
+ id: string;
9
+ userId: string;
10
+ planId: string;
11
+ status: SubscriptionStatus;
12
+ startDate: string;
13
+ endDate: string;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ metadata?: Record<string, any>;
17
+ }
18
+ //# sourceMappingURL=user-subscription.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-subscription.dto.d.ts","sourceRoot":"","sources":["../../src/dto/user-subscription.dto.ts"],"names":[],"mappings":"AAGA,oBAAY,kBAAkB;IAC5B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB;AAED,qBAAa,mBAAmB;IAG9B,EAAE,EAAG,MAAM,CAAC;IAIZ,MAAM,EAAG,MAAM,CAAC;IAIhB,MAAM,EAAG,MAAM,CAAC;IAIhB,MAAM,EAAG,kBAAkB,CAAC;IAI5B,SAAS,EAAG,MAAM,CAAC;IAInB,OAAO,EAAG,MAAM,CAAC;IAIjB,SAAS,EAAG,MAAM,CAAC;IAInB,SAAS,EAAG,MAAM,CAAC;IAInB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.UserSubscriptionDto = exports.SubscriptionStatus = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const swagger_1 = require("@nestjs/swagger");
15
+ var SubscriptionStatus;
16
+ (function (SubscriptionStatus) {
17
+ SubscriptionStatus["ACTIVE"] = "active";
18
+ SubscriptionStatus["PAUSED"] = "paused";
19
+ SubscriptionStatus["CANCELED"] = "canceled";
20
+ SubscriptionStatus["EXPIRED"] = "expired";
21
+ })(SubscriptionStatus || (exports.SubscriptionStatus = SubscriptionStatus = {}));
22
+ class UserSubscriptionDto {
23
+ }
24
+ exports.UserSubscriptionDto = UserSubscriptionDto;
25
+ __decorate([
26
+ (0, swagger_1.ApiProperty)({ description: 'ID подписки' }),
27
+ (0, class_validator_1.IsString)(),
28
+ __metadata("design:type", String)
29
+ ], UserSubscriptionDto.prototype, "id", void 0);
30
+ __decorate([
31
+ (0, swagger_1.ApiProperty)({ description: 'ID пользователя' }),
32
+ (0, class_validator_1.IsString)(),
33
+ __metadata("design:type", String)
34
+ ], UserSubscriptionDto.prototype, "userId", void 0);
35
+ __decorate([
36
+ (0, swagger_1.ApiProperty)({ description: 'ID тарифного плана' }),
37
+ (0, class_validator_1.IsString)(),
38
+ __metadata("design:type", String)
39
+ ], UserSubscriptionDto.prototype, "planId", void 0);
40
+ __decorate([
41
+ (0, swagger_1.ApiProperty)({ description: 'Статус подписки' }),
42
+ (0, class_validator_1.IsEnum)(SubscriptionStatus),
43
+ __metadata("design:type", String)
44
+ ], UserSubscriptionDto.prototype, "status", void 0);
45
+ __decorate([
46
+ (0, swagger_1.ApiProperty)({ description: 'Дата начала подписки' }),
47
+ (0, class_validator_1.IsDateString)(),
48
+ __metadata("design:type", String)
49
+ ], UserSubscriptionDto.prototype, "startDate", void 0);
50
+ __decorate([
51
+ (0, swagger_1.ApiProperty)({ description: 'Дата окончания подписки' }),
52
+ (0, class_validator_1.IsDateString)(),
53
+ __metadata("design:type", String)
54
+ ], UserSubscriptionDto.prototype, "endDate", void 0);
55
+ __decorate([
56
+ (0, swagger_1.ApiProperty)({ description: 'Дата создания' }),
57
+ (0, class_validator_1.IsDateString)(),
58
+ __metadata("design:type", String)
59
+ ], UserSubscriptionDto.prototype, "createdAt", void 0);
60
+ __decorate([
61
+ (0, swagger_1.ApiProperty)({ description: 'Дата последнего обновления' }),
62
+ (0, class_validator_1.IsDateString)(),
63
+ __metadata("design:type", String)
64
+ ], UserSubscriptionDto.prototype, "updatedAt", void 0);
65
+ __decorate([
66
+ (0, swagger_1.ApiProperty)({ description: 'Метаданные подписки' }),
67
+ (0, class_validator_1.IsOptional)(),
68
+ __metadata("design:type", Object)
69
+ ], UserSubscriptionDto.prototype, "metadata", void 0);
70
+ //# sourceMappingURL=user-subscription.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-subscription.dto.js","sourceRoot":"","sources":["../../src/dto/user-subscription.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuF;AACvF,6CAA8C;AAE9C,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;IACjB,2CAAqB,CAAA;IACrB,yCAAmB,CAAA;AACrB,CAAC,EALW,kBAAkB,kCAAlB,kBAAkB,QAK7B;AAED,MAAa,mBAAmB;CAoC/B;AApCD,kDAoCC;AAjCC;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;IAC3C,IAAA,0BAAQ,GAAE;;+CACC;AAIZ;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IAC/C,IAAA,0BAAQ,GAAE;;mDACK;AAIhB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;IAClD,IAAA,0BAAQ,GAAE;;mDACK;AAIhB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IAC/C,IAAA,wBAAM,EAAC,kBAAkB,CAAC;;mDACC;AAI5B;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACpD,IAAA,8BAAY,GAAE;;sDACI;AAInB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;IACvD,IAAA,8BAAY,GAAE;;oDACE;AAIjB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;IAC7C,IAAA,8BAAY,GAAE;;sDACI;AAInB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;IAC1D,IAAA,8BAAY,GAAE;;sDACI;AAInB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACnD,IAAA,4BAAU,GAAE;;qDACkB"}
@@ -0,0 +1,16 @@
1
+ export interface CheckAccessRequest {
2
+ subject: {
3
+ type: string;
4
+ id: string;
5
+ service: string;
6
+ scopes: string[];
7
+ };
8
+ service: string;
9
+ action: string;
10
+ }
11
+ export interface CheckAccessResponse {
12
+ allowed: boolean;
13
+ reason?: string;
14
+ limits?: Record<string, any>;
15
+ }
16
+ //# sourceMappingURL=access-check.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-check.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/access-check.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=access-check.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-check.interface.js","sourceRoot":"","sources":["../../src/interfaces/access-check.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ export declare enum AccessSubjectType {
2
+ USER = "user",
3
+ API_KEY = "api_key"
4
+ }
5
+ export interface AccessSubject {
6
+ type: AccessSubjectType;
7
+ id: string;
8
+ service: string;
9
+ scopes: string[];
10
+ metadata?: Record<string, any>;
11
+ }
12
+ export interface UserSubject extends AccessSubject {
13
+ type: AccessSubjectType.USER;
14
+ userId: string;
15
+ }
16
+ export interface ApiKeySubject extends AccessSubject {
17
+ type: AccessSubjectType.API_KEY;
18
+ apiKeyId: string;
19
+ }
20
+ //# sourceMappingURL=access-subject.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-subject.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/access-subject.interface.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,iBAAiB,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccessSubjectType = void 0;
4
+ var AccessSubjectType;
5
+ (function (AccessSubjectType) {
6
+ AccessSubjectType["USER"] = "user";
7
+ AccessSubjectType["API_KEY"] = "api_key";
8
+ })(AccessSubjectType || (exports.AccessSubjectType = AccessSubjectType = {}));
9
+ //# sourceMappingURL=access-subject.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-subject.interface.js","sourceRoot":"","sources":["../../src/interfaces/access-subject.interface.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,kCAAa,CAAA;IACb,wCAAmB,CAAA;AACrB,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B"}
@@ -1,4 +1,6 @@
1
1
  export * from './auth.interface';
2
2
  export * from './base.interface';
3
3
  export * from './error.interface';
4
+ export * from './access-subject.interface';
5
+ export * from './access-check.interface';
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC"}
@@ -18,4 +18,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  __exportStar(require("./auth.interface"), exports);
19
19
  __exportStar(require("./base.interface"), exports);
20
20
  __exportStar(require("./error.interface"), exports);
21
+ __exportStar(require("./access-subject.interface"), exports);
22
+ __exportStar(require("./access-check.interface"), exports);
21
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2BAA2B;AAC3B,mDAAiC;AACjC,mDAAiC;AACjC,oDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2BAA2B;AAC3B,mDAAiC;AACjC,mDAAiC;AACjC,oDAAkC;AAClC,6DAA2C;AAC3C,2DAAyC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umapi/contracts",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "Shared contracts for UMAPI microservices",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",