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