@greatapps/common 1.1.559 → 1.1.561
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/components/navigation/subcomponents/BottomLinks.mjs +1 -1
- package/dist/components/navigation/subcomponents/BottomLinks.mjs.map +1 -1
- package/dist/modules/auth/utils/assert-paid-subscription.mjs +1 -1
- package/dist/modules/auth/utils/assert-paid-subscription.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/navigation/subcomponents/BottomLinks.tsx +1 -1
- package/src/modules/auth/utils/assert-paid-subscription.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/navigation/subcomponents/BottomLinks.tsx"],"sourcesContent":["'use client';\n\nimport { IconHelp, IconBulb } from '@tabler/icons-react';\nimport { useWhitelabel } from '../../../providers/whitelabel.provider';\n\nexport function BottomLinks() {\n const { whitelabel } = useWhitelabel();\n\n const helpUrl = whitelabel?.url_help || 'https://ajuda.greatsoftwares.com.br/pt-br/';\n const isMainWhitelabel = !whitelabel || whitelabel.id === 1;\n\n const links = [\n {\n label: 'Central de ajuda',\n icon: IconHelp,\n href: helpUrl,\n },\n ...(
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/navigation/subcomponents/BottomLinks.tsx"],"sourcesContent":["'use client';\n\nimport { IconHelp, IconBulb } from '@tabler/icons-react';\nimport { useWhitelabel } from '../../../providers/whitelabel.provider';\n\nexport function BottomLinks() {\n const { whitelabel } = useWhitelabel();\n\n const helpUrl = whitelabel?.url_help || 'https://ajuda.greatsoftwares.com.br/pt-br/';\n const isMainWhitelabel = !whitelabel || whitelabel.id === 1;\n\n const links = [\n {\n label: 'Central de ajuda',\n icon: IconHelp,\n href: helpUrl,\n },\n ...(isMainWhitelabel\n ? [\n {\n label: 'Enviar sugestões',\n icon: IconBulb,\n href: 'https://ideias.greatpages.com.br/b/y0geg1ve/feature-ideas',\n },\n ]\n : []),\n ];\n\n return (\n <div className=\"flex flex-col\">\n {links.map((link) => (\n <a\n key={link.label}\n href={link.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"rounded-md flex items-center gap-2 p-3 cursor-pointer transition-colors no-underline bg-white hover:bg-gray-100 active:bg-gray-50\"\n >\n <link.icon size={20} className=\"text-gray-400\" />\n <span className=\"paragraph-small-medium text-gray-500\">\n {link.label}\n </span>\n </a>\n ))}\n </div>\n );\n}\n"],"mappings":";AA+BQ,SAOE,KAPF;AA7BR,SAAS,UAAU,gBAAgB;AACnC,SAAS,qBAAqB;AAEvB,SAAS,cAAc;AAC5B,QAAM,EAAE,WAAW,IAAI,cAAc;AAErC,QAAM,UAAU,YAAY,YAAY;AACxC,QAAM,mBAAmB,CAAC,cAAc,WAAW,OAAO;AAE1D,QAAM,QAAQ;AAAA,IACZ;AAAA,MACE,OAAO;AAAA,MACP,MAAM;AAAA,MACN,MAAM;AAAA,IACR;AAAA,IACA,GAAI,mBACA;AAAA,MACE;AAAA,QACE,OAAO;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF,IACA,CAAC;AAAA,EACP;AAEA,SACE,oBAAC,SAAI,WAAU,iBACZ,gBAAM,IAAI,CAAC,SACV;AAAA,IAAC;AAAA;AAAA,MAEC,MAAM,KAAK;AAAA,MACX,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,WAAU;AAAA,MAEV;AAAA,4BAAC,KAAK,MAAL,EAAU,MAAM,IAAI,WAAU,iBAAgB;AAAA,QAC/C,oBAAC,UAAK,WAAU,wCACb,eAAK,OACR;AAAA;AAAA;AAAA,IATK,KAAK;AAAA,EAUZ,CACD,GACH;AAEJ;","names":[]}
|
|
@@ -26,7 +26,7 @@ async function assertPaidSubscription() {
|
|
|
26
26
|
403
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
|
-
if (subscription.type === "free" || subscription.id_plan === 5
|
|
29
|
+
if (subscription.type === "free" || subscription.id_plan === 5) {
|
|
30
30
|
throw new ApiError(
|
|
31
31
|
"Este recurso est\xE1 dispon\xEDvel apenas para planos pagos. Fa\xE7a upgrade do seu plano para continuar.",
|
|
32
32
|
"PAID_SUBSCRIPTION_REQUIRED",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/auth/utils/assert-paid-subscription.ts"],"sourcesContent":["import \"server-only\";\n\nimport { ApiError } from \"../../../infra/api/types\";\nimport { listSubscriptionsAction } from \"../../subscriptions/actions/list-subscriptions.action\";\nimport { hasSubscriptionExpired } from \"../../subscriptions/utils/has-subscription-expired\";\n\nexport async function assertPaidSubscription() {\n const result = await listSubscriptionsAction({ active: true });\n\n if (!result.success) {\n throw new ApiError(\n result.error || \"Não foi possível validar a assinatura atual\",\n \"SUBSCRIPTION_CONTEXT_FAILED\",\n 403,\n );\n }\n\n const subscription = result.data?.data?.[0];\n\n if (!subscription) {\n throw new ApiError(\n \"Nenhuma assinatura ativa encontrada. Assine um plano para continuar.\",\n \"SUBSCRIPTION_NOT_FOUND\",\n 403,\n );\n }\n\n if (hasSubscriptionExpired(subscription.date_due)) {\n throw new ApiError(\n \"Sua assinatura está vencida. Assine um novo plano para continuar.\",\n \"SUBSCRIPTION_EXPIRED\",\n 403,\n );\n }\n\n if (subscription.type === 'free' || subscription.id_plan === 5
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/auth/utils/assert-paid-subscription.ts"],"sourcesContent":["import \"server-only\";\n\nimport { ApiError } from \"../../../infra/api/types\";\nimport { listSubscriptionsAction } from \"../../subscriptions/actions/list-subscriptions.action\";\nimport { hasSubscriptionExpired } from \"../../subscriptions/utils/has-subscription-expired\";\n\nexport async function assertPaidSubscription() {\n const result = await listSubscriptionsAction({ active: true });\n\n if (!result.success) {\n throw new ApiError(\n result.error || \"Não foi possível validar a assinatura atual\",\n \"SUBSCRIPTION_CONTEXT_FAILED\",\n 403,\n );\n }\n\n const subscription = result.data?.data?.[0];\n\n if (!subscription) {\n throw new ApiError(\n \"Nenhuma assinatura ativa encontrada. Assine um plano para continuar.\",\n \"SUBSCRIPTION_NOT_FOUND\",\n 403,\n );\n }\n\n if (hasSubscriptionExpired(subscription.date_due)) {\n throw new ApiError(\n \"Sua assinatura está vencida. Assine um novo plano para continuar.\",\n \"SUBSCRIPTION_EXPIRED\",\n 403,\n );\n }\n\n \n if (subscription.type === 'free' || subscription.id_plan === 5) {\n throw new ApiError(\n \"Este recurso está disponível apenas para planos pagos. Faça upgrade do seu plano para continuar.\",\n \"PAID_SUBSCRIPTION_REQUIRED\",\n 403,\n );\n }\n}\n"],"mappings":"AAAA,OAAO;AAEP,SAAS,gBAAgB;AACzB,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AAEvC,eAAsB,yBAAyB;AAC7C,QAAM,SAAS,MAAM,wBAAwB,EAAE,QAAQ,KAAK,CAAC;AAE7D,MAAI,CAAC,OAAO,SAAS;AACnB,UAAM,IAAI;AAAA,MACR,OAAO,SAAS;AAAA,MAChB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,eAAe,OAAO,MAAM,OAAO,CAAC;AAE1C,MAAI,CAAC,cAAc;AACjB,UAAM,IAAI;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,MAAI,uBAAuB,aAAa,QAAQ,GAAG;AACjD,UAAM,IAAI;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAGA,MAAI,aAAa,SAAS,UAAU,aAAa,YAAY,GAAG;AAC9D,UAAM,IAAI;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -33,7 +33,8 @@ export async function assertPaidSubscription() {
|
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
|
|
37
|
+
if (subscription.type === 'free' || subscription.id_plan === 5) {
|
|
37
38
|
throw new ApiError(
|
|
38
39
|
"Este recurso está disponível apenas para planos pagos. Faça upgrade do seu plano para continuar.",
|
|
39
40
|
"PAID_SUBSCRIPTION_REQUIRED",
|