hello everyone, I have a question about the cloud functions with my own server, the cloud functions are run directly in the cloud folder, the serious question: inside this folder can I import the clouds in separate files? Or do I have to do it from main, I’m executing it in typescript and there is a main.ts file, could I import my clouds separately as I had in the moralis host?
you can separate the cloud functions in separate files and import them all after that
Thanks for the information. I’m trying it, how could I migrate the acl functions? I put the cloud I had on the moralis server to migrate it to my own server, what would the syntax be like?
Parse.Cloud.define("setTDCPayment", async (request: { params: { address: any; tokens: any; matic: any; cost: any; }; }) => {
const Payment = Parse.Object.extend('Payments');
const payment = new Payment();
const ACL = new Moralis.ACL();
ACL.setPublicReadAccess(false);
payment.setACL(ACL);
const result = await payment.save({
address: request.params.address,
tokens: request.params.tokens,
matic: request.params.matic,
cost: request.params.cost,
fulfilled: false,
completed: false,
hashMatic: null,
hashToken: null,
});
return result.id;
});
in this case it would be const ACL = new Parse.ACL();
? would it be correct?
Yes, try Parse. instead of Moralis for parse server specific functionalities
Sorry for bothering you so much cryptokit, thanks for the help. I have other questions regarding the server, I copy them here or I create a different thread, it’s about the streams.
You can create a separate thread
thanks for the help, but why does it throw me this error export declare const Parse: any; Cannot redeclare block-scoped variable 'Parse'.ts(2451)
renderNft.ts(6, 15): “Parse” has also been declared here. I have imported the clouds in this way in the main,
/* eslint-disable etc/no-commented-out-code */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-var-requires */
declare const Parse: any; // export declare const Parse: any; --- i try --
import './generated/evmApi';
import './generated/solApi';
import './collections';
import './functionMarket';
import './renderNft';
import './stripe';
import './user';
in each file use declare const Parse: any; If this is not the way, what would it be, where could I see documentation related to this error, the errors I see are from typescript
Try to import it once or check if it was already imported
you have to declare it in any additional file that is imported in cloud code
you can look at the example from the repository that imports generated files for cloud code
Thank you very much, I could solve it in the following way, in the cloud main I was importing the files and I shouldn’t do it, I just put the files inside the folder and that’s it, I’m going to open another thread to consult regarding the login. thank you