appwrite 20.0.0 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +1 -2
- data/lib/appwrite/enums/browser_permission.rb +26 -0
- data/lib/appwrite/enums/deployment_status.rb +1 -0
- data/lib/appwrite/enums/name.rb +1 -0
- data/lib/appwrite/enums/o_auth_provider.rb +0 -1
- data/lib/appwrite/enums/order_by.rb +8 -0
- data/lib/appwrite/enums/roles.rb +9 -0
- data/lib/appwrite/enums/scopes.rb +61 -0
- data/lib/appwrite/models/attribute_longtext.rb +86 -0
- data/lib/appwrite/models/attribute_mediumtext.rb +86 -0
- data/lib/appwrite/models/attribute_text.rb +86 -0
- data/lib/appwrite/models/attribute_varchar.rb +91 -0
- data/lib/appwrite/models/bucket.rb +8 -3
- data/lib/appwrite/models/column_longtext.rb +86 -0
- data/lib/appwrite/models/column_mediumtext.rb +86 -0
- data/lib/appwrite/models/column_text.rb +86 -0
- data/lib/appwrite/models/column_varchar.rb +91 -0
- data/lib/appwrite/models/deployment.rb +1 -0
- data/lib/appwrite/models/file.rb +13 -3
- data/lib/appwrite/models/health_status_list.rb +32 -0
- data/lib/appwrite/query.rb +34 -0
- data/lib/appwrite/services/account.rb +3 -1
- data/lib/appwrite/services/avatars.rb +1 -1
- data/lib/appwrite/services/databases.rb +453 -16
- data/lib/appwrite/services/health.rb +31 -6
- data/lib/appwrite/services/storage.rb +6 -6
- data/lib/appwrite/services/tables_db.rb +458 -11
- data/lib/appwrite.rb +14 -2
- metadata +17 -5
- data/lib/appwrite/enums/output.rb +0 -13
|
@@ -279,7 +279,7 @@ module Appwrite
|
|
|
279
279
|
# @param [] enabled Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
|
|
280
280
|
#
|
|
281
281
|
# @return [Database]
|
|
282
|
-
def update(database_id:, name
|
|
282
|
+
def update(database_id:, name: nil, enabled: nil)
|
|
283
283
|
api_path = '/tablesdb/{databaseId}'
|
|
284
284
|
.gsub('{databaseId}', database_id)
|
|
285
285
|
|
|
@@ -287,10 +287,6 @@ module Appwrite
|
|
|
287
287
|
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
|
288
288
|
end
|
|
289
289
|
|
|
290
|
-
if name.nil?
|
|
291
|
-
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
292
|
-
end
|
|
293
|
-
|
|
294
290
|
api_params = {
|
|
295
291
|
name: name,
|
|
296
292
|
enabled: enabled,
|
|
@@ -384,9 +380,11 @@ module Appwrite
|
|
|
384
380
|
# @param [Array] permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
385
381
|
# @param [] row_security Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
386
382
|
# @param [] enabled Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
383
|
+
# @param [Array] columns Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
|
|
384
|
+
# @param [Array] indexes Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
|
|
387
385
|
#
|
|
388
386
|
# @return [Table]
|
|
389
|
-
def create_table(database_id:, table_id:, name:, permissions: nil, row_security: nil, enabled: nil)
|
|
387
|
+
def create_table(database_id:, table_id:, name:, permissions: nil, row_security: nil, enabled: nil, columns: nil, indexes: nil)
|
|
390
388
|
api_path = '/tablesdb/{databaseId}/tables'
|
|
391
389
|
.gsub('{databaseId}', database_id)
|
|
392
390
|
|
|
@@ -408,6 +406,8 @@ module Appwrite
|
|
|
408
406
|
permissions: permissions,
|
|
409
407
|
rowSecurity: row_security,
|
|
410
408
|
enabled: enabled,
|
|
409
|
+
columns: columns,
|
|
410
|
+
indexes: indexes,
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
api_headers = {
|
|
@@ -468,7 +468,7 @@ module Appwrite
|
|
|
468
468
|
# @param [] enabled Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.
|
|
469
469
|
#
|
|
470
470
|
# @return [Table]
|
|
471
|
-
def update_table(database_id:, table_id:, name
|
|
471
|
+
def update_table(database_id:, table_id:, name: nil, permissions: nil, row_security: nil, enabled: nil)
|
|
472
472
|
api_path = '/tablesdb/{databaseId}/tables/{tableId}'
|
|
473
473
|
.gsub('{databaseId}', database_id)
|
|
474
474
|
.gsub('{tableId}', table_id)
|
|
@@ -481,10 +481,6 @@ module Appwrite
|
|
|
481
481
|
raise Appwrite::Exception.new('Missing required parameter: "tableId"')
|
|
482
482
|
end
|
|
483
483
|
|
|
484
|
-
if name.nil?
|
|
485
|
-
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
|
486
|
-
end
|
|
487
|
-
|
|
488
484
|
api_params = {
|
|
489
485
|
name: name,
|
|
490
486
|
permissions: permissions,
|
|
@@ -1469,6 +1465,224 @@ module Appwrite
|
|
|
1469
1465
|
)
|
|
1470
1466
|
end
|
|
1471
1467
|
|
|
1468
|
+
# Create a longtext column.
|
|
1469
|
+
#
|
|
1470
|
+
#
|
|
1471
|
+
# @param [String] database_id Database ID.
|
|
1472
|
+
# @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
|
|
1473
|
+
# @param [String] key Column Key.
|
|
1474
|
+
# @param [] required Is column required?
|
|
1475
|
+
# @param [String] default Default value for column when not provided. Cannot be set when column is required.
|
|
1476
|
+
# @param [] array Is column an array?
|
|
1477
|
+
#
|
|
1478
|
+
# @return [ColumnLongtext]
|
|
1479
|
+
def create_longtext_column(database_id:, table_id:, key:, required:, default: nil, array: nil)
|
|
1480
|
+
api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/longtext'
|
|
1481
|
+
.gsub('{databaseId}', database_id)
|
|
1482
|
+
.gsub('{tableId}', table_id)
|
|
1483
|
+
|
|
1484
|
+
if database_id.nil?
|
|
1485
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
|
1486
|
+
end
|
|
1487
|
+
|
|
1488
|
+
if table_id.nil?
|
|
1489
|
+
raise Appwrite::Exception.new('Missing required parameter: "tableId"')
|
|
1490
|
+
end
|
|
1491
|
+
|
|
1492
|
+
if key.nil?
|
|
1493
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
|
1494
|
+
end
|
|
1495
|
+
|
|
1496
|
+
if required.nil?
|
|
1497
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
|
1498
|
+
end
|
|
1499
|
+
|
|
1500
|
+
api_params = {
|
|
1501
|
+
key: key,
|
|
1502
|
+
required: required,
|
|
1503
|
+
default: default,
|
|
1504
|
+
array: array,
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
api_headers = {
|
|
1508
|
+
"content-type": 'application/json',
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
@client.call(
|
|
1512
|
+
method: 'POST',
|
|
1513
|
+
path: api_path,
|
|
1514
|
+
headers: api_headers,
|
|
1515
|
+
params: api_params,
|
|
1516
|
+
response_type: Models::ColumnLongtext
|
|
1517
|
+
)
|
|
1518
|
+
end
|
|
1519
|
+
|
|
1520
|
+
# Update a longtext column. Changing the `default` value will not update
|
|
1521
|
+
# already existing rows.
|
|
1522
|
+
#
|
|
1523
|
+
#
|
|
1524
|
+
# @param [String] database_id Database ID.
|
|
1525
|
+
# @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
|
|
1526
|
+
# @param [String] key Column Key.
|
|
1527
|
+
# @param [] required Is column required?
|
|
1528
|
+
# @param [String] default Default value for column when not provided. Cannot be set when column is required.
|
|
1529
|
+
# @param [String] new_key New Column Key.
|
|
1530
|
+
#
|
|
1531
|
+
# @return [ColumnLongtext]
|
|
1532
|
+
def update_longtext_column(database_id:, table_id:, key:, required:, default:, new_key: nil)
|
|
1533
|
+
api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/longtext/{key}'
|
|
1534
|
+
.gsub('{databaseId}', database_id)
|
|
1535
|
+
.gsub('{tableId}', table_id)
|
|
1536
|
+
.gsub('{key}', key)
|
|
1537
|
+
|
|
1538
|
+
if database_id.nil?
|
|
1539
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
|
1540
|
+
end
|
|
1541
|
+
|
|
1542
|
+
if table_id.nil?
|
|
1543
|
+
raise Appwrite::Exception.new('Missing required parameter: "tableId"')
|
|
1544
|
+
end
|
|
1545
|
+
|
|
1546
|
+
if key.nil?
|
|
1547
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
|
1548
|
+
end
|
|
1549
|
+
|
|
1550
|
+
if required.nil?
|
|
1551
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
|
1552
|
+
end
|
|
1553
|
+
|
|
1554
|
+
if default.nil?
|
|
1555
|
+
raise Appwrite::Exception.new('Missing required parameter: "default"')
|
|
1556
|
+
end
|
|
1557
|
+
|
|
1558
|
+
api_params = {
|
|
1559
|
+
required: required,
|
|
1560
|
+
default: default,
|
|
1561
|
+
newKey: new_key,
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1564
|
+
api_headers = {
|
|
1565
|
+
"content-type": 'application/json',
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
@client.call(
|
|
1569
|
+
method: 'PATCH',
|
|
1570
|
+
path: api_path,
|
|
1571
|
+
headers: api_headers,
|
|
1572
|
+
params: api_params,
|
|
1573
|
+
response_type: Models::ColumnLongtext
|
|
1574
|
+
)
|
|
1575
|
+
end
|
|
1576
|
+
|
|
1577
|
+
# Create a mediumtext column.
|
|
1578
|
+
#
|
|
1579
|
+
#
|
|
1580
|
+
# @param [String] database_id Database ID.
|
|
1581
|
+
# @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
|
|
1582
|
+
# @param [String] key Column Key.
|
|
1583
|
+
# @param [] required Is column required?
|
|
1584
|
+
# @param [String] default Default value for column when not provided. Cannot be set when column is required.
|
|
1585
|
+
# @param [] array Is column an array?
|
|
1586
|
+
#
|
|
1587
|
+
# @return [ColumnMediumtext]
|
|
1588
|
+
def create_mediumtext_column(database_id:, table_id:, key:, required:, default: nil, array: nil)
|
|
1589
|
+
api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext'
|
|
1590
|
+
.gsub('{databaseId}', database_id)
|
|
1591
|
+
.gsub('{tableId}', table_id)
|
|
1592
|
+
|
|
1593
|
+
if database_id.nil?
|
|
1594
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
|
1595
|
+
end
|
|
1596
|
+
|
|
1597
|
+
if table_id.nil?
|
|
1598
|
+
raise Appwrite::Exception.new('Missing required parameter: "tableId"')
|
|
1599
|
+
end
|
|
1600
|
+
|
|
1601
|
+
if key.nil?
|
|
1602
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
|
1603
|
+
end
|
|
1604
|
+
|
|
1605
|
+
if required.nil?
|
|
1606
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
|
1607
|
+
end
|
|
1608
|
+
|
|
1609
|
+
api_params = {
|
|
1610
|
+
key: key,
|
|
1611
|
+
required: required,
|
|
1612
|
+
default: default,
|
|
1613
|
+
array: array,
|
|
1614
|
+
}
|
|
1615
|
+
|
|
1616
|
+
api_headers = {
|
|
1617
|
+
"content-type": 'application/json',
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
@client.call(
|
|
1621
|
+
method: 'POST',
|
|
1622
|
+
path: api_path,
|
|
1623
|
+
headers: api_headers,
|
|
1624
|
+
params: api_params,
|
|
1625
|
+
response_type: Models::ColumnMediumtext
|
|
1626
|
+
)
|
|
1627
|
+
end
|
|
1628
|
+
|
|
1629
|
+
# Update a mediumtext column. Changing the `default` value will not update
|
|
1630
|
+
# already existing rows.
|
|
1631
|
+
#
|
|
1632
|
+
#
|
|
1633
|
+
# @param [String] database_id Database ID.
|
|
1634
|
+
# @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
|
|
1635
|
+
# @param [String] key Column Key.
|
|
1636
|
+
# @param [] required Is column required?
|
|
1637
|
+
# @param [String] default Default value for column when not provided. Cannot be set when column is required.
|
|
1638
|
+
# @param [String] new_key New Column Key.
|
|
1639
|
+
#
|
|
1640
|
+
# @return [ColumnMediumtext]
|
|
1641
|
+
def update_mediumtext_column(database_id:, table_id:, key:, required:, default:, new_key: nil)
|
|
1642
|
+
api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/mediumtext/{key}'
|
|
1643
|
+
.gsub('{databaseId}', database_id)
|
|
1644
|
+
.gsub('{tableId}', table_id)
|
|
1645
|
+
.gsub('{key}', key)
|
|
1646
|
+
|
|
1647
|
+
if database_id.nil?
|
|
1648
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
|
1649
|
+
end
|
|
1650
|
+
|
|
1651
|
+
if table_id.nil?
|
|
1652
|
+
raise Appwrite::Exception.new('Missing required parameter: "tableId"')
|
|
1653
|
+
end
|
|
1654
|
+
|
|
1655
|
+
if key.nil?
|
|
1656
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
|
1657
|
+
end
|
|
1658
|
+
|
|
1659
|
+
if required.nil?
|
|
1660
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
|
1661
|
+
end
|
|
1662
|
+
|
|
1663
|
+
if default.nil?
|
|
1664
|
+
raise Appwrite::Exception.new('Missing required parameter: "default"')
|
|
1665
|
+
end
|
|
1666
|
+
|
|
1667
|
+
api_params = {
|
|
1668
|
+
required: required,
|
|
1669
|
+
default: default,
|
|
1670
|
+
newKey: new_key,
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
api_headers = {
|
|
1674
|
+
"content-type": 'application/json',
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
|
+
@client.call(
|
|
1678
|
+
method: 'PATCH',
|
|
1679
|
+
path: api_path,
|
|
1680
|
+
headers: api_headers,
|
|
1681
|
+
params: api_params,
|
|
1682
|
+
response_type: Models::ColumnMediumtext
|
|
1683
|
+
)
|
|
1684
|
+
end
|
|
1685
|
+
|
|
1472
1686
|
# Create a geometric point column.
|
|
1473
1687
|
#
|
|
1474
1688
|
# @param [String] database_id Database ID.
|
|
@@ -1728,6 +1942,9 @@ module Appwrite
|
|
|
1728
1942
|
)
|
|
1729
1943
|
end
|
|
1730
1944
|
|
|
1945
|
+
#
|
|
1946
|
+
# @deprecated This API has been deprecated since 1.9.0. Please use `TablesDB.createTextColumn` instead.
|
|
1947
|
+
#
|
|
1731
1948
|
# Create a string column.
|
|
1732
1949
|
#
|
|
1733
1950
|
#
|
|
@@ -1788,6 +2005,9 @@ module Appwrite
|
|
|
1788
2005
|
)
|
|
1789
2006
|
end
|
|
1790
2007
|
|
|
2008
|
+
#
|
|
2009
|
+
# @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateTextColumn` instead.
|
|
2010
|
+
#
|
|
1791
2011
|
# Update a string column. Changing the `default` value will not update
|
|
1792
2012
|
# already existing rows.
|
|
1793
2013
|
#
|
|
@@ -1847,6 +2067,115 @@ module Appwrite
|
|
|
1847
2067
|
)
|
|
1848
2068
|
end
|
|
1849
2069
|
|
|
2070
|
+
# Create a text column.
|
|
2071
|
+
#
|
|
2072
|
+
#
|
|
2073
|
+
# @param [String] database_id Database ID.
|
|
2074
|
+
# @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
|
|
2075
|
+
# @param [String] key Column Key.
|
|
2076
|
+
# @param [] required Is column required?
|
|
2077
|
+
# @param [String] default Default value for column when not provided. Cannot be set when column is required.
|
|
2078
|
+
# @param [] array Is column an array?
|
|
2079
|
+
#
|
|
2080
|
+
# @return [ColumnText]
|
|
2081
|
+
def create_text_column(database_id:, table_id:, key:, required:, default: nil, array: nil)
|
|
2082
|
+
api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/text'
|
|
2083
|
+
.gsub('{databaseId}', database_id)
|
|
2084
|
+
.gsub('{tableId}', table_id)
|
|
2085
|
+
|
|
2086
|
+
if database_id.nil?
|
|
2087
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
|
2088
|
+
end
|
|
2089
|
+
|
|
2090
|
+
if table_id.nil?
|
|
2091
|
+
raise Appwrite::Exception.new('Missing required parameter: "tableId"')
|
|
2092
|
+
end
|
|
2093
|
+
|
|
2094
|
+
if key.nil?
|
|
2095
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
|
2096
|
+
end
|
|
2097
|
+
|
|
2098
|
+
if required.nil?
|
|
2099
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
|
2100
|
+
end
|
|
2101
|
+
|
|
2102
|
+
api_params = {
|
|
2103
|
+
key: key,
|
|
2104
|
+
required: required,
|
|
2105
|
+
default: default,
|
|
2106
|
+
array: array,
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
api_headers = {
|
|
2110
|
+
"content-type": 'application/json',
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
@client.call(
|
|
2114
|
+
method: 'POST',
|
|
2115
|
+
path: api_path,
|
|
2116
|
+
headers: api_headers,
|
|
2117
|
+
params: api_params,
|
|
2118
|
+
response_type: Models::ColumnText
|
|
2119
|
+
)
|
|
2120
|
+
end
|
|
2121
|
+
|
|
2122
|
+
# Update a text column. Changing the `default` value will not update already
|
|
2123
|
+
# existing rows.
|
|
2124
|
+
#
|
|
2125
|
+
#
|
|
2126
|
+
# @param [String] database_id Database ID.
|
|
2127
|
+
# @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
|
|
2128
|
+
# @param [String] key Column Key.
|
|
2129
|
+
# @param [] required Is column required?
|
|
2130
|
+
# @param [String] default Default value for column when not provided. Cannot be set when column is required.
|
|
2131
|
+
# @param [String] new_key New Column Key.
|
|
2132
|
+
#
|
|
2133
|
+
# @return [ColumnText]
|
|
2134
|
+
def update_text_column(database_id:, table_id:, key:, required:, default:, new_key: nil)
|
|
2135
|
+
api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/text/{key}'
|
|
2136
|
+
.gsub('{databaseId}', database_id)
|
|
2137
|
+
.gsub('{tableId}', table_id)
|
|
2138
|
+
.gsub('{key}', key)
|
|
2139
|
+
|
|
2140
|
+
if database_id.nil?
|
|
2141
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
|
2142
|
+
end
|
|
2143
|
+
|
|
2144
|
+
if table_id.nil?
|
|
2145
|
+
raise Appwrite::Exception.new('Missing required parameter: "tableId"')
|
|
2146
|
+
end
|
|
2147
|
+
|
|
2148
|
+
if key.nil?
|
|
2149
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
|
2150
|
+
end
|
|
2151
|
+
|
|
2152
|
+
if required.nil?
|
|
2153
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
|
2154
|
+
end
|
|
2155
|
+
|
|
2156
|
+
if default.nil?
|
|
2157
|
+
raise Appwrite::Exception.new('Missing required parameter: "default"')
|
|
2158
|
+
end
|
|
2159
|
+
|
|
2160
|
+
api_params = {
|
|
2161
|
+
required: required,
|
|
2162
|
+
default: default,
|
|
2163
|
+
newKey: new_key,
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
api_headers = {
|
|
2167
|
+
"content-type": 'application/json',
|
|
2168
|
+
}
|
|
2169
|
+
|
|
2170
|
+
@client.call(
|
|
2171
|
+
method: 'PATCH',
|
|
2172
|
+
path: api_path,
|
|
2173
|
+
headers: api_headers,
|
|
2174
|
+
params: api_params,
|
|
2175
|
+
response_type: Models::ColumnText
|
|
2176
|
+
)
|
|
2177
|
+
end
|
|
2178
|
+
|
|
1850
2179
|
# Create a URL column.
|
|
1851
2180
|
#
|
|
1852
2181
|
#
|
|
@@ -1956,6 +2285,123 @@ module Appwrite
|
|
|
1956
2285
|
)
|
|
1957
2286
|
end
|
|
1958
2287
|
|
|
2288
|
+
# Create a varchar column.
|
|
2289
|
+
#
|
|
2290
|
+
#
|
|
2291
|
+
# @param [String] database_id Database ID.
|
|
2292
|
+
# @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
|
|
2293
|
+
# @param [String] key Column Key.
|
|
2294
|
+
# @param [Integer] size Column size for varchar columns, in number of characters. Maximum size is 16381.
|
|
2295
|
+
# @param [] required Is column required?
|
|
2296
|
+
# @param [String] default Default value for column when not provided. Cannot be set when column is required.
|
|
2297
|
+
# @param [] array Is column an array?
|
|
2298
|
+
#
|
|
2299
|
+
# @return [ColumnVarchar]
|
|
2300
|
+
def create_varchar_column(database_id:, table_id:, key:, size:, required:, default: nil, array: nil)
|
|
2301
|
+
api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/varchar'
|
|
2302
|
+
.gsub('{databaseId}', database_id)
|
|
2303
|
+
.gsub('{tableId}', table_id)
|
|
2304
|
+
|
|
2305
|
+
if database_id.nil?
|
|
2306
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
|
2307
|
+
end
|
|
2308
|
+
|
|
2309
|
+
if table_id.nil?
|
|
2310
|
+
raise Appwrite::Exception.new('Missing required parameter: "tableId"')
|
|
2311
|
+
end
|
|
2312
|
+
|
|
2313
|
+
if key.nil?
|
|
2314
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
|
2315
|
+
end
|
|
2316
|
+
|
|
2317
|
+
if size.nil?
|
|
2318
|
+
raise Appwrite::Exception.new('Missing required parameter: "size"')
|
|
2319
|
+
end
|
|
2320
|
+
|
|
2321
|
+
if required.nil?
|
|
2322
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
|
2323
|
+
end
|
|
2324
|
+
|
|
2325
|
+
api_params = {
|
|
2326
|
+
key: key,
|
|
2327
|
+
size: size,
|
|
2328
|
+
required: required,
|
|
2329
|
+
default: default,
|
|
2330
|
+
array: array,
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2333
|
+
api_headers = {
|
|
2334
|
+
"content-type": 'application/json',
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
@client.call(
|
|
2338
|
+
method: 'POST',
|
|
2339
|
+
path: api_path,
|
|
2340
|
+
headers: api_headers,
|
|
2341
|
+
params: api_params,
|
|
2342
|
+
response_type: Models::ColumnVarchar
|
|
2343
|
+
)
|
|
2344
|
+
end
|
|
2345
|
+
|
|
2346
|
+
# Update a varchar column. Changing the `default` value will not update
|
|
2347
|
+
# already existing rows.
|
|
2348
|
+
#
|
|
2349
|
+
#
|
|
2350
|
+
# @param [String] database_id Database ID.
|
|
2351
|
+
# @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
|
|
2352
|
+
# @param [String] key Column Key.
|
|
2353
|
+
# @param [] required Is column required?
|
|
2354
|
+
# @param [String] default Default value for column when not provided. Cannot be set when column is required.
|
|
2355
|
+
# @param [Integer] size Maximum size of the varchar column.
|
|
2356
|
+
# @param [String] new_key New Column Key.
|
|
2357
|
+
#
|
|
2358
|
+
# @return [ColumnVarchar]
|
|
2359
|
+
def update_varchar_column(database_id:, table_id:, key:, required:, default:, size: nil, new_key: nil)
|
|
2360
|
+
api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns/varchar/{key}'
|
|
2361
|
+
.gsub('{databaseId}', database_id)
|
|
2362
|
+
.gsub('{tableId}', table_id)
|
|
2363
|
+
.gsub('{key}', key)
|
|
2364
|
+
|
|
2365
|
+
if database_id.nil?
|
|
2366
|
+
raise Appwrite::Exception.new('Missing required parameter: "databaseId"')
|
|
2367
|
+
end
|
|
2368
|
+
|
|
2369
|
+
if table_id.nil?
|
|
2370
|
+
raise Appwrite::Exception.new('Missing required parameter: "tableId"')
|
|
2371
|
+
end
|
|
2372
|
+
|
|
2373
|
+
if key.nil?
|
|
2374
|
+
raise Appwrite::Exception.new('Missing required parameter: "key"')
|
|
2375
|
+
end
|
|
2376
|
+
|
|
2377
|
+
if required.nil?
|
|
2378
|
+
raise Appwrite::Exception.new('Missing required parameter: "required"')
|
|
2379
|
+
end
|
|
2380
|
+
|
|
2381
|
+
if default.nil?
|
|
2382
|
+
raise Appwrite::Exception.new('Missing required parameter: "default"')
|
|
2383
|
+
end
|
|
2384
|
+
|
|
2385
|
+
api_params = {
|
|
2386
|
+
required: required,
|
|
2387
|
+
default: default,
|
|
2388
|
+
size: size,
|
|
2389
|
+
newKey: new_key,
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
api_headers = {
|
|
2393
|
+
"content-type": 'application/json',
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2396
|
+
@client.call(
|
|
2397
|
+
method: 'PATCH',
|
|
2398
|
+
path: api_path,
|
|
2399
|
+
headers: api_headers,
|
|
2400
|
+
params: api_params,
|
|
2401
|
+
response_type: Models::ColumnVarchar
|
|
2402
|
+
)
|
|
2403
|
+
end
|
|
2404
|
+
|
|
1959
2405
|
# Get column by ID.
|
|
1960
2406
|
#
|
|
1961
2407
|
# @param [String] database_id Database ID.
|
|
@@ -1992,6 +2438,7 @@ module Appwrite
|
|
|
1992
2438
|
path: api_path,
|
|
1993
2439
|
headers: api_headers,
|
|
1994
2440
|
params: api_params,
|
|
2441
|
+
response_type: Models::ColumnBoolean
|
|
1995
2442
|
)
|
|
1996
2443
|
end
|
|
1997
2444
|
|
data/lib/appwrite.rb
CHANGED
|
@@ -41,6 +41,7 @@ require_relative 'appwrite/models/language_list'
|
|
|
41
41
|
require_relative 'appwrite/models/currency_list'
|
|
42
42
|
require_relative 'appwrite/models/phone_list'
|
|
43
43
|
require_relative 'appwrite/models/variable_list'
|
|
44
|
+
require_relative 'appwrite/models/health_status_list'
|
|
44
45
|
require_relative 'appwrite/models/locale_code_list'
|
|
45
46
|
require_relative 'appwrite/models/provider_list'
|
|
46
47
|
require_relative 'appwrite/models/message_list'
|
|
@@ -65,6 +66,10 @@ require_relative 'appwrite/models/attribute_relationship'
|
|
|
65
66
|
require_relative 'appwrite/models/attribute_point'
|
|
66
67
|
require_relative 'appwrite/models/attribute_line'
|
|
67
68
|
require_relative 'appwrite/models/attribute_polygon'
|
|
69
|
+
require_relative 'appwrite/models/attribute_varchar'
|
|
70
|
+
require_relative 'appwrite/models/attribute_text'
|
|
71
|
+
require_relative 'appwrite/models/attribute_mediumtext'
|
|
72
|
+
require_relative 'appwrite/models/attribute_longtext'
|
|
68
73
|
require_relative 'appwrite/models/table'
|
|
69
74
|
require_relative 'appwrite/models/column_list'
|
|
70
75
|
require_relative 'appwrite/models/column_string'
|
|
@@ -80,6 +85,10 @@ require_relative 'appwrite/models/column_relationship'
|
|
|
80
85
|
require_relative 'appwrite/models/column_point'
|
|
81
86
|
require_relative 'appwrite/models/column_line'
|
|
82
87
|
require_relative 'appwrite/models/column_polygon'
|
|
88
|
+
require_relative 'appwrite/models/column_varchar'
|
|
89
|
+
require_relative 'appwrite/models/column_text'
|
|
90
|
+
require_relative 'appwrite/models/column_mediumtext'
|
|
91
|
+
require_relative 'appwrite/models/column_longtext'
|
|
83
92
|
require_relative 'appwrite/models/index'
|
|
84
93
|
require_relative 'appwrite/models/column_index'
|
|
85
94
|
require_relative 'appwrite/models/row'
|
|
@@ -144,11 +153,14 @@ require_relative 'appwrite/enums/credit_card'
|
|
|
144
153
|
require_relative 'appwrite/enums/flag'
|
|
145
154
|
require_relative 'appwrite/enums/theme'
|
|
146
155
|
require_relative 'appwrite/enums/timezone'
|
|
147
|
-
require_relative 'appwrite/enums/
|
|
156
|
+
require_relative 'appwrite/enums/browser_permission'
|
|
157
|
+
require_relative 'appwrite/enums/image_format'
|
|
148
158
|
require_relative 'appwrite/enums/relationship_type'
|
|
149
159
|
require_relative 'appwrite/enums/relation_mutate'
|
|
150
160
|
require_relative 'appwrite/enums/index_type'
|
|
161
|
+
require_relative 'appwrite/enums/order_by'
|
|
151
162
|
require_relative 'appwrite/enums/runtime'
|
|
163
|
+
require_relative 'appwrite/enums/scopes'
|
|
152
164
|
require_relative 'appwrite/enums/template_reference_type'
|
|
153
165
|
require_relative 'appwrite/enums/vcs_reference_type'
|
|
154
166
|
require_relative 'appwrite/enums/deployment_download_type'
|
|
@@ -161,7 +173,7 @@ require_relative 'appwrite/enums/build_runtime'
|
|
|
161
173
|
require_relative 'appwrite/enums/adapter'
|
|
162
174
|
require_relative 'appwrite/enums/compression'
|
|
163
175
|
require_relative 'appwrite/enums/image_gravity'
|
|
164
|
-
require_relative 'appwrite/enums/
|
|
176
|
+
require_relative 'appwrite/enums/roles'
|
|
165
177
|
require_relative 'appwrite/enums/password_hash'
|
|
166
178
|
require_relative 'appwrite/enums/messaging_provider_type'
|
|
167
179
|
require_relative 'appwrite/enums/database_type'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: appwrite
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 21.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Appwrite Team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-02-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mime-types
|
|
@@ -37,6 +37,7 @@ files:
|
|
|
37
37
|
- lib/appwrite/enums/authentication_factor.rb
|
|
38
38
|
- lib/appwrite/enums/authenticator_type.rb
|
|
39
39
|
- lib/appwrite/enums/browser.rb
|
|
40
|
+
- lib/appwrite/enums/browser_permission.rb
|
|
40
41
|
- lib/appwrite/enums/build_runtime.rb
|
|
41
42
|
- lib/appwrite/enums/column_status.rb
|
|
42
43
|
- lib/appwrite/enums/compression.rb
|
|
@@ -60,11 +61,13 @@ files:
|
|
|
60
61
|
- lib/appwrite/enums/messaging_provider_type.rb
|
|
61
62
|
- lib/appwrite/enums/name.rb
|
|
62
63
|
- lib/appwrite/enums/o_auth_provider.rb
|
|
63
|
-
- lib/appwrite/enums/
|
|
64
|
+
- lib/appwrite/enums/order_by.rb
|
|
64
65
|
- lib/appwrite/enums/password_hash.rb
|
|
65
66
|
- lib/appwrite/enums/relation_mutate.rb
|
|
66
67
|
- lib/appwrite/enums/relationship_type.rb
|
|
68
|
+
- lib/appwrite/enums/roles.rb
|
|
67
69
|
- lib/appwrite/enums/runtime.rb
|
|
70
|
+
- lib/appwrite/enums/scopes.rb
|
|
68
71
|
- lib/appwrite/enums/smtp_encryption.rb
|
|
69
72
|
- lib/appwrite/enums/template_reference_type.rb
|
|
70
73
|
- lib/appwrite/enums/theme.rb
|
|
@@ -89,11 +92,15 @@ files:
|
|
|
89
92
|
- lib/appwrite/models/attribute_ip.rb
|
|
90
93
|
- lib/appwrite/models/attribute_line.rb
|
|
91
94
|
- lib/appwrite/models/attribute_list.rb
|
|
95
|
+
- lib/appwrite/models/attribute_longtext.rb
|
|
96
|
+
- lib/appwrite/models/attribute_mediumtext.rb
|
|
92
97
|
- lib/appwrite/models/attribute_point.rb
|
|
93
98
|
- lib/appwrite/models/attribute_polygon.rb
|
|
94
99
|
- lib/appwrite/models/attribute_relationship.rb
|
|
95
100
|
- lib/appwrite/models/attribute_string.rb
|
|
101
|
+
- lib/appwrite/models/attribute_text.rb
|
|
96
102
|
- lib/appwrite/models/attribute_url.rb
|
|
103
|
+
- lib/appwrite/models/attribute_varchar.rb
|
|
97
104
|
- lib/appwrite/models/bucket.rb
|
|
98
105
|
- lib/appwrite/models/bucket_list.rb
|
|
99
106
|
- lib/appwrite/models/collection.rb
|
|
@@ -109,11 +116,15 @@ files:
|
|
|
109
116
|
- lib/appwrite/models/column_ip.rb
|
|
110
117
|
- lib/appwrite/models/column_line.rb
|
|
111
118
|
- lib/appwrite/models/column_list.rb
|
|
119
|
+
- lib/appwrite/models/column_longtext.rb
|
|
120
|
+
- lib/appwrite/models/column_mediumtext.rb
|
|
112
121
|
- lib/appwrite/models/column_point.rb
|
|
113
122
|
- lib/appwrite/models/column_polygon.rb
|
|
114
123
|
- lib/appwrite/models/column_relationship.rb
|
|
115
124
|
- lib/appwrite/models/column_string.rb
|
|
125
|
+
- lib/appwrite/models/column_text.rb
|
|
116
126
|
- lib/appwrite/models/column_url.rb
|
|
127
|
+
- lib/appwrite/models/column_varchar.rb
|
|
117
128
|
- lib/appwrite/models/continent.rb
|
|
118
129
|
- lib/appwrite/models/continent_list.rb
|
|
119
130
|
- lib/appwrite/models/country.rb
|
|
@@ -140,6 +151,7 @@ files:
|
|
|
140
151
|
- lib/appwrite/models/health_certificate.rb
|
|
141
152
|
- lib/appwrite/models/health_queue.rb
|
|
142
153
|
- lib/appwrite/models/health_status.rb
|
|
154
|
+
- lib/appwrite/models/health_status_list.rb
|
|
143
155
|
- lib/appwrite/models/health_time.rb
|
|
144
156
|
- lib/appwrite/models/identity.rb
|
|
145
157
|
- lib/appwrite/models/identity_list.rb
|
|
@@ -236,6 +248,6 @@ requirements: []
|
|
|
236
248
|
rubygems_version: 3.1.6
|
|
237
249
|
signing_key:
|
|
238
250
|
specification_version: 4
|
|
239
|
-
summary: Appwrite is an open-source self-hosted backend server that
|
|
240
|
-
complex and repetitive development tasks behind a very simple REST API
|
|
251
|
+
summary: Appwrite is an open-source self-hosted backend server that abstracts and
|
|
252
|
+
simplifies complex and repetitive development tasks behind a very simple REST API
|
|
241
253
|
test_files: []
|