# Zontroy AI Offline Inner Repeating File

## *<mark style="color:blue;">ziref</mark>*

<figure><img src="/files/83DbOOGD2Hn9tHma9931" alt=""><figcaption></figcaption></figure>

*Zontroy AI Offline  Inner Repeating File is used to create folders, multiple code files and generate lines of code inside those. It uses .ziref extension. Name of folders and ziref files is set programatically by entering a name in Zontroy Programming Language.*

<figure><img src="https://zontroy.com/wp-content/uploads/2022/03/ziref.png" alt=""><figcaption><p>Multiple entities to multiple folders and code files</p></figcaption></figure>

### *<mark style="color:blue;">Folder Naming Format</mark>*

```
[folder_name].ziref
```

### *<mark style="color:blue;">File Naming Format</mark>*

```
[file_name].[file_extension].ziref
```

### *<mark style="color:blue;">Folder Naming Example</mark>*

```
My[[[zg-entity...zg-name]]]Folder.ziref
```

### *<mark style="color:blue;">File Naming Example</mark>*

```
MyClass.java.ziref
```

### *<mark style="color:blue;">Code Example</mark>*

*A simple usage example of ziref file in Typescript.*

```
// folder name
zg-l(((zg-p(((zg-entity...zg-name))))))-list.ziref
```

```typescript
// file name
// _requests.ts.ziref
import axios, {AxiosResponse} from 'axios'
import {ID, Response} from '../../../../../_metronic/helpers'
import {[[[zg-entity...zg-name]]], zg-pluralize(((zg-entity...zg-name)))QueryResponse} from './_models'

const API_URL = process.env.REACT_APP_API_URL
const GET_zg-upper(((zg-entity...zg-name)))_URL = `${API_URL}/zg-lower(((zg-entity...zg-name)))/getzg-lower(((zg-entity...zg-name)))`
const CREATE_zg-upper(((zg-entity...zg-name)))_URL = `${API_URL}/zg-lower(((zg-entity...zg-name)))/addzg-lower(((zg-entity...zg-name)))`
const UPDATE_zg-upper(((zg-entity...zg-name)))_URL = `${API_URL}/zg-lower(((zg-entity...zg-name)))/updatezg-lower(((zg-entity...zg-name)))`
const DELETE_zg-upper(((zg-entity...zg-name)))_URL = `${API_URL}/zg-lower(((zg-entity...zg-name)))/deletezg-lower(((zg-entity...zg-name)))`
const GET_zg-upper(((zg-pluralize(((zg-entity...zg-name))))))_URL = `${API_URL}/zg-lower(((zg-entity...zg-name)))/getzg-lower(((zg-pluralize(((zg-entity...zg-name))))))`

const getzg-pluralize(((zg-entity...zg-name))) = (query: string): Promise<zg-pluralize(((zg-entity...zg-name)))QueryResponse> => {
  return axios
    .get(`${GET_zg-upper(((zg-pluralize(((zg-entity...zg-name))))))_URL}?${query}`)
    .then((d: AxiosResponse<zg-pluralize(((zg-entity...zg-name)))QueryResponse>) => d.data)
}

const get[[[zg-entity...zg-name]]]ById = (id: ID): Promise<[[[zg-entity...zg-name]]] | undefined> => {
  return axios
    .get(`${GET_zg-upper(((zg-entity...zg-name)))_URL}/${id}`)
    .then((response: AxiosResponse<Response<[[[zg-entity...zg-name]]]>>) => response.data)
    .then((response: Response<[[[zg-entity...zg-name]]]>) => response.data)
}

const create[[[zg-entity...zg-name]]] = (zg-lower(((zg-entity...zg-name))): [[[zg-entity...zg-name]]]): Promise<[[[zg-entity...zg-name]]] | undefined> => {
  return axios
    .post(CREATE_zg-upper(((zg-entity...zg-name)))_URL, zg-lower(((zg-entity...zg-name))))
    .then((response: AxiosResponse<Response<[[[zg-entity...zg-name]]]>>) => response.data)
    .then((response: Response<[[[zg-entity...zg-name]]]>) => response.data)
}

const update[[[zg-entity...zg-name]]] = (zg-lower(((zg-entity...zg-name))): [[[zg-entity...zg-name]]]): Promise<[[[zg-entity...zg-name]]] | undefined> => {
  return axios
    .put(`${UPDATE_zg-upper(((zg-entity...zg-name)))_URL}/${zg-lower(((zg-entity...zg-name))).id}`, zg-lower(((zg-entity...zg-name))))
    .then((response: AxiosResponse<Response<[[[zg-entity...zg-name]]]>>) => response.data)
    .then((response: Response<[[[zg-entity...zg-name]]]>) => response.data)
}

const delete[[[zg-entity...zg-name]]] = (zg-lower(((zg-entity...zg-name)))Id: ID): Promise<void> => {
  return axios.delete(`${DELETE_zg-upper(((zg-entity...zg-name)))_URL}/${zg-lower(((zg-entity...zg-name)))Id}`).then(() => {})
}

const deleteSelectedzg-pluralize(((zg-entity...zg-name))) = (zg-lower(((zg-entity...zg-name)))Ids: Array<ID>): Promise<void> => {
  const requests = zg-lower(((zg-entity...zg-name)))Ids.map((id) => axios.delete(`${DELETE_zg-upper(((zg-entity...zg-name)))_URL}/${id}`))
  return axios.all(requests).then(() => {})
}

export {getzg-pluralize(((zg-entity...zg-name))), delete[[[zg-entity...zg-name]]], deleteSelectedzg-pluralize(((zg-entity...zg-name))), get[[[zg-entity...zg-name]]]ById, create[[[zg-entity...zg-name]]], update[[[zg-entity...zg-name]]]}

```

### *<mark style="color:blue;">Output Example</mark>*

```
// folder
--> expenses-list
```

```typescript
// file
// _requests.ts
import axios, {AxiosResponse} from 'axios'
import {ID, Response} from '../../../../../_metronic/helpers'
import {Expense, ExpensesQueryResponse} from './_models'

const API_URL = process.env.REACT_APP_API_URL
const GET_EXPENSE_URL = `${API_URL}/expense/getexpense`
const CREATE_EXPENSE_URL = `${API_URL}/expense/addexpense`
const UPDATE_EXPENSE_URL = `${API_URL}/expense/updateexpense`
const DELETE_EXPENSE_URL = `${API_URL}/expense/deleteexpense`
const GET_EXPENSES_URL = `${API_URL}/expense/getexpenses`

const getExpenses = (query: string): Promise<ExpensesQueryResponse> => {
  return axios
    .get(`${GET_EXPENSES_URL}?${query}`)
    .then((d: AxiosResponse<ExpensesQueryResponse>) => d.data)
}

const getExpenseById = (id: ID): Promise<Expense | undefined> => {
  return axios
    .get(`${GET_EXPENSE_URL}/${id}`)
    .then((response: AxiosResponse<Response<Expense>>) => response.data)
    .then((response: Response<Expense>) => response.data)
}

const createExpense = (expense: Expense): Promise<Expense | undefined> => {
  return axios
    .post(CREATE_EXPENSE_URL, expense)
    .then((response: AxiosResponse<Response<Expense>>) => response.data)
    .then((response: Response<Expense>) => response.data)
}

const updateExpense = (expense: Expense): Promise<Expense | undefined> => {
  return axios
    .put(`${UPDATE_EXPENSE_URL}/${expense.id}`, expense)
    .then((response: AxiosResponse<Response<Expense>>) => response.data)
    .then((response: Response<Expense>) => response.data)
}

const deleteExpense = (expenseId: ID): Promise<void> => {
  return axios.delete(`${DELETE_EXPENSE_URL}/${expenseId}`).then(() => {})
}

const deleteSelectedExpenses = (expenseIds: Array<ID>): Promise<void> => {
  const requests = expenseIds.map((id) => axios.delete(`${DELETE_EXPENSE_URL}/${id}`))
  return axios.all(requests).then(() => {})
}

export {getExpenses, deleteExpense, deleteSelectedExpenses, getExpenseById, createExpense, updateExpense}

```

```
// folder
--> expensetypes-list
```

```typescript
// file
// _requests.ts
import axios, {AxiosResponse} from 'axios'
import {ID, Response} from '../../../../../_metronic/helpers'
import {ExpenseType, ExpenseTypesQueryResponse} from './_models'

const API_URL = process.env.REACT_APP_API_URL
const GET_EXPENSETYPE_URL = `${API_URL}/expensetype/getexpensetype`
const CREATE_EXPENSETYPE_URL = `${API_URL}/expensetype/addexpensetype`
const UPDATE_EXPENSETYPE_URL = `${API_URL}/expensetype/updateexpensetype`
const DELETE_EXPENSETYPE_URL = `${API_URL}/expensetype/deleteexpensetype`
const GET_EXPENSETYPES_URL = `${API_URL}/expensetype/getexpensetypes`

const getExpenseTypes = (query: string): Promise<ExpenseTypesQueryResponse> => {
  return axios
    .get(`${GET_EXPENSETYPES_URL}?${query}`)
    .then((d: AxiosResponse<ExpenseTypesQueryResponse>) => d.data)
}

const getExpenseTypeById = (id: ID): Promise<ExpenseType | undefined> => {
  return axios
    .get(`${GET_EXPENSETYPE_URL}/${id}`)
    .then((response: AxiosResponse<Response<ExpenseType>>) => response.data)
    .then((response: Response<ExpenseType>) => response.data)
}

const createExpenseType = (expensetype: ExpenseType): Promise<ExpenseType | undefined> => {
  return axios
    .post(CREATE_EXPENSETYPE_URL, expensetype)
    .then((response: AxiosResponse<Response<ExpenseType>>) => response.data)
    .then((response: Response<ExpenseType>) => response.data)
}

const updateExpenseType = (expensetype: ExpenseType): Promise<ExpenseType | undefined> => {
  return axios
    .put(`${UPDATE_EXPENSETYPE_URL}/${expensetype.id}`, expensetype)
    .then((response: AxiosResponse<Response<ExpenseType>>) => response.data)
    .then((response: Response<ExpenseType>) => response.data)
}

const deleteExpenseType = (expensetypeId: ID): Promise<void> => {
  return axios.delete(`${DELETE_EXPENSETYPE_URL}/${expensetypeId}`).then(() => {})
}

const deleteSelectedExpenseTypes = (expensetypeIds: Array<ID>): Promise<void> => {
  const requests = expensetypeIds.map((id) => axios.delete(`${DELETE_EXPENSETYPE_URL}/${id}`))
  return axios.all(requests).then(() => {})
}

export {getExpenseTypes, deleteExpenseType, deleteSelectedExpenseTypes, getExpenseTypeById, createExpenseType, updateExpenseType}

```

{% hint style="info" %}
*<mark style="color:blue;">**Good to know:**</mark>* *ziref is used for code files hold in a folder for each entity.*
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zontroy.com/zontroy-offline-code-generator/zontroy-ai-offline-file-types/zontroy-ai-offline-inner-repeating-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
