Skip to content

Commit f094531

Browse files
committed
CLI: Fix bigInt, add 1.0 support
1 parent 6d6b8ba commit f094531

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

templates/cli/lib/client.js.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ class Client {
137137
method.toUpperCase() === "GET" || contentType.startsWith("multipart/form-data") ? formData : params,
138138
json: contentType.startsWith("application/json"),
139139
transformRequest: method.toUpperCase() === "GET" || contentType.startsWith("multipart/form-data") ? undefined : (data) => JSONbig.stringify(data),
140+
transformResponse: [ (data) => data ? JSONbig.parse(data) : data ],
140141
responseType: responseType,
141142
};
142143
try {

templates/cli/lib/commands/deploy.js.twig

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const {
1515
databasesCreateIntegerAttribute,
1616
databasesCreateFloatAttribute,
1717
databasesCreateEmailAttribute,
18+
databasesCreateDatetimeAttribute,
1819
databasesCreateIndex,
1920
databasesCreateUrlAttribute,
2021
databasesCreateIpAttribute,
@@ -338,6 +339,15 @@ const createAttribute = async (databaseId, collectionId, attribute) => {
338339
case 'boolean':
339340
return databasesCreateBooleanAttribute({
340341
databaseId,
342+
collectionId,
343+
key: attribute.key,
344+
required: attribute.required,
345+
xdefault: attribute.default,
346+
array: attribute.array,
347+
parseOutput: false
348+
})
349+
case 'datetime':
350+
return databasesCreateDatetimeAttribute({
341351
databaseId,
342352
collectionId,
343353
key: attribute.key,
@@ -494,9 +504,8 @@ const deployCollection = async ({ all } = {}) => {
494504
databaseId,
495505
collectionId: collection['$id'],
496506
name: collection.name,
497-
permission: collection.permission,
498-
read: collection['$read'],
499-
write: collection['$write'],
507+
documentSecurity: collection.documentSecurity,
508+
'$permissions': collection['$permissions'],
500509
parseOutput: false
501510
})
502511

0 commit comments

Comments
 (0)