@iveri/contracts 0.7.0 → 0.8.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 (114) hide show
  1. package/README.md +22 -4
  2. package/dist/cjs/api/unibox/canned-reply.type.d.ts +49 -0
  3. package/dist/cjs/api/unibox/canned-reply.type.d.ts.map +1 -0
  4. package/dist/cjs/api/unibox/canned-reply.type.js +3 -0
  5. package/dist/cjs/api/unibox/canned-reply.type.js.map +1 -0
  6. package/dist/cjs/api/unibox/channel-platform.enum.d.ts +32 -0
  7. package/dist/cjs/api/unibox/channel-platform.enum.d.ts.map +1 -0
  8. package/dist/cjs/api/unibox/channel-platform.enum.js +36 -0
  9. package/dist/cjs/api/unibox/channel-platform.enum.js.map +1 -0
  10. package/dist/cjs/api/unibox/channel.type.d.ts +110 -0
  11. package/dist/cjs/api/unibox/channel.type.d.ts.map +1 -0
  12. package/dist/cjs/api/unibox/channel.type.js +3 -0
  13. package/dist/cjs/api/unibox/channel.type.js.map +1 -0
  14. package/dist/cjs/api/unibox/contact.type.d.ts +102 -0
  15. package/dist/cjs/api/unibox/contact.type.d.ts.map +1 -0
  16. package/dist/cjs/api/unibox/contact.type.js +3 -0
  17. package/dist/cjs/api/unibox/contact.type.js.map +1 -0
  18. package/dist/cjs/api/unibox/conversation-status.enum.d.ts +39 -0
  19. package/dist/cjs/api/unibox/conversation-status.enum.d.ts.map +1 -0
  20. package/dist/cjs/api/unibox/conversation-status.enum.js +43 -0
  21. package/dist/cjs/api/unibox/conversation-status.enum.js.map +1 -0
  22. package/dist/cjs/api/unibox/conversation.type.d.ts +134 -0
  23. package/dist/cjs/api/unibox/conversation.type.d.ts.map +1 -0
  24. package/dist/cjs/api/unibox/conversation.type.js +3 -0
  25. package/dist/cjs/api/unibox/conversation.type.js.map +1 -0
  26. package/dist/cjs/api/unibox/index.d.ts +13 -0
  27. package/dist/cjs/api/unibox/index.d.ts.map +1 -0
  28. package/dist/cjs/api/unibox/index.js +29 -0
  29. package/dist/cjs/api/unibox/index.js.map +1 -0
  30. package/dist/cjs/api/unibox/message-author-type.enum.d.ts +26 -0
  31. package/dist/cjs/api/unibox/message-author-type.enum.d.ts.map +1 -0
  32. package/dist/cjs/api/unibox/message-author-type.enum.js +30 -0
  33. package/dist/cjs/api/unibox/message-author-type.enum.js.map +1 -0
  34. package/dist/cjs/api/unibox/message-content-type.enum.d.ts +29 -0
  35. package/dist/cjs/api/unibox/message-content-type.enum.d.ts.map +1 -0
  36. package/dist/cjs/api/unibox/message-content-type.enum.js +33 -0
  37. package/dist/cjs/api/unibox/message-content-type.enum.js.map +1 -0
  38. package/dist/cjs/api/unibox/message-direction.enum.d.ts +23 -0
  39. package/dist/cjs/api/unibox/message-direction.enum.d.ts.map +1 -0
  40. package/dist/cjs/api/unibox/message-direction.enum.js +27 -0
  41. package/dist/cjs/api/unibox/message-direction.enum.js.map +1 -0
  42. package/dist/cjs/api/unibox/message-status.enum.d.ts +40 -0
  43. package/dist/cjs/api/unibox/message-status.enum.d.ts.map +1 -0
  44. package/dist/cjs/api/unibox/message-status.enum.js +44 -0
  45. package/dist/cjs/api/unibox/message-status.enum.js.map +1 -0
  46. package/dist/cjs/api/unibox/message.type.d.ts +120 -0
  47. package/dist/cjs/api/unibox/message.type.d.ts.map +1 -0
  48. package/dist/cjs/api/unibox/message.type.js +3 -0
  49. package/dist/cjs/api/unibox/message.type.js.map +1 -0
  50. package/dist/cjs/api/unibox/team.type.d.ts +50 -0
  51. package/dist/cjs/api/unibox/team.type.d.ts.map +1 -0
  52. package/dist/cjs/api/unibox/team.type.js +3 -0
  53. package/dist/cjs/api/unibox/team.type.js.map +1 -0
  54. package/dist/cjs/enum/user-permission.enum.d.ts +48 -1
  55. package/dist/cjs/enum/user-permission.enum.d.ts.map +1 -1
  56. package/dist/cjs/enum/user-permission.enum.js +54 -0
  57. package/dist/cjs/enum/user-permission.enum.js.map +1 -1
  58. package/dist/esm/api/unibox/canned-reply.type.d.ts +49 -0
  59. package/dist/esm/api/unibox/canned-reply.type.d.ts.map +1 -0
  60. package/dist/esm/api/unibox/canned-reply.type.js +2 -0
  61. package/dist/esm/api/unibox/canned-reply.type.js.map +1 -0
  62. package/dist/esm/api/unibox/channel-platform.enum.d.ts +32 -0
  63. package/dist/esm/api/unibox/channel-platform.enum.d.ts.map +1 -0
  64. package/dist/esm/api/unibox/channel-platform.enum.js +33 -0
  65. package/dist/esm/api/unibox/channel-platform.enum.js.map +1 -0
  66. package/dist/esm/api/unibox/channel.type.d.ts +110 -0
  67. package/dist/esm/api/unibox/channel.type.d.ts.map +1 -0
  68. package/dist/esm/api/unibox/channel.type.js +2 -0
  69. package/dist/esm/api/unibox/channel.type.js.map +1 -0
  70. package/dist/esm/api/unibox/contact.type.d.ts +102 -0
  71. package/dist/esm/api/unibox/contact.type.d.ts.map +1 -0
  72. package/dist/esm/api/unibox/contact.type.js +2 -0
  73. package/dist/esm/api/unibox/contact.type.js.map +1 -0
  74. package/dist/esm/api/unibox/conversation-status.enum.d.ts +39 -0
  75. package/dist/esm/api/unibox/conversation-status.enum.d.ts.map +1 -0
  76. package/dist/esm/api/unibox/conversation-status.enum.js +40 -0
  77. package/dist/esm/api/unibox/conversation-status.enum.js.map +1 -0
  78. package/dist/esm/api/unibox/conversation.type.d.ts +134 -0
  79. package/dist/esm/api/unibox/conversation.type.d.ts.map +1 -0
  80. package/dist/esm/api/unibox/conversation.type.js +2 -0
  81. package/dist/esm/api/unibox/conversation.type.js.map +1 -0
  82. package/dist/esm/api/unibox/index.d.ts +13 -0
  83. package/dist/esm/api/unibox/index.d.ts.map +1 -0
  84. package/dist/esm/api/unibox/index.js +13 -0
  85. package/dist/esm/api/unibox/index.js.map +1 -0
  86. package/dist/esm/api/unibox/message-author-type.enum.d.ts +26 -0
  87. package/dist/esm/api/unibox/message-author-type.enum.d.ts.map +1 -0
  88. package/dist/esm/api/unibox/message-author-type.enum.js +27 -0
  89. package/dist/esm/api/unibox/message-author-type.enum.js.map +1 -0
  90. package/dist/esm/api/unibox/message-content-type.enum.d.ts +29 -0
  91. package/dist/esm/api/unibox/message-content-type.enum.d.ts.map +1 -0
  92. package/dist/esm/api/unibox/message-content-type.enum.js +30 -0
  93. package/dist/esm/api/unibox/message-content-type.enum.js.map +1 -0
  94. package/dist/esm/api/unibox/message-direction.enum.d.ts +23 -0
  95. package/dist/esm/api/unibox/message-direction.enum.d.ts.map +1 -0
  96. package/dist/esm/api/unibox/message-direction.enum.js +24 -0
  97. package/dist/esm/api/unibox/message-direction.enum.js.map +1 -0
  98. package/dist/esm/api/unibox/message-status.enum.d.ts +40 -0
  99. package/dist/esm/api/unibox/message-status.enum.d.ts.map +1 -0
  100. package/dist/esm/api/unibox/message-status.enum.js +41 -0
  101. package/dist/esm/api/unibox/message-status.enum.js.map +1 -0
  102. package/dist/esm/api/unibox/message.type.d.ts +120 -0
  103. package/dist/esm/api/unibox/message.type.d.ts.map +1 -0
  104. package/dist/esm/api/unibox/message.type.js +2 -0
  105. package/dist/esm/api/unibox/message.type.js.map +1 -0
  106. package/dist/esm/api/unibox/team.type.d.ts +50 -0
  107. package/dist/esm/api/unibox/team.type.d.ts.map +1 -0
  108. package/dist/esm/api/unibox/team.type.js +2 -0
  109. package/dist/esm/api/unibox/team.type.js.map +1 -0
  110. package/dist/esm/enum/user-permission.enum.d.ts +48 -1
  111. package/dist/esm/enum/user-permission.enum.d.ts.map +1 -1
  112. package/dist/esm/enum/user-permission.enum.js +54 -0
  113. package/dist/esm/enum/user-permission.enum.js.map +1 -1
  114. package/package.json +9 -1
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=message.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.type.js","sourceRoot":"","sources":["../../../../src/api/unibox/message.type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,50 @@
1
+ import type { IsoDateTime } from '../../type/iso-date-time.type.js';
2
+ import type { Nullable } from '../../type/nil.type.js';
3
+ import type { Paginated } from '../../type/paginated.type.js';
4
+ import type { UUID } from '../../type/uuid.type.js';
5
+ /**
6
+ * A group of agents work is routed to — Support, Sales, Billing.
7
+ *
8
+ * **A team is not a role and not a membership.** Identity owns who exists and what they may do;
9
+ * this owns who is expected to answer what. Keeping them apart is what lets an agent be moved
10
+ * between teams without touching their permissions, which is the operation that actually happens
11
+ * weekly.
12
+ *
13
+ * `memberUserIds` names users in `iveri-identity-api`, so it is a loose reference with no foreign
14
+ * key. A user removed there leaves a stale id here; Unibox filters those out when resolving a
15
+ * team rather than pretending it can prevent them.
16
+ */
17
+ export interface Team {
18
+ id: UUID;
19
+ name: string;
20
+ description: Nullable<string>;
21
+ /** Identity user ids. Order is not meaningful. */
22
+ memberUserIds: UUID[];
23
+ /**
24
+ * Conversations on these channels are routed to this team when nothing else claims them.
25
+ *
26
+ * Empty means the team takes no automatic routing and is assignment-only. Deliberately a list
27
+ * on the team rather than a team id on the channel: a channel routed to two teams during a
28
+ * handover period is a real thing customers ask for, and the other direction cannot express it.
29
+ */
30
+ channelIds: UUID[];
31
+ createdAt: IsoDateTime;
32
+ updatedAt: IsoDateTime;
33
+ }
34
+ /** `GET /api/v1/teams`. Offset-paged; a tenant has a handful. */
35
+ export type TeamsPage = Paginated<Team>;
36
+ /** `POST /api/v1/teams`. */
37
+ export interface CreateTeamBody {
38
+ name: string;
39
+ description?: Nullable<string>;
40
+ memberUserIds?: Nullable<UUID[]>;
41
+ channelIds?: Nullable<UUID[]>;
42
+ }
43
+ /** `PATCH /api/v1/teams/:id`. Both id lists replace wholesale; omit to leave alone, `[]` clears. */
44
+ export interface UpdateTeamBody {
45
+ name?: string;
46
+ description?: Nullable<string>;
47
+ memberUserIds?: Nullable<UUID[]>;
48
+ channelIds?: Nullable<UUID[]>;
49
+ }
50
+ //# sourceMappingURL=team.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team.type.d.ts","sourceRoot":"","sources":["../../../../src/api/unibox/team.type.ts"],"names":[],"mappings":"AAAA,OAAO,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js","sourceRoot":"","sources":["../../../../src/api/unibox/team.type.ts"],"names":[],"mappings":""}
@@ -128,7 +128,54 @@ export declare enum UserPermission {
128
128
  */
129
129
  CONDUIT_DISPATCH_SEND = "conduit:dispatch:send",
130
130
  /** Redrive a dead-lettered dispatch, or cancel one still pending. */
131
- CONDUIT_DISPATCH_OPERATE = "conduit:dispatch:operate"
131
+ CONDUIT_DISPATCH_OPERATE = "conduit:dispatch:operate",
132
+ /** Read connected messaging accounts. Never exposes a channel's ingest secret. */
133
+ UNIBOX_CHANNEL_READ = "unibox:channel:read",
134
+ /**
135
+ * Connect, amend or disconnect a messaging account, and rotate its ingest secret.
136
+ *
137
+ * A single manage permission for the same reason as `CONDUIT_CONNECTION_MANAGE`: the
138
+ * dangerous act is holding the credential that lets anything post messages into a tenant's
139
+ * inbox, and create/update/delete carry that identically.
140
+ */
141
+ UNIBOX_CHANNEL_MANAGE = "unibox:channel:manage",
142
+ /** Read contacts. Personal data — closer to a data-export permission than a config one. */
143
+ UNIBOX_CONTACT_READ = "unibox:contact:read",
144
+ /** Create, amend or delete a contact record. */
145
+ UNIBOX_CONTACT_MANAGE = "unibox:contact:manage",
146
+ /**
147
+ * Read the inbox and every message in it.
148
+ *
149
+ * **There is deliberately no separate `unibox:message:read`.** A conversation with its
150
+ * messages hidden is an empty row, so a permission that granted one without the other would
151
+ * describe a screen nobody can use — and the reverse would be a way to read a customer's
152
+ * messages while appearing to have no access to the inbox.
153
+ */
154
+ UNIBOX_CONVERSATION_READ = "unibox:conversation:read",
155
+ /** Change a conversation's status — close, snooze, reopen — and write internal notes. */
156
+ UNIBOX_CONVERSATION_MANAGE = "unibox:conversation:manage",
157
+ /**
158
+ * Assign a conversation to an agent or a team, and take over from the AI.
159
+ *
160
+ * Separate from `UNIBOX_CONVERSATION_MANAGE` because assignment decides whose work this is.
161
+ * A supervisor routing a queue and an agent closing their own conversations are different
162
+ * jobs, and a tenant that wants only the first to reassign should be able to say so.
163
+ */
164
+ UNIBOX_CONVERSATION_ASSIGN = "unibox:conversation:assign",
165
+ /**
166
+ * Send a message to a contact.
167
+ *
168
+ * The sharpest permission in this service, and the reason there is no `unibox:message:*`
169
+ * read counterpart. Everything else here moves rows around inside our own database; this one
170
+ * reaches a real person on their phone, through a paid channel, and cannot be taken back.
171
+ */
172
+ UNIBOX_MESSAGE_SEND = "unibox:message:send",
173
+ UNIBOX_TEAM_READ = "unibox:team:read",
174
+ /** Create teams and change who is in them. Routing, not permissions — identity owns those. */
175
+ UNIBOX_TEAM_MANAGE = "unibox:team:manage",
176
+ UNIBOX_CANNED_REPLY_READ = "unibox:canned-reply:read",
177
+ /** Author the saved replies every agent in the tenant will send. */
178
+ UNIBOX_CANNED_REPLY_MANAGE = "unibox:canned-reply:manage"
132
179
  }
133
180
  /**
134
181
  * Every member, for seeding the owner role and validating custom-role input.
@@ -1 +1 @@
1
- {"version":3,"file":"user-permission.enum.d.ts","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,cAAc;IAItB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,sFAAsF;IACtF,aAAa,kBAAkB;IAG/B,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAG3B,eAAe,oBAAoB;IACnC,6EAA6E;IAC7E,iBAAiB,sBAAsB;IACvC;;;OAGG;IACH,sBAAsB,2BAA2B;IAGjD,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAG3B,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;IAKjC,qEAAqE;IACrE,qBAAqB,0BAA0B;IAC/C,uBAAuB,4BAA4B;IACnD,uBAAuB,4BAA4B;IACnD,uBAAuB,4BAA4B;IAGnD;;;;OAIG;IACH,oBAAoB,yBAAyB;IAC7C,sBAAsB,2BAA2B;IAGjD;;;;OAIG;IACH,sBAAsB,2BAA2B;IAGjD,qBAAqB,0BAA0B;IAC/C,yFAAyF;IACzF,uBAAuB,4BAA4B;IAGnD,mEAAmE;IACnE,wBAAwB,6BAA6B;IACrD;;;;;;;OAOG;IACH,0BAA0B,+BAA+B;IAGzD,kBAAkB,uBAAuB;IACzC,2DAA2D;IAC3D,oBAAoB,yBAAyB;IAG7C;;;;;OAKG;IACH,qBAAqB,0BAA0B;IAC/C;;;;;;OAMG;IACH,wBAAwB,6BAA6B;IAGrD,wFAAwF;IACxF,sBAAsB,2BAA2B;IACjD;;;;;;;;OAQG;IACH,wBAAwB,6BAA6B;IAGrD,sEAAsE;IACtE,uBAAuB,4BAA4B;IACnD;;;;;OAKG;IACH,yBAAyB,8BAA8B;IAGvD;;;;;OAKG;IACH,qBAAqB,0BAA0B;IAC/C;;;;;;;OAOG;IACH,qBAAqB,0BAA0B;IAC/C,qEAAqE;IACrE,wBAAwB,6BAA6B;CACxD;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,cAAc,EAAiD,CAAC"}
1
+ {"version":3,"file":"user-permission.enum.d.ts","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,oBAAY,cAAc;IAItB,WAAW,gBAAgB;IAC3B,aAAa,kBAAkB;IAC/B,sFAAsF;IACtF,aAAa,kBAAkB;IAG/B,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAG3B,eAAe,oBAAoB;IACnC,6EAA6E;IAC7E,iBAAiB,sBAAsB;IACvC;;;OAGG;IACH,sBAAsB,2BAA2B;IAGjD,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAG3B,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,cAAc,mBA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;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,cAAc,EAAiD,CAAC"}
@@ -147,6 +147,60 @@ export var UserPermission;
147
147
  UserPermission["CONDUIT_DISPATCH_SEND"] = "conduit:dispatch:send";
148
148
  /** Redrive a dead-lettered dispatch, or cancel one still pending. */
149
149
  UserPermission["CONDUIT_DISPATCH_OPERATE"] = "conduit:dispatch:operate";
150
+ // ══ unibox-api ═══════════════════════════════════════════════════════════
151
+ // ── Channel ─────────────────────────────────────────────────────────────
152
+ /** Read connected messaging accounts. Never exposes a channel's ingest secret. */
153
+ UserPermission["UNIBOX_CHANNEL_READ"] = "unibox:channel:read";
154
+ /**
155
+ * Connect, amend or disconnect a messaging account, and rotate its ingest secret.
156
+ *
157
+ * A single manage permission for the same reason as `CONDUIT_CONNECTION_MANAGE`: the
158
+ * dangerous act is holding the credential that lets anything post messages into a tenant's
159
+ * inbox, and create/update/delete carry that identically.
160
+ */
161
+ UserPermission["UNIBOX_CHANNEL_MANAGE"] = "unibox:channel:manage";
162
+ // ── Contact ─────────────────────────────────────────────────────────────
163
+ /** Read contacts. Personal data — closer to a data-export permission than a config one. */
164
+ UserPermission["UNIBOX_CONTACT_READ"] = "unibox:contact:read";
165
+ /** Create, amend or delete a contact record. */
166
+ UserPermission["UNIBOX_CONTACT_MANAGE"] = "unibox:contact:manage";
167
+ // ── Conversation ────────────────────────────────────────────────────────
168
+ /**
169
+ * Read the inbox and every message in it.
170
+ *
171
+ * **There is deliberately no separate `unibox:message:read`.** A conversation with its
172
+ * messages hidden is an empty row, so a permission that granted one without the other would
173
+ * describe a screen nobody can use — and the reverse would be a way to read a customer's
174
+ * messages while appearing to have no access to the inbox.
175
+ */
176
+ UserPermission["UNIBOX_CONVERSATION_READ"] = "unibox:conversation:read";
177
+ /** Change a conversation's status — close, snooze, reopen — and write internal notes. */
178
+ UserPermission["UNIBOX_CONVERSATION_MANAGE"] = "unibox:conversation:manage";
179
+ /**
180
+ * Assign a conversation to an agent or a team, and take over from the AI.
181
+ *
182
+ * Separate from `UNIBOX_CONVERSATION_MANAGE` because assignment decides whose work this is.
183
+ * A supervisor routing a queue and an agent closing their own conversations are different
184
+ * jobs, and a tenant that wants only the first to reassign should be able to say so.
185
+ */
186
+ UserPermission["UNIBOX_CONVERSATION_ASSIGN"] = "unibox:conversation:assign";
187
+ // ── Message ─────────────────────────────────────────────────────────────
188
+ /**
189
+ * Send a message to a contact.
190
+ *
191
+ * The sharpest permission in this service, and the reason there is no `unibox:message:*`
192
+ * read counterpart. Everything else here moves rows around inside our own database; this one
193
+ * reaches a real person on their phone, through a paid channel, and cannot be taken back.
194
+ */
195
+ UserPermission["UNIBOX_MESSAGE_SEND"] = "unibox:message:send";
196
+ // ── Team ────────────────────────────────────────────────────────────────
197
+ UserPermission["UNIBOX_TEAM_READ"] = "unibox:team:read";
198
+ /** Create teams and change who is in them. Routing, not permissions — identity owns those. */
199
+ UserPermission["UNIBOX_TEAM_MANAGE"] = "unibox:team:manage";
200
+ // ── Canned reply ────────────────────────────────────────────────────────
201
+ UserPermission["UNIBOX_CANNED_REPLY_READ"] = "unibox:canned-reply:read";
202
+ /** Author the saved replies every agent in the tenant will send. */
203
+ UserPermission["UNIBOX_CANNED_REPLY_MANAGE"] = "unibox:canned-reply:manage";
150
204
  })(UserPermission || (UserPermission = {}));
151
205
  /**
152
206
  * Every member, for seeding the owner role and validating custom-role input.
@@ -1 +1 @@
1
- {"version":3,"file":"user-permission.enum.js","sourceRoot":"","sources":["../../../src/enum/user-permission.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAN,IAAY,cAkJX;AAlJD,WAAY,cAAc;IACtB,4EAA4E;IAE5E,2EAA2E;IAC3E,6CAA2B,CAAA;IAC3B,iDAA+B,CAAA;IAC/B,sFAAsF;IACtF,iDAA+B,CAAA;IAE/B,2EAA2E;IAC3E,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;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.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -34,6 +34,11 @@
34
34
  "import": "./dist/esm/api/identity/index.js",
35
35
  "require": "./dist/cjs/api/identity/index.js"
36
36
  },
37
+ "./unibox": {
38
+ "types": "./dist/cjs/api/unibox/index.d.ts",
39
+ "import": "./dist/esm/api/unibox/index.js",
40
+ "require": "./dist/cjs/api/unibox/index.js"
41
+ },
37
42
  "./package.json": "./package.json"
38
43
  },
39
44
  "typesVersions": {
@@ -43,6 +48,9 @@
43
48
  ],
44
49
  "identity": [
45
50
  "./dist/cjs/api/identity/index.d.ts"
51
+ ],
52
+ "unibox": [
53
+ "./dist/cjs/api/unibox/index.d.ts"
46
54
  ]
47
55
  }
48
56
  },