@tansy/multi-tenant 0.0.0-stage → 0.1.1

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.
package/messages.d.ts ADDED
@@ -0,0 +1,308 @@
1
+ /** The plugin's dashboard words, read as `t("ext.multi-tenant.<key>")`. */
2
+ export declare const messages: {
3
+ en: {
4
+ section: string;
5
+ scopeLabel: string;
6
+ switcher: string;
7
+ switcherNone: string;
8
+ pages: {
9
+ tenants: string;
10
+ "tenants/members": string;
11
+ "tenants/domains": string;
12
+ };
13
+ settingsTitle: string;
14
+ settings: {
15
+ invitationDays: {
16
+ label: string;
17
+ description: string;
18
+ };
19
+ verificationRecord: {
20
+ label: string;
21
+ description: string;
22
+ };
23
+ };
24
+ tenants: {
25
+ description: string;
26
+ list: string;
27
+ new: string;
28
+ name: string;
29
+ slug: string;
30
+ slugHint: string;
31
+ create: string;
32
+ cancel: string;
33
+ columnName: string;
34
+ columnSlug: string;
35
+ columnStatus: string;
36
+ columnRoles: string;
37
+ active: string;
38
+ suspended: string;
39
+ current: string;
40
+ switchTo: string;
41
+ manage: string;
42
+ noRoles: string;
43
+ empty: string;
44
+ emptyHint: string;
45
+ created: string;
46
+ };
47
+ members: {
48
+ description: string;
49
+ chooseFirst: string;
50
+ list: string;
51
+ invite: string;
52
+ columnName: string;
53
+ columnEmail: string;
54
+ columnRoles: string;
55
+ empty: string;
56
+ emptyHint: string;
57
+ editRoles: string;
58
+ remove: string;
59
+ confirmRemove: string;
60
+ roles: string;
61
+ rolesHint: string;
62
+ noRolesToGive: string;
63
+ save: string;
64
+ cancel: string;
65
+ details: string;
66
+ name: string;
67
+ rename: string;
68
+ renamed: string;
69
+ };
70
+ invitations: {
71
+ list: string;
72
+ empty: string;
73
+ emptyHint: string;
74
+ columnEmail: string;
75
+ columnRoles: string;
76
+ columnExpires: string;
77
+ cancelInvitation: string;
78
+ email: string;
79
+ send: string;
80
+ sent: string;
81
+ title: string;
82
+ };
83
+ domains: {
84
+ description: string;
85
+ chooseFirst: string;
86
+ list: string;
87
+ add: string;
88
+ host: string;
89
+ hostHint: string;
90
+ cancel: string;
91
+ columnHost: string;
92
+ columnState: string;
93
+ primary: string;
94
+ verified: string;
95
+ waiting: string;
96
+ checked: string;
97
+ verify: string;
98
+ verifiedNotice: string;
99
+ makePrimary: string;
100
+ remove: string;
101
+ confirmRemove: string;
102
+ empty: string;
103
+ emptyHint: string;
104
+ howTitle: string;
105
+ how: string;
106
+ recordType: string;
107
+ recordName: string;
108
+ recordValue: string;
109
+ };
110
+ manage: {
111
+ limits: string;
112
+ limitsHint: string;
113
+ "limit.records": string;
114
+ "limit.storageBytes": string;
115
+ "limit.members": string;
116
+ "limit.requestsPerMinute": string;
117
+ used: string;
118
+ noLimit: string;
119
+ saveLimits: string;
120
+ limitsSaved: string;
121
+ danger: string;
122
+ activeHint: string;
123
+ suspendedHint: string;
124
+ suspend: string;
125
+ suspendedDone: string;
126
+ resume: string;
127
+ resumed: string;
128
+ export: string;
129
+ purge: string;
130
+ purgeConfirm: string;
131
+ purgeHint: string;
132
+ purgeAsked: string;
133
+ purgeScheduled: string;
134
+ cancelPurge: string;
135
+ purgeCancelled: string;
136
+ };
137
+ account: {
138
+ title: string;
139
+ description: string;
140
+ invited: string;
141
+ expires: string;
142
+ accept: string;
143
+ decline: string;
144
+ accepted: string;
145
+ open: string;
146
+ memberOf: string;
147
+ };
148
+ };
149
+ ar: {
150
+ section: string;
151
+ scopeLabel: string;
152
+ switcher: string;
153
+ switcherNone: string;
154
+ pages: {
155
+ tenants: string;
156
+ "tenants/members": string;
157
+ "tenants/domains": string;
158
+ };
159
+ settingsTitle: string;
160
+ settings: {
161
+ invitationDays: {
162
+ label: string;
163
+ description: string;
164
+ };
165
+ verificationRecord: {
166
+ label: string;
167
+ description: string;
168
+ };
169
+ };
170
+ tenants: {
171
+ description: string;
172
+ list: string;
173
+ new: string;
174
+ name: string;
175
+ slug: string;
176
+ slugHint: string;
177
+ create: string;
178
+ cancel: string;
179
+ columnName: string;
180
+ columnSlug: string;
181
+ columnStatus: string;
182
+ columnRoles: string;
183
+ active: string;
184
+ suspended: string;
185
+ current: string;
186
+ switchTo: string;
187
+ manage: string;
188
+ noRoles: string;
189
+ empty: string;
190
+ emptyHint: string;
191
+ created: string;
192
+ };
193
+ members: {
194
+ description: string;
195
+ chooseFirst: string;
196
+ list: string;
197
+ invite: string;
198
+ columnName: string;
199
+ columnEmail: string;
200
+ columnRoles: string;
201
+ empty: string;
202
+ emptyHint: string;
203
+ editRoles: string;
204
+ remove: string;
205
+ confirmRemove: string;
206
+ roles: string;
207
+ rolesHint: string;
208
+ noRolesToGive: string;
209
+ save: string;
210
+ cancel: string;
211
+ details: string;
212
+ name: string;
213
+ rename: string;
214
+ renamed: string;
215
+ };
216
+ invitations: {
217
+ list: string;
218
+ empty: string;
219
+ emptyHint: string;
220
+ columnEmail: string;
221
+ columnRoles: string;
222
+ columnExpires: string;
223
+ cancelInvitation: string;
224
+ email: string;
225
+ send: string;
226
+ sent: string;
227
+ title: string;
228
+ };
229
+ domains: {
230
+ description: string;
231
+ chooseFirst: string;
232
+ list: string;
233
+ add: string;
234
+ host: string;
235
+ hostHint: string;
236
+ cancel: string;
237
+ columnHost: string;
238
+ columnState: string;
239
+ primary: string;
240
+ verified: string;
241
+ waiting: string;
242
+ checked: string;
243
+ verify: string;
244
+ verifiedNotice: string;
245
+ makePrimary: string;
246
+ remove: string;
247
+ confirmRemove: string;
248
+ empty: string;
249
+ emptyHint: string;
250
+ howTitle: string;
251
+ how: string;
252
+ recordType: string;
253
+ recordName: string;
254
+ recordValue: string;
255
+ };
256
+ manage: {
257
+ limits: string;
258
+ limitsHint: string;
259
+ "limit.records": string;
260
+ "limit.storageBytes": string;
261
+ "limit.members": string;
262
+ "limit.requestsPerMinute": string;
263
+ used: string;
264
+ noLimit: string;
265
+ saveLimits: string;
266
+ limitsSaved: string;
267
+ danger: string;
268
+ activeHint: string;
269
+ suspendedHint: string;
270
+ suspend: string;
271
+ suspendedDone: string;
272
+ resume: string;
273
+ resumed: string;
274
+ export: string;
275
+ purge: string;
276
+ purgeConfirm: string;
277
+ purgeHint: string;
278
+ purgeAsked: string;
279
+ purgeScheduled: string;
280
+ cancelPurge: string;
281
+ purgeCancelled: string;
282
+ };
283
+ account: {
284
+ title: string;
285
+ description: string;
286
+ invited: string;
287
+ expires: string;
288
+ accept: string;
289
+ decline: string;
290
+ accepted: string;
291
+ open: string;
292
+ memberOf: string;
293
+ };
294
+ };
295
+ };
296
+ /** The invitation email's words in a language, English where there are none, with the language they're in. */
297
+ export declare function invitationMail(locale: string | null | undefined, values: {
298
+ tenant: string;
299
+ inviter: string;
300
+ days: number;
301
+ }): {
302
+ locale: "en" | "ar";
303
+ subject: string;
304
+ body: string;
305
+ action: string;
306
+ };
307
+ /** One of the plugin's top-level words in a language, for the few a route answers with itself. English where missing. */
308
+ export declare function wordIn(locale: string | null | undefined, key: "switcherNone"): string;
package/messages.js ADDED
@@ -0,0 +1,300 @@
1
+ /** The plugin's dashboard words, read as `t("ext.multi-tenant.<key>")`. */
2
+ export const messages = {
3
+ en: {
4
+ section: "Tenants",
5
+ scopeLabel: "Tenant",
6
+ switcher: "Tenant",
7
+ switcherNone: "No tenant",
8
+ pages: { tenants: "Tenants", "tenants/members": "Members", "tenants/domains": "Domains" },
9
+ settingsTitle: "Settings",
10
+ settings: {
11
+ invitationDays: { label: "Invitations last", description: "Days before an invitation to a tenant expires." },
12
+ verificationRecord: { label: "Verification record", description: "The name a tenant's TXT record goes under, before their domain, to prove they control it." },
13
+ },
14
+ tenants: {
15
+ description: "Each tenant has its own records, members and roles. Choose one at the top of the page to work in it.",
16
+ list: "Tenants",
17
+ new: "New tenant",
18
+ name: "Name",
19
+ slug: "Short name",
20
+ slugHint: "Lowercase letters, numbers and hyphens, such as acme.",
21
+ create: "Create tenant",
22
+ cancel: "Cancel",
23
+ columnName: "Name",
24
+ columnSlug: "Short name",
25
+ columnStatus: "Status",
26
+ columnRoles: "Your roles",
27
+ active: "Active",
28
+ suspended: "Suspended",
29
+ current: "Current",
30
+ switchTo: "Work here",
31
+ manage: "Manage",
32
+ noRoles: "Through your staff role",
33
+ empty: "No tenants yet",
34
+ emptyHint: "Create one to give a client or a site its own records and members.",
35
+ created: "Created {name}.",
36
+ },
37
+ members: {
38
+ description: "People who work in {tenant}, and the roles they hold here.",
39
+ chooseFirst: "Choose a tenant at the top of the page to see its members.",
40
+ list: "Members",
41
+ invite: "Invite",
42
+ columnName: "Name",
43
+ columnEmail: "Email",
44
+ columnRoles: "Roles",
45
+ empty: "No members yet",
46
+ emptyHint: "Invite someone to work in this tenant.",
47
+ editRoles: "Change roles",
48
+ remove: "Remove",
49
+ confirmRemove: "Remove {name} from this tenant? They lose access to its records at once.",
50
+ roles: "Roles",
51
+ rolesHint: "Only roles marked to apply within one tenant can be given, and only those you hold here unless you work across every tenant.",
52
+ noRolesToGive: "You hold no tenant role you could give. Mark a role to apply within one tenant under Roles.",
53
+ save: "Save",
54
+ cancel: "Cancel",
55
+ details: "Details",
56
+ name: "Name",
57
+ rename: "Save name",
58
+ renamed: "Saved.",
59
+ },
60
+ invitations: {
61
+ list: "Invitations",
62
+ empty: "No open invitations",
63
+ emptyHint: "Invitations waiting for an answer show here until they expire.",
64
+ columnEmail: "Email",
65
+ columnRoles: "Roles",
66
+ columnExpires: "Expires",
67
+ cancelInvitation: "Cancel invitation",
68
+ email: "Email",
69
+ send: "Send invitation",
70
+ sent: "Invitation sent to {email}.",
71
+ title: "Invite someone",
72
+ },
73
+ domains: {
74
+ description: "The addresses {tenant}'s site answers on. A domain works once its DNS proves this tenant controls it.",
75
+ chooseFirst: "Choose a tenant at the top of the page to see its domains.",
76
+ list: "Domains",
77
+ add: "Add domain",
78
+ host: "Domain",
79
+ hostHint: "Such as www.example.com, without https:// or a path.",
80
+ cancel: "Cancel",
81
+ columnHost: "Domain",
82
+ columnState: "State",
83
+ primary: "Main",
84
+ verified: "Verified",
85
+ waiting: "Waiting for DNS",
86
+ checked: "Last checked {date}",
87
+ verify: "Check DNS",
88
+ verifiedNotice: "{host} is verified. Its visitors now see this tenant's site.",
89
+ makePrimary: "Make main",
90
+ remove: "Remove",
91
+ confirmRemove: "Remove {host}? Its visitors stop seeing this tenant's site at once.",
92
+ empty: "No domains yet",
93
+ emptyHint: "Add one to serve this tenant's site on its own address.",
94
+ howTitle: "Prove you control a domain",
95
+ how: "Add this TXT record at the domain's DNS provider, then choose Check DNS. Point the domain at this server too, so visitors reach it.",
96
+ recordType: "Type: {type}",
97
+ recordName: "Name:",
98
+ recordValue: "Value:",
99
+ },
100
+ manage: {
101
+ limits: "Limits",
102
+ limitsHint: "What this tenant may use. Leave one empty for no limit. Requests count every API call made in the tenant, a minute at a time.",
103
+ "limit.records": "Records",
104
+ "limit.storageBytes": "Bytes of files",
105
+ "limit.members": "Members, with pending invitations",
106
+ "limit.requestsPerMinute": "API requests a minute",
107
+ used: "{count} in use.",
108
+ noLimit: "No limit",
109
+ saveLimits: "Save limits",
110
+ limitsSaved: "Limits saved.",
111
+ danger: "Danger zone",
112
+ activeHint: "Suspending closes the tenant: its sites, members and API keys reach nothing, and its data stays. It can be resumed.",
113
+ suspendedHint: "This tenant is suspended. Resume it to open it again, or ask for it to be removed for good.",
114
+ suspend: "Suspend",
115
+ suspendedDone: "The tenant is suspended.",
116
+ resume: "Resume",
117
+ resumed: "The tenant is open again.",
118
+ export: "Download its data",
119
+ purge: "Remove for good",
120
+ purgeConfirm: "Type {slug} to remove this tenant",
121
+ purgeHint: "Its records, files, settings, members and domains are deleted after the waiting period in the settings. Resuming it before then keeps everything. Download its data first.",
122
+ purgeAsked: "The tenant will be removed after the waiting period.",
123
+ purgeScheduled: "Everything this tenant has will be deleted on {date}.",
124
+ cancelPurge: "Keep it",
125
+ purgeCancelled: "The removal is called off.",
126
+ },
127
+ account: {
128
+ title: "Tenants",
129
+ description: "Invitations to work in a tenant, and the tenants you belong to.",
130
+ invited: "{tenant} invited you as {roles}.",
131
+ expires: "Expires {date}.",
132
+ accept: "Accept",
133
+ decline: "Decline",
134
+ accepted: "You joined {tenant}.",
135
+ open: "Open in the dashboard",
136
+ memberOf: "You belong to {tenant}.",
137
+ },
138
+ },
139
+ ar: {
140
+ section: "المستأجرون",
141
+ scopeLabel: "مستأجر",
142
+ switcher: "المستأجر",
143
+ switcherNone: "بلا مستأجر",
144
+ pages: { tenants: "المستأجرون", "tenants/members": "الأعضاء", "tenants/domains": "النطاقات" },
145
+ settingsTitle: "الإعدادات",
146
+ settings: {
147
+ invitationDays: { label: "مدة الدعوات", description: "عدد الأيام قبل أن تنتهي دعوة إلى مستأجر." },
148
+ verificationRecord: { label: "سجل التوثيق", description: "الاسم الذي يوضع تحته سجل TXT الخاص بالمستأجر، قبل نطاقه، لإثبات أنه يتحكم فيه." },
149
+ },
150
+ tenants: {
151
+ description: "لكل مستأجر سجلاته وأعضاؤه وأدواره. اختر واحدًا من أعلى الصفحة للعمل فيه.",
152
+ list: "المستأجرون",
153
+ new: "مستأجر جديد",
154
+ name: "الاسم",
155
+ slug: "الاسم المختصر",
156
+ slugHint: "أحرف لاتينية صغيرة وأرقام وشرطات، مثل acme.",
157
+ create: "إنشاء المستأجر",
158
+ cancel: "إلغاء",
159
+ columnName: "الاسم",
160
+ columnSlug: "الاسم المختصر",
161
+ columnStatus: "الحالة",
162
+ columnRoles: "أدوارك",
163
+ active: "نشط",
164
+ suspended: "موقوف",
165
+ current: "الحالي",
166
+ switchTo: "اعمل هنا",
167
+ manage: "إدارة",
168
+ noRoles: "عبر دورك في الطاقم",
169
+ empty: "لا يوجد مستأجرون بعد",
170
+ emptyHint: "أنشئ واحدًا لتمنح عميلًا أو موقعًا سجلاته وأعضاءه الخاصة.",
171
+ created: "تم إنشاء {name}.",
172
+ },
173
+ members: {
174
+ description: "الأشخاص الذين يعملون في {tenant}، والأدوار التي يحملونها هنا.",
175
+ chooseFirst: "اختر مستأجرًا من أعلى الصفحة لعرض أعضائه.",
176
+ list: "الأعضاء",
177
+ invite: "دعوة",
178
+ columnName: "الاسم",
179
+ columnEmail: "البريد الإلكتروني",
180
+ columnRoles: "الأدوار",
181
+ empty: "لا يوجد أعضاء بعد",
182
+ emptyHint: "ادعُ أحدًا للعمل في هذا المستأجر.",
183
+ editRoles: "تغيير الأدوار",
184
+ remove: "إزالة",
185
+ confirmRemove: "إزالة {name} من هذا المستأجر؟ سيفقد الوصول إلى سجلاته فورًا.",
186
+ roles: "الأدوار",
187
+ rolesHint: "لا يمكن منح إلا الأدوار المحددة للعمل داخل مستأجر واحد، وفقط ما تحمله هنا ما لم تكن تعمل عبر كل المستأجرين.",
188
+ noRolesToGive: "لا تحمل أي دور مستأجر يمكنك منحه. حدّد دورًا للعمل داخل مستأجر واحد من صفحة الأدوار.",
189
+ save: "حفظ",
190
+ cancel: "إلغاء",
191
+ details: "التفاصيل",
192
+ name: "الاسم",
193
+ rename: "حفظ الاسم",
194
+ renamed: "تم الحفظ.",
195
+ },
196
+ invitations: {
197
+ list: "الدعوات",
198
+ empty: "لا توجد دعوات مفتوحة",
199
+ emptyHint: "تظهر هنا الدعوات التي تنتظر ردًا حتى تنتهي صلاحيتها.",
200
+ columnEmail: "البريد الإلكتروني",
201
+ columnRoles: "الأدوار",
202
+ columnExpires: "تنتهي",
203
+ cancelInvitation: "إلغاء الدعوة",
204
+ email: "البريد الإلكتروني",
205
+ send: "إرسال الدعوة",
206
+ sent: "أُرسلت الدعوة إلى {email}.",
207
+ title: "دعوة شخص",
208
+ },
209
+ domains: {
210
+ description: "العناوين التي يجيب عليها موقع {tenant}. يعمل النطاق بعد أن يثبت نظام أسماء النطاقات (DNS) أن هذا المستأجر يتحكم فيه.",
211
+ chooseFirst: "اختر مستأجرًا من أعلى الصفحة لعرض نطاقاته.",
212
+ list: "النطاقات",
213
+ add: "إضافة نطاق",
214
+ host: "النطاق",
215
+ hostHint: "مثل www.example.com، دون https:// أو مسار.",
216
+ cancel: "إلغاء",
217
+ columnHost: "النطاق",
218
+ columnState: "الحالة",
219
+ primary: "الرئيسي",
220
+ verified: "موثَّق",
221
+ waiting: "بانتظار DNS",
222
+ checked: "آخر فحص {date}",
223
+ verify: "فحص DNS",
224
+ verifiedNotice: "تم توثيق {host}. يرى زواره الآن موقع هذا المستأجر.",
225
+ makePrimary: "اجعله الرئيسي",
226
+ remove: "إزالة",
227
+ confirmRemove: "إزالة {host}؟ سيتوقف زواره عن رؤية موقع هذا المستأجر فورًا.",
228
+ empty: "لا توجد نطاقات بعد",
229
+ emptyHint: "أضف نطاقًا ليُعرض موقع هذا المستأجر على عنوانه الخاص.",
230
+ howTitle: "أثبت أنك تتحكم في النطاق",
231
+ how: "أضف سجل TXT هذا لدى مزوّد DNS الخاص بالنطاق، ثم اختر «فحص DNS». ووجّه النطاق إلى هذا الخادم أيضًا ليصل إليه الزوار.",
232
+ recordType: "النوع: {type}",
233
+ recordName: "الاسم:",
234
+ recordValue: "القيمة:",
235
+ },
236
+ manage: {
237
+ limits: "الحدود",
238
+ limitsHint: "ما يحق لهذا المستأجر استخدامه. اترك الحقل فارغًا لعدم وضع حد. تُحسب الطلبات لكل استدعاء للواجهة البرمجية في المستأجر، دقيقةً بدقيقة.",
239
+ "limit.records": "السجلات",
240
+ "limit.storageBytes": "حجم الملفات بالبايت",
241
+ "limit.members": "الأعضاء، مع الدعوات المعلّقة",
242
+ "limit.requestsPerMinute": "طلبات الواجهة البرمجية في الدقيقة",
243
+ used: "المستخدم: {count}.",
244
+ noLimit: "بلا حد",
245
+ saveLimits: "حفظ الحدود",
246
+ limitsSaved: "حُفظت الحدود.",
247
+ danger: "منطقة الخطر",
248
+ activeHint: "الإيقاف يغلق المستأجر: لا تصل مواقعه ولا أعضاؤه ولا مفاتيحه إلى شيء، وتبقى بياناته. ويمكن استئنافه.",
249
+ suspendedHint: "هذا المستأجر موقوف. استأنفه لفتحه من جديد، أو اطلب حذفه نهائيًا.",
250
+ suspend: "إيقاف",
251
+ suspendedDone: "أُوقف المستأجر.",
252
+ resume: "استئناف",
253
+ resumed: "فُتح المستأجر من جديد.",
254
+ export: "تنزيل بياناته",
255
+ purge: "حذف نهائي",
256
+ purgeConfirm: "اكتب {slug} لحذف هذا المستأجر",
257
+ purgeHint: "تُحذف سجلاته وملفاته وإعداداته وأعضاؤه ونطاقاته بعد مدة الانتظار المحددة في الإعدادات. استئنافه قبل ذلك يُبقي كل شيء. نزّل بياناته أولًا.",
258
+ purgeAsked: "سيُحذف المستأجر بعد مدة الانتظار.",
259
+ purgeScheduled: "سيُحذف كل ما لدى هذا المستأجر في {date}.",
260
+ cancelPurge: "الإبقاء عليه",
261
+ purgeCancelled: "أُلغي الحذف.",
262
+ },
263
+ account: {
264
+ title: "المستأجرون",
265
+ description: "دعوات العمل في مستأجر، والمستأجرون الذين تنتمي إليهم.",
266
+ invited: "دعاك {tenant} بصفة {roles}.",
267
+ expires: "تنتهي في {date}.",
268
+ accept: "قبول",
269
+ decline: "رفض",
270
+ accepted: "انضممت إلى {tenant}.",
271
+ open: "افتح في لوحة التحكم",
272
+ memberOf: "أنت عضو في {tenant}.",
273
+ },
274
+ },
275
+ };
276
+ /** The invitation email, in the invitee's language. */
277
+ const mail = {
278
+ en: {
279
+ subject: "You're invited to {tenant}",
280
+ body: "{inviter} invited you to work on {tenant}. Sign in with this email address to accept. The invitation lasts {days} days.",
281
+ action: "Accept the invitation",
282
+ },
283
+ ar: {
284
+ subject: "دعوة للانضمام إلى {tenant}",
285
+ body: "دعاك {inviter} للعمل على {tenant}. سجّل الدخول بعنوان البريد هذا لقبول الدعوة. تبقى الدعوة صالحة {days} يومًا.",
286
+ action: "اقبل الدعوة",
287
+ },
288
+ };
289
+ /** The invitation email's words in a language, English where there are none, with the language they're in. */
290
+ export function invitationMail(locale, values) {
291
+ const language = locale && locale.split("-")[0] in mail ? locale.split("-")[0] : "en";
292
+ const fill = (text) => text.replace(/\{(\w+)\}/g, (_, name) => String(values[name] ?? ""));
293
+ const words = mail[language];
294
+ return { locale: language, subject: fill(words.subject), body: fill(words.body), action: words.action };
295
+ }
296
+ /** One of the plugin's top-level words in a language, for the few a route answers with itself. English where missing. */
297
+ export function wordIn(locale, key) {
298
+ const words = (locale && messages[locale]) || messages.en;
299
+ return words[key] ?? messages.en[key];
300
+ }
package/package.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "@tansy/multi-tenant",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Many tenants on one tansy: organizations with their own members, roles, domains, content, files and limits.",
5
+ "keywords": [
6
+ "tansy",
7
+ "tansy-plugin",
8
+ "cms",
9
+ "nextjs"
10
+ ],
11
+ "license": "MIT",
12
+ "author": "Mohamed Salah <mohamedsalahsebai@gmail.com>",
13
+ "homepage": "https://github.com/mhmdsalahsebai/tansy",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/mhmdsalahsebai/tansy.git",
17
+ "directory": "plugins/multi-tenant"
18
+ },
19
+ "bugs": "https://github.com/mhmdsalahsebai/tansy/issues",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./index.d.ts",
23
+ "default": "./index.js"
24
+ },
25
+ "./admin": {
26
+ "types": "./admin.d.ts",
27
+ "default": "./admin.js"
28
+ }
29
+ },
30
+ "peerDependencies": {
31
+ "next": "^16.4.6",
32
+ "react": "^19.3.0",
33
+ "tansy": "^0.1.1"
34
+ },
35
+ "dependencies": {
36
+ "better-auth": "^1.7.18",
37
+ "zod": "^4.6.7"
38
+ }
39
+ }
package/pages.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ export declare function TenantsList({ canCreate, canManage, canUpdate, canDelete }: {
2
+ canCreate: boolean;
3
+ canManage?: boolean;
4
+ canUpdate?: boolean;
5
+ canDelete?: boolean;
6
+ }): import("react").JSX.Element;
7
+ /** The current tenant's members and open invitations. */
8
+ export declare function TenantMembers({ canRename }: {
9
+ canRename: boolean;
10
+ }): import("react").JSX.Element;
11
+ /** The current tenant's domains: adding one, the TXT record that proves it, checking it, and choosing the main one. */
12
+ export declare function TenantDomains(): import("react").JSX.Element;
13
+ /**
14
+ * On the account page, which anyone signed in can open: invitations to accept, and the tenants
15
+ * they belong to, so someone with no dashboard access yet can join and open their tenant.
16
+ */
17
+ export declare function AccountTenants(): import("react").JSX.Element | null;