@iveri/contracts 0.5.0 → 0.7.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 (86) hide show
  1. package/README.md +8 -2
  2. package/dist/cjs/api/conduit/connection.type.d.ts +100 -0
  3. package/dist/cjs/api/conduit/connection.type.d.ts.map +1 -0
  4. package/dist/cjs/api/conduit/connection.type.js +3 -0
  5. package/dist/cjs/api/conduit/connection.type.js.map +1 -0
  6. package/dist/cjs/api/conduit/connector-auth-type.enum.d.ts +42 -0
  7. package/dist/cjs/api/conduit/connector-auth-type.enum.d.ts.map +1 -0
  8. package/dist/cjs/api/conduit/connector-auth-type.enum.js +46 -0
  9. package/dist/cjs/api/conduit/connector-auth-type.enum.js.map +1 -0
  10. package/dist/cjs/api/conduit/connector.type.d.ts +179 -0
  11. package/dist/cjs/api/conduit/connector.type.d.ts.map +1 -0
  12. package/dist/cjs/api/conduit/connector.type.js +13 -0
  13. package/dist/cjs/api/conduit/connector.type.js.map +1 -0
  14. package/dist/cjs/api/conduit/dispatch-status.enum.d.ts +40 -0
  15. package/dist/cjs/api/conduit/dispatch-status.enum.d.ts.map +1 -0
  16. package/dist/cjs/api/conduit/dispatch-status.enum.js +44 -0
  17. package/dist/cjs/api/conduit/dispatch-status.enum.js.map +1 -0
  18. package/dist/cjs/api/conduit/dispatch.type.d.ts +143 -0
  19. package/dist/cjs/api/conduit/dispatch.type.d.ts.map +1 -0
  20. package/dist/cjs/api/conduit/dispatch.type.js +3 -0
  21. package/dist/cjs/api/conduit/dispatch.type.js.map +1 -0
  22. package/dist/cjs/api/conduit/index.d.ts +5 -0
  23. package/dist/cjs/api/conduit/index.d.ts.map +1 -1
  24. package/dist/cjs/api/conduit/index.js +5 -0
  25. package/dist/cjs/api/conduit/index.js.map +1 -1
  26. package/dist/cjs/api/identity/access-token-payload.interface.d.ts +53 -0
  27. package/dist/cjs/api/identity/access-token-payload.interface.d.ts.map +1 -0
  28. package/dist/cjs/api/identity/access-token-payload.interface.js +3 -0
  29. package/dist/cjs/api/identity/access-token-payload.interface.js.map +1 -0
  30. package/dist/cjs/api/identity/auth.type.d.ts +21 -0
  31. package/dist/cjs/api/identity/auth.type.d.ts.map +1 -1
  32. package/dist/cjs/api/identity/index.d.ts +2 -0
  33. package/dist/cjs/api/identity/index.d.ts.map +1 -1
  34. package/dist/cjs/api/identity/index.js +2 -0
  35. package/dist/cjs/api/identity/index.js.map +1 -1
  36. package/dist/cjs/api/identity/principal-type.enum.d.ts +19 -0
  37. package/dist/cjs/api/identity/principal-type.enum.d.ts.map +1 -0
  38. package/dist/cjs/api/identity/principal-type.enum.js +23 -0
  39. package/dist/cjs/api/identity/principal-type.enum.js.map +1 -0
  40. package/dist/cjs/enum/user-permission.enum.d.ts +40 -1
  41. package/dist/cjs/enum/user-permission.enum.d.ts.map +1 -1
  42. package/dist/cjs/enum/user-permission.enum.js +42 -0
  43. package/dist/cjs/enum/user-permission.enum.js.map +1 -1
  44. package/dist/esm/api/conduit/connection.type.d.ts +100 -0
  45. package/dist/esm/api/conduit/connection.type.d.ts.map +1 -0
  46. package/dist/esm/api/conduit/connection.type.js +2 -0
  47. package/dist/esm/api/conduit/connection.type.js.map +1 -0
  48. package/dist/esm/api/conduit/connector-auth-type.enum.d.ts +42 -0
  49. package/dist/esm/api/conduit/connector-auth-type.enum.d.ts.map +1 -0
  50. package/dist/esm/api/conduit/connector-auth-type.enum.js +43 -0
  51. package/dist/esm/api/conduit/connector-auth-type.enum.js.map +1 -0
  52. package/dist/esm/api/conduit/connector.type.d.ts +179 -0
  53. package/dist/esm/api/conduit/connector.type.d.ts.map +1 -0
  54. package/dist/esm/api/conduit/connector.type.js +10 -0
  55. package/dist/esm/api/conduit/connector.type.js.map +1 -0
  56. package/dist/esm/api/conduit/dispatch-status.enum.d.ts +40 -0
  57. package/dist/esm/api/conduit/dispatch-status.enum.d.ts.map +1 -0
  58. package/dist/esm/api/conduit/dispatch-status.enum.js +41 -0
  59. package/dist/esm/api/conduit/dispatch-status.enum.js.map +1 -0
  60. package/dist/esm/api/conduit/dispatch.type.d.ts +143 -0
  61. package/dist/esm/api/conduit/dispatch.type.d.ts.map +1 -0
  62. package/dist/esm/api/conduit/dispatch.type.js +2 -0
  63. package/dist/esm/api/conduit/dispatch.type.js.map +1 -0
  64. package/dist/esm/api/conduit/index.d.ts +5 -0
  65. package/dist/esm/api/conduit/index.d.ts.map +1 -1
  66. package/dist/esm/api/conduit/index.js +5 -0
  67. package/dist/esm/api/conduit/index.js.map +1 -1
  68. package/dist/esm/api/identity/access-token-payload.interface.d.ts +53 -0
  69. package/dist/esm/api/identity/access-token-payload.interface.d.ts.map +1 -0
  70. package/dist/esm/api/identity/access-token-payload.interface.js +2 -0
  71. package/dist/esm/api/identity/access-token-payload.interface.js.map +1 -0
  72. package/dist/esm/api/identity/auth.type.d.ts +21 -0
  73. package/dist/esm/api/identity/auth.type.d.ts.map +1 -1
  74. package/dist/esm/api/identity/index.d.ts +2 -0
  75. package/dist/esm/api/identity/index.d.ts.map +1 -1
  76. package/dist/esm/api/identity/index.js +2 -0
  77. package/dist/esm/api/identity/index.js.map +1 -1
  78. package/dist/esm/api/identity/principal-type.enum.d.ts +19 -0
  79. package/dist/esm/api/identity/principal-type.enum.d.ts.map +1 -0
  80. package/dist/esm/api/identity/principal-type.enum.js +20 -0
  81. package/dist/esm/api/identity/principal-type.enum.js.map +1 -0
  82. package/dist/esm/enum/user-permission.enum.d.ts +40 -1
  83. package/dist/esm/enum/user-permission.enum.d.ts.map +1 -1
  84. package/dist/esm/enum/user-permission.enum.js +42 -0
  85. package/dist/esm/enum/user-permission.enum.js.map +1 -1
  86. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=access-token-payload.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-token-payload.interface.js","sourceRoot":"","sources":["../../../../src/api/identity/access-token-payload.interface.ts"],"names":[],"mappings":""}
@@ -51,6 +51,27 @@ export interface AuthTokens {
51
51
  /** Lifetime of `accessToken` in seconds, not of `refreshToken`. */
52
52
  expiresInSeconds: number;
53
53
  }
54
+ /**
55
+ * Returned by `POST /auth/token` — the API-key-for-JWT exchange a service makes so that other
56
+ * Iveri services can authorize it **without calling identity**.
57
+ *
58
+ * **There is deliberately no refresh token.** The API key already is the long-lived credential,
59
+ * and it is revocable by a row. A refresh token here would be a second long-lived credential
60
+ * with its own independent lifetime, rotation rule and leak story, obtained from the first —
61
+ * so revoking the key would no longer be enough to stop the caller. A service re-exchanges
62
+ * instead, which costs one call per {@link expiresInSeconds}.
63
+ *
64
+ * The key travels as `x-api-key`, so this call has no request body.
65
+ */
66
+ export interface ServiceToken {
67
+ /** Send as `Authorization: Bearer <accessToken>`. Carries `pt: 'service'`. */
68
+ accessToken: string;
69
+ /**
70
+ * Lifetime in seconds. Shorter than a human session's: a service re-exchanges with nobody
71
+ * waiting, so the revocation window is cheap to shrink.
72
+ */
73
+ expiresInSeconds: number;
74
+ }
54
75
  /**
55
76
  * Who the caller is. Returned by `GET /auth/me` and nested inside {@link AuthSession}.
56
77
  *
@@ -1 +1 @@
1
- {"version":3,"file":"auth.type.d.ts","sourceRoot":"","sources":["../../../../src/api/identity/auth.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,8EAA8E;AAC9E,MAAM,WAAW,UAAU;IACvB,UAAU,EAAE,MAAM,CAAC;IAEnB,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,QAA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;IAC9E,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACtB,qCAAqC;IACrC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEvB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE3B,QAAQ,EAAE,IAAI,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;IAE3B,qCAAqC;IACrC,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IAE7C,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB,gEAAgE;IAChE,WAAW,EAAE,cAAc,EAAE,CAAC;CACjC;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC;CACtB"}
@@ -1,4 +1,6 @@
1
+ export * from './access-token-payload.interface.js';
1
2
  export * from './auth.type.js';
2
3
  export * from './membership-status.enum.js';
4
+ export * from './principal-type.enum.js';
3
5
  export * from './tenant-status.enum.js';
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/identity/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/identity/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC"}
@@ -1,4 +1,6 @@
1
+ export * from './access-token-payload.interface.js';
1
2
  export * from './auth.type.js';
2
3
  export * from './membership-status.enum.js';
4
+ export * from './principal-type.enum.js';
3
5
  export * from './tenant-status.enum.js';
4
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/identity/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/identity/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * What kind of principal an access token was minted for.
3
+ *
4
+ * It exists because `sub` alone cannot answer the question. A JWT's subject is *the principal*,
5
+ * and identity issues tokens for two kinds of them: a person who logged in, and a service that
6
+ * exchanged an API key. Both put a UUID in `sub`, and the two UUIDs mean entirely different
7
+ * things — one names a row in `user`, the other a row in `api_key`.
8
+ *
9
+ * A consumer that reads `sub` as a user id without checking this claim attributes a machine's
10
+ * actions to a user who does not exist. That is why every guard branches on it, and why it is
11
+ * required rather than optional: `tsc` then makes the branch impossible to forget.
12
+ */
13
+ export declare enum PrincipalType {
14
+ /** A person, authenticated by password. `sub` is their `user.id`. */
15
+ USER = "user",
16
+ /** A service, authenticated by API key. `sub` is the `api_key.id`, and there is no user. */
17
+ SERVICE = "service"
18
+ }
19
+ //# sourceMappingURL=principal-type.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"principal-type.enum.d.ts","sourceRoot":"","sources":["../../../../src/api/identity/principal-type.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,oBAAY,aAAa;IACrB,qEAAqE;IACrE,IAAI,SAAS;IAEb,4FAA4F;IAC5F,OAAO,YAAY;CACtB"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * What kind of principal an access token was minted for.
3
+ *
4
+ * It exists because `sub` alone cannot answer the question. A JWT's subject is *the principal*,
5
+ * and identity issues tokens for two kinds of them: a person who logged in, and a service that
6
+ * exchanged an API key. Both put a UUID in `sub`, and the two UUIDs mean entirely different
7
+ * things — one names a row in `user`, the other a row in `api_key`.
8
+ *
9
+ * A consumer that reads `sub` as a user id without checking this claim attributes a machine's
10
+ * actions to a user who does not exist. That is why every guard branches on it, and why it is
11
+ * required rather than optional: `tsc` then makes the branch impossible to forget.
12
+ */
13
+ export var PrincipalType;
14
+ (function (PrincipalType) {
15
+ /** A person, authenticated by password. `sub` is their `user.id`. */
16
+ PrincipalType["USER"] = "user";
17
+ /** A service, authenticated by API key. `sub` is the `api_key.id`, and there is no user. */
18
+ PrincipalType["SERVICE"] = "service";
19
+ })(PrincipalType || (PrincipalType = {}));
20
+ //# sourceMappingURL=principal-type.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"principal-type.enum.js","sourceRoot":"","sources":["../../../../src/api/identity/principal-type.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAN,IAAY,aAMX;AAND,WAAY,aAAa;IACrB,qEAAqE;IACrE,8BAAa,CAAA;IAEb,4FAA4F;IAC5F,oCAAmB,CAAA;AACvB,CAAC,EANW,aAAa,KAAb,aAAa,QAMxB"}
@@ -89,7 +89,46 @@ export declare enum UserPermission {
89
89
  * read: it causes an outbound request rather than returning a row, and redriving a large
90
90
  * dead-letter backlog is a way to flood a customer's own service.
91
91
  */
92
- CONDUIT_DELIVERY_OPERATE = "conduit:delivery:operate"
92
+ CONDUIT_DELIVERY_OPERATE = "conduit:delivery:operate",
93
+ /** Read connector manifests. They hold no credential, so this is configuration only. */
94
+ CONDUIT_CONNECTOR_READ = "conduit:connector:read",
95
+ /**
96
+ * Define or amend a connector manifest — **the list of hosts and paths Conduit may be asked
97
+ * to call**, and the token endpoint it will send a customer's client secret to.
98
+ *
99
+ * The most powerful permission in the outbound half. A dispatch cannot name a URL; it can
100
+ * only name an operation somebody with this permission wrote down, which is what keeps
101
+ * outbound from being an authenticated open proxy. Whoever holds this decides where the
102
+ * proxy may point.
103
+ */
104
+ CONDUIT_CONNECTOR_MANAGE = "conduit:connector:manage",
105
+ /** Read connections. Never exposes their stored credential values. */
106
+ CONDUIT_CONNECTION_READ = "conduit:connection:read",
107
+ /**
108
+ * Create, amend or delete a connection — the customer's own third-party credentials.
109
+ *
110
+ * Single manage permission rather than create/update/delete: the dangerous act is holding
111
+ * the credential at all, and the three carry the same risk.
112
+ */
113
+ CONDUIT_CONNECTION_MANAGE = "conduit:connection:manage",
114
+ /**
115
+ * Read the outbound log and its dead-letter queue, including each attempt's response.
116
+ *
117
+ * A dispatch record holds the payload a vertical asked to send — a customer's message text,
118
+ * an order — so this is a data-read permission, not a config one.
119
+ */
120
+ CONDUIT_DISPATCH_READ = "conduit:dispatch:read",
121
+ /**
122
+ * Submit an outbound request. **This is the permission a vertical holds**, and the only one
123
+ * it needs: `unibox-api` sending a reply presents this and nothing else.
124
+ *
125
+ * Separate from `CONDUIT_DISPATCH_OPERATE` because sending is the routine act and operating
126
+ * the queue is the exceptional one — a service principal that can send should not also be
127
+ * able to redrive a backlog.
128
+ */
129
+ CONDUIT_DISPATCH_SEND = "conduit:dispatch:send",
130
+ /** Redrive a dead-lettered dispatch, or cancel one still pending. */
131
+ CONDUIT_DISPATCH_OPERATE = "conduit:dispatch:operate"
93
132
  }
94
133
  /**
95
134
  * 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;;;;;;;;;;;;;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own service.
106
106
  */
107
107
  UserPermission["CONDUIT_DELIVERY_OPERATE"] = "conduit:delivery:operate";
108
+ // ── Connector (outbound) ────────────────────────────────────────────────
109
+ /** Read connector manifests. They hold no credential, so this is configuration only. */
110
+ UserPermission["CONDUIT_CONNECTOR_READ"] = "conduit:connector:read";
111
+ /**
112
+ * Define or amend a connector manifest — **the list of hosts and paths Conduit may be asked
113
+ * to call**, and the token endpoint it will send a customer's client secret to.
114
+ *
115
+ * The most powerful permission in the outbound half. A dispatch cannot name a URL; it can
116
+ * only name an operation somebody with this permission wrote down, which is what keeps
117
+ * outbound from being an authenticated open proxy. Whoever holds this decides where the
118
+ * proxy may point.
119
+ */
120
+ UserPermission["CONDUIT_CONNECTOR_MANAGE"] = "conduit:connector:manage";
121
+ // ── Connection (outbound) ───────────────────────────────────────────────
122
+ /** Read connections. Never exposes their stored credential values. */
123
+ UserPermission["CONDUIT_CONNECTION_READ"] = "conduit:connection:read";
124
+ /**
125
+ * Create, amend or delete a connection — the customer's own third-party credentials.
126
+ *
127
+ * Single manage permission rather than create/update/delete: the dangerous act is holding
128
+ * the credential at all, and the three carry the same risk.
129
+ */
130
+ UserPermission["CONDUIT_CONNECTION_MANAGE"] = "conduit:connection:manage";
131
+ // ── Dispatch (outbound) ─────────────────────────────────────────────────
132
+ /**
133
+ * Read the outbound log and its dead-letter queue, including each attempt's response.
134
+ *
135
+ * A dispatch record holds the payload a vertical asked to send — a customer's message text,
136
+ * an order — so this is a data-read permission, not a config one.
137
+ */
138
+ UserPermission["CONDUIT_DISPATCH_READ"] = "conduit:dispatch:read";
139
+ /**
140
+ * Submit an outbound request. **This is the permission a vertical holds**, and the only one
141
+ * it needs: `unibox-api` sending a reply presents this and nothing else.
142
+ *
143
+ * Separate from `CONDUIT_DISPATCH_OPERATE` because sending is the routine act and operating
144
+ * the queue is the exceptional one — a service principal that can send should not also be
145
+ * able to redrive a backlog.
146
+ */
147
+ UserPermission["CONDUIT_DISPATCH_SEND"] = "conduit:dispatch:send";
148
+ /** Redrive a dead-lettered dispatch, or cancel one still pending. */
149
+ UserPermission["CONDUIT_DISPATCH_OPERATE"] = "conduit:dispatch:operate";
108
150
  })(UserPermission || (UserPermission = {}));
109
151
  /**
110
152
  * 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,cAqGX;AArGD,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;IAC3B,6CAA2B,CAAA;IAE3B,2EAA2E;IAC3E,qDAAmC,CAAA;IACnC,6EAA6E;IAC7E,yDAAuC,CAAA;IACvC;;;OAGG;IACH,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E,yCAAuB,CAAA;IACvB,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAC3B,6CAA2B,CAAA;IAE3B,2EAA2E;IAC3E,+CAA6B,CAAA;IAC7B,iDAA+B,CAAA;IAC/B,mDAAiC,CAAA;IAEjC,4EAA4E;IAE5E,2EAA2E;IAC3E,qEAAqE;IACrE,iEAA+C,CAAA;IAC/C,qEAAmD,CAAA;IACnD,qEAAmD,CAAA;IACnD,qEAAmD,CAAA;IAEnD,2EAA2E;IAC3E;;;;OAIG;IACH,+DAA6C,CAAA;IAC7C,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E;;;;OAIG;IACH,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E,iEAA+C,CAAA;IAC/C,yFAAyF;IACzF,qEAAmD,CAAA;IAEnD,2EAA2E;IAC3E,mEAAmE;IACnE,uEAAqD,CAAA;IACrD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CAAA;IAEjD,2EAA2E;IAC3E;;;;OAIG;IACH,mEAAiD,CAAA;IAEjD,2EAA2E;IAC3E,iEAA+C,CAAA;IAC/C,yFAAyF;IACzF,qEAAmD,CAAA;IAEnD,2EAA2E;IAC3E,mEAAmE;IACnE,uEAAqD,CAAA;IACrD;;;;;;;OAOG;IACH,2EAAyD,CAAA;IAEzD,2EAA2E;IAC3E,2DAAyC,CAAA;IACzC,2DAA2D;IAC3D,+DAA6C,CAAA;IAE7C,2EAA2E;IAC3E;;;;;OAKG;IACH,iEAA+C,CAAA;IAC/C;;;;;;OAMG;IACH,uEAAqD,CAAA;IAErD,2EAA2E;IAC3E,wFAAwF;IACxF,mEAAiD,CAAA;IACjD;;;;;;;;OAQG;IACH,uEAAqD,CAAA;IAErD,2EAA2E;IAC3E,sEAAsE;IACtE,qEAAmD,CAAA;IACnD;;;;;OAKG;IACH,yEAAuD,CAAA;IAEvD,2EAA2E;IAC3E;;;;;OAKG;IACH,iEAA+C,CAAA;IAC/C;;;;;;;OAOG;IACH,iEAA+C,CAAA;IAC/C,qEAAqE;IACrE,uEAAqD,CAAA;AACzD,CAAC,EAlJW,cAAc,KAAd,cAAc,QAkJzB;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA8B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iveri/contracts",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Wire contracts shared by every Iveri backend and frontend. Zero runtime dependencies.",
5
5
  "license": "MIT",
6
6
  "repository": {