Skip to content

Commit ecfe922

Browse files
committed
fix: update crud methods
1 parent 34aba71 commit ecfe922

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const componentsReference = {
1717
"send": "<data>",
1818
"listen": "<method>"
1919
},
20-
"methods": ["create.database", "read.database", "update.database", "delete.database", "create.array", "read.array", "update.array", "delete.array", "create.index", "read.index", "update.index", "delete.index", "create.object", "read.object", "update.object", "delete.object"],
20+
"methods": ["database.create", "database.read", "database.update", "database.delete", "array.create", "array.read", "array.update", "array.delete", "index.create", "index.read", "index.update", "index.delete", "object.create", "object.read", "object.update", "object.delete"],
2121
"data": { method: "", database: "", array: "", index: "", object: {} || [], filter: {} },
2222
"html-attributes": ['storage', 'database', 'array', 'object', 'key', 'index', 'save', 'read', 'update', 'delete', 'realtime', 'crud', 'upsert', 'value-type', 'value-prefix', 'value-suffix']
2323
},
@@ -67,7 +67,7 @@ async function send(form) {
6767
if (!conversation) {
6868
const crudReference = {
6969
data: {
70-
method: "create.database | read.database | update.database | delete.database | create.array | read.array | update.array | delete.array | create.index | read.index | update.index | delete.index | create.object | read.object | update.object | delete.object",
70+
method: "database.create | database.read | database.update | database.delete | array.create | array.read | array.update | array.delete | index.create | index.read | index.update | index.delete | object.create | object.read | object.update | object.delete",
7171
storage: "" || [""],
7272
database: "" || [""],
7373
array: "" || [""],
@@ -82,7 +82,7 @@ async function send(form) {
8282
}
8383
const crudObjectReference = {
8484
data: {
85-
method: " create.object | read.object | update.object | delete.object",
85+
method: " object.create | object.read | object.update | object.delete",
8686
array: "" || [""],
8787
object: {} || [{}],
8888
filter: {
@@ -96,7 +96,7 @@ async function send(form) {
9696

9797
const filterObjectReference = {
9898
data: {
99-
method: " create.object | read.object | update.object | delete.object",
99+
method: " object.create | object.read | object.update | object.delete",
100100
array: "files",
101101
object: [{
102102
"_id": "",
@@ -122,14 +122,14 @@ async function send(form) {
122122

123123
conversation = [
124124
{ role: 'system', content: 'If the users request seem to want to perform a CRUD operation, return a CoCreateJS CRUD data object as a response. Else reply to best you can to users queries' },
125-
{ role: 'system', content: 'data.method should default to "create.object", "read.object", "update.object", "delete.object". The following methods should be used if the user specifically request crud operation on the entity. example: return a list of databases, delete array contacts, etc. "create.database", "read.database", "update.database", "delete.database", "create.array", "read.array", "update.array", "delete.array", "create.index", "read.index", "update.index", "delete.index"' },
126-
{ role: 'system', content: 'To perform CRUD operations on the objects contained within an array, use the following methods: "create.object" for creating objects, "read.object" for reading objects, "update.object" for updating objects, and "delete.object" for deleting objects. The array property must be defined to perform crud operations on objects' },
125+
{ role: 'system', content: 'data.method should default to "object.create", "object.read", "object.update", "object.delete". The following methods should be used if the user specifically request crud operation on the entity. example: return a list of databases, delete array contacts, etc. "database.create", "database.read", "database.update", "database.delete", "array.create", "array.read", "array.update", "array.delete", "index.create", "index.read", "index.update", "index.delete"' },
126+
{ role: 'system', content: 'To perform CRUD operations on the objects contained within an array, use the following methods: "object.create" for creating objects, "object.read" for reading objects, "object.update" for updating objects, and "object.delete" for deleting objects. The array property must be defined to perform crud operations on objects' },
127127
{ role: 'system', content: 'data.storage and data.database is not required and should only be defined if the user specifically requests it. example: delete test database from indexeddb storage' },
128128
{ role: 'system', content: 'In the context of CoCreateJS, an "array" corresponds to a "table" in SQL databases or a "collection" in NoSQL databases.' },
129129
{ role: 'system', content: 'In the context of CoCreateJS, an "object" corresponds to a "row" in SQL databases or a "document" in NoSQL databases.' },
130130
{ role: 'system', content: 'crud reference' + JSON.stringify(crudReference) },
131131
{ role: 'system', content: 'crud object reference' + JSON.stringify(crudObjectReference) },
132-
{ role: 'system', content: 'When using update.object or delete.object methods the data.object._id should be defined or a filter used to return and excute on matches' },
132+
{ role: 'system', content: 'When using object.update or object.delete methods the data.object._id should be defined or a filter used to return and excute on matches' },
133133
{ role: 'system', content: 'file object reference' + JSON.stringify(filterObjectReference) },
134134
{ role: 'system', content: 'If the users request seem to want to create a file or code return the code/source in the data.object.src . This will make the file available over network request using the defined path' },
135135
{ role: 'system', content: 'html attributes reference' + JSON.stringify(htmlAttributesReference) },

0 commit comments

Comments
 (0)