Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const createDefaultCollections = async (
try {
const createdCollectionIds: string[] = [];

// Crear todas las colecciones definidas en defaultCollections
for (const collectionConfig of defaultCollections as DefaultCollection[]) {
try {
const collection = await client.models.Collection.create({
Expand Down
2 changes: 0 additions & 2 deletions amplify/functions/createStoreTemplate/services/menuService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ export const createDefaultMenus = async (
try {
const createdMenuIds: string[] = [];

// Crear todos los menús definidos en defaultMenus
for (const menuConfig of defaultMenus as DefaultNavigationMenu[]) {
try {
// Crear el menú con toda la estructura JSON
const menuResult = await client.models.NavigationMenu.create({
storeId: storeId,
domain: domain,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useAuthUser } from '@/hooks/auth/useAuthUser';
import { getCdnUrlForKey } from '@/utils/client';
import { updateUserAttributes } from 'aws-amplify/auth';
import { uploadData } from 'aws-amplify/storage';
import { useState } from 'react';
Expand Down Expand Up @@ -26,26 +27,8 @@ export function useUpdateProfilePicture() {
},
}).result;

// 2. Construir la URL pública condicionalmente.
const bucketName = process.env.NEXT_PUBLIC_S3_URL;
const awsRegion = process.env.NEXT_PUBLIC_AWS_REGION;
const cloudFrontDomain = process.env.NEXT_PUBLIC_CLOUDFRONT_DOMAIN;

if (!bucketName) {
throw new Error('NEXT_PUBLIC_S3_URL is not defined in your environment variables');
}

let publicUrl: string;
const s3Key = result.path;

if (cloudFrontDomain && cloudFrontDomain.trim() !== '') {
// Usar CloudFront para producción (o cuando esté configurado)
publicUrl = `https://${cloudFrontDomain}/${s3Key}`;
} else {
// Fallback a la URL de S3 para otros entornos
const regionForS3Url = awsRegion;
publicUrl = `https://${bucketName}.s3.${regionForS3Url}.amazonaws.com/${s3Key}`;
}
// 2. Construir la URL pública usando la utilidad de CDN.
const publicUrl = getCdnUrlForKey(result.path);

// 3. Actualizar el atributo 'picture' del usuario con la URL pública.
await updateUserAttributes({
Expand Down
16 changes: 16 additions & 0 deletions app/api/domain-validation/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { NextRequest, NextResponse } from 'next/server';
import { CustomDomainService } from '@/tenant-domains/services/custom-domain-service';
import { getNextCorsHeaders } from '@/lib/utils/next-cors';
Expand Down
16 changes: 16 additions & 0 deletions app/api/domain-validation/verify-acm/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { NextRequest, NextResponse } from 'next/server';
import { CertificateManager } from '@/tenant-domains/services/ssl/certificate-manager';
import { getNextCorsHeaders } from '@/lib/utils/next-cors';
Expand Down
16 changes: 16 additions & 0 deletions app/api/domain-validation/verify/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { NextRequest, NextResponse } from 'next/server';
import { CustomDomainService } from '@/tenant-domains/services/custom-domain-service';
import { SecurityConfig } from '@/tenant-domains/config/security-config';
Expand Down
16 changes: 16 additions & 0 deletions app/api/stores/[storeId]/assets/[...path]/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { getNextCorsHeaders } from '@/lib/utils/next-cors';
import { logger } from '@/renderer-engine/lib/logger';
import { GetObjectCommand, S3Client } from '@aws-sdk/client-s3';
Expand Down
16 changes: 16 additions & 0 deletions app/api/stores/[storeId]/cache/invalidate/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { getNextCorsHeaders } from '@/lib/utils/next-cors';
import { cacheInvalidationService, type ChangeType } from '@/renderer-engine/services/core/cache';
import { AuthGetCurrentUserServer, cookiesClient } from '@/utils/client/AmplifyUtils';
Expand Down
16 changes: 16 additions & 0 deletions app/api/stores/[storeId]/cart/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { getCartCookieOptions } from '@/lib/cookies/cookiesOption';
import { getNextCorsHeaders } from '@/lib/utils/next-cors';
import { logger } from '@/renderer-engine/lib/logger';
Expand Down
16 changes: 16 additions & 0 deletions app/api/stores/[storeId]/checkout/complete/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { getNextCorsHeaders } from '@/lib/utils/next-cors';
import { checkoutFetcher } from '@/renderer-engine/services/fetchers/checkout-fetcher';
import { NextRequest, NextResponse } from 'next/server';
Expand Down
16 changes: 16 additions & 0 deletions app/api/stores/[storeId]/checkout/direct/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { getNextCorsHeaders } from '@/lib/utils/next-cors';
import { cartFetcher } from '@/renderer-engine/services/fetchers/cart-fetcher';
import { checkoutFetcher } from '@/renderer-engine/services/fetchers/checkout-fetcher';
Expand Down
16 changes: 16 additions & 0 deletions app/api/stores/[storeId]/checkout/start/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { getNextCorsHeaders } from '@/lib/utils/next-cors';
import { cartFetcher } from '@/renderer-engine/services/fetchers/cart-fetcher';
import { checkoutFetcher } from '@/renderer-engine/services/fetchers/checkout-fetcher';
Expand Down
16 changes: 16 additions & 0 deletions app/api/stores/[storeId]/custom-domain/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { getNextCorsHeaders } from '@/lib/utils/next-cors';
import { logger } from '@/renderer-engine/lib/logger';
import { CustomDomainService } from '@/tenant-domains/services/custom-domain-service';
Expand Down
16 changes: 16 additions & 0 deletions app/api/stores/[storeId]/products/filter/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { getNextCorsHeaders } from '@/lib/utils/next-cors';
import { logger } from '@/renderer-engine/lib/logger';
import { dataTransformer } from '@/renderer-engine/services/core/data-transformer';
Expand Down
16 changes: 16 additions & 0 deletions app/api/stores/[storeId]/search/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { getNextCorsHeaders } from '@/lib/utils/next-cors';
import { cacheManager, getSearchProductsCacheKey } from '@/renderer-engine/services/core/cache';
import { dataTransformer } from '@/renderer-engine/services/core/data-transformer';
Expand Down
16 changes: 16 additions & 0 deletions app/api/stores/[storeId]/themes/confirm/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { getNextCorsHeaders } from '@/lib/utils/next-cors';
import { logger } from '@/renderer-engine/lib/logger';
import {
Expand Down
16 changes: 16 additions & 0 deletions app/api/stores/[storeId]/themes/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { getNextCorsHeaders } from '@/lib/utils/next-cors';
import { logger } from '@/renderer-engine/lib/logger';
import { AuthGetCurrentUserServer, cookiesClient } from '@/utils/client/AmplifyUtils';
Expand Down
16 changes: 16 additions & 0 deletions app/api/stores/[storeId]/themes/upload/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { getNextCorsHeaders } from '@/lib/utils/next-cors';
import { logger } from '@/renderer-engine/lib/logger';
import { TemplateAnalysis } from '@/renderer-engine/services/templates/analysis/template-analyzer';
Expand Down
16 changes: 16 additions & 0 deletions app/api/stores/template-dev/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { getNextCorsHeaders } from '@/lib/utils/next-cors';
import { logger } from '@/renderer-engine/lib/logger';
import { templateDevSynchronizer } from '@/renderer-engine/services/templates/sync/template-dev-synchronizer';
Expand Down
16 changes: 16 additions & 0 deletions app/api/stores/template-dev/ws/route.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2025 Fasttify LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { logger } from '@/renderer-engine/lib/logger';
import { templateDevSynchronizer } from '@/renderer-engine/services/templates/sync/template-dev-synchronizer';
import { NextRequest } from 'next/server';
Expand Down
Loading
Loading