projectName | extensions |
---|---|
Firebase Authentication |
core,identity,hono,fly,postgresql,firebase-auth |
export default project(
feature('products', {
policies: {
isAuthenticated: policy.authenticated(),
},
tables: {
products: table({
fields: {
name: field({
type: 'short-text',
validations: [
mandatory({
message: 'Name is missing.',
}),
],
}),
},
}),
},
workflows: [
workflow('CreateProductWorkflow', {
tag: 'products',
trigger: trigger.http({
path: '/',
method: 'post',
policies: ['isAuthenticated'],
}),
actions: {
insertProduct: action.database.insert({
outputName: 'product',
table: useTable('products'),
columns: [useField('name', '@trigger:body.name')],
}),
},
}),
],
}),
);