@zeyos/client 0.1.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.
Files changed (110) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/LICENSE +21 -0
  3. package/README.md +458 -0
  4. package/agents/README.md +66 -0
  5. package/agents/shared/business-app-benchmarks.md +111 -0
  6. package/agents/shared/zeyos-entity-map.md +142 -0
  7. package/agents/shared/zeyos-entity-reference.md +570 -0
  8. package/agents/shared/zeyos-query-patterns.md +89 -0
  9. package/agents/zeyos-account-intelligence/SKILL.md +34 -0
  10. package/agents/zeyos-account-intelligence/agents/openai.yaml +4 -0
  11. package/agents/zeyos-account-intelligence/references/workflows.md +84 -0
  12. package/agents/zeyos-billing-insights/SKILL.md +41 -0
  13. package/agents/zeyos-billing-insights/agents/openai.yaml +4 -0
  14. package/agents/zeyos-billing-insights/references/workflows.md +106 -0
  15. package/agents/zeyos-campaign-and-outreach/SKILL.md +44 -0
  16. package/agents/zeyos-campaign-and-outreach/agents/openai.yaml +4 -0
  17. package/agents/zeyos-campaign-and-outreach/references/workflows.md +100 -0
  18. package/agents/zeyos-collaboration-and-activity/SKILL.md +37 -0
  19. package/agents/zeyos-collaboration-and-activity/agents/openai.yaml +4 -0
  20. package/agents/zeyos-collaboration-and-activity/references/workflows.md +104 -0
  21. package/agents/zeyos-collections-and-dunning/SKILL.md +46 -0
  22. package/agents/zeyos-collections-and-dunning/agents/openai.yaml +4 -0
  23. package/agents/zeyos-collections-and-dunning/references/workflows.md +132 -0
  24. package/agents/zeyos-commerce-and-inventory/SKILL.md +38 -0
  25. package/agents/zeyos-commerce-and-inventory/agents/openai.yaml +4 -0
  26. package/agents/zeyos-commerce-and-inventory/references/workflows.md +101 -0
  27. package/agents/zeyos-mail-operations/SKILL.md +35 -0
  28. package/agents/zeyos-mail-operations/agents/openai.yaml +4 -0
  29. package/agents/zeyos-mail-operations/references/workflows.md +110 -0
  30. package/agents/zeyos-notes-and-sops/SKILL.md +31 -0
  31. package/agents/zeyos-notes-and-sops/agents/openai.yaml +4 -0
  32. package/agents/zeyos-notes-and-sops/references/workflows.md +85 -0
  33. package/agents/zeyos-platform-and-schema/SKILL.md +37 -0
  34. package/agents/zeyos-platform-and-schema/agents/openai.yaml +4 -0
  35. package/agents/zeyos-platform-and-schema/references/workflows.md +97 -0
  36. package/agents/zeyos-work-management/SKILL.md +45 -0
  37. package/agents/zeyos-work-management/agents/openai.yaml +4 -0
  38. package/agents/zeyos-work-management/references/workflows.md +148 -0
  39. package/docs/01-api-reference/01-data-retrieval.md +601 -0
  40. package/docs/01-api-reference/02-authentication.md +288 -0
  41. package/docs/01-api-reference/03-resources.md +270 -0
  42. package/docs/01-api-reference/04-schema.md +539 -0
  43. package/docs/01-api-reference/_category_.json +9 -0
  44. package/docs/02-javascript-client/01-getting-started.md +146 -0
  45. package/docs/02-javascript-client/02-authentication.md +287 -0
  46. package/docs/02-javascript-client/03-making-requests.md +572 -0
  47. package/docs/02-javascript-client/04-practical-guide.md +348 -0
  48. package/docs/02-javascript-client/_category_.json +9 -0
  49. package/docs/03-cli/01-getting-started.md +219 -0
  50. package/docs/03-cli/02-commands.md +407 -0
  51. package/docs/03-cli/03-configuration.md +220 -0
  52. package/docs/03-cli/_category_.json +9 -0
  53. package/docs/04-agent-workflows/00-coding-agents.md +35 -0
  54. package/docs/04-agent-workflows/01-agent-quickstart.md +147 -0
  55. package/docs/04-agent-workflows/02-agent-recipes.md +109 -0
  56. package/docs/04-agent-workflows/03-cli-coverage-and-escalation.md +65 -0
  57. package/docs/04-agent-workflows/_category_.json +9 -0
  58. package/docs/04-sample-apps/01-kanban.md +89 -0
  59. package/docs/04-sample-apps/02-crm.md +81 -0
  60. package/docs/04-sample-apps/03-dashboard.md +80 -0
  61. package/docs/04-sample-apps/_category_.json +9 -0
  62. package/docs/05-tutorials/00-application-developers.md +43 -0
  63. package/docs/05-tutorials/01-integration-architecture.md +60 -0
  64. package/docs/05-tutorials/02-build-your-own-zeyos-frontend.md +517 -0
  65. package/docs/05-tutorials/03-server-side-integrations.md +185 -0
  66. package/docs/05-tutorials/_category_.json +9 -0
  67. package/docs/intro.md +197 -0
  68. package/openapi/api.json +24308 -0
  69. package/openapi/auth.json +415 -0
  70. package/openapi/dbref.json +56223 -0
  71. package/openapi/oauth2.json +781 -0
  72. package/openapi/sdk.json +949 -0
  73. package/openapi/views.txt +642 -0
  74. package/package.json +49 -0
  75. package/samples/crm/README.md +28 -0
  76. package/samples/crm/index.html +327 -0
  77. package/samples/crm/js/api.js +208 -0
  78. package/samples/crm/js/auth.js +61 -0
  79. package/samples/crm/js/main.js +545 -0
  80. package/samples/crm/js/state.js +90 -0
  81. package/samples/crm/js/ui.js +51 -0
  82. package/samples/dashboard/README.md +28 -0
  83. package/samples/dashboard/index.html +280 -0
  84. package/samples/dashboard/js/api.js +197 -0
  85. package/samples/dashboard/js/auth.js +59 -0
  86. package/samples/dashboard/js/main.js +382 -0
  87. package/samples/dashboard/js/state.js +81 -0
  88. package/samples/dashboard/js/ui.js +48 -0
  89. package/samples/kanban/README.md +28 -0
  90. package/samples/kanban/index.html +263 -0
  91. package/samples/kanban/js/api.js +152 -0
  92. package/samples/kanban/js/auth.js +59 -0
  93. package/samples/kanban/js/constants.js +40 -0
  94. package/samples/kanban/js/kanban.js +246 -0
  95. package/samples/kanban/js/main.js +362 -0
  96. package/samples/kanban/js/modals.js +474 -0
  97. package/samples/kanban/js/settings.js +82 -0
  98. package/samples/kanban/js/state.js +118 -0
  99. package/samples/kanban/js/ui.js +49 -0
  100. package/scripts/generate-client.mjs +344 -0
  101. package/src/generated/operations.js +9772 -0
  102. package/src/generated/schema.js +8982 -0
  103. package/src/index.js +85 -0
  104. package/src/runtime/client.js +1208 -0
  105. package/src/runtime/error.js +29 -0
  106. package/src/runtime/http.js +174 -0
  107. package/src/runtime/request-shape.js +35 -0
  108. package/src/runtime/schema.js +206 -0
  109. package/src/runtime/suggest.js +74 -0
  110. package/src/runtime/token-store.js +105 -0
@@ -0,0 +1,781 @@
1
+ {
2
+ "openapi": "3.0.0",
3
+ "info": {
4
+ "title": "ZeyOS OAuth 2.0 API",
5
+ "termsOfService": "https://www.zeyos.com/termsofservice",
6
+ "contact": {
7
+ "name": "ZeyOS GmbH & Co. KG",
8
+ "url": "https://www.zeyos.com",
9
+ "email": "info@zeyos.com"
10
+ },
11
+ "version": "v1"
12
+ },
13
+ "externalDocs": {
14
+ "description": "ZeyOS Developer Center",
15
+ "url": "https://developers.zeyos.com"
16
+ },
17
+ "servers": [
18
+ {
19
+ "url": "https://cloud.zeyos.com/{INSTANCE}/oauth2/v1",
20
+ "description": "ZeyOS Cloud",
21
+ "variables": {
22
+ "INSTANCE": {
23
+ "default": "demo"
24
+ }
25
+ }
26
+ }
27
+ ],
28
+ "tags": [
29
+ {
30
+ "name": "auth",
31
+ "description": "Authorization"
32
+ },
33
+ {
34
+ "name": "token",
35
+ "description": "Token Handling"
36
+ },
37
+ {
38
+ "name": "userinfo",
39
+ "description": "User Info"
40
+ }
41
+ ],
42
+ "components": {
43
+ "securitySchemes": {
44
+ "basic": {
45
+ "type": "http",
46
+ "scheme": "basic",
47
+ "description": "HTTP Basic Authentication ([RFC 7617](https://tools.ietf.org/html/rfc7617))"
48
+ },
49
+ "token": {
50
+ "type": "http",
51
+ "scheme": "bearer",
52
+ "description": "HTTP Bearer Authentication ([RFC 6750](https://tools.ietf.org/html/rfc6750))"
53
+ },
54
+ "session": {
55
+ "type": "apiKey",
56
+ "name": "ZEYOSID",
57
+ "in": "cookie",
58
+ "description": "Session Cookie Authentication ([RFC 6265](https://tools.ietf.org/html/rfc6265))"
59
+ }
60
+ },
61
+ "schemas": {
62
+ "token": {
63
+ "type": "object",
64
+ "required": ["client_id", "client_secret", "grant_type"],
65
+ "properties": {
66
+ "client_id": {
67
+ "type": "string",
68
+ "maxLength": 200,
69
+ "pattern": "^[a-zA-Z0-9]([a-zA-Z0-9_.-]*[a-zA-Z0-9])?$",
70
+ "description": "Client application identifier (corresponds to `applications.identifier`); only required if not supplied via the username component of the `Authorization` header",
71
+ "example": "my_application"
72
+ },
73
+ "client_secret": {
74
+ "type": "string",
75
+ "format": "password",
76
+ "minLength": 1,
77
+ "description": "Client application's API secret key (corresponds to `applications.secret`); only required if not supplied via the password component of the `Authorization` header",
78
+ "example": "519d6241f455abbe71d93e0de58083534473a65a"
79
+ },
80
+ "grant_type": {
81
+ "type": "string",
82
+ "enum": ["authorization_code", "refresh_token", "password"],
83
+ "description": "Grant type",
84
+ "example": "authorization_code"
85
+ },
86
+ "code": {
87
+ "type": "string",
88
+ "format": "password",
89
+ "pattern": "^[a-f0-9]{40}$",
90
+ "description": "Authorization code (single-use) as returned by the `/authorize` request's callback; is required if `grant_type`=`authorization_code`",
91
+ "example": "4c82f23d91a75961f4d08134fc5ad0dfe6a4c36a"
92
+ },
93
+ "refresh_token": {
94
+ "type": "string",
95
+ "format": "password",
96
+ "pattern": "^[a-f0-9]{40}$",
97
+ "description": "Refresh token (single-use) as returned by a previous `/token` request; is required if `grant_type`=`refresh_token`",
98
+ "example": "4c82f23d91a75961f4d08134fc5ad0dfe6a4c36a"
99
+ },
100
+ "code_verifier": {
101
+ "type": "string",
102
+ "format": "password",
103
+ "description": "PKCE code verifier ([RFC 7636](https://tools.ietf.org/html/rfc7636)) (optional); only if `grant_type`=`authorization_code`",
104
+ "example": "EorzMPECLYK2vhnHZX9Cel4IW9DGzr9g-Hh0Vl7w-5A"
105
+ },
106
+ "username": {
107
+ "type": "string",
108
+ "minLength": 1,
109
+ "description": "Username or e-mail address; might be required if `grant_type`=`password`",
110
+ "example": "john.doe"
111
+ },
112
+ "password": {
113
+ "type": "string",
114
+ "format": "password",
115
+ "description": "Password; might be required if `grant_type`=`password`",
116
+ "example": "**********"
117
+ },
118
+ "otp": {
119
+ "type": "string",
120
+ "format": "password",
121
+ "description": "OTP authentication code for 2FA (optional); only for `grant_type`=`password`",
122
+ "example": "123456"
123
+ }
124
+ }
125
+ },
126
+ "token-revoke-introspect": {
127
+ "type": "object",
128
+ "required": ["client_id", "client_secret", "token"],
129
+ "properties": {
130
+ "client_id": {
131
+ "type": "string",
132
+ "maxLength": 200,
133
+ "pattern": "^[a-zA-Z0-9]([a-zA-Z0-9_.-]*[a-zA-Z0-9])?$",
134
+ "description": "Client application identifier (corresponds to `applications.identifier`); only required if not supplied via the username component of the `Authorization` header",
135
+ "example": "my_application"
136
+ },
137
+ "client_secret": {
138
+ "type": "string",
139
+ "format": "password",
140
+ "minLength": 1,
141
+ "description": "Client application's API secret key (corresponds to `applications.secret`); only required if not supplied via the password component of the `Authorization` header",
142
+ "example": "519d6241f455abbe71d93e0de58083534473a65a"
143
+ },
144
+ "token": {
145
+ "type": "string",
146
+ "format": "password",
147
+ "pattern": "^[a-f0-9]{40}$",
148
+ "description": "Access or refresh token as returned by a previous `/token` request",
149
+ "example": "4c82f23d91a75961f4d08134fc5ad0dfe6a4c36a"
150
+ }
151
+ }
152
+ }
153
+ },
154
+ "requestBodies": {
155
+ "token-revoke-introspect": {
156
+ "required": true,
157
+ "content": {
158
+ "application/x-www-form-urlencoded": {
159
+ "schema": {
160
+ "$ref": "#/components/schemas/token-revoke-introspect"
161
+ }
162
+ },
163
+ "application/json": {
164
+ "schema": {
165
+ "$ref": "#/components/schemas/token-revoke-introspect"
166
+ }
167
+ }
168
+ }
169
+ }
170
+ },
171
+ "responses": {
172
+ "401": {
173
+ "description": "Unauthorized",
174
+ "headers": {
175
+ "WWW-Authenticate": {
176
+ "description": "Preferred authentication scheme ([RFC 7235](https://tools.ietf.org/html/rfc7235#section-4.1))",
177
+ "schema": {
178
+ "type": "string",
179
+ "example": "Basic realm=\"{INSTANCE}\""
180
+ }
181
+ }
182
+ },
183
+ "content": {
184
+ "application/json": {
185
+ "schema": {
186
+ "type": "object",
187
+ "required": ["error", "error_description"],
188
+ "properties": {
189
+ "error": {
190
+ "type": "string",
191
+ "description": "Error code",
192
+ "example": "invalid_client"
193
+ },
194
+ "error_description": {
195
+ "type": "string",
196
+ "description": "Error description",
197
+ "example": "Unauthorized: Unknown client application"
198
+ }
199
+ }
200
+ }
201
+ }
202
+ }
203
+ },
204
+ "500": {
205
+ "description": "Runtime Error (Internal Server Error)",
206
+ "content": {
207
+ "application/json": {
208
+ "schema": {
209
+ "type": "object",
210
+ "properties": {
211
+ "error": {
212
+ "type": "string",
213
+ "description": "Error code",
214
+ "example": "server_error"
215
+ },
216
+ "error_description": {
217
+ "type": "string",
218
+ "description": "Error description",
219
+ "example": "Runtime Error: I am afraid I can't do that Dave!"
220
+ }
221
+ }
222
+ }
223
+ }
224
+ }
225
+ },
226
+ "500-simple": {
227
+ "description": "Runtime Error (Internal Server Error)",
228
+ "content": {
229
+ "text/plain": {
230
+ "schema": {
231
+ "type": "string",
232
+ "example": "I am afraid I can't do that Dave!"
233
+ }
234
+ }
235
+ }
236
+ }
237
+ }
238
+ },
239
+ "paths": {
240
+ "/authorize": {
241
+ "get": {
242
+ "tags": ["auth"],
243
+ "summary": "Request authorization",
244
+ "description": "Request client authorization by redirecting the user agent (typically a web browser) to ZeyOS and returning to the client application via the specified callback URL according to [RFC 6749](https://tools.ietf.org/html/rfc6749#section-4.1.1).",
245
+ "operationId": "authorize",
246
+ "parameters": [
247
+ {
248
+ "name": "client_id",
249
+ "in": "query",
250
+ "required": true,
251
+ "description": "Client application identifier (corresponds to `applications.identifier`)",
252
+ "schema": {
253
+ "type": "string",
254
+ "maxLength": 200,
255
+ "pattern": "^[a-zA-Z0-9]([a-zA-Z0-9_.-]*[a-zA-Z0-9])?$",
256
+ "example": "my_application"
257
+ }
258
+ },
259
+ {
260
+ "name": "redirect_uri",
261
+ "in": "query",
262
+ "required": true,
263
+ "description": "Callback URL (HTTPS required, unless 127.0.0.1 or localhost)",
264
+ "schema": {
265
+ "type": "string",
266
+ "example": "https://www.my_site.com/oauth_callback"
267
+ }
268
+ },
269
+ {
270
+ "name": "response_type",
271
+ "in": "query",
272
+ "required": true,
273
+ "description": "Response type (always `code`)",
274
+ "schema": {
275
+ "type": "string",
276
+ "enum": ["code"],
277
+ "example": "code"
278
+ }
279
+ },
280
+ {
281
+ "name": "response_mode",
282
+ "in": "query",
283
+ "description": "Response mode (optional)",
284
+ "schema": {
285
+ "type": "string",
286
+ "enum": ["query", "form_post"],
287
+ "default": "query",
288
+ "example": "query"
289
+ }
290
+ },
291
+ {
292
+ "name": "code_challenge",
293
+ "in": "query",
294
+ "description": "PKCE code challenge ([RFC 7636](https://tools.ietf.org/html/rfc7636)) (optional)",
295
+ "schema": {
296
+ "type": "string",
297
+ "example": "TPWKUmcvj2m43OoxtmS6mBWcLnBfWAopmqyhsNsl3f0"
298
+ }
299
+ },
300
+ {
301
+ "name": "code_challenge_method",
302
+ "in": "query",
303
+ "description": "PKCE code challenge method ([RFC 7636](https://tools.ietf.org/html/rfc7636)); only required if `code_challenge` is provided",
304
+ "schema": {
305
+ "type": "string",
306
+ "enum": ["S256"],
307
+ "example": "S256"
308
+ }
309
+ },
310
+ {
311
+ "name": "state",
312
+ "in": "query",
313
+ "description": "State to be maintained between request and callback",
314
+ "schema": {
315
+ "type": "string"
316
+ }
317
+ }
318
+ ],
319
+ "responses": {
320
+ "303": {
321
+ "description": "See Other",
322
+ "headers": {
323
+ "Location": {
324
+ "description": "Authorization URL for the user to be redirected to",
325
+ "schema": {
326
+ "type": "string",
327
+ "example": "Location: https://cloud.zeyos.com/{INSTANCE}/?umi=auth&page=oauth&..."
328
+ }
329
+ }
330
+ }
331
+ },
332
+ "500": {
333
+ "$ref": "#/components/responses/500-simple"
334
+ }
335
+ }
336
+ }
337
+ },
338
+ "/token": {
339
+ "post": {
340
+ "tags": ["token"],
341
+ "summary": "Get access token",
342
+ "description": "Return a new auto-generated, cryptographically secure and persistent access token, plus accompanying single-use refresh token based on the specified authorization code or refresh token according to [RFC 6749](https://tools.ietf.org/html/rfc6749#section-4.1.3). Previous tokens will thereby invalidate.",
343
+ "operationId": "getToken",
344
+ "security": [
345
+ {
346
+ "basic": []
347
+ }
348
+ ],
349
+ "requestBody": {
350
+ "required": true,
351
+ "content": {
352
+ "application/x-www-form-urlencoded": {
353
+ "schema": {
354
+ "$ref": "#/components/schemas/token"
355
+ }
356
+ },
357
+ "application/json": {
358
+ "schema": {
359
+ "$ref": "#/components/schemas/token"
360
+ }
361
+ }
362
+ }
363
+ },
364
+ "responses": {
365
+ "200": {
366
+ "description": "OK",
367
+ "content": {
368
+ "application/json": {
369
+ "schema": {
370
+ "type": "object",
371
+ "required": ["token_type", "access_token", "expires_in", "refresh_token", "refresh_token_expires_in"],
372
+ "properties": {
373
+ "token_type": {
374
+ "type": "string",
375
+ "enum": ["Bearer"],
376
+ "description": "Access token type (always `Bearer`)",
377
+ "example": "Bearer"
378
+ },
379
+ "access_token": {
380
+ "type": "string",
381
+ "format": "password",
382
+ "pattern": "^[a-f0-9]{40}$",
383
+ "description": "Auto-generated bearer token for use in subsequent requests' `Authorization` header",
384
+ "example": "97c4281ea528ef02ba573fffce2fa80a3a8414b7"
385
+ },
386
+ "expires_in": {
387
+ "type": "integer",
388
+ "enum": [3600],
389
+ "description": "Expiry time (time-to-live) of the access token in seconds (always 1 hour)",
390
+ "example": 3600
391
+ },
392
+ "refresh_token": {
393
+ "type": "string",
394
+ "format": "password",
395
+ "pattern": "^[a-f0-9]{40}$",
396
+ "description": "Auto-generated single-use refresh token to obtain a new access token",
397
+ "example": "4c82f23d91a75961f4d08134fc5ad0dfe6a4c36a"
398
+ },
399
+ "refresh_token_expires_in": {
400
+ "type": "integer",
401
+ "enum": [8640000],
402
+ "description": "Expiry time (time-to-live) of the refresh token in seconds (always 100 days)",
403
+ "example": 8640000
404
+ }
405
+ }
406
+ }
407
+ }
408
+ }
409
+ },
410
+ "401": {
411
+ "$ref": "#/components/responses/401"
412
+ },
413
+ "403": {
414
+ "description": "Forbidden",
415
+ "content": {
416
+ "application/json": {
417
+ "schema": {
418
+ "type": "object",
419
+ "required": ["error", "error_description"],
420
+ "properties": {
421
+ "error": {
422
+ "type": "string",
423
+ "description": "Error code",
424
+ "example": "invalid_grant"
425
+ },
426
+ "error_description": {
427
+ "type": "string",
428
+ "description": "Error description",
429
+ "example": "Forbidden: Invalid or expired refresh_token"
430
+ }
431
+ }
432
+ }
433
+ }
434
+ }
435
+ },
436
+ "500": {
437
+ "$ref": "#/components/responses/500"
438
+ }
439
+ }
440
+ }
441
+ },
442
+ "/revoke": {
443
+ "post": {
444
+ "tags": ["token"],
445
+ "summary": "Revoke token",
446
+ "description": "Invalidates an existing token according to [RFC 7009](https://tools.ietf.org/html/rfc7009). If the specified token is a refresh token, the associated access token will also be invalidated.",
447
+ "operationId": "revokeToken",
448
+ "security": [
449
+ {
450
+ "basic": []
451
+ }
452
+ ],
453
+ "requestBody": {
454
+ "$ref": "#/components/requestBodies/token-revoke-introspect"
455
+ },
456
+ "responses": {
457
+ "200": {
458
+ "description": "OK"
459
+ },
460
+ "401": {
461
+ "$ref": "#/components/responses/401"
462
+ },
463
+ "500": {
464
+ "$ref": "#/components/responses/500"
465
+ }
466
+ }
467
+ }
468
+ },
469
+ "/introspect": {
470
+ "post": {
471
+ "tags": ["token"],
472
+ "summary": "Introspect token",
473
+ "description": "Return details of a specified token according to [RFC 7662](https://tools.ietf.org/html/rfc7662).",
474
+ "operationId": "introspectToken",
475
+ "security": [
476
+ {
477
+ "basic": []
478
+ }
479
+ ],
480
+ "requestBody": {
481
+ "$ref": "#/components/requestBodies/token-revoke-introspect"
482
+ },
483
+ "responses": {
484
+ "200": {
485
+ "description": "OK",
486
+ "content": {
487
+ "application/json": {
488
+ "schema": {
489
+ "type": "object",
490
+ "required": ["active"],
491
+ "properties": {
492
+ "active": {
493
+ "type": "boolean",
494
+ "description": "Token is active (valid and not yet expired)",
495
+ "example": true
496
+ },
497
+ "client_id": {
498
+ "type": "string",
499
+ "maxLength": 200,
500
+ "pattern": "^[a-zA-Z0-9]([a-zA-Z0-9_.-]*[a-zA-Z0-9])?$",
501
+ "description": "Client application identifier (corresponds to `applications.identifier`)",
502
+ "example": "my_application"
503
+ },
504
+ "username": {
505
+ "type": "string",
506
+ "minLength": 1,
507
+ "description": "Username",
508
+ "example": "john.doe"
509
+ },
510
+ "sub": {
511
+ "type": "string",
512
+ "pattern": "^[1-9][0-9]*$",
513
+ "description": "User ID as subject identifier (always a stringified positive integer)",
514
+ "example": "1"
515
+ },
516
+ "exp": {
517
+ "type": "integer",
518
+ "format": "int64",
519
+ "description": "Token expiry date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time)",
520
+ "example": 872838840
521
+ }
522
+ }
523
+ }
524
+ }
525
+ }
526
+ },
527
+ "401": {
528
+ "$ref": "#/components/responses/401"
529
+ },
530
+ "500": {
531
+ "$ref": "#/components/responses/500"
532
+ }
533
+ }
534
+ }
535
+ },
536
+ "/userinfo": {
537
+ "get": {
538
+ "tags": ["userinfo"],
539
+ "summary": "Get user info",
540
+ "description": "Return details of a user based on the header-supplied access token with profile information according to [OpenID Connect 1.0](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo) and ZeyOS-specific fields as an extension.",
541
+ "operationId": "getUserInfo",
542
+ "security": [
543
+ {
544
+ "token": []
545
+ },
546
+ {
547
+ "session": []
548
+ }
549
+ ],
550
+ "responses": {
551
+ "200": {
552
+ "description": "OK",
553
+ "content": {
554
+ "application/json": {
555
+ "schema": {
556
+ "type": "object",
557
+ "required": ["sub", "name", "preferred_username", "email", "zoneinfo", "locale", "nopublic", "apionly", "updated_at"],
558
+ "properties": {
559
+ "sub": {
560
+ "type": "string",
561
+ "pattern": "^[1-9][0-9]*$",
562
+ "description": "User ID as subject identifier (always a stringified positive integer)",
563
+ "example": "1"
564
+ },
565
+ "name": {
566
+ "type": "string",
567
+ "minLength": 1,
568
+ "description": "User's real name or username (fallback)",
569
+ "example": "John Doe"
570
+ },
571
+ "preferred_username": {
572
+ "type": "string",
573
+ "minLength": 1,
574
+ "description": "Username",
575
+ "example": "john.doe"
576
+ },
577
+ "email": {
578
+ "type": "string",
579
+ "format": "email",
580
+ "minLength": 1,
581
+ "description": "User's system e-mail address",
582
+ "example": "john.doe@company.com"
583
+ },
584
+ "zoneinfo": {
585
+ "type": "string",
586
+ "minLength": 1,
587
+ "description": "Time zone name as defined by the [IANA Time Zone Database](https://www.iana.org/time-zones)",
588
+ "example": "Europe/Berlin"
589
+ },
590
+ "locale": {
591
+ "type": "string",
592
+ "enum": ["de-DE", "en-US", "es-ES"],
593
+ "description": "User's locale as a BCP47 language tag ([RFC 5646](https://tools.ietf.org/html/rfc5646))",
594
+ "example": "en-US"
595
+ },
596
+ "nopublic": {
597
+ "type": "boolean",
598
+ "description": "User has no access to public data (ZeyOS extension)",
599
+ "example": false
600
+ },
601
+ "apionly": {
602
+ "type": "boolean",
603
+ "description": "User is restricted to API access, no regular login (ZeyOS extension)",
604
+ "example": false
605
+ },
606
+ "updated_at": {
607
+ "type": "integer",
608
+ "format": "int64",
609
+ "description": "Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time)",
610
+ "example": 872838840
611
+ },
612
+ "given_name": {
613
+ "type": "string",
614
+ "minLength": 1,
615
+ "description": "User's first name (given name)",
616
+ "example": "John"
617
+ },
618
+ "family_name": {
619
+ "type": "string",
620
+ "description": "User's last name (surname or company name)",
621
+ "example": "Doe"
622
+ },
623
+ "phone_number": {
624
+ "type": "string",
625
+ "description": "User's primary phone number",
626
+ "example": "+1 123-456-7890"
627
+ },
628
+ "birthdate": {
629
+ "type": "string",
630
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
631
+ "description": "Birth date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) `YYYY-MM-DD` format",
632
+ "example": "1982-12-09"
633
+ },
634
+ "address": {
635
+ "type": "object",
636
+ "description": "User's full address",
637
+ "properties": {
638
+ "street_address": {
639
+ "type": "string",
640
+ "description": "Address (street and building/suite number)",
641
+ "example": "123 Main St."
642
+ },
643
+ "locality": {
644
+ "type": "string",
645
+ "description": "City or locality",
646
+ "example": "Anytown"
647
+ },
648
+ "region": {
649
+ "type": "string",
650
+ "description": "Region or state",
651
+ "example": "CA"
652
+ },
653
+ "postal_code": {
654
+ "type": "string",
655
+ "description": "Postal or ZIP code",
656
+ "example": "95060"
657
+ },
658
+ "country": {
659
+ "type": "string",
660
+ "pattern": "^([A-Z]{2})?$",
661
+ "description": "Country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2))",
662
+ "example": "US"
663
+ }
664
+ }
665
+ },
666
+ "groups": {
667
+ "type": "array",
668
+ "description": "User's groups (ZeyOS extension)",
669
+ "items": {
670
+ "type": "object",
671
+ "properties": {
672
+ "id": {
673
+ "type": "integer",
674
+ "format": "int32",
675
+ "description": "Group ID",
676
+ "example": 1
677
+ },
678
+ "name": {
679
+ "type": "string",
680
+ "minLength": 1,
681
+ "description": "Group name",
682
+ "example": "Operations"
683
+ },
684
+ "writable": {
685
+ "type": "boolean",
686
+ "description": "Allow writing of group-owned data by user",
687
+ "example": true
688
+ }
689
+ }
690
+ }
691
+ },
692
+ "permissions": {
693
+ "type": "array",
694
+ "description": "User's permissions (ZeyOS extension)",
695
+ "items": {
696
+ "oneOf": [
697
+ {
698
+ "type": "object",
699
+ "properties": {
700
+ "identifier": {
701
+ "type": "string",
702
+ "maxLength": 200,
703
+ "pattern": "^[a-zA-Z0-9]([a-zA-Z0-9_.-]*[a-zA-Z0-9])?$",
704
+ "description": "Permission identifier (e.g. module)",
705
+ "example": "billing"
706
+ },
707
+ "writable": {
708
+ "type": "boolean",
709
+ "description": "Allow writing of permission-specific data by user",
710
+ "example": true
711
+ }
712
+ }
713
+ },
714
+ {
715
+ "type": "object",
716
+ "properties": {
717
+ "fork": {
718
+ "type": "integer",
719
+ "format": "int32",
720
+ "description": "Fork ID",
721
+ "example": 1
722
+ },
723
+ "writable": {
724
+ "type": "boolean",
725
+ "description": "Allow writing of permission-specific data by user",
726
+ "example": true
727
+ }
728
+ }
729
+ },
730
+ {
731
+ "type": "object",
732
+ "properties": {
733
+ "application": {
734
+ "type": "integer",
735
+ "format": "int32",
736
+ "description": "Application ID",
737
+ "example": 1
738
+ },
739
+ "writable": {
740
+ "type": "boolean",
741
+ "description": "Allow writing of permission-specific data by user",
742
+ "example": true
743
+ }
744
+ }
745
+ }
746
+ ]
747
+ }
748
+ }
749
+ }
750
+ }
751
+ }
752
+ }
753
+ },
754
+ "401": {
755
+ "description": "Unauthorized",
756
+ "headers": {
757
+ "WWW-Authenticate": {
758
+ "description": "Preferred authentication scheme ([RFC 7235](https://tools.ietf.org/html/rfc7235#section-4.1))",
759
+ "schema": {
760
+ "type": "string",
761
+ "example": "Bearer realm=\"{INSTANCE}\" error=\"invalid_token\""
762
+ }
763
+ }
764
+ },
765
+ "content": {
766
+ "text/plain": {
767
+ "schema": {
768
+ "type": "string",
769
+ "example": "Unauthorized: Invalid bearer token"
770
+ }
771
+ }
772
+ }
773
+ },
774
+ "500": {
775
+ "$ref": "#/components/responses/500-simple"
776
+ }
777
+ }
778
+ }
779
+ }
780
+ }
781
+ }