@talkplay/shared-types 1.0.9 → 1.0.11

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/index.d.mts CHANGED
@@ -36,6 +36,59 @@ declare const JobsEnum: {
36
36
  };
37
37
  type JobsEnum = Enum<typeof JobsEnum>;
38
38
 
39
+ declare enum TkplayErrorCodesEnum {
40
+ MODULE_NAME_IS_TAKEN = "MODULE_NAME_IS_TAKEN",
41
+ MODULE_NOT_FOUND = "MODULE_NOT_FOUND",
42
+ PLAN_NAME_IS_TAKEN = "PLAN_NAME_IS_TAKEN",
43
+ PLAN_AMOUNT_INVALID = "PLAN_AMOUNT_INVALID",
44
+ RADIO_EMAIL_IS_TAKEN = "RADIO_EMAIL_IS_TAKEN",
45
+ RADIO_CNPJ_IS_TAKEN = "RADIO_CNPJ_IS_TAKEN",
46
+ RADIO_NOT_FOUND = "RADIO_NOT_FOUND",
47
+ RADIO_CONTRACT_NOT_FOUND = "RADIO_CONTRACT_NOT_FOUND",
48
+ RADIO_DIRECTOR_NOT_FOUND = "RADIO_DIRECTOR_NOT_FOUND",
49
+ RADIO_DIFF = "RADIO_DIFF",
50
+ INVALID_AUTH_TOKEN = "INVALID_AUTH_TOKEN",
51
+ MISSING_AUTH_TOKEN = "MISSING_AUTH_TOKEN",
52
+ WRONG_PASSWORD = "WRONG_PASSWORD",
53
+ RADIO_INACTIVE = "RADIO_INACTIVE",
54
+ RADIO_PAYMENT_DELINQUENT = "RADIO_PAYMENT_DELINQUENT",
55
+ SESSION_NOT_FOUND = "SESSION_NOT_FOUND",
56
+ FORBIDDEN_SESSION_TYPE = "FORBIDDEN_SESSION_TYPE",
57
+ FORBIDDEN_ROLE = "FORBIDDEN_ROLE",
58
+ PAYMENT_UNAUTHORIZED = "PAYMENT_UNAUTHORIZED",
59
+ PAYMENT_FAIL = "PAYMENT_FAIL",
60
+ SUBSCRIPTION_NOT_FOUND = "SUBSCRIPTION_NOT_FOUND",
61
+ LEGAL_TERMS_NOT_FOUND = "LEGAL_TERMS_NOT_FOUND",
62
+ LEGAL_TERM_INACTIVE = "LEGAL_TERM_INACTIVE",
63
+ LEGAL_TERM_TYPE_INVALID = "LEGAL_TERM_TYPE_INVALID",
64
+ COUPON_NOT_FOUND = "COUPON_NOT_FOUND",
65
+ INVALID_COUPON_DISCOUNT = "INVALID_COUPON_DISCOUNT",
66
+ COUPON_CODE_IS_TAKEN = "COUPON_CODE_IS_TAKEN",
67
+ PAST_COUPON_VALIDATION = "PAST_COUPON_VALIDATION",
68
+ USER_NOT_FOUND = "USER_NOT_FOUND",
69
+ USER_EMAIL_IS_TAKEN = "USER_EMAIL_IS_TAKEN",
70
+ USER_PASSWORDS_DONT_MATCH = "USER_PASSWORDS_DONT_MATCH",
71
+ UNABLE_TO_DELETE_USER = "UNABLE_TO_DELETE_USER"
72
+ }
73
+
74
+ declare enum TkplayErrorNamesEnum {
75
+ EFI_ERROR = "EfiError",// 400
76
+ BILLING_ERROR = "BillingError",// 402
77
+ BAD_REQUEST = "BadRequest",// 400
78
+ UNAUTHORIZED = "Unauthorized",// 401
79
+ FORBIDDEN = "Forbidden",// 403
80
+ NOT_FOUND = "NotFound",// 404
81
+ METHOD_NOT_ALLOWED = "MethodNotAllowed",// 405
82
+ CONFLICT = "Conflict",// 409
83
+ UNPROCESSABLE_ENTITY = "UnprocessableEntity",// 422
84
+ TOO_MANY_REQUESTS = "TooManyRequests",// 429
85
+ INTERNAL_SERVER_ERROR = "InternalServerError",// 500
86
+ NOT_IMPLEMENTED = "NotImplemented",// 501
87
+ BAD_GATEWAY = "BadGateway",// 502
88
+ SERVICE_UNAVAILABLE = "ServiceUnavailable",// 503
89
+ GATEWAY_TIMEOUT = "GatewayTimeout"
90
+ }
91
+
39
92
  declare const SessionTypesEnum: {
40
93
  readonly RADIO_USER: "RADIO_USER";
41
94
  readonly SYSTEM_USER: "SYSTEM_USER";
@@ -247,59 +300,6 @@ type AddressEntity = {
247
300
  state: BrStatesEnum;
248
301
  };
249
302
 
250
- declare enum TkplayErrorCodesEnum {
251
- MODULE_NAME_IS_TAKEN = "MODULE_NAME_IS_TAKEN",
252
- MODULE_NOT_FOUND = "MODULE_NOT_FOUND",
253
- PLAN_NAME_IS_TAKEN = "PLAN_NAME_IS_TAKEN",
254
- PLAN_AMOUNT_INVALID = "PLAN_AMOUNT_INVALID",
255
- RADIO_EMAIL_IS_TAKEN = "RADIO_EMAIL_IS_TAKEN",
256
- RADIO_CNPJ_IS_TAKEN = "RADIO_CNPJ_IS_TAKEN",
257
- RADIO_NOT_FOUND = "RADIO_NOT_FOUND",
258
- RADIO_CONTRACT_NOT_FOUND = "RADIO_CONTRACT_NOT_FOUND",
259
- RADIO_DIRECTOR_NOT_FOUND = "RADIO_DIRECTOR_NOT_FOUND",
260
- RADIO_DIFF = "RADIO_DIFF",
261
- INVALID_AUTH_TOKEN = "INVALID_AUTH_TOKEN",
262
- MISSING_AUTH_TOKEN = "MISSING_AUTH_TOKEN",
263
- WRONG_PASSWORD = "WRONG_PASSWORD",
264
- RADIO_INACTIVE = "RADIO_INACTIVE",
265
- RADIO_PAYMENT_DELINQUENT = "RADIO_PAYMENT_DELINQUENT",
266
- SESSION_NOT_FOUND = "SESSION_NOT_FOUND",
267
- FORBIDDEN_SESSION_TYPE = "FORBIDDEN_SESSION_TYPE",
268
- FORBIDDEN_ROLE = "FORBIDDEN_ROLE",
269
- PAYMENT_UNAUTHORIZED = "PAYMENT_UNAUTHORIZED",
270
- PAYMENT_FAIL = "PAYMENT_FAIL",
271
- SUBSCRIPTION_NOT_FOUND = "SUBSCRIPTION_NOT_FOUND",
272
- LEGAL_TERMS_NOT_FOUND = "LEGAL_TERMS_NOT_FOUND",
273
- LEGAL_TERM_INACTIVE = "LEGAL_TERM_INACTIVE",
274
- LEGAL_TERM_TYPE_INVALID = "LEGAL_TERM_TYPE_INVALID",
275
- COUPON_NOT_FOUND = "COUPON_NOT_FOUND",
276
- INVALID_COUPON_DISCOUNT = "INVALID_COUPON_DISCOUNT",
277
- COUPON_CODE_IS_TAKEN = "COUPON_CODE_IS_TAKEN",
278
- PAST_COUPON_VALIDATION = "PAST_COUPON_VALIDATION",
279
- USER_NOT_FOUND = "USER_NOT_FOUND",
280
- USER_EMAIL_IS_TAKEN = "USER_EMAIL_IS_TAKEN",
281
- USER_PASSWORDS_DONT_MATCH = "USER_PASSWORDS_DONT_MATCH",
282
- UNABLE_TO_DELETE_USER = "UNABLE_TO_DELETE_USER"
283
- }
284
-
285
- declare enum TkplayErrorNamesEnum {
286
- EFI_ERROR = "EfiError",// 400
287
- BILLING_ERROR = "BillingError",// 402
288
- BAD_REQUEST = "BadRequest",// 400
289
- UNAUTHORIZED = "Unauthorized",// 401
290
- FORBIDDEN = "Forbidden",// 403
291
- NOT_FOUND = "NotFound",// 404
292
- METHOD_NOT_ALLOWED = "MethodNotAllowed",// 405
293
- CONFLICT = "Conflict",// 409
294
- UNPROCESSABLE_ENTITY = "UnprocessableEntity",// 422
295
- TOO_MANY_REQUESTS = "TooManyRequests",// 429
296
- INTERNAL_SERVER_ERROR = "InternalServerError",// 500
297
- NOT_IMPLEMENTED = "NotImplemented",// 501
298
- BAD_GATEWAY = "BadGateway",// 502
299
- SERVICE_UNAVAILABLE = "ServiceUnavailable",// 503
300
- GATEWAY_TIMEOUT = "GatewayTimeout"
301
- }
302
-
303
303
  type TkplayErrorEntity = {
304
304
  message: string;
305
305
  name: `${TkplayErrorNamesEnum}`;
@@ -768,4 +768,10 @@ type EpisodeErrorEvt = {};
768
768
 
769
769
  type EpisodeProgressEvt = {};
770
770
 
771
- export { type AddressEntity, AudioBitratesEnum, AudioFormatsEnum, AudioFrequenciesEnum, type BaseEntity, BrStatesEnum, type CasterAvatarEntity, type CasterEntity, type ChargeEntity, ChargeItemTypesEnum, ChargeStatusEnum, type CouponActivationEntity, type CouponEntity, CouponTypesEnum, CouponTypesTranslationsEnum, type CreateCouponPayload, type CreateCouponResponse, type CreateLegalTermAgreementPayload, type CreateLegalTermPayload, type CreateLegalTermResponse, type CreateRadioPayload, type CreateRadioUserPayload, type CreateRadioUserResponse, type CreateSystemUserPayload, type Enum, EpGenerationQualityEnum, EpGenerationTypesEnum, type EpisodeCreatedEvt, type EpisodeErrorEvt, type EpisodeProgressEvt, FFmpegAudioCurveEnum, type GenerateEpJobPayload, type GenerateEpisodePayload, type GenerateEpisodeResponse, type GetCouponByIdResponse, type GetCouponValidationResponse, type GetPenaltyValueResponse, type GetRadioDetailsResponse, JobsEnum, type LegalTermEntity, LegalTermTypesEnum, LegalTermTypesTranslationsEnum, type ListChargesParams, type ListCouponsParams, type ListCouponsResponse, type ListLegalTermsParams, type ListLegalTermsResponse, type ListRadioUsersParams, type ListRadioUsersResponse, type ListRadiosParams, type ListRadiosResponse, type ListSystemModulesResponse, type ListSystemUsersParams, type ListSystemUsersResponse, type LoginPayload, type LoginResponse, type MusicProgramScriptElement, NewsCategoriesEnum, type NewsProgramScriptElement, type NewsProgramScriptElementOptions, type OffProgramScriptElement, type PaginatedResponseDTO, type Pagination, type PaginationParams, type PlanEntity, type PopulatedProgramScriptBlock, type PopulatedProgramScriptElement, type PopulatedProgramScriptEntity, type ProgramEntity, type ProgramEpisodeBlockEntity, type ProgramEpisodeEntity, type ProgramScriptElement, type ProgramScriptElementOptionsAll, ProgramScriptElementTypesEnum, type ProgramScriptEntity, RadioBandsEnum, type RadioContractEntity, type RadioEntity, type RadioLegalAgreementEntity, type RadioLogoEntity, type RadioSubscriptionEntity, RadioSubscriptionStatusEnum, type RadioUserAvatarEntity, type RadioUserEntity, S3DirectoriesEnum, type S3FileEntity, type ScriptBlock, type SessionEntity, SessionTypesEnum, type SessionUser, type SoundtrackProgramScriptElementOptions, type SystemModuleEntity, type SystemUserEntity, type TkplayErrorEntity, type UpdateCouponPayload, type UpdateCouponResponse, type UpdateRadioUserPasswordPayload, type UpdateRadioUserProfilePayload, type UpdateRadioUserResponse, type UpdateRadioUserRolePayload, type UpdateSystemUserPaswordPayload, type UpdateSystemUserPayload, type UpdateSystemUserResponse, type UpsertPlanPayload, type UpsertPlanResponse, type UpsertSystemModulePayload, type UpsertSystemModuleResponse, type UpsertSystemUserResponse, type UserLegalAgreementEntity, UserRolesEnum, UserRolesTranslationsEnum, type VignetteProgramScriptElement };
771
+ type TkplayMappedErrors = Record<`${TkplayErrorCodesEnum}`, string | ((args: any) => string)>;
772
+ declare const tkplayErrorsMap: TkplayMappedErrors;
773
+
774
+ type TkplayMappedErrors__Ptbr = Record<`${TkplayErrorCodesEnum}`, string>;
775
+ declare const tkplayErrrosPtbr: TkplayMappedErrors__Ptbr;
776
+
777
+ export { type AddressEntity, AudioBitratesEnum, AudioFormatsEnum, AudioFrequenciesEnum, type BaseEntity, BrStatesEnum, type CasterAvatarEntity, type CasterEntity, type ChargeEntity, ChargeItemTypesEnum, ChargeStatusEnum, type CouponActivationEntity, type CouponEntity, CouponTypesEnum, CouponTypesTranslationsEnum, type CreateCouponPayload, type CreateCouponResponse, type CreateLegalTermAgreementPayload, type CreateLegalTermPayload, type CreateLegalTermResponse, type CreateRadioPayload, type CreateRadioUserPayload, type CreateRadioUserResponse, type CreateSystemUserPayload, type Enum, EpGenerationQualityEnum, EpGenerationTypesEnum, type EpisodeCreatedEvt, type EpisodeErrorEvt, type EpisodeProgressEvt, FFmpegAudioCurveEnum, type GenerateEpJobPayload, type GenerateEpisodePayload, type GenerateEpisodeResponse, type GetCouponByIdResponse, type GetCouponValidationResponse, type GetPenaltyValueResponse, type GetRadioDetailsResponse, JobsEnum, type LegalTermEntity, LegalTermTypesEnum, LegalTermTypesTranslationsEnum, type ListChargesParams, type ListCouponsParams, type ListCouponsResponse, type ListLegalTermsParams, type ListLegalTermsResponse, type ListRadioUsersParams, type ListRadioUsersResponse, type ListRadiosParams, type ListRadiosResponse, type ListSystemModulesResponse, type ListSystemUsersParams, type ListSystemUsersResponse, type LoginPayload, type LoginResponse, type MusicProgramScriptElement, NewsCategoriesEnum, type NewsProgramScriptElement, type NewsProgramScriptElementOptions, type OffProgramScriptElement, type PaginatedResponseDTO, type Pagination, type PaginationParams, type PlanEntity, type PopulatedProgramScriptBlock, type PopulatedProgramScriptElement, type PopulatedProgramScriptEntity, type ProgramEntity, type ProgramEpisodeBlockEntity, type ProgramEpisodeEntity, type ProgramScriptElement, type ProgramScriptElementOptionsAll, ProgramScriptElementTypesEnum, type ProgramScriptEntity, RadioBandsEnum, type RadioContractEntity, type RadioEntity, type RadioLegalAgreementEntity, type RadioLogoEntity, type RadioSubscriptionEntity, RadioSubscriptionStatusEnum, type RadioUserAvatarEntity, type RadioUserEntity, S3DirectoriesEnum, type S3FileEntity, type ScriptBlock, type SessionEntity, SessionTypesEnum, type SessionUser, type SoundtrackProgramScriptElementOptions, type SystemModuleEntity, type SystemUserEntity, TkplayErrorCodesEnum, type TkplayErrorEntity, TkplayErrorNamesEnum, type TkplayMappedErrors, type TkplayMappedErrors__Ptbr, type UpdateCouponPayload, type UpdateCouponResponse, type UpdateRadioUserPasswordPayload, type UpdateRadioUserProfilePayload, type UpdateRadioUserResponse, type UpdateRadioUserRolePayload, type UpdateSystemUserPaswordPayload, type UpdateSystemUserPayload, type UpdateSystemUserResponse, type UpsertPlanPayload, type UpsertPlanResponse, type UpsertSystemModulePayload, type UpsertSystemModuleResponse, type UpsertSystemUserResponse, type UserLegalAgreementEntity, UserRolesEnum, UserRolesTranslationsEnum, type VignetteProgramScriptElement, tkplayErrorsMap, tkplayErrrosPtbr };
package/dist/index.d.ts CHANGED
@@ -36,6 +36,59 @@ declare const JobsEnum: {
36
36
  };
37
37
  type JobsEnum = Enum<typeof JobsEnum>;
38
38
 
39
+ declare enum TkplayErrorCodesEnum {
40
+ MODULE_NAME_IS_TAKEN = "MODULE_NAME_IS_TAKEN",
41
+ MODULE_NOT_FOUND = "MODULE_NOT_FOUND",
42
+ PLAN_NAME_IS_TAKEN = "PLAN_NAME_IS_TAKEN",
43
+ PLAN_AMOUNT_INVALID = "PLAN_AMOUNT_INVALID",
44
+ RADIO_EMAIL_IS_TAKEN = "RADIO_EMAIL_IS_TAKEN",
45
+ RADIO_CNPJ_IS_TAKEN = "RADIO_CNPJ_IS_TAKEN",
46
+ RADIO_NOT_FOUND = "RADIO_NOT_FOUND",
47
+ RADIO_CONTRACT_NOT_FOUND = "RADIO_CONTRACT_NOT_FOUND",
48
+ RADIO_DIRECTOR_NOT_FOUND = "RADIO_DIRECTOR_NOT_FOUND",
49
+ RADIO_DIFF = "RADIO_DIFF",
50
+ INVALID_AUTH_TOKEN = "INVALID_AUTH_TOKEN",
51
+ MISSING_AUTH_TOKEN = "MISSING_AUTH_TOKEN",
52
+ WRONG_PASSWORD = "WRONG_PASSWORD",
53
+ RADIO_INACTIVE = "RADIO_INACTIVE",
54
+ RADIO_PAYMENT_DELINQUENT = "RADIO_PAYMENT_DELINQUENT",
55
+ SESSION_NOT_FOUND = "SESSION_NOT_FOUND",
56
+ FORBIDDEN_SESSION_TYPE = "FORBIDDEN_SESSION_TYPE",
57
+ FORBIDDEN_ROLE = "FORBIDDEN_ROLE",
58
+ PAYMENT_UNAUTHORIZED = "PAYMENT_UNAUTHORIZED",
59
+ PAYMENT_FAIL = "PAYMENT_FAIL",
60
+ SUBSCRIPTION_NOT_FOUND = "SUBSCRIPTION_NOT_FOUND",
61
+ LEGAL_TERMS_NOT_FOUND = "LEGAL_TERMS_NOT_FOUND",
62
+ LEGAL_TERM_INACTIVE = "LEGAL_TERM_INACTIVE",
63
+ LEGAL_TERM_TYPE_INVALID = "LEGAL_TERM_TYPE_INVALID",
64
+ COUPON_NOT_FOUND = "COUPON_NOT_FOUND",
65
+ INVALID_COUPON_DISCOUNT = "INVALID_COUPON_DISCOUNT",
66
+ COUPON_CODE_IS_TAKEN = "COUPON_CODE_IS_TAKEN",
67
+ PAST_COUPON_VALIDATION = "PAST_COUPON_VALIDATION",
68
+ USER_NOT_FOUND = "USER_NOT_FOUND",
69
+ USER_EMAIL_IS_TAKEN = "USER_EMAIL_IS_TAKEN",
70
+ USER_PASSWORDS_DONT_MATCH = "USER_PASSWORDS_DONT_MATCH",
71
+ UNABLE_TO_DELETE_USER = "UNABLE_TO_DELETE_USER"
72
+ }
73
+
74
+ declare enum TkplayErrorNamesEnum {
75
+ EFI_ERROR = "EfiError",// 400
76
+ BILLING_ERROR = "BillingError",// 402
77
+ BAD_REQUEST = "BadRequest",// 400
78
+ UNAUTHORIZED = "Unauthorized",// 401
79
+ FORBIDDEN = "Forbidden",// 403
80
+ NOT_FOUND = "NotFound",// 404
81
+ METHOD_NOT_ALLOWED = "MethodNotAllowed",// 405
82
+ CONFLICT = "Conflict",// 409
83
+ UNPROCESSABLE_ENTITY = "UnprocessableEntity",// 422
84
+ TOO_MANY_REQUESTS = "TooManyRequests",// 429
85
+ INTERNAL_SERVER_ERROR = "InternalServerError",// 500
86
+ NOT_IMPLEMENTED = "NotImplemented",// 501
87
+ BAD_GATEWAY = "BadGateway",// 502
88
+ SERVICE_UNAVAILABLE = "ServiceUnavailable",// 503
89
+ GATEWAY_TIMEOUT = "GatewayTimeout"
90
+ }
91
+
39
92
  declare const SessionTypesEnum: {
40
93
  readonly RADIO_USER: "RADIO_USER";
41
94
  readonly SYSTEM_USER: "SYSTEM_USER";
@@ -247,59 +300,6 @@ type AddressEntity = {
247
300
  state: BrStatesEnum;
248
301
  };
249
302
 
250
- declare enum TkplayErrorCodesEnum {
251
- MODULE_NAME_IS_TAKEN = "MODULE_NAME_IS_TAKEN",
252
- MODULE_NOT_FOUND = "MODULE_NOT_FOUND",
253
- PLAN_NAME_IS_TAKEN = "PLAN_NAME_IS_TAKEN",
254
- PLAN_AMOUNT_INVALID = "PLAN_AMOUNT_INVALID",
255
- RADIO_EMAIL_IS_TAKEN = "RADIO_EMAIL_IS_TAKEN",
256
- RADIO_CNPJ_IS_TAKEN = "RADIO_CNPJ_IS_TAKEN",
257
- RADIO_NOT_FOUND = "RADIO_NOT_FOUND",
258
- RADIO_CONTRACT_NOT_FOUND = "RADIO_CONTRACT_NOT_FOUND",
259
- RADIO_DIRECTOR_NOT_FOUND = "RADIO_DIRECTOR_NOT_FOUND",
260
- RADIO_DIFF = "RADIO_DIFF",
261
- INVALID_AUTH_TOKEN = "INVALID_AUTH_TOKEN",
262
- MISSING_AUTH_TOKEN = "MISSING_AUTH_TOKEN",
263
- WRONG_PASSWORD = "WRONG_PASSWORD",
264
- RADIO_INACTIVE = "RADIO_INACTIVE",
265
- RADIO_PAYMENT_DELINQUENT = "RADIO_PAYMENT_DELINQUENT",
266
- SESSION_NOT_FOUND = "SESSION_NOT_FOUND",
267
- FORBIDDEN_SESSION_TYPE = "FORBIDDEN_SESSION_TYPE",
268
- FORBIDDEN_ROLE = "FORBIDDEN_ROLE",
269
- PAYMENT_UNAUTHORIZED = "PAYMENT_UNAUTHORIZED",
270
- PAYMENT_FAIL = "PAYMENT_FAIL",
271
- SUBSCRIPTION_NOT_FOUND = "SUBSCRIPTION_NOT_FOUND",
272
- LEGAL_TERMS_NOT_FOUND = "LEGAL_TERMS_NOT_FOUND",
273
- LEGAL_TERM_INACTIVE = "LEGAL_TERM_INACTIVE",
274
- LEGAL_TERM_TYPE_INVALID = "LEGAL_TERM_TYPE_INVALID",
275
- COUPON_NOT_FOUND = "COUPON_NOT_FOUND",
276
- INVALID_COUPON_DISCOUNT = "INVALID_COUPON_DISCOUNT",
277
- COUPON_CODE_IS_TAKEN = "COUPON_CODE_IS_TAKEN",
278
- PAST_COUPON_VALIDATION = "PAST_COUPON_VALIDATION",
279
- USER_NOT_FOUND = "USER_NOT_FOUND",
280
- USER_EMAIL_IS_TAKEN = "USER_EMAIL_IS_TAKEN",
281
- USER_PASSWORDS_DONT_MATCH = "USER_PASSWORDS_DONT_MATCH",
282
- UNABLE_TO_DELETE_USER = "UNABLE_TO_DELETE_USER"
283
- }
284
-
285
- declare enum TkplayErrorNamesEnum {
286
- EFI_ERROR = "EfiError",// 400
287
- BILLING_ERROR = "BillingError",// 402
288
- BAD_REQUEST = "BadRequest",// 400
289
- UNAUTHORIZED = "Unauthorized",// 401
290
- FORBIDDEN = "Forbidden",// 403
291
- NOT_FOUND = "NotFound",// 404
292
- METHOD_NOT_ALLOWED = "MethodNotAllowed",// 405
293
- CONFLICT = "Conflict",// 409
294
- UNPROCESSABLE_ENTITY = "UnprocessableEntity",// 422
295
- TOO_MANY_REQUESTS = "TooManyRequests",// 429
296
- INTERNAL_SERVER_ERROR = "InternalServerError",// 500
297
- NOT_IMPLEMENTED = "NotImplemented",// 501
298
- BAD_GATEWAY = "BadGateway",// 502
299
- SERVICE_UNAVAILABLE = "ServiceUnavailable",// 503
300
- GATEWAY_TIMEOUT = "GatewayTimeout"
301
- }
302
-
303
303
  type TkplayErrorEntity = {
304
304
  message: string;
305
305
  name: `${TkplayErrorNamesEnum}`;
@@ -768,4 +768,10 @@ type EpisodeErrorEvt = {};
768
768
 
769
769
  type EpisodeProgressEvt = {};
770
770
 
771
- export { type AddressEntity, AudioBitratesEnum, AudioFormatsEnum, AudioFrequenciesEnum, type BaseEntity, BrStatesEnum, type CasterAvatarEntity, type CasterEntity, type ChargeEntity, ChargeItemTypesEnum, ChargeStatusEnum, type CouponActivationEntity, type CouponEntity, CouponTypesEnum, CouponTypesTranslationsEnum, type CreateCouponPayload, type CreateCouponResponse, type CreateLegalTermAgreementPayload, type CreateLegalTermPayload, type CreateLegalTermResponse, type CreateRadioPayload, type CreateRadioUserPayload, type CreateRadioUserResponse, type CreateSystemUserPayload, type Enum, EpGenerationQualityEnum, EpGenerationTypesEnum, type EpisodeCreatedEvt, type EpisodeErrorEvt, type EpisodeProgressEvt, FFmpegAudioCurveEnum, type GenerateEpJobPayload, type GenerateEpisodePayload, type GenerateEpisodeResponse, type GetCouponByIdResponse, type GetCouponValidationResponse, type GetPenaltyValueResponse, type GetRadioDetailsResponse, JobsEnum, type LegalTermEntity, LegalTermTypesEnum, LegalTermTypesTranslationsEnum, type ListChargesParams, type ListCouponsParams, type ListCouponsResponse, type ListLegalTermsParams, type ListLegalTermsResponse, type ListRadioUsersParams, type ListRadioUsersResponse, type ListRadiosParams, type ListRadiosResponse, type ListSystemModulesResponse, type ListSystemUsersParams, type ListSystemUsersResponse, type LoginPayload, type LoginResponse, type MusicProgramScriptElement, NewsCategoriesEnum, type NewsProgramScriptElement, type NewsProgramScriptElementOptions, type OffProgramScriptElement, type PaginatedResponseDTO, type Pagination, type PaginationParams, type PlanEntity, type PopulatedProgramScriptBlock, type PopulatedProgramScriptElement, type PopulatedProgramScriptEntity, type ProgramEntity, type ProgramEpisodeBlockEntity, type ProgramEpisodeEntity, type ProgramScriptElement, type ProgramScriptElementOptionsAll, ProgramScriptElementTypesEnum, type ProgramScriptEntity, RadioBandsEnum, type RadioContractEntity, type RadioEntity, type RadioLegalAgreementEntity, type RadioLogoEntity, type RadioSubscriptionEntity, RadioSubscriptionStatusEnum, type RadioUserAvatarEntity, type RadioUserEntity, S3DirectoriesEnum, type S3FileEntity, type ScriptBlock, type SessionEntity, SessionTypesEnum, type SessionUser, type SoundtrackProgramScriptElementOptions, type SystemModuleEntity, type SystemUserEntity, type TkplayErrorEntity, type UpdateCouponPayload, type UpdateCouponResponse, type UpdateRadioUserPasswordPayload, type UpdateRadioUserProfilePayload, type UpdateRadioUserResponse, type UpdateRadioUserRolePayload, type UpdateSystemUserPaswordPayload, type UpdateSystemUserPayload, type UpdateSystemUserResponse, type UpsertPlanPayload, type UpsertPlanResponse, type UpsertSystemModulePayload, type UpsertSystemModuleResponse, type UpsertSystemUserResponse, type UserLegalAgreementEntity, UserRolesEnum, UserRolesTranslationsEnum, type VignetteProgramScriptElement };
771
+ type TkplayMappedErrors = Record<`${TkplayErrorCodesEnum}`, string | ((args: any) => string)>;
772
+ declare const tkplayErrorsMap: TkplayMappedErrors;
773
+
774
+ type TkplayMappedErrors__Ptbr = Record<`${TkplayErrorCodesEnum}`, string>;
775
+ declare const tkplayErrrosPtbr: TkplayMappedErrors__Ptbr;
776
+
777
+ export { type AddressEntity, AudioBitratesEnum, AudioFormatsEnum, AudioFrequenciesEnum, type BaseEntity, BrStatesEnum, type CasterAvatarEntity, type CasterEntity, type ChargeEntity, ChargeItemTypesEnum, ChargeStatusEnum, type CouponActivationEntity, type CouponEntity, CouponTypesEnum, CouponTypesTranslationsEnum, type CreateCouponPayload, type CreateCouponResponse, type CreateLegalTermAgreementPayload, type CreateLegalTermPayload, type CreateLegalTermResponse, type CreateRadioPayload, type CreateRadioUserPayload, type CreateRadioUserResponse, type CreateSystemUserPayload, type Enum, EpGenerationQualityEnum, EpGenerationTypesEnum, type EpisodeCreatedEvt, type EpisodeErrorEvt, type EpisodeProgressEvt, FFmpegAudioCurveEnum, type GenerateEpJobPayload, type GenerateEpisodePayload, type GenerateEpisodeResponse, type GetCouponByIdResponse, type GetCouponValidationResponse, type GetPenaltyValueResponse, type GetRadioDetailsResponse, JobsEnum, type LegalTermEntity, LegalTermTypesEnum, LegalTermTypesTranslationsEnum, type ListChargesParams, type ListCouponsParams, type ListCouponsResponse, type ListLegalTermsParams, type ListLegalTermsResponse, type ListRadioUsersParams, type ListRadioUsersResponse, type ListRadiosParams, type ListRadiosResponse, type ListSystemModulesResponse, type ListSystemUsersParams, type ListSystemUsersResponse, type LoginPayload, type LoginResponse, type MusicProgramScriptElement, NewsCategoriesEnum, type NewsProgramScriptElement, type NewsProgramScriptElementOptions, type OffProgramScriptElement, type PaginatedResponseDTO, type Pagination, type PaginationParams, type PlanEntity, type PopulatedProgramScriptBlock, type PopulatedProgramScriptElement, type PopulatedProgramScriptEntity, type ProgramEntity, type ProgramEpisodeBlockEntity, type ProgramEpisodeEntity, type ProgramScriptElement, type ProgramScriptElementOptionsAll, ProgramScriptElementTypesEnum, type ProgramScriptEntity, RadioBandsEnum, type RadioContractEntity, type RadioEntity, type RadioLegalAgreementEntity, type RadioLogoEntity, type RadioSubscriptionEntity, RadioSubscriptionStatusEnum, type RadioUserAvatarEntity, type RadioUserEntity, S3DirectoriesEnum, type S3FileEntity, type ScriptBlock, type SessionEntity, SessionTypesEnum, type SessionUser, type SoundtrackProgramScriptElementOptions, type SystemModuleEntity, type SystemUserEntity, TkplayErrorCodesEnum, type TkplayErrorEntity, TkplayErrorNamesEnum, type TkplayMappedErrors, type TkplayMappedErrors__Ptbr, type UpdateCouponPayload, type UpdateCouponResponse, type UpdateRadioUserPasswordPayload, type UpdateRadioUserProfilePayload, type UpdateRadioUserResponse, type UpdateRadioUserRolePayload, type UpdateSystemUserPaswordPayload, type UpdateSystemUserPayload, type UpdateSystemUserResponse, type UpsertPlanPayload, type UpsertPlanResponse, type UpsertSystemModulePayload, type UpsertSystemModuleResponse, type UpsertSystemUserResponse, type UserLegalAgreementEntity, UserRolesEnum, UserRolesTranslationsEnum, type VignetteProgramScriptElement, tkplayErrorsMap, tkplayErrrosPtbr };
package/dist/index.js CHANGED
@@ -40,8 +40,12 @@ __export(index_exports, {
40
40
  RadioSubscriptionStatusEnum: () => RadioSubscriptionStatusEnum,
41
41
  S3DirectoriesEnum: () => S3DirectoriesEnum,
42
42
  SessionTypesEnum: () => SessionTypesEnum,
43
+ TkplayErrorCodesEnum: () => TkplayErrorCodesEnum,
44
+ TkplayErrorNamesEnum: () => TkplayErrorNamesEnum,
43
45
  UserRolesEnum: () => UserRolesEnum,
44
- UserRolesTranslationsEnum: () => UserRolesTranslationsEnum
46
+ UserRolesTranslationsEnum: () => UserRolesTranslationsEnum,
47
+ tkplayErrorsMap: () => tkplayErrorsMap,
48
+ tkplayErrrosPtbr: () => tkplayErrrosPtbr
45
49
  });
46
50
  module.exports = __toCommonJS(index_exports);
47
51
 
@@ -130,6 +134,63 @@ var JobsEnum = {
130
134
  GENERATE_EP_BLOCK: "generate-episode-block"
131
135
  };
132
136
 
137
+ // src/enums/commom/error-codes.ts
138
+ var TkplayErrorCodesEnum = /* @__PURE__ */ ((TkplayErrorCodesEnum2) => {
139
+ TkplayErrorCodesEnum2["MODULE_NAME_IS_TAKEN"] = "MODULE_NAME_IS_TAKEN";
140
+ TkplayErrorCodesEnum2["MODULE_NOT_FOUND"] = "MODULE_NOT_FOUND";
141
+ TkplayErrorCodesEnum2["PLAN_NAME_IS_TAKEN"] = "PLAN_NAME_IS_TAKEN";
142
+ TkplayErrorCodesEnum2["PLAN_AMOUNT_INVALID"] = "PLAN_AMOUNT_INVALID";
143
+ TkplayErrorCodesEnum2["RADIO_EMAIL_IS_TAKEN"] = "RADIO_EMAIL_IS_TAKEN";
144
+ TkplayErrorCodesEnum2["RADIO_CNPJ_IS_TAKEN"] = "RADIO_CNPJ_IS_TAKEN";
145
+ TkplayErrorCodesEnum2["RADIO_NOT_FOUND"] = "RADIO_NOT_FOUND";
146
+ TkplayErrorCodesEnum2["RADIO_CONTRACT_NOT_FOUND"] = "RADIO_CONTRACT_NOT_FOUND";
147
+ TkplayErrorCodesEnum2["RADIO_DIRECTOR_NOT_FOUND"] = "RADIO_DIRECTOR_NOT_FOUND";
148
+ TkplayErrorCodesEnum2["RADIO_DIFF"] = "RADIO_DIFF";
149
+ TkplayErrorCodesEnum2["INVALID_AUTH_TOKEN"] = "INVALID_AUTH_TOKEN";
150
+ TkplayErrorCodesEnum2["MISSING_AUTH_TOKEN"] = "MISSING_AUTH_TOKEN";
151
+ TkplayErrorCodesEnum2["WRONG_PASSWORD"] = "WRONG_PASSWORD";
152
+ TkplayErrorCodesEnum2["RADIO_INACTIVE"] = "RADIO_INACTIVE";
153
+ TkplayErrorCodesEnum2["RADIO_PAYMENT_DELINQUENT"] = "RADIO_PAYMENT_DELINQUENT";
154
+ TkplayErrorCodesEnum2["SESSION_NOT_FOUND"] = "SESSION_NOT_FOUND";
155
+ TkplayErrorCodesEnum2["FORBIDDEN_SESSION_TYPE"] = "FORBIDDEN_SESSION_TYPE";
156
+ TkplayErrorCodesEnum2["FORBIDDEN_ROLE"] = "FORBIDDEN_ROLE";
157
+ TkplayErrorCodesEnum2["PAYMENT_UNAUTHORIZED"] = "PAYMENT_UNAUTHORIZED";
158
+ TkplayErrorCodesEnum2["PAYMENT_FAIL"] = "PAYMENT_FAIL";
159
+ TkplayErrorCodesEnum2["SUBSCRIPTION_NOT_FOUND"] = "SUBSCRIPTION_NOT_FOUND";
160
+ TkplayErrorCodesEnum2["LEGAL_TERMS_NOT_FOUND"] = "LEGAL_TERMS_NOT_FOUND";
161
+ TkplayErrorCodesEnum2["LEGAL_TERM_INACTIVE"] = "LEGAL_TERM_INACTIVE";
162
+ TkplayErrorCodesEnum2["LEGAL_TERM_TYPE_INVALID"] = "LEGAL_TERM_TYPE_INVALID";
163
+ TkplayErrorCodesEnum2["COUPON_NOT_FOUND"] = "COUPON_NOT_FOUND";
164
+ TkplayErrorCodesEnum2["INVALID_COUPON_DISCOUNT"] = "INVALID_COUPON_DISCOUNT";
165
+ TkplayErrorCodesEnum2["COUPON_CODE_IS_TAKEN"] = "COUPON_CODE_IS_TAKEN";
166
+ TkplayErrorCodesEnum2["PAST_COUPON_VALIDATION"] = "PAST_COUPON_VALIDATION";
167
+ TkplayErrorCodesEnum2["USER_NOT_FOUND"] = "USER_NOT_FOUND";
168
+ TkplayErrorCodesEnum2["USER_EMAIL_IS_TAKEN"] = "USER_EMAIL_IS_TAKEN";
169
+ TkplayErrorCodesEnum2["USER_PASSWORDS_DONT_MATCH"] = "USER_PASSWORDS_DONT_MATCH";
170
+ TkplayErrorCodesEnum2["UNABLE_TO_DELETE_USER"] = "UNABLE_TO_DELETE_USER";
171
+ return TkplayErrorCodesEnum2;
172
+ })(TkplayErrorCodesEnum || {});
173
+
174
+ // src/enums/commom/error-names.ts
175
+ var TkplayErrorNamesEnum = /* @__PURE__ */ ((TkplayErrorNamesEnum2) => {
176
+ TkplayErrorNamesEnum2["EFI_ERROR"] = "EfiError";
177
+ TkplayErrorNamesEnum2["BILLING_ERROR"] = "BillingError";
178
+ TkplayErrorNamesEnum2["BAD_REQUEST"] = "BadRequest";
179
+ TkplayErrorNamesEnum2["UNAUTHORIZED"] = "Unauthorized";
180
+ TkplayErrorNamesEnum2["FORBIDDEN"] = "Forbidden";
181
+ TkplayErrorNamesEnum2["NOT_FOUND"] = "NotFound";
182
+ TkplayErrorNamesEnum2["METHOD_NOT_ALLOWED"] = "MethodNotAllowed";
183
+ TkplayErrorNamesEnum2["CONFLICT"] = "Conflict";
184
+ TkplayErrorNamesEnum2["UNPROCESSABLE_ENTITY"] = "UnprocessableEntity";
185
+ TkplayErrorNamesEnum2["TOO_MANY_REQUESTS"] = "TooManyRequests";
186
+ TkplayErrorNamesEnum2["INTERNAL_SERVER_ERROR"] = "InternalServerError";
187
+ TkplayErrorNamesEnum2["NOT_IMPLEMENTED"] = "NotImplemented";
188
+ TkplayErrorNamesEnum2["BAD_GATEWAY"] = "BadGateway";
189
+ TkplayErrorNamesEnum2["SERVICE_UNAVAILABLE"] = "ServiceUnavailable";
190
+ TkplayErrorNamesEnum2["GATEWAY_TIMEOUT"] = "GatewayTimeout";
191
+ return TkplayErrorNamesEnum2;
192
+ })(TkplayErrorNamesEnum || {});
193
+
133
194
  // src/enums/content-creation/episode-generation-quality.enum.ts
134
195
  var EpGenerationQualityEnum = {
135
196
  DEFAULT: "DEFAULT",
@@ -239,6 +300,92 @@ var UserRolesTranslationsEnum = {
239
300
  ADMIN: "Administrador",
240
301
  STAFF: "Colaborador"
241
302
  };
303
+
304
+ // src/constants/tkplay-errors-map.ts
305
+ var tkplayErrorsMap = {
306
+ // System Errors
307
+ MODULE_NAME_IS_TAKEN: "Module name already in use",
308
+ MODULE_NOT_FOUND: (moduleId) => `Module not found (id: ${moduleId})`,
309
+ PLAN_NAME_IS_TAKEN: `Plan name already in use`,
310
+ PLAN_AMOUNT_INVALID: `System must have 2 or 3 plans`,
311
+ // Radio Errors
312
+ RADIO_EMAIL_IS_TAKEN: "Email already in use",
313
+ RADIO_CNPJ_IS_TAKEN: "CNPJ already in use",
314
+ RADIO_NOT_FOUND: "Radio not found",
315
+ RADIO_CONTRACT_NOT_FOUND: "Radio contract not found",
316
+ RADIO_DIRECTOR_NOT_FOUND: "Radio director not found",
317
+ RADIO_DIFF: "Resource belongs to a different radio",
318
+ // Auth Errors
319
+ INVALID_AUTH_TOKEN: "Invalid authentication token",
320
+ MISSING_AUTH_TOKEN: "Authentication token required",
321
+ WRONG_PASSWORD: "Invalid credentials",
322
+ RADIO_INACTIVE: "Radio inactive",
323
+ RADIO_PAYMENT_DELINQUENT: "Payment required",
324
+ SESSION_NOT_FOUND: "Session not found or expired",
325
+ FORBIDDEN_SESSION_TYPE: "Access denied for this session type",
326
+ FORBIDDEN_ROLE: (roles) => `Access denied. Required role(s): ${roles.join(" | ")}`,
327
+ // Billing Errors
328
+ PAYMENT_UNAUTHORIZED: "Payment provider authentication failed",
329
+ PAYMENT_FAIL: (s) => `Payment failed (status: ${s})`,
330
+ SUBSCRIPTION_NOT_FOUND: "Subscription not found",
331
+ // Legal Terms Errors
332
+ LEGAL_TERMS_NOT_FOUND: "Legal terms not found",
333
+ LEGAL_TERM_INACTIVE: "Legal term inactive",
334
+ LEGAL_TERM_TYPE_INVALID: "Invalid legal term type",
335
+ // Coupon Errors
336
+ COUPON_NOT_FOUND: "Coupon not found",
337
+ INVALID_COUPON_DISCOUNT: (d) => `Invalid discount for ${d.type} coupon (${d.discountDescription} required)`,
338
+ COUPON_CODE_IS_TAKEN: "Coupon code already in use",
339
+ PAST_COUPON_VALIDATION: "Coupon expired",
340
+ // User Errors
341
+ USER_NOT_FOUND: "User not found",
342
+ USER_EMAIL_IS_TAKEN: "User email is taken",
343
+ USER_PASSWORDS_DONT_MATCH: "Provided passwords dont match",
344
+ UNABLE_TO_DELETE_USER: "Admin users cannot be deleted"
345
+ };
346
+
347
+ // src/constants/tkplay-errors-ptbr.ts
348
+ var tkplayErrrosPtbr = {
349
+ // System Errors
350
+ MODULE_NAME_IS_TAKEN: "Nome do m\xF3dulo j\xE1 est\xE1 em uso",
351
+ MODULE_NOT_FOUND: "M\xF3dulo n\xE3o encontrado",
352
+ PLAN_NAME_IS_TAKEN: "Nome do plano j\xE1 est\xE1 em uso",
353
+ PLAN_AMOUNT_INVALID: "O sistema deve possuir 2 ou 3 planos",
354
+ // Radio Errors
355
+ RADIO_EMAIL_IS_TAKEN: "E-mail j\xE1 est\xE1 em uso",
356
+ RADIO_CNPJ_IS_TAKEN: "CNPJ j\xE1 est\xE1 em uso",
357
+ RADIO_NOT_FOUND: "R\xE1dio n\xE3o encontrada",
358
+ RADIO_CONTRACT_NOT_FOUND: "Contrato da r\xE1dio n\xE3o encontrado",
359
+ RADIO_DIRECTOR_NOT_FOUND: "Diretor da r\xE1dio n\xE3o encontrado",
360
+ RADIO_DIFF: "O recurso pertence a outra r\xE1dio",
361
+ // Auth Errors
362
+ INVALID_AUTH_TOKEN: "Token de autentica\xE7\xE3o inv\xE1lido",
363
+ MISSING_AUTH_TOKEN: "Token de autentica\xE7\xE3o obrigat\xF3rio",
364
+ WRONG_PASSWORD: "Credenciais inv\xE1lidas",
365
+ RADIO_INACTIVE: "R\xE1dio inativa",
366
+ RADIO_PAYMENT_DELINQUENT: "Pagamento pendente",
367
+ SESSION_NOT_FOUND: "Sess\xE3o n\xE3o encontrada ou expirada",
368
+ FORBIDDEN_SESSION_TYPE: "Acesso negado para este tipo de sess\xE3o",
369
+ FORBIDDEN_ROLE: "Acesso negado para o perfil informado",
370
+ // Billing Errors
371
+ PAYMENT_UNAUTHORIZED: "Falha na autentica\xE7\xE3o com o provedor de pagamento",
372
+ PAYMENT_FAIL: "Falha no pagamento",
373
+ SUBSCRIPTION_NOT_FOUND: "Assinatura da r\xE1dio n\xE3o encontrada",
374
+ // Legal Terms Errors
375
+ LEGAL_TERMS_NOT_FOUND: "Termos legais n\xE3o encontrados",
376
+ LEGAL_TERM_INACTIVE: "Termo legal inativo",
377
+ LEGAL_TERM_TYPE_INVALID: "Tipo de termo legal inv\xE1lido",
378
+ // Coupon Errors
379
+ COUPON_NOT_FOUND: "Cupom n\xE3o encontrado",
380
+ INVALID_COUPON_DISCOUNT: "Desconto do cupom inv\xE1lido",
381
+ COUPON_CODE_IS_TAKEN: "C\xF3digo do cupom j\xE1 est\xE1 em uso",
382
+ PAST_COUPON_VALIDATION: "Cupom expirado",
383
+ // User Errors
384
+ USER_NOT_FOUND: "Usu\xE1rio n\xE3o encontrado",
385
+ USER_EMAIL_IS_TAKEN: "E-mail j\xE1 est\xE1 em uso",
386
+ USER_PASSWORDS_DONT_MATCH: "As senhas informadas n\xE3o coincidem",
387
+ UNABLE_TO_DELETE_USER: "Usu\xE1rios administradores n\xE3o podem ser removidos"
388
+ };
242
389
  // Annotate the CommonJS export names for ESM import in node:
243
390
  0 && (module.exports = {
244
391
  AudioBitratesEnum,
@@ -261,6 +408,10 @@ var UserRolesTranslationsEnum = {
261
408
  RadioSubscriptionStatusEnum,
262
409
  S3DirectoriesEnum,
263
410
  SessionTypesEnum,
411
+ TkplayErrorCodesEnum,
412
+ TkplayErrorNamesEnum,
264
413
  UserRolesEnum,
265
- UserRolesTranslationsEnum
414
+ UserRolesTranslationsEnum,
415
+ tkplayErrorsMap,
416
+ tkplayErrrosPtbr
266
417
  });
package/dist/index.mjs CHANGED
@@ -83,6 +83,63 @@ var JobsEnum = {
83
83
  GENERATE_EP_BLOCK: "generate-episode-block"
84
84
  };
85
85
 
86
+ // src/enums/commom/error-codes.ts
87
+ var TkplayErrorCodesEnum = /* @__PURE__ */ ((TkplayErrorCodesEnum2) => {
88
+ TkplayErrorCodesEnum2["MODULE_NAME_IS_TAKEN"] = "MODULE_NAME_IS_TAKEN";
89
+ TkplayErrorCodesEnum2["MODULE_NOT_FOUND"] = "MODULE_NOT_FOUND";
90
+ TkplayErrorCodesEnum2["PLAN_NAME_IS_TAKEN"] = "PLAN_NAME_IS_TAKEN";
91
+ TkplayErrorCodesEnum2["PLAN_AMOUNT_INVALID"] = "PLAN_AMOUNT_INVALID";
92
+ TkplayErrorCodesEnum2["RADIO_EMAIL_IS_TAKEN"] = "RADIO_EMAIL_IS_TAKEN";
93
+ TkplayErrorCodesEnum2["RADIO_CNPJ_IS_TAKEN"] = "RADIO_CNPJ_IS_TAKEN";
94
+ TkplayErrorCodesEnum2["RADIO_NOT_FOUND"] = "RADIO_NOT_FOUND";
95
+ TkplayErrorCodesEnum2["RADIO_CONTRACT_NOT_FOUND"] = "RADIO_CONTRACT_NOT_FOUND";
96
+ TkplayErrorCodesEnum2["RADIO_DIRECTOR_NOT_FOUND"] = "RADIO_DIRECTOR_NOT_FOUND";
97
+ TkplayErrorCodesEnum2["RADIO_DIFF"] = "RADIO_DIFF";
98
+ TkplayErrorCodesEnum2["INVALID_AUTH_TOKEN"] = "INVALID_AUTH_TOKEN";
99
+ TkplayErrorCodesEnum2["MISSING_AUTH_TOKEN"] = "MISSING_AUTH_TOKEN";
100
+ TkplayErrorCodesEnum2["WRONG_PASSWORD"] = "WRONG_PASSWORD";
101
+ TkplayErrorCodesEnum2["RADIO_INACTIVE"] = "RADIO_INACTIVE";
102
+ TkplayErrorCodesEnum2["RADIO_PAYMENT_DELINQUENT"] = "RADIO_PAYMENT_DELINQUENT";
103
+ TkplayErrorCodesEnum2["SESSION_NOT_FOUND"] = "SESSION_NOT_FOUND";
104
+ TkplayErrorCodesEnum2["FORBIDDEN_SESSION_TYPE"] = "FORBIDDEN_SESSION_TYPE";
105
+ TkplayErrorCodesEnum2["FORBIDDEN_ROLE"] = "FORBIDDEN_ROLE";
106
+ TkplayErrorCodesEnum2["PAYMENT_UNAUTHORIZED"] = "PAYMENT_UNAUTHORIZED";
107
+ TkplayErrorCodesEnum2["PAYMENT_FAIL"] = "PAYMENT_FAIL";
108
+ TkplayErrorCodesEnum2["SUBSCRIPTION_NOT_FOUND"] = "SUBSCRIPTION_NOT_FOUND";
109
+ TkplayErrorCodesEnum2["LEGAL_TERMS_NOT_FOUND"] = "LEGAL_TERMS_NOT_FOUND";
110
+ TkplayErrorCodesEnum2["LEGAL_TERM_INACTIVE"] = "LEGAL_TERM_INACTIVE";
111
+ TkplayErrorCodesEnum2["LEGAL_TERM_TYPE_INVALID"] = "LEGAL_TERM_TYPE_INVALID";
112
+ TkplayErrorCodesEnum2["COUPON_NOT_FOUND"] = "COUPON_NOT_FOUND";
113
+ TkplayErrorCodesEnum2["INVALID_COUPON_DISCOUNT"] = "INVALID_COUPON_DISCOUNT";
114
+ TkplayErrorCodesEnum2["COUPON_CODE_IS_TAKEN"] = "COUPON_CODE_IS_TAKEN";
115
+ TkplayErrorCodesEnum2["PAST_COUPON_VALIDATION"] = "PAST_COUPON_VALIDATION";
116
+ TkplayErrorCodesEnum2["USER_NOT_FOUND"] = "USER_NOT_FOUND";
117
+ TkplayErrorCodesEnum2["USER_EMAIL_IS_TAKEN"] = "USER_EMAIL_IS_TAKEN";
118
+ TkplayErrorCodesEnum2["USER_PASSWORDS_DONT_MATCH"] = "USER_PASSWORDS_DONT_MATCH";
119
+ TkplayErrorCodesEnum2["UNABLE_TO_DELETE_USER"] = "UNABLE_TO_DELETE_USER";
120
+ return TkplayErrorCodesEnum2;
121
+ })(TkplayErrorCodesEnum || {});
122
+
123
+ // src/enums/commom/error-names.ts
124
+ var TkplayErrorNamesEnum = /* @__PURE__ */ ((TkplayErrorNamesEnum2) => {
125
+ TkplayErrorNamesEnum2["EFI_ERROR"] = "EfiError";
126
+ TkplayErrorNamesEnum2["BILLING_ERROR"] = "BillingError";
127
+ TkplayErrorNamesEnum2["BAD_REQUEST"] = "BadRequest";
128
+ TkplayErrorNamesEnum2["UNAUTHORIZED"] = "Unauthorized";
129
+ TkplayErrorNamesEnum2["FORBIDDEN"] = "Forbidden";
130
+ TkplayErrorNamesEnum2["NOT_FOUND"] = "NotFound";
131
+ TkplayErrorNamesEnum2["METHOD_NOT_ALLOWED"] = "MethodNotAllowed";
132
+ TkplayErrorNamesEnum2["CONFLICT"] = "Conflict";
133
+ TkplayErrorNamesEnum2["UNPROCESSABLE_ENTITY"] = "UnprocessableEntity";
134
+ TkplayErrorNamesEnum2["TOO_MANY_REQUESTS"] = "TooManyRequests";
135
+ TkplayErrorNamesEnum2["INTERNAL_SERVER_ERROR"] = "InternalServerError";
136
+ TkplayErrorNamesEnum2["NOT_IMPLEMENTED"] = "NotImplemented";
137
+ TkplayErrorNamesEnum2["BAD_GATEWAY"] = "BadGateway";
138
+ TkplayErrorNamesEnum2["SERVICE_UNAVAILABLE"] = "ServiceUnavailable";
139
+ TkplayErrorNamesEnum2["GATEWAY_TIMEOUT"] = "GatewayTimeout";
140
+ return TkplayErrorNamesEnum2;
141
+ })(TkplayErrorNamesEnum || {});
142
+
86
143
  // src/enums/content-creation/episode-generation-quality.enum.ts
87
144
  var EpGenerationQualityEnum = {
88
145
  DEFAULT: "DEFAULT",
@@ -192,6 +249,92 @@ var UserRolesTranslationsEnum = {
192
249
  ADMIN: "Administrador",
193
250
  STAFF: "Colaborador"
194
251
  };
252
+
253
+ // src/constants/tkplay-errors-map.ts
254
+ var tkplayErrorsMap = {
255
+ // System Errors
256
+ MODULE_NAME_IS_TAKEN: "Module name already in use",
257
+ MODULE_NOT_FOUND: (moduleId) => `Module not found (id: ${moduleId})`,
258
+ PLAN_NAME_IS_TAKEN: `Plan name already in use`,
259
+ PLAN_AMOUNT_INVALID: `System must have 2 or 3 plans`,
260
+ // Radio Errors
261
+ RADIO_EMAIL_IS_TAKEN: "Email already in use",
262
+ RADIO_CNPJ_IS_TAKEN: "CNPJ already in use",
263
+ RADIO_NOT_FOUND: "Radio not found",
264
+ RADIO_CONTRACT_NOT_FOUND: "Radio contract not found",
265
+ RADIO_DIRECTOR_NOT_FOUND: "Radio director not found",
266
+ RADIO_DIFF: "Resource belongs to a different radio",
267
+ // Auth Errors
268
+ INVALID_AUTH_TOKEN: "Invalid authentication token",
269
+ MISSING_AUTH_TOKEN: "Authentication token required",
270
+ WRONG_PASSWORD: "Invalid credentials",
271
+ RADIO_INACTIVE: "Radio inactive",
272
+ RADIO_PAYMENT_DELINQUENT: "Payment required",
273
+ SESSION_NOT_FOUND: "Session not found or expired",
274
+ FORBIDDEN_SESSION_TYPE: "Access denied for this session type",
275
+ FORBIDDEN_ROLE: (roles) => `Access denied. Required role(s): ${roles.join(" | ")}`,
276
+ // Billing Errors
277
+ PAYMENT_UNAUTHORIZED: "Payment provider authentication failed",
278
+ PAYMENT_FAIL: (s) => `Payment failed (status: ${s})`,
279
+ SUBSCRIPTION_NOT_FOUND: "Subscription not found",
280
+ // Legal Terms Errors
281
+ LEGAL_TERMS_NOT_FOUND: "Legal terms not found",
282
+ LEGAL_TERM_INACTIVE: "Legal term inactive",
283
+ LEGAL_TERM_TYPE_INVALID: "Invalid legal term type",
284
+ // Coupon Errors
285
+ COUPON_NOT_FOUND: "Coupon not found",
286
+ INVALID_COUPON_DISCOUNT: (d) => `Invalid discount for ${d.type} coupon (${d.discountDescription} required)`,
287
+ COUPON_CODE_IS_TAKEN: "Coupon code already in use",
288
+ PAST_COUPON_VALIDATION: "Coupon expired",
289
+ // User Errors
290
+ USER_NOT_FOUND: "User not found",
291
+ USER_EMAIL_IS_TAKEN: "User email is taken",
292
+ USER_PASSWORDS_DONT_MATCH: "Provided passwords dont match",
293
+ UNABLE_TO_DELETE_USER: "Admin users cannot be deleted"
294
+ };
295
+
296
+ // src/constants/tkplay-errors-ptbr.ts
297
+ var tkplayErrrosPtbr = {
298
+ // System Errors
299
+ MODULE_NAME_IS_TAKEN: "Nome do m\xF3dulo j\xE1 est\xE1 em uso",
300
+ MODULE_NOT_FOUND: "M\xF3dulo n\xE3o encontrado",
301
+ PLAN_NAME_IS_TAKEN: "Nome do plano j\xE1 est\xE1 em uso",
302
+ PLAN_AMOUNT_INVALID: "O sistema deve possuir 2 ou 3 planos",
303
+ // Radio Errors
304
+ RADIO_EMAIL_IS_TAKEN: "E-mail j\xE1 est\xE1 em uso",
305
+ RADIO_CNPJ_IS_TAKEN: "CNPJ j\xE1 est\xE1 em uso",
306
+ RADIO_NOT_FOUND: "R\xE1dio n\xE3o encontrada",
307
+ RADIO_CONTRACT_NOT_FOUND: "Contrato da r\xE1dio n\xE3o encontrado",
308
+ RADIO_DIRECTOR_NOT_FOUND: "Diretor da r\xE1dio n\xE3o encontrado",
309
+ RADIO_DIFF: "O recurso pertence a outra r\xE1dio",
310
+ // Auth Errors
311
+ INVALID_AUTH_TOKEN: "Token de autentica\xE7\xE3o inv\xE1lido",
312
+ MISSING_AUTH_TOKEN: "Token de autentica\xE7\xE3o obrigat\xF3rio",
313
+ WRONG_PASSWORD: "Credenciais inv\xE1lidas",
314
+ RADIO_INACTIVE: "R\xE1dio inativa",
315
+ RADIO_PAYMENT_DELINQUENT: "Pagamento pendente",
316
+ SESSION_NOT_FOUND: "Sess\xE3o n\xE3o encontrada ou expirada",
317
+ FORBIDDEN_SESSION_TYPE: "Acesso negado para este tipo de sess\xE3o",
318
+ FORBIDDEN_ROLE: "Acesso negado para o perfil informado",
319
+ // Billing Errors
320
+ PAYMENT_UNAUTHORIZED: "Falha na autentica\xE7\xE3o com o provedor de pagamento",
321
+ PAYMENT_FAIL: "Falha no pagamento",
322
+ SUBSCRIPTION_NOT_FOUND: "Assinatura da r\xE1dio n\xE3o encontrada",
323
+ // Legal Terms Errors
324
+ LEGAL_TERMS_NOT_FOUND: "Termos legais n\xE3o encontrados",
325
+ LEGAL_TERM_INACTIVE: "Termo legal inativo",
326
+ LEGAL_TERM_TYPE_INVALID: "Tipo de termo legal inv\xE1lido",
327
+ // Coupon Errors
328
+ COUPON_NOT_FOUND: "Cupom n\xE3o encontrado",
329
+ INVALID_COUPON_DISCOUNT: "Desconto do cupom inv\xE1lido",
330
+ COUPON_CODE_IS_TAKEN: "C\xF3digo do cupom j\xE1 est\xE1 em uso",
331
+ PAST_COUPON_VALIDATION: "Cupom expirado",
332
+ // User Errors
333
+ USER_NOT_FOUND: "Usu\xE1rio n\xE3o encontrado",
334
+ USER_EMAIL_IS_TAKEN: "E-mail j\xE1 est\xE1 em uso",
335
+ USER_PASSWORDS_DONT_MATCH: "As senhas informadas n\xE3o coincidem",
336
+ UNABLE_TO_DELETE_USER: "Usu\xE1rios administradores n\xE3o podem ser removidos"
337
+ };
195
338
  export {
196
339
  AudioBitratesEnum,
197
340
  AudioFormatsEnum,
@@ -213,6 +356,10 @@ export {
213
356
  RadioSubscriptionStatusEnum,
214
357
  S3DirectoriesEnum,
215
358
  SessionTypesEnum,
359
+ TkplayErrorCodesEnum,
360
+ TkplayErrorNamesEnum,
216
361
  UserRolesEnum,
217
- UserRolesTranslationsEnum
362
+ UserRolesTranslationsEnum,
363
+ tkplayErrorsMap,
364
+ tkplayErrrosPtbr
218
365
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talkplay/shared-types",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",