Zontroy AI
  • 🖌️Getting started with Zontroy AI
  • INTRODUCTION
    • Zontroy AI
    • Why Choose Zontroy AI?
      • Free AI Models Integration
      • Free for Students
      • Technical Advantages
      • The Developer's Choice
    • Zontroy AI Quick Start
    • Zontroy AI Chat
    • Zontroy AI Collaborator
    • Zontroy AI Peerer
    • Zontroy AI Model Context Protocol (MCP)
  • Zontroy Offline Code Generator
    • Zontroy Offline Code Generator
      • Oprazi .zproject file for MSSQL
      • CrudwithGo .zproject file for MySQL
      • Course-management .zproject file for Entity
      • JavaCodeGenerator .zproject file for PostgreSQL
    • Zontroy AI Offline File Types
      • Zontroy AI Offline Single File
      • Zontroy AI Offline Repeating File
      • Zontroy AI Offline Inner Repeating File
    • Zontroy AI Offline Code Generator Tutorial
      • Zontroy Syntax
      • zg-entity
      • zg-entities
      • zg-if
      • zg-for
      • Data Type Conversion
      • Built-in Functions
  • Zontroy AI Models
    • Supported AI Models
      • OpenAI
      • Anthropic (Claude)
      • DeepSeek
      • Google (Gemini)
      • Qwen
      • xAI
      • Llama
      • OpenRouter
    • Selecting the Optimal Model for Different Tasks
  • Zontroy AI How To
    • Javascript
    • Typescript
    • Java
    • Python
    • CSharp
    • PHP
Powered by GitBook
On this page
  • ziref
  • Folder Naming Format
  • File Naming Format
  • Folder Naming Example
  • File Naming Example
  • Code Example
  • Output Example
  1. Zontroy Offline Code Generator
  2. Zontroy AI Offline File Types

Zontroy AI Offline Inner Repeating File

PreviousZontroy AI Offline Repeating FileNextZontroy AI Offline Code Generator Tutorial

Last updated 29 days ago

ziref

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.

Folder Naming Format

[folder_name].ziref

File Naming Format

[file_name].[file_extension].ziref

Folder Naming Example

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

File Naming Example

MyClass.java.ziref

Code Example

A simple usage example of ziref file in Typescript.

// folder name
zg-l(((zg-p(((zg-entity...zg-name))))))-list.ziref
// 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]]]}

Output Example

// folder
--> expenses-list
// 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
// 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}

Good to know: ziref is used for code files hold in a folder for each entity.

Multiple entities to multiple folders and code files