@colveor/admin 0.0.0-stage → 0.5.3

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 (156) hide show
  1. package/LICENSE.md +106 -0
  2. package/README.md +365 -2
  3. package/TAILWINDADMIN-LICENSE +21 -0
  4. package/dist/account/data.d.ts +1 -0
  5. package/dist/account/data.js +44 -0
  6. package/dist/account/profile.d.ts +6 -0
  7. package/dist/account/profile.js +118 -0
  8. package/dist/account/sessions.d.ts +1 -0
  9. package/dist/account/sessions.js +26 -0
  10. package/dist/account/shared.d.ts +26 -0
  11. package/dist/account/shared.js +44 -0
  12. package/dist/account/two-factor.d.ts +5 -0
  13. package/dist/account/two-factor.js +60 -0
  14. package/dist/actions.d.ts +39 -0
  15. package/dist/actions.js +81 -0
  16. package/dist/api/audit.gen.d.ts +80 -0
  17. package/dist/api/audit.gen.js +43 -0
  18. package/dist/api/auth.gen.d.ts +537 -0
  19. package/dist/api/auth.gen.js +313 -0
  20. package/dist/api/errors.gen.d.ts +16 -0
  21. package/dist/api/errors.gen.js +2 -0
  22. package/dist/api/gormx.gen.d.ts +60 -0
  23. package/dist/api/gormx.gen.js +16 -0
  24. package/dist/api/health.gen.d.ts +103 -0
  25. package/dist/api/health.gen.js +23 -0
  26. package/dist/api/index.gen.d.ts +21 -0
  27. package/dist/api/index.gen.js +22 -0
  28. package/dist/api/invitations.gen.d.ts +128 -0
  29. package/dist/api/invitations.gen.js +57 -0
  30. package/dist/api/ledger.gen.d.ts +269 -0
  31. package/dist/api/ledger.gen.js +113 -0
  32. package/dist/api/msgtemplate.gen.d.ts +31 -0
  33. package/dist/api/msgtemplate.gen.js +2 -0
  34. package/dist/api/notifications.gen.d.ts +66 -0
  35. package/dist/api/notifications.gen.js +28 -0
  36. package/dist/api/outbox.gen.d.ts +8 -0
  37. package/dist/api/outbox.gen.js +2 -0
  38. package/dist/api/queue.gen.d.ts +112 -0
  39. package/dist/api/queue.gen.js +15 -0
  40. package/dist/api/rbac.gen.d.ts +406 -0
  41. package/dist/api/rbac.gen.js +191 -0
  42. package/dist/api/reauth.gen.d.ts +289 -0
  43. package/dist/api/reauth.gen.js +122 -0
  44. package/dist/api/recorded_payments.gen.d.ts +171 -0
  45. package/dist/api/recorded_payments.gen.js +79 -0
  46. package/dist/api/sessions.gen.d.ts +64 -0
  47. package/dist/api/sessions.gen.js +48 -0
  48. package/dist/api/settings.gen.d.ts +147 -0
  49. package/dist/api/settings.gen.js +69 -0
  50. package/dist/api/storage.gen.d.ts +327 -0
  51. package/dist/api/storage.gen.js +208 -0
  52. package/dist/api/support_access.gen.d.ts +155 -0
  53. package/dist/api/support_access.gen.js +131 -0
  54. package/dist/api/users.gen.d.ts +407 -0
  55. package/dist/api/users.gen.js +159 -0
  56. package/dist/api/verification.gen.d.ts +427 -0
  57. package/dist/api/verification.gen.js +280 -0
  58. package/dist/api/webhooks.gen.d.ts +110 -0
  59. package/dist/api/webhooks.gen.js +45 -0
  60. package/dist/auth-layout.d.ts +9 -0
  61. package/dist/auth-layout.js +5 -0
  62. package/dist/banner.d.ts +1 -0
  63. package/dist/banner.js +49 -0
  64. package/dist/client.d.ts +41 -0
  65. package/dist/client.js +72 -0
  66. package/dist/config.d.ts +27 -0
  67. package/dist/config.js +82 -0
  68. package/dist/dates.d.ts +4 -0
  69. package/dist/dates.js +16 -0
  70. package/dist/header.d.ts +12 -0
  71. package/dist/header.js +105 -0
  72. package/dist/icons.d.ts +2 -0
  73. package/dist/icons.js +15 -0
  74. package/dist/index.d.ts +28 -0
  75. package/dist/index.js +42 -0
  76. package/dist/kit/avatar.d.ts +5 -0
  77. package/dist/kit/avatar.js +16 -0
  78. package/dist/kit/badge.d.ts +10 -0
  79. package/dist/kit/badge.js +31 -0
  80. package/dist/kit/card.d.ts +12 -0
  81. package/dist/kit/card.js +7 -0
  82. package/dist/kit/code-area.d.ts +15 -0
  83. package/dist/kit/code-area.js +69 -0
  84. package/dist/kit/dropdown.d.ts +26 -0
  85. package/dist/kit/dropdown.js +67 -0
  86. package/dist/kit/filter-tabs.d.ts +9 -0
  87. package/dist/kit/filter-tabs.js +7 -0
  88. package/dist/kit/modal.d.ts +8 -0
  89. package/dist/kit/modal.js +15 -0
  90. package/dist/kit/page-header.d.ts +13 -0
  91. package/dist/kit/page-header.js +13 -0
  92. package/dist/kit/search.d.ts +4 -0
  93. package/dist/kit/search.js +16 -0
  94. package/dist/kit/tooltip.d.ts +17 -0
  95. package/dist/kit/tooltip.js +52 -0
  96. package/dist/message-editor.d.ts +9 -0
  97. package/dist/message-editor.js +80 -0
  98. package/dist/money.d.ts +10 -0
  99. package/dist/money.js +17 -0
  100. package/dist/next.d.ts +6 -0
  101. package/dist/next.js +19 -0
  102. package/dist/pages/account.d.ts +1 -0
  103. package/dist/pages/account.js +47 -0
  104. package/dist/pages/audit.d.ts +1 -0
  105. package/dist/pages/audit.js +88 -0
  106. package/dist/pages/forgot-password.d.ts +1 -0
  107. package/dist/pages/forgot-password.js +73 -0
  108. package/dist/pages/ledger.d.ts +1 -0
  109. package/dist/pages/ledger.js +132 -0
  110. package/dist/pages/roles.d.ts +1 -0
  111. package/dist/pages/roles.js +102 -0
  112. package/dist/pages/settings.d.ts +1 -0
  113. package/dist/pages/settings.js +86 -0
  114. package/dist/pages/sign-in.d.ts +5 -0
  115. package/dist/pages/sign-in.js +117 -0
  116. package/dist/pages/status.d.ts +1 -0
  117. package/dist/pages/status.js +122 -0
  118. package/dist/pages/support.d.ts +1 -0
  119. package/dist/pages/support.js +90 -0
  120. package/dist/pages/teams.d.ts +1 -0
  121. package/dist/pages/teams.js +94 -0
  122. package/dist/pages/users.d.ts +1 -0
  123. package/dist/pages/users.js +158 -0
  124. package/dist/pages/webhooks.d.ts +1 -0
  125. package/dist/pages/webhooks.js +88 -0
  126. package/dist/permissions.d.ts +5 -0
  127. package/dist/permissions.js +31 -0
  128. package/dist/proof.d.ts +10 -0
  129. package/dist/proof.js +78 -0
  130. package/dist/proxy.d.ts +10 -0
  131. package/dist/proxy.js +166 -0
  132. package/dist/retry.d.ts +8 -0
  133. package/dist/retry.js +30 -0
  134. package/dist/router.d.ts +13 -0
  135. package/dist/router.js +14 -0
  136. package/dist/setting-fields.d.ts +12 -0
  137. package/dist/setting-fields.js +102 -0
  138. package/dist/setting-list.d.ts +22 -0
  139. package/dist/setting-list.js +78 -0
  140. package/dist/shell.d.ts +40 -0
  141. package/dist/shell.js +97 -0
  142. package/dist/support.d.ts +37 -0
  143. package/dist/support.js +76 -0
  144. package/dist/table.d.ts +40 -0
  145. package/dist/table.js +73 -0
  146. package/dist/ui.d.ts +39 -0
  147. package/dist/ui.js +56 -0
  148. package/dist/user-actions.d.ts +30 -0
  149. package/dist/user-actions.js +129 -0
  150. package/dist/user-roles.d.ts +4 -0
  151. package/dist/user-roles.js +51 -0
  152. package/dist/user-row-menu.d.ts +14 -0
  153. package/dist/user-row-menu.js +45 -0
  154. package/dist/version.d.ts +1 -0
  155. package/dist/version.js +3 -0
  156. package/package.json +63 -4
@@ -0,0 +1,128 @@
1
+ /**
2
+ * InviteRequest is what the owning module passes to Invite. Exactly one of
3
+ * Email or Phone is set.
4
+ */
5
+ export interface InviteRequest {
6
+ /**
7
+ * Kind and TeamID name what the invitation is to: "store" and the
8
+ * store's ID.
9
+ */
10
+ Kind: string;
11
+ TeamID: string;
12
+ /**
13
+ * TeamName is shown to the recipient: "Accra Mall branch".
14
+ */
15
+ TeamName: string;
16
+ /**
17
+ * Role is the owning module's role, handed back to its AcceptFunc.
18
+ */
19
+ Role: string;
20
+ Email: string;
21
+ Phone: string;
22
+ }
23
+ export interface InvitationResponse {
24
+ id: string;
25
+ kind: string;
26
+ team_id: string;
27
+ team_name: string;
28
+ role: string;
29
+ /**
30
+ * Channel is "email" or "phone", and Recipient the address it was sent to.
31
+ */
32
+ channel: string;
33
+ recipient: string;
34
+ status: Status;
35
+ invited_by: string;
36
+ expires_at: string;
37
+ created_at: string;
38
+ }
39
+ export interface ListResponse {
40
+ invitations: InvitationResponse[];
41
+ }
42
+ export type Status = string;
43
+ export declare const StatusPending: Status;
44
+ export declare const StatusAccepted: Status;
45
+ export declare const StatusDeclined: Status;
46
+ /**
47
+ * StatusRevoked: cancelled by the team, or replaced by a newer
48
+ * invitation to the same person.
49
+ */
50
+ export declare const StatusRevoked: Status;
51
+ /**
52
+ * TeamInviteRequest invites someone to a team role:
53
+ * POST /v1/teams/{kind}/{id}/invitations. Accepting gives them Role there.
54
+ */
55
+ export interface TeamInviteRequest {
56
+ role: string;
57
+ /**
58
+ * TeamName is shown to the recipient: "Accra Mall branch".
59
+ */
60
+ team_name: string;
61
+ email: string;
62
+ phone: string;
63
+ }
64
+ /**
65
+ * Stable error codes for this module (section 42.5: <module>.<error>).
66
+ */
67
+ export declare const ErrCodeNotFound = "invitations.not_found";
68
+ /**
69
+ * Stable error codes for this module (section 42.5: <module>.<error>).
70
+ */
71
+ export declare const ErrCodeUnauthenticated = "invitations.unauthenticated";
72
+ /**
73
+ * Permissions this module guards: the invitee's own invitations. Inviting
74
+ * and revoking are guarded by the module that owns the team.
75
+ */
76
+ export declare const PermissionInvitationRead: string;
77
+ /**
78
+ * Permissions this module guards: the invitee's own invitations. Inviting
79
+ * and revoking are guarded by the module that owns the team.
80
+ */
81
+ export declare const PermissionInvitationWrite: string;
82
+ /**
83
+ * NotificationReceived is the in-app notification type sent to an invitee
84
+ * who already has an account; its data holds "invitation_id".
85
+ */
86
+ export declare const NotificationReceived = "invitations.received";
87
+ /**
88
+ * Actions recorded in the audit log (section 42.1).
89
+ */
90
+ export declare const ActionInvitationCreated = "invitations.InvitationCreated";
91
+ /**
92
+ * Actions recorded in the audit log (section 42.1).
93
+ */
94
+ export declare const ActionInvitationRevoked = "invitations.InvitationRevoked";
95
+ /**
96
+ * Actions recorded in the audit log (section 42.1).
97
+ */
98
+ export declare const ActionInvitationAccepted = "invitations.InvitationAccepted";
99
+ /**
100
+ * Actions recorded in the audit log (section 42.1).
101
+ */
102
+ export declare const ActionInvitationDeclined = "invitations.InvitationDeclined";
103
+ /**
104
+ * AcceptFunc grants what inv offers to user uid: for a store, it adds them
105
+ * as staff with inv.Role. It runs inside the transaction that marks the
106
+ * invitation accepted, so an error refuses the acceptance and changes
107
+ * nothing.
108
+ */
109
+ export type AcceptFunc = unknown;
110
+ export type Service = unknown;
111
+ export declare const SettingTTL: string;
112
+ export declare const SettingLinkURL: string;
113
+ export declare const SettingMessage: string;
114
+ /**
115
+ * MessageData is what the invitation message template can use.
116
+ */
117
+ export interface MessageData {
118
+ AppName: string;
119
+ /**
120
+ * InviterName is the inviter's display name, or first and last name;
121
+ * empty when their profile has neither.
122
+ */
123
+ InviterName: string;
124
+ TeamName: string;
125
+ Role: string;
126
+ Link: string;
127
+ ExpiresAt: string;
128
+ }
@@ -0,0 +1,57 @@
1
+ // Code generated by tygo. DO NOT EDIT.
2
+ export const StatusPending = "pending";
3
+ export const StatusAccepted = "accepted";
4
+ export const StatusDeclined = "declined";
5
+ /**
6
+ * StatusRevoked: cancelled by the team, or replaced by a newer
7
+ * invitation to the same person.
8
+ */
9
+ export const StatusRevoked = "revoked";
10
+ //////////
11
+ // source: errors.go
12
+ /**
13
+ * Stable error codes for this module (section 42.5: <module>.<error>).
14
+ */
15
+ export const ErrCodeNotFound = "invitations.not_found";
16
+ /**
17
+ * Stable error codes for this module (section 42.5: <module>.<error>).
18
+ */
19
+ export const ErrCodeUnauthenticated = "invitations.unauthenticated";
20
+ //////////
21
+ // source: permissions.go
22
+ /**
23
+ * Permissions this module guards: the invitee's own invitations. Inviting
24
+ * and revoking are guarded by the module that owns the team.
25
+ */
26
+ export const PermissionInvitationRead = "invitations.read";
27
+ /**
28
+ * Permissions this module guards: the invitee's own invitations. Inviting
29
+ * and revoking are guarded by the module that owns the team.
30
+ */
31
+ export const PermissionInvitationWrite = "invitations.write";
32
+ /**
33
+ * NotificationReceived is the in-app notification type sent to an invitee
34
+ * who already has an account; its data holds "invitation_id".
35
+ */
36
+ export const NotificationReceived = "invitations.received";
37
+ /**
38
+ * Actions recorded in the audit log (section 42.1).
39
+ */
40
+ export const ActionInvitationCreated = "invitations.InvitationCreated";
41
+ /**
42
+ * Actions recorded in the audit log (section 42.1).
43
+ */
44
+ export const ActionInvitationRevoked = "invitations.InvitationRevoked";
45
+ /**
46
+ * Actions recorded in the audit log (section 42.1).
47
+ */
48
+ export const ActionInvitationAccepted = "invitations.InvitationAccepted";
49
+ /**
50
+ * Actions recorded in the audit log (section 42.1).
51
+ */
52
+ export const ActionInvitationDeclined = "invitations.InvitationDeclined";
53
+ //////////
54
+ // source: settings.go
55
+ export const SettingTTL = "invitations.ttl";
56
+ export const SettingLinkURL = "invitations.link_url";
57
+ export const SettingMessage = "invitations.message";
@@ -0,0 +1,269 @@
1
+ /**
2
+ * Actions recorded in the audit log. Movements themselves aren't: the
3
+ * ledger is their record.
4
+ */
5
+ export declare const ActionWalletOpened = "ledger.WalletOpened";
6
+ /**
7
+ * Actions recorded in the audit log. Movements themselves aren't: the
8
+ * ledger is their record.
9
+ */
10
+ export declare const ActionAccountFrozen = "ledger.AccountFrozen";
11
+ /**
12
+ * Actions recorded in the audit log. Movements themselves aren't: the
13
+ * ledger is their record.
14
+ */
15
+ export declare const ActionAccountUnfrozen = "ledger.AccountUnfrozen";
16
+ /**
17
+ * Actions recorded in the audit log. Movements themselves aren't: the
18
+ * ledger is their record.
19
+ */
20
+ export declare const ActionAdjustmentRequested = "ledger.AdjustmentRequested";
21
+ /**
22
+ * Actions recorded in the audit log. Movements themselves aren't: the
23
+ * ledger is their record.
24
+ */
25
+ export declare const ActionAdjustmentDecided = "ledger.AdjustmentDecided";
26
+ /**
27
+ * Actions recorded in the audit log. Movements themselves aren't: the
28
+ * ledger is their record.
29
+ */
30
+ export declare const ActionAccountClosed = "ledger.AccountClosed";
31
+ /**
32
+ * StepUpAdjust is the re-authentication an adjustment needs.
33
+ */
34
+ export declare const StepUpAdjust = "ledger_adjust";
35
+ /**
36
+ * JobReleaseHolds releases expired holds (every 10 minutes).
37
+ */
38
+ export declare const JobReleaseHolds = "ledger.release_holds";
39
+ /**
40
+ * Account types.
41
+ */
42
+ export declare const TypeWallet = "wallet";
43
+ /**
44
+ * Account types.
45
+ */
46
+ export declare const TypeRecorded = "recorded";
47
+ /**
48
+ * Account types.
49
+ */
50
+ export declare const TypePlatform = "platform";
51
+ /**
52
+ * Account statuses.
53
+ */
54
+ export declare const StatusActive = "active";
55
+ /**
56
+ * Account statuses.
57
+ */
58
+ export declare const StatusFrozen = "frozen";
59
+ /**
60
+ * Account statuses.
61
+ */
62
+ export declare const StatusClosed = "closed";
63
+ export interface Account {
64
+ id: string;
65
+ type: string;
66
+ owner: Owner;
67
+ kind: string;
68
+ currency: string;
69
+ status: string;
70
+ /**
71
+ * Balance is everything in it; Available is what can be spent (Balance
72
+ * less active holds). Platform accounts report them on request only.
73
+ */
74
+ balance: {
75
+ amount: number;
76
+ currency: string;
77
+ };
78
+ held: {
79
+ amount: number;
80
+ currency: string;
81
+ };
82
+ available: {
83
+ amount: number;
84
+ currency: string;
85
+ };
86
+ created_at: string;
87
+ }
88
+ export interface Transaction {
89
+ id: string;
90
+ key: string;
91
+ kind: string;
92
+ subject: Subject;
93
+ description?: string;
94
+ reverses?: string;
95
+ actor_id?: string;
96
+ created_at: string;
97
+ }
98
+ /**
99
+ * Hold statuses.
100
+ */
101
+ export declare const HoldActive = "active";
102
+ /**
103
+ * Hold statuses.
104
+ */
105
+ export declare const HoldCaptured = "captured";
106
+ /**
107
+ * Hold statuses.
108
+ */
109
+ export declare const HoldReleased = "released";
110
+ export interface Hold {
111
+ id: string;
112
+ account_id: string;
113
+ amount: {
114
+ amount: number;
115
+ currency: string;
116
+ };
117
+ reason: string;
118
+ status: string;
119
+ expires_at: string;
120
+ }
121
+ /**
122
+ * EntryResponse is one line of a statement.
123
+ */
124
+ export interface EntryResponse {
125
+ id: number;
126
+ transaction: Transaction;
127
+ amount: {
128
+ amount: number;
129
+ currency: string;
130
+ };
131
+ balance_after: {
132
+ amount: number;
133
+ currency: string;
134
+ };
135
+ }
136
+ /**
137
+ * TeamWallets is a team's wallets, with the totals of the team and every
138
+ * team under it when asked.
139
+ */
140
+ export interface TeamWallets {
141
+ wallets: Account[];
142
+ totals?: {
143
+ amount: number;
144
+ currency: string;
145
+ }[];
146
+ }
147
+ /**
148
+ * Adjustment statuses.
149
+ */
150
+ export declare const AdjustmentPending = "pending";
151
+ /**
152
+ * Adjustment statuses.
153
+ */
154
+ export declare const AdjustmentApproved = "approved";
155
+ /**
156
+ * Adjustment statuses.
157
+ */
158
+ export declare const AdjustmentRejected = "rejected";
159
+ /**
160
+ * AdjustmentRequest asks for a correction or credit to an account: a
161
+ * positive amount credits it, a negative one debits it. The other side is
162
+ * the platform's "adjustments" account.
163
+ */
164
+ export interface AdjustmentRequest {
165
+ account_id: string;
166
+ amount: number;
167
+ reason: string;
168
+ }
169
+ export interface AdjustmentResponse {
170
+ id: string;
171
+ account_id: string;
172
+ amount: {
173
+ amount: number;
174
+ currency: string;
175
+ };
176
+ reason: string;
177
+ status: string;
178
+ requested_by: string;
179
+ decided_by?: string;
180
+ transaction_id?: string;
181
+ created_at: string;
182
+ }
183
+ /**
184
+ * Permissions this module guards. ledger.read is a team permission.
185
+ */
186
+ export declare const PermissionRead: string;
187
+ /**
188
+ * Permissions this module guards. ledger.read is a team permission.
189
+ */
190
+ export declare const PermissionManage: string;
191
+ /**
192
+ * Permissions this module guards. ledger.read is a team permission.
193
+ */
194
+ export declare const PermissionAdjust: string;
195
+ /**
196
+ * Permissions this module guards. ledger.read is a team permission.
197
+ */
198
+ export declare const PermissionApprove: string;
199
+ export type Service = unknown;
200
+ /**
201
+ * KindDef declares a wallet kind.
202
+ */
203
+ export interface KindDef {
204
+ Name: string;
205
+ /**
206
+ * OwnerTypes may own it: "user", or team kinds ("store").
207
+ */
208
+ OwnerTypes: string[];
209
+ /**
210
+ * Currencies are those the app allows; the gateways may narrow them.
211
+ */
212
+ Currencies: string[];
213
+ /**
214
+ * Level is the KYC level needed, "" for none (checked by the owner hook).
215
+ */
216
+ Level: string;
217
+ }
218
+ /**
219
+ * Owner is who an account belongs to: "user" and a user's ID, or a team
220
+ * kind and the team's ID.
221
+ */
222
+ export interface Owner {
223
+ type: string;
224
+ id: string;
225
+ }
226
+ /**
227
+ * Movement is one change of money: lines that add up to zero.
228
+ */
229
+ export interface Movement {
230
+ /**
231
+ * Key makes it idempotent: posting the same key again returns the first
232
+ * transaction (and a different movement under it is refused).
233
+ */
234
+ Key: string;
235
+ Kind: string;
236
+ Subject: Subject;
237
+ Lines: Line[];
238
+ /**
239
+ * Description is shown in statements.
240
+ */
241
+ Description: string;
242
+ /**
243
+ * AllowNegative lets a wallet go below zero (a chargeback).
244
+ */
245
+ AllowNegative: boolean;
246
+ /**
247
+ * Reverses is the transaction this one corrects.
248
+ */
249
+ Reverses?: string;
250
+ }
251
+ /**
252
+ * Subject is what a movement is for: "sale" and its ID.
253
+ */
254
+ export interface Subject {
255
+ type: string;
256
+ id: string;
257
+ }
258
+ /**
259
+ * Line adds Amount (signed) to Account's balance.
260
+ */
261
+ export interface Line {
262
+ Account: string;
263
+ Amount: {
264
+ amount: number;
265
+ currency: string;
266
+ };
267
+ }
268
+ export declare const SettingApprovalAbove: string;
269
+ export declare const SettingHoldMaxHours: string;
@@ -0,0 +1,113 @@
1
+ // Code generated by tygo. DO NOT EDIT.
2
+ //////////
3
+ // source: actions.go
4
+ /**
5
+ * Actions recorded in the audit log. Movements themselves aren't: the
6
+ * ledger is their record.
7
+ */
8
+ export const ActionWalletOpened = "ledger.WalletOpened";
9
+ /**
10
+ * Actions recorded in the audit log. Movements themselves aren't: the
11
+ * ledger is their record.
12
+ */
13
+ export const ActionAccountFrozen = "ledger.AccountFrozen";
14
+ /**
15
+ * Actions recorded in the audit log. Movements themselves aren't: the
16
+ * ledger is their record.
17
+ */
18
+ export const ActionAccountUnfrozen = "ledger.AccountUnfrozen";
19
+ /**
20
+ * Actions recorded in the audit log. Movements themselves aren't: the
21
+ * ledger is their record.
22
+ */
23
+ export const ActionAdjustmentRequested = "ledger.AdjustmentRequested";
24
+ /**
25
+ * Actions recorded in the audit log. Movements themselves aren't: the
26
+ * ledger is their record.
27
+ */
28
+ export const ActionAdjustmentDecided = "ledger.AdjustmentDecided";
29
+ /**
30
+ * Actions recorded in the audit log. Movements themselves aren't: the
31
+ * ledger is their record.
32
+ */
33
+ export const ActionAccountClosed = "ledger.AccountClosed";
34
+ /**
35
+ * StepUpAdjust is the re-authentication an adjustment needs.
36
+ */
37
+ export const StepUpAdjust = "ledger_adjust";
38
+ /**
39
+ * JobReleaseHolds releases expired holds (every 10 minutes).
40
+ */
41
+ export const JobReleaseHolds = "ledger.release_holds";
42
+ //////////
43
+ // source: dto.go
44
+ /**
45
+ * Account types.
46
+ */
47
+ export const TypeWallet = "wallet";
48
+ /**
49
+ * Account types.
50
+ */
51
+ export const TypeRecorded = "recorded";
52
+ /**
53
+ * Account types.
54
+ */
55
+ export const TypePlatform = "platform";
56
+ /**
57
+ * Account statuses.
58
+ */
59
+ export const StatusActive = "active";
60
+ /**
61
+ * Account statuses.
62
+ */
63
+ export const StatusFrozen = "frozen"; // nothing can leave it
64
+ /**
65
+ * Account statuses.
66
+ */
67
+ export const StatusClosed = "closed";
68
+ /**
69
+ * Hold statuses.
70
+ */
71
+ export const HoldActive = "active";
72
+ /**
73
+ * Hold statuses.
74
+ */
75
+ export const HoldCaptured = "captured";
76
+ /**
77
+ * Hold statuses.
78
+ */
79
+ export const HoldReleased = "released";
80
+ /**
81
+ * Adjustment statuses.
82
+ */
83
+ export const AdjustmentPending = "pending";
84
+ /**
85
+ * Adjustment statuses.
86
+ */
87
+ export const AdjustmentApproved = "approved";
88
+ /**
89
+ * Adjustment statuses.
90
+ */
91
+ export const AdjustmentRejected = "rejected";
92
+ //////////
93
+ // source: permissions.go
94
+ /**
95
+ * Permissions this module guards. ledger.read is a team permission.
96
+ */
97
+ export const PermissionRead = "ledger.read"; // a team's wallets
98
+ /**
99
+ * Permissions this module guards. ledger.read is a team permission.
100
+ */
101
+ export const PermissionManage = "ledger.manage";
102
+ /**
103
+ * Permissions this module guards. ledger.read is a team permission.
104
+ */
105
+ export const PermissionAdjust = "ledger.adjust";
106
+ /**
107
+ * Permissions this module guards. ledger.read is a team permission.
108
+ */
109
+ export const PermissionApprove = "ledger.approve";
110
+ //////////
111
+ // source: settings.go
112
+ export const SettingApprovalAbove = "ledger.adjustment_approval_above";
113
+ export const SettingHoldMaxHours = "ledger.hold_max_hours";
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Template is the editable source of one message across every channel it
3
+ * can be sent on. Empty parts are allowed at compile time; rendering a part
4
+ * that is required but empty fails with ErrEmpty.
5
+ */
6
+ export interface Template {
7
+ email: Email;
8
+ sms: string;
9
+ }
10
+ /**
11
+ * Email is the source of an email message. Text is required when sending
12
+ * email (every email carries a plain-text part); HTML is optional.
13
+ */
14
+ export interface Email {
15
+ subject: string;
16
+ text: string;
17
+ html: string;
18
+ }
19
+ /**
20
+ * RenderedEmail is an email ready to hand to mail.Sender.
21
+ */
22
+ export interface RenderedEmail {
23
+ Subject: string;
24
+ Text: string;
25
+ HTML: string;
26
+ }
27
+ /**
28
+ * Compiled is a parsed Template. It is safe for concurrent use.
29
+ */
30
+ export interface Compiled {
31
+ }
@@ -0,0 +1,2 @@
1
+ // Code generated by tygo. DO NOT EDIT.
2
+ export {};
@@ -0,0 +1,66 @@
1
+ /**
2
+ * SendRequest is one notification, to one or more users.
3
+ */
4
+ export interface SendRequest {
5
+ UserIDs: string[];
6
+ /**
7
+ * Type is "<module>.<what>", e.g. "invitations.received": the client
8
+ * chooses the icon and what opening it does from it.
9
+ */
10
+ Type: string;
11
+ Title: string;
12
+ Body: string;
13
+ /**
14
+ * Data is what the client needs to open it, such as
15
+ * {"invitation_id": "..."}. Never secrets: the user and their devices
16
+ * can read it.
17
+ */
18
+ Data: {
19
+ [key: string]: unknown;
20
+ };
21
+ }
22
+ export interface NotificationResponse {
23
+ id: string;
24
+ type: string;
25
+ title: string;
26
+ body: string;
27
+ data: {
28
+ [key: string]: unknown;
29
+ };
30
+ read_at?: string;
31
+ created_at: string;
32
+ }
33
+ export interface UnreadCountResponse {
34
+ unread: number;
35
+ }
36
+ /**
37
+ * EventCreated is the realtime event (GET /v1/events) carrying a new
38
+ * NotificationResponse.
39
+ */
40
+ export declare const EventCreated = "notifications.created";
41
+ /**
42
+ * Stable error codes for this module (section 42.5: <module>.<error>).
43
+ */
44
+ export declare const ErrCodeNotFound = "notifications.not_found";
45
+ /**
46
+ * Stable error codes for this module (section 42.5: <module>.<error>).
47
+ */
48
+ export declare const ErrCodeUnauthenticated = "notifications.unauthenticated";
49
+ /**
50
+ * Permissions this module guards: the user's own notifications. Sending is
51
+ * done by modules, not through a route.
52
+ */
53
+ export declare const PermissionNotificationRead: string;
54
+ /**
55
+ * Permissions this module guards: the user's own notifications. Sending is
56
+ * done by modules, not through a route.
57
+ */
58
+ export declare const PermissionNotificationWrite: string;
59
+ /**
60
+ * Sender is what other modules consume.
61
+ */
62
+ export type Sender = unknown;
63
+ /**
64
+ * Service is the signed-in user's surface, used by the HTTP handlers.
65
+ */
66
+ export type Service = Sender;
@@ -0,0 +1,28 @@
1
+ // Code generated by tygo. DO NOT EDIT.
2
+ /**
3
+ * EventCreated is the realtime event (GET /v1/events) carrying a new
4
+ * NotificationResponse.
5
+ */
6
+ export const EventCreated = "notifications.created";
7
+ //////////
8
+ // source: errors.go
9
+ /**
10
+ * Stable error codes for this module (section 42.5: <module>.<error>).
11
+ */
12
+ export const ErrCodeNotFound = "notifications.not_found";
13
+ /**
14
+ * Stable error codes for this module (section 42.5: <module>.<error>).
15
+ */
16
+ export const ErrCodeUnauthenticated = "notifications.unauthenticated";
17
+ //////////
18
+ // source: permissions.go
19
+ /**
20
+ * Permissions this module guards: the user's own notifications. Sending is
21
+ * done by modules, not through a route.
22
+ */
23
+ export const PermissionNotificationRead = "notifications.read";
24
+ /**
25
+ * Permissions this module guards: the user's own notifications. Sending is
26
+ * done by modules, not through a route.
27
+ */
28
+ export const PermissionNotificationWrite = "notifications.write";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Outbox has the queue's Enqueue, but saves the job in the transaction in
3
+ * ctx. The worker queues it once that transaction commits (within about a
4
+ * second), and never if it rolls back. A job may run more than once
5
+ * (after a crash at the wrong moment), so its handler must be safe to
6
+ * repeat.
7
+ */
8
+ export type Outbox = unknown;