Я следую учебному пособию Sails.js здесь: https://courses.platzi.com/classes/1273-sails-js/10748-using-cloud-stk/ и собираюсь добавить файл cloud.js, чтобы использовать Cloud SDK для доступа к конечным точкам API.
У меня естьуспешно запустить scripts/rebuild-cloud-sdk.js
, который сгенерировал
app / assets / js / cloud.setup.js, который содержит:
Cloud.setup({
/* eslint-disable */
methods: {"confirmEmail":{"verb":"GET","url":"/email/confirm","args":["token"]},"logout":{"verb":"GET","url":"/api/v1/account/logout","args":[]},"updatePassword":{"verb":"PUT","url":"/api/v1/account/update-password","args":["password"]},"updateProfile":{"verb":"PUT","url":"/api/v1/account/update-profile","args":["fullName","emailAddress"]},"updateBillingCard":{"verb":"PUT","url":"/api/v1/account/update-billing-card","args":["stripeToken","billingCardLast4","billingCardBrand","billingCardExpMonth","billingCardExpYear"]},"login":{"verb":"PUT","url":"/api/v1/entrance/login","args":["emailAddress","password","rememberMe"]},"signup":{"verb":"POST","url":"/api/v1/entrance/signup","args":["emailAddress","password","fullName"]},"sendPasswordRecoveryEmail":{"verb":"POST","url":"/api/v1/entrance/send-password-recovery-email","args":["emailAddress"]},"updatePasswordAndLogin":{"verb":"POST","url":"/api/v1/entrance/update-password-and-login","args":["password","token"]},"deliverContactFormMessage":{"verb":"POST","url":"/api/v1/deliver-contact-form-message","args":["emailAddress","topic","fullName","message"]},"destroyOneEntity":{"verb":"DELETE","url":"/api/v1/entities/destroy-one-entity","args":["id"]}}
/* eslint-enable */
});
, но в консоли паруса, когда я запускаю Cloud.destroyOneEntity.with({ id: 3 }).log()
возвращает:
ReferenceError: Cloud is not defined