@norbix.ai/react-redux 0.1.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.
package/dist/index.js ADDED
@@ -0,0 +1,2042 @@
1
+ import { createApi } from '@reduxjs/toolkit/query/react';
2
+ import { createContext, useMemo, useContext } from 'react';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ // src/createNorbixApi.ts
6
+
7
+ // src/errors.ts
8
+ function serializeNorbixError(err) {
9
+ if (err && typeof err === "object") {
10
+ const e = err;
11
+ return {
12
+ status: typeof e.status === "number" ? e.status : 0,
13
+ code: e.code,
14
+ message: e.message ?? "Unknown Norbix error",
15
+ fieldErrors: Array.isArray(e.fieldErrors) ? e.fieldErrors : [],
16
+ url: e.url
17
+ };
18
+ }
19
+ return {
20
+ status: 0,
21
+ message: typeof err === "string" ? err : "Unknown Norbix error",
22
+ fieldErrors: []
23
+ };
24
+ }
25
+
26
+ // src/baseQuery.ts
27
+ function createNorbixBaseQuery(getClient) {
28
+ return async (call) => {
29
+ let client;
30
+ try {
31
+ client = getClient();
32
+ } catch (err) {
33
+ return { error: serializeNorbixError(err) };
34
+ }
35
+ if (!client) {
36
+ return {
37
+ error: {
38
+ status: 0,
39
+ code: "NORBIX_NO_CLIENT",
40
+ message: "No Norbix client available. Did you forget <NorbixProvider>?",
41
+ fieldErrors: []
42
+ }
43
+ };
44
+ }
45
+ try {
46
+ const data = await call(client);
47
+ return { data };
48
+ } catch (err) {
49
+ return { error: serializeNorbixError(err) };
50
+ }
51
+ };
52
+ }
53
+
54
+ // src/hooks/api/apikeys.ts
55
+ var apiApikeys = (b) => ({
56
+ getApiKeys: b.query({
57
+ query: (args) => (norbix) => norbix.api.apikeys.getApiKeys(args),
58
+ providesTags: [{ type: "ApiKey", id: "LIST" }]
59
+ }),
60
+ regenerateApiKeys: b.mutation({
61
+ query: (args) => (norbix) => norbix.api.apikeys.regenerateApiKeys(args),
62
+ invalidatesTags: [{ type: "ApiKey", id: "LIST" }]
63
+ })
64
+ });
65
+
66
+ // src/hooks/api/auth.ts
67
+ var apiAuth = (b) => ({
68
+ login: b.mutation({
69
+ query: (creds) => (norbix) => norbix.login(creds),
70
+ invalidatesTags: [
71
+ { type: "MembershipUsers", id: "LIST" },
72
+ { type: "AccountProfile", id: "CURRENT" },
73
+ { type: "Account", id: "Profile" }
74
+ ]
75
+ }),
76
+ authenticate: b.mutation({
77
+ query: (req) => (norbix) => norbix.api.auth.authenticate(req)
78
+ }),
79
+ logout: b.mutation({
80
+ queryFn: async (_arg, _api, _opts, baseQuery) => {
81
+ const result = await baseQuery((norbix) => {
82
+ norbix.logout();
83
+ return Promise.resolve();
84
+ });
85
+ if (result.error) return { error: result.error };
86
+ return { data: void 0 };
87
+ },
88
+ invalidatesTags: [
89
+ { type: "MembershipUsers", id: "LIST" },
90
+ { type: "AccountProfile", id: "CURRENT" },
91
+ { type: "Account", id: "Profile" },
92
+ { type: "DatabaseCollections" },
93
+ { type: "DatabaseSchemas" }
94
+ ]
95
+ })
96
+ });
97
+
98
+ // src/hooks/api/chat.ts
99
+ var apiChat = (b) => ({
100
+ askChat: b.mutation({
101
+ query: (args) => (norbix) => norbix.api.chat.askChat(args)
102
+ })
103
+ });
104
+
105
+ // src/hooks/api/database.ts
106
+ var apiDatabase = (b) => ({
107
+ // ---- Collections — Read ----
108
+ findCollection: b.query({
109
+ query: (args) => (norbix) => norbix.api.database.find(args),
110
+ providesTags: (_res, _err, arg) => [
111
+ { type: "DatabaseCollections", id: arg?.collectionName ?? "ANY" }
112
+ ]
113
+ }),
114
+ findOne: b.query({
115
+ query: (args) => (norbix) => norbix.api.database.findOne(args),
116
+ providesTags: (_res, _err, arg) => [
117
+ { type: "DatabaseCollections", id: arg?.collectionName ?? "ANY" }
118
+ ]
119
+ }),
120
+ countCollection: b.query({
121
+ query: (args) => (norbix) => norbix.api.database.count(args),
122
+ providesTags: (_res, _err, arg) => [
123
+ { type: "DatabaseCollections", id: arg?.collectionName ?? "ANY" }
124
+ ]
125
+ }),
126
+ distinct: b.query({
127
+ query: (args) => (norbix) => norbix.api.database.distinct(args),
128
+ providesTags: (_res, _err, arg) => [
129
+ { type: "DatabaseCollections", id: arg?.collectionName ?? "ANY" }
130
+ ]
131
+ }),
132
+ aggregate: b.mutation({
133
+ query: (args) => (norbix) => norbix.api.database.aggregate(args)
134
+ }),
135
+ executeAggregate: b.mutation({
136
+ query: (args) => (norbix) => norbix.api.database.executeAggregate(args)
137
+ }),
138
+ // ---- Collections — Write ----
139
+ insertOne: b.mutation({
140
+ query: (args) => (norbix) => norbix.api.database.insertOne(args),
141
+ invalidatesTags: (_res, _err, arg) => [
142
+ { type: "DatabaseCollections", id: arg?.collectionName ?? "ANY" }
143
+ ]
144
+ }),
145
+ insertMany: b.mutation({
146
+ query: (args) => (norbix) => norbix.api.database.insertMany(args),
147
+ invalidatesTags: (_res, _err, arg) => [
148
+ { type: "DatabaseCollections", id: arg?.collectionName ?? "ANY" }
149
+ ]
150
+ }),
151
+ updateOne: b.mutation({
152
+ query: (args) => (norbix) => norbix.api.database.updateOne(args),
153
+ invalidatesTags: (_res, _err, arg) => [
154
+ { type: "DatabaseCollections", id: arg?.collectionName ?? "ANY" }
155
+ ]
156
+ }),
157
+ updateMany: b.mutation({
158
+ query: (args) => (norbix) => norbix.api.database.updateMany(args),
159
+ invalidatesTags: (_res, _err, arg) => [
160
+ { type: "DatabaseCollections", id: arg?.collectionName ?? "ANY" }
161
+ ]
162
+ }),
163
+ replaceOne: b.mutation({
164
+ query: (args) => (norbix) => norbix.api.database.replaceOne(args),
165
+ invalidatesTags: (_res, _err, arg) => [
166
+ { type: "DatabaseCollections", id: arg?.collectionName ?? "ANY" }
167
+ ]
168
+ }),
169
+ deleteOne: b.mutation({
170
+ query: (args) => (norbix) => norbix.api.database.deleteOne(args),
171
+ invalidatesTags: (_res, _err, arg) => [
172
+ { type: "DatabaseCollections", id: arg?.collectionName ?? "ANY" }
173
+ ]
174
+ }),
175
+ deleteMany: b.mutation({
176
+ query: (args) => (norbix) => norbix.api.database.deleteMany(args),
177
+ invalidatesTags: (_res, _err, arg) => [
178
+ { type: "DatabaseCollections", id: arg?.collectionName ?? "ANY" }
179
+ ]
180
+ }),
181
+ changeResponsibility: b.mutation({
182
+ query: (args) => (norbix) => norbix.api.database.changeResponsibility(args),
183
+ invalidatesTags: (_res, _err, arg) => [
184
+ { type: "DatabaseCollections", id: arg?.collectionName ?? "ANY" }
185
+ ]
186
+ }),
187
+ // ---- Taxonomies (read-only on api; admin lives in hub.database) ----
188
+ findTerms: b.query({
189
+ query: (args) => (norbix) => norbix.api.database.findTerms(args),
190
+ providesTags: (_res, _err, arg) => [
191
+ { type: "DatabaseTaxonomyTerms", id: arg?.taxonomyName ?? "ANY" }
192
+ ]
193
+ }),
194
+ findTermsChildren: b.query({
195
+ query: (args) => (norbix) => norbix.api.database.findTermsChildren(args),
196
+ providesTags: (_res, _err, arg) => [
197
+ { type: "DatabaseTaxonomyTerms", id: arg?.taxonomyName ?? "ANY" }
198
+ ]
199
+ }),
200
+ // Whole term tree of a taxonomy (or a sub-tree from a root term) in one call.
201
+ findTermTree: b.query({
202
+ query: (args) => (norbix) => norbix.api.database.findTermTree(args),
203
+ providesTags: (_res, _err, arg) => [
204
+ { type: "DatabaseTaxonomyTerms", id: arg?.taxonomyName ?? "ANY" }
205
+ ]
206
+ }),
207
+ // Single-parent taxonomy structure tree (Countries → Cities), optionally with terms.
208
+ findTaxonomyTree: b.query({
209
+ query: (args) => (norbix) => norbix.api.database.findTaxonomyTree(args),
210
+ providesTags: () => [{ type: "DatabaseTaxonomyTerms", id: "ANY" }]
211
+ }),
212
+ // ---- Schemas (read-only mirror; full CRUD lives in hub.database) ----
213
+ getApiDatabaseSchema: b.query({
214
+ query: (args) => (norbix) => norbix.api.database.getDatabaseSchema(args),
215
+ providesTags: (_res, _err, arg) => [
216
+ { type: "DatabaseSchemas", id: arg?.id ?? "CURRENT" }
217
+ ]
218
+ }),
219
+ getApiDatabaseSchemas: b.query({
220
+ query: (args) => (norbix) => norbix.api.database.getDatabaseSchemas(args),
221
+ providesTags: [{ type: "DatabaseSchemas", id: "LIST" }]
222
+ })
223
+ });
224
+
225
+ // src/hooks/api/files.ts
226
+ var apiFiles = (b) => ({
227
+ commitUpload: b.mutation({
228
+ query: (args) => (norbix) => norbix.api.files.commitUpload(args),
229
+ invalidatesTags: ["Files"]
230
+ }),
231
+ deleteFileApi: b.mutation({
232
+ query: (args) => (norbix) => norbix.api.files.deleteFileApi(args),
233
+ invalidatesTags: ["Files"]
234
+ }),
235
+ deleteManyFilesApi: b.mutation({
236
+ query: (args) => (norbix) => norbix.api.files.deleteManyFilesApi(args),
237
+ invalidatesTags: ["Files"]
238
+ }),
239
+ downloadFileApi: b.query({
240
+ query: (args) => (norbix) => norbix.api.files.downloadFileApi(args),
241
+ providesTags: ["Files"]
242
+ }),
243
+ getFileInfo: b.query({
244
+ query: (args) => (norbix) => norbix.api.files.getFileInfo(args),
245
+ providesTags: ["Files"]
246
+ }),
247
+ getSignedUrl: b.query({
248
+ query: (args) => (norbix) => norbix.api.files.getSignedUrl(args),
249
+ providesTags: ["Files"]
250
+ }),
251
+ listFiles: b.query({
252
+ query: (args) => (norbix) => norbix.api.files.listFiles(args),
253
+ providesTags: ["Files"]
254
+ }),
255
+ requestUploadUrl: b.mutation({
256
+ query: (args) => (norbix) => norbix.api.files.requestUploadUrl(args),
257
+ invalidatesTags: ["Files"]
258
+ }),
259
+ /**
260
+ * Reads a file somebody published from the Hub side. The one Files call
261
+ * that carries no credentials at all — the link has to work in an e-mail,
262
+ * in an `<img src>`, or in a browser on a stranger's phone.
263
+ *
264
+ * Answers with the file's raw bytes (`Uint8Array`), not JSON.
265
+ *
266
+ * Cached under its own `id` rather than the plain `Files` tag: the bytes
267
+ * belong to the public link, and are keyed by the id + name a caller asked
268
+ * for. Making the file private again invalidates `Files`, which is a
269
+ * different tag, so a stale cache entry here is possible — call
270
+ * `refetch()` when that matters to you.
271
+ */
272
+ getPublicFile: b.query({
273
+ query: (args) => (norbix) => norbix.api.files.getPublicFile(args),
274
+ providesTags: (_res, _err, arg) => [
275
+ { type: "Files", id: `PUBLIC:${arg?.publicId ?? "unknown"}` }
276
+ ]
277
+ })
278
+ });
279
+
280
+ // src/hooks/api/membership.ts
281
+ var apiMembership = (b) => ({
282
+ blockUser: b.mutation({
283
+ query: (args) => (norbix) => norbix.api.membership.blockUser(args),
284
+ invalidatesTags: ["MembershipUsers"]
285
+ }),
286
+ saveSystemUserWithPermissions: b.mutation({
287
+ query: (args) => (norbix) => norbix.api.membership.saveSystemUserWithPermissions(args),
288
+ invalidatesTags: ["MembershipUsers"]
289
+ }),
290
+ saveGuestUser: b.mutation({
291
+ query: (args) => (norbix) => norbix.api.membership.saveGuestUser(args),
292
+ invalidatesTags: ["MembershipUsers"]
293
+ }),
294
+ saveUserNameUser: b.mutation({
295
+ query: (args) => (norbix) => norbix.api.membership.saveUserNameUser(args),
296
+ invalidatesTags: ["MembershipUsers"]
297
+ }),
298
+ saveEmailUser: b.mutation({
299
+ query: (args) => (norbix) => norbix.api.membership.saveEmailUser(args),
300
+ invalidatesTags: ["MembershipUsers"]
301
+ }),
302
+ savePhoneUser: b.mutation({
303
+ query: (args) => (norbix) => norbix.api.membership.savePhoneUser(args),
304
+ invalidatesTags: ["MembershipUsers"]
305
+ }),
306
+ savePhoneUserNameWithPermissions: b.mutation({
307
+ query: (args) => (norbix) => norbix.api.membership.savePhoneUserNameWithPermissions(args),
308
+ invalidatesTags: ["MembershipUsers"]
309
+ }),
310
+ saveEmailUserNameWithPermissions: b.mutation({
311
+ query: (args) => (norbix) => norbix.api.membership.saveEmailUserNameWithPermissions(args),
312
+ invalidatesTags: ["MembershipUsers"]
313
+ }),
314
+ saveUserNameWithPermissions: b.mutation({
315
+ query: (args) => (norbix) => norbix.api.membership.saveUserNameWithPermissions(args),
316
+ invalidatesTags: ["MembershipUsers"]
317
+ }),
318
+ deleteUser: b.mutation({
319
+ query: (args) => (norbix) => norbix.api.membership.deleteUser(args),
320
+ invalidatesTags: ["MembershipUsers"]
321
+ }),
322
+ getUser: b.query({
323
+ query: (args) => (norbix) => norbix.api.membership.getUser(args),
324
+ providesTags: ["MembershipUsers"]
325
+ }),
326
+ getUsers: b.query({
327
+ query: (args) => (norbix) => norbix.api.membership.getUsers(args),
328
+ providesTags: ["MembershipUsers"]
329
+ }),
330
+ getUserPreferences: b.query({
331
+ query: (args) => (norbix) => norbix.api.membership.getUserPreferences(args),
332
+ providesTags: ["MembershipUsers"]
333
+ }),
334
+ inviteUser: b.mutation({
335
+ query: (args) => (norbix) => norbix.api.membership.inviteUser(args),
336
+ invalidatesTags: ["MembershipUsers"]
337
+ }),
338
+ linkIdentity: b.mutation({
339
+ query: (args) => (norbix) => norbix.api.membership.linkIdentity(args),
340
+ invalidatesTags: ["MembershipUsers"]
341
+ }),
342
+ assignRolePermissions: b.mutation({
343
+ query: (args) => (norbix) => norbix.api.membership.assignRolePermissions(args),
344
+ invalidatesTags: ["MembershipRoles"]
345
+ }),
346
+ unblockUser: b.mutation({
347
+ query: (args) => (norbix) => norbix.api.membership.unblockUser(args),
348
+ invalidatesTags: ["MembershipUsers"]
349
+ }),
350
+ updateUser: b.mutation({
351
+ query: (args) => (norbix) => norbix.api.membership.updateUser(args),
352
+ invalidatesTags: ["MembershipUsers"]
353
+ }),
354
+ updateUserPreferences: b.mutation({
355
+ query: (args) => (norbix) => norbix.api.membership.updateUserPreferences(args),
356
+ invalidatesTags: ["MembershipUsers"]
357
+ }),
358
+ passkeyAuthenticationOptions: b.mutation({
359
+ query: (args) => (norbix) => norbix.api.membership.passkeyAuthenticationOptions(args),
360
+ invalidatesTags: ["MembershipUsers"]
361
+ }),
362
+ verifyPasskeyAuthentication: b.mutation({
363
+ query: (args) => (norbix) => norbix.api.membership.verifyPasskeyAuthentication(args),
364
+ invalidatesTags: ["MembershipUsers"]
365
+ }),
366
+ listPasskeys: b.query({
367
+ query: (args) => (norbix) => norbix.api.membership.listPasskeys(args),
368
+ providesTags: ["MembershipUsers"]
369
+ }),
370
+ renamePasskey: b.mutation({
371
+ query: (args) => (norbix) => norbix.api.membership.renamePasskey(args),
372
+ invalidatesTags: ["MembershipUsers"]
373
+ }),
374
+ revokePasskey: b.mutation({
375
+ query: (args) => (norbix) => norbix.api.membership.revokePasskey(args),
376
+ invalidatesTags: ["MembershipUsers"]
377
+ }),
378
+ useRecoveryCode: b.mutation({
379
+ query: (args) => (norbix) => norbix.api.membership.useRecoveryCode(args),
380
+ invalidatesTags: ["MembershipUsers"]
381
+ }),
382
+ requestMagicLink: b.mutation({
383
+ query: (args) => (norbix) => norbix.api.membership.requestMagicLink(args),
384
+ invalidatesTags: ["MembershipUsers"]
385
+ }),
386
+ consumeMagicLink: b.mutation({
387
+ query: (args) => (norbix) => norbix.api.membership.consumeMagicLink(args),
388
+ invalidatesTags: ["MembershipUsers"]
389
+ }),
390
+ hasPasskey: b.query({
391
+ query: (args) => (norbix) => norbix.api.membership.hasPasskey(args),
392
+ providesTags: ["MembershipUsers"]
393
+ }),
394
+ startEmailVerification: b.mutation({
395
+ query: (args) => (norbix) => norbix.api.membership.startEmailVerification(args),
396
+ invalidatesTags: ["MembershipUsers"]
397
+ }),
398
+ confirmEmailVerification: b.mutation({
399
+ query: (args) => (norbix) => norbix.api.membership.confirmEmailVerification(args),
400
+ invalidatesTags: ["MembershipUsers"]
401
+ }),
402
+ passkeyRegistrationOptions: b.mutation({
403
+ query: (args) => (norbix) => norbix.api.membership.passkeyRegistrationOptions(args),
404
+ invalidatesTags: ["MembershipUsers"]
405
+ }),
406
+ verifyPasskeyRegistration: b.mutation({
407
+ query: (args) => (norbix) => norbix.api.membership.verifyPasskeyRegistration(args),
408
+ invalidatesTags: ["MembershipUsers"]
409
+ }),
410
+ refreshPasskeyToken: b.mutation({
411
+ query: (args) => (norbix) => norbix.api.membership.refreshPasskeyToken(args),
412
+ invalidatesTags: ["MembershipUsers"]
413
+ }),
414
+ passkeyLogout: b.mutation({
415
+ query: (args) => (norbix) => norbix.api.membership.passkeyLogout(args),
416
+ invalidatesTags: ["MembershipUsers"]
417
+ }),
418
+ // ---- password (change + reset) -------------------------------------
419
+ changePassword: b.mutation({
420
+ query: (args) => (norbix) => norbix.api.membership.changePassword(args)
421
+ }),
422
+ requestPasswordReset: b.mutation({
423
+ query: (args) => (norbix) => norbix.api.membership.requestPasswordReset(args)
424
+ }),
425
+ confirmPasswordReset: b.mutation({
426
+ query: (args) => (norbix) => norbix.api.membership.confirmPasswordReset(args)
427
+ })
428
+ });
429
+
430
+ // src/hooks/api/public.ts
431
+ var apiPublic = (b) => ({
432
+ getPublicProjectConfig: b.query({
433
+ query: (args) => (norbix) => norbix.api.public.getPublicProjectConfig(args),
434
+ providesTags: [{ type: "Config", id: "PUBLIC" }]
435
+ }),
436
+ getPublicProjectLegal: b.query({
437
+ query: (args) => (norbix) => norbix.api.public.getPublicProjectLegal(args),
438
+ providesTags: (_res, _err, arg) => [
439
+ { type: "Config", id: `LEGAL:${arg?.kind ?? "unknown"}` }
440
+ ]
441
+ })
442
+ });
443
+
444
+ // src/hooks/hub/account.ts
445
+ var hubAccount = (b) => ({
446
+ getAccountProfile: b.query({
447
+ query: (args) => (norbix) => norbix.hub.account.getAccountProfile(args),
448
+ providesTags: ["Account"]
449
+ }),
450
+ updateAccountProfile: b.mutation({
451
+ query: (args) => (norbix) => norbix.hub.account.updateAccountProfile(args),
452
+ invalidatesTags: ["Account"]
453
+ }),
454
+ resendAccountVerificationToken: b.mutation({
455
+ query: (args) => (norbix) => norbix.hub.account.resendAccountVerificationToken(args),
456
+ invalidatesTags: ["Account"]
457
+ }),
458
+ getAccountStatus: b.query({
459
+ query: (args) => (norbix) => norbix.hub.account.getAccountStatus(args),
460
+ providesTags: ["Account"]
461
+ }),
462
+ createStripeCheckoutSession: b.mutation({
463
+ query: (args) => (norbix) => norbix.hub.account.createStripeCheckoutSession(args),
464
+ invalidatesTags: ["Billing"]
465
+ }),
466
+ getStripeBillingPortalUrl: b.query({
467
+ query: (args) => (norbix) => norbix.hub.account.getStripeBillingPortalUrl(args),
468
+ providesTags: ["Billing"]
469
+ }),
470
+ createTeamMemberFromInvitation: b.mutation({
471
+ query: (args) => (norbix) => norbix.hub.account.createTeamMemberFromInvitation(args),
472
+ invalidatesTags: ["Account"]
473
+ }),
474
+ verifyAccount: b.mutation({
475
+ query: (args) => (norbix) => norbix.hub.account.verifyAccount(args),
476
+ invalidatesTags: ["Account"]
477
+ }),
478
+ deleteNotificationsGroup: b.mutation({
479
+ query: (args) => (norbix) => norbix.hub.account.deleteNotificationsGroup(args),
480
+ invalidatesTags: ["Account"]
481
+ }),
482
+ deleteNotificationsTag: b.mutation({
483
+ query: (args) => (norbix) => norbix.hub.account.deleteNotificationsTag(args),
484
+ invalidatesTags: ["Account"]
485
+ }),
486
+ removeTagFromNotificationsGroup: b.mutation({
487
+ query: (args) => (norbix) => norbix.hub.account.removeTagFromNotificationsGroup(args),
488
+ invalidatesTags: ["Account"]
489
+ }),
490
+ saveNotificationsGroup: b.mutation({
491
+ query: (args) => (norbix) => norbix.hub.account.saveNotificationsGroup(args),
492
+ invalidatesTags: ["Account"]
493
+ }),
494
+ saveNotificationsTag: b.mutation({
495
+ query: (args) => (norbix) => norbix.hub.account.saveNotificationsTag(args),
496
+ invalidatesTags: ["Account"]
497
+ }),
498
+ createProject: b.mutation({
499
+ query: (args) => (norbix) => norbix.hub.account.createProject(args),
500
+ invalidatesTags: ["Projects"]
501
+ }),
502
+ deleteProject: b.mutation({
503
+ query: (args) => (norbix) => norbix.hub.account.deleteProject(args),
504
+ invalidatesTags: ["Projects"]
505
+ }),
506
+ getProject: b.query({
507
+ query: (args) => (norbix) => norbix.hub.account.getProject(args),
508
+ providesTags: ["Projects"]
509
+ }),
510
+ getProjects: b.query({
511
+ query: (args) => (norbix) => norbix.hub.account.getProjects(args),
512
+ providesTags: ["Projects"]
513
+ }),
514
+ getAccountRegions: b.query({
515
+ query: (args) => (norbix) => norbix.hub.account.getAccountRegions(args),
516
+ providesTags: ["Account"]
517
+ }),
518
+ getProjectTokens: b.query({
519
+ query: (args) => (norbix) => norbix.hub.account.getProjectTokens(args),
520
+ providesTags: ["Projects"]
521
+ }),
522
+ updateProjectAccentColor: b.mutation({
523
+ query: (args) => (norbix) => norbix.hub.account.updateProjectAccentColor(args),
524
+ invalidatesTags: ["Projects"]
525
+ }),
526
+ updateProjectIcon: b.mutation({
527
+ query: (args) => (norbix) => norbix.hub.account.updateProjectIcon(args),
528
+ invalidatesTags: ["Projects"]
529
+ }),
530
+ updateProjectLogo: b.mutation({
531
+ query: (args) => (norbix) => norbix.hub.account.updateProjectLogo(args),
532
+ invalidatesTags: ["Projects"]
533
+ }),
534
+ updateProjectMainColor: b.mutation({
535
+ query: (args) => (norbix) => norbix.hub.account.updateProjectMainColor(args),
536
+ invalidatesTags: ["Projects"]
537
+ }),
538
+ updateProjectAllowedOrigins: b.mutation({
539
+ query: (args) => (norbix) => norbix.hub.account.updateProjectAllowedOrigins(args),
540
+ invalidatesTags: ["Projects"]
541
+ }),
542
+ updateProjectDefaultLanguage: b.mutation({
543
+ query: (args) => (norbix) => norbix.hub.account.updateProjectDefaultLanguage(args),
544
+ invalidatesTags: ["Projects"]
545
+ }),
546
+ updateProjectDescription: b.mutation({
547
+ query: (args) => (norbix) => norbix.hub.account.updateProjectDescription(args),
548
+ invalidatesTags: ["Projects"]
549
+ }),
550
+ disableProject: b.mutation({
551
+ query: (args) => (norbix) => norbix.hub.account.disableProject(args),
552
+ invalidatesTags: ["Projects"]
553
+ }),
554
+ enableProject: b.mutation({
555
+ query: (args) => (norbix) => norbix.hub.account.enableProject(args),
556
+ invalidatesTags: ["Projects"]
557
+ }),
558
+ updateProjectLanguages: b.mutation({
559
+ query: (args) => (norbix) => norbix.hub.account.updateProjectLanguages(args),
560
+ invalidatesTags: ["Projects"]
561
+ }),
562
+ updateProjectUrl: b.mutation({
563
+ query: (args) => (norbix) => norbix.hub.account.updateProjectUrl(args),
564
+ invalidatesTags: ["Projects"]
565
+ }),
566
+ updateProjectName: b.mutation({
567
+ query: (args) => (norbix) => norbix.hub.account.updateProjectName(args),
568
+ invalidatesTags: ["Projects"]
569
+ }),
570
+ updateProjectRegions: b.mutation({
571
+ query: (args) => (norbix) => norbix.hub.account.updateProjectRegions(args),
572
+ invalidatesTags: ["Projects"]
573
+ }),
574
+ createAccount: b.mutation({
575
+ query: (args) => (norbix) => norbix.hub.account.createAccount(args),
576
+ invalidatesTags: ["Account"]
577
+ }),
578
+ getAccountCollaborators: b.query({
579
+ query: (args) => (norbix) => norbix.hub.account.getAccountCollaborators(args),
580
+ providesTags: ["Account"]
581
+ }),
582
+ sendInviteToTeamMember: b.mutation({
583
+ query: (args) => (norbix) => norbix.hub.account.sendInviteToTeamMember(args),
584
+ invalidatesTags: ["Account"]
585
+ }),
586
+ getLicenses: b.query({
587
+ query: (args) => (norbix) => norbix.hub.account.getLicenses(args),
588
+ providesTags: ["Billing"]
589
+ }),
590
+ askAccountChat: b.mutation({
591
+ query: (args) => (norbix) => norbix.hub.account.askChat(args),
592
+ invalidatesTags: ["Account"]
593
+ })
594
+ });
595
+
596
+ // src/hooks/hub/ai.ts
597
+ var hubAi = (b) => ({
598
+ deleteLlmIntegration: b.mutation({
599
+ query: (args) => (norbix) => norbix.hub.ai.deleteLlmIntegration(args),
600
+ invalidatesTags: ["Ai"]
601
+ }),
602
+ disableLlmIntegration: b.mutation({
603
+ query: (args) => (norbix) => norbix.hub.ai.disableLlmIntegration(args),
604
+ invalidatesTags: ["Ai"]
605
+ }),
606
+ enableLlmIntegration: b.mutation({
607
+ query: (args) => (norbix) => norbix.hub.ai.enableLlmIntegration(args),
608
+ invalidatesTags: ["Ai"]
609
+ }),
610
+ getLlmIntegration: b.query({
611
+ query: (args) => (norbix) => norbix.hub.ai.getLlmIntegration(args),
612
+ providesTags: ["Ai"]
613
+ }),
614
+ getLlmIntegrations: b.query({
615
+ query: (args) => (norbix) => norbix.hub.ai.getLlmIntegrations(args),
616
+ providesTags: ["Ai"]
617
+ }),
618
+ saveLlmIntegration: b.mutation({
619
+ query: (args) => (norbix) => norbix.hub.ai.saveLlmIntegration(args),
620
+ invalidatesTags: ["Ai"]
621
+ }),
622
+ testLlmIntegration: b.mutation({
623
+ query: (args) => (norbix) => norbix.hub.ai.testLlmIntegration(args),
624
+ invalidatesTags: ["Ai"]
625
+ }),
626
+ deleteMcpIntegration: b.mutation({
627
+ query: (args) => (norbix) => norbix.hub.ai.deleteMcpIntegration(args),
628
+ invalidatesTags: ["Ai"]
629
+ }),
630
+ disableMcpIntegration: b.mutation({
631
+ query: (args) => (norbix) => norbix.hub.ai.disableMcpIntegration(args),
632
+ invalidatesTags: ["Ai"]
633
+ }),
634
+ enableMcpIntegration: b.mutation({
635
+ query: (args) => (norbix) => norbix.hub.ai.enableMcpIntegration(args),
636
+ invalidatesTags: ["Ai"]
637
+ }),
638
+ getMcpIntegration: b.query({
639
+ query: (args) => (norbix) => norbix.hub.ai.getMcpIntegration(args),
640
+ providesTags: ["Ai"]
641
+ }),
642
+ getMcpIntegrations: b.query({
643
+ query: (args) => (norbix) => norbix.hub.ai.getMcpIntegrations(args),
644
+ providesTags: ["Ai"]
645
+ }),
646
+ saveMcpIntegration: b.mutation({
647
+ query: (args) => (norbix) => norbix.hub.ai.saveMcpIntegration(args),
648
+ invalidatesTags: ["Ai"]
649
+ }),
650
+ testMcpIntegration: b.mutation({
651
+ query: (args) => (norbix) => norbix.hub.ai.testMcpIntegration(args),
652
+ invalidatesTags: ["Ai"]
653
+ })
654
+ });
655
+
656
+ // src/hooks/hub/apikeys.ts
657
+ var hubApikeys = (b) => ({
658
+ getHubApiKeys: b.query({
659
+ query: (args) => (norbix) => norbix.hub.apikeys.getApiKeys(args),
660
+ providesTags: ["ApiKey"]
661
+ }),
662
+ regenerateHubApiKeys: b.mutation({
663
+ query: (args) => (norbix) => norbix.hub.apikeys.regenerateApiKeys(args),
664
+ invalidatesTags: ["ApiKey"]
665
+ })
666
+ });
667
+
668
+ // src/hooks/hub/database.ts
669
+ var hubDatabase = (b) => ({
670
+ disableDatabase: b.mutation({
671
+ query: (args) => (norbix) => norbix.hub.database.disableDatabase(args),
672
+ invalidatesTags: ["Database"]
673
+ }),
674
+ enableDatabase: b.mutation({
675
+ query: (args) => (norbix) => norbix.hub.database.enableDatabase(args),
676
+ invalidatesTags: ["Database"]
677
+ }),
678
+ deleteSchemaTrigger: b.mutation({
679
+ query: (args) => (norbix) => norbix.hub.database.deleteSchemaTrigger(args),
680
+ invalidatesTags: ["Triggers"]
681
+ }),
682
+ disableSchemaTrigger: b.mutation({
683
+ query: (args) => (norbix) => norbix.hub.database.disableSchemaTrigger(args),
684
+ invalidatesTags: ["Triggers"]
685
+ }),
686
+ enableSchemaTrigger: b.mutation({
687
+ query: (args) => (norbix) => norbix.hub.database.enableSchemaTrigger(args),
688
+ invalidatesTags: ["Triggers"]
689
+ }),
690
+ getSchemaTrigger: b.query({
691
+ query: (args) => (norbix) => norbix.hub.database.getSchemaTrigger(args),
692
+ providesTags: ["Triggers"]
693
+ }),
694
+ getSchemaTriggers: b.query({
695
+ query: (args) => (norbix) => norbix.hub.database.getSchemaTriggers(args),
696
+ providesTags: ["Triggers"]
697
+ }),
698
+ saveSchemaTrigger: b.mutation({
699
+ query: (args) => (norbix) => norbix.hub.database.saveSchemaTrigger(args),
700
+ invalidatesTags: ["Triggers"]
701
+ }),
702
+ deleteDatabaseTaxonomy: b.mutation({
703
+ query: (args) => (norbix) => norbix.hub.database.deleteDatabaseTaxonomy(args),
704
+ invalidatesTags: ["DatabaseTaxonomies"]
705
+ }),
706
+ getDatabaseTaxonomy: b.query({
707
+ query: (args) => (norbix) => norbix.hub.database.getDatabaseTaxonomy(args),
708
+ providesTags: ["DatabaseTaxonomies"]
709
+ }),
710
+ getDatabaseTaxonomies: b.query({
711
+ query: (args) => (norbix) => norbix.hub.database.getDatabaseTaxonomies(args),
712
+ providesTags: ["Database"]
713
+ }),
714
+ saveDatabaseTaxonomy: b.mutation({
715
+ query: (args) => (norbix) => norbix.hub.database.saveDatabaseTaxonomy(args),
716
+ invalidatesTags: ["DatabaseTaxonomies"]
717
+ }),
718
+ deleteDatabaseTaxonomyTerm: b.mutation({
719
+ query: (args) => (norbix) => norbix.hub.database.deleteDatabaseTaxonomyTerm(args),
720
+ invalidatesTags: ["DatabaseTaxonomyTerms"]
721
+ }),
722
+ deleteManyDatabaseTaxonomyTerms: b.mutation({
723
+ query: (args) => (norbix) => norbix.hub.database.deleteManyDatabaseTaxonomyTerms(args),
724
+ invalidatesTags: ["DatabaseTaxonomyTerms"]
725
+ }),
726
+ getDatabaseTaxonomyTerm: b.query({
727
+ query: (args) => (norbix) => norbix.hub.database.getDatabaseTaxonomyTerm(args),
728
+ providesTags: ["DatabaseTaxonomyTerms"]
729
+ }),
730
+ saveDatabaseTaxonomyTerm: b.mutation({
731
+ query: (args) => (norbix) => norbix.hub.database.saveDatabaseTaxonomyTerm(args),
732
+ invalidatesTags: ["DatabaseTaxonomyTerms"]
733
+ }),
734
+ updateDatabaseTaxonomyTerm: b.mutation({
735
+ query: (args) => (norbix) => norbix.hub.database.updateDatabaseTaxonomyTerm(args),
736
+ invalidatesTags: ["DatabaseTaxonomyTerms"]
737
+ }),
738
+ deleteDatabaseSchema: b.mutation({
739
+ query: (args) => (norbix) => norbix.hub.database.deleteDatabaseSchema(args),
740
+ invalidatesTags: ["DatabaseSchemas"]
741
+ }),
742
+ discardDatabaseSchemaDraft: b.mutation({
743
+ query: (args) => (norbix) => norbix.hub.database.discardDatabaseSchemaDraft(args),
744
+ invalidatesTags: ["DatabaseSchemas"]
745
+ }),
746
+ getDatabaseSchema: b.query({
747
+ query: (args) => (norbix) => norbix.hub.database.getDatabaseSchema(args),
748
+ providesTags: ["DatabaseSchemas"]
749
+ }),
750
+ getDatabaseSchemas: b.query({
751
+ query: (args) => (norbix) => norbix.hub.database.getDatabaseSchemas(args),
752
+ providesTags: ["DatabaseSchemas"]
753
+ }),
754
+ getDatabaseSchemaDraft: b.query({
755
+ query: (args) => (norbix) => norbix.hub.database.getDatabaseSchemaDraft(args),
756
+ providesTags: ["DatabaseSchemas"]
757
+ }),
758
+ getDatabaseSchemaVersionDiff: b.query({
759
+ query: (args) => (norbix) => norbix.hub.database.getDatabaseSchemaVersionDiff(args),
760
+ providesTags: ["DatabaseSchemas"]
761
+ }),
762
+ getDatabaseSchemaVersions: b.query({
763
+ query: (args) => (norbix) => norbix.hub.database.getDatabaseSchemaVersions(args),
764
+ providesTags: ["DatabaseSchemas"]
765
+ }),
766
+ publishDatabaseSchema: b.mutation({
767
+ query: (args) => (norbix) => norbix.hub.database.publishDatabaseSchema(args),
768
+ invalidatesTags: ["DatabaseSchemas"]
769
+ }),
770
+ renameDatabaseSchema: b.mutation({
771
+ query: (args) => (norbix) => norbix.hub.database.renameDatabaseSchema(args),
772
+ invalidatesTags: ["DatabaseSchemas"]
773
+ }),
774
+ saveDatabaseSchema: b.mutation({
775
+ query: (args) => (norbix) => norbix.hub.database.saveDatabaseSchema(args),
776
+ invalidatesTags: ["DatabaseSchemas"]
777
+ }),
778
+ updateDatabaseSchemaDraft: b.mutation({
779
+ query: (args) => (norbix) => norbix.hub.database.updateDatabaseSchemaDraft(args),
780
+ invalidatesTags: ["DatabaseSchemas"]
781
+ }),
782
+ updateDatabaseSchemaSettings: b.mutation({
783
+ query: (args) => (norbix) => norbix.hub.database.updateDatabaseSchemaSettings(args),
784
+ invalidatesTags: ["DatabaseSchemas"]
785
+ }),
786
+ deleteDatabaseIntegration: b.mutation({
787
+ query: (args) => (norbix) => norbix.hub.database.deleteDatabaseIntegration(args),
788
+ invalidatesTags: ["DatabaseIntegrations"]
789
+ }),
790
+ disableDatabaseIntegration: b.mutation({
791
+ query: (args) => (norbix) => norbix.hub.database.disableDatabaseIntegration(args),
792
+ invalidatesTags: ["DatabaseIntegrations"]
793
+ }),
794
+ enableDatabaseIntegration: b.mutation({
795
+ query: (args) => (norbix) => norbix.hub.database.enableDatabaseIntegration(args),
796
+ invalidatesTags: ["DatabaseIntegrations"]
797
+ }),
798
+ getDatabaseIntegration: b.query({
799
+ query: (args) => (norbix) => norbix.hub.database.getDatabaseIntegration(args),
800
+ providesTags: ["DatabaseIntegrations"]
801
+ }),
802
+ getDatabaseIntegrations: b.query({
803
+ query: (args) => (norbix) => norbix.hub.database.getDatabaseIntegrations(args),
804
+ providesTags: ["DatabaseIntegrations"]
805
+ }),
806
+ getAllowedFlexTiers: b.query({
807
+ query: (args) => (norbix) => norbix.hub.database.getAllowedFlexTiers(args),
808
+ providesTags: ["DatabaseIntegrations"]
809
+ }),
810
+ revealManagedFlexConnectionString: b.mutation({
811
+ query: (args) => (norbix) => norbix.hub.database.revealManagedFlexConnectionString(args),
812
+ invalidatesTags: ["DatabaseIntegrations"]
813
+ }),
814
+ saveDatabaseIntegration: b.mutation({
815
+ query: (args) => (norbix) => norbix.hub.database.saveDatabaseIntegration(args),
816
+ invalidatesTags: ["DatabaseIntegrations"]
817
+ }),
818
+ setDatabaseIntegrationAsDefault: b.mutation({
819
+ query: (args) => (norbix) => norbix.hub.database.setDatabaseIntegrationAsDefault(args),
820
+ invalidatesTags: ["DatabaseIntegrations"]
821
+ }),
822
+ testDatabaseIntegration: b.mutation({
823
+ query: (args) => (norbix) => norbix.hub.database.testDatabaseIntegration(args),
824
+ invalidatesTags: ["DatabaseIntegrations"]
825
+ }),
826
+ deleteDatabaseAggregate: b.mutation({
827
+ query: (args) => (norbix) => norbix.hub.database.deleteDatabaseAggregate(args),
828
+ invalidatesTags: ["DatabaseAggregates"]
829
+ }),
830
+ getDatabaseAggregate: b.query({
831
+ query: (args) => (norbix) => norbix.hub.database.getDatabaseAggregate(args),
832
+ providesTags: ["DatabaseAggregates"]
833
+ }),
834
+ getDatabaseAggregates: b.query({
835
+ query: (args) => (norbix) => norbix.hub.database.getDatabaseAggregates(args),
836
+ providesTags: ["DatabaseAggregates"]
837
+ }),
838
+ saveDatabaseAggregate: b.mutation({
839
+ query: (args) => (norbix) => norbix.hub.database.saveDatabaseAggregate(args),
840
+ invalidatesTags: ["DatabaseAggregates"]
841
+ }),
842
+ testDatabaseAggregate: b.mutation({
843
+ query: (args) => (norbix) => norbix.hub.database.testDatabaseAggregate(args),
844
+ invalidatesTags: ["DatabaseAggregates"]
845
+ })
846
+ });
847
+
848
+ // src/hooks/hub/email.ts
849
+ var hubEmail = (b) => ({
850
+ oneClickUnsubscribe: b.mutation({
851
+ query: (args) => (norbix) => norbix.hub.email.oneClickUnsubscribe(args)
852
+ })
853
+ });
854
+
855
+ // src/hooks/hub/environments.ts
856
+ var hubEnvironments = (b) => ({
857
+ listEnvironments: b.query({
858
+ query: (args) => (norbix) => norbix.hub.environments.list(args),
859
+ providesTags: ["Environments"]
860
+ }),
861
+ createEnvironment: b.mutation({
862
+ query: (args) => (norbix) => norbix.hub.environments.create(args),
863
+ // Creating an env changes the available set and seeds a DB integration.
864
+ invalidatesTags: ["Environments", "Projects", "DatabaseIntegrations"]
865
+ }),
866
+ deleteEnvironment: b.mutation({
867
+ query: (args) => (norbix) => norbix.hub.environments.delete(args),
868
+ // Deleting cascades integrations across modules in that env.
869
+ invalidatesTags: ["Environments", "Projects", "DatabaseIntegrations"]
870
+ })
871
+ });
872
+
873
+ // src/hooks/hub/files.ts
874
+ var hubFiles = (b) => ({
875
+ disableFiles: b.mutation({
876
+ query: (args) => (norbix) => norbix.hub.files.disableFiles(args),
877
+ invalidatesTags: ["Files"]
878
+ }),
879
+ enableFiles: b.mutation({
880
+ query: (args) => (norbix) => norbix.hub.files.enableFiles(args),
881
+ invalidatesTags: ["Files"]
882
+ }),
883
+ deleteFilesTrigger: b.mutation({
884
+ query: (args) => (norbix) => norbix.hub.files.deleteFilesTrigger(args),
885
+ invalidatesTags: ["Triggers"]
886
+ }),
887
+ disableFilesTrigger: b.mutation({
888
+ query: (args) => (norbix) => norbix.hub.files.disableFilesTrigger(args),
889
+ invalidatesTags: ["Triggers"]
890
+ }),
891
+ enableFilesTrigger: b.mutation({
892
+ query: (args) => (norbix) => norbix.hub.files.enableFilesTrigger(args),
893
+ invalidatesTags: ["Triggers"]
894
+ }),
895
+ getFilesTrigger: b.query({
896
+ query: (args) => (norbix) => norbix.hub.files.getFilesTrigger(args),
897
+ providesTags: ["Triggers"]
898
+ }),
899
+ getFilesTriggers: b.query({
900
+ query: (args) => (norbix) => norbix.hub.files.getFilesTriggers(args),
901
+ providesTags: ["Triggers"]
902
+ }),
903
+ saveFilesTrigger: b.mutation({
904
+ query: (args) => (norbix) => norbix.hub.files.saveFilesTrigger(args),
905
+ invalidatesTags: ["Triggers"]
906
+ }),
907
+ deleteFilesIntegration: b.mutation({
908
+ query: (args) => (norbix) => norbix.hub.files.deleteFilesIntegration(args),
909
+ invalidatesTags: ["FilesIntegrations"]
910
+ }),
911
+ disableFilesIntegration: b.mutation({
912
+ query: (args) => (norbix) => norbix.hub.files.disableFilesIntegration(args),
913
+ invalidatesTags: ["FilesIntegrations"]
914
+ }),
915
+ enableFilesIntegration: b.mutation({
916
+ query: (args) => (norbix) => norbix.hub.files.enableFilesIntegration(args),
917
+ invalidatesTags: ["FilesIntegrations"]
918
+ }),
919
+ getFilesIntegration: b.query({
920
+ query: (args) => (norbix) => norbix.hub.files.getFilesIntegration(args),
921
+ providesTags: ["FilesIntegrations"]
922
+ }),
923
+ getFilesIntegrations: b.query({
924
+ query: (args) => (norbix) => norbix.hub.files.getFilesIntegrations(args),
925
+ providesTags: ["FilesIntegrations"]
926
+ }),
927
+ saveFilesIntegration: b.mutation({
928
+ query: (args) => (norbix) => norbix.hub.files.saveFilesIntegration(args),
929
+ invalidatesTags: ["FilesIntegrations"]
930
+ }),
931
+ setFilesIntegrationAsDefault: b.mutation({
932
+ query: (args) => (norbix) => norbix.hub.files.setFilesIntegrationAsDefault(args),
933
+ invalidatesTags: ["FilesIntegrations"]
934
+ }),
935
+ getFile: b.query({
936
+ query: (args) => (norbix) => norbix.hub.files.getFile(args),
937
+ providesTags: ["Files"]
938
+ }),
939
+ getFolderFiles: b.query({
940
+ query: (args) => (norbix) => norbix.hub.files.getFolderFiles(args),
941
+ providesTags: ["Files"]
942
+ }),
943
+ /**
944
+ * Tries an integration's credentials against the storage provider and
945
+ * answers whether they work. Nothing is saved, so nothing is invalidated —
946
+ * call it before `saveFilesIntegration` to tell a bad key from a bad
947
+ * bucket. A mutation rather than a query because it is an action with a
948
+ * side effect on the provider, and its answer must never be served from
949
+ * cache.
950
+ */
951
+ testFilesIntegration: b.mutation({
952
+ query: (args) => (norbix) => norbix.hub.files.testFilesIntegration(args)
953
+ }),
954
+ /**
955
+ * Makes one file readable by anyone holding its link. Answers with the
956
+ * `nbpf_…` public id; the link itself arrives on the file's `publicUrl`
957
+ * the next time the listing is read — which is why this invalidates
958
+ * `Files`.
959
+ */
960
+ makeFilePublic: b.mutation({
961
+ query: (args) => (norbix) => norbix.hub.files.makeFilePublic(args),
962
+ invalidatesTags: ["Files"]
963
+ }),
964
+ /**
965
+ * Takes a file's public link away. Refused while a folder above the file
966
+ * is public — switch the folder off instead.
967
+ */
968
+ makeFilePrivate: b.mutation({
969
+ query: (args) => (norbix) => norbix.hub.files.makeFilePrivate(args),
970
+ invalidatesTags: ["Files"]
971
+ }),
972
+ /**
973
+ * Publishes a whole folder prefix — one record, however many files sit
974
+ * under it, at any depth. Every file underneath changes its `isPublic`,
975
+ * so the whole `Files` tag goes.
976
+ */
977
+ makeFolderPublic: b.mutation({
978
+ query: (args) => (norbix) => norbix.hub.files.makeFolderPublic(args),
979
+ invalidatesTags: ["Files"]
980
+ }),
981
+ /** Takes back every link inside the folder, including per-file ones. */
982
+ makeFolderPrivate: b.mutation({
983
+ query: (args) => (norbix) => norbix.hub.files.makeFolderPrivate(args),
984
+ invalidatesTags: ["Files"]
985
+ })
986
+ });
987
+
988
+ // src/hooks/hub/logs.ts
989
+ var hubLogs = (b) => ({
990
+ disableLogging: b.mutation({
991
+ query: (args) => (norbix) => norbix.hub.logs.disableLogging(args),
992
+ invalidatesTags: ["Logs"]
993
+ }),
994
+ enableLogging: b.mutation({
995
+ query: (args) => (norbix) => norbix.hub.logs.enableLogging(args),
996
+ invalidatesTags: ["Logs"]
997
+ }),
998
+ deleteLoggingIntegration: b.mutation({
999
+ query: (args) => (norbix) => norbix.hub.logs.deleteLoggingIntegration(args),
1000
+ invalidatesTags: ["LogsIntegrations"]
1001
+ }),
1002
+ disableLoggingIntegration: b.mutation({
1003
+ query: (args) => (norbix) => norbix.hub.logs.disableLoggingIntegration(args),
1004
+ invalidatesTags: ["LogsIntegrations"]
1005
+ }),
1006
+ enableLoggingIntegration: b.mutation({
1007
+ query: (args) => (norbix) => norbix.hub.logs.enableLoggingIntegration(args),
1008
+ invalidatesTags: ["LogsIntegrations"]
1009
+ }),
1010
+ getLoggingIntegration: b.query({
1011
+ query: (args) => (norbix) => norbix.hub.logs.getLoggingIntegration(args),
1012
+ providesTags: ["LogsIntegrations"]
1013
+ }),
1014
+ getLoggingIntegrations: b.query({
1015
+ query: (args) => (norbix) => norbix.hub.logs.getLoggingIntegrations(args),
1016
+ providesTags: ["LogsIntegrations"]
1017
+ }),
1018
+ saveLoggingIntegration: b.mutation({
1019
+ query: (args) => (norbix) => norbix.hub.logs.saveLoggingIntegration(args),
1020
+ invalidatesTags: ["LogsIntegrations"]
1021
+ }),
1022
+ testLoggingIntegration: b.mutation({
1023
+ query: (args) => (norbix) => norbix.hub.logs.testLoggingIntegration(args),
1024
+ invalidatesTags: ["LogsIntegrations"]
1025
+ }),
1026
+ getLogsByCorrelationId: b.query({
1027
+ query: (args) => (norbix) => norbix.hub.logs.getLogsByCorrelationId(args),
1028
+ providesTags: ["Logs"]
1029
+ })
1030
+ });
1031
+
1032
+ // src/hooks/hub/membership.ts
1033
+ var hubMembership = (b) => ({
1034
+ disableMembership: b.mutation({
1035
+ query: (args) => (norbix) => norbix.hub.membership.disableMembership(args),
1036
+ invalidatesTags: ["Membership"]
1037
+ }),
1038
+ enableMembership: b.mutation({
1039
+ query: (args) => (norbix) => norbix.hub.membership.enableMembership(args),
1040
+ invalidatesTags: ["Membership"]
1041
+ }),
1042
+ deleteMembershipTrigger: b.mutation({
1043
+ query: (args) => (norbix) => norbix.hub.membership.deleteMembershipTrigger(args),
1044
+ invalidatesTags: ["Triggers"]
1045
+ }),
1046
+ disableMembershipTrigger: b.mutation({
1047
+ query: (args) => (norbix) => norbix.hub.membership.disableMembershipTrigger(args),
1048
+ invalidatesTags: ["Triggers"]
1049
+ }),
1050
+ enableMembershipTrigger: b.mutation({
1051
+ query: (args) => (norbix) => norbix.hub.membership.enableMembershipTrigger(args),
1052
+ invalidatesTags: ["Triggers"]
1053
+ }),
1054
+ getMembershipTrigger: b.query({
1055
+ query: (args) => (norbix) => norbix.hub.membership.getMembershipTrigger(args),
1056
+ providesTags: ["Triggers"]
1057
+ }),
1058
+ getMembershipTriggers: b.query({
1059
+ query: (args) => (norbix) => norbix.hub.membership.getMembershipTriggers(args),
1060
+ providesTags: ["Triggers"]
1061
+ }),
1062
+ saveMembershipTrigger: b.mutation({
1063
+ query: (args) => (norbix) => norbix.hub.membership.saveMembershipTrigger(args),
1064
+ invalidatesTags: ["Triggers"]
1065
+ }),
1066
+ createRole: b.mutation({
1067
+ query: (args) => (norbix) => norbix.hub.membership.createRole(args),
1068
+ invalidatesTags: ["MembershipRoles"]
1069
+ }),
1070
+ deleteRole: b.mutation({
1071
+ query: (args) => (norbix) => norbix.hub.membership.deleteRole(args),
1072
+ invalidatesTags: ["MembershipRoles"]
1073
+ }),
1074
+ getRole: b.query({
1075
+ query: (args) => (norbix) => norbix.hub.membership.getRole(args),
1076
+ providesTags: ["MembershipRoles"]
1077
+ }),
1078
+ getRoles: b.query({
1079
+ query: (args) => (norbix) => norbix.hub.membership.getRoles(args),
1080
+ providesTags: ["MembershipRoles"]
1081
+ }),
1082
+ updateRolePolicies: b.mutation({
1083
+ query: (args) => (norbix) => norbix.hub.membership.updateRolePolicies(args),
1084
+ invalidatesTags: ["MembershipRoles"]
1085
+ }),
1086
+ createPolicy: b.mutation({
1087
+ query: (args) => (norbix) => norbix.hub.membership.createPolicy(args),
1088
+ invalidatesTags: ["MembershipPolicies"]
1089
+ }),
1090
+ deletePolicy: b.mutation({
1091
+ query: (args) => (norbix) => norbix.hub.membership.deletePolicy(args),
1092
+ invalidatesTags: ["MembershipPolicies"]
1093
+ }),
1094
+ getPolicy: b.query({
1095
+ query: (args) => (norbix) => norbix.hub.membership.getPolicy(args),
1096
+ providesTags: ["MembershipPolicies"]
1097
+ }),
1098
+ getPolicies: b.query({
1099
+ query: (args) => (norbix) => norbix.hub.membership.getPolicies(args),
1100
+ providesTags: ["MembershipPolicies"]
1101
+ }),
1102
+ updatePolicy: b.mutation({
1103
+ query: (args) => (norbix) => norbix.hub.membership.updatePolicy(args),
1104
+ invalidatesTags: ["MembershipPolicies"]
1105
+ }),
1106
+ getPasskeySettings: b.query({
1107
+ query: (args) => (norbix) => norbix.hub.membership.getPasskeySettings(args),
1108
+ providesTags: ["MembershipUsers"]
1109
+ }),
1110
+ savePasskeySettings: b.mutation({
1111
+ query: (args) => (norbix) => norbix.hub.membership.savePasskeySettings(args),
1112
+ invalidatesTags: ["MembershipUsers"]
1113
+ }),
1114
+ deleteMembershipIntegration: b.mutation({
1115
+ query: (args) => (norbix) => norbix.hub.membership.deleteMembershipIntegration(args),
1116
+ invalidatesTags: ["MembershipIntegrations"]
1117
+ }),
1118
+ disableMembershipIntegration: b.mutation({
1119
+ query: (args) => (norbix) => norbix.hub.membership.disableMembershipIntegration(args),
1120
+ invalidatesTags: ["MembershipIntegrations"]
1121
+ }),
1122
+ enableMembershipIntegration: b.mutation({
1123
+ query: (args) => (norbix) => norbix.hub.membership.enableMembershipIntegration(args),
1124
+ invalidatesTags: ["MembershipIntegrations"]
1125
+ }),
1126
+ getMembershipIntegration: b.query({
1127
+ query: (args) => (norbix) => norbix.hub.membership.getMembershipIntegration(args),
1128
+ providesTags: ["MembershipIntegrations"]
1129
+ }),
1130
+ getMembershipIntegrations: b.query({
1131
+ query: (args) => (norbix) => norbix.hub.membership.getMembershipIntegrations(args),
1132
+ providesTags: ["MembershipIntegrations"]
1133
+ }),
1134
+ saveMembershipIntegration: b.mutation({
1135
+ query: (args) => (norbix) => norbix.hub.membership.saveMembershipIntegration(args),
1136
+ invalidatesTags: ["MembershipIntegrations"]
1137
+ }),
1138
+ setMembershipIntegrationAsDefault: b.mutation({
1139
+ query: (args) => (norbix) => norbix.hub.membership.setMembershipIntegrationAsDefault(args),
1140
+ invalidatesTags: ["MembershipIntegrations"]
1141
+ })
1142
+ });
1143
+
1144
+ // src/hooks/hub/notifications.ts
1145
+ var hubNotifications = (b) => ({
1146
+ getUserNotificationPreferences: b.query({
1147
+ query: (args) => (norbix) => norbix.hub.notifications.getUserNotificationPreferences(args),
1148
+ providesTags: ["Account"]
1149
+ }),
1150
+ updateUserNotificationsPreferences: b.mutation({
1151
+ query: (args) => (norbix) => norbix.hub.notifications.updateUserNotificationsPreferences(args),
1152
+ invalidatesTags: ["Emails"]
1153
+ }),
1154
+ disableEmail: b.mutation({
1155
+ query: (args) => (norbix) => norbix.hub.notifications.disableEmail(args),
1156
+ invalidatesTags: ["Emails"]
1157
+ }),
1158
+ enableEmail: b.mutation({
1159
+ query: (args) => (norbix) => norbix.hub.notifications.enableEmail(args),
1160
+ invalidatesTags: ["Emails"]
1161
+ }),
1162
+ saveEmailValidationIntegration: b.mutation({
1163
+ query: (args) => (norbix) => norbix.hub.notifications.saveEmailValidationIntegration(args),
1164
+ invalidatesTags: ["EmailIntegrations"]
1165
+ }),
1166
+ testEmailValidationIntegration: b.mutation({
1167
+ query: (args) => (norbix) => norbix.hub.notifications.testEmailValidationIntegration(args),
1168
+ invalidatesTags: ["EmailIntegrations"]
1169
+ }),
1170
+ attachFileToTemplate: b.mutation({
1171
+ query: (args) => (norbix) => norbix.hub.notifications.attachFileToTemplate(args),
1172
+ invalidatesTags: ["Emails"]
1173
+ }),
1174
+ createEmailTemplate: b.mutation({
1175
+ query: (args) => (norbix) => norbix.hub.notifications.createEmailTemplate(args),
1176
+ invalidatesTags: ["EmailTemplates"]
1177
+ }),
1178
+ deleteEmailTemplate: b.mutation({
1179
+ query: (args) => (norbix) => norbix.hub.notifications.deleteEmailTemplate(args),
1180
+ invalidatesTags: ["EmailTemplates"]
1181
+ }),
1182
+ getEmailTemplate: b.query({
1183
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailTemplate(args),
1184
+ providesTags: ["EmailTemplates"]
1185
+ }),
1186
+ getEmailTemplates: b.query({
1187
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailTemplates(args),
1188
+ providesTags: ["EmailTemplates"]
1189
+ }),
1190
+ getMjml: b.query({
1191
+ query: (args) => (norbix) => norbix.hub.notifications.getMjml(args),
1192
+ providesTags: ["Emails"]
1193
+ }),
1194
+ getSystemEmailTemplate: b.query({
1195
+ query: (args) => (norbix) => norbix.hub.notifications.getSystemEmailTemplate(args),
1196
+ providesTags: ["EmailTemplates"]
1197
+ }),
1198
+ getSystemEmailTemplates: b.query({
1199
+ query: (args) => (norbix) => norbix.hub.notifications.getSystemEmailTemplates(args),
1200
+ providesTags: ["EmailTemplates"]
1201
+ }),
1202
+ getEmailTemplateAvailableTokens: b.query({
1203
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailTemplateAvailableTokens(args),
1204
+ providesTags: ["EmailTemplates"]
1205
+ }),
1206
+ updateEmailTemplate: b.mutation({
1207
+ query: (args) => (norbix) => norbix.hub.notifications.updateEmailTemplate(args),
1208
+ invalidatesTags: ["EmailTemplates"]
1209
+ }),
1210
+ deleteEmailSignature: b.mutation({
1211
+ query: (args) => (norbix) => norbix.hub.notifications.deleteEmailSignature(args),
1212
+ invalidatesTags: ["EmailSignatures"]
1213
+ }),
1214
+ getEmailSignature: b.query({
1215
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailSignature(args),
1216
+ providesTags: ["EmailSignatures"]
1217
+ }),
1218
+ getEmailSignatures: b.query({
1219
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailSignatures(args),
1220
+ providesTags: ["EmailSignatures"]
1221
+ }),
1222
+ saveEmailSignature: b.mutation({
1223
+ query: (args) => (norbix) => norbix.hub.notifications.saveEmailSignature(args),
1224
+ invalidatesTags: ["EmailSignatures"]
1225
+ }),
1226
+ getEmailSettings: b.query({
1227
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailSettings(args),
1228
+ providesTags: ["EmailSettings"]
1229
+ }),
1230
+ confirmEmailIntegrationHumanDelivery: b.mutation({
1231
+ query: (args) => (norbix) => norbix.hub.notifications.confirmEmailIntegrationHumanDelivery(args),
1232
+ invalidatesTags: ["EmailIntegrations"]
1233
+ }),
1234
+ deleteEmailIntegration: b.mutation({
1235
+ query: (args) => (norbix) => norbix.hub.notifications.deleteEmailIntegration(args),
1236
+ invalidatesTags: ["EmailIntegrations"]
1237
+ }),
1238
+ disableEmailIntegration: b.mutation({
1239
+ query: (args) => (norbix) => norbix.hub.notifications.disableEmailIntegration(args),
1240
+ invalidatesTags: ["EmailIntegrations"]
1241
+ }),
1242
+ enableEmailIntegration: b.mutation({
1243
+ query: (args) => (norbix) => norbix.hub.notifications.enableEmailIntegration(args),
1244
+ invalidatesTags: ["EmailIntegrations"]
1245
+ }),
1246
+ getEmailIntegration: b.query({
1247
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailIntegration(args),
1248
+ providesTags: ["EmailIntegrations"]
1249
+ }),
1250
+ getEmailIntegrations: b.query({
1251
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailIntegrations(args),
1252
+ providesTags: ["EmailIntegrations"]
1253
+ }),
1254
+ saveEmailIntegration: b.mutation({
1255
+ query: (args) => (norbix) => norbix.hub.notifications.saveEmailIntegration(args),
1256
+ invalidatesTags: ["EmailIntegrations"]
1257
+ }),
1258
+ setEmailsIntegrationAsDefault: b.mutation({
1259
+ query: (args) => (norbix) => norbix.hub.notifications.setEmailsIntegrationAsDefault(args),
1260
+ invalidatesTags: ["Emails"]
1261
+ }),
1262
+ testEmailIntegration: b.mutation({
1263
+ query: (args) => (norbix) => norbix.hub.notifications.testEmailIntegration(args),
1264
+ invalidatesTags: ["EmailIntegrations"]
1265
+ }),
1266
+ archiveEmailTemplate: b.mutation({
1267
+ query: (args) => (norbix) => norbix.hub.notifications.archiveEmailTemplate(args),
1268
+ invalidatesTags: ["EmailTemplates"]
1269
+ }),
1270
+ cloneEmailTemplate: b.mutation({
1271
+ query: (args) => (norbix) => norbix.hub.notifications.cloneEmailTemplate(args),
1272
+ invalidatesTags: ["EmailTemplates"]
1273
+ }),
1274
+ unArchiveEmailTemplate: b.mutation({
1275
+ query: (args) => (norbix) => norbix.hub.notifications.unArchiveEmailTemplate(args),
1276
+ invalidatesTags: ["EmailTemplates"]
1277
+ }),
1278
+ deleteEmailFooter: b.mutation({
1279
+ query: (args) => (norbix) => norbix.hub.notifications.deleteEmailFooter(args),
1280
+ invalidatesTags: ["EmailFooters"]
1281
+ }),
1282
+ getEmailFooter: b.query({
1283
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailFooter(args),
1284
+ providesTags: ["EmailFooters"]
1285
+ }),
1286
+ getEmailFooters: b.query({
1287
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailFooters(args),
1288
+ providesTags: ["EmailFooters"]
1289
+ }),
1290
+ saveEmailFooter: b.mutation({
1291
+ query: (args) => (norbix) => norbix.hub.notifications.saveEmailFooter(args),
1292
+ invalidatesTags: ["EmailFooters"]
1293
+ }),
1294
+ createEmailCampaign: b.mutation({
1295
+ query: (args) => (norbix) => norbix.hub.notifications.createEmailCampaign(args),
1296
+ invalidatesTags: ["EmailCampaigns"]
1297
+ }),
1298
+ deleteEmailCampaign: b.mutation({
1299
+ query: (args) => (norbix) => norbix.hub.notifications.deleteEmailCampaign(args),
1300
+ invalidatesTags: ["EmailCampaigns"]
1301
+ }),
1302
+ getEmailCampaign: b.query({
1303
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailCampaign(args),
1304
+ providesTags: ["EmailCampaigns"]
1305
+ }),
1306
+ getEmailCampaigns: b.query({
1307
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailCampaigns(args),
1308
+ providesTags: ["EmailCampaigns"]
1309
+ }),
1310
+ getEmailCampaignBatches: b.query({
1311
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailCampaignBatches(args),
1312
+ providesTags: ["EmailCampaigns"]
1313
+ }),
1314
+ getEmailCampaignBatchNotification: b.query({
1315
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailCampaignBatchNotification(args),
1316
+ providesTags: ["EmailCampaigns"]
1317
+ }),
1318
+ getEmailCampaignBatchNotifications: b.query({
1319
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailCampaignBatchNotifications(args),
1320
+ providesTags: ["EmailCampaigns"]
1321
+ }),
1322
+ getEmailCampaignStatistics: b.query({
1323
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailCampaignStatistics(args),
1324
+ providesTags: ["EmailCampaigns"]
1325
+ }),
1326
+ previewEmailNotification: b.query({
1327
+ query: (args) => (norbix) => norbix.hub.notifications.previewEmailNotification(args),
1328
+ providesTags: ["Emails"]
1329
+ }),
1330
+ getEmailCampaignMessage: b.query({
1331
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailCampaignMessage(args),
1332
+ providesTags: ["EmailCampaigns"]
1333
+ }),
1334
+ getEmailCampaignMessages: b.query({
1335
+ query: (args) => (norbix) => norbix.hub.notifications.getEmailCampaignMessages(args),
1336
+ providesTags: ["EmailCampaigns"]
1337
+ }),
1338
+ disableSms: b.mutation({
1339
+ query: (args) => (norbix) => norbix.hub.notifications.disableSms(args),
1340
+ invalidatesTags: ["Sms"]
1341
+ }),
1342
+ enableSms: b.mutation({
1343
+ query: (args) => (norbix) => norbix.hub.notifications.enableSms(args),
1344
+ invalidatesTags: ["Sms"]
1345
+ }),
1346
+ archiveSmsTemplate: b.mutation({
1347
+ query: (args) => (norbix) => norbix.hub.notifications.archiveSmsTemplate(args),
1348
+ invalidatesTags: ["SmsTemplates"]
1349
+ }),
1350
+ cloneSmsTemplate: b.mutation({
1351
+ query: (args) => (norbix) => norbix.hub.notifications.cloneSmsTemplate(args),
1352
+ invalidatesTags: ["SmsTemplates"]
1353
+ }),
1354
+ createSmsTemplate: b.mutation({
1355
+ query: (args) => (norbix) => norbix.hub.notifications.createSmsTemplate(args),
1356
+ invalidatesTags: ["SmsTemplates"]
1357
+ }),
1358
+ deleteSmsTemplate: b.mutation({
1359
+ query: (args) => (norbix) => norbix.hub.notifications.deleteSmsTemplate(args),
1360
+ invalidatesTags: ["SmsTemplates"]
1361
+ }),
1362
+ getSmsTemplate: b.query({
1363
+ query: (args) => (norbix) => norbix.hub.notifications.getSmsTemplate(args),
1364
+ providesTags: ["SmsTemplates"]
1365
+ }),
1366
+ getSmsTemplates: b.query({
1367
+ query: (args) => (norbix) => norbix.hub.notifications.getSmsTemplates(args),
1368
+ providesTags: ["SmsTemplates"]
1369
+ }),
1370
+ getSmsMessageContentTokens: b.query({
1371
+ query: (args) => (norbix) => norbix.hub.notifications.getSmsMessageContentTokens(args),
1372
+ providesTags: ["Sms"]
1373
+ }),
1374
+ unArchiveSmsTemplate: b.mutation({
1375
+ query: (args) => (norbix) => norbix.hub.notifications.unArchiveSmsTemplate(args),
1376
+ invalidatesTags: ["SmsTemplates"]
1377
+ }),
1378
+ updateSmsTemplate: b.mutation({
1379
+ query: (args) => (norbix) => norbix.hub.notifications.updateSmsTemplate(args),
1380
+ invalidatesTags: ["SmsTemplates"]
1381
+ }),
1382
+ getSmsSettings: b.query({
1383
+ query: (args) => (norbix) => norbix.hub.notifications.getSmsSettings(args),
1384
+ providesTags: ["SmsSettings"]
1385
+ }),
1386
+ confirmSmsIntegrationHumanDelivery: b.mutation({
1387
+ query: (args) => (norbix) => norbix.hub.notifications.confirmSmsIntegrationHumanDelivery(args),
1388
+ invalidatesTags: ["SmsIntegrations"]
1389
+ }),
1390
+ deleteSmsIntegration: b.mutation({
1391
+ query: (args) => (norbix) => norbix.hub.notifications.deleteSmsIntegration(args),
1392
+ invalidatesTags: ["SmsIntegrations"]
1393
+ }),
1394
+ disableSmsIntegration: b.mutation({
1395
+ query: (args) => (norbix) => norbix.hub.notifications.disableSmsIntegration(args),
1396
+ invalidatesTags: ["SmsIntegrations"]
1397
+ }),
1398
+ enableSmsIntegration: b.mutation({
1399
+ query: (args) => (norbix) => norbix.hub.notifications.enableSmsIntegration(args),
1400
+ invalidatesTags: ["SmsIntegrations"]
1401
+ }),
1402
+ getSmsIntegration: b.query({
1403
+ query: (args) => (norbix) => norbix.hub.notifications.getSmsIntegration(args),
1404
+ providesTags: ["SmsIntegrations"]
1405
+ }),
1406
+ getSmsIntegrations: b.query({
1407
+ query: (args) => (norbix) => norbix.hub.notifications.getSmsIntegrations(args),
1408
+ providesTags: ["SmsIntegrations"]
1409
+ }),
1410
+ saveSmsIntegration: b.mutation({
1411
+ query: (args) => (norbix) => norbix.hub.notifications.saveSmsIntegration(args),
1412
+ invalidatesTags: ["SmsIntegrations"]
1413
+ }),
1414
+ setSmsIntegrationAsDefault: b.mutation({
1415
+ query: (args) => (norbix) => norbix.hub.notifications.setSmsIntegrationAsDefault(args),
1416
+ invalidatesTags: ["SmsIntegrations"]
1417
+ }),
1418
+ testSmsIntegration: b.mutation({
1419
+ query: (args) => (norbix) => norbix.hub.notifications.testSmsIntegration(args),
1420
+ invalidatesTags: ["SmsIntegrations"]
1421
+ }),
1422
+ createSmsCampaign: b.mutation({
1423
+ query: (args) => (norbix) => norbix.hub.notifications.createSmsCampaign(args),
1424
+ invalidatesTags: ["SmsCampaigns"]
1425
+ }),
1426
+ deleteSmsCampaign: b.mutation({
1427
+ query: (args) => (norbix) => norbix.hub.notifications.deleteSmsCampaign(args),
1428
+ invalidatesTags: ["SmsCampaigns"]
1429
+ }),
1430
+ getSmsCampaign: b.query({
1431
+ query: (args) => (norbix) => norbix.hub.notifications.getSmsCampaign(args),
1432
+ providesTags: ["SmsCampaigns"]
1433
+ }),
1434
+ getSmsCampaigns: b.query({
1435
+ query: (args) => (norbix) => norbix.hub.notifications.getSmsCampaigns(args),
1436
+ providesTags: ["SmsCampaigns"]
1437
+ }),
1438
+ getSmsCampaignBatches: b.query({
1439
+ query: (args) => (norbix) => norbix.hub.notifications.getSmsCampaignBatches(args),
1440
+ providesTags: ["SmsCampaigns"]
1441
+ }),
1442
+ getSmsCampaignBatchNotification: b.query({
1443
+ query: (args) => (norbix) => norbix.hub.notifications.getSmsCampaignBatchNotification(args),
1444
+ providesTags: ["SmsCampaigns"]
1445
+ }),
1446
+ getSmsCampaignBatchNotifications: b.query({
1447
+ query: (args) => (norbix) => norbix.hub.notifications.getSmsCampaignBatchNotifications(args),
1448
+ providesTags: ["SmsCampaigns"]
1449
+ }),
1450
+ getSmsCampaignStatistics: b.query({
1451
+ query: (args) => (norbix) => norbix.hub.notifications.getSmsCampaignStatistics(args),
1452
+ providesTags: ["SmsCampaigns"]
1453
+ }),
1454
+ previewSmsNotification: b.query({
1455
+ query: (args) => (norbix) => norbix.hub.notifications.previewSmsNotification(args),
1456
+ providesTags: ["Sms"]
1457
+ }),
1458
+ getSmsCampaignMessage: b.query({
1459
+ query: (args) => (norbix) => norbix.hub.notifications.getSmsCampaignMessage(args),
1460
+ providesTags: ["SmsCampaigns"]
1461
+ }),
1462
+ getSmsCampaignMessages: b.query({
1463
+ query: (args) => (norbix) => norbix.hub.notifications.getSmsCampaignMessages(args),
1464
+ providesTags: ["SmsCampaigns"]
1465
+ }),
1466
+ disablePush: b.mutation({
1467
+ query: (args) => (norbix) => norbix.hub.notifications.disablePush(args),
1468
+ invalidatesTags: ["Push"]
1469
+ }),
1470
+ enablePush: b.mutation({
1471
+ query: (args) => (norbix) => norbix.hub.notifications.enablePush(args),
1472
+ invalidatesTags: ["Push"]
1473
+ }),
1474
+ archivePushTemplate: b.mutation({
1475
+ query: (args) => (norbix) => norbix.hub.notifications.archivePushTemplate(args),
1476
+ invalidatesTags: ["PushTemplates"]
1477
+ }),
1478
+ clonePushTemplate: b.mutation({
1479
+ query: (args) => (norbix) => norbix.hub.notifications.clonePushTemplate(args),
1480
+ invalidatesTags: ["PushTemplates"]
1481
+ }),
1482
+ createPushTemplate: b.mutation({
1483
+ query: (args) => (norbix) => norbix.hub.notifications.createPushTemplate(args),
1484
+ invalidatesTags: ["PushTemplates"]
1485
+ }),
1486
+ deletePushTemplate: b.mutation({
1487
+ query: (args) => (norbix) => norbix.hub.notifications.deletePushTemplate(args),
1488
+ invalidatesTags: ["PushTemplates"]
1489
+ }),
1490
+ getPushTemplate: b.query({
1491
+ query: (args) => (norbix) => norbix.hub.notifications.getPushTemplate(args),
1492
+ providesTags: ["PushTemplates"]
1493
+ }),
1494
+ getPushTemplates: b.query({
1495
+ query: (args) => (norbix) => norbix.hub.notifications.getPushTemplates(args),
1496
+ providesTags: ["PushTemplates"]
1497
+ }),
1498
+ getPushMessageContentTokens: b.query({
1499
+ query: (args) => (norbix) => norbix.hub.notifications.getPushMessageContentTokens(args),
1500
+ providesTags: ["Push"]
1501
+ }),
1502
+ unArchivePushTemplate: b.mutation({
1503
+ query: (args) => (norbix) => norbix.hub.notifications.unArchivePushTemplate(args),
1504
+ invalidatesTags: ["PushTemplates"]
1505
+ }),
1506
+ updatePushTemplate: b.mutation({
1507
+ query: (args) => (norbix) => norbix.hub.notifications.updatePushTemplate(args),
1508
+ invalidatesTags: ["PushTemplates"]
1509
+ }),
1510
+ getPushSettings: b.query({
1511
+ query: (args) => (norbix) => norbix.hub.notifications.getPushSettings(args),
1512
+ providesTags: ["Push"]
1513
+ }),
1514
+ confirmPushIntegrationHumanDelivery: b.mutation({
1515
+ query: (args) => (norbix) => norbix.hub.notifications.confirmPushIntegrationHumanDelivery(args),
1516
+ invalidatesTags: ["PushIntegrations"]
1517
+ }),
1518
+ deletePushIntegration: b.mutation({
1519
+ query: (args) => (norbix) => norbix.hub.notifications.deletePushIntegration(args),
1520
+ invalidatesTags: ["PushIntegrations"]
1521
+ }),
1522
+ disablePushIntegration: b.mutation({
1523
+ query: (args) => (norbix) => norbix.hub.notifications.disablePushIntegration(args),
1524
+ invalidatesTags: ["PushIntegrations"]
1525
+ }),
1526
+ enablePushIntegration: b.mutation({
1527
+ query: (args) => (norbix) => norbix.hub.notifications.enablePushIntegration(args),
1528
+ invalidatesTags: ["PushIntegrations"]
1529
+ }),
1530
+ getPushIntegration: b.query({
1531
+ query: (args) => (norbix) => norbix.hub.notifications.getPushIntegration(args),
1532
+ providesTags: ["PushIntegrations"]
1533
+ }),
1534
+ getPushIntegrations: b.query({
1535
+ query: (args) => (norbix) => norbix.hub.notifications.getPushIntegrations(args),
1536
+ providesTags: ["PushIntegrations"]
1537
+ }),
1538
+ savePushIntegration: b.mutation({
1539
+ query: (args) => (norbix) => norbix.hub.notifications.savePushIntegration(args),
1540
+ invalidatesTags: ["PushIntegrations"]
1541
+ }),
1542
+ setPushIntegrationAsDefault: b.mutation({
1543
+ query: (args) => (norbix) => norbix.hub.notifications.setPushIntegrationAsDefault(args),
1544
+ invalidatesTags: ["PushIntegrations"]
1545
+ }),
1546
+ testPushIntegration: b.mutation({
1547
+ query: (args) => (norbix) => norbix.hub.notifications.testPushIntegration(args),
1548
+ invalidatesTags: ["PushIntegrations"]
1549
+ }),
1550
+ registerCodeMashAppPushIntegration: b.mutation({
1551
+ query: (args) => (norbix) => norbix.hub.notifications.registerCodeMashAppPushIntegration(args),
1552
+ invalidatesTags: ["PushIntegrations"]
1553
+ }),
1554
+ registerDevice: b.mutation({
1555
+ query: (args) => (norbix) => norbix.hub.notifications.registerDevice(args),
1556
+ invalidatesTags: ["Push"]
1557
+ }),
1558
+ createPushCampaign: b.mutation({
1559
+ query: (args) => (norbix) => norbix.hub.notifications.createPushCampaign(args),
1560
+ invalidatesTags: ["PushCampaigns"]
1561
+ }),
1562
+ deletePushCampaign: b.mutation({
1563
+ query: (args) => (norbix) => norbix.hub.notifications.deletePushCampaign(args),
1564
+ invalidatesTags: ["PushCampaigns"]
1565
+ }),
1566
+ getPushCampaign: b.query({
1567
+ query: (args) => (norbix) => norbix.hub.notifications.getPushCampaign(args),
1568
+ providesTags: ["PushCampaigns"]
1569
+ }),
1570
+ getPushCampaigns: b.query({
1571
+ query: (args) => (norbix) => norbix.hub.notifications.getPushCampaigns(args),
1572
+ providesTags: ["PushCampaigns"]
1573
+ }),
1574
+ getPushCampaignBatches: b.query({
1575
+ query: (args) => (norbix) => norbix.hub.notifications.getPushCampaignBatches(args),
1576
+ providesTags: ["PushCampaigns"]
1577
+ }),
1578
+ getPushCampaignBatchNotification: b.query({
1579
+ query: (args) => (norbix) => norbix.hub.notifications.getPushCampaignBatchNotification(args),
1580
+ providesTags: ["PushCampaigns"]
1581
+ }),
1582
+ getPushCampaignBatchNotifications: b.query({
1583
+ query: (args) => (norbix) => norbix.hub.notifications.getPushCampaignBatchNotifications(args),
1584
+ providesTags: ["PushCampaigns"]
1585
+ }),
1586
+ getPushCampaignStatistics: b.query({
1587
+ query: (args) => (norbix) => norbix.hub.notifications.getPushCampaignStatistics(args),
1588
+ providesTags: ["PushCampaigns"]
1589
+ }),
1590
+ getPushCampaignMessage: b.query({
1591
+ query: (args) => (norbix) => norbix.hub.notifications.getPushCampaignMessage(args),
1592
+ providesTags: ["PushCampaigns"]
1593
+ }),
1594
+ getPushCampaignMessages: b.query({
1595
+ query: (args) => (norbix) => norbix.hub.notifications.getPushCampaignMessages(args),
1596
+ providesTags: ["PushCampaigns"]
1597
+ }),
1598
+ createContact: b.mutation({
1599
+ query: (args) => (norbix) => norbix.hub.membership.createContact(args),
1600
+ invalidatesTags: ["Contacts"]
1601
+ }),
1602
+ deleteContact: b.mutation({
1603
+ query: (args) => (norbix) => norbix.hub.membership.deleteContact(args),
1604
+ invalidatesTags: ["Contacts"]
1605
+ }),
1606
+ getContact: b.query({
1607
+ query: (args) => (norbix) => norbix.hub.membership.getContact(args),
1608
+ providesTags: ["Contacts"]
1609
+ }),
1610
+ getAllContacts: b.query({
1611
+ query: (args) => (norbix) => norbix.hub.membership.getAllContacts(args),
1612
+ providesTags: ["Contacts"]
1613
+ }),
1614
+ mergeContacts: b.mutation({
1615
+ query: (args) => (norbix) => norbix.hub.membership.mergeContacts(args),
1616
+ invalidatesTags: ["Contacts"]
1617
+ }),
1618
+ grantContactConsent: b.mutation({
1619
+ query: (args) => (norbix) => norbix.hub.notifications.grantContactConsent(args),
1620
+ invalidatesTags: ["Contacts"]
1621
+ }),
1622
+ unsubscribeContact: b.mutation({
1623
+ query: (args) => (norbix) => norbix.hub.notifications.unsubscribeContact(args),
1624
+ invalidatesTags: ["Contacts"]
1625
+ }),
1626
+ addContactIdentity: b.mutation({
1627
+ query: (args) => (norbix) => norbix.hub.membership.addContactIdentity(args),
1628
+ invalidatesTags: ["Contacts"]
1629
+ }),
1630
+ promoteContactIdentity: b.mutation({
1631
+ query: (args) => (norbix) => norbix.hub.membership.promoteContactIdentity(args),
1632
+ invalidatesTags: ["Contacts"]
1633
+ }),
1634
+ removeContactIdentity: b.mutation({
1635
+ query: (args) => (norbix) => norbix.hub.membership.removeContactIdentity(args),
1636
+ invalidatesTags: ["Contacts"]
1637
+ })
1638
+ });
1639
+
1640
+ // src/hooks/hub/payments.ts
1641
+ var hubPayments = (b) => ({
1642
+ disablePayments: b.mutation({
1643
+ query: (args) => (norbix) => norbix.hub.payments.disablePayments(args),
1644
+ invalidatesTags: ["Payments"]
1645
+ }),
1646
+ enablePayments: b.mutation({
1647
+ query: (args) => (norbix) => norbix.hub.payments.enablePayments(args),
1648
+ invalidatesTags: ["Payments"]
1649
+ }),
1650
+ deletePaymentsTrigger: b.mutation({
1651
+ query: (args) => (norbix) => norbix.hub.payments.deletePaymentsTrigger(args),
1652
+ invalidatesTags: ["Triggers"]
1653
+ }),
1654
+ disablePaymentsTrigger: b.mutation({
1655
+ query: (args) => (norbix) => norbix.hub.payments.disablePaymentsTrigger(args),
1656
+ invalidatesTags: ["Triggers"]
1657
+ }),
1658
+ enablePaymentsTrigger: b.mutation({
1659
+ query: (args) => (norbix) => norbix.hub.payments.enablePaymentsTrigger(args),
1660
+ invalidatesTags: ["Triggers"]
1661
+ }),
1662
+ getPaymentsTrigger: b.query({
1663
+ query: (args) => (norbix) => norbix.hub.payments.getPaymentsTrigger(args),
1664
+ providesTags: ["Triggers"]
1665
+ }),
1666
+ getPaymentsTriggers: b.query({
1667
+ query: (args) => (norbix) => norbix.hub.payments.getPaymentsTriggers(args),
1668
+ providesTags: ["Triggers"]
1669
+ }),
1670
+ savePaymentsTrigger: b.mutation({
1671
+ query: (args) => (norbix) => norbix.hub.payments.savePaymentsTrigger(args),
1672
+ invalidatesTags: ["Triggers"]
1673
+ }),
1674
+ confirmPaymentsIntegrationHumanDelivery: b.mutation({
1675
+ query: (args) => (norbix) => norbix.hub.payments.confirmPaymentsIntegrationHumanDelivery(args),
1676
+ invalidatesTags: ["PaymentIntegrations"]
1677
+ }),
1678
+ deletePaymentsIntegration: b.mutation({
1679
+ query: (args) => (norbix) => norbix.hub.payments.deletePaymentsIntegration(args),
1680
+ invalidatesTags: ["PaymentIntegrations"]
1681
+ }),
1682
+ disablePaymentsIntegration: b.mutation({
1683
+ query: (args) => (norbix) => norbix.hub.payments.disablePaymentsIntegration(args),
1684
+ invalidatesTags: ["PaymentIntegrations"]
1685
+ }),
1686
+ enablePaymentsIntegration: b.mutation({
1687
+ query: (args) => (norbix) => norbix.hub.payments.enablePaymentsIntegration(args),
1688
+ invalidatesTags: ["PaymentIntegrations"]
1689
+ }),
1690
+ getPaymentsIntegration: b.query({
1691
+ query: (args) => (norbix) => norbix.hub.payments.getPaymentsIntegration(args),
1692
+ providesTags: ["PaymentIntegrations"]
1693
+ }),
1694
+ getPaymentsIntegrations: b.query({
1695
+ query: (args) => (norbix) => norbix.hub.payments.getPaymentsIntegrations(args),
1696
+ providesTags: ["PaymentIntegrations"]
1697
+ }),
1698
+ savePaymentsIntegration: b.mutation({
1699
+ query: (args) => (norbix) => norbix.hub.payments.savePaymentsIntegration(args),
1700
+ invalidatesTags: ["PaymentIntegrations"]
1701
+ }),
1702
+ testPaymentsIntegration: b.mutation({
1703
+ query: (args) => (norbix) => norbix.hub.payments.testPaymentsIntegration(args),
1704
+ invalidatesTags: ["PaymentIntegrations"]
1705
+ })
1706
+ });
1707
+
1708
+ // src/hooks/hub/regions.ts
1709
+ var hubRegions = (b) => ({
1710
+ listRegions: b.query({
1711
+ query: (args) => (norbix) => norbix.hub.regions.list(args),
1712
+ providesTags: ["Regions"]
1713
+ }),
1714
+ updateProjectRegions: b.mutation({
1715
+ query: (args) => (norbix) => norbix.hub.regions.updateProjectRegions(args),
1716
+ // Changing the regions a project spans updates the project DTO
1717
+ // (`primaryRegion` / `additionalRegions`).
1718
+ invalidatesTags: ["Regions", "Projects"]
1719
+ })
1720
+ });
1721
+
1722
+ // src/hooks/hub/resources.ts
1723
+ var hubResources = (b) => ({
1724
+ resolveResources: b.mutation({
1725
+ query: (args) => (norbix) => norbix.hub.resources.resolveResources(args)
1726
+ })
1727
+ });
1728
+
1729
+ // src/hooks/hub/scheduler.ts
1730
+ var hubScheduler = (b) => {
1731
+ const callHS = (norbix) => norbix.hub.scheduler;
1732
+ return {
1733
+ // ---- Module toggle ----
1734
+ enableSchedulerModule: b.mutation({
1735
+ query: (args) => (norbix) => callHS(norbix).enableScheduler(args),
1736
+ invalidatesTags: ["Account", "Projects", "Scheduler"]
1737
+ }),
1738
+ disableSchedulerModule: b.mutation({
1739
+ query: (args) => (norbix) => callHS(norbix).disableScheduler(args),
1740
+ invalidatesTags: ["Account", "Projects", "Scheduler"]
1741
+ }),
1742
+ // ---- Tasks ----
1743
+ getSchedulerTasks: b.query({
1744
+ query: (args) => (norbix) => callHS(norbix).getSchedulerTasks(args),
1745
+ providesTags: [{ type: "Scheduler", id: "LIST" }]
1746
+ }),
1747
+ getSchedulerTask: b.query({
1748
+ query: (args) => (norbix) => callHS(norbix).getSchedulerTask(args),
1749
+ providesTags: (_res, _err, arg) => [
1750
+ { type: "Scheduler", id: arg?.id ?? "CURRENT" }
1751
+ ]
1752
+ }),
1753
+ saveSchedulerTask: b.mutation({
1754
+ query: (args) => (norbix) => callHS(norbix).saveSchedulerTask(args),
1755
+ invalidatesTags: (_res, _err, arg) => [
1756
+ { type: "Scheduler", id: "LIST" },
1757
+ { type: "Scheduler", id: arg?.taskId ?? "CURRENT" }
1758
+ ]
1759
+ }),
1760
+ enableSchedulerTask: b.mutation({
1761
+ query: (args) => (norbix) => callHS(norbix).enableSchedulerTask(args),
1762
+ invalidatesTags: (_res, _err, arg) => [
1763
+ { type: "Scheduler", id: "LIST" },
1764
+ { type: "Scheduler", id: arg?.id ?? "CURRENT" }
1765
+ ]
1766
+ }),
1767
+ disableSchedulerTask: b.mutation({
1768
+ query: (args) => (norbix) => callHS(norbix).disableSchedulerTask(args),
1769
+ invalidatesTags: (_res, _err, arg) => [
1770
+ { type: "Scheduler", id: "LIST" },
1771
+ { type: "Scheduler", id: arg?.id ?? "CURRENT" }
1772
+ ]
1773
+ }),
1774
+ deleteSchedulerTask: b.mutation({
1775
+ query: (args) => (norbix) => callHS(norbix).deleteSchedulerTask(args),
1776
+ invalidatesTags: (_res, _err, arg) => [
1777
+ { type: "Scheduler", id: "LIST" },
1778
+ { type: "Scheduler", id: arg?.id ?? "CURRENT" }
1779
+ ]
1780
+ })
1781
+ };
1782
+ };
1783
+
1784
+ // src/hooks/hub/webhooks.ts
1785
+ var hubWebhooks = (b) => ({
1786
+ getWebhookIntegration: b.query({
1787
+ query: (args) => (norbix) => norbix.hub.webhooks.getWebhookIntegration(args),
1788
+ providesTags: ["Webhooks"]
1789
+ }),
1790
+ revealWebhookIntegrationSecret: b.mutation({
1791
+ query: (args) => (norbix) => norbix.hub.webhooks.revealWebhookIntegrationSecret(args),
1792
+ invalidatesTags: ["Webhooks"]
1793
+ }),
1794
+ rotateWebhookIntegrationSecret: b.mutation({
1795
+ query: (args) => (norbix) => norbix.hub.webhooks.rotateWebhookIntegrationSecret(args),
1796
+ invalidatesTags: ["Webhooks"]
1797
+ }),
1798
+ updateWebhookIntegrationExtraHeaders: b.mutation({
1799
+ query: (args) => (norbix) => norbix.hub.webhooks.updateWebhookIntegrationExtraHeaders(args),
1800
+ invalidatesTags: ["Webhooks"]
1801
+ }),
1802
+ receiveWebhook: b.mutation({
1803
+ query: (args) => (norbix) => norbix.hub.webhooks.receiveWebhook(args),
1804
+ invalidatesTags: ["Webhooks"]
1805
+ }),
1806
+ disableWebhookDestination: b.mutation({
1807
+ query: (args) => (norbix) => norbix.hub.webhooks.disableWebhookDestination(args),
1808
+ invalidatesTags: ["Webhooks"]
1809
+ }),
1810
+ enableWebhookDestination: b.mutation({
1811
+ query: (args) => (norbix) => norbix.hub.webhooks.enableWebhookDestination(args),
1812
+ invalidatesTags: ["Webhooks"]
1813
+ }),
1814
+ removeWebhookDestination: b.mutation({
1815
+ query: (args) => (norbix) => norbix.hub.webhooks.removeWebhookDestination(args),
1816
+ invalidatesTags: ["Webhooks"]
1817
+ }),
1818
+ saveWebhookDestination: b.mutation({
1819
+ query: (args) => (norbix) => norbix.hub.webhooks.saveWebhookDestination(args),
1820
+ invalidatesTags: ["Webhooks"]
1821
+ })
1822
+ });
1823
+
1824
+ // src/hooks/index.ts
1825
+ function buildEndpoints(builder) {
1826
+ return {
1827
+ // API surface (runtime, project-scoped)
1828
+ ...apiAuth(builder),
1829
+ ...apiMembership(builder),
1830
+ ...apiDatabase(builder),
1831
+ ...apiApikeys(builder),
1832
+ ...apiChat(builder),
1833
+ ...apiFiles(builder),
1834
+ ...apiPublic(builder),
1835
+ // Hub surface (control plane)
1836
+ ...hubAccount(builder),
1837
+ ...hubAi(builder),
1838
+ ...hubApikeys(builder),
1839
+ ...hubMembership(builder),
1840
+ ...hubDatabase(builder),
1841
+ ...hubFiles(builder),
1842
+ ...hubLogs(builder),
1843
+ ...hubNotifications(builder),
1844
+ ...hubPayments(builder),
1845
+ ...hubScheduler(builder),
1846
+ ...hubEmail(builder),
1847
+ ...hubEnvironments(builder),
1848
+ ...hubRegions(builder),
1849
+ ...hubResources(builder),
1850
+ ...hubWebhooks(builder)
1851
+ };
1852
+ }
1853
+
1854
+ // src/createNorbixApi.ts
1855
+ function createNorbixApi(getClient, options = {}) {
1856
+ const reducerPath = options.reducerPath ?? "norbix";
1857
+ return createApi({
1858
+ reducerPath,
1859
+ baseQuery: createNorbixBaseQuery(getClient),
1860
+ tagTypes: [
1861
+ // Account / config
1862
+ "Config",
1863
+ "Account",
1864
+ "AccountProfile",
1865
+ "AccountUsers",
1866
+ "Billing",
1867
+ "Projects",
1868
+ "Environments",
1869
+ "Regions",
1870
+ "ApiKey",
1871
+ // Membership
1872
+ "Membership",
1873
+ "MembershipUsers",
1874
+ "MembershipRoles",
1875
+ "MembershipPolicies",
1876
+ "MembershipIntegrations",
1877
+ // Database
1878
+ "Database",
1879
+ "DatabaseSchemas",
1880
+ "DatabaseCollections",
1881
+ "DatabaseRecords",
1882
+ "DatabaseTaxonomies",
1883
+ "DatabaseTaxonomyTerms",
1884
+ "DatabaseAggregates",
1885
+ "DatabaseIntegrations",
1886
+ "DatabaseImports",
1887
+ "DatabaseExports",
1888
+ "DatabaseBackups",
1889
+ // Files
1890
+ "Files",
1891
+ "FilesIntegrations",
1892
+ // Code
1893
+ "Code",
1894
+ "CodeIntegrations",
1895
+ "CodeFunctions",
1896
+ "CodeMarketplace",
1897
+ // Email
1898
+ "Emails",
1899
+ "EmailTemplates",
1900
+ "EmailCampaigns",
1901
+ "EmailIntegrations",
1902
+ "EmailSignatures",
1903
+ "EmailFooters",
1904
+ "EmailSettings",
1905
+ // Push
1906
+ "Push",
1907
+ "PushTemplates",
1908
+ "PushCampaigns",
1909
+ "PushIntegrations",
1910
+ // Sms
1911
+ "Sms",
1912
+ "SmsTemplates",
1913
+ "SmsCampaigns",
1914
+ "SmsIntegrations",
1915
+ "SmsSettings",
1916
+ // Payments
1917
+ "Payments",
1918
+ "PaymentIntegrations",
1919
+ "PaymentPlans",
1920
+ "PaymentDiscounts",
1921
+ "PaymentCustomers",
1922
+ // AI
1923
+ "Ai",
1924
+ // Webhooks
1925
+ "Webhooks",
1926
+ // Contacts
1927
+ "Contacts",
1928
+ // Other
1929
+ "Scheduler",
1930
+ "Triggers",
1931
+ "Logs",
1932
+ "LogsIntegrations"
1933
+ ],
1934
+ endpoints: (builder) => buildEndpoints(builder)
1935
+ });
1936
+ }
1937
+ var NorbixContext = createContext(null);
1938
+ function NorbixProvider({ client, children }) {
1939
+ const value = useMemo(() => client, [client]);
1940
+ return /* @__PURE__ */ jsx(NorbixContext.Provider, { value, children });
1941
+ }
1942
+ function useNorbix() {
1943
+ const client = useContext(NorbixContext);
1944
+ if (!client) {
1945
+ throw new Error(
1946
+ "@norbix.ai/react-redux: useNorbix() must be called inside <NorbixProvider client={...}>."
1947
+ );
1948
+ }
1949
+ return client;
1950
+ }
1951
+ function useOptionalNorbix() {
1952
+ return useContext(NorbixContext);
1953
+ }
1954
+
1955
+ // src/helpers/integrations.ts
1956
+ function buildIntegrationsEndpoints(b, opts) {
1957
+ const { tag, prefix, namespace } = opts;
1958
+ const m = opts.methodNames ?? {};
1959
+ const list = m.list ?? `get${prefix}Integrations`;
1960
+ const one = m.one ?? `get${prefix}Integration`;
1961
+ const save = m.save ?? `save${prefix}Integration`;
1962
+ const del = m.delete ?? `delete${prefix}Integration`;
1963
+ const enable = m.enable ?? `enable${prefix}Integration`;
1964
+ const disable = m.disable ?? `disable${prefix}Integration`;
1965
+ const setDefault = m.setDefault ?? `set${prefix}IntegrationAsDefault`;
1966
+ const test = m.test ?? `test${prefix}Integration`;
1967
+ const confirmHumanDelivery = m.confirmHumanDelivery ?? `confirm${prefix}IntegrationHumanDelivery`;
1968
+ const callMethod = (methodName) => (args) => (norbix) => {
1969
+ const ns = namespace(norbix);
1970
+ const fn = ns[methodName];
1971
+ if (typeof fn !== "function") {
1972
+ return Promise.reject(
1973
+ new Error(
1974
+ `@norbix.ai/react-redux: SDK method "${methodName}" not found. Check your SDK version or pass methodNames overrides.`
1975
+ )
1976
+ );
1977
+ }
1978
+ return fn(args);
1979
+ };
1980
+ const endpoints = {
1981
+ [list]: b.query({
1982
+ query: callMethod(list),
1983
+ providesTags: [{ type: tag, id: "INTEGRATIONS_LIST" }]
1984
+ }),
1985
+ [one]: b.query({
1986
+ query: callMethod(one),
1987
+ providesTags: (_r, _e, arg) => [{ type: tag, id: arg?.id ?? "CURRENT" }]
1988
+ }),
1989
+ [save]: b.mutation({
1990
+ query: callMethod(save),
1991
+ invalidatesTags: (_r, _e, arg) => [
1992
+ { type: tag, id: "INTEGRATIONS_LIST" },
1993
+ { type: tag, id: arg?.id ?? "" }
1994
+ ]
1995
+ }),
1996
+ [del]: b.mutation({
1997
+ query: callMethod(del),
1998
+ invalidatesTags: (_r, _e, arg) => [
1999
+ { type: tag, id: "INTEGRATIONS_LIST" },
2000
+ { type: tag, id: arg?.id ?? "" }
2001
+ ]
2002
+ }),
2003
+ [enable]: b.mutation({
2004
+ query: callMethod(enable),
2005
+ invalidatesTags: (_r, _e, arg) => [
2006
+ { type: tag, id: "INTEGRATIONS_LIST" },
2007
+ { type: tag, id: arg?.id ?? "" }
2008
+ ]
2009
+ }),
2010
+ [disable]: b.mutation({
2011
+ query: callMethod(disable),
2012
+ invalidatesTags: (_r, _e, arg) => [
2013
+ { type: tag, id: "INTEGRATIONS_LIST" },
2014
+ { type: tag, id: arg?.id ?? "" }
2015
+ ]
2016
+ }),
2017
+ [setDefault]: b.mutation({
2018
+ query: callMethod(setDefault),
2019
+ invalidatesTags: (_r, _e, arg) => [
2020
+ { type: tag, id: "INTEGRATIONS_LIST" },
2021
+ { type: tag, id: arg?.id ?? "" }
2022
+ ]
2023
+ })
2024
+ };
2025
+ if (opts.include?.test !== false) {
2026
+ endpoints[test] = b.mutation({
2027
+ query: callMethod(test),
2028
+ invalidatesTags: (_r, _e, arg) => arg?.integrationId ? [{ type: tag, id: arg.integrationId }] : []
2029
+ });
2030
+ }
2031
+ if (opts.include?.confirmHumanDelivery === true) {
2032
+ endpoints[confirmHumanDelivery] = b.mutation({
2033
+ query: callMethod(confirmHumanDelivery),
2034
+ invalidatesTags: (_r, _e, arg) => arg?.integrationId ? [{ type: tag, id: arg.integrationId }] : []
2035
+ });
2036
+ }
2037
+ return endpoints;
2038
+ }
2039
+
2040
+ export { NorbixProvider, buildIntegrationsEndpoints, createNorbixApi, createNorbixBaseQuery, serializeNorbixError, useNorbix, useOptionalNorbix };
2041
+ //# sourceMappingURL=index.js.map
2042
+ //# sourceMappingURL=index.js.map