Items as files¶
Every item of an account is a folder of files in its Git repository and in the folder of the local client. An AI agent which adds a custom API, a hook or a scheduler writes these files : this page says which files each kind has, what is in each one, and what makes an item new. Pick your language in the tabs : the files of the code follow it.
In short
src/<kind>/<item>/holds<item>.yaml(the item, without its code),<item>.<ts|py|php|cs|go|rs|java|kt>(its code : the extension is its language) and, for a few kinds,<item>.config.ts(its settings, TypeScript in every language).- A new item has no
_idand noguid: API Maker gives them. Code next to the YAML is read when the YAML listsversionswith one version"-1". - Run the local client (
npm run start) : a saved folder is checked and saved the way the admin panel saves it, and✗ Not applied on server : …says what is wrong.
The whole tree¶
A repository with one item of each kind, its code in the language of the tab :
AGENTS.md the guide for AI agents, written by API Maker
package.json tsconfig.json am-types/types.ts localClient.js written by API Maker
src/
custom_apis/shippingCost/
shippingCost.yaml name, path, versions and their hooks (no code)
shippingCost.config.ts path, method, access, schemas : TypeScript in every language
shippingCost.ts the code
pre-hooks/check_weight.ts a hook of the API, named in versions[].preHooks
collection_hooks/Row_scope-orders/ one folder per hook
Row_scope-orders.yaml its table, pre or post, its order
Row_scope-orders.ts
events/Order_placed/
Order_placed.yaml its listeners, its triggers
listeners/Notify_the_shop/Notify_the_shop.ts
web_socket_events/defaultorders-updated/ the event default/orders-updated
defaultorders-updated.yaml
defaultorders-updated.ts who may subscribe
schedulers/Clean_old_carts/
Clean_old_carts.yaml intervals, isActive
Clean_old_carts.ts
database_migrations/Add_description/
Add_description.yaml label, order, active
Add_description.ts
process_initializers/Load_rates/
Load_rates.yaml order
Load_rates.ts
utility_classes/utils---Money/ the class Money of the folder utils/
Money.yaml
Money.ts
test_cases/Shipping_cost/
Shipping_cost.yaml what it tests, its mocks
Shipping_cost.ts the tests
schemas/<guid>/ a table : its YAML and <guid>.config.ts
instance_api_settings/orders/ settings of a table : orders.yaml, orders.config.ts
system_api_settings/HASH_DATA/ settings of a system API : HASH_DATA.yaml, HASH_DATA.config.ts
auth_providers/default_db_login/
default_db_login.yaml
default_db_login.ts what the provider is : TypeScript in every language
default_db_login.fg.ts its fields generator
groups/Shop_app/Shop_app.yaml
api_users/shop_app/shop_app.yaml
instances/mongodb/mongodb.yaml
i18ns/hindi/hindi.yaml hindi.ts
admin_user/data.yaml sandboxes : runtimes, versions, packages
ssr/<website>/ an SSR website, in TypeScript
types/db-interfaces.d.ts api_security_report/ auto_increments/ written by API Maker
AGENTS.md the guide for AI agents, written by API Maker
package.json tsconfig.json am-types/types.ts localClient.js written by API Maker
pyproject.toml the project of the language, written by API Maker
src/
custom_apis/shippingCost/
shippingCost.yaml name, path, versions and their hooks (no code)
shippingCost.config.ts path, method, access, schemas : TypeScript in every language
shippingCost.py the code
pre-hooks/check_weight.py a hook of the API, named in versions[].preHooks
collection_hooks/Row_scope-orders/ one folder per hook
Row_scope-orders.yaml its table, pre or post, its order
Row_scope-orders.py
events/Order_placed/
Order_placed.yaml its listeners, its triggers
listeners/Notify_the_shop/Notify_the_shop.py
web_socket_events/defaultorders-updated/ the event default/orders-updated
defaultorders-updated.yaml
defaultorders-updated.py who may subscribe
schedulers/Clean_old_carts/
Clean_old_carts.yaml intervals, isActive
Clean_old_carts.py
database_migrations/Add_description/
Add_description.yaml label, order, active
Add_description.py
process_initializers/Load_rates/
Load_rates.yaml order
Load_rates.py
utility_classes/utils---Money/ the class Money of the folder utils/
Money.yaml
Money.py
test_cases/Shipping_cost/
Shipping_cost.yaml what it tests, its mocks
Shipping_cost.py the tests
schemas/<guid>/ a table : its YAML and <guid>.config.ts
instance_api_settings/orders/ settings of a table : orders.yaml, orders.config.ts
system_api_settings/HASH_DATA/ settings of a system API : HASH_DATA.yaml, HASH_DATA.config.ts
auth_providers/default_db_login/
default_db_login.yaml
default_db_login.ts what the provider is : TypeScript in every language
default_db_login.fg.py its fields generator
groups/Shop_app/Shop_app.yaml
api_users/shop_app/shop_app.yaml
instances/mongodb/mongodb.yaml
i18ns/hindi/hindi.yaml hindi.ts
admin_user/data.yaml sandboxes : runtimes, versions, packages
ssr/<website>/ an SSR website, in TypeScript
types/db-interfaces.d.ts api_security_report/ auto_increments/ written by API Maker
AGENTS.md the guide for AI agents, written by API Maker
package.json tsconfig.json am-types/types.ts localClient.js written by API Maker
composer.json the project of the language, written by API Maker
src/
custom_apis/shippingCost/
shippingCost.yaml name, path, versions and their hooks (no code)
shippingCost.config.ts path, method, access, schemas : TypeScript in every language
shippingCost.php the code
pre-hooks/check_weight.php a hook of the API, named in versions[].preHooks
collection_hooks/Row_scope-orders/ one folder per hook
Row_scope-orders.yaml its table, pre or post, its order
Row_scope-orders.php
events/Order_placed/
Order_placed.yaml its listeners, its triggers
listeners/Notify_the_shop/Notify_the_shop.php
web_socket_events/defaultorders-updated/ the event default/orders-updated
defaultorders-updated.yaml
defaultorders-updated.php who may subscribe
schedulers/Clean_old_carts/
Clean_old_carts.yaml intervals, isActive
Clean_old_carts.php
database_migrations/Add_description/
Add_description.yaml label, order, active
Add_description.php
process_initializers/Load_rates/
Load_rates.yaml order
Load_rates.php
utility_classes/utils---Money/ the class Money of the folder utils/
Money.yaml
Money.php
test_cases/Shipping_cost/
Shipping_cost.yaml what it tests, its mocks
Shipping_cost.php the tests
schemas/<guid>/ a table : its YAML and <guid>.config.ts
instance_api_settings/orders/ settings of a table : orders.yaml, orders.config.ts
system_api_settings/HASH_DATA/ settings of a system API : HASH_DATA.yaml, HASH_DATA.config.ts
auth_providers/default_db_login/
default_db_login.yaml
default_db_login.ts what the provider is : TypeScript in every language
default_db_login.fg.php its fields generator
groups/Shop_app/Shop_app.yaml
api_users/shop_app/shop_app.yaml
instances/mongodb/mongodb.yaml
i18ns/hindi/hindi.yaml hindi.ts
admin_user/data.yaml sandboxes : runtimes, versions, packages
ssr/<website>/ an SSR website, in TypeScript
types/db-interfaces.d.ts api_security_report/ auto_increments/ written by API Maker
AGENTS.md the guide for AI agents, written by API Maker
package.json tsconfig.json am-types/types.ts localClient.js written by API Maker
ApiMaker.csproj am/dotnet/ the project of the language, written by API Maker
src/
custom_apis/shippingCost/
shippingCost.yaml name, path, versions and their hooks (no code)
shippingCost.config.ts path, method, access, schemas : TypeScript in every language
shippingCost.cs the code
pre-hooks/check_weight.cs a hook of the API, named in versions[].preHooks
collection_hooks/Row_scope-orders/ one folder per hook
Row_scope-orders.yaml its table, pre or post, its order
Row_scope-orders.cs
events/Order_placed/
Order_placed.yaml its listeners, its triggers
listeners/Notify_the_shop/Notify_the_shop.cs
web_socket_events/defaultorders-updated/ the event default/orders-updated
defaultorders-updated.yaml
defaultorders-updated.cs who may subscribe
schedulers/Clean_old_carts/
Clean_old_carts.yaml intervals, isActive
Clean_old_carts.cs
database_migrations/Add_description/
Add_description.yaml label, order, active
Add_description.cs
process_initializers/Load_rates/
Load_rates.yaml order
Load_rates.cs
utility_classes/utils---Money/ the class Money of the folder utils/
Money.yaml
Money.cs
test_cases/Shipping_cost/
Shipping_cost.yaml what it tests, its mocks
Shipping_cost.cs the tests
schemas/<guid>/ a table : its YAML and <guid>.config.ts
instance_api_settings/orders/ settings of a table : orders.yaml, orders.config.ts
system_api_settings/HASH_DATA/ settings of a system API : HASH_DATA.yaml, HASH_DATA.config.ts
auth_providers/default_db_login/
default_db_login.yaml
default_db_login.ts what the provider is : TypeScript in every language
default_db_login.fg.cs its fields generator
groups/Shop_app/Shop_app.yaml
api_users/shop_app/shop_app.yaml
instances/mongodb/mongodb.yaml
i18ns/hindi/hindi.yaml hindi.ts
admin_user/data.yaml sandboxes : runtimes, versions, packages
ssr/<website>/ an SSR website, in TypeScript
types/db-interfaces.d.ts api_security_report/ auto_increments/ written by API Maker
AGENTS.md the guide for AI agents, written by API Maker
package.json tsconfig.json am-types/types.ts localClient.js written by API Maker
go.mod am/am.go am/methods.go the project of the language, written by API Maker
src/
custom_apis/shippingCost/
shippingCost.yaml name, path, versions and their hooks (no code)
shippingCost.config.ts path, method, access, schemas : TypeScript in every language
shippingCost.go the code
pre-hooks/check_weight/check_weight.go a hook of the API, named in versions[].preHooks
collection_hooks/Row_scope-orders/ one folder per hook
Row_scope-orders.yaml its table, pre or post, its order
Row_scope-orders.go
events/Order_placed/
Order_placed.yaml its listeners, its triggers
listeners/Notify_the_shop/Notify_the_shop.go
web_socket_events/defaultorders-updated/ the event default/orders-updated
defaultorders-updated.yaml
defaultorders-updated.go who may subscribe
schedulers/Clean_old_carts/
Clean_old_carts.yaml intervals, isActive
Clean_old_carts.go
database_migrations/Add_description/
Add_description.yaml label, order, active
Add_description.go
process_initializers/Load_rates/
Load_rates.yaml order
Load_rates.go
utility_classes/utils---Money/ the class Money of the folder utils/
Money.yaml
Money.go
test_cases/Shipping_cost/
Shipping_cost.yaml what it tests, its mocks
Shipping_cost.go the tests
schemas/<guid>/ a table : its YAML and <guid>.config.ts
instance_api_settings/orders/ settings of a table : orders.yaml, orders.config.ts
system_api_settings/HASH_DATA/ settings of a system API : HASH_DATA.yaml, HASH_DATA.config.ts
auth_providers/default_db_login/
default_db_login.yaml
default_db_login.ts what the provider is : TypeScript in every language
default_db_login.fg/default_db_login.fg.go its fields generator
groups/Shop_app/Shop_app.yaml
api_users/shop_app/shop_app.yaml
instances/mongodb/mongodb.yaml
i18ns/hindi/hindi.yaml hindi.ts
admin_user/data.yaml sandboxes : runtimes, versions, packages
ssr/<website>/ an SSR website, in TypeScript
types/db-interfaces.d.ts api_security_report/ auto_increments/ written by API Maker
AGENTS.md the guide for AI agents, written by API Maker
package.json tsconfig.json am-types/types.ts localClient.js written by API Maker
Cargo.toml am/rust/ (project.rs names every .rs file as a module) the project of the language, written by API Maker
src/
custom_apis/shippingCost/
shippingCost.yaml name, path, versions and their hooks (no code)
shippingCost.config.ts path, method, access, schemas : TypeScript in every language
shippingCost.rs the code
pre-hooks/check_weight.rs a hook of the API, named in versions[].preHooks
collection_hooks/Row_scope-orders/ one folder per hook
Row_scope-orders.yaml its table, pre or post, its order
Row_scope-orders.rs
events/Order_placed/
Order_placed.yaml its listeners, its triggers
listeners/Notify_the_shop/Notify_the_shop.rs
web_socket_events/defaultorders-updated/ the event default/orders-updated
defaultorders-updated.yaml
defaultorders-updated.rs who may subscribe
schedulers/Clean_old_carts/
Clean_old_carts.yaml intervals, isActive
Clean_old_carts.rs
database_migrations/Add_description/
Add_description.yaml label, order, active
Add_description.rs
process_initializers/Load_rates/
Load_rates.yaml order
Load_rates.rs
utility_classes/utils---Money/ the class Money of the folder utils/
Money.yaml
Money.rs
test_cases/Shipping_cost/
Shipping_cost.yaml what it tests, its mocks
Shipping_cost.rs the tests
schemas/<guid>/ a table : its YAML and <guid>.config.ts
instance_api_settings/orders/ settings of a table : orders.yaml, orders.config.ts
system_api_settings/HASH_DATA/ settings of a system API : HASH_DATA.yaml, HASH_DATA.config.ts
auth_providers/default_db_login/
default_db_login.yaml
default_db_login.ts what the provider is : TypeScript in every language
default_db_login.fg.rs its fields generator
groups/Shop_app/Shop_app.yaml
api_users/shop_app/shop_app.yaml
instances/mongodb/mongodb.yaml
i18ns/hindi/hindi.yaml hindi.ts
admin_user/data.yaml sandboxes : runtimes, versions, packages
ssr/<website>/ an SSR website, in TypeScript
types/db-interfaces.d.ts api_security_report/ auto_increments/ written by API Maker
AGENTS.md the guide for AI agents, written by API Maker
package.json tsconfig.json am-types/types.ts localClient.js written by API Maker
settings.gradle.kts am/java/build.gradle.kts am/jvm/am/ the project of the language, written by API Maker
src/
custom_apis/shippingCost/
shippingCost.yaml name, path, versions and their hooks (no code)
shippingCost.config.ts path, method, access, schemas : TypeScript in every language
shippingCost.java the code
pre-hooks/check_weight/check_weight.java a hook of the API, named in versions[].preHooks
collection_hooks/Row_scope-orders/ one folder per hook
Row_scope-orders.yaml its table, pre or post, its order
Row_scope-orders.java
events/Order_placed/
Order_placed.yaml its listeners, its triggers
listeners/Notify_the_shop/Notify_the_shop.java
web_socket_events/defaultorders-updated/ the event default/orders-updated
defaultorders-updated.yaml
defaultorders-updated.java who may subscribe
schedulers/Clean_old_carts/
Clean_old_carts.yaml intervals, isActive
Clean_old_carts.java
database_migrations/Add_description/
Add_description.yaml label, order, active
Add_description.java
process_initializers/Load_rates/
Load_rates.yaml order
Load_rates.java
utility_classes/utils---Money/ the class Money of the folder utils/
Money.yaml
Money.java
test_cases/Shipping_cost/
Shipping_cost.yaml what it tests, its mocks
Shipping_cost.java the tests
schemas/<guid>/ a table : its YAML and <guid>.config.ts
instance_api_settings/orders/ settings of a table : orders.yaml, orders.config.ts
system_api_settings/HASH_DATA/ settings of a system API : HASH_DATA.yaml, HASH_DATA.config.ts
auth_providers/default_db_login/
default_db_login.yaml
default_db_login.ts what the provider is : TypeScript in every language
default_db_login.fg/default_db_login.fg.java its fields generator
groups/Shop_app/Shop_app.yaml
api_users/shop_app/shop_app.yaml
instances/mongodb/mongodb.yaml
i18ns/hindi/hindi.yaml hindi.ts
admin_user/data.yaml sandboxes : runtimes, versions, packages
ssr/<website>/ an SSR website, in TypeScript
types/db-interfaces.d.ts api_security_report/ auto_increments/ written by API Maker
AGENTS.md the guide for AI agents, written by API Maker
package.json tsconfig.json am-types/types.ts localClient.js written by API Maker
settings.gradle.kts am/kotlin/build.gradle.kts am/jvm/am/ the project of the language, written by API Maker
src/
custom_apis/shippingCost/
shippingCost.yaml name, path, versions and their hooks (no code)
shippingCost.config.ts path, method, access, schemas : TypeScript in every language
shippingCost.kt the code
pre-hooks/check_weight/check_weight.kt a hook of the API, named in versions[].preHooks
collection_hooks/Row_scope-orders/ one folder per hook
Row_scope-orders.yaml its table, pre or post, its order
Row_scope-orders.kt
events/Order_placed/
Order_placed.yaml its listeners, its triggers
listeners/Notify_the_shop/Notify_the_shop.kt
web_socket_events/defaultorders-updated/ the event default/orders-updated
defaultorders-updated.yaml
defaultorders-updated.kt who may subscribe
schedulers/Clean_old_carts/
Clean_old_carts.yaml intervals, isActive
Clean_old_carts.kt
database_migrations/Add_description/
Add_description.yaml label, order, active
Add_description.kt
process_initializers/Load_rates/
Load_rates.yaml order
Load_rates.kt
utility_classes/utils---Money/ the class Money of the folder utils/
Money.yaml
Money.kt
test_cases/Shipping_cost/
Shipping_cost.yaml what it tests, its mocks
Shipping_cost.kt the tests
schemas/<guid>/ a table : its YAML and <guid>.config.ts
instance_api_settings/orders/ settings of a table : orders.yaml, orders.config.ts
system_api_settings/HASH_DATA/ settings of a system API : HASH_DATA.yaml, HASH_DATA.config.ts
auth_providers/default_db_login/
default_db_login.yaml
default_db_login.ts what the provider is : TypeScript in every language
default_db_login.fg/default_db_login.fg.kt its fields generator
groups/Shop_app/Shop_app.yaml
api_users/shop_app/shop_app.yaml
instances/mongodb/mongodb.yaml
i18ns/hindi/hindi.yaml hindi.ts
admin_user/data.yaml sandboxes : runtimes, versions, packages
ssr/<website>/ an SSR website, in TypeScript
types/db-interfaces.d.ts api_security_report/ auto_increments/ written by API Maker
The rules of every item¶
Folders and file names¶
| Rule | Example |
|---|---|
One folder per kind in src, the kind in small letters with _ |
src/custom_apis, src/web_socket_events |
One folder per item : its name, where what is no letter, digit, ., - or _ is written _ |
the scheduler Daily report is src/schedulers/Daily_report/ |
- and -- between the parts of a name lose their spaces |
the hook Row scope - orders is Row_scope-orders/ |
| The files of an item are named as its folder | Daily_report/Daily_report.yaml, Daily_report/Daily_report.py |
The name itself is name: in the YAML : nothing is read back from the folder |
name: Daily report |
- A utility class is its folder with
-for/, then--, then its name : the classMoneyof the folderutils/issrc/utility_classes/utils---Money/(ofcloud/db/:cloud-db---Money/), its YAMLMoney.yaml, its codeMoney.<extension>. - A schema is the folder of its guid when API Maker writes it. A new one can have any folder (the name of its table) : the next commit writes it under its guid.
- The settings of a system API are the folder of the API :
src/system_api_settings/GET_TOKEN/. A WebSocket event is its name without/and@:default/orders-updatedisdefaultorders-updated/. - Two hooks of one name : the second one gets its table, then a number (
Check_access,Check_access--orders). See Hooks in Git.
The YAML¶
- The item as the admin panel saves it, without its code and without the keys of its settings file. Write the keys this page shows for its kind ; API Maker writes the others back with their defaults.
- A new item : no
_idand noguid. A guid copied from another item replaces that item : never copy a folder with its guid. - The language of the code is the extension of its file :
orders.pynext toorders.yamlis Python.codeLanguage: pythonin the YAML says the same, and wins over the extension.
The code¶
- One function
mainin each file, which getsg: what it returns is the answer. The code blocks of this page show it in each language ; the global object g has every call. - An API and all its hooks are one language. In Go, Java and Kotlin, a piece of code which shares a folder with other code (the hooks of a custom API, the functions of an auth provider) is in a folder named as its file :
pre-hooks/check_weight/check_weight.go. - A file of Go never ends as Go reads names :
orders_testis writtenorders_test_.go.
Versions¶
versionsin the YAML is the list of the versions of the code. One version"-1"(namedOriginal) : the code is<item>.<extension>, next to the YAML.- Several versions :
versions/<version>/<Name_of_the_version>.<extension>, its hooks inversions/<version>/pre-hooks/andpost-hooks/, andisActive: trueon the version which runs.
The settings¶
<item>.config.tsfor a custom API, a schema and the settings of a database, a table, an API or a system API ;<item>.tsfor an auth provider and for texts (i18n). They are TypeScript in every language : API Maker runs them itself when it saves. Each exports one object :module.exports = customApi;.- The settings file wins over the YAML for the keys it has : the
name,path,requestMethod,apiAccessType… of a custom API, the columns of an auth provider. Keepnamethe same in both : it names the folder.
Files API Maker writes : never edit them¶
AGENTS.md (the block of API Maker), am-types/types.ts, src/types/db-interfaces.d.ts, localClient.js, package.json, tsconfig.json, pyproject.toml, composer.json, go.mod, Cargo.toml, ApiMaker.csproj, settings.gradle.kts, am/, src/api_security_report/, src/auto_increments/. A package goes into src/admin_user/data.yaml : see Packages.
Check a change¶
- With the local client :
npm run startsends each saved folder, and the server answers✓ Saved on serveror✗ Not applied on server : <errors>. Deleting the folder of an item deletes the item. npm run testruns the test cases of the account with the code of the folder.- The compiler of the language, offline :
Every kind at a glance¶
| Kind | Folder in src |
Files | Code |
|---|---|---|---|
| Custom API | custom_apis/ |
YAML, .config.ts, code, .docs.json, pre-hooks/, post-hooks/, versions/ |
main, the answer |
| Hook of an instance, a database, a table, an API, a system API | instance_hooks/, database_hooks/, collection_hooks/, instance_api_hooks/, system_api_hooks/ |
YAML, code : one folder per hook | main, before or after the APIs |
| Event | events/ |
YAML, listeners/<listener>/<listener>.<ext> |
one main per listener |
| WebSocket event | web_socket_events/ |
YAML, code | who may subscribe |
| Scheduler | schedulers/ |
YAML, code | the job |
| Database migration | database_migrations/ |
YAML, code | runs once per environment, after a pull |
| Process initializer | process_initializers/ |
YAML, code | runs once per runner, when it starts |
| Utility class | utility_classes/ |
YAML, code | shared by the code of its language |
| Test case | test_cases/ |
YAML, code | the tests |
| Schema | schemas/ |
YAML, .config.ts |
none : TypeScript settings |
| Settings of a database, a table, an API | instance_api_settings/ |
YAML, .config.ts |
none |
| Settings of a system API | system_api_settings/ |
YAML, .config.ts |
none |
| Auth provider | auth_providers/ |
YAML, .ts, .fg.<ext>, .tg.<ext>, .tv.<ext> |
the functions of the provider |
| Group, API user, instance | groups/, api_users/, instances/ |
YAML | none |
| Texts, log profiles, saved requests | i18ns/, log_profiles/, api_testing_states/ |
YAML, and .ts for texts |
none |
| Packages and sandboxes | admin_user/ |
data.yaml, sandbox/<family>/Dockerfile |
none |
| SSR website | ssr/<website>/ |
a project of TypeScript | pages |
Custom API¶
A function behind a path and a method : see Custom APIs. The custom API shippingCost gives the cost of a parcel from the rates table ; the test case below tests it.
name: shippingCost # the same name as in shippingCost.config.ts : it names the folder and the files
path: /shipping-cost # as in the settings file, which wins
versions:
- name: Original
version: "-1" # "-1" : the code is the file next to this one, shippingCost.<extension>
isActive: true
preHooks: [] # the hooks of the API, see below
postHooks: []
| src/custom_apis/shippingCost/shippingCost.py | |
|---|---|
| src/custom_apis/shippingCost/shippingCost.php | |
|---|---|
- Its hooks are named in the version they run with, and their code is in
pre-hooks/andpost-hooks/of the folder of the API :preHooks: [{ name: check_weight, isActive: true }]ispre-hooks/check_weight.<extension>(in Go, Java and Kotlinpre-hooks/check_weight/check_weight.<extension>). A hook of an API is in the language of the API ;groupNameson a hook runs it for the API users of those groups only. - Its docs (the Docs tab) are
shippingCost.docs.json, which the panel writes. An API without docs has no such file. - Its path is unique with its method, and its
nameis unique in the account.
Hooks¶
The hooks of an instance, a database, a table, an API of a table and a system API are a folder each, named by the hook. See Pre hooks and Post hooks.
| Hook of | Folder in src |
Where it runs : keys of its YAML |
|---|---|---|
| An instance | instance_hooks/ |
instanceName |
| A database | database_hooks/ |
instanceName, databaseName |
| A table | collection_hooks/ |
instanceName, databaseName, collectionName |
| One API of a table | instance_api_hooks/ |
instanceName, databaseName, collectionName, apiId (SCHEMA_GET_ALL, GEN_POST_QUERY…) |
| A system API | system_api_hooks/ |
apiId (GET_TOKEN…) |
name: Row scope - orders # the folder : Row_scope-orders
instanceName: mongodb # where it runs : the table orders
databaseName: shop
collectionName: orders
hookType: pre # pre : before the APIs of the table ; post : after them
order: 1 # its place among the pre hooks of the table, from 1
isActive: true
groupNames: [Shop app] # only for the API users of these groups ; leave it out for all of them
- A new hook needs no
_idand noguid: it joins the other hooks of its place. Delete its folder and the hook goes. - The code is
Row_scope-orders.<extension>, next to its YAML, in every language : a hook of a table is alone in its folder.
- The code which keeps each person to its own rows is on Narrow a request to the rows of the caller, in every language. A table which people read through an application needs it before its first API user : the security report says where it is missing.
Event¶
An event has listeners, each one a folder of code under listeners/. See Events.
name: Order placed # g.sys.system.emitEvent('Order placed', data) emits it
isAutomaticallyTriggerOnApiHit: false # true : emitted after each successful call of the APIs of triggerOnApis
triggerOnApis: []
eventListeners:
- name: Notify the shop # its code : listeners/Notify_the_shop/Notify_the_shop.<extension>
versions:
- name: Original
version: "-1"
isActive: true
| src/events/Order_placed/listeners/Notify_the_shop/Notify_the_shop.py | |
|---|---|
| src/events/Order_placed/listeners/Notify_the_shop/Notify_the_shop.php | |
|---|---|
- A listener is a folder of its own in every language :
listeners/<listener>/<listener>.<extension>. - To emit it after a call of an API instead of from code :
isAutomaticallyTriggerOnApiHit: true, and the API intriggerOnApis({ apiCategory: CUSTOM_APIS, customApiName: shippingCost }, or an API of a table withinstanceName,databaseName,collectionName,instanceApiName).
WebSocket event¶
A custom WebSocket event, emitted by g.sys.system.emitEventWS. Its code says who may subscribe. See WebSocket events.
name: default/orders-updated # the folder is the name without its /
apiCategory: WEB_SOCKET_EVENT
authProviders: [default_db_login] # a client subscribes with a person token of these providers
versions:
- name: Original
version: "-1"
isActive: true
| src/web_socket_events/defaultorders-updated/defaultorders-updated.ts | |
|---|---|
| src/web_socket_events/defaultorders-updated/defaultorders-updated.py | |
|---|---|
| src/web_socket_events/defaultorders-updated/defaultorders-updated.php | |
|---|---|
| src/web_socket_events/defaultorders-updated/defaultorders-updated.cs | |
|---|---|
| src/web_socket_events/defaultorders-updated/defaultorders-updated.kt | |
|---|---|
Scheduler¶
Code which runs on a timetable. See Schedulers.
name: Clean old carts
isActive: true # the switch of the whole scheduler
intervalArr:
- timeInterval: 0 30 2 * * * # cron, seconds first : every day at 02:30
timeZone: Asia/Kolkata
active: true # each interval has its own switch
schedulerTimeoutInMinutes: 10
versions:
- name: Original
version: "-1"
isActive: true
Database migration¶
A script which runs once on each environment, after the pull which brings it. See Database migration.
name: Add description
label: Add the column description to order_transactions # what the list of scripts shows
order: 1 # the pull runs the scripts which never ran here, from the lowest order
active: true
dbMigrationTimeoutInMinutes: 10
- Write a script which can run twice without harm : a script which failed half way runs again after the fix.
Process initializer¶
Code which runs once in each runner of the sandboxes of the account, when it starts. See Process initializers.
name: Load rates
order: 1 # the initializers run one after the other, from the lowest order
active: true
processInitializerTimeoutInMinutes: 1
| src/process_initializers/Load_rates/Load_rates.py | |
|---|---|
| src/process_initializers/Load_rates/Load_rates.php | |
|---|---|
| src/process_initializers/Load_rates/Load_rates.kt | |
|---|---|
Utility class¶
Code which the other code of its language imports. See Utility classes.
name: Money # what the code imports ; the file is named Money.yaml, not as the folder
folderPath: utils/ # its folder in the list : the folder in git is utils---Money
versions:
- name: Original
version: "-1" # the code is Money.<extension>, next to this file
isActive: true
The class is src/utility_classes/utils---Money/Money.ts, imported as utils/Money.
| The utility class Money, in the folder utils | |
|---|---|
The class is src/utility_classes/utils---Money/Money.py, the module Money.
The class is src/utility_classes/utils---Money/Money.php : what it declares is there for the code of PHP.
| The utility class Money, in the folder utils | |
|---|---|
The class is src/utility_classes/utils---Money/Money.cs, compiled with the code.
| The utility class Money, in the folder utils | |
|---|---|
The class is src/utility_classes/utils---Money/Money.go, a package imported by its folder.
| The utility class Money, in the folder utils | |
|---|---|
The class is src/utility_classes/utils---Money/Money.rs, the module Money of the crate of the code.
| The utility class Money, in the folder utils | |
|---|---|
The class is src/utility_classes/utils---Money/Money.java, compiled with the other classes of Java.
| The utility class Money, in the folder utils | |
|---|---|
The class is src/utility_classes/utils---Money/Money.kt, compiled with the other classes of Kotlin.
| The utility class Money, in the folder utils | |
|---|---|
- A class is used by the code of its own language only.
Test case¶
The tests of a custom API or of a utility class, run by npm run test and the Test Cases page. See Test cases.
name: Shipping cost
testCaseType: CUSTOM_APIS # UTILITY_CLASS with utilityClassName for a utility class
customApiName: shippingCost # the custom API it tests
mocks: [] # the mocks of the Mocks tab ; the code adds its own
The test case is src/test_cases/Shipping_cost/Shipping_cost.ts.
The test case is src/test_cases/Shipping_cost/Shipping_cost.py.
The test case is src/test_cases/Shipping_cost/Shipping_cost.php.
The test case is src/test_cases/Shipping_cost/Shipping_cost.cs.
The test case is src/test_cases/Shipping_cost/Shipping_cost.go.
The test case is src/test_cases/Shipping_cost/Shipping_cost.rs.
The test case is src/test_cases/Shipping_cost/Shipping_cost.java.
The test case is src/test_cases/Shipping_cost/Shipping_cost.kt.
- How each language names its tests : Test cases in every language.
Schema¶
The columns of a table, their checks and conversions, and the relations to other tables. TypeScript in every language. See Table schema.
instanceName: mongodb # the table the schema is for
databaseName: shop
collectionName: orders
active: true
- The YAML is named as the folder. API Maker writes a schema in the folder of its guid (
src/schemas/01M6NW232XSTGXXD4222CXZDM7/) : a new one goes in any folder, and the next commit writes it under its guid. src/types/db-interfaces.d.tsgets the interface of the table once the schema is saved (db.mongodb.shop.IOrders).
Settings of a database, a table, an API¶
Who may call the APIs of a table, their caching and their auth providers. See Collection settings.
name: orders # names the folder ; the guid of the settings when it has none
instanceName: mongodb
databaseName: shop
collectionName: orders
apiId: __COLLECTION_SETTINGS__ # the table ; SCHEMA_GET_ALL… : one API of it ;
# __DATABASE_SETTINGS__ here and in collectionName : the whole database
- A key left out is taken from the level above : API settings, then the table, then the database, then the secret.
Settings of a system API¶
apiId: HASH_DATA # the folder and the files are named by the API
| src/system_api_settings/HASH_DATA/HASH_DATA.config.ts | |
|---|---|
- The ids : System API settings.
Auth provider¶
Who the person behind a request is : a row of your users table, Google, Azure AD, AWS Cognito or your own code. See Auth of a database user.
name: default_db_login
generatorType: DB_TOKEN_GENERATOR # CUSTOM_TOKEN_GENERATOR, GOOGLE, AZURE, AWS : the other kinds
- Its functions are in the language of the provider, next to it :
default_db_login.fg.<extension>(the fields it adds to the token, may be empty), and for a provider of your own code<name>.tg.<extension>(it makes the token) and<name>.tv.<extension>(it checks one). In Go, Java and Kotlin each one is in a folder named as its file :my_tokens.tg/my_tokens.tg.go. Their code : A provider of your own.
Group, API user, instance¶
name: Shop app
apisRegex: # true : every item of a kind ; false : only the ones named below
allInstances: false
allDatabases: false
allCollections: false
allInstanceApis: false
allFields: true
allCustomApis: false
allSystemApis: false
allWebSocketEvents: false
queryParams: # the grants, by name
instanceNames: [mongodb]
databaseNames: [shop]
collectionNames: [products, orders]
supportedApiNames: [SCHEMA_GET_ALL, SCHEMA_GET_BY_ID, SCHEMA_POST_QUERY]
customApiNames: [shippingCost]
systemApiNames: []
webSocketEventNames: []
name: shop_app
username: shop_app
groupNames: [Shop app]
enablePasswordPath: true
apiUserPasswordPath: common.apiUserPasswords.shop_app # where the password is in the secret : never write password
name: mongodb
type: MONGO_DB # MYSQL_DB, MARIA_DB, POSTGRE_SQL_DB, SQL_SERVER_DB, ORACLE_DB
connectionString: common.connectionString.mongodb # a path in the secret, never the string itself
connectionStringSandbox: common.connectionString.mongodb # the one the sandboxes use
maxPoolConnections: 10
- Secrets are not in the repository : ask the person to add what a path names (
common.apiUserPasswords.shop_app) to the secret of each environment. See Secrets and API group permission.
Texts, log profiles, saved requests¶
- Texts of a language (
src/i18ns/<name>/) :<name>.yaml(name) and<name>.ts,module.exports = { "message": "translation" }. See Internationalization. - Log profiles (
src/log_profiles/<name>/<name>.yaml) and the shared saved requests of API Testing (src/api_testing_states/<name>/: YAML,.code.ts,.response.txt) : made in the admin panel, kept as they are.
Packages and sandboxes¶
src/admin_user/data.yaml holds the sandboxes of the account : the runtime, the version and the packages of each family of languages (javascript, python, php, dotnet, go, rust, java, kotlin), under settings.sandbox.environments. A package of a new library goes there :
settings:
sandbox:
environments:
python:
packages:
- name: requests
version: 2.32.3
- The Dockerfile written for a family is
src/admin_user/sandbox/<family>/Dockerfile. See Sandbox settings.
SSR website¶
src/ssr/<website>/ is a project of TypeScript : website.yaml, site.config.ts, pages/, components/, public/. Read the guide for AI assistants of the SSR websites first.