add functions
@@ -1,179 +0,0 @@
|
|||||||
apply plugin: "com.android.application"
|
|
||||||
apply plugin: "org.jetbrains.kotlin.android"
|
|
||||||
apply plugin: "com.facebook.react"
|
|
||||||
|
|
||||||
def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the configuration block to customize your React Native Android app.
|
|
||||||
* By default you don't need to apply any configuration, just uncomment the lines you need.
|
|
||||||
*/
|
|
||||||
react {
|
|
||||||
entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", projectRoot, "android", "absolute"].execute(null, rootDir).text.trim())
|
|
||||||
reactNativeDir = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()
|
|
||||||
hermesCommand = new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/sdks/hermesc/%OS-BIN%/hermesc"
|
|
||||||
codegenDir = new File(["node", "--print", "require.resolve('@react-native/codegen/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim()).getParentFile().getAbsoluteFile()
|
|
||||||
|
|
||||||
// Use Expo CLI to bundle the app, this ensures the Metro config
|
|
||||||
// works correctly with Expo projects.
|
|
||||||
cliFile = new File(["node", "--print", "require.resolve('@expo/cli', { paths: [require.resolve('expo/package.json')] })"].execute(null, rootDir).text.trim())
|
|
||||||
bundleCommand = "export:embed"
|
|
||||||
|
|
||||||
/* Folders */
|
|
||||||
// The root of your project, i.e. where "package.json" lives. Default is '../..'
|
|
||||||
// root = file("../../")
|
|
||||||
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
|
|
||||||
// reactNativeDir = file("../../node_modules/react-native")
|
|
||||||
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
|
|
||||||
// codegenDir = file("../../node_modules/@react-native/codegen")
|
|
||||||
|
|
||||||
/* Variants */
|
|
||||||
// The list of variants to that are debuggable. For those we're going to
|
|
||||||
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
|
|
||||||
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
|
|
||||||
// debuggableVariants = ["liteDebug", "prodDebug"]
|
|
||||||
|
|
||||||
/* Bundling */
|
|
||||||
// A list containing the node command and its flags. Default is just 'node'.
|
|
||||||
// nodeExecutableAndArgs = ["node"]
|
|
||||||
|
|
||||||
//
|
|
||||||
// The path to the CLI configuration file. Default is empty.
|
|
||||||
// bundleConfig = file(../rn-cli.config.js)
|
|
||||||
//
|
|
||||||
// The name of the generated asset file containing your JS bundle
|
|
||||||
// bundleAssetName = "MyApplication.android.bundle"
|
|
||||||
//
|
|
||||||
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
|
|
||||||
// entryFile = file("../js/MyApplication.android.js")
|
|
||||||
//
|
|
||||||
// A list of extra flags to pass to the 'bundle' commands.
|
|
||||||
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
|
|
||||||
// extraPackagerArgs = []
|
|
||||||
|
|
||||||
/* Hermes Commands */
|
|
||||||
// The hermes compiler command to run. By default it is 'hermesc'
|
|
||||||
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
|
|
||||||
//
|
|
||||||
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
|
|
||||||
// hermesFlags = ["-O", "-output-source-map"]
|
|
||||||
|
|
||||||
/* Autolinking */
|
|
||||||
autolinkLibrariesWithApp()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
|
|
||||||
*/
|
|
||||||
def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInReleaseBuilds') ?: false).toBoolean()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The preferred build flavor of JavaScriptCore (JSC)
|
|
||||||
*
|
|
||||||
* For example, to use the international variant, you can use:
|
|
||||||
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
|
|
||||||
*
|
|
||||||
* The international variant includes ICU i18n library and necessary data
|
|
||||||
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
|
|
||||||
* give correct results when using with locales other than en-US. Note that
|
|
||||||
* this variant is about 6MiB larger per architecture than default.
|
|
||||||
*/
|
|
||||||
def jscFlavor = 'org.webkit:android-jsc:+'
|
|
||||||
|
|
||||||
android {
|
|
||||||
ndkVersion rootProject.ext.ndkVersion
|
|
||||||
|
|
||||||
buildToolsVersion rootProject.ext.buildToolsVersion
|
|
||||||
compileSdk rootProject.ext.compileSdkVersion
|
|
||||||
|
|
||||||
namespace 'com.minuit.starter'
|
|
||||||
defaultConfig {
|
|
||||||
applicationId 'com.minuit.starter'
|
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
||||||
versionCode 1
|
|
||||||
versionName "2024.04.1"
|
|
||||||
}
|
|
||||||
signingConfigs {
|
|
||||||
debug {
|
|
||||||
storeFile file('debug.keystore')
|
|
||||||
storePassword 'android'
|
|
||||||
keyAlias 'androiddebugkey'
|
|
||||||
keyPassword 'android'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
buildTypes {
|
|
||||||
debug {
|
|
||||||
signingConfig signingConfigs.debug
|
|
||||||
}
|
|
||||||
release {
|
|
||||||
// Caution! In production, you need to generate your own keystore file.
|
|
||||||
// see https://reactnative.dev/docs/signed-apk-android.
|
|
||||||
signingConfig signingConfigs.debug
|
|
||||||
shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)
|
|
||||||
minifyEnabled enableProguardInReleaseBuilds
|
|
||||||
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
||||||
crunchPngs (findProperty('android.enablePngCrunchInReleaseBuilds')?.toBoolean() ?: true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
packagingOptions {
|
|
||||||
jniLibs {
|
|
||||||
useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
androidResources {
|
|
||||||
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Apply static values from `gradle.properties` to the `android.packagingOptions`
|
|
||||||
// Accepts values in comma delimited lists, example:
|
|
||||||
// android.packagingOptions.pickFirsts=/LICENSE,**/picasa.ini
|
|
||||||
["pickFirsts", "excludes", "merges", "doNotStrip"].each { prop ->
|
|
||||||
// Split option: 'foo,bar' -> ['foo', 'bar']
|
|
||||||
def options = (findProperty("android.packagingOptions.$prop") ?: "").split(",");
|
|
||||||
// Trim all elements in place.
|
|
||||||
for (i in 0..<options.size()) options[i] = options[i].trim();
|
|
||||||
// `[] - ""` is essentially `[""].filter(Boolean)` removing all empty strings.
|
|
||||||
options -= ""
|
|
||||||
|
|
||||||
if (options.length > 0) {
|
|
||||||
println "android.packagingOptions.$prop += $options ($options.length)"
|
|
||||||
// Ex: android.packagingOptions.pickFirsts += '**/SCCS/**'
|
|
||||||
options.each {
|
|
||||||
android.packagingOptions[prop] += it
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
// The version of react-native is set by the React Native Gradle Plugin
|
|
||||||
implementation("com.facebook.react:react-android")
|
|
||||||
|
|
||||||
def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true";
|
|
||||||
def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true";
|
|
||||||
def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true";
|
|
||||||
|
|
||||||
if (isGifEnabled) {
|
|
||||||
// For animated gif support
|
|
||||||
implementation("com.facebook.fresco:animated-gif:${reactAndroidLibs.versions.fresco.get()}")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isWebpEnabled) {
|
|
||||||
// For webp support
|
|
||||||
implementation("com.facebook.fresco:webpsupport:${reactAndroidLibs.versions.fresco.get()}")
|
|
||||||
if (isWebpAnimatedEnabled) {
|
|
||||||
// Animated webp support
|
|
||||||
implementation("com.facebook.fresco:animated-webp:${reactAndroidLibs.versions.fresco.get()}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hermesEnabled.toBoolean()) {
|
|
||||||
implementation("com.facebook.react:hermes-android")
|
|
||||||
} else {
|
|
||||||
implementation jscFlavor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
|
||||||
apply plugin: 'com.google.firebase.crashlytics'
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"project_info": {
|
|
||||||
"project_number": "943006074419",
|
|
||||||
"project_id": "minuitcloud",
|
|
||||||
"storage_bucket": "minuitcloud.appspot.com"
|
|
||||||
},
|
|
||||||
"client": [
|
|
||||||
{
|
|
||||||
"client_info": {
|
|
||||||
"mobilesdk_app_id": "1:943006074419:android:1cf962aa044ea020658546",
|
|
||||||
"android_client_info": {
|
|
||||||
"package_name": "com.minuit.starter"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oauth_client": [
|
|
||||||
{
|
|
||||||
"client_id": "943006074419-bal1qb28ssgh0v2ta1fhj1vl8a9mb7tp.apps.googleusercontent.com",
|
|
||||||
"client_type": 3
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"api_key": [
|
|
||||||
{
|
|
||||||
"current_key": "AIzaSyA13RHqqFcx0tu6qja0shDomazoOk7wBw0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"services": {
|
|
||||||
"appinvite_service": {
|
|
||||||
"other_platform_oauth_client": [
|
|
||||||
{
|
|
||||||
"client_id": "943006074419-bal1qb28ssgh0v2ta1fhj1vl8a9mb7tp.apps.googleusercontent.com",
|
|
||||||
"client_type": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"client_id": "943006074419-h43c7p48nhn5f4td4oimv4dq7b1p3s29.apps.googleusercontent.com",
|
|
||||||
"client_type": 2,
|
|
||||||
"ios_info": {
|
|
||||||
"bundle_id": "com.minuit.starter",
|
|
||||||
"app_store_id": "1661696886"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"configuration_version": "1"
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# Add project specific ProGuard rules here.
|
|
||||||
# By default, the flags in this file are appended to flags specified
|
|
||||||
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
|
|
||||||
# You can edit the include path and order by changing the proguardFiles
|
|
||||||
# directive in build.gradle.
|
|
||||||
#
|
|
||||||
# For more details, see
|
|
||||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
||||||
|
|
||||||
# react-native-reanimated
|
|
||||||
-keep class com.swmansion.reanimated.** { *; }
|
|
||||||
-keep class com.facebook.react.turbomodule.** { *; }
|
|
||||||
|
|
||||||
# Add any project specific keep options here:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
||||||
|
|
||||||
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" tools:replace="android:usesCleartextTraffic" />
|
|
||||||
</manifest>
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
|
||||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
|
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
||||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
|
||||||
<queries>
|
|
||||||
<intent>
|
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
|
||||||
<category android:name="android.intent.category.BROWSABLE"/>
|
|
||||||
<data android:scheme="https"/>
|
|
||||||
</intent>
|
|
||||||
</queries>
|
|
||||||
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme" android:supportsRtl="true">
|
|
||||||
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
|
|
||||||
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
|
|
||||||
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
|
|
||||||
<activity android:name=".MainActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true" android:screenOrientation="portrait">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
|
||||||
</intent-filter>
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
|
||||||
<category android:name="android.intent.category.BROWSABLE"/>
|
|
||||||
<data android:scheme="minuit"/>
|
|
||||||
<data android:scheme="com.minuit.starter"/>
|
|
||||||
<data android:scheme="exp+minuitstarter"/>
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
</application>
|
|
||||||
</manifest>
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
package com.minuit.starter
|
|
||||||
import expo.modules.splashscreen.SplashScreenManager
|
|
||||||
|
|
||||||
import android.os.Build
|
|
||||||
import android.os.Bundle
|
|
||||||
|
|
||||||
import com.facebook.react.ReactActivity
|
|
||||||
import com.facebook.react.ReactActivityDelegate
|
|
||||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
|
||||||
import com.facebook.react.defaults.DefaultReactActivityDelegate
|
|
||||||
|
|
||||||
import expo.modules.ReactActivityDelegateWrapper
|
|
||||||
|
|
||||||
class MainActivity : ReactActivity() {
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
|
||||||
// Set the theme to AppTheme BEFORE onCreate to support
|
|
||||||
// coloring the background, status bar, and navigation bar.
|
|
||||||
// This is required for expo-splash-screen.
|
|
||||||
// setTheme(R.style.AppTheme);
|
|
||||||
// @generated begin expo-splashscreen - expo prebuild (DO NOT MODIFY) sync-f3ff59a738c56c9a6119210cb55f0b613eb8b6af
|
|
||||||
SplashScreenManager.registerOnActivity(this)
|
|
||||||
// @generated end expo-splashscreen
|
|
||||||
super.onCreate(null)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
||||||
* rendering of the component.
|
|
||||||
*/
|
|
||||||
override fun getMainComponentName(): String = "main"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
|
|
||||||
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
|
|
||||||
*/
|
|
||||||
override fun createReactActivityDelegate(): ReactActivityDelegate {
|
|
||||||
return ReactActivityDelegateWrapper(
|
|
||||||
this,
|
|
||||||
BuildConfig.IS_NEW_ARCHITECTURE_ENABLED,
|
|
||||||
object : DefaultReactActivityDelegate(
|
|
||||||
this,
|
|
||||||
mainComponentName,
|
|
||||||
fabricEnabled
|
|
||||||
){})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Align the back button behavior with Android S
|
|
||||||
* where moving root activities to background instead of finishing activities.
|
|
||||||
* @see <a href="https://developer.android.com/reference/android/app/Activity#onBackPressed()">onBackPressed</a>
|
|
||||||
*/
|
|
||||||
override fun invokeDefaultOnBackPressed() {
|
|
||||||
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
|
|
||||||
if (!moveTaskToBack(false)) {
|
|
||||||
// For non-root activities, use the default implementation to finish them.
|
|
||||||
super.invokeDefaultOnBackPressed()
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use the default back button implementation on Android S
|
|
||||||
// because it's doing more than [Activity.moveTaskToBack] in fact.
|
|
||||||
super.invokeDefaultOnBackPressed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
package com.minuit.starter
|
|
||||||
|
|
||||||
import android.app.Application
|
|
||||||
import android.content.res.Configuration
|
|
||||||
|
|
||||||
import com.facebook.react.PackageList
|
|
||||||
import com.facebook.react.ReactApplication
|
|
||||||
import com.facebook.react.ReactNativeHost
|
|
||||||
import com.facebook.react.ReactPackage
|
|
||||||
import com.facebook.react.ReactHost
|
|
||||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
|
|
||||||
import com.facebook.react.defaults.DefaultReactNativeHost
|
|
||||||
import com.facebook.react.soloader.OpenSourceMergedSoMapping
|
|
||||||
import com.facebook.soloader.SoLoader
|
|
||||||
|
|
||||||
import expo.modules.ApplicationLifecycleDispatcher
|
|
||||||
import expo.modules.ReactNativeHostWrapper
|
|
||||||
|
|
||||||
class MainApplication : Application(), ReactApplication {
|
|
||||||
|
|
||||||
override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(
|
|
||||||
this,
|
|
||||||
object : DefaultReactNativeHost(this) {
|
|
||||||
override fun getPackages(): List<ReactPackage> {
|
|
||||||
val packages = PackageList(this).packages
|
|
||||||
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
||||||
// packages.add(new MyReactNativePackage());
|
|
||||||
return packages
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getJSMainModuleName(): String = ".expo/.virtual-metro-entry"
|
|
||||||
|
|
||||||
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
|
|
||||||
|
|
||||||
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
|
||||||
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
override val reactHost: ReactHost
|
|
||||||
get() = ReactNativeHostWrapper.createReactHost(applicationContext, reactNativeHost)
|
|
||||||
|
|
||||||
override fun onCreate() {
|
|
||||||
super.onCreate()
|
|
||||||
SoLoader.init(this, OpenSourceMergedSoMapping)
|
|
||||||
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
||||||
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
|
||||||
load()
|
|
||||||
}
|
|
||||||
ApplicationLifecycleDispatcher.onApplicationCreate(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
|
||||||
super.onConfigurationChanged(newConfig)
|
|
||||||
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
@@ -1,6 +0,0 @@
|
|||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:drawable="@color/splashscreen_background"/>
|
|
||||||
<item>
|
|
||||||
<bitmap android:gravity="center" android:src="@drawable/splashscreen_logo"/>
|
|
||||||
</item>
|
|
||||||
</layer-list>
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Copyright (C) 2014 The Android Open Source Project
|
|
||||||
|
|
||||||
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.
|
|
||||||
-->
|
|
||||||
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
|
|
||||||
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
|
|
||||||
android:insetTop="@dimen/abc_edit_text_inset_top_material"
|
|
||||||
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
|
|
||||||
>
|
|
||||||
|
|
||||||
<selector>
|
|
||||||
<!--
|
|
||||||
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
|
|
||||||
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
|
|
||||||
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
|
|
||||||
|
|
||||||
<item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
|
|
||||||
|
|
||||||
For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
|
|
||||||
-->
|
|
||||||
<item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
|
|
||||||
<item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
|
|
||||||
</selector>
|
|
||||||
|
|
||||||
</inset>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@color/iconBackground"/>
|
|
||||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
|
||||||
</adaptive-icon>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<background android:drawable="@color/iconBackground"/>
|
|
||||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
|
||||||
</adaptive-icon>
|
|
||||||
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 12 KiB |
@@ -1 +0,0 @@
|
|||||||
<resources/>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<color name="splashscreen_background">#0F0C14</color>
|
|
||||||
<color name="iconBackground">#FFFFFF</color>
|
|
||||||
<color name="colorPrimary">#023c69</color>
|
|
||||||
<color name="colorPrimaryDark">#0F0C14</color>
|
|
||||||
<color name="activityBackground">#0F0C14</color>
|
|
||||||
</resources>
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
<resources>
|
|
||||||
<string name="app_name">minuit.starter</string>
|
|
||||||
<string name="expo_splash_screen_resize_mode" translatable="false">contain</string>
|
|
||||||
<string name="expo_splash_screen_status_bar_translucent" translatable="false">false</string>
|
|
||||||
</resources>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
|
||||||
<item name="android:textColor">@android:color/black</item>
|
|
||||||
<item name="android:editTextStyle">@style/ResetEditText</item>
|
|
||||||
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
|
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
|
||||||
<item name="android:statusBarColor">#0F0C14</item>
|
|
||||||
<item name="android:windowBackground">@color/activityBackground</item>
|
|
||||||
</style>
|
|
||||||
<style name="ResetEditText" parent="@android:style/Widget.EditText">
|
|
||||||
<item name="android:padding">0dp</item>
|
|
||||||
<item name="android:textColorHint">#c8c8c8</item>
|
|
||||||
<item name="android:textColor">@android:color/black</item>
|
|
||||||
</style>
|
|
||||||
<style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">
|
|
||||||
<item name="windowSplashScreenBackground">@color/splashscreen_background</item>
|
|
||||||
<item name="android:windowBackground">@drawable/splashscreen_logo</item>
|
|
||||||
<item name="postSplashScreenTheme">@style/AppTheme</item>
|
|
||||||
</style>
|
|
||||||
</resources>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# GOOGLE GENAI
|
|
||||||
GOOGLE_GENAI_API_KEY=...
|
|
||||||
|
|
||||||
@@ -1 +1,69 @@
|
|||||||
|
# Dependencies
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
logs/
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Runtime data
|
||||||
|
pids
|
||||||
|
*.pid
|
||||||
|
*.seed
|
||||||
|
*.pid.lock
|
||||||
|
|
||||||
|
# Coverage directory used by tools like istanbul
|
||||||
|
coverage/
|
||||||
|
|
||||||
|
# nyc test coverage
|
||||||
|
.nyc_output
|
||||||
|
|
||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# Optional npm cache directory
|
||||||
|
.npm
|
||||||
|
|
||||||
|
# Optional REPL history
|
||||||
|
.node_repl_history
|
||||||
|
|
||||||
|
# Output of 'npm pack'
|
||||||
|
*.tgz
|
||||||
|
|
||||||
|
# Yarn Integrity file
|
||||||
|
.yarn-integrity
|
||||||
|
|
||||||
|
# dotenv environment variables file
|
||||||
|
.env
|
||||||
|
|
||||||
|
# Firebase
|
||||||
|
.firebase/
|
||||||
|
|
||||||
|
# Service account key
|
||||||
|
serviceAccountKey.json
|
||||||
|
|
||||||
|
# API keys
|
||||||
|
config/keys.js
|
||||||
|
|
||||||
|
# Build files
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
|
||||||
|
# IDE files
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*~
|
||||||
|
|
||||||
|
# OS generated files
|
||||||
|
.DS_Store
|
||||||
|
.DS_Store?
|
||||||
|
._*
|
||||||
|
.Spotlight-V100
|
||||||
|
.Trashes
|
||||||
|
ehthumbs.db
|
||||||
|
Thumbs.db
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
[debug] [2024-11-29T15:16:33.623Z] ----------------------------------------------------------------------
|
|
||||||
[debug] [2024-11-29T15:16:33.625Z] Command: /Users/theo/.nvm/versions/node/v18.17.0/bin/node /Users/theo/.nvm/versions/node/v18.17.0/bin/firebase emulators:start
|
|
||||||
[debug] [2024-11-29T15:16:33.625Z] CLI Version: 13.18.0
|
|
||||||
[debug] [2024-11-29T15:16:33.626Z] Platform: darwin
|
|
||||||
[debug] [2024-11-29T15:16:33.626Z] Node Version: v18.17.0
|
|
||||||
[debug] [2024-11-29T15:16:33.628Z] Time: Fri Nov 29 2024 16:16:33 GMT+0100 (Central European Standard Time)
|
|
||||||
[debug] [2024-11-29T15:16:33.629Z] ----------------------------------------------------------------------
|
|
||||||
[debug]
|
|
||||||
[debug] [2024-11-29T15:16:33.795Z] Object "" in "firebase.json" has unknown property: {"additionalProperty":"react-native"}
|
|
||||||
[debug] [2024-11-29T15:16:33.804Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
||||||
[debug] [2024-11-29T15:16:33.805Z] > authorizing via signed-in user (letawny@gmail.com)
|
|
||||||
[info] i emulators: Starting emulators: functions {"metadata":{"emulator":{"name":"hub"},"message":"Starting emulators: functions"}}
|
|
||||||
[debug] [2024-11-29T15:16:35.338Z] [logging] Logging Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
|
|
||||||
[debug] [2024-11-29T15:16:35.339Z] assigned listening specs for emulators {"user":{"hub":[{"address":"127.0.0.1","family":"IPv4","port":4400},{"address":"::1","family":"IPv6","port":4400}],"ui":[{"address":"127.0.0.1","family":"IPv4","port":4000},{"address":"::1","family":"IPv6","port":4000}],"logging":[{"address":"127.0.0.1","family":"IPv4","port":4500}]},"metadata":{"message":"assigned listening specs for emulators"}}
|
|
||||||
[debug] [2024-11-29T15:16:35.347Z] [hub] writing locator at /var/folders/xw/v22l0r3n74lfydgqkyv8br5c0000gp/T/hub-starsclick.json
|
|
||||||
[debug] [2024-11-29T15:16:36.711Z] [functions] Functions Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
|
|
||||||
[debug] [2024-11-29T15:16:36.712Z] [eventarc] Eventarc Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
|
|
||||||
[debug] [2024-11-29T15:16:36.712Z] [tasks] Cloud Tasks Emulator only supports listening on one address (127.0.0.1). Not listening on ::1
|
|
||||||
[debug] [2024-11-29T15:16:36.713Z] late-assigned ports for functions and eventarc emulators {"user":{"hub":[{"address":"127.0.0.1","family":"IPv4","port":4400},{"address":"::1","family":"IPv6","port":4400}],"ui":[{"address":"127.0.0.1","family":"IPv4","port":4000},{"address":"::1","family":"IPv6","port":4000}],"logging":[{"address":"127.0.0.1","family":"IPv4","port":4500}],"functions":[{"address":"127.0.0.1","family":"IPv4","port":5001}],"eventarc":[{"address":"127.0.0.1","family":"IPv4","port":9299}],"tasks":[{"address":"127.0.0.1","family":"IPv4","port":9499}]},"metadata":{"message":"late-assigned ports for functions and eventarc emulators"}}
|
|
||||||
[warn] ⚠ functions: The following emulators are not running, calls to these services from the Functions emulator will affect production: auth, firestore, database, hosting, pubsub, storage, dataconnect {"metadata":{"emulator":{"name":"functions"},"message":"The following emulators are not running, calls to these services from the Functions emulator will affect production: \u001b[1mauth, firestore, database, hosting, pubsub, storage, dataconnect\u001b[22m"}}
|
|
||||||
[debug] [2024-11-29T15:16:36.719Z] defaultcredentials: writing to file /Users/theo/.config/firebase/letawny_gmail_com_application_default_credentials.json
|
|
||||||
[debug] [2024-11-29T15:16:36.725Z] Setting GAC to /Users/theo/.config/firebase/letawny_gmail_com_application_default_credentials.json {"metadata":{"emulator":{"name":"functions"},"message":"Setting GAC to /Users/theo/.config/firebase/letawny_gmail_com_application_default_credentials.json"}}
|
|
||||||
[debug] [2024-11-29T15:16:36.728Z] > refreshing access token with scopes: []
|
|
||||||
[debug] [2024-11-29T15:16:36.730Z] >>> [apiv2][query] POST https://www.googleapis.com/oauth2/v3/token [none]
|
|
||||||
[debug] [2024-11-29T15:16:36.730Z] >>> [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
|
|
||||||
[debug] [2024-11-29T15:16:36.876Z] <<< [apiv2][status] POST https://www.googleapis.com/oauth2/v3/token 200
|
|
||||||
[debug] [2024-11-29T15:16:36.878Z] <<< [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
|
|
||||||
[debug] [2024-11-29T15:16:36.900Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/starsclick/adminSdkConfig [none]
|
|
||||||
[debug] [2024-11-29T15:16:37.423Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/starsclick/adminSdkConfig 200
|
|
||||||
[debug] [2024-11-29T15:16:37.423Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/starsclick/adminSdkConfig {"projectId":"starsclick","storageBucket":"starsclick.appspot.com","locationId":"europe-west"}
|
|
||||||
[debug] [2024-11-29T15:16:37.462Z] Ignoring unsupported arg: auto_download {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: auto_download"}}
|
|
||||||
[debug] [2024-11-29T15:16:37.463Z] Ignoring unsupported arg: port {"metadata":{"emulator":{"name":"ui"},"message":"Ignoring unsupported arg: port"}}
|
|
||||||
[debug] [2024-11-29T15:16:37.463Z] Starting Emulator UI with command {"binary":"node","args":["/Users/theo/.cache/firebase/emulators/ui-v1.13.0/server/server.mjs"],"optionalArgs":[],"joinArgs":false,"shell":false} {"metadata":{"emulator":{"name":"ui"},"message":"Starting Emulator UI with command {\"binary\":\"node\",\"args\":[\"/Users/theo/.cache/firebase/emulators/ui-v1.13.0/server/server.mjs\"],\"optionalArgs\":[],\"joinArgs\":false,\"shell\":false}"}}
|
|
||||||
[info] i ui: Emulator UI logging to ui-debug.log {"metadata":{"emulator":{"name":"ui"},"message":"Emulator UI logging to \u001b[1mui-debug.log\u001b[22m"}}
|
|
||||||
[debug] [2024-11-29T15:16:37.616Z] Web / API server started at 127.0.0.1:4000
|
|
||||||
{"metadata":{"emulator":{"name":"ui"},"message":"Web / API server started at 127.0.0.1:4000\n"}}
|
|
||||||
[debug] [2024-11-29T15:16:37.616Z] Web / API server started at ::1:4000
|
|
||||||
{"metadata":{"emulator":{"name":"ui"},"message":"Web / API server started at ::1:4000\n"}}
|
|
||||||
[info] i functions: Watching "/Users/theo/starsclick/functions" for Cloud Functions... {"metadata":{"emulator":{"name":"functions"},"message":"Watching \"/Users/theo/starsclick/functions\" for Cloud Functions..."}}
|
|
||||||
[debug] [2024-11-29T15:16:37.683Z] Validating nodejs source
|
|
||||||
[warn] ⚠ functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory.
|
|
||||||
[warn] ⚠ functions: Please note that there will be breaking changes when you upgrade.
|
|
||||||
[debug] [2024-11-29T15:16:38.518Z] > [functions] package.json contents: {
|
|
||||||
"name": "functions",
|
|
||||||
"description": "Cloud Functions for Firebase",
|
|
||||||
"scripts": {
|
|
||||||
"serve": "firebase emulators:start --only functions",
|
|
||||||
"shell": "firebase functions:shell",
|
|
||||||
"start": "npm run shell",
|
|
||||||
"deploy": "firebase deploy --only functions",
|
|
||||||
"logs": "firebase functions:log"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "18"
|
|
||||||
},
|
|
||||||
"main": "index.js",
|
|
||||||
"dependencies": {
|
|
||||||
"@babel/preset-env": "^7.25.8",
|
|
||||||
"@babel/preset-react": "^7.25.7",
|
|
||||||
"@babel/register": "^7.25.7",
|
|
||||||
"@genkit-ai/google-cloud": "^0.9.4",
|
|
||||||
"@genkit-ai/googleai": "^0.9.4",
|
|
||||||
"@genkit-ai/vertexai": "^0.9.4",
|
|
||||||
"@react-pdf/renderer": "^2.3.0",
|
|
||||||
"axios": "^1.6.2",
|
|
||||||
"crypto-js": "^4.2.0",
|
|
||||||
"dotenv": "^16.0.3",
|
|
||||||
"firebase-admin": "^11.8.0",
|
|
||||||
"firebase-functions": "^4.3.1",
|
|
||||||
"lodash": "^4.17.21",
|
|
||||||
"moment": "^2.30.1",
|
|
||||||
"moment-timezone": "^0.5.45",
|
|
||||||
"stripe": "^16.1.0",
|
|
||||||
"react": "^17.0.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"firebase-functions-test": "^3.1.0"
|
|
||||||
},
|
|
||||||
"private": true
|
|
||||||
}
|
|
||||||
[debug] [2024-11-29T15:16:38.518Z] Building nodejs source
|
|
||||||
[debug] [2024-11-29T15:16:38.518Z] Failed to find version of module node: reached end of search path /Users/theo/starsclick/functions/node_modules
|
|
||||||
[info] ✔ functions: Using node@18 from host.
|
|
||||||
[info] i functions: Loaded environment variables from .env.
|
|
||||||
[debug] [2024-11-29T15:16:38.522Z] Could not find functions.yaml. Must use http discovery
|
|
||||||
[debug] [2024-11-29T15:16:38.537Z] Found firebase-functions binary at '/Users/theo/starsclick/functions/node_modules/.bin/firebase-functions'
|
|
||||||
[info] Serving at port 8113
|
|
||||||
|
|
||||||
[debug] [2024-11-29T15:16:41.014Z] Got response from /__/functions.yaml {"endpoints":{"users-userUpdateListener":{"availableMemoryMb":null,"timeoutSeconds":null,"minInstances":null,"maxInstances":null,"ingressSettings":null,"concurrency":null,"serviceAccountEmail":null,"vpc":null,"platform":"gcfv2","labels":{},"eventTrigger":{"eventType":"google.cloud.firestore.document.v1.written","eventFilters":{"database":"(default)","namespace":"(default)"},"eventFilterPathPatterns":{"document":"users/{userID}"},"retry":false},"entryPoint":"users.userUpdateListener"},"users-deleteAccount":{"availableMemoryMb":null,"timeoutSeconds":null,"minInstances":null,"maxInstances":null,"ingressSettings":null,"concurrency":null,"serviceAccountEmail":null,"vpc":null,"platform":"gcfv2","labels":{},"callableTrigger":{},"entryPoint":"users.deleteAccount"},"payments-createCheckoutSession":{"availableMemoryMb":null,"timeoutSeconds":null,"minInstances":null,"maxInstances":null,"ingressSettings":null,"concurrency":null,"serviceAccountEmail":null,"vpc":null,"platform":"gcfv2","labels":{},"callableTrigger":{},"entryPoint":"payments.createCheckoutSession"},"payments-getPremiumStatus":{"availableMemoryMb":null,"timeoutSeconds":null,"minInstances":null,"maxInstances":null,"ingressSettings":null,"concurrency":null,"serviceAccountEmail":null,"vpc":null,"platform":"gcfv2","labels":{},"callableTrigger":{},"entryPoint":"payments.getPremiumStatus"},"payments-createStripeCustomerPortalSession":{"availableMemoryMb":null,"timeoutSeconds":null,"minInstances":null,"maxInstances":null,"ingressSettings":null,"concurrency":null,"serviceAccountEmail":null,"vpc":null,"platform":"gcfv2","labels":{},"callableTrigger":{},"entryPoint":"payments.createStripeCustomerPortalSession"},"documents-generateDocumentFromTemplate":{"availableMemoryMb":null,"timeoutSeconds":null,"minInstances":null,"maxInstances":null,"ingressSettings":null,"concurrency":null,"serviceAccountEmail":null,"vpc":null,"platform":"gcfv2","labels":{},"callableTrigger":{},"entryPoint":"documents.generateDocumentFromTemplate"},"documents-testDocumentGeneration":{"platform":"gcfv1","availableMemoryMb":512,"timeoutSeconds":null,"minInstances":null,"maxInstances":null,"ingressSettings":null,"serviceAccountEmail":null,"vpc":null,"httpsTrigger":{},"entryPoint":"documents.testDocumentGeneration"}},"specVersion":"v1alpha1","requiredAPIs":[]}
|
|
||||||
[info] ✔ functions: Loaded functions definitions from source: users.userUpdateListener, users.deleteAccount, payments.createCheckoutSession, payments.getPremiumStatus, payments.createStripeCustomerPortalSession, documents.generateDocumentFromTemplate, documents.testDocumentGeneration. {"metadata":{"emulator":{"name":"functions"},"message":"Loaded functions definitions from source: users.userUpdateListener, users.deleteAccount, payments.createCheckoutSession, payments.getPremiumStatus, payments.createStripeCustomerPortalSession, documents.generateDocumentFromTemplate, documents.testDocumentGeneration."}}
|
|
||||||
[info] i functions[us-central1-users-userUpdateListener]: function ignored because the firestore emulator does not exist or is not running. {"metadata":{"emulator":{"name":"functions"},"message":"function ignored because the firestore emulator does not exist or is not running."}}
|
|
||||||
[info] ✔ functions[us-central1-users-deleteAccount]: http function initialized (http://127.0.0.1:5001/starsclick/us-central1/users-deleteAccount). {"metadata":{"emulator":{"name":"functions"},"message":"\u001b[1mhttp\u001b[22m function initialized (http://127.0.0.1:5001/starsclick/us-central1/users-deleteAccount)."}}
|
|
||||||
[info] ✔ functions[us-central1-payments-createCheckoutSession]: http function initialized (http://127.0.0.1:5001/starsclick/us-central1/payments-createCheckoutSession). {"metadata":{"emulator":{"name":"functions"},"message":"\u001b[1mhttp\u001b[22m function initialized (http://127.0.0.1:5001/starsclick/us-central1/payments-createCheckoutSession)."}}
|
|
||||||
[info] ✔ functions[us-central1-payments-getPremiumStatus]: http function initialized (http://127.0.0.1:5001/starsclick/us-central1/payments-getPremiumStatus). {"metadata":{"emulator":{"name":"functions"},"message":"\u001b[1mhttp\u001b[22m function initialized (http://127.0.0.1:5001/starsclick/us-central1/payments-getPremiumStatus)."}}
|
|
||||||
[info] ✔ functions[us-central1-payments-createStripeCustomerPortalSession]: http function initialized (http://127.0.0.1:5001/starsclick/us-central1/payments-createStripeCustomerPortalSession). {"metadata":{"emulator":{"name":"functions"},"message":"\u001b[1mhttp\u001b[22m function initialized (http://127.0.0.1:5001/starsclick/us-central1/payments-createStripeCustomerPortalSession)."}}
|
|
||||||
[info] ✔ functions[us-central1-documents-generateDocumentFromTemplate]: http function initialized (http://127.0.0.1:5001/starsclick/us-central1/documents-generateDocumentFromTemplate). {"metadata":{"emulator":{"name":"functions"},"message":"\u001b[1mhttp\u001b[22m function initialized (http://127.0.0.1:5001/starsclick/us-central1/documents-generateDocumentFromTemplate)."}}
|
|
||||||
[info] ✔ functions[us-central1-documents-testDocumentGeneration]: http function initialized (http://127.0.0.1:5001/starsclick/us-central1/documents-testDocumentGeneration). {"metadata":{"emulator":{"name":"functions"},"message":"\u001b[1mhttp\u001b[22m function initialized (http://127.0.0.1:5001/starsclick/us-central1/documents-testDocumentGeneration)."}}
|
|
||||||
[info]
|
|
||||||
┌─────────────────────────────────────────────────────────────┐
|
|
||||||
│ ✔ All emulators ready! It is now safe to connect your app. │
|
|
||||||
│ i View Emulator UI at http://127.0.0.1:4000/ │
|
|
||||||
└─────────────────────────────────────────────────────────────┘
|
|
||||||
|
|
||||||
┌───────────┬────────────────┬─────────────────────────────────┐
|
|
||||||
│ Emulator │ Host:Port │ View in Emulator UI │
|
|
||||||
├───────────┼────────────────┼─────────────────────────────────┤
|
|
||||||
│ Functions │ 127.0.0.1:5001 │ http://127.0.0.1:4000/functions │
|
|
||||||
└───────────┴────────────────┴─────────────────────────────────┘
|
|
||||||
Emulator Hub running at 127.0.0.1:4400
|
|
||||||
Other reserved ports: 4500
|
|
||||||
|
|
||||||
Issues? Report them at https://github.com/firebase/firebase-tools/issues and attach the *-debug.log files.
|
|
||||||
|
|
||||||
@@ -1,39 +1,39 @@
|
|||||||
const admin = require("firebase-admin");
|
const admin = require("firebase-admin");
|
||||||
|
const serviceAccount = require("./serviceAccountKey.json");
|
||||||
const serviceAccount = require("./serviceAccountProd.json");
|
const { googleAI, gemini25FlashLite } = require("@genkit-ai/googleai");
|
||||||
|
const { GEMINI_API_KEY } = require("./config/keys");
|
||||||
|
const { genkit } = require("genkit");
|
||||||
|
|
||||||
admin.initializeApp({
|
admin.initializeApp({
|
||||||
credential: admin.credential.cert(serviceAccount),
|
credential: admin.credential.cert(serviceAccount),
|
||||||
|
storageBucket: "musicland-d33f9.firebasestorage.app",
|
||||||
});
|
});
|
||||||
|
|
||||||
let db = admin.firestore();
|
exports.generateAI = async ({ system = "", prompt = "", schema }) => {
|
||||||
exports.db = db;
|
const genkitInstance = genkit({
|
||||||
|
plugins: [
|
||||||
|
googleAI({
|
||||||
|
apiKey: GEMINI_API_KEY,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
model: gemini25FlashLite,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (prompt?.length < 1) {
|
||||||
|
throw new Error(
|
||||||
|
"Vous devez spécifier un prompt pour effectuer cette action.",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const { vertexAI, gemini15Flash } = require("@genkit-ai/vertexai");
|
const { output } = await genkitInstance.generate({
|
||||||
const { genkit } = require("genkit");
|
system,
|
||||||
|
prompt,
|
||||||
|
output: { schema },
|
||||||
|
});
|
||||||
|
|
||||||
require("dotenv").config();
|
return output;
|
||||||
|
|
||||||
require("@babel/register")({
|
|
||||||
presets: ["@babel/preset-env", "@babel/preset-react"],
|
|
||||||
});
|
|
||||||
|
|
||||||
// configure a Genkit instance
|
|
||||||
exports.genkitInstance = genkit({
|
|
||||||
plugins: [vertexAI({ projectId: "starsclick", location: "us-central1" })],
|
|
||||||
logLevel: "debug",
|
|
||||||
enableTracingAndMetrics: true,
|
|
||||||
model: gemini15Flash, // set default model
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
exports.refsList = {
|
|
||||||
users: db.collection("users"),
|
|
||||||
documents: db.collection("documents"),
|
|
||||||
logs: db.collection("logs"),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.users = require("./src/users");
|
// Exporter toutes les fonctions
|
||||||
exports.payments = require("./src/payments");
|
exports.music = require("./src/music");
|
||||||
exports.documents = require("./src/documents");
|
exports.lyrics = require("./src/lyrics");
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"name": "functions",
|
"name": "functions",
|
||||||
"description": "Cloud Functions for Firebase",
|
"description": "Cloud Functions for Firebase",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"lint": "eslint .",
|
||||||
"serve": "firebase emulators:start --only functions",
|
"serve": "firebase emulators:start --only functions",
|
||||||
"shell": "firebase functions:shell",
|
"shell": "firebase functions:shell",
|
||||||
"start": "npm run shell",
|
"start": "npm run shell",
|
||||||
@@ -13,26 +14,15 @@
|
|||||||
},
|
},
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/preset-env": "^7.25.8",
|
"@genkit-ai/googleai": "^1.16.0",
|
||||||
"@babel/preset-react": "^7.25.7",
|
"axios": "^1.6.0",
|
||||||
"@babel/register": "^7.25.7",
|
"firebase-admin": "^12.1.0",
|
||||||
"@genkit-ai/google-cloud": "^0.9.4",
|
"firebase-functions": "^5.0.0",
|
||||||
"@genkit-ai/googleai": "^0.9.4",
|
"genkit": "^1.16.0"
|
||||||
"@genkit-ai/vertexai": "^0.9.4",
|
|
||||||
"@react-pdf/renderer": "^2.3.0",
|
|
||||||
"axios": "^1.6.2",
|
|
||||||
"crypto-js": "^4.2.0",
|
|
||||||
"dotenv": "^16.0.3",
|
|
||||||
"firebase-admin": "^11.8.0",
|
|
||||||
"firebase-functions": "^4.3.1",
|
|
||||||
"lodash": "^4.17.21",
|
|
||||||
"moment": "^2.30.1",
|
|
||||||
"moment-timezone": "^0.5.45",
|
|
||||||
"stripe": "^16.1.0",
|
|
||||||
"react": "^17.0.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"firebase-functions-test": "^3.1.0"
|
"eslint": "^8.15.0",
|
||||||
|
"eslint-config-google": "^0.14.0"
|
||||||
},
|
},
|
||||||
"private": true
|
"private": true
|
||||||
}
|
}
|
||||||
@@ -1,185 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
import { Document, Page, Text, View, Font, Image } from "@react-pdf/renderer";
|
|
||||||
import { presidentSignatureBase64 } from "../data/presidentSignatureBase64";
|
|
||||||
import { RenderCompanyLogo, SignatureForm, Styles } from "./SharedElements";
|
|
||||||
|
|
||||||
Font.register({
|
|
||||||
family: "Helvetica",
|
|
||||||
fonts: [
|
|
||||||
{ src: "https://fonts.gstatic.com/s/helvetica/v15/Helvetica-Regular.ttf" },
|
|
||||||
{
|
|
||||||
src: "https://fonts.gstatic.com/s/helvetica/v15/Helvetica-Bold.ttf",
|
|
||||||
fontWeight: "bold",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
const Contract = ({
|
|
||||||
domiciliationData = {},
|
|
||||||
appConfig = {},
|
|
||||||
contractFields = {},
|
|
||||||
} = {}) => {
|
|
||||||
const { company } = appConfig;
|
|
||||||
|
|
||||||
const {
|
|
||||||
intro_contrat,
|
|
||||||
raison_sociale,
|
|
||||||
forme_juridique,
|
|
||||||
qualite,
|
|
||||||
civilite,
|
|
||||||
prenoms,
|
|
||||||
nom_de_jeune_fille_si_madame,
|
|
||||||
nom,
|
|
||||||
adresse,
|
|
||||||
code_postal,
|
|
||||||
ville,
|
|
||||||
adresse_de_domiciliation,
|
|
||||||
date_souhaitee_du_debut_de_la_domiciliation,
|
|
||||||
} = contractFields;
|
|
||||||
|
|
||||||
const sections = [
|
|
||||||
{
|
|
||||||
title: "Contrat de domiciliation",
|
|
||||||
content: <RenderCompanyLogo logoBase64={company?.logoBase64} />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: null,
|
|
||||||
content: (
|
|
||||||
<Text style={Styles.textParagraph}>{`
|
|
||||||
Entre les soussignés :
|
|
||||||
${intro_contrat}
|
|
||||||
Ci-après désignée « le domiciliataire »
|
|
||||||
D’une part et,
|
|
||||||
La société ${raison_sociale} ${forme_juridique} représentée par son ${qualite} , ${civilite} ${prenoms} ${nom_de_jeune_fille_si_madame} ${nom} demeurant ${adresse} ${code_postal} ${ville}.
|
|
||||||
Ci-après désignée « Le domicilié »
|
|
||||||
Il a été arrêté et convenu ce qui suit :
|
|
||||||
Article préliminaire : consentement des parties
|
|
||||||
Le Domicilié déclare avoir pris connaissance de tous les documents afférents à la présente (annexes, autorisation du pli du courrier et attestation comptable) et déclare donner acceptation expresse pour la totalité des clauses figurants dans les documents.
|
|
||||||
|
|
||||||
Article 1 : OBJET DU CONTRAT
|
|
||||||
Le présent contrat a pour objet la domiciliation du siège social du Domicilié conformément aux dispositions des articles R123-167 à R 123-171 du Code de Commerce.
|
|
||||||
|
|
||||||
Article 2 : OBLIGATION DES PARTIES
|
|
||||||
2.1 Obligations du domiciliataire
|
|
||||||
2.1.1 Obligations légales.
|
|
||||||
Conformément aux dispositions législatives des articles R 123-167 à R 123-171 du code de Commerce, le Domiciliataire s’engage, pendant toute la durée du présent contrat, à :
|
|
||||||
• Etre immatriculé au Registre du Commerce et des Sociétés ou au Répertoire des Métiers, durant l’occupation des locaux.
|
|
||||||
• Mettre à la disposition du Domicilié des locaux dotés d’une pièce destinée à assurer la confidentialité nécessaire et à permettre une réunion régulière des organes de direction, d’administration ou de surveillance de l’entreprise ainsi que la tenue, la conservation et consultation des livres, registres et documents prescrits par la loi (Décret N°85.1280 du 5 décembre 1985, Article 2.6.1 modifié par Décret 2007-750 du 9 mai 2007).
|
|
||||||
• Détenir, pour le Domicilié, un dossier contenant les pièces justificatives relatives au domicile de son représentant légal, ses coordonnées téléphoniques ainsi que les lieux d’activité et de détention des documents comptables lorsqu’ils ne sont pas conservés chez elle.
|
|
||||||
• Informer le greffier du tribunal, à l’expiration du contrat ou en cas de résiliation anticipée de celui-ci, de la cessation de la domiciliation de l’entreprise dans ses locaux.
|
|
||||||
• Communiquer aux huissiers de justice, munis d’un titre exécutoire, les renseignements propres à joindre le domicilié.
|
|
||||||
• Fournir, chaque trimestre, au centre des impôts et aux organismes de recouvrement des cotisations et contributions de sécurité sociale compétents, une liste des personnes qui se sont domiciliées dans ses locaux au cours de cette période ou qui ont mis fin à leur domiciliation ainsi que chaque année, une liste des personnes domiciliées au 1er
|
|
||||||
|
|
||||||
2.1.2 Prestations
|
|
||||||
Le domiciliataire s’engage à fournir au Domicilié les prestations de services suivantes :
|
|
||||||
Domiciliation commerciale.
|
|
||||||
Cette prestation permet au domicilié de fixer son siège social dans les locaux du Domiciliataire situés au ${adresse_de_domiciliation}.
|
|
||||||
Domiciliation postale.
|
|
||||||
La prestation sus évoquée permet uniquement au Domicilié de recevoir son courrier (recommandé et pli spécial avec autorisation) , sans pour autant en faire une utilisation dans sa communication commerciale qui serait susceptible de publicité mensongère ou trompeuse, le tout conformément aux dispositions législatives en vigueur et notamment l’article L-121-1 du Code de la consommation.
|
|
||||||
La mise à disposition des locaux.
|
|
||||||
Cette prestation permet au domicilié de bénéficier de locaux dotés d’une pièce destinée à assurer la confidentialité nécessaire et y permettre une réunion régulière des organes chargés de la direction, de l’administration ou de la surveillance de l’entreprise ainsi que la tenue, la conservation et la consultation des livres, registres et documents prescrits par les lois et règlements. Cette prestation est soumise à une rémunération supplémentaire proposée sur devis.
|
|
||||||
|
|
||||||
2.2 Obligations du Domicilié
|
|
||||||
2.2.1. Obligations générales
|
|
||||||
Dès la signature du présent contrat et durant toute la durée de celui-ci, le domicilié s’engage à :
|
|
||||||
• Justifier de son inscription au Registre du Commerce ou des Métiers ou toutes autres administrations compétentes dans les trois mois qui suivent la date d’engagement de la domiciliation, faute de quoi le Domiciliataire se réserve le droit de commander les documents justificatifs au frais du domicilié, au coût de 20 € HT (Vingt euros hors-taxes) pour le K-bis et de 40 € HT (quarante euros hors-taxes) pour les statuts.
|
|
||||||
• certifier l’exactitude des renseignements fournis à l’appui de la signature du contrat avec le Domiciliataire, certifier ne pas être en situation de liquidation de biens, redressement judiciaire en ce qui concerne l’entreprise ou les entreprises qu’il dirige, que ces établissements soient l’objet ou non dudit contrat, certifier ne pas être à titre personnel frappé de faillite personnelle ou d’interdiction de gérer, attester l’exactitude de tous les renseignements fournis au Domiciliataire tant en ce qui concerne son état civil que l’entreprise représentée.
|
|
||||||
Dans tous les cas, le Domicilié sera responsable de ses dettes après son départ du ${adresse_de_domiciliation}.
|
|
||||||
Tout renseignement fourni par le Domicilié pourra être communiqué sur demande aux représentants des organismes officiels et le domicilié en donne dès à présent son accord.
|
|
||||||
• Utiliser effectivement et exclusivement les locaux, soit comme siège de l’entreprise, soit si le siège est situé à l’étranger comme agence, succursale ou représentation ;
|
|
||||||
• Tenir informé le Domiciliataire de toute modification concernant son activité ;
|
|
||||||
En cas de changement, soit d’adresse, soit d’état civil personnel, soit de dénomination sociale, soit de nom commercial, soit de sigle (afin d’éviter les homonymes), soit de forme juridique ou d’objet, soit de dirigeant, soit de l’utilisateur des prestations fournies au titre du présent contrat, le Domicilié devra fournir tous les documents afférents à ces modifications au Domiciliataire et présenter son successeur ou le nouvel utilisateur, avant de déclarer tout changement auprès du Greffe du Tribunal de Commerce ou de la Chambre des Métiers ou de toute autre administration compétente.
|
|
||||||
• Déclarer tout changement statutaire et/ou relatif à sa forme juridique et son objet, ainsi qu’au nom et au domicile personnel des personnes ayant le pouvoir de l’engager à titre habituel ; donner mandat au Domiciliataire, qui l’accepte, de recevoir en son nom toute notification. Faute d’exécution d’une telle obligation, le domicilié s’acquittera dun règlement de 30 € HT (trente euros hors-taxes) correspondant aux frais de recherches des informations à fournir.
|
|
||||||
Les colis et plis spéciaux (DHL, CHRONOPOST, UPS, ...) ne seront acceptés qu’après signature d’un pouvoir de réception, aux conditions indiquées sur ledit document.
|
|
||||||
Le Domicilié s’engage à signer la procuration postale fournie avec le contrat au bénéfice du Domiciliataire afin de pouvoir réceptionner en son nom ou au nom de son entreprise les envois recommandés.
|
|
||||||
2.2.2. Obligations particulières relatives à la formule choisie par le domicilié
|
|
||||||
- Le domicilié s’engage à respecter les modalités d’exécution et obligations contractuelles qui figurent en annexe du présent contrat.
|
|
||||||
- Lesdites annexes reflètent l’offre à laquelle le domicilié a souscrit et doivent être considérées comme partie intégrante du présent contrat et doivent être à cet égard signées par les parties.
|
|
||||||
2.2.3. Redevance
|
|
||||||
En contrepartie des obligations auxquelles le Domiciliataire sest engagé à l’article 2.1, le domicilié s’engage à régler une redevance mensuelle dont le montant figure en annexe conformément à l’offre choisie. Ladite redevance est payable par prélèvement bancaire automatique, dit “ mandat SEPA “ le dix du mois en cours. Elle couvre les différentes prestations décrites dans chacune des offres à l’exception de la mise à disposition des locaux qui fait l’objet d’une tarification supplémentaire et des éventuels frais de réexpédition.
|
|
||||||
Lesdits frais de réexpédition du courrier prévus dans certaines offres seront facturés en sus au Domicilié et payables par prélèvement bancaire automatique, dit “ Mandat SEPA “ le dix du mois en cours. Une facture dématérialisée sera adressée mensuellement au gérant du Domicilié.
|
|
||||||
En cas d’anomalie ou erreur de prélèvement, ou en cas de règlement autre que le prélèvement mensuel ou le règlement de l’offre à l’année, la somme forfaitaire mensuelle sera majorée au tarif bancaire en vigueur par incident ou erreur commise, au titre des frais administratifs.
|
|
||||||
Pour les règlements par chèque, prélèvement ou carte bancaire remis à l’encaissement et impayés, des frais au tarif bancaire en vigueur seront imputés automatiquement sur la prochaine facture de domiciliation.
|
|
||||||
Le Domicilié donne dès à présent son accord pour une révision chaque année du tarif mensuel des prestations de services définies à l’Article 2.1.2. en fonction du taux d’inflation (indice IPC) ou de l’évolution des services auxquels il souscrit, ainsi que pour le mode de règlement proposé par le Domiciliataire.
|
|
||||||
Le domicilié sera tenu informé de la révision du tarif mensuel des prestations de services, un mois avant ladite révision.
|
|
||||||
Ce contrat est ferme et définitif à la signature et aucun remboursement même partiel ne saurait être revendiqué par le domicilié.
|
|
||||||
|
|
||||||
Article 3 : Accès à l’espace et utilisation des locaux
|
|
||||||
Sauf autorisation exceptionnelle mentionnée dans les conditions particulières ou par avenant à ce présent contrat, le Domicilié n’aura en aucun cas le droit de sous louer ou donner accès à l’espace à un tiers, hors prestations permises par le présent contrat.
|
|
||||||
|
|
||||||
Article 4 : Durée du contrat
|
|
||||||
Le présent contratest consenti pour une durée minimale de 3 mois à compter du ${date_souhaitee_du_debut_de_la_domiciliation}.
|
|
||||||
4.1. Renouvellement
|
|
||||||
Le présent contrat peut être renouvelé, par tacite reconduction, sauf résiliation notifiée par l’une ou l’autre des parties par lettre recommandée avec accusé de réception et expédiée au moins 30 (trente) jours avant le terme annuel.
|
|
||||||
4.2. Résiliation
|
|
||||||
Avant le terme de ce préavis, le Domicilié devra impérativement, pour valider sa résiliation définitive de contrat, adresser par courrier, une photocopie de son nouveau Kbis ou tout document remis par l’administration compétente, justifiant le transfert de siège social ou de sa radiation.
|
|
||||||
En l’absence de ce justificatif, le Domiciliataire se réserve le droit de poursuivre le contrat de domiciliation dans les termes initiaux.
|
|
||||||
L’adresse de correspondance est :
|
|
||||||
I DOM YOU ${adresse_de_domiciliation}
|
|
||||||
À l’expiration du présent contrat ou en cas de résiliation de celui-ci, le Domiciliataire s’engage à informer le greffe du Tribunal de Commerce de Paris de la cessation de la domiciliation.
|
|
||||||
Au terme de ce contrat, le courrier sera refusé par le Domiciliataire avec l’annotation « N’habite Pas à l’Adresse Indiquée ».
|
|
||||||
|
|
||||||
Article 5 : Dépôt de garantie
|
|
||||||
Le Domicilié verse, à la date de signature du présent contrat, à titre de dépôt de garantie, un montant correspondant à 3mois de redevance, en sus du mois correspondant à l’offre souscrite.
|
|
||||||
Le dépôt de garantie sera encaissé par le Domiciliataire dès sa remise par le Domicilié.
|
|
||||||
À chaque réajustement de la redevance, le dépôt de garantie sera diminué ou majoré de manière à toujours correspondre à 3 mois de redevance, hors taxes.
|
|
||||||
Ce dépôt de garantie est destiné, en cas de résiliation du contrat, au paiement des sommes dues pour la fourniture des services, l’exécution parfaite des clauses du présent contrat et des sommes dues par le Domicilié dont le Domiciliataire pourrait être rendu responsable.
|
|
||||||
En effet, ce dépôt de garantie pourra être utilisé soit pour défaut de règlement, soit pour la conséquence de dommages occasionnés par le Domicilié ou ses commettants.
|
|
||||||
Ledit dépôt de garantie ne saurait en aucun cas dispenser le Domicilié de payer toutes les redevances jusqu’au terme prévu.
|
|
||||||
Dans l’hypothèse où le dépôt de garantie versé par le Domicilié est inférieur au montant des remises en état opérées par le Domiciliataire au terme du contrat, le Domicilié s’engage à rembourser au Domiciliataire la différence entre la valeur des remises en état justifiée sur facture et le dépôt de garantie.
|
|
||||||
À la fin du contrat, ce dépôt de garantie sera remboursé déduction faite des sommes qui pourraient être dues au Domiciliataire.
|
|
||||||
Les sommes versées à titre de dépôt de garantie ne sauraient produire d’intérêt au profit du Domicilié.
|
|
||||||
|
|
||||||
Article 6 : Responsabilité des Parties
|
|
||||||
Dans la limite maximale admise par le droit français, le Domiciliataire décline toute responsabilité à l’égard du Domicilié en raison de la perte ou d’un dommage subi par le client en relation avec le présent contrat, avec les prestations, le ou les espaces, à moins que la perte ou le dommage ne résulte d’un acte intentionnel ou d’une négligence du Domiciliataire.
|
|
||||||
Le Domiciliataire décline toute responsabilité en raison de la perte résultant d’un manquement relatif à la fourniture d’une prestation par suite d’une panne mécanique, d’une grève, de la déchéance des droits du Domiciliataire sur les espaces ou pour toute autre raison à moins que le Domiciliataire n’ait agi intentionnellement ou par négligence.
|
|
||||||
En tout état de cause, le Domiciliataire ne sera responsable d’une perte ou dun dommage que si le Domicilié len avise par écrit et lui octroie un délai qui ne peut être inférieur à 20 (vingt) jours pour y remédier.
|
|
||||||
Si le Domicilié considère que le Domiciliataire a failli dans la fourniture des prestations prévues à l’article 2.1.2 des conditions particulières du contrat, le Domicilié devra en aviser le Domiciliataire par écrit et lui octroyer un délai qui ne peut être inférieur à 20 (vingt) jours afin que le Domiciliataire puisse y remédier.
|
|
||||||
En tout état de cause, seuls les préjudices directs pourront permettre l’engagement de la responsabilité des parties, étant précisé que pour ce qui est de la responsabilité du Domiciliataire, cette dernière ne pourra être supérieure au total du montant des sommes encaissées par ce dernier et payées par le Domicilié dans le cadre de l’exécution du contrat.
|
|
||||||
|
|
||||||
Article 7 : Assurance
|
|
||||||
Le Domicilié est responsable du matériel qu’il entrepose ${adresse_de_domiciliation}
|
|
||||||
Le Domiciliataire ne pourra être tenu responsable d’un vol dans les locaux.
|
|
||||||
Il est donc vivement conseillé au Domicilié de s’assurer pour son activité professionnelle (assurance civile professionnelle) et pour les espaces qu’il occupe (assurance multirisques bureaux).
|
|
||||||
|
|
||||||
Article 8 : Élection de domicile
|
|
||||||
Les parties font élection de domicile au ${adresse_de_domiciliation}.
|
|
||||||
|
|
||||||
Article 9 : Différend - Attribution de juridiction
|
|
||||||
Tout litige pouvant survenir entre les parties à l’occasion de l’exécution du présent contrat devra être porté devant le Tribunal de Commerce de Paris.
|
|
||||||
|
|
||||||
Article 10 : Confidentialité
|
|
||||||
Les parties s’engagent à traiter comme confidentielles toutes informations qu’elles seraient amenées à obtenir dans le cadre de ce contrat.`}</Text>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
SignatureForm(),
|
|
||||||
{
|
|
||||||
title: "Pour le responsable",
|
|
||||||
content: (
|
|
||||||
<>
|
|
||||||
<Image
|
|
||||||
src={`data:image/png;base64,${presidentSignatureBase64}`}
|
|
||||||
style={{ width: 200 }}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
].filter(({ condition = true }) => condition);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Document>
|
|
||||||
<Page style={Styles.body}>
|
|
||||||
{sections.map((section, index) => (
|
|
||||||
<View key={index} style={Styles.section}>
|
|
||||||
{section.title && (
|
|
||||||
<Text style={Styles.sectionTitle}>{section.title}</Text>
|
|
||||||
)}
|
|
||||||
{section.content}
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
</Page>
|
|
||||||
</Document>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Contract;
|
|
||||||
@@ -1,206 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
import { Document, Page, Text, View, Font, Image } from "@react-pdf/renderer";
|
|
||||||
import moment from "moment-timezone";
|
|
||||||
import {
|
|
||||||
DisplayCustomerInformation,
|
|
||||||
formatPrice,
|
|
||||||
RenderCompanyLogo,
|
|
||||||
RenderTermsOfSale,
|
|
||||||
Styles,
|
|
||||||
} from "./SharedElements";
|
|
||||||
|
|
||||||
Font.register({
|
|
||||||
family: "Helvetica",
|
|
||||||
fonts: [
|
|
||||||
{ src: "https://fonts.gstatic.com/s/helvetica/v15/Helvetica-Regular.ttf" },
|
|
||||||
{
|
|
||||||
src: "https://fonts.gstatic.com/s/helvetica/v15/Helvetica-Bold.ttf",
|
|
||||||
fontWeight: "bold",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
const Invoice = ({
|
|
||||||
itemList = [],
|
|
||||||
billingDetails = {},
|
|
||||||
|
|
||||||
number = "-",
|
|
||||||
|
|
||||||
paymentTimestamp = null,
|
|
||||||
creationTimestamp = new Date().toLocaleDateString("fr-FR"),
|
|
||||||
|
|
||||||
appConfig = {},
|
|
||||||
}) => {
|
|
||||||
const { company } = appConfig;
|
|
||||||
|
|
||||||
const subTotalNoTax = itemList.reduce(
|
|
||||||
(sum, item) => sum + (item?.unitPrice || 0) * (item?.quantity || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
let taxList = {};
|
|
||||||
|
|
||||||
itemList.forEach((item) => {
|
|
||||||
const { taxBreakdown = [] } = item;
|
|
||||||
taxBreakdown.forEach((tax) => {
|
|
||||||
const { type, amount, displayName, percentageDecimal = null } = tax;
|
|
||||||
if (type) {
|
|
||||||
taxList[type] = {
|
|
||||||
displayName,
|
|
||||||
percentageDecimal,
|
|
||||||
amount: (taxList?.[type]?.amount || 0) + amount,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const montantTotalTTC =
|
|
||||||
subTotalNoTax +
|
|
||||||
Object.values(taxList).reduce((sum, tax) => sum + tax.amount, 0);
|
|
||||||
|
|
||||||
const taxExemptionLegalString = "";
|
|
||||||
|
|
||||||
const sections = [
|
|
||||||
{
|
|
||||||
title: `Facture n°${number}`,
|
|
||||||
content: <RenderCompanyLogo logoBase64={company?.logoBase64} />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: null,
|
|
||||||
content: (
|
|
||||||
<View style={Styles.headerRow}>
|
|
||||||
<View style={Styles.leftColumn}>
|
|
||||||
{[
|
|
||||||
`Date d'émission: ${moment(creationTimestamp)
|
|
||||||
.tz("Europe/Paris")
|
|
||||||
.format("DD/MM/YYYY à HH:mm")}`,
|
|
||||||
paymentTimestamp
|
|
||||||
? `Date de paiement: ${moment(paymentTimestamp)
|
|
||||||
.tz("Europe/Paris")
|
|
||||||
.format("DD/MM/YYYY à HH:mm")}`
|
|
||||||
: null,
|
|
||||||
"Statut: payée",
|
|
||||||
]
|
|
||||||
.filter(Boolean)
|
|
||||||
.map((line, index) => (
|
|
||||||
<Text key={index} style={Styles.textParagraph}>
|
|
||||||
{line}
|
|
||||||
</Text>
|
|
||||||
))}
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<DisplayCustomerInformation billingDetails={billingDetails} />
|
|
||||||
</View>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Détails des prestations",
|
|
||||||
content: (
|
|
||||||
<View style={Styles.table}>
|
|
||||||
<View style={Styles.tableRow}>
|
|
||||||
<Text style={Styles.tableColHeaderLeft}>Description</Text>
|
|
||||||
<Text style={Styles.tableColHeaderRight}>Prix HT</Text>
|
|
||||||
</View>
|
|
||||||
{itemList.map((item, index) => (
|
|
||||||
<View key={index} style={Styles.tableRow}>
|
|
||||||
<View>
|
|
||||||
<Text style={Styles.tableColLeft}>{item.description}</Text>
|
|
||||||
</View>
|
|
||||||
<Text style={Styles.tableColRight}>
|
|
||||||
{formatPrice({ amount: item.unitPrice * item.quantity })}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
<View style={Styles.summaryRow}>
|
|
||||||
<Text style={Styles.summaryLabel}>Sous-total HT :</Text>
|
|
||||||
<Text style={Styles.summaryValue}>
|
|
||||||
{formatPrice({ amount: subTotalNoTax })}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
{Object.values(taxList)?.map((itemTax, index) => (
|
|
||||||
<View key={index} style={Styles.summaryRow}>
|
|
||||||
<Text style={Styles.summaryLabel}>
|
|
||||||
{itemTax?.displayName}{" "}
|
|
||||||
{itemTax?.percentageDecimal
|
|
||||||
? `(${itemTax?.percentageDecimal}%)`
|
|
||||||
: ""}{" "}
|
|
||||||
:
|
|
||||||
</Text>
|
|
||||||
<Text style={Styles.summaryValue}>
|
|
||||||
{formatPrice({ amount: itemTax.amount })}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
<View style={Styles.summaryRow}>
|
|
||||||
<Text style={Styles.summaryLabel}>Total TTC :</Text>
|
|
||||||
<Text style={Styles.summaryValue}>
|
|
||||||
{formatPrice({ amount: montantTotalTTC })}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Mentions légales",
|
|
||||||
content: (
|
|
||||||
<Text style={Styles.textParagraph}>
|
|
||||||
{`En cas de retard de paiement, une pénalité de 3 fois le taux d'intérêt légal sera appliquée, à laquelle s'ajoutera une indemnité forfaitaire pour frais de recouvrement de 40€. ${taxExemptionLegalString}`}
|
|
||||||
</Text>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
RenderTermsOfSale(),
|
|
||||||
].filter(({ content }) => content);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Document>
|
|
||||||
<Page style={Styles.body}>
|
|
||||||
{sections.map((section, index) => (
|
|
||||||
<View key={index} style={Styles.section}>
|
|
||||||
{section.title && (
|
|
||||||
<Text style={Styles.sectionTitle}>{section.title}</Text>
|
|
||||||
)}
|
|
||||||
{section.content}
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
</Page>
|
|
||||||
</Document>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Liste des taux de TVA standard pour les pays de l'UE
|
|
||||||
const euVatRates = {
|
|
||||||
AT: 0.2, // Autriche
|
|
||||||
BE: 0.21, // Belgique
|
|
||||||
BG: 0.2, // Bulgarie
|
|
||||||
HR: 0.25, // Croatie
|
|
||||||
CY: 0.19, // Chypre
|
|
||||||
CZ: 0.21, // République tchèque
|
|
||||||
DK: 0.25, // Danemark
|
|
||||||
EE: 0.2, // Estonie
|
|
||||||
FI: 0.24, // Finlande
|
|
||||||
FR: 0.2, // France
|
|
||||||
DE: 0.19, // Allemagne
|
|
||||||
GR: 0.24, // Grèce
|
|
||||||
HU: 0.27, // Hongrie
|
|
||||||
IE: 0.23, // Irlande
|
|
||||||
IT: 0.22, // Italie
|
|
||||||
LV: 0.21, // Lettonie
|
|
||||||
LT: 0.21, // Lituanie
|
|
||||||
LU: 0.17, // Luxembourg
|
|
||||||
MT: 0.18, // Malte
|
|
||||||
NL: 0.21, // Pays-Bas
|
|
||||||
PL: 0.23, // Pologne
|
|
||||||
PT: 0.23, // Portugal
|
|
||||||
RO: 0.19, // Roumanie
|
|
||||||
SK: 0.2, // Slovaquie
|
|
||||||
SI: 0.22, // Slovénie
|
|
||||||
ES: 0.21, // Espagne
|
|
||||||
SE: 0.25, // Suède
|
|
||||||
};
|
|
||||||
|
|
||||||
// Fonction pour vérifier si le pays fait partie de l'UE
|
|
||||||
function isCustomerFromEurope({ countryCode }) {
|
|
||||||
return euVatRates.hasOwnProperty(countryCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Invoice;
|
|
||||||
@@ -1,199 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
import { Document, Page, Text, View, Font, Image } from "@react-pdf/renderer";
|
|
||||||
import {
|
|
||||||
DisplayCustomerInformation,
|
|
||||||
formatPrice,
|
|
||||||
RenderCompanyInformation,
|
|
||||||
RenderCompanyLogo,
|
|
||||||
RenderTermsOfSale,
|
|
||||||
SignatureForm,
|
|
||||||
Styles,
|
|
||||||
} from "./SharedElements";
|
|
||||||
import moment from "moment-timezone";
|
|
||||||
|
|
||||||
Font.register({
|
|
||||||
family: "Helvetica",
|
|
||||||
fonts: [
|
|
||||||
{ src: "https://fonts.gstatic.com/s/helvetica/v15/Helvetica-Regular.ttf" },
|
|
||||||
{
|
|
||||||
src: "https://fonts.gstatic.com/s/helvetica/v15/Helvetica-Bold.ttf",
|
|
||||||
fontWeight: "bold",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
const Quote = ({
|
|
||||||
itemList = [],
|
|
||||||
project = {},
|
|
||||||
billingDetails = {},
|
|
||||||
|
|
||||||
quoteNumber = "-",
|
|
||||||
creationTimestamp = new Date(),
|
|
||||||
|
|
||||||
appConfig = {},
|
|
||||||
|
|
||||||
frequentlyAskedQuestion = [],
|
|
||||||
planning = [],
|
|
||||||
|
|
||||||
paymentTerms = "",
|
|
||||||
}) => {
|
|
||||||
const { summary = "" } = project;
|
|
||||||
const { dailyRate = {}, company } = appConfig;
|
|
||||||
|
|
||||||
const dailyRateEuro = dailyRate?.amount || 500;
|
|
||||||
|
|
||||||
const TVA_RATE = 0.2;
|
|
||||||
const sousTotalHT = itemList.reduce(
|
|
||||||
(sum, phase) => sum + phase.totalNumberOfDay * dailyRateEuro,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
const tva = sousTotalHT * TVA_RATE;
|
|
||||||
const montantTotalTTC = sousTotalHT + tva;
|
|
||||||
|
|
||||||
const sections = [
|
|
||||||
{
|
|
||||||
title: `Devis n°${quoteNumber}`,
|
|
||||||
content: <RenderCompanyLogo logoBase64={company?.logoBase64} />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: null,
|
|
||||||
content: (
|
|
||||||
<View style={Styles.headerRow}>
|
|
||||||
<View style={Styles.leftColumn}>
|
|
||||||
<Text style={Styles.textParagraph}>
|
|
||||||
Date d'émission:{" "}
|
|
||||||
{moment(creationTimestamp)
|
|
||||||
.tz("Europe/Paris")
|
|
||||||
.format("DD/MM/YYYY à HH:mm")}
|
|
||||||
{"\n"}
|
|
||||||
Période de validité: 60 jours
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
{Object.keys(billingDetails).length > 0 && (
|
|
||||||
<DisplayCustomerInformation billingDetails={billingDetails} />
|
|
||||||
)}
|
|
||||||
</View>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Résumé du Projet",
|
|
||||||
content: <Text style={Styles.textParagraph}>{summary}</Text>,
|
|
||||||
condition: summary.length > 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Détails des Prestations",
|
|
||||||
content: (
|
|
||||||
<View style={Styles.table}>
|
|
||||||
<View style={Styles.tableRow}>
|
|
||||||
<Text style={Styles.tableColHeaderLeft}>Description</Text>
|
|
||||||
<Text style={Styles.tableColHeaderRight}>Prix HT</Text>
|
|
||||||
</View>
|
|
||||||
{itemList.map((phase, index) => (
|
|
||||||
<View key={index} style={Styles.tableRow}>
|
|
||||||
<View>
|
|
||||||
<Text style={Styles.tableColLeft}>{phase.title}</Text>
|
|
||||||
<Text style={Styles.tableColLeft}>{phase.description}</Text>
|
|
||||||
<Text style={Styles.tableColLeft}>
|
|
||||||
Nombre de jours: {phase?.totalNumberOfDay || 0}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
<Text style={Styles.tableColRight}>
|
|
||||||
{formatPrice({
|
|
||||||
amount: phase.totalNumberOfDay * dailyRateEuro,
|
|
||||||
})}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
<View style={Styles.summaryRow}>
|
|
||||||
<Text style={Styles.summaryLabel}>Sous-total HT :</Text>
|
|
||||||
<Text style={Styles.summaryValue}>
|
|
||||||
{formatPrice({ amount: sousTotalHT })}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
<View style={Styles.summaryRow}>
|
|
||||||
<Text style={Styles.summaryLabel}>TVA (20%) :</Text>
|
|
||||||
<Text style={Styles.summaryValue}>
|
|
||||||
{formatPrice({ amount: tva })}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
<View style={Styles.summaryRow}>
|
|
||||||
<Text style={Styles.summaryLabel}>Total TTC :</Text>
|
|
||||||
<Text style={Styles.summaryValue}>
|
|
||||||
{formatPrice({ amount: montantTotalTTC })}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
),
|
|
||||||
condition: itemList.length > 0,
|
|
||||||
},
|
|
||||||
RenderCompanyInformation({ company }),
|
|
||||||
{
|
|
||||||
title: "Modalités de paiement",
|
|
||||||
content: (
|
|
||||||
<Text style={Styles.textParagraph}>
|
|
||||||
{paymentTerms ||
|
|
||||||
"Acompte de 40% à la signature du devis, 30% après livraison du design et solde à la livraison."}
|
|
||||||
</Text>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Questions fréquentes",
|
|
||||||
content: (
|
|
||||||
<View>
|
|
||||||
{frequentlyAskedQuestion.map((faq, index) => (
|
|
||||||
<View key={index}>
|
|
||||||
<Text style={Styles.textParagraph}>{faq.question}</Text>
|
|
||||||
<Text style={{ ...Styles.textParagraph, opacity: 0.5 }}>
|
|
||||||
{faq.answer}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
</View>
|
|
||||||
),
|
|
||||||
condition: frequentlyAskedQuestion.length > 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "Planning prévisionnel",
|
|
||||||
content: (
|
|
||||||
<View>
|
|
||||||
<Text style={Styles.textParagraph}>
|
|
||||||
Planning estimatif des semaines de travail, sujet à modification et
|
|
||||||
ajustement périodique.
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
{planning.map((event, index) => (
|
|
||||||
<View key={index}>
|
|
||||||
<Text style={Styles.textParagraph}>
|
|
||||||
{`${event?.weekNumberStart} - ${event?.weekNumberEnd}: ${event.title}`}
|
|
||||||
</Text>
|
|
||||||
<Text style={{ ...Styles.textParagraph, opacity: 0.5 }}>
|
|
||||||
{event.description}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
</View>
|
|
||||||
),
|
|
||||||
condition: planning.length > 0,
|
|
||||||
},
|
|
||||||
RenderTermsOfSale(),
|
|
||||||
SignatureForm(),
|
|
||||||
].filter(({ condition = true }) => condition);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Document>
|
|
||||||
<Page style={Styles.body}>
|
|
||||||
{sections.map((section, index) => (
|
|
||||||
<View key={index} style={Styles.section}>
|
|
||||||
{section.title && (
|
|
||||||
<Text style={Styles.sectionTitle}>{section.title}</Text>
|
|
||||||
)}
|
|
||||||
{section.content}
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
</Page>
|
|
||||||
</Document>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Quote;
|
|
||||||
@@ -1,147 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
import { Text, View, Image, StyleSheet } from "@react-pdf/renderer";
|
|
||||||
import numbro from "numbro";
|
|
||||||
|
|
||||||
const DisplayCustomerInformation = ({ billingDetails } = {}) => {
|
|
||||||
return (
|
|
||||||
<View style={Styles.rightColumn}>
|
|
||||||
{[
|
|
||||||
`Client: ${billingDetails.legalName || "NC"}`,
|
|
||||||
billingDetails.billingAddress,
|
|
||||||
// `${billingDetails.zipCode}, ${billingDetails.city}, ${billingDetails.countryCode}`,
|
|
||||||
`TVA: ${billingDetails.taxIdentificationNumber || "NC"}`,
|
|
||||||
`SIREN: ${billingDetails.SIREN || "NC"}`,
|
|
||||||
]
|
|
||||||
.filter(Boolean)
|
|
||||||
.map((line, index) => (
|
|
||||||
<Text key={index} style={Styles.textParagraph}>
|
|
||||||
{line}
|
|
||||||
</Text>
|
|
||||||
))}
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const RenderCompanyLogo = ({ logoBase64 } = {}) => {
|
|
||||||
return (
|
|
||||||
<Image src={`data:image/png;base64,${logoBase64}`} style={{ width: 200 }} />
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const RenderTermsOfSale = () => {
|
|
||||||
return {
|
|
||||||
title: "Conditions générales de vente",
|
|
||||||
content: <Text style={Styles.textParagraph}>{"ICI TES CGV"}</Text>,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const RenderCompanyInformation = ({ company }) => {
|
|
||||||
return {
|
|
||||||
title: "Informations du prestataire",
|
|
||||||
content: (
|
|
||||||
<Text style={Styles.textParagraph}>
|
|
||||||
{`${company?.name}, ${company?.address}, ${company?.postalCode || "-"}, ${company?.city || "-"},\nSIRET: ${company?.identifier}, RCS: ${company?.city} ${company?.RCS}, TVA: ${company?.taxIdentifier || "-"}.\nPour toute question, vous pourrez nous contacter au ${company?.phoneNumber} ou à l'adresse ${company?.supportEmail}.`}
|
|
||||||
</Text>
|
|
||||||
),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const SignatureForm = () => {
|
|
||||||
return {
|
|
||||||
title: "Signature du client",
|
|
||||||
content: (
|
|
||||||
<>
|
|
||||||
<Text style={Styles.textParagraph}>
|
|
||||||
Fait à {"{{Ville de signature;font_size=12}}"}, le
|
|
||||||
{" {{Date;type=datenow;font_size=12}}"}
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Text style={Styles.textParagraph}>
|
|
||||||
Nom et prénom du signataire:{" "}
|
|
||||||
{"{{Nom et Prénom du signataire;font_size=12}}"}
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Text style={Styles.textParagraph}>
|
|
||||||
Fonction du signataire: {"{{Fonction du signataire;font_size=12}}"}
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Text style={Styles.textParagraph}>
|
|
||||||
Téléphone: {"{{type=phone;required=true;font_size=12}}"}
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Text style={Styles.textParagraph}>Signature:</Text>
|
|
||||||
|
|
||||||
<View style={Styles.signatureBox}>
|
|
||||||
<Text>{"{{Sign;type=signature;width=200;height=50}}"}</Text>
|
|
||||||
</View>
|
|
||||||
</>
|
|
||||||
),
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
const formatPrice = ({ amount = 0, average = false }) =>
|
|
||||||
`${numbro(amount || 0).format({
|
|
||||||
spaceSeparated: true,
|
|
||||||
thousandSeparated: true,
|
|
||||||
average,
|
|
||||||
mantissa: average ? 1 : 2,
|
|
||||||
})} €`;
|
|
||||||
|
|
||||||
const Styles = StyleSheet.create({
|
|
||||||
body: {
|
|
||||||
padding: 40,
|
|
||||||
fontFamily: "Helvetica",
|
|
||||||
fontSize: 12,
|
|
||||||
lineHeight: 1.5,
|
|
||||||
color: "#000",
|
|
||||||
},
|
|
||||||
section: { marginBottom: 30 },
|
|
||||||
sectionTitle: { fontSize: 14, opacity: 0.5, marginBottom: 5 },
|
|
||||||
textParagraph: { marginBottom: 5 },
|
|
||||||
headerRow: {
|
|
||||||
flexDirection: "row",
|
|
||||||
justifyContent: "space-between",
|
|
||||||
},
|
|
||||||
leftColumn: { width: "50%", textAlign: "left" },
|
|
||||||
rightColumn: { width: "50%", textAlign: "right" },
|
|
||||||
table: { marginBottom: 20 },
|
|
||||||
tableRow: {
|
|
||||||
flexDirection: "row",
|
|
||||||
justifyContent: "space-between",
|
|
||||||
paddingVertical: 10,
|
|
||||||
borderBottomWidth: 1,
|
|
||||||
borderBottomColor: "#ccc",
|
|
||||||
},
|
|
||||||
tableColHeaderLeft: { width: "70%", fontWeight: "bold", textAlign: "left" },
|
|
||||||
tableColHeaderRight: { width: "30%", fontWeight: "bold", textAlign: "right" },
|
|
||||||
tableColLeft: { width: "70%", textAlign: "left" },
|
|
||||||
tableColRight: { width: "30%", textAlign: "right" },
|
|
||||||
summaryRow: {
|
|
||||||
flexDirection: "row",
|
|
||||||
justifyContent: "flex-end",
|
|
||||||
marginTop: 10,
|
|
||||||
},
|
|
||||||
summaryLabel: {
|
|
||||||
width: "70%",
|
|
||||||
textAlign: "right",
|
|
||||||
paddingRight: 10,
|
|
||||||
fontWeight: "bold",
|
|
||||||
},
|
|
||||||
summaryValue: { width: "30%", textAlign: "right" },
|
|
||||||
signatureBox: {
|
|
||||||
width: 200,
|
|
||||||
height: 50,
|
|
||||||
borderWidth: 1,
|
|
||||||
borderStyle: "solid",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export {
|
|
||||||
Styles,
|
|
||||||
formatPrice,
|
|
||||||
DisplayCustomerInformation,
|
|
||||||
RenderTermsOfSale,
|
|
||||||
RenderCompanyLogo,
|
|
||||||
RenderCompanyInformation,
|
|
||||||
SignatureForm,
|
|
||||||
};
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
const admin = require("firebase-admin");
|
|
||||||
const moment = require("moment");
|
|
||||||
const { onCall, HttpsError } = require("firebase-functions/v2/https");
|
|
||||||
const functions = require("firebase-functions/v1");
|
|
||||||
|
|
||||||
const { generateDocument } = require("./utils/helpers.js");
|
|
||||||
const { logoBase64 } = require("./data/logoBase64.js");
|
|
||||||
|
|
||||||
const documentTemplateList = {
|
|
||||||
QUOTE: {
|
|
||||||
path: "./components/Quote.js",
|
|
||||||
},
|
|
||||||
INVOICE: {
|
|
||||||
path: "./components/Invoice.js",
|
|
||||||
},
|
|
||||||
CONTRACT: {
|
|
||||||
path: "./components/Contract.js",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const appConfig = {
|
|
||||||
company: {
|
|
||||||
logoBase64,
|
|
||||||
name: "SAS StarsClick",
|
|
||||||
address: "8 rue de la Paix",
|
|
||||||
postalCode: "75002",
|
|
||||||
city: "Paris",
|
|
||||||
identifier: "123456789",
|
|
||||||
RCS: "123 456 789",
|
|
||||||
taxIdentifier: "FR 12 345 678 912",
|
|
||||||
phoneNumber: "01 23 45 67 89",
|
|
||||||
supportEmail: "contact@starsclick.fr",
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.generateDocumentFromTemplate = onCall(
|
|
||||||
async ({ auth = {}, data = {} }) => {
|
|
||||||
try {
|
|
||||||
const { type, documentData = {} } = data;
|
|
||||||
|
|
||||||
const { path } = documentTemplateList[type] || {};
|
|
||||||
|
|
||||||
if (!path) {
|
|
||||||
throw new Error("Invalid document type");
|
|
||||||
}
|
|
||||||
|
|
||||||
const { default: DocumentImport } = await import(path);
|
|
||||||
|
|
||||||
const { downloadURL } = await generateDocument({
|
|
||||||
template: DocumentImport,
|
|
||||||
data: {
|
|
||||||
...documentData,
|
|
||||||
creationTimestamp: moment().format("DD/MM/YYYY"),
|
|
||||||
},
|
|
||||||
filePath: `documents/${moment().format("DD-MM-YYYY-HH-mm-ss")}.pdf`,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`PDF URL: ${downloadURL}`);
|
|
||||||
|
|
||||||
return { documentUrl: downloadURL };
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
exports.testDocumentGeneration = functions
|
|
||||||
.runWith({ memory: "512MB" })
|
|
||||||
.https.onRequest(async (req, res) => {
|
|
||||||
try {
|
|
||||||
// const { type } = req.query;
|
|
||||||
|
|
||||||
const type = "INVOICE";
|
|
||||||
|
|
||||||
const { path } = documentTemplateList[type] || {};
|
|
||||||
|
|
||||||
if (!path) {
|
|
||||||
throw new Error("Invalid document type");
|
|
||||||
}
|
|
||||||
|
|
||||||
const { default: DocumentTemplate } = await import(path);
|
|
||||||
|
|
||||||
const { downloadURL } = await generateDocument({
|
|
||||||
template: DocumentTemplate,
|
|
||||||
data: {
|
|
||||||
appConfig,
|
|
||||||
},
|
|
||||||
filePath: `documents/${moment().format("DD-MM-YYYY-HH-mm-ss")}.pdf`,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`PDF URL: ${downloadURL}`);
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
const { onCall } = require("firebase-functions/v2/https");
|
||||||
|
const { z } = require("genkit");
|
||||||
|
const { generateAI } = require("../index");
|
||||||
|
|
||||||
|
exports.generateLyrics = onCall({}, async ({ auth = {}, data = {} }) => {
|
||||||
|
try {
|
||||||
|
const {
|
||||||
|
objective = "Célébrer l'agence Minuit et mettre en avant son " +
|
||||||
|
"expertise digitale, son esprit d'équipe et sa créativité.",
|
||||||
|
context = "L'agence Minuit accompagne les startups et entreprises " +
|
||||||
|
"innovantes dans la création de produits digitaux, du prototype " +
|
||||||
|
"à la version de financement, jusqu'à l'optimisation et la mise " +
|
||||||
|
"à l'échelle. Spécialisée dans le développement sur-mesure " +
|
||||||
|
"d'applications mobiles, elle valorise l'humain, le design et " +
|
||||||
|
"l'accompagnement personnalisé. Esprit nocturne, équipe passionnée.",
|
||||||
|
emotion = "La Joie : expose un bonheur profond, l'émerveillement, " +
|
||||||
|
"la gratitude, satisfaction intense, énergie positive.",
|
||||||
|
style = "Upbeat : Pour une ambiance joyeuse et rythmée.",
|
||||||
|
audience = "L'équipe Minuit et ses clients fidèles, startups " +
|
||||||
|
"ambitieuses et partenaires visionnaires.",
|
||||||
|
structure = ["couplet", "refrain", "couplet", "refrain"],
|
||||||
|
rhymes = "Avec rimes",
|
||||||
|
} = data;
|
||||||
|
|
||||||
|
console.log("Function generate lyrics start with data", data);
|
||||||
|
|
||||||
|
const system =
|
||||||
|
`
|
||||||
|
Tu es un parolier expert en chanson française moderne et populaire.
|
||||||
|
Tu écris des chansons marquantes, accessibles, sur des thématiques ` +
|
||||||
|
`d'innovation, d'esprit d'équipe et de créativité digitale.
|
||||||
|
Ton ` +
|
||||||
|
`écriture doit toucher à la fois l'humain, le collectif et la ` +
|
||||||
|
`passion d'entreprendre.
|
||||||
|
Tu dois générer un titre accrocheur et ` +
|
||||||
|
`mémorable pour la chanson en plus des paroles.
|
||||||
|
Respecte ` +
|
||||||
|
`précisément la structure demandée et fournis le résultat dans un ` +
|
||||||
|
`format JSON clair, respectant strictement le schéma demandé.
|
||||||
|
`.trim();
|
||||||
|
|
||||||
|
// Construction du prompt utilisateur
|
||||||
|
const prompt =
|
||||||
|
`
|
||||||
|
Objectif : ${objective}
|
||||||
|
Contexte : ${context}
|
||||||
|
Émotion : ${emotion}
|
||||||
|
Style musical : ${style}
|
||||||
|
Audience cible : ${audience}
|
||||||
|
Structure de la chanson : ${structure.join(" => ")}
|
||||||
|
Schéma de rimes : ${rhymes}
|
||||||
|
|
||||||
|
Génère un titre accrocheur et les paroles de la chanson en suivant ` +
|
||||||
|
`strictement cette structure.
|
||||||
|
Le titre doit être court, ` +
|
||||||
|
`mémorable et refléter l'esprit de l'agence Minuit.
|
||||||
|
Pour chaque ` +
|
||||||
|
`partie ("couplet" ou "refrain"), écris 4 à 16 lignes adaptées, ` +
|
||||||
|
`expressives et cohérentes avec le style et l'émotion souhaitée.
|
||||||
|
`.trim();
|
||||||
|
|
||||||
|
// Définition du schéma zod/genkit pour la validation du retour
|
||||||
|
const lyricsSchema = z.object({
|
||||||
|
title: z.string().describe("Titre de la chanson, court et accrocheur"),
|
||||||
|
lyrics: z
|
||||||
|
.array(
|
||||||
|
z.object({
|
||||||
|
type: z
|
||||||
|
.string()
|
||||||
|
.describe(
|
||||||
|
'Type de section : "couplet" ou "refrain" ' +
|
||||||
|
"selon la structure",
|
||||||
|
),
|
||||||
|
lyrics: z
|
||||||
|
.string()
|
||||||
|
.describe(
|
||||||
|
"Paroles de la section, chaque ligne séparée " +
|
||||||
|
"par un retour à la ligne",
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.describe(
|
||||||
|
"Paroles de la chanson sous forme de tableau de sections " +
|
||||||
|
"structurées.",
|
||||||
|
),
|
||||||
|
success: z.boolean().describe("Indique si la génération a réussi"),
|
||||||
|
});
|
||||||
|
|
||||||
|
return await generateAI({
|
||||||
|
system,
|
||||||
|
prompt,
|
||||||
|
schema: lyricsSchema,
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -0,0 +1,451 @@
|
|||||||
|
const { onCall, onRequest } = require("firebase-functions/v2/https");
|
||||||
|
const axios = require("axios");
|
||||||
|
const admin = require("firebase-admin");
|
||||||
|
const { logger } = require("firebase-functions/logger");
|
||||||
|
const { SUNO_API_KEY } = require("../config/keys");
|
||||||
|
|
||||||
|
// Initialiser Firestore
|
||||||
|
const db = admin.firestore();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ===== CONFIG GLOBALE =====
|
||||||
|
*/
|
||||||
|
const SUNO_API_BASE = "https://api.sunoapi.org";
|
||||||
|
const SUNO_API_PATH = "/api/v1/generate";
|
||||||
|
const SUNO_STATUS_PATH = "/api/v1/generate/record-info";
|
||||||
|
const SUNO_MODEL = "V4_5";
|
||||||
|
// const SUNO_MODEL = "V3_5";
|
||||||
|
const SUNO_CALLBACK_URL =
|
||||||
|
"https://us-central1-musicland-d33f9.cloudfunctions.net/music-sunoCallback";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Limite la longueur d'une chaîne
|
||||||
|
* @param {string} str - La chaîne à limiter
|
||||||
|
* @param {number} max - La longueur maximale
|
||||||
|
* @return {string} La chaîne limitée
|
||||||
|
*/
|
||||||
|
function clampLen(str = "", max) {
|
||||||
|
if (!max) return str || "";
|
||||||
|
if (!str) return "";
|
||||||
|
return str.length <= max ? str : str.slice(0, max);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construit le style musical à partir des paramètres
|
||||||
|
* @param {Object} params - Les paramètres de style
|
||||||
|
* @return {string} Le style formaté
|
||||||
|
*/
|
||||||
|
function buildStyle({ genres = [], voice = "", instruments = [], tempo = "" }) {
|
||||||
|
const flatGenres = (genres || []).map((g) => ("" + g).trim()).filter(Boolean);
|
||||||
|
const flatInstruments = (instruments || [])
|
||||||
|
.map((i) => ("" + i).trim())
|
||||||
|
.filter(Boolean);
|
||||||
|
|
||||||
|
const styleParts = [
|
||||||
|
flatGenres.length ? `Genres: ${flatGenres.join(", ")}` : "",
|
||||||
|
tempo ? `Tempo: ${tempo}` : "",
|
||||||
|
flatInstruments.length ? `Instruments: ${flatInstruments.join(", ")}` : "",
|
||||||
|
voice ? `Vocal: ${voice}` : "",
|
||||||
|
"Mix: propre, punchy, large stéréo, radio-ready",
|
||||||
|
].filter(Boolean);
|
||||||
|
|
||||||
|
const style = styleParts.join(" ; ");
|
||||||
|
return clampLen(style, 600);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convertit les paroles en prompt avec tags
|
||||||
|
* @param {Array} lyrics - Tableau des paroles
|
||||||
|
* @return {string} Prompt formaté avec tags
|
||||||
|
*/
|
||||||
|
function lyricsToTaggedPrompt(lyrics = []) {
|
||||||
|
if (!Array.isArray(lyrics) || lyrics.length === 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
const sections = lyrics
|
||||||
|
.map((section) => {
|
||||||
|
if (!section || typeof section !== "object") return "";
|
||||||
|
const { type = "verse", lyrics: content = "" } = section;
|
||||||
|
if (!content.trim()) return "";
|
||||||
|
|
||||||
|
const tag = type.toLowerCase();
|
||||||
|
return `[${tag}]\n${content.trim()}`;
|
||||||
|
})
|
||||||
|
.filter(Boolean);
|
||||||
|
|
||||||
|
return sections.join("\n\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construit le prompt pour Suno
|
||||||
|
* @param {Object} params - Paramètres du prompt
|
||||||
|
* @return {string} Prompt formaté
|
||||||
|
*/
|
||||||
|
function buildSunoPrompt({
|
||||||
|
title,
|
||||||
|
audience = "",
|
||||||
|
projectContext = "",
|
||||||
|
emotionGuide = "",
|
||||||
|
styleGuide = "",
|
||||||
|
}) {
|
||||||
|
const parts = [
|
||||||
|
title ? `Titre: ${title}` : "",
|
||||||
|
audience ? `Public cible: ${audience}` : "",
|
||||||
|
projectContext ? `Contexte: ${projectContext}` : "",
|
||||||
|
emotionGuide ? `Émotion: ${emotionGuide}` : "",
|
||||||
|
styleGuide ? `Style: ${styleGuide}` : "",
|
||||||
|
].filter(Boolean);
|
||||||
|
|
||||||
|
return parts.join("\n\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construit les guides de style et d'émotion
|
||||||
|
* @param {Object} params - Paramètres des guides
|
||||||
|
* @return {Object} Guides formatés
|
||||||
|
*/
|
||||||
|
function buildGuides({
|
||||||
|
genres = [],
|
||||||
|
tempo = "",
|
||||||
|
voice = "",
|
||||||
|
instruments = [],
|
||||||
|
}) {
|
||||||
|
const styleElements = [];
|
||||||
|
|
||||||
|
if (genres && genres.length > 0) {
|
||||||
|
styleElements.push(`Genres: ${genres.join(", ")}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tempo) {
|
||||||
|
const tempoGuide = tempo.toLowerCase().includes("lent")
|
||||||
|
? "Rythme lent et contemplatif"
|
||||||
|
: tempo.toLowerCase().includes("rapide")
|
||||||
|
? "Rythme énergique et dynamique"
|
||||||
|
: `Tempo ${tempo.toLowerCase()}.`;
|
||||||
|
styleElements.push(tempoGuide);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (instruments && instruments.length > 0) {
|
||||||
|
styleElements.push(`Instruments principaux: ${instruments.join(", ")}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (voice) {
|
||||||
|
styleElements.push(`Style vocal: ${voice}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
styleGuide: styleElements.join(" "),
|
||||||
|
emotionGuide: "",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction principale de génération de musique
|
||||||
|
*/
|
||||||
|
exports.generateMusic = onCall(async ({ data = {} }) => {
|
||||||
|
try {
|
||||||
|
const {
|
||||||
|
title = "",
|
||||||
|
lyrics = [],
|
||||||
|
genres = [],
|
||||||
|
voice = "",
|
||||||
|
instruments = [],
|
||||||
|
tempo = "",
|
||||||
|
audience = "",
|
||||||
|
projectContext = "",
|
||||||
|
} = data;
|
||||||
|
|
||||||
|
const { styleGuide, emotionGuide } = buildGuides({
|
||||||
|
genres,
|
||||||
|
voice,
|
||||||
|
instruments,
|
||||||
|
tempo,
|
||||||
|
});
|
||||||
|
const taggedLyrics = lyricsToTaggedPrompt(lyrics);
|
||||||
|
|
||||||
|
const safeTitle = clampLen(title, 80);
|
||||||
|
|
||||||
|
// Construire les informations de contexte pour le style
|
||||||
|
const contextInfo = buildSunoPrompt({
|
||||||
|
title: safeTitle,
|
||||||
|
audience,
|
||||||
|
projectContext,
|
||||||
|
emotionGuide,
|
||||||
|
styleGuide,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Le style combine les informations de genre ET le contexte
|
||||||
|
const baseStyle = buildStyle({ genres, voice, instruments, tempo });
|
||||||
|
const enhancedStyle = `${baseStyle}. ${contextInfo}`;
|
||||||
|
|
||||||
|
const payload = {
|
||||||
|
customMode: true,
|
||||||
|
instrumental: false,
|
||||||
|
model: SUNO_MODEL,
|
||||||
|
prompt: clampLen(taggedLyrics, 3000),
|
||||||
|
title: safeTitle,
|
||||||
|
style: clampLen(enhancedStyle, 600),
|
||||||
|
callBackUrl: SUNO_CALLBACK_URL || "",
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log("PAYLOAD", payload);
|
||||||
|
|
||||||
|
const response = await axios.post(
|
||||||
|
`${SUNO_API_BASE}${SUNO_API_PATH}`,
|
||||||
|
payload,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
Authorization: `Bearer ${SUNO_API_KEY}`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
const parsed = response.data;
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: !!parsed?.data?.taskId,
|
||||||
|
request: {
|
||||||
|
model: SUNO_MODEL,
|
||||||
|
instrumental: false,
|
||||||
|
title: safeTitle,
|
||||||
|
style: enhancedStyle,
|
||||||
|
prompt: taggedLyrics,
|
||||||
|
},
|
||||||
|
response: parsed || {},
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
console.error("❌ Erreur lors de la génération de musique:", error);
|
||||||
|
throw new Error(
|
||||||
|
`Erreur lors de la génération de musique: ${error.message}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction pour suivre le statut d'une génération de musique Suno
|
||||||
|
*/
|
||||||
|
exports.getSunoStatus = onCall(async ({ data = {} }) => {
|
||||||
|
try {
|
||||||
|
const { taskId } = data;
|
||||||
|
|
||||||
|
if (!taskId) {
|
||||||
|
throw new Error("TaskId manquant");
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("🔍 Vérification du statut Suno", { taskId });
|
||||||
|
|
||||||
|
let response;
|
||||||
|
let parsed;
|
||||||
|
|
||||||
|
try {
|
||||||
|
response = await axios.get(
|
||||||
|
`${SUNO_API_BASE}${SUNO_STATUS_PATH}?taskId=${taskId}`,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
Authorization: `Bearer ${SUNO_API_KEY}`,
|
||||||
|
},
|
||||||
|
timeout: 30000, // 30 secondes de timeout
|
||||||
|
},
|
||||||
|
);
|
||||||
|
parsed = response.data;
|
||||||
|
|
||||||
|
console.log("📊 Réponse Suno API:", parsed);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("❌ Erreur détaillée API Suno Status:", {
|
||||||
|
message: error.message,
|
||||||
|
status: error.response?.status,
|
||||||
|
statusText: error.response?.statusText,
|
||||||
|
data: error.response?.data,
|
||||||
|
config: {
|
||||||
|
url: error.config?.url,
|
||||||
|
headers: error.config?.headers,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Gestion spéciale pour les taskId de test
|
||||||
|
if (
|
||||||
|
error.response &&
|
||||||
|
error.response.status === 404 &&
|
||||||
|
taskId.includes("test")
|
||||||
|
) {
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
taskId,
|
||||||
|
data: {
|
||||||
|
status: "not_found",
|
||||||
|
message: "TaskId de test - tâche non trouvée dans l'API Suno",
|
||||||
|
isTestId: true,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Retourner une erreur plus descriptive
|
||||||
|
const errorStatus = error.response?.status || "UNKNOWN";
|
||||||
|
const errorMessage =
|
||||||
|
error.response?.data?.msg ||
|
||||||
|
error.response?.data?.message ||
|
||||||
|
error.response?.statusText ||
|
||||||
|
error.message;
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: false,
|
||||||
|
taskId,
|
||||||
|
error: {
|
||||||
|
status: errorStatus,
|
||||||
|
message: errorMessage,
|
||||||
|
type: "API_ERROR",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("✅ Statut Suno récupéré", {
|
||||||
|
taskId,
|
||||||
|
status: parsed?.data?.status || parsed?.status,
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
taskId,
|
||||||
|
data: parsed?.data || parsed,
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
console.error("❌ Erreur lors de la vérification du statut:", error);
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: false,
|
||||||
|
taskId: data?.taskId,
|
||||||
|
error: {
|
||||||
|
message: error.message,
|
||||||
|
type: "INTERNAL_ERROR",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cloud Function pour recevoir les callbacks de l'API Suno
|
||||||
|
* Cette fonction est appelée par l'API Suno lorsque la génération
|
||||||
|
* de musique est terminée
|
||||||
|
*/
|
||||||
|
exports.sunoCallback = onRequest(
|
||||||
|
{
|
||||||
|
methods: ["POST"],
|
||||||
|
},
|
||||||
|
async (req, res) => {
|
||||||
|
try {
|
||||||
|
console.log("🎵 Received music generation callback body:", req.body);
|
||||||
|
if (req.method !== "POST") {
|
||||||
|
console.warn("⚠️ Méthode non autorisée:", req.method);
|
||||||
|
return res.status(405).json({ error: "Méthode non autorisée" });
|
||||||
|
}
|
||||||
|
|
||||||
|
const { code, msg, data } = req.body || {};
|
||||||
|
console.log("🎵 Callback details:", { code, msg, data });
|
||||||
|
|
||||||
|
// Extraire les données du callback - peut être dans data ou directement dans req.body
|
||||||
|
const callbackData = data || req.body || {};
|
||||||
|
const {
|
||||||
|
id,
|
||||||
|
taskId,
|
||||||
|
status,
|
||||||
|
audio_url: audioUrl,
|
||||||
|
video_url: videoUrl,
|
||||||
|
image_url: imageUrl,
|
||||||
|
lyric,
|
||||||
|
title,
|
||||||
|
tags,
|
||||||
|
duration,
|
||||||
|
error_message: errorMessage,
|
||||||
|
} = callbackData;
|
||||||
|
|
||||||
|
// Normaliser le statut global et le taskId
|
||||||
|
const overallStatus = status || code || callbackData?.status || null;
|
||||||
|
const overallTaskId = callbackData?.taskId || callbackData?.task_id || null;
|
||||||
|
|
||||||
|
// Déterminer les éléments piste(s) à traiter
|
||||||
|
const items = Array.isArray(callbackData?.response?.data)
|
||||||
|
? callbackData.response.data
|
||||||
|
: Array.isArray(callbackData?.sunoData)
|
||||||
|
? callbackData.sunoData
|
||||||
|
: id || audioUrl || imageUrl || title || tags || duration
|
||||||
|
? [callbackData]
|
||||||
|
: [];
|
||||||
|
|
||||||
|
if (!items.length) {
|
||||||
|
// Aucun contenu piste à mettre à jour: acquitter le callback sans erreur
|
||||||
|
return res.status(200).json({
|
||||||
|
success: true,
|
||||||
|
message: "Callback reçu (aucune piste à mettre à jour)",
|
||||||
|
taskId: overallTaskId,
|
||||||
|
status: overallStatus,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const updates = [];
|
||||||
|
|
||||||
|
for (const item of items) {
|
||||||
|
const trackId = item.id || item.musicId || item.audioId || item.audio_id;
|
||||||
|
if (!trackId) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Chercher le document correspondant dans Firestore
|
||||||
|
const musicRef = db.collection("music").doc(trackId);
|
||||||
|
const musicDoc = await musicRef.get();
|
||||||
|
if (!musicDoc.exists) {
|
||||||
|
// Si le doc n'existe pas, ignorer silencieusement cet item
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateData = {
|
||||||
|
status: item.status || overallStatus,
|
||||||
|
updatedAt: admin.firestore.FieldValue.serverTimestamp(),
|
||||||
|
};
|
||||||
|
|
||||||
|
const audioU = item.audio_url || item.audioUrl || item.streamAudioUrl;
|
||||||
|
const videoU = item.video_url || item.videoUrl;
|
||||||
|
const imageU = item.image_url || item.imageUrl;
|
||||||
|
const lyricText = item.lyric || item.prompt;
|
||||||
|
const titleText = item.title;
|
||||||
|
const tagsText = item.tags;
|
||||||
|
const durationVal = item.duration;
|
||||||
|
const errMsg = item.error_message || item.errorMessage;
|
||||||
|
|
||||||
|
if (audioU) updateData.audioUrl = audioU;
|
||||||
|
if (videoU) updateData.videoUrl = videoU;
|
||||||
|
if (imageU) updateData.imageUrl = imageU;
|
||||||
|
if (lyricText) updateData.lyrics = lyricText;
|
||||||
|
if (titleText) updateData.title = titleText;
|
||||||
|
if (tagsText) updateData.style = tagsText;
|
||||||
|
if (durationVal) updateData.duration = durationVal;
|
||||||
|
if (errMsg) updateData.errorMessage = errMsg;
|
||||||
|
|
||||||
|
updates.push(
|
||||||
|
musicRef
|
||||||
|
.update(updateData)
|
||||||
|
.then(() => ({ id: trackId, ok: true }))
|
||||||
|
.catch(() => ({ id: trackId, ok: false })),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const results = await Promise.all(updates);
|
||||||
|
const updated = results.filter((r) => r.ok).map((r) => r.id);
|
||||||
|
|
||||||
|
return res.status(200).json({
|
||||||
|
success: true,
|
||||||
|
message: "Callback traité avec succès",
|
||||||
|
updated,
|
||||||
|
taskId: overallTaskId,
|
||||||
|
status: overallStatus,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
logger.error("❌ Erreur lors du traitement du callback:", error);
|
||||||
|
res.status(500).json({
|
||||||
|
error: "Erreur interne du serveur",
|
||||||
|
message: error.message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
@@ -1,163 +0,0 @@
|
|||||||
const functions = require("firebase-functions");
|
|
||||||
|
|
||||||
const { refsList } = require("..");
|
|
||||||
const { onCall } = require("firebase-functions/v2/https");
|
|
||||||
|
|
||||||
const isStripeProd = false;
|
|
||||||
|
|
||||||
const stripe = require("stripe")(isStripeProd ? "sk_live_..." : "sk_test_...");
|
|
||||||
|
|
||||||
const baseURL = isStripeProd ? "https://.../" : "https://.../";
|
|
||||||
|
|
||||||
exports.createCheckoutSession = onCall(async ({ auth = {}, data = {} }) => {
|
|
||||||
try {
|
|
||||||
const { userID, productList = [] } = data || {};
|
|
||||||
|
|
||||||
console.log("productList", productList);
|
|
||||||
|
|
||||||
if (!userID) {
|
|
||||||
throw new Error("userID is required");
|
|
||||||
}
|
|
||||||
|
|
||||||
const currentUserRef = refsList.users.doc(userID);
|
|
||||||
const userData = (await currentUserRef.get())?.data() || null;
|
|
||||||
|
|
||||||
let stripeCustomerID;
|
|
||||||
const { firstName } = userData || {};
|
|
||||||
|
|
||||||
let updatedCustomerData = {
|
|
||||||
name: firstName,
|
|
||||||
email: auth.token.email,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (userData?.stripeCustomerID) {
|
|
||||||
stripeCustomerID = userData.stripeCustomerID;
|
|
||||||
} else {
|
|
||||||
const customer = await stripe.customers.create({
|
|
||||||
...updatedCustomerData,
|
|
||||||
});
|
|
||||||
stripeCustomerID = customer.id;
|
|
||||||
await currentUserRef.update({ stripeCustomerID });
|
|
||||||
}
|
|
||||||
|
|
||||||
await stripe.customers.update(stripeCustomerID, updatedCustomerData);
|
|
||||||
|
|
||||||
let line_items = productList.map((product) => ({
|
|
||||||
price: product.priceID,
|
|
||||||
quantity: product.quantity,
|
|
||||||
}));
|
|
||||||
|
|
||||||
const hasSubscription = productList.some((product) => product.isRenewable);
|
|
||||||
|
|
||||||
let checkoutObject = {
|
|
||||||
line_items: line_items,
|
|
||||||
mode: hasSubscription ? "subscription" : "payment", // Use "subscription" to support both one-time and subscription items
|
|
||||||
ui_mode: "embedded",
|
|
||||||
return_url: `${baseURL}explore`,
|
|
||||||
customer: stripeCustomerID,
|
|
||||||
invoice_creation: {
|
|
||||||
enabled: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const session = await stripe.checkout.sessions.create(checkoutObject);
|
|
||||||
|
|
||||||
return session;
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e);
|
|
||||||
throw new functions.https.HttpsError("permission-denied", e.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
exports.getPremiumStatus = onCall(async ({ auth = {}, data = {} }) => {
|
|
||||||
// Vérifiez l'authentification de l'utilisateur
|
|
||||||
if (!auth) {
|
|
||||||
throw new functions.https.HttpsError(
|
|
||||||
"unauthenticated",
|
|
||||||
"The function must be called while authenticated."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const uid = auth.uid;
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Récupérer l'ID client Stripe depuis Firestore (supposons que vous l'avez stocké précédemment)
|
|
||||||
const userDoc = await refsList.users.doc(uid).get();
|
|
||||||
const stripeCustomerID = userDoc.data()?.stripeCustomerID || null;
|
|
||||||
|
|
||||||
if (!stripeCustomerID) {
|
|
||||||
throw new functions.https.HttpsError(
|
|
||||||
"not-found",
|
|
||||||
"Stripe customer ID not found."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Récupérer les abonnements de l'utilisateur
|
|
||||||
const subscriptions = await stripe.subscriptions.list({
|
|
||||||
customer: stripeCustomerID,
|
|
||||||
status: "all",
|
|
||||||
});
|
|
||||||
|
|
||||||
// Récupérer les achats de produits (Invoices)
|
|
||||||
const invoices = await stripe.invoices.list({
|
|
||||||
customer: stripeCustomerID,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log("subscriptions", subscriptions);
|
|
||||||
console.log("invoices", invoices);
|
|
||||||
|
|
||||||
return {
|
|
||||||
subscriptions: subscriptions.data,
|
|
||||||
invoices: invoices.data,
|
|
||||||
};
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Error fetching Stripe details:", error);
|
|
||||||
return {
|
|
||||||
subscriptions: [],
|
|
||||||
invoices: [],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
exports.createStripeCustomerPortalSession = onCall(
|
|
||||||
async ({ auth = {}, data = {} }) => {
|
|
||||||
// Vérifiez l'authentification de l'utilisateur
|
|
||||||
if (!auth) {
|
|
||||||
throw new functions.https.HttpsError(
|
|
||||||
"unauthenticated",
|
|
||||||
"The function must be called while authenticated."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const uid = auth.uid;
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Récupérer l'ID client Stripe depuis Firestore (supposons que vous l'avez stocké précédemment)
|
|
||||||
const userDoc = await refsList.users.doc(uid).get();
|
|
||||||
const stripeCustomerID = userDoc.data().stripeCustomerID;
|
|
||||||
|
|
||||||
if (!stripeCustomerID) {
|
|
||||||
throw new functions.https.HttpsError(
|
|
||||||
"not-found",
|
|
||||||
"Stripe customer ID not found."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Créer une session de portail client
|
|
||||||
const session = await stripe.billingPortal.sessions.create({
|
|
||||||
customer: stripeCustomerID,
|
|
||||||
return_url: baseURL, // Remplacez par l'URL de retour de votre application
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
url: session.url,
|
|
||||||
};
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Error creating Stripe customer portal session:", error);
|
|
||||||
throw new functions.https.HttpsError(
|
|
||||||
"internal",
|
|
||||||
"Unable to create Stripe customer portal session."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
const admin = require("firebase-admin");
|
|
||||||
const { onCall, HttpsError } = require("firebase-functions/v2/https");
|
|
||||||
const { onDocumentWritten } = require("firebase-functions/v2/firestore");
|
|
||||||
|
|
||||||
const { refsList } = require("..");
|
|
||||||
|
|
||||||
exports.userUpdateListener = onDocumentWritten(
|
|
||||||
"users/{userID}",
|
|
||||||
async (userSnap) => {
|
|
||||||
try {
|
|
||||||
const { userID } = userSnap.params;
|
|
||||||
|
|
||||||
const currentData = userSnap?.data?.after?.data() || null;
|
|
||||||
const previousData = userSnap?.data?.before?.data() || null;
|
|
||||||
|
|
||||||
if (!currentData) {
|
|
||||||
await admin.auth().deleteUser(userID);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!previousData) {
|
|
||||||
} else if (!!previousData && !!currentData) {
|
|
||||||
const { email = null } = currentData;
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (previousData?.email && previousData?.email !== email && email) {
|
|
||||||
await admin.auth().updateUser(userID, {
|
|
||||||
email,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
exports.deleteAccount = onCall(async ({ auth = {}, data = {} }) => {
|
|
||||||
try {
|
|
||||||
if (!auth.uid) {
|
|
||||||
throw new HttpsError(
|
|
||||||
"unauthenticated",
|
|
||||||
"Vous devez être connecté pour effectuer cette action."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const userDoc = await refsList.users.doc(auth.uid).get();
|
|
||||||
|
|
||||||
if (!userDoc.exists) {
|
|
||||||
throw new HttpsError("not-found", "L'utilisateur n'existe pas.");
|
|
||||||
}
|
|
||||||
|
|
||||||
await admin.auth().deleteUser(auth.uid);
|
|
||||||
await userDoc.ref.delete();
|
|
||||||
|
|
||||||
return { success: true };
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
throw new HttpsError(
|
|
||||||
"internal",
|
|
||||||
"Une erreur s'est produite lors de la suppression de votre compte."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -1,154 +0,0 @@
|
|||||||
const { Timestamp } = require("firebase-admin/firestore");
|
|
||||||
const admin = require("firebase-admin");
|
|
||||||
const React = require("react");
|
|
||||||
|
|
||||||
const { refsList, genkitInstance } = require("../..");
|
|
||||||
|
|
||||||
exports.getCompanyDataFromUserID = async ({ userID = null }) => {
|
|
||||||
try {
|
|
||||||
if (!userID) {
|
|
||||||
throw new Error("No userID provided");
|
|
||||||
}
|
|
||||||
|
|
||||||
const companySnapshot =
|
|
||||||
(await refsList.companies.where("mainOwnerID", "==", userID).get())
|
|
||||||
.docs?.[0] || null;
|
|
||||||
|
|
||||||
if (!companySnapshot) {
|
|
||||||
throw new Error("Company not found");
|
|
||||||
}
|
|
||||||
|
|
||||||
const companyData =
|
|
||||||
{ ...companySnapshot.data(), companyID: companySnapshot.id } || null;
|
|
||||||
|
|
||||||
return companyData;
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const logNewAction = async ({
|
|
||||||
description = "",
|
|
||||||
userID = null,
|
|
||||||
isSuccess = true,
|
|
||||||
}) => {
|
|
||||||
try {
|
|
||||||
if (!description?.length) {
|
|
||||||
throw new Error("Missing required fields");
|
|
||||||
}
|
|
||||||
|
|
||||||
await refsList.logs.add({
|
|
||||||
isSuccess,
|
|
||||||
description,
|
|
||||||
userID,
|
|
||||||
timestamp: Timestamp.now(),
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.logNewAction = logNewAction;
|
|
||||||
|
|
||||||
// Fonction pour générer et uploader le PDF
|
|
||||||
exports.generateDocument = async ({ template, data, filePath }) => {
|
|
||||||
try {
|
|
||||||
// Générer le PDF en buffer
|
|
||||||
// Import dynamique de Quote en ESM
|
|
||||||
const { pdf } = await import("@react-pdf/renderer");
|
|
||||||
|
|
||||||
// Générer le PDF en buffer
|
|
||||||
const buffer = await pdf(
|
|
||||||
React.createElement(template, {
|
|
||||||
...data,
|
|
||||||
})
|
|
||||||
).toBuffer();
|
|
||||||
|
|
||||||
// Uploader le PDF dans Firebase Storage
|
|
||||||
const bucket = admin.storage().bucket("gs://starsclick.appspot.com/");
|
|
||||||
const file = bucket.file(filePath);
|
|
||||||
|
|
||||||
console.log(`Uploading PDF to Firebase Storage as ${filePath}...`);
|
|
||||||
|
|
||||||
const chunks = [];
|
|
||||||
buffer.on("data", (chunk) => chunks.push(chunk));
|
|
||||||
buffer.on("end", async () => {
|
|
||||||
const pdfBuffer = Buffer.concat(chunks);
|
|
||||||
|
|
||||||
await file.save(pdfBuffer, {
|
|
||||||
metadata: {
|
|
||||||
contentType: "application/pdf",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Générer une URL signée
|
|
||||||
const expiresAt = Date.now() + 1000 * 60 * 60 * 24 * 7; // Expire dans 7 jours
|
|
||||||
const [url] = await file.getSignedUrl({
|
|
||||||
action: "read",
|
|
||||||
expires: expiresAt,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`PDF uploaded to Firebase Storage as ${filePath}.`);
|
|
||||||
console.log(`PDF URL: ${url}`);
|
|
||||||
|
|
||||||
return { downloadURL: url };
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Error generating or uploading PDF:", error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.generateAI = async ({ prompt = "", schema, config = {} }) => {
|
|
||||||
if (prompt?.length < 1) {
|
|
||||||
throw new Error(
|
|
||||||
"Vous devez spécifier un prompt pour effectuer cette action."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
let attempts = 0;
|
|
||||||
let result;
|
|
||||||
|
|
||||||
while (attempts < 3) {
|
|
||||||
try {
|
|
||||||
const { output } = await genkitInstance.generate({
|
|
||||||
system:
|
|
||||||
"Voici un prompt, le contenu généré doit toujours être en français: ",
|
|
||||||
prompt,
|
|
||||||
config: {
|
|
||||||
...config,
|
|
||||||
},
|
|
||||||
output: { schema },
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log("Résultat de la génération par IA:", output);
|
|
||||||
|
|
||||||
result = output;
|
|
||||||
|
|
||||||
await logNewAction({
|
|
||||||
description: `Génération par IA réussie`,
|
|
||||||
isSuccess: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
return result;
|
|
||||||
} catch (error) {
|
|
||||||
attempts += 1;
|
|
||||||
console.log(`Tentative ${attempts} échouée:`, error);
|
|
||||||
|
|
||||||
if (attempts >= 3) {
|
|
||||||
await logNewAction({
|
|
||||||
description: `Génération par IA échouée après plusieurs tentatives`,
|
|
||||||
isSuccess: false,
|
|
||||||
error,
|
|
||||||
});
|
|
||||||
|
|
||||||
throw new Error(
|
|
||||||
"Erreur lors de la génération par IA après plusieurs tentatives, veuillez réessayer."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Web / API server started at 127.0.0.1:4000
|
|
||||||
Web / API server started at ::1:4000
|
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
"android": "expo run:android",
|
"android": "expo run:android",
|
||||||
"ios": "expo run:ios",
|
"ios": "expo run:ios",
|
||||||
"web": "expo start --web",
|
"web": "expo start --web",
|
||||||
"postinstall": "patch-package",
|
|
||||||
"clean": "node cleanProject.js",
|
"clean": "node cleanProject.js",
|
||||||
"build:web": "expo export -p web",
|
"build:web": "expo export -p web",
|
||||||
"build:desktop:dev": "npx pake-cli http://localhost:8081 --name minuitdev --iter-copy-file --icon ./assets/desktopIcon.icns",
|
"build:desktop:dev": "npx pake-cli http://localhost:8081 --name minuitdev --iter-copy-file --icon ./assets/desktopIcon.icns",
|
||||||
@@ -63,7 +62,6 @@
|
|||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"numbro": "^2.3.6",
|
"numbro": "^2.3.6",
|
||||||
"patch-package": "^6.5.0",
|
|
||||||
"react": "18.3.1",
|
"react": "18.3.1",
|
||||||
"react-dom": "18.3.1",
|
"react-dom": "18.3.1",
|
||||||
"react-native": "0.76.5",
|
"react-native": "0.76.5",
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
diff --git a/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerShadowView.m b/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerShadowView.m
|
|
||||||
index c139440..45a97dd 100644
|
|
||||||
--- a/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerShadowView.m
|
|
||||||
+++ b/node_modules/@react-native-community/datetimepicker/ios/RNDateTimePickerShadowView.m
|
|
||||||
@@ -41,7 +40,7 @@ - (void)setTimeZoneName:(NSString *)timeZoneName {
|
|
||||||
YGNodeMarkDirty(self.yogaNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
-static YGSize RNDateTimePickerShadowViewMeasure(YGNodeRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode)
|
|
||||||
+static YGSize RNDateTimePickerShadowViewMeasure(YGNodeConstRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode)
|
|
||||||
{
|
|
||||||
RNDateTimePickerShadowView *shadowPickerView = (__bridge RNDateTimePickerShadowView *)YGNodeGetContext(node);
|
|
||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
diff --git a/node_modules/react-async-hook/package.json b/node_modules/react-async-hook/package.json
|
|
||||||
index d881745..3ba7d1d 100644
|
|
||||||
--- a/node_modules/react-async-hook/package.json
|
|
||||||
+++ b/node_modules/react-async-hook/package.json
|
|
||||||
@@ -31,7 +31,7 @@
|
|
||||||
"npm": ">=5"
|
|
||||||
},
|
|
||||||
"main": "dist/index.js",
|
|
||||||
- "module": "react-async-hook.esm.js",
|
|
||||||
+ "module": "dist/react-async-hook.esm.js",
|
|
||||||
"typings": "dist/index.d.ts",
|
|
||||||
"files": [
|
|
||||||
"dist"
|
|
||||||
@@ -2596,11 +2596,6 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.7.13.tgz#ff34942667a4e19a9f4a0996a76814daac364cf3"
|
resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.7.13.tgz#ff34942667a4e19a9f4a0996a76814daac364cf3"
|
||||||
integrity sha512-lm2GW5PkosIzccsaZIz7tp8cPADSIlIHWDFTR1N0SzfinhhYgeIQjFMz4rYzanCScr3DqQLeomUDArp6MWKm+g==
|
integrity sha512-lm2GW5PkosIzccsaZIz7tp8cPADSIlIHWDFTR1N0SzfinhhYgeIQjFMz4rYzanCScr3DqQLeomUDArp6MWKm+g==
|
||||||
|
|
||||||
"@yarnpkg/lockfile@^1.1.0":
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31"
|
|
||||||
integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==
|
|
||||||
|
|
||||||
abort-controller@^3.0.0:
|
abort-controller@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392"
|
resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392"
|
||||||
@@ -3558,7 +3553,7 @@ cross-spawn@^5.0.1:
|
|||||||
shebang-command "^1.2.0"
|
shebang-command "^1.2.0"
|
||||||
which "^1.2.9"
|
which "^1.2.9"
|
||||||
|
|
||||||
cross-spawn@^6.0.0, cross-spawn@^6.0.5:
|
cross-spawn@^6.0.0:
|
||||||
version "6.0.6"
|
version "6.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.6.tgz#30d0efa0712ddb7eb5a76e1e8721bffafa6b5d57"
|
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.6.tgz#30d0efa0712ddb7eb5a76e1e8721bffafa6b5d57"
|
||||||
integrity sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==
|
integrity sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==
|
||||||
@@ -4664,13 +4659,6 @@ find-versions@^3.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
semver-regex "^2.0.0"
|
semver-regex "^2.0.0"
|
||||||
|
|
||||||
find-yarn-workspace-root@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd"
|
|
||||||
integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==
|
|
||||||
dependencies:
|
|
||||||
micromatch "^4.0.2"
|
|
||||||
|
|
||||||
firebase@10.13.2, firebase@^9.20.0:
|
firebase@10.13.2, firebase@^9.20.0:
|
||||||
version "9.23.0"
|
version "9.23.0"
|
||||||
resolved "https://registry.yarnpkg.com/firebase/-/firebase-9.23.0.tgz#71fea60d704bfed8e92162911544fd6564a04d0e"
|
resolved "https://registry.yarnpkg.com/firebase/-/firebase-9.23.0.tgz#71fea60d704bfed8e92162911544fd6564a04d0e"
|
||||||
@@ -5328,13 +5316,6 @@ is-buffer@~1.1.6:
|
|||||||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
|
||||||
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
|
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
|
||||||
|
|
||||||
is-ci@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
|
|
||||||
integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==
|
|
||||||
dependencies:
|
|
||||||
ci-info "^2.0.0"
|
|
||||||
|
|
||||||
is-core-module@^2.13.0:
|
is-core-module@^2.13.0:
|
||||||
version "2.15.1"
|
version "2.15.1"
|
||||||
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.15.1.tgz#a7363a25bee942fefab0de13bf6aa372c82dcc37"
|
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.15.1.tgz#a7363a25bee942fefab0de13bf6aa372c82dcc37"
|
||||||
@@ -5759,13 +5740,6 @@ kind-of@^6.0.2:
|
|||||||
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
|
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
|
||||||
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==
|
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==
|
||||||
|
|
||||||
klaw-sync@^6.0.0:
|
|
||||||
version "6.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c"
|
|
||||||
integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==
|
|
||||||
dependencies:
|
|
||||||
graceful-fs "^4.1.11"
|
|
||||||
|
|
||||||
kleur@^3.0.3:
|
kleur@^3.0.3:
|
||||||
version "3.0.3"
|
version "3.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
|
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
|
||||||
@@ -6317,7 +6291,7 @@ metro@0.81.0, metro@^0.81.0:
|
|||||||
ws "^7.5.10"
|
ws "^7.5.10"
|
||||||
yargs "^17.6.2"
|
yargs "^17.6.2"
|
||||||
|
|
||||||
micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.8:
|
micromatch@^4.0.4, micromatch@^4.0.8:
|
||||||
version "4.0.8"
|
version "4.0.8"
|
||||||
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202"
|
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202"
|
||||||
integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==
|
integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==
|
||||||
@@ -6687,7 +6661,7 @@ onetime@^5.1.2:
|
|||||||
dependencies:
|
dependencies:
|
||||||
mimic-fn "^2.1.0"
|
mimic-fn "^2.1.0"
|
||||||
|
|
||||||
open@^7.0.3, open@^7.4.2:
|
open@^7.0.3:
|
||||||
version "7.4.2"
|
version "7.4.2"
|
||||||
resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321"
|
resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321"
|
||||||
integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==
|
integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==
|
||||||
@@ -6900,26 +6874,6 @@ password-prompt@^1.0.4:
|
|||||||
ansi-escapes "^4.3.2"
|
ansi-escapes "^4.3.2"
|
||||||
cross-spawn "^7.0.3"
|
cross-spawn "^7.0.3"
|
||||||
|
|
||||||
patch-package@^6.5.0:
|
|
||||||
version "6.5.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.5.1.tgz#3e5d00c16997e6160291fee06a521c42ac99b621"
|
|
||||||
integrity sha512-I/4Zsalfhc6bphmJTlrLoOcAF87jcxko4q0qsv4bGcurbr8IskEOtdnt9iCmsQVGL1B+iUhSQqweyTLJfCF9rA==
|
|
||||||
dependencies:
|
|
||||||
"@yarnpkg/lockfile" "^1.1.0"
|
|
||||||
chalk "^4.1.2"
|
|
||||||
cross-spawn "^6.0.5"
|
|
||||||
find-yarn-workspace-root "^2.0.0"
|
|
||||||
fs-extra "^9.0.0"
|
|
||||||
is-ci "^2.0.0"
|
|
||||||
klaw-sync "^6.0.0"
|
|
||||||
minimist "^1.2.6"
|
|
||||||
open "^7.4.2"
|
|
||||||
rimraf "^2.6.3"
|
|
||||||
semver "^5.6.0"
|
|
||||||
slash "^2.0.0"
|
|
||||||
tmp "^0.0.33"
|
|
||||||
yaml "^1.10.2"
|
|
||||||
|
|
||||||
path-exists@^2.0.0:
|
path-exists@^2.0.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b"
|
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b"
|
||||||
@@ -7777,7 +7731,7 @@ reusify@^1.0.4:
|
|||||||
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
|
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
|
||||||
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
|
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
|
||||||
|
|
||||||
rimraf@^2.5.4, rimraf@^2.6.3:
|
rimraf@^2.5.4:
|
||||||
version "2.7.1"
|
version "2.7.1"
|
||||||
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
|
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
|
||||||
integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
|
integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
|
||||||
@@ -8013,11 +7967,6 @@ sisteransi@^1.0.5:
|
|||||||
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
|
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
|
||||||
integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==
|
integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==
|
||||||
|
|
||||||
slash@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
|
|
||||||
integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==
|
|
||||||
|
|
||||||
slash@^3.0.0:
|
slash@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
|
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
|
||||||
@@ -9087,11 +9036,6 @@ yallist@^4.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
|
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
|
||||||
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
|
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
|
||||||
|
|
||||||
yaml@^1.10.2:
|
|
||||||
version "1.10.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
|
|
||||||
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
|
|
||||||
|
|
||||||
yargs-parser@^20.2.2:
|
yargs-parser@^20.2.2:
|
||||||
version "20.2.9"
|
version "20.2.9"
|
||||||
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
|
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
|
||||||
|
|||||||