diff --git a/lib/commands/databases.js b/lib/commands/databases.js index d4dbdbc..0e2bf90 100644 --- a/lib/commands/databases.js +++ b/lib/commands/databases.js @@ -1185,7 +1185,7 @@ const databasesUpdateIpAttribute = async ({databaseId,collectionId,key,required, * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? - * @property {string} xdefault Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required. + * @property {any[]} xdefault Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -1205,6 +1205,7 @@ const databasesCreateLineAttribute = async ({databaseId,collectionId,key,require if (typeof required !== 'undefined') { payload['required'] = required; } + xdefault = xdefault === true ? [] : xdefault; if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } @@ -1228,7 +1229,7 @@ const databasesCreateLineAttribute = async ({databaseId,collectionId,key,require * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? - * @property {string} xdefault Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required. + * @property {any[]} xdefault Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required. * @property {string} newKey New attribute key. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -1246,6 +1247,7 @@ const databasesUpdateLineAttribute = async ({databaseId,collectionId,key,require if (typeof required !== 'undefined') { payload['required'] = required; } + xdefault = xdefault === true ? [] : xdefault; if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } @@ -1272,7 +1274,7 @@ const databasesUpdateLineAttribute = async ({databaseId,collectionId,key,require * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? - * @property {string} xdefault Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required. + * @property {any[]} xdefault Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -1292,6 +1294,7 @@ const databasesCreatePointAttribute = async ({databaseId,collectionId,key,requir if (typeof required !== 'undefined') { payload['required'] = required; } + xdefault = xdefault === true ? [] : xdefault; if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } @@ -1315,7 +1318,7 @@ const databasesCreatePointAttribute = async ({databaseId,collectionId,key,requir * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? - * @property {string} xdefault Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required. + * @property {any[]} xdefault Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required. * @property {string} newKey New attribute key. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -1333,6 +1336,7 @@ const databasesUpdatePointAttribute = async ({databaseId,collectionId,key,requir if (typeof required !== 'undefined') { payload['required'] = required; } + xdefault = xdefault === true ? [] : xdefault; if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } @@ -1359,7 +1363,7 @@ const databasesUpdatePointAttribute = async ({databaseId,collectionId,key,requir * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? - * @property {string} xdefault Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required. + * @property {any[]} xdefault Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -1379,6 +1383,7 @@ const databasesCreatePolygonAttribute = async ({databaseId,collectionId,key,requ if (typeof required !== 'undefined') { payload['required'] = required; } + xdefault = xdefault === true ? [] : xdefault; if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } @@ -1402,7 +1407,7 @@ const databasesCreatePolygonAttribute = async ({databaseId,collectionId,key,requ * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection). * @property {string} key Attribute Key. * @property {boolean} required Is attribute required? - * @property {string} xdefault Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required. + * @property {any[]} xdefault Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required. * @property {string} newKey New attribute key. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -1420,6 +1425,7 @@ const databasesUpdatePolygonAttribute = async ({databaseId,collectionId,key,requ if (typeof required !== 'undefined') { payload['required'] = required; } + xdefault = xdefault === true ? [] : xdefault; if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } @@ -2851,7 +2857,7 @@ databases .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.`) + .option(`--xdefault `, `Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.`) .action(actionRunner(databasesCreateLineAttribute)) databases @@ -2861,18 +2867,18 @@ databases .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.`) + .option(`--xdefault `, `Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.`) .option(`--new-key `, `New attribute key.`) .action(actionRunner(databasesUpdateLineAttribute)) databases .command(`create-point-attribute`) - .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-point-column' instead] Create a geometric 2d point attribute.`) + .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-point-column' instead] Create a geometric point attribute.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.`) + .option(`--xdefault `, `Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.`) .action(actionRunner(databasesCreatePointAttribute)) databases @@ -2882,7 +2888,7 @@ databases .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.`) + .option(`--xdefault `, `Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.`) .option(`--new-key `, `New attribute key.`) .action(actionRunner(databasesUpdatePointAttribute)) @@ -2893,7 +2899,7 @@ databases .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.`) + .option(`--xdefault `, `Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.`) .action(actionRunner(databasesCreatePolygonAttribute)) databases @@ -2903,7 +2909,7 @@ databases .requiredOption(`--collection-id `, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`) .requiredOption(`--key `, `Attribute Key.`) .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for attribute when not provided, as JSON string. Cannot be set when attribute is required.`) + .option(`--xdefault `, `Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.`) .option(`--new-key `, `New attribute key.`) .action(actionRunner(databasesUpdatePolygonAttribute)) diff --git a/lib/commands/tables-db.js b/lib/commands/tables-db.js index 1325902..6f9611b 100644 --- a/lib/commands/tables-db.js +++ b/lib/commands/tables-db.js @@ -1185,7 +1185,7 @@ const tablesDBUpdateIpColumn = async ({databaseId,tableId,key,required,xdefault, * @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). * @property {string} key Column Key. * @property {boolean} required Is column required? - * @property {string} xdefault Default value for column when not provided, as JSON string. Cannot be set when column is required. + * @property {any[]} xdefault Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -1205,6 +1205,7 @@ const tablesDBCreateLineColumn = async ({databaseId,tableId,key,required,xdefaul if (typeof required !== 'undefined') { payload['required'] = required; } + xdefault = xdefault === true ? [] : xdefault; if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } @@ -1228,7 +1229,7 @@ const tablesDBCreateLineColumn = async ({databaseId,tableId,key,required,xdefaul * @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). * @property {string} key Column Key. * @property {boolean} required Is column required? - * @property {string} xdefault Default value for column when not provided, as JSON string. Cannot be set when column is required. + * @property {any[]} xdefault Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required. * @property {string} newKey New Column Key. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -1246,6 +1247,7 @@ const tablesDBUpdateLineColumn = async ({databaseId,tableId,key,required,xdefaul if (typeof required !== 'undefined') { payload['required'] = required; } + xdefault = xdefault === true ? [] : xdefault; if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } @@ -1272,7 +1274,7 @@ const tablesDBUpdateLineColumn = async ({databaseId,tableId,key,required,xdefaul * @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). * @property {string} key Column Key. * @property {boolean} required Is column required? - * @property {string} xdefault Default value for column when not provided, as JSON string. Cannot be set when column is required. + * @property {any[]} xdefault Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -1292,6 +1294,7 @@ const tablesDBCreatePointColumn = async ({databaseId,tableId,key,required,xdefau if (typeof required !== 'undefined') { payload['required'] = required; } + xdefault = xdefault === true ? [] : xdefault; if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } @@ -1315,7 +1318,7 @@ const tablesDBCreatePointColumn = async ({databaseId,tableId,key,required,xdefau * @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). * @property {string} key Column Key. * @property {boolean} required Is column required? - * @property {string} xdefault Default value for column when not provided, as JSON string. Cannot be set when column is required. + * @property {any[]} xdefault Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required. * @property {string} newKey New Column Key. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -1333,6 +1336,7 @@ const tablesDBUpdatePointColumn = async ({databaseId,tableId,key,required,xdefau if (typeof required !== 'undefined') { payload['required'] = required; } + xdefault = xdefault === true ? [] : xdefault; if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } @@ -1359,7 +1363,7 @@ const tablesDBUpdatePointColumn = async ({databaseId,tableId,key,required,xdefau * @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). * @property {string} key Column Key. * @property {boolean} required Is column required? - * @property {string} xdefault Default value for column when not provided, as JSON string. Cannot be set when column is required. + * @property {any[]} xdefault Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. * @property {boolean} overrideForCli * @property {boolean} parseOutput * @property {libClient | undefined} sdk @@ -1379,6 +1383,7 @@ const tablesDBCreatePolygonColumn = async ({databaseId,tableId,key,required,xdef if (typeof required !== 'undefined') { payload['required'] = required; } + xdefault = xdefault === true ? [] : xdefault; if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } @@ -1402,7 +1407,7 @@ const tablesDBCreatePolygonColumn = async ({databaseId,tableId,key,required,xdef * @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). * @property {string} key Column Key. * @property {boolean} required Is column required? - * @property {string} xdefault Default value for column when not provided, as JSON string. Cannot be set when column is required. + * @property {any[]} xdefault Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required. * @property {string} newKey New Column Key. * @property {boolean} overrideForCli * @property {boolean} parseOutput @@ -1420,6 +1425,7 @@ const tablesDBUpdatePolygonColumn = async ({databaseId,tableId,key,required,xdef if (typeof required !== 'undefined') { payload['required'] = required; } + xdefault = xdefault === true ? [] : xdefault; if (typeof xdefault !== 'undefined') { payload['default'] = xdefault; } @@ -2829,64 +2835,64 @@ tablesDB tablesDB .command(`create-line-column`) - .description(`Create a geometric line attribute.`) + .description(`Create a geometric line column.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--table-id `, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) .requiredOption(`--key `, `Column Key.`) .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for column when not provided, as JSON string. Cannot be set when column is required.`) + .option(`--xdefault `, `Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.`) .action(actionRunner(tablesDBCreateLineColumn)) tablesDB .command(`update-line-column`) - .description(`Update a line column. Changing the 'default' value will not update already existing documents.`) + .description(`Update a line column. Changing the 'default' value will not update already existing rows.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--table-id `, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) .requiredOption(`--key `, `Column Key.`) .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for column when not provided, as JSON string. Cannot be set when column is required.`) + .option(`--xdefault `, `Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.`) .option(`--new-key `, `New Column Key.`) .action(actionRunner(tablesDBUpdateLineColumn)) tablesDB .command(`create-point-column`) - .description(`Create a geometric point attribute.`) + .description(`Create a geometric point column.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--table-id `, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) .requiredOption(`--key `, `Column Key.`) .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for column when not provided, as JSON string. Cannot be set when column is required.`) + .option(`--xdefault `, `Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.`) .action(actionRunner(tablesDBCreatePointColumn)) tablesDB .command(`update-point-column`) - .description(`Update a point column. Changing the 'default' value will not update already existing documents.`) + .description(`Update a point column. Changing the 'default' value will not update already existing rows.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--table-id `, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) .requiredOption(`--key `, `Column Key.`) .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for column when not provided, as JSON string. Cannot be set when column is required.`) + .option(`--xdefault `, `Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.`) .option(`--new-key `, `New Column Key.`) .action(actionRunner(tablesDBUpdatePointColumn)) tablesDB .command(`create-polygon-column`) - .description(`Create a geometric polygon attribute.`) + .description(`Create a geometric polygon column.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--table-id `, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) .requiredOption(`--key `, `Column Key.`) .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for column when not provided, as JSON string. Cannot be set when column is required.`) + .option(`--xdefault `, `Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.`) .action(actionRunner(tablesDBCreatePolygonColumn)) tablesDB .command(`update-polygon-column`) - .description(`Update a polygon column. Changing the 'default' value will not update already existing documents.`) + .description(`Update a polygon column. Changing the 'default' value will not update already existing rows.`) .requiredOption(`--database-id `, `Database ID.`) .requiredOption(`--table-id `, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`) .requiredOption(`--key `, `Column Key.`) .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value)) - .option(`--xdefault `, `Default value for column when not provided, as JSON string. Cannot be set when column is required.`) + .option(`--xdefault `, `Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.`) .option(`--new-key `, `New Column Key.`) .action(actionRunner(tablesDBUpdatePolygonColumn)) diff --git a/lib/type-generation/languages/typescript.js b/lib/type-generation/languages/typescript.js index 69285dd..d189d23 100644 --- a/lib/type-generation/languages/typescript.js +++ b/lib/type-generation/languages/typescript.js @@ -90,7 +90,9 @@ export enum <%- toPascalCase(attribute.key) %> { <% for (const [index, collection] of Object.entries(collections)) { -%> export type <%- toPascalCase(collection.name) %> = Models.Row & { <% for (const attribute of collection.attributes) { -%> - <%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- getType(attribute, collections) %>; +<% const propertyName = strict ? toCamelCase(attribute.key) : attribute.key; -%> +<% const isValidIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(propertyName); -%> + <% if (isValidIdentifier) { %><%- propertyName %><% } else { %>"<%- propertyName %>"<% } %>: <%- getType(attribute, collections) %>; <% } -%> }<% if (index < collections.length - 1) { %> <% } %>