@nekutima/biome-sdk 0.19.3 → 0.29.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 (219) hide show
  1. package/dist/admin/admin.model.d.ts +70 -0
  2. package/dist/admin/admin.model.d.ts.map +1 -1
  3. package/dist/admin/admin.schema.json +339 -0
  4. package/dist/admin/admin.service.d.ts +9 -1
  5. package/dist/admin/admin.service.d.ts.map +1 -1
  6. package/dist/admin/admin.service.js +79 -4
  7. package/dist/admin/admin.service.js.map +1 -1
  8. package/dist/agents/agent-identity.d.ts +19 -0
  9. package/dist/agents/agent-identity.d.ts.map +1 -0
  10. package/dist/agents/agent-identity.js +36 -0
  11. package/dist/agents/agent-identity.js.map +1 -0
  12. package/dist/agents/agent-resource.d.ts +0 -1
  13. package/dist/agents/agent-resource.d.ts.map +1 -1
  14. package/dist/agents/agent.model.d.ts +13 -40
  15. package/dist/agents/agent.model.d.ts.map +1 -1
  16. package/dist/agents/agent.service.d.ts +9 -3
  17. package/dist/agents/agent.service.d.ts.map +1 -1
  18. package/dist/agents/agent.service.js +37 -8
  19. package/dist/agents/agent.service.js.map +1 -1
  20. package/dist/ai/yuri.service.d.ts +39 -5
  21. package/dist/ai/yuri.service.d.ts.map +1 -1
  22. package/dist/ai/yuri.service.js +64 -34
  23. package/dist/ai/yuri.service.js.map +1 -1
  24. package/dist/alexandria/nugget.model.d.ts +77 -0
  25. package/dist/alexandria/nugget.model.d.ts.map +1 -0
  26. package/dist/alexandria/nugget.model.js +7 -0
  27. package/dist/alexandria/nugget.model.js.map +1 -0
  28. package/dist/alexandria/nugget.service.d.ts +21 -0
  29. package/dist/alexandria/nugget.service.d.ts.map +1 -0
  30. package/dist/alexandria/nugget.service.js +127 -0
  31. package/dist/alexandria/nugget.service.js.map +1 -0
  32. package/dist/alexandria/problem.model.d.ts +48 -0
  33. package/dist/alexandria/problem.model.d.ts.map +1 -0
  34. package/dist/alexandria/problem.model.js +7 -0
  35. package/dist/alexandria/problem.model.js.map +1 -0
  36. package/dist/alexandria/problem.service.d.ts +17 -0
  37. package/dist/alexandria/problem.service.d.ts.map +1 -0
  38. package/dist/alexandria/problem.service.js +98 -0
  39. package/dist/alexandria/problem.service.js.map +1 -0
  40. package/dist/alexandria/progress.model.d.ts +19 -0
  41. package/dist/alexandria/progress.model.d.ts.map +1 -0
  42. package/dist/alexandria/progress.model.js +3 -0
  43. package/dist/alexandria/progress.model.js.map +1 -0
  44. package/dist/alexandria/progress.service.d.ts +10 -0
  45. package/dist/alexandria/progress.service.d.ts.map +1 -0
  46. package/dist/alexandria/progress.service.js +38 -0
  47. package/dist/alexandria/progress.service.js.map +1 -0
  48. package/dist/api-keys/api-key.model.d.ts +30 -0
  49. package/dist/api-keys/api-key.model.d.ts.map +1 -0
  50. package/dist/api-keys/api-key.model.js +3 -0
  51. package/dist/api-keys/api-key.model.js.map +1 -0
  52. package/dist/api-keys/api-key.service.d.ts +16 -0
  53. package/dist/api-keys/api-key.service.d.ts.map +1 -0
  54. package/dist/api-keys/api-key.service.js +34 -0
  55. package/dist/api-keys/api-key.service.js.map +1 -0
  56. package/dist/auth/auth.schema.json +106 -0
  57. package/dist/auth/auth.service.d.ts +8 -1
  58. package/dist/auth/auth.service.d.ts.map +1 -1
  59. package/dist/auth/auth.service.js +23 -10
  60. package/dist/auth/auth.service.js.map +1 -1
  61. package/dist/chat/chat.service.d.ts.map +1 -1
  62. package/dist/chat/chat.service.js +60 -68
  63. package/dist/chat/chat.service.js.map +1 -1
  64. package/dist/circles/circle.model.d.ts +25 -0
  65. package/dist/circles/circle.model.d.ts.map +1 -0
  66. package/dist/circles/circle.model.js +3 -0
  67. package/dist/circles/circle.model.js.map +1 -0
  68. package/dist/circles/circle.schema.json +332 -0
  69. package/dist/circles/circle.service.d.ts +14 -0
  70. package/dist/circles/circle.service.d.ts.map +1 -0
  71. package/dist/circles/circle.service.js +50 -0
  72. package/dist/circles/circle.service.js.map +1 -0
  73. package/dist/communities/community.model.d.ts +72 -0
  74. package/dist/communities/community.model.d.ts.map +1 -0
  75. package/dist/communities/community.model.js +3 -0
  76. package/dist/communities/community.model.js.map +1 -0
  77. package/dist/communities/community.service.d.ts +26 -0
  78. package/dist/communities/community.service.d.ts.map +1 -0
  79. package/dist/communities/community.service.js +140 -0
  80. package/dist/communities/community.service.js.map +1 -0
  81. package/dist/contacts/contact.model.d.ts +97 -0
  82. package/dist/contacts/contact.model.d.ts.map +1 -0
  83. package/dist/contacts/contact.model.js +3 -0
  84. package/dist/contacts/contact.model.js.map +1 -0
  85. package/dist/contacts/contact.schema.json +312 -0
  86. package/dist/contacts/contact.service.d.ts +28 -0
  87. package/dist/contacts/contact.service.d.ts.map +1 -0
  88. package/dist/contacts/contact.service.js +109 -0
  89. package/dist/contacts/contact.service.js.map +1 -0
  90. package/dist/core/api-diagnostics.d.ts +91 -0
  91. package/dist/core/api-diagnostics.d.ts.map +1 -0
  92. package/dist/core/api-diagnostics.js +211 -0
  93. package/dist/core/api-diagnostics.js.map +1 -0
  94. package/dist/core/configuration.d.ts +12 -0
  95. package/dist/core/configuration.d.ts.map +1 -1
  96. package/dist/core/error-handler.d.ts +5 -1
  97. package/dist/core/error-handler.d.ts.map +1 -1
  98. package/dist/core/error-handler.js +45 -21
  99. package/dist/core/error-handler.js.map +1 -1
  100. package/dist/core/http-client.d.ts +33 -6
  101. package/dist/core/http-client.d.ts.map +1 -1
  102. package/dist/core/http-client.js +193 -31
  103. package/dist/core/http-client.js.map +1 -1
  104. package/dist/core/node-cookie-jar.d.ts +14 -0
  105. package/dist/core/node-cookie-jar.d.ts.map +1 -0
  106. package/dist/core/node-cookie-jar.js +58 -0
  107. package/dist/core/node-cookie-jar.js.map +1 -0
  108. package/dist/core/request-scheduler.d.ts +56 -0
  109. package/dist/core/request-scheduler.d.ts.map +1 -0
  110. package/dist/core/request-scheduler.js +176 -0
  111. package/dist/core/request-scheduler.js.map +1 -0
  112. package/dist/core/resilience.d.ts +10 -0
  113. package/dist/core/resilience.d.ts.map +1 -1
  114. package/dist/core/resilience.js +27 -0
  115. package/dist/core/resilience.js.map +1 -1
  116. package/dist/ecosystem/organization.model.d.ts +4 -4
  117. package/dist/ecosystem/organization.model.d.ts.map +1 -1
  118. package/dist/errors/error-codes.d.ts +3 -1
  119. package/dist/errors/error-codes.d.ts.map +1 -1
  120. package/dist/errors/error-codes.js +2 -0
  121. package/dist/errors/error-codes.js.map +1 -1
  122. package/dist/events/event-edition.model.d.ts +5 -0
  123. package/dist/events/event-edition.model.d.ts.map +1 -1
  124. package/dist/events/event.model.d.ts +5 -0
  125. package/dist/events/event.model.d.ts.map +1 -1
  126. package/dist/follows/follow.model.d.ts +1 -1
  127. package/dist/follows/follow.model.d.ts.map +1 -1
  128. package/dist/follows/follow.service.d.ts.map +1 -1
  129. package/dist/follows/follow.service.js +1 -0
  130. package/dist/follows/follow.service.js.map +1 -1
  131. package/dist/guilds/guild.model.d.ts +36 -0
  132. package/dist/guilds/guild.model.d.ts.map +1 -1
  133. package/dist/guilds/guild.service.d.ts +7 -1
  134. package/dist/guilds/guild.service.d.ts.map +1 -1
  135. package/dist/guilds/guild.service.js +52 -0
  136. package/dist/guilds/guild.service.js.map +1 -1
  137. package/dist/index.d.ts +50 -6
  138. package/dist/index.d.ts.map +1 -1
  139. package/dist/index.js +70 -4
  140. package/dist/index.js.map +1 -1
  141. package/dist/memberships/membership.model.d.ts +34 -0
  142. package/dist/memberships/membership.model.d.ts.map +1 -0
  143. package/dist/memberships/membership.model.js +3 -0
  144. package/dist/memberships/membership.model.js.map +1 -0
  145. package/dist/memberships/membership.service.d.ts +22 -0
  146. package/dist/memberships/membership.service.d.ts.map +1 -0
  147. package/dist/memberships/membership.service.js +111 -0
  148. package/dist/memberships/membership.service.js.map +1 -0
  149. package/dist/missions/mission.model.d.ts +4 -4
  150. package/dist/missions/mission.model.d.ts.map +1 -1
  151. package/dist/missions/mission.schema.json +204 -0
  152. package/dist/missions/mission.service.d.ts +2 -2
  153. package/dist/missions/mission.service.d.ts.map +1 -1
  154. package/dist/missions/mission.service.js.map +1 -1
  155. package/dist/models/chat.model.d.ts +11 -1
  156. package/dist/models/chat.model.d.ts.map +1 -1
  157. package/dist/models/chat.model.js +4 -0
  158. package/dist/models/chat.model.js.map +1 -1
  159. package/dist/notifications/notification.service.d.ts.map +1 -1
  160. package/dist/notifications/notification.service.js +10 -2
  161. package/dist/notifications/notification.service.js.map +1 -1
  162. package/dist/profiles/person.model.d.ts +26 -26
  163. package/dist/profiles/person.model.d.ts.map +1 -1
  164. package/dist/profiles/profile.schema.json +269 -0
  165. package/dist/project/schemas.js +2 -1
  166. package/dist/project/schemas.js.map +1 -1
  167. package/dist/projects/project.service.d.ts +1 -1
  168. package/dist/projects/project.service.d.ts.map +1 -1
  169. package/dist/projects/project.service.js +2 -2
  170. package/dist/projects/project.service.js.map +1 -1
  171. package/dist/rewards/reward.model.d.ts +2 -2
  172. package/dist/rewards/reward.model.d.ts.map +1 -1
  173. package/dist/rewards/reward.service.d.ts +9 -0
  174. package/dist/rewards/reward.service.d.ts.map +1 -1
  175. package/dist/rewards/reward.service.js +32 -0
  176. package/dist/rewards/reward.service.js.map +1 -1
  177. package/dist/support/support.model.d.ts +6 -0
  178. package/dist/support/support.model.d.ts.map +1 -0
  179. package/dist/support/support.model.js +3 -0
  180. package/dist/support/support.model.js.map +1 -0
  181. package/dist/support/support.schema.json +25 -0
  182. package/dist/support/support.service.d.ts +11 -0
  183. package/dist/support/support.service.d.ts.map +1 -0
  184. package/dist/support/support.service.js +22 -0
  185. package/dist/support/support.service.js.map +1 -0
  186. package/dist/tasks/schemas.js +4 -3
  187. package/dist/tasks/schemas.js.map +1 -1
  188. package/dist/tasks/task.model.d.ts +40 -15
  189. package/dist/tasks/task.model.d.ts.map +1 -1
  190. package/dist/tasks/task.model.js +1 -1
  191. package/dist/tasks/task.model.js.map +1 -1
  192. package/dist/tasks/task.schema.json +780 -0
  193. package/dist/tasks/task.service.d.ts +108 -9
  194. package/dist/tasks/task.service.d.ts.map +1 -1
  195. package/dist/tasks/task.service.js +184 -47
  196. package/dist/tasks/task.service.js.map +1 -1
  197. package/dist/timezone/time.helper.d.ts +9 -0
  198. package/dist/timezone/time.helper.d.ts.map +1 -1
  199. package/dist/timezone/time.helper.js +31 -2
  200. package/dist/timezone/time.helper.js.map +1 -1
  201. package/dist/users/user.model.d.ts +2 -1
  202. package/dist/users/user.model.d.ts.map +1 -1
  203. package/dist/users/user.model.js.map +1 -1
  204. package/dist/users/user.schema.json +429 -0
  205. package/dist/users/user.service.d.ts +2 -2
  206. package/dist/users/user.service.d.ts.map +1 -1
  207. package/dist/users/user.service.js +29 -35
  208. package/dist/users/user.service.js.map +1 -1
  209. package/dist/utils/validation.utils.d.ts +0 -4
  210. package/dist/utils/validation.utils.d.ts.map +1 -1
  211. package/dist/utils/validation.utils.js +1 -11
  212. package/dist/utils/validation.utils.js.map +1 -1
  213. package/dist/wallet/wallet.model.d.ts +5 -0
  214. package/dist/wallet/wallet.model.d.ts.map +1 -1
  215. package/dist/wallet/wallet.service.d.ts +2 -1
  216. package/dist/wallet/wallet.service.d.ts.map +1 -1
  217. package/dist/wallet/wallet.service.js +9 -0
  218. package/dist/wallet/wallet.service.js.map +1 -1
  219. package/package.json +19 -6
@@ -0,0 +1,97 @@
1
+ import type { Task } from '../tasks/task.model';
2
+ export type ContactEmailType = 'home' | 'work' | 'other';
3
+ export type ContactPhoneType = 'home' | 'work' | 'mobile' | 'other';
4
+ export type ContactAddressType = 'home' | 'work' | 'other';
5
+ export interface ContactEmail {
6
+ type: ContactEmailType;
7
+ value: string;
8
+ }
9
+ export interface ContactPhone {
10
+ type: ContactPhoneType;
11
+ value: string;
12
+ }
13
+ export interface ContactAddress {
14
+ type: ContactAddressType;
15
+ street?: string;
16
+ city?: string;
17
+ region?: string;
18
+ postalCode?: string;
19
+ country?: string;
20
+ }
21
+ export interface Contact {
22
+ id?: number;
23
+ ownerId: number;
24
+ /** Stable vCard UID, assigned once on creation. */
25
+ uid: string;
26
+ /** vCard FN (formatted name). */
27
+ displayName: string;
28
+ givenName?: string | null;
29
+ familyName?: string | null;
30
+ nickname?: string | null;
31
+ organization?: string | null;
32
+ jobTitle?: string | null;
33
+ emails: ContactEmail[];
34
+ phones: ContactPhone[];
35
+ addresses: ContactAddress[];
36
+ notes?: string | null;
37
+ /** Biome user account that is the same person as this contact, if associated. */
38
+ linkedUserId?: number | null;
39
+ createdAt?: Date | string;
40
+ /** Doubles as the vCard REV-equivalent value. */
41
+ updatedAt?: Date | string;
42
+ }
43
+ export interface CreateContactRequest {
44
+ displayName: string;
45
+ givenName?: string;
46
+ familyName?: string;
47
+ nickname?: string;
48
+ organization?: string;
49
+ jobTitle?: string;
50
+ emails?: ContactEmail[];
51
+ phones?: ContactPhone[];
52
+ addresses?: ContactAddress[];
53
+ notes?: string;
54
+ }
55
+ export interface UpdateContactRequest {
56
+ displayName?: string;
57
+ givenName?: string | null;
58
+ familyName?: string | null;
59
+ nickname?: string | null;
60
+ organization?: string | null;
61
+ jobTitle?: string | null;
62
+ emails?: ContactEmail[];
63
+ phones?: ContactPhone[];
64
+ addresses?: ContactAddress[];
65
+ notes?: string | null;
66
+ }
67
+ export interface ContactListResponse {
68
+ data: Contact[];
69
+ total: number;
70
+ }
71
+ export interface ContactCircleSummary {
72
+ id: number;
73
+ name: string;
74
+ }
75
+ /**
76
+ * A task the contact owner attached to a contact as a **private reminder**.
77
+ * Visible only to the contact owner (never to the linked user or task
78
+ * participants) — see ADR-0016.
79
+ */
80
+ export interface ContactTask {
81
+ taskId: number;
82
+ /** The owner's private reminder text about this task/contact. */
83
+ note?: string | null;
84
+ /** Task summary for display (present on list/attach). */
85
+ task?: Task;
86
+ }
87
+ export interface AttachContactTaskRequest {
88
+ taskId: number;
89
+ note?: string;
90
+ }
91
+ /** Reverse view: one of the operator's contacts linked to a task (owner-private). */
92
+ export interface ContactTaskLink {
93
+ contactId: number;
94
+ contactName: string;
95
+ note?: string | null;
96
+ }
97
+ //# sourceMappingURL=contact.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.model.d.ts","sourceRoot":"","sources":["../../src/contacts/contact.model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AACzD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AACpE,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,OAAO;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,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GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,yDAAyD;IACzD,IAAI,CAAC,EAAE,IAAI,CAAC;CACf;AAED,MAAM,WAAW,wBAAwB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qFAAqF;AACrF,MAAM,WAAW,eAAe;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=contact.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.model.js","sourceRoot":"","sources":["../../src/contacts/contact.model.ts"],"names":[],"mappings":""}
@@ -0,0 +1,312 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "definitions": {
4
+ "Contact": {
5
+ "additionalProperties": true,
6
+ "properties": {
7
+ "addresses": {
8
+ "items": {
9
+ "$ref": "#/definitions/ContactAddress"
10
+ },
11
+ "type": "array"
12
+ },
13
+ "createdAt": {
14
+ "anyOf": [
15
+ {
16
+ "format": "date-time",
17
+ "type": "string"
18
+ },
19
+ {
20
+ "type": "string"
21
+ }
22
+ ]
23
+ },
24
+ "displayName": {
25
+ "description": "vCard FN (formatted name).",
26
+ "type": "string"
27
+ },
28
+ "emails": {
29
+ "items": {
30
+ "$ref": "#/definitions/ContactEmail"
31
+ },
32
+ "type": "array"
33
+ },
34
+ "familyName": {
35
+ "type": [
36
+ "string",
37
+ "null"
38
+ ]
39
+ },
40
+ "givenName": {
41
+ "type": [
42
+ "string",
43
+ "null"
44
+ ]
45
+ },
46
+ "id": {
47
+ "type": "number"
48
+ },
49
+ "jobTitle": {
50
+ "type": [
51
+ "string",
52
+ "null"
53
+ ]
54
+ },
55
+ "linkedUserId": {
56
+ "description": "Biome user account that is the same person as this contact, if associated.",
57
+ "type": [
58
+ "number",
59
+ "null"
60
+ ]
61
+ },
62
+ "nickname": {
63
+ "type": [
64
+ "string",
65
+ "null"
66
+ ]
67
+ },
68
+ "notes": {
69
+ "type": [
70
+ "string",
71
+ "null"
72
+ ]
73
+ },
74
+ "organization": {
75
+ "type": [
76
+ "string",
77
+ "null"
78
+ ]
79
+ },
80
+ "ownerId": {
81
+ "type": "number"
82
+ },
83
+ "phones": {
84
+ "items": {
85
+ "$ref": "#/definitions/ContactPhone"
86
+ },
87
+ "type": "array"
88
+ },
89
+ "uid": {
90
+ "description": "Stable vCard UID, assigned once on creation.",
91
+ "type": "string"
92
+ },
93
+ "updatedAt": {
94
+ "anyOf": [
95
+ {
96
+ "format": "date-time",
97
+ "type": "string"
98
+ },
99
+ {
100
+ "type": "string"
101
+ }
102
+ ],
103
+ "description": "Doubles as the vCard REV-equivalent value."
104
+ }
105
+ },
106
+ "required": [
107
+ "ownerId",
108
+ "uid",
109
+ "displayName",
110
+ "emails",
111
+ "phones",
112
+ "addresses"
113
+ ],
114
+ "type": "object"
115
+ },
116
+ "ContactAddress": {
117
+ "additionalProperties": true,
118
+ "properties": {
119
+ "city": {
120
+ "type": "string"
121
+ },
122
+ "country": {
123
+ "type": "string"
124
+ },
125
+ "postalCode": {
126
+ "type": "string"
127
+ },
128
+ "region": {
129
+ "type": "string"
130
+ },
131
+ "street": {
132
+ "type": "string"
133
+ },
134
+ "type": {
135
+ "$ref": "#/definitions/ContactAddressType"
136
+ }
137
+ },
138
+ "required": [
139
+ "type"
140
+ ],
141
+ "type": "object"
142
+ },
143
+ "ContactAddressType": {
144
+ "enum": [
145
+ "home",
146
+ "work",
147
+ "other"
148
+ ],
149
+ "type": "string"
150
+ },
151
+ "ContactEmail": {
152
+ "additionalProperties": true,
153
+ "properties": {
154
+ "type": {
155
+ "$ref": "#/definitions/ContactEmailType"
156
+ },
157
+ "value": {
158
+ "type": "string"
159
+ }
160
+ },
161
+ "required": [
162
+ "type",
163
+ "value"
164
+ ],
165
+ "type": "object"
166
+ },
167
+ "ContactEmailType": {
168
+ "enum": [
169
+ "home",
170
+ "work",
171
+ "other"
172
+ ],
173
+ "type": "string"
174
+ },
175
+ "ContactPhone": {
176
+ "additionalProperties": true,
177
+ "properties": {
178
+ "type": {
179
+ "$ref": "#/definitions/ContactPhoneType"
180
+ },
181
+ "value": {
182
+ "type": "string"
183
+ }
184
+ },
185
+ "required": [
186
+ "type",
187
+ "value"
188
+ ],
189
+ "type": "object"
190
+ },
191
+ "ContactPhoneType": {
192
+ "enum": [
193
+ "home",
194
+ "work",
195
+ "mobile",
196
+ "other"
197
+ ],
198
+ "type": "string"
199
+ },
200
+ "CreateContactRequest": {
201
+ "additionalProperties": false,
202
+ "properties": {
203
+ "addresses": {
204
+ "items": {
205
+ "$ref": "#/definitions/ContactAddress"
206
+ },
207
+ "type": "array"
208
+ },
209
+ "displayName": {
210
+ "type": "string"
211
+ },
212
+ "emails": {
213
+ "items": {
214
+ "$ref": "#/definitions/ContactEmail"
215
+ },
216
+ "type": "array"
217
+ },
218
+ "familyName": {
219
+ "type": "string"
220
+ },
221
+ "givenName": {
222
+ "type": "string"
223
+ },
224
+ "jobTitle": {
225
+ "type": "string"
226
+ },
227
+ "nickname": {
228
+ "type": "string"
229
+ },
230
+ "notes": {
231
+ "type": "string"
232
+ },
233
+ "organization": {
234
+ "type": "string"
235
+ },
236
+ "phones": {
237
+ "items": {
238
+ "$ref": "#/definitions/ContactPhone"
239
+ },
240
+ "type": "array"
241
+ }
242
+ },
243
+ "required": [
244
+ "displayName"
245
+ ],
246
+ "type": "object"
247
+ },
248
+ "UpdateContactRequest": {
249
+ "additionalProperties": false,
250
+ "properties": {
251
+ "addresses": {
252
+ "items": {
253
+ "$ref": "#/definitions/ContactAddress"
254
+ },
255
+ "type": "array"
256
+ },
257
+ "displayName": {
258
+ "type": "string"
259
+ },
260
+ "emails": {
261
+ "items": {
262
+ "$ref": "#/definitions/ContactEmail"
263
+ },
264
+ "type": "array"
265
+ },
266
+ "familyName": {
267
+ "type": [
268
+ "string",
269
+ "null"
270
+ ]
271
+ },
272
+ "givenName": {
273
+ "type": [
274
+ "string",
275
+ "null"
276
+ ]
277
+ },
278
+ "jobTitle": {
279
+ "type": [
280
+ "string",
281
+ "null"
282
+ ]
283
+ },
284
+ "nickname": {
285
+ "type": [
286
+ "string",
287
+ "null"
288
+ ]
289
+ },
290
+ "notes": {
291
+ "type": [
292
+ "string",
293
+ "null"
294
+ ]
295
+ },
296
+ "organization": {
297
+ "type": [
298
+ "string",
299
+ "null"
300
+ ]
301
+ },
302
+ "phones": {
303
+ "items": {
304
+ "$ref": "#/definitions/ContactPhone"
305
+ },
306
+ "type": "array"
307
+ }
308
+ },
309
+ "type": "object"
310
+ }
311
+ }
312
+ }
@@ -0,0 +1,28 @@
1
+ import { BiomeHttpClient } from '../core/http-client';
2
+ import { Contact, ContactCircleSummary, ContactListResponse, ContactTask, AttachContactTaskRequest, CreateContactRequest, UpdateContactRequest } from './contact.model';
3
+ export declare class BiomeContacts {
4
+ private http;
5
+ constructor(http: BiomeHttpClient);
6
+ list(): Promise<ContactListResponse>;
7
+ /**
8
+ * Searches the caller's own contacts by displayName/organization/nickname.
9
+ * Kept separate from list() so callers get an always-fresh, uncached call
10
+ * (list()'s FE wrapper caches its "give me everything" result).
11
+ */
12
+ search(keyword?: string, limit?: number): Promise<Contact[]>;
13
+ get(id: number): Promise<Contact>;
14
+ create(data: CreateContactRequest): Promise<Contact>;
15
+ update(id: number, data: UpdateContactRequest): Promise<Contact>;
16
+ delete(id: number): Promise<void>;
17
+ listCircles(id: number): Promise<ContactCircleSummary[]>;
18
+ /** Associates a contact with the Biome user account that is the same person. */
19
+ linkUser(id: number, userId: number): Promise<Contact>;
20
+ unlinkUser(id: number): Promise<Contact>;
21
+ /** The tasks the operator attached to this contact as private reminders. */
22
+ listTasks(id: number): Promise<ContactTask[]>;
23
+ /** Attach a task the operator is involved in to this contact, with an optional note. */
24
+ attachTask(id: number, data: AttachContactTaskRequest): Promise<ContactTask>;
25
+ updateTaskNote(id: number, taskId: number, note: string): Promise<ContactTask>;
26
+ detachTask(id: number, taskId: number): Promise<void>;
27
+ }
28
+ //# sourceMappingURL=contact.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.service.d.ts","sourceRoot":"","sources":["../../src/contacts/contact.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,WAAW,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAExK,qBAAa,aAAa;IACV,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,eAAe;IAEnC,IAAI,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAM1C;;;;OAIG;IACG,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAkBxD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMjC,MAAM,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAMpD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAShE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKjC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAM9D,gFAAgF;IAC1E,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMtD,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQ9C,4EAA4E;IACtE,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAMnD,wFAAwF;IAClF,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,WAAW,CAAC;IAM5E,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAM9E,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAI9D"}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BiomeContacts = void 0;
4
+ const error_handler_1 = require("../core/error-handler");
5
+ class BiomeContacts {
6
+ constructor(http) {
7
+ this.http = http;
8
+ }
9
+ async list() {
10
+ const response = await this.http.get('/contacts');
11
+ if (!response.isSuccess)
12
+ throw (0, error_handler_1.createSdkError)(response);
13
+ return response.payload;
14
+ }
15
+ /**
16
+ * Searches the caller's own contacts by displayName/organization/nickname.
17
+ * Kept separate from list() so callers get an always-fresh, uncached call
18
+ * (list()'s FE wrapper caches its "give me everything" result).
19
+ */
20
+ async search(keyword, limit = 20) {
21
+ // Whitespace-only keyword is a deliberate no-match, mirroring BiomeUsers.findUsers:
22
+ // '' is valid (returns all, respecting limit), but ' '/'\t' returns [] without a call.
23
+ if (keyword !== undefined && keyword.length > 0 && keyword.trim().length === 0) {
24
+ return [];
25
+ }
26
+ const params = new URLSearchParams();
27
+ if (keyword !== undefined && keyword.trim().length > 0) {
28
+ params.set('q', keyword);
29
+ }
30
+ params.set('limit', String(Math.min(Math.max(1, limit), 100)));
31
+ const response = await this.http.get(`/contacts?${params.toString()}`);
32
+ if (!response.isSuccess)
33
+ throw (0, error_handler_1.createSdkError)(response);
34
+ return response.payload.data;
35
+ }
36
+ async get(id) {
37
+ const response = await this.http.get(`/contact/${id}`);
38
+ if (!response.isSuccess)
39
+ throw (0, error_handler_1.createSdkError)(response);
40
+ return response.payload;
41
+ }
42
+ async create(data) {
43
+ const response = await this.http.post('/contact', data);
44
+ if (!response.isSuccess)
45
+ throw (0, error_handler_1.createSdkError)(response);
46
+ return response.payload;
47
+ }
48
+ async update(id, data) {
49
+ const response = await this.http.put(`/contact/${id}`, data);
50
+ if (!response.isSuccess)
51
+ throw (0, error_handler_1.createSdkError)(response);
52
+ return response.payload;
53
+ }
54
+ // BE responds 200 + a JSON ApiResponse body here (not a bare 204),
55
+ // deliberately sidestepping the empty-body isSuccess bug documented in
56
+ // sst/retrospectives/LOG.md for BiomeAgents.delete.
57
+ async delete(id) {
58
+ const response = await this.http.delete(`/contact/${id}`);
59
+ if (!response.isSuccess)
60
+ throw (0, error_handler_1.createSdkError)(response);
61
+ }
62
+ async listCircles(id) {
63
+ const response = await this.http.get(`/contact/${id}/circles`);
64
+ if (!response.isSuccess)
65
+ throw (0, error_handler_1.createSdkError)(response);
66
+ return response.payload;
67
+ }
68
+ /** Associates a contact with the Biome user account that is the same person. */
69
+ async linkUser(id, userId) {
70
+ const response = await this.http.post(`/contact/${id}/link-user`, { userId });
71
+ if (!response.isSuccess)
72
+ throw (0, error_handler_1.createSdkError)(response);
73
+ return response.payload;
74
+ }
75
+ async unlinkUser(id) {
76
+ const response = await this.http.delete(`/contact/${id}/link-user`);
77
+ if (!response.isSuccess)
78
+ throw (0, error_handler_1.createSdkError)(response);
79
+ return response.payload;
80
+ }
81
+ // ── Private task reminders (owner-only; ADR-0016) ──────────────────────────
82
+ /** The tasks the operator attached to this contact as private reminders. */
83
+ async listTasks(id) {
84
+ const response = await this.http.get(`/contact/${id}/tasks`);
85
+ if (!response.isSuccess)
86
+ throw (0, error_handler_1.createSdkError)(response);
87
+ return response.payload;
88
+ }
89
+ /** Attach a task the operator is involved in to this contact, with an optional note. */
90
+ async attachTask(id, data) {
91
+ const response = await this.http.post(`/contact/${id}/tasks`, data);
92
+ if (!response.isSuccess)
93
+ throw (0, error_handler_1.createSdkError)(response);
94
+ return response.payload;
95
+ }
96
+ async updateTaskNote(id, taskId, note) {
97
+ const response = await this.http.patch(`/contact/${id}/tasks/${taskId}`, { note });
98
+ if (!response.isSuccess)
99
+ throw (0, error_handler_1.createSdkError)(response);
100
+ return response.payload;
101
+ }
102
+ async detachTask(id, taskId) {
103
+ const response = await this.http.delete(`/contact/${id}/tasks/${taskId}`);
104
+ if (!response.isSuccess)
105
+ throw (0, error_handler_1.createSdkError)(response);
106
+ }
107
+ }
108
+ exports.BiomeContacts = BiomeContacts;
109
+ //# sourceMappingURL=contact.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.service.js","sourceRoot":"","sources":["../../src/contacts/contact.service.ts"],"names":[],"mappings":";;;AACA,yDAAuD;AAIvD,MAAa,aAAa;IACtB,YAAoB,IAAqB;QAArB,SAAI,GAAJ,IAAI,CAAiB;IAAG,CAAC;IAE7C,KAAK,CAAC,IAAI;QACN,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAmC,WAAW,CAAC,CAAC;QACpF,IAAI,CAAC,QAAQ,CAAC,SAAS;YAAE,MAAM,IAAA,8BAAc,EAAC,QAAQ,CAAC,CAAC;QACxD,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,OAAgB,EAAE,KAAK,GAAG,EAAE;QACrC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AAA,8BAAc,EAAC,QAAQ,CAAC,CAAC;QACxD,OAAO,QAAQ,CAAC,OAAO,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,EAAU,EAAE,MAAc;QACvC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAoB,YAAY,EAAE,UAAU,MAAM,EAAE,CAAC,CAAC;QAC7F,IAAI,CAAC,QAAQ,CAAC,SAAS;YAAE,MAAM,IAAA,8BAAc,EAAC,QAAQ,CAAC,CAAC;IAC5D,CAAC;CACJ;AAvGD,sCAuGC"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Structured API failure diagnostics for BiomeSDK HTTP calls.
3
+ * Used by BiomeHttpClient to classify failures and surface them to consumers
4
+ * (e.g. Angular FE) via a CustomEvent + console logging.
5
+ */
6
+ import type { RequestPriority, RequestSchedulerSnapshot } from "./request-scheduler";
7
+ export declare const BIOME_API_ERROR_EVENT = "biome:api-error";
8
+ export type ApiFailureKind = "timeout" | "queue_timeout" | "rate_limited" | "network" | "http_error" | "unknown";
9
+ export interface RateLimitSnapshot {
10
+ limit?: number;
11
+ remaining?: number;
12
+ reset?: string;
13
+ retryAfterSeconds?: number;
14
+ }
15
+ export interface ApiFailureDiagnostic {
16
+ tag: "[BiomeSDK]";
17
+ kind: ApiFailureKind;
18
+ method?: string;
19
+ url?: string;
20
+ status?: number;
21
+ code?: string;
22
+ elapsedMs: number;
23
+ timeoutMs?: number;
24
+ message?: string;
25
+ rateLimit?: RateLimitSnapshot;
26
+ /** Present on `queue_timeout` — client RequestScheduler pressure at fail time. */
27
+ scheduler?: RequestSchedulerSnapshot;
28
+ /** Priority the timed-out waiter was using (when known). */
29
+ requestPriority?: RequestPriority;
30
+ timestamp: string;
31
+ }
32
+ /** Axios-like error shape used for classification without importing axios here. */
33
+ export interface ClassifiableHttpError {
34
+ code?: string;
35
+ message?: string;
36
+ isQueueTimeout?: boolean;
37
+ priority?: RequestPriority;
38
+ maxWaitMs?: number;
39
+ scheduler?: RequestSchedulerSnapshot;
40
+ config?: {
41
+ url?: string;
42
+ method?: string;
43
+ timeout?: number;
44
+ baseURL?: string;
45
+ _startTime?: number;
46
+ biomePriority?: RequestPriority;
47
+ };
48
+ response?: {
49
+ status?: number;
50
+ headers?: Record<string, unknown>;
51
+ data?: {
52
+ message?: string;
53
+ payload?: {
54
+ message?: string;
55
+ retryAfter?: number;
56
+ data?: {
57
+ retryAfter?: number;
58
+ };
59
+ };
60
+ data?: {
61
+ retryAfter?: number;
62
+ };
63
+ };
64
+ };
65
+ }
66
+ /**
67
+ * Extract rate-limit metadata from standard RateLimit-* / Retry-After headers
68
+ * and optional JSON body fields.
69
+ */
70
+ export declare function extractRateLimitInfo(error: ClassifiableHttpError): RateLimitSnapshot | undefined;
71
+ /**
72
+ * Classify an HTTP client failure for diagnostics and UX.
73
+ */
74
+ export declare function classifyApiFailure(error: ClassifiableHttpError): ApiFailureKind;
75
+ /**
76
+ * Build a structured diagnostic payload from an axios-like error.
77
+ */
78
+ export declare function buildApiFailureDiagnostic(error: ClassifiableHttpError, elapsedMs?: number): ApiFailureDiagnostic;
79
+ /**
80
+ * Log a failure diagnostic and dispatch `biome:api-error` for FE consumers.
81
+ */
82
+ export declare function reportApiFailure(error: ClassifiableHttpError, elapsedMs?: number): ApiFailureDiagnostic;
83
+ /**
84
+ * Map failure kind to stable SDK error codes used in BiomeSdkError.code.
85
+ */
86
+ export declare function failureKindToErrorCode(kind: ApiFailureKind): string | undefined;
87
+ /**
88
+ * User-facing message for timeout / network when the server did not respond.
89
+ */
90
+ export declare function userMessageForTransportFailure(kind: ApiFailureKind, retryAfterSeconds?: number): string | undefined;
91
+ //# sourceMappingURL=api-diagnostics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-diagnostics.d.ts","sourceRoot":"","sources":["../../src/core/api-diagnostics.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,w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