@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.
@@ -12,7 +12,7 @@ function BottomLinks() {
12
12
  icon: IconHelp,
13
13
  href: helpUrl
14
14
  },
15
- ...!isMainWhitelabel ? [
15
+ ...isMainWhitelabel ? [
16
16
  {
17
17
  label: "Enviar sugest\xF5es",
18
18
  icon: IconBulb,
@@ -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 ...(!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,CAAC,mBACD;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":[]}
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 || subscription.type === "trial") {
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 || subscription.type === 'trial') {\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;AAEA,MAAI,aAAa,SAAS,UAAU,aAAa,YAAY,KAAK,aAAa,SAAS,SAAS;AAC/F,UAAM,IAAI;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greatapps/common",
3
- "version": "1.1.559",
3
+ "version": "1.1.561",
4
4
  "description": "Shared library for GreatApps frontend applications",
5
5
  "main": "./dist/index.mjs",
6
6
  "types": "./src/index.ts",
@@ -15,7 +15,7 @@ export function BottomLinks() {
15
15
  icon: IconHelp,
16
16
  href: helpUrl,
17
17
  },
18
- ...(!isMainWhitelabel
18
+ ...(isMainWhitelabel
19
19
  ? [
20
20
  {
21
21
  label: 'Enviar sugestões',
@@ -33,7 +33,8 @@ export async function assertPaidSubscription() {
33
33
  );
34
34
  }
35
35
 
36
- if (subscription.type === 'free' || subscription.id_plan === 5 || subscription.type === 'trial') {
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",