@carlonicora/nextjs-jsonapi 1.118.0 → 1.120.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/{BlockNoteEditor-5FFVS7KW.js → BlockNoteEditor-MQWCI6TX.js} +20 -20
- package/dist/{BlockNoteEditor-5FFVS7KW.js.map → BlockNoteEditor-MQWCI6TX.js.map} +1 -1
- package/dist/{BlockNoteEditor-6GRZW6BL.mjs → BlockNoteEditor-NW7SS2YJ.mjs} +5 -5
- package/dist/{JsonApiRequest-IYL5RZ7I.mjs → JsonApiRequest-4ISXX7PC.mjs} +4 -2
- package/dist/JsonApiRequest-P3VQ2WIS.js +26 -0
- package/dist/JsonApiRequest-P3VQ2WIS.js.map +1 -0
- package/dist/billing/index.js +347 -347
- package/dist/billing/index.mjs +4 -4
- package/dist/{chunk-6KLR3WJQ.js → chunk-5NNJYJSI.js} +9 -9
- package/dist/{chunk-6KLR3WJQ.js.map → chunk-5NNJYJSI.js.map} +1 -1
- package/dist/{chunk-KK7PYKVI.mjs → chunk-DKFXGCG2.mjs} +14 -10
- package/dist/chunk-DKFXGCG2.mjs.map +1 -0
- package/dist/{chunk-J5LROFGL.js → chunk-EIOEYXY3.js} +15 -11
- package/dist/chunk-EIOEYXY3.js.map +1 -0
- package/dist/{chunk-M7XAKLSP.mjs → chunk-IUKSHJPS.mjs} +40 -24
- package/dist/chunk-IUKSHJPS.mjs.map +1 -0
- package/dist/{chunk-WEPQD5MP.mjs → chunk-JL3X3LQR.mjs} +3 -3
- package/dist/{chunk-M2ODDWY3.js → chunk-MJ2TMIK3.js} +701 -701
- package/dist/{chunk-M2ODDWY3.js.map → chunk-MJ2TMIK3.js.map} +1 -1
- package/dist/{chunk-KXHEOLPZ.mjs → chunk-S4BL7L3J.mjs} +6 -6
- package/dist/{chunk-S2PTWBN6.js → chunk-YCMYYYBP.js} +66 -50
- package/dist/chunk-YCMYYYBP.js.map +1 -0
- package/dist/client/index.d.mts +15 -1
- package/dist/client/index.d.ts +15 -1
- package/dist/client/index.js +7 -5
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +6 -4
- package/dist/components/index.js +5 -5
- package/dist/components/index.mjs +4 -4
- package/dist/contexts/index.js +5 -5
- package/dist/contexts/index.mjs +4 -4
- package/dist/core/index.d.mts +7 -2
- package/dist/core/index.d.ts +7 -2
- package/dist/core/index.js +3 -3
- package/dist/core/index.mjs +2 -2
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +4 -4
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/index.mjs +3 -3
- package/dist/{s3.service-CihgBy97.d.mts → s3.service-CBqyDZyz.d.mts} +7 -0
- package/dist/{s3.service-Cyvfk3qV.d.ts → s3.service-gcEjq8gF.d.ts} +7 -0
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +12 -12
- package/dist/server/index.mjs +2 -2
- package/package.json +1 -1
- package/src/client/JsonApiClient.ts +23 -8
- package/src/client/__tests__/JsonApiClient.test.ts +31 -0
- package/src/core/abstracts/AbstractService.ts +13 -0
- package/src/core/abstracts/ClientAbstractService.ts +12 -0
- package/src/core/utils/translateResponse.ts +1 -0
- package/src/unified/JsonApiRequest.ts +22 -8
- package/src/unified/__tests__/JsonApiRequest.test.ts +29 -0
- package/dist/JsonApiRequest-OSGJ63XR.js +0 -24
- package/dist/JsonApiRequest-OSGJ63XR.js.map +0 -1
- package/dist/chunk-J5LROFGL.js.map +0 -1
- package/dist/chunk-KK7PYKVI.mjs.map +0 -1
- package/dist/chunk-M7XAKLSP.mjs.map +0 -1
- package/dist/chunk-S2PTWBN6.js.map +0 -1
- /package/dist/{BlockNoteEditor-6GRZW6BL.mjs.map → BlockNoteEditor-NW7SS2YJ.mjs.map} +0 -0
- /package/dist/{JsonApiRequest-IYL5RZ7I.mjs.map → JsonApiRequest-4ISXX7PC.mjs.map} +0 -0
- /package/dist/{chunk-WEPQD5MP.mjs.map → chunk-JL3X3LQR.mjs.map} +0 -0
- /package/dist/{chunk-KXHEOLPZ.mjs.map → chunk-S4BL7L3J.mjs.map} +0 -0
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
useI18nLocale,
|
|
21
21
|
useI18nRouter,
|
|
22
22
|
useI18nTranslations
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-JL3X3LQR.mjs";
|
|
24
24
|
import {
|
|
25
25
|
AVAILABLE_OAUTH_SCOPES,
|
|
26
26
|
AssistantMessage,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
showToast,
|
|
61
61
|
useComposedRefs,
|
|
62
62
|
useIsMobile
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-IUKSHJPS.mjs";
|
|
64
64
|
import {
|
|
65
65
|
JsonApiContext
|
|
66
66
|
} from "./chunk-VOXD3ZLY.mjs";
|
|
@@ -9801,7 +9801,7 @@ import { useRef as useRef15 } from "react";
|
|
|
9801
9801
|
import dynamic from "next/dynamic";
|
|
9802
9802
|
import React17 from "react";
|
|
9803
9803
|
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
9804
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
9804
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-NW7SS2YJ.mjs"), {
|
|
9805
9805
|
ssr: false
|
|
9806
9806
|
});
|
|
9807
9807
|
var BlockNoteEditorContainer = React17.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -15100,7 +15100,7 @@ function useJsonApiGet(params) {
|
|
|
15100
15100
|
setLoading(true);
|
|
15101
15101
|
setError(null);
|
|
15102
15102
|
try {
|
|
15103
|
-
const { JsonApiGet } = await import("./JsonApiRequest-
|
|
15103
|
+
const { JsonApiGet } = await import("./JsonApiRequest-4ISXX7PC.mjs");
|
|
15104
15104
|
const language = navigator.language.split("-")[0] || "en";
|
|
15105
15105
|
const apiResponse = await JsonApiGet({
|
|
15106
15106
|
classKey: params.classKey,
|
|
@@ -15205,7 +15205,7 @@ function useJsonApiMutation(config) {
|
|
|
15205
15205
|
setLoading(true);
|
|
15206
15206
|
setError(null);
|
|
15207
15207
|
try {
|
|
15208
|
-
const { JsonApiPost, JsonApiPut, JsonApiPatch, JsonApiDelete } = await import("./JsonApiRequest-
|
|
15208
|
+
const { JsonApiPost, JsonApiPut, JsonApiPatch, JsonApiDelete } = await import("./JsonApiRequest-4ISXX7PC.mjs");
|
|
15209
15209
|
const language = navigator.language.split("-")[0] || "en";
|
|
15210
15210
|
let apiResponse;
|
|
15211
15211
|
switch (config.method) {
|
|
@@ -23107,4 +23107,4 @@ export {
|
|
|
23107
23107
|
useOAuthClients,
|
|
23108
23108
|
useOAuthClient
|
|
23109
23109
|
};
|
|
23110
|
-
//# sourceMappingURL=chunk-
|
|
23110
|
+
//# sourceMappingURL=chunk-S4BL7L3J.mjs.map
|
|
@@ -14,7 +14,7 @@ var _chunkIBS6NI7Djs = require('./chunk-IBS6NI7D.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkEIOEYXY3js = require('./chunk-EIOEYXY3.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
var _chunk7QVYU63Ejs = require('./chunk-7QVYU63E.js');
|
|
@@ -25,12 +25,12 @@ var RehydrationFactory = class {
|
|
|
25
25
|
_chunk7QVYU63Ejs.__name.call(void 0, this, "RehydrationFactory");
|
|
26
26
|
}
|
|
27
27
|
static rehydrate(classKey, data) {
|
|
28
|
-
const factoryClass =
|
|
28
|
+
const factoryClass = _chunkEIOEYXY3js.DataClassRegistry.get(classKey);
|
|
29
29
|
const instance = new factoryClass();
|
|
30
30
|
return instance.rehydrate(data);
|
|
31
31
|
}
|
|
32
32
|
static rehydrateList(classKey, data) {
|
|
33
|
-
const factoryClass =
|
|
33
|
+
const factoryClass = _chunkEIOEYXY3js.DataClassRegistry.get(classKey);
|
|
34
34
|
const response = data.map((item) => {
|
|
35
35
|
const instance = new factoryClass();
|
|
36
36
|
return instance.rehydrate(item);
|
|
@@ -326,7 +326,7 @@ var AbstractService = class {
|
|
|
326
326
|
* Make an API call with automatic environment detection and error handling.
|
|
327
327
|
*/
|
|
328
328
|
static async callApi(params) {
|
|
329
|
-
const { JsonApiGet: JsonApiGet2, JsonApiPost: JsonApiPost2, JsonApiPut, JsonApiPatch, JsonApiDelete: JsonApiDelete2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-
|
|
329
|
+
const { JsonApiGet: JsonApiGet2, JsonApiPost: JsonApiPost2, JsonApiPut, JsonApiPatch, JsonApiDelete: JsonApiDelete2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-P3VQ2WIS.js")));
|
|
330
330
|
let apiResponse;
|
|
331
331
|
let language = "en";
|
|
332
332
|
if (typeof window === "undefined") {
|
|
@@ -341,7 +341,8 @@ var AbstractService = class {
|
|
|
341
341
|
classKey: params.type,
|
|
342
342
|
endpoint: params.endpoint,
|
|
343
343
|
companyId: params.companyId,
|
|
344
|
-
language
|
|
344
|
+
language,
|
|
345
|
+
baseUrl: params.baseUrl
|
|
345
346
|
});
|
|
346
347
|
break;
|
|
347
348
|
case "POST" /* POST */:
|
|
@@ -354,7 +355,8 @@ var AbstractService = class {
|
|
|
354
355
|
language,
|
|
355
356
|
responseType: params.responseType,
|
|
356
357
|
files: params.files,
|
|
357
|
-
token: params.token
|
|
358
|
+
token: params.token,
|
|
359
|
+
baseUrl: params.baseUrl
|
|
358
360
|
});
|
|
359
361
|
break;
|
|
360
362
|
case "PUT" /* PUT */:
|
|
@@ -365,7 +367,8 @@ var AbstractService = class {
|
|
|
365
367
|
body: params.input,
|
|
366
368
|
language,
|
|
367
369
|
responseType: params.responseType,
|
|
368
|
-
files: params.files
|
|
370
|
+
files: params.files,
|
|
371
|
+
baseUrl: params.baseUrl
|
|
369
372
|
});
|
|
370
373
|
break;
|
|
371
374
|
case "PATCH" /* PATCH */:
|
|
@@ -377,7 +380,8 @@ var AbstractService = class {
|
|
|
377
380
|
overridesJsonApiCreation: params.overridesJsonApiCreation,
|
|
378
381
|
language,
|
|
379
382
|
responseType: params.responseType,
|
|
380
|
-
files: params.files
|
|
383
|
+
files: params.files,
|
|
384
|
+
baseUrl: params.baseUrl
|
|
381
385
|
});
|
|
382
386
|
break;
|
|
383
387
|
case "DELETE" /* DELETE */:
|
|
@@ -386,7 +390,8 @@ var AbstractService = class {
|
|
|
386
390
|
endpoint: params.endpoint,
|
|
387
391
|
companyId: params.companyId,
|
|
388
392
|
language,
|
|
389
|
-
responseType: params.responseType
|
|
393
|
+
responseType: params.responseType,
|
|
394
|
+
baseUrl: params.baseUrl
|
|
390
395
|
});
|
|
391
396
|
break;
|
|
392
397
|
default:
|
|
@@ -416,7 +421,7 @@ var AbstractService = class {
|
|
|
416
421
|
* Make an API call and return both data and meta from the response.
|
|
417
422
|
*/
|
|
418
423
|
static async callApiWithMeta(params) {
|
|
419
|
-
const { JsonApiGet: JsonApiGet2, JsonApiPost: JsonApiPost2, JsonApiPut, JsonApiPatch, JsonApiDelete: JsonApiDelete2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-
|
|
424
|
+
const { JsonApiGet: JsonApiGet2, JsonApiPost: JsonApiPost2, JsonApiPut, JsonApiPatch, JsonApiDelete: JsonApiDelete2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-P3VQ2WIS.js")));
|
|
420
425
|
let apiResponse;
|
|
421
426
|
let language = "en";
|
|
422
427
|
if (typeof window === "undefined") {
|
|
@@ -501,7 +506,7 @@ var AbstractService = class {
|
|
|
501
506
|
* Get raw JSON:API response data without deserialization.
|
|
502
507
|
*/
|
|
503
508
|
static async getRawData(params) {
|
|
504
|
-
const { JsonApiGet: JsonApiGet2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-
|
|
509
|
+
const { JsonApiGet: JsonApiGet2 } = await Promise.resolve().then(() => _interopRequireWildcard(require("./JsonApiRequest-P3VQ2WIS.js")));
|
|
505
510
|
let language = "en";
|
|
506
511
|
if (typeof window === "undefined") {
|
|
507
512
|
const { getLocale } = await Promise.resolve().then(() => _interopRequireWildcard(require("next-intl/server")));
|
|
@@ -513,6 +518,7 @@ var AbstractService = class {
|
|
|
513
518
|
classKey: params.type,
|
|
514
519
|
endpoint: params.endpoint,
|
|
515
520
|
companyId: params.companyId,
|
|
521
|
+
baseUrl: params.baseUrl,
|
|
516
522
|
language
|
|
517
523
|
});
|
|
518
524
|
if (!apiResponse.ok) {
|
|
@@ -535,7 +541,7 @@ var _clientConfig = null;
|
|
|
535
541
|
function configureClientJsonApi(config) {
|
|
536
542
|
_clientConfig = config;
|
|
537
543
|
if (config.bootstrapper) {
|
|
538
|
-
|
|
544
|
+
_chunkEIOEYXY3js.setBootstrapper.call(void 0, config.bootstrapper);
|
|
539
545
|
config.bootstrapper();
|
|
540
546
|
}
|
|
541
547
|
}
|
|
@@ -576,9 +582,10 @@ function runClientBootstrapper() {
|
|
|
576
582
|
}
|
|
577
583
|
}
|
|
578
584
|
_chunk7QVYU63Ejs.__name.call(void 0, runClientBootstrapper, "runClientBootstrapper");
|
|
579
|
-
function buildClientUrl(endpoint) {
|
|
580
|
-
|
|
581
|
-
|
|
585
|
+
function buildClientUrl(endpoint, baseUrl) {
|
|
586
|
+
if (endpoint.startsWith("http")) return endpoint;
|
|
587
|
+
const apiUrl = _nullishCoalesce(baseUrl, () => ( getClientApiUrl()));
|
|
588
|
+
return `${apiUrl}${endpoint}`;
|
|
582
589
|
}
|
|
583
590
|
_chunk7QVYU63Ejs.__name.call(void 0, buildClientUrl, "buildClientUrl");
|
|
584
591
|
async function ClientJsonApiGet(params) {
|
|
@@ -586,13 +593,13 @@ async function ClientJsonApiGet(params) {
|
|
|
586
593
|
const token = await _chunkLXKSUWAVjs.getClientToken.call(void 0, );
|
|
587
594
|
const apiResponse = await _chunkIBS6NI7Djs.directFetch.call(void 0, {
|
|
588
595
|
method: "GET",
|
|
589
|
-
url: buildClientUrl(params.endpoint),
|
|
596
|
+
url: buildClientUrl(params.endpoint, params.baseUrl),
|
|
590
597
|
token,
|
|
591
598
|
companyId: params.companyId,
|
|
592
599
|
language: params.language,
|
|
593
600
|
additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _26 => _26.additionalHeaders])
|
|
594
601
|
});
|
|
595
|
-
return
|
|
602
|
+
return _chunkEIOEYXY3js.translateResponse.call(void 0, {
|
|
596
603
|
classKey: params.classKey,
|
|
597
604
|
apiResponse,
|
|
598
605
|
companyId: params.companyId,
|
|
@@ -601,7 +608,8 @@ async function ClientJsonApiGet(params) {
|
|
|
601
608
|
classKey: params.classKey,
|
|
602
609
|
endpoint,
|
|
603
610
|
companyId: params.companyId,
|
|
604
|
-
language: params.language
|
|
611
|
+
language: params.language,
|
|
612
|
+
baseUrl: params.baseUrl
|
|
605
613
|
}), "paginationHandler")
|
|
606
614
|
});
|
|
607
615
|
}
|
|
@@ -613,11 +621,11 @@ async function ClientJsonApiPost(params) {
|
|
|
613
621
|
if (!body) {
|
|
614
622
|
body = {};
|
|
615
623
|
} else if (params.overridesJsonApiCreation !== true) {
|
|
616
|
-
body =
|
|
624
|
+
body = _chunkEIOEYXY3js.JsonApiDataFactory.create(params.classKey, body);
|
|
617
625
|
}
|
|
618
626
|
const apiResponse = await _chunkIBS6NI7Djs.directFetch.call(void 0, {
|
|
619
627
|
method: "POST",
|
|
620
|
-
url: buildClientUrl(params.endpoint),
|
|
628
|
+
url: buildClientUrl(params.endpoint, params.baseUrl),
|
|
621
629
|
token,
|
|
622
630
|
body,
|
|
623
631
|
files: params.files,
|
|
@@ -625,7 +633,7 @@ async function ClientJsonApiPost(params) {
|
|
|
625
633
|
language: params.language,
|
|
626
634
|
additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _27 => _27.additionalHeaders])
|
|
627
635
|
});
|
|
628
|
-
return
|
|
636
|
+
return _chunkEIOEYXY3js.translateResponse.call(void 0, {
|
|
629
637
|
classKey: _nullishCoalesce(params.responseType, () => ( params.classKey)),
|
|
630
638
|
apiResponse,
|
|
631
639
|
companyId: params.companyId,
|
|
@@ -640,11 +648,11 @@ async function ClientJsonApiPut(params) {
|
|
|
640
648
|
if (!body) {
|
|
641
649
|
body = {};
|
|
642
650
|
} else {
|
|
643
|
-
body =
|
|
651
|
+
body = _chunkEIOEYXY3js.JsonApiDataFactory.create(params.classKey, body);
|
|
644
652
|
}
|
|
645
653
|
const apiResponse = await _chunkIBS6NI7Djs.directFetch.call(void 0, {
|
|
646
654
|
method: "PUT",
|
|
647
|
-
url: buildClientUrl(params.endpoint),
|
|
655
|
+
url: buildClientUrl(params.endpoint, params.baseUrl),
|
|
648
656
|
token,
|
|
649
657
|
body,
|
|
650
658
|
files: params.files,
|
|
@@ -652,7 +660,7 @@ async function ClientJsonApiPut(params) {
|
|
|
652
660
|
language: params.language,
|
|
653
661
|
additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _28 => _28.additionalHeaders])
|
|
654
662
|
});
|
|
655
|
-
return
|
|
663
|
+
return _chunkEIOEYXY3js.translateResponse.call(void 0, {
|
|
656
664
|
classKey: _nullishCoalesce(params.responseType, () => ( params.classKey)),
|
|
657
665
|
apiResponse,
|
|
658
666
|
companyId: params.companyId,
|
|
@@ -667,11 +675,11 @@ async function ClientJsonApiPatch(params) {
|
|
|
667
675
|
if (!body) {
|
|
668
676
|
body = {};
|
|
669
677
|
} else if (params.overridesJsonApiCreation !== true) {
|
|
670
|
-
body =
|
|
678
|
+
body = _chunkEIOEYXY3js.JsonApiDataFactory.create(params.classKey, body);
|
|
671
679
|
}
|
|
672
680
|
const apiResponse = await _chunkIBS6NI7Djs.directFetch.call(void 0, {
|
|
673
681
|
method: "PATCH",
|
|
674
|
-
url: buildClientUrl(params.endpoint),
|
|
682
|
+
url: buildClientUrl(params.endpoint, params.baseUrl),
|
|
675
683
|
token,
|
|
676
684
|
body,
|
|
677
685
|
files: params.files,
|
|
@@ -679,7 +687,7 @@ async function ClientJsonApiPatch(params) {
|
|
|
679
687
|
language: params.language,
|
|
680
688
|
additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _29 => _29.additionalHeaders])
|
|
681
689
|
});
|
|
682
|
-
return
|
|
690
|
+
return _chunkEIOEYXY3js.translateResponse.call(void 0, {
|
|
683
691
|
classKey: _nullishCoalesce(params.responseType, () => ( params.classKey)),
|
|
684
692
|
apiResponse,
|
|
685
693
|
companyId: params.companyId,
|
|
@@ -692,13 +700,13 @@ async function ClientJsonApiDelete(params) {
|
|
|
692
700
|
const token = await _chunkLXKSUWAVjs.getClientToken.call(void 0, );
|
|
693
701
|
const apiResponse = await _chunkIBS6NI7Djs.directFetch.call(void 0, {
|
|
694
702
|
method: "DELETE",
|
|
695
|
-
url: buildClientUrl(params.endpoint),
|
|
703
|
+
url: buildClientUrl(params.endpoint, params.baseUrl),
|
|
696
704
|
token,
|
|
697
705
|
companyId: params.companyId,
|
|
698
706
|
language: params.language,
|
|
699
707
|
additionalHeaders: _optionalChain([_clientConfig, 'optionalAccess', _30 => _30.additionalHeaders])
|
|
700
708
|
});
|
|
701
|
-
return
|
|
709
|
+
return _chunkEIOEYXY3js.translateResponse.call(void 0, {
|
|
702
710
|
classKey: _nullishCoalesce(params.responseType, () => ( params.classKey)),
|
|
703
711
|
apiResponse,
|
|
704
712
|
companyId: params.companyId,
|
|
@@ -790,7 +798,8 @@ var ClientAbstractService = class {
|
|
|
790
798
|
classKey: params.type,
|
|
791
799
|
endpoint: params.endpoint,
|
|
792
800
|
companyId: params.companyId,
|
|
793
|
-
language
|
|
801
|
+
language,
|
|
802
|
+
baseUrl: params.baseUrl
|
|
794
803
|
});
|
|
795
804
|
break;
|
|
796
805
|
case "POST" /* POST */:
|
|
@@ -802,7 +811,8 @@ var ClientAbstractService = class {
|
|
|
802
811
|
overridesJsonApiCreation: params.overridesJsonApiCreation,
|
|
803
812
|
language,
|
|
804
813
|
responseType: params.responseType,
|
|
805
|
-
files: params.files
|
|
814
|
+
files: params.files,
|
|
815
|
+
baseUrl: params.baseUrl
|
|
806
816
|
});
|
|
807
817
|
break;
|
|
808
818
|
case "PUT" /* PUT */:
|
|
@@ -813,7 +823,8 @@ var ClientAbstractService = class {
|
|
|
813
823
|
body: params.input,
|
|
814
824
|
language,
|
|
815
825
|
responseType: params.responseType,
|
|
816
|
-
files: params.files
|
|
826
|
+
files: params.files,
|
|
827
|
+
baseUrl: params.baseUrl
|
|
817
828
|
});
|
|
818
829
|
break;
|
|
819
830
|
case "PATCH" /* PATCH */:
|
|
@@ -825,7 +836,8 @@ var ClientAbstractService = class {
|
|
|
825
836
|
overridesJsonApiCreation: params.overridesJsonApiCreation,
|
|
826
837
|
language,
|
|
827
838
|
responseType: params.responseType,
|
|
828
|
-
files: params.files
|
|
839
|
+
files: params.files,
|
|
840
|
+
baseUrl: params.baseUrl
|
|
829
841
|
});
|
|
830
842
|
break;
|
|
831
843
|
case "DELETE" /* DELETE */:
|
|
@@ -834,7 +846,8 @@ var ClientAbstractService = class {
|
|
|
834
846
|
endpoint: params.endpoint,
|
|
835
847
|
companyId: params.companyId,
|
|
836
848
|
language,
|
|
837
|
-
responseType: params.responseType
|
|
849
|
+
responseType: params.responseType,
|
|
850
|
+
baseUrl: params.baseUrl
|
|
838
851
|
});
|
|
839
852
|
break;
|
|
840
853
|
default:
|
|
@@ -848,6 +861,7 @@ var ClientAbstractService = class {
|
|
|
848
861
|
const error = new Error(`${apiResponse.response}:${apiResponse.error}`);
|
|
849
862
|
error.status = apiResponse.response;
|
|
850
863
|
error.digest = `HTTP_${apiResponse.response}`;
|
|
864
|
+
error.body = apiResponse.raw;
|
|
851
865
|
throw error;
|
|
852
866
|
}
|
|
853
867
|
}
|
|
@@ -876,6 +890,7 @@ var ClientAbstractService = class {
|
|
|
876
890
|
const error = new Error(`${apiResponse.response}:${apiResponse.error}`);
|
|
877
891
|
error.status = apiResponse.response;
|
|
878
892
|
error.digest = `HTTP_${apiResponse.response}`;
|
|
893
|
+
error.body = apiResponse.raw;
|
|
879
894
|
throw error;
|
|
880
895
|
}
|
|
881
896
|
}
|
|
@@ -903,7 +918,7 @@ var ModuleRegistrar = (_class2 = class {
|
|
|
903
918
|
}).map((key) => modulesClass[key]);
|
|
904
919
|
data.forEach((item) => {
|
|
905
920
|
if (item && item.model) {
|
|
906
|
-
|
|
921
|
+
_chunkEIOEYXY3js.DataClassRegistry.registerObjectClass(item, item.model);
|
|
907
922
|
}
|
|
908
923
|
});
|
|
909
924
|
this._isBootstrapped = true;
|
|
@@ -913,7 +928,7 @@ var ModuleRegistrar = (_class2 = class {
|
|
|
913
928
|
*/
|
|
914
929
|
static reset() {
|
|
915
930
|
this._isBootstrapped = false;
|
|
916
|
-
|
|
931
|
+
_chunkEIOEYXY3js.DataClassRegistry.clear();
|
|
917
932
|
}
|
|
918
933
|
}, _class2.__initStatic2(), _class2);
|
|
919
934
|
|
|
@@ -936,20 +951,20 @@ var ModuleRegistryClass = class {
|
|
|
936
951
|
get(name) {
|
|
937
952
|
let module = this._modules.get(name);
|
|
938
953
|
if (!module) {
|
|
939
|
-
const didBootstrap =
|
|
954
|
+
const didBootstrap = _chunkEIOEYXY3js.tryBootstrap.call(void 0, );
|
|
940
955
|
if (didBootstrap) {
|
|
941
956
|
module = this._modules.get(name);
|
|
942
957
|
}
|
|
943
958
|
}
|
|
944
959
|
if (!module) {
|
|
945
|
-
const hint =
|
|
960
|
+
const hint = _chunkEIOEYXY3js.hasBootstrapper.call(void 0, ) ? "Bootstrap was called but module still not found. Check module registration." : "No bootstrapper registered. Ensure configureJsonApi({ bootstrapper }) is called before accessing modules.";
|
|
946
961
|
throw new Error(`Module "${String(name)}" not registered. ${hint}`);
|
|
947
962
|
}
|
|
948
963
|
return module;
|
|
949
964
|
}
|
|
950
965
|
findByName(moduleName) {
|
|
951
966
|
if (this._modules.size === 0) {
|
|
952
|
-
|
|
967
|
+
_chunkEIOEYXY3js.tryBootstrap.call(void 0, );
|
|
953
968
|
}
|
|
954
969
|
for (const module of this._modules.values()) {
|
|
955
970
|
if (module.name === moduleName) {
|
|
@@ -960,7 +975,7 @@ var ModuleRegistryClass = class {
|
|
|
960
975
|
}
|
|
961
976
|
getAllPageUrls() {
|
|
962
977
|
if (this._modules.size === 0) {
|
|
963
|
-
|
|
978
|
+
_chunkEIOEYXY3js.tryBootstrap.call(void 0, );
|
|
964
979
|
}
|
|
965
980
|
const seen = /* @__PURE__ */ new Set();
|
|
966
981
|
const result = [];
|
|
@@ -977,7 +992,7 @@ var ModuleRegistryClass = class {
|
|
|
977
992
|
findByModelName(modelName) {
|
|
978
993
|
let module = this._modules.get(modelName);
|
|
979
994
|
if (!module) {
|
|
980
|
-
const didBootstrap =
|
|
995
|
+
const didBootstrap = _chunkEIOEYXY3js.tryBootstrap.call(void 0, );
|
|
981
996
|
if (didBootstrap) {
|
|
982
997
|
module = this._modules.get(modelName);
|
|
983
998
|
}
|
|
@@ -999,7 +1014,7 @@ var ModuleRegistryClass = class {
|
|
|
999
1014
|
}
|
|
1000
1015
|
getAll() {
|
|
1001
1016
|
if (this._modules.size === 0) {
|
|
1002
|
-
|
|
1017
|
+
_chunkEIOEYXY3js.tryBootstrap.call(void 0, );
|
|
1003
1018
|
}
|
|
1004
1019
|
return Array.from(this._modules.values());
|
|
1005
1020
|
}
|
|
@@ -2853,7 +2868,7 @@ var AuthService = class extends AbstractService {
|
|
|
2853
2868
|
}
|
|
2854
2869
|
static async login(params) {
|
|
2855
2870
|
const language = params.language || "en-US";
|
|
2856
|
-
const apiResponse = await
|
|
2871
|
+
const apiResponse = await _chunkEIOEYXY3js.JsonApiPost.call(void 0, {
|
|
2857
2872
|
classKey: Modules.Auth,
|
|
2858
2873
|
endpoint: new EndpointCreator({ endpoint: Modules.Auth, id: "login" }).generate(),
|
|
2859
2874
|
body: { email: params.email, password: params.password },
|
|
@@ -2887,7 +2902,7 @@ var AuthService = class extends AbstractService {
|
|
|
2887
2902
|
}
|
|
2888
2903
|
static async logout(params) {
|
|
2889
2904
|
const language = _optionalChain([params, 'optionalAccess', _70 => _70.language]) || "en-US";
|
|
2890
|
-
await
|
|
2905
|
+
await _chunkEIOEYXY3js.JsonApiDelete.call(void 0, {
|
|
2891
2906
|
classKey: Modules.Auth,
|
|
2892
2907
|
endpoint: new EndpointCreator({ endpoint: Modules.Auth }).generate(),
|
|
2893
2908
|
language
|
|
@@ -2899,7 +2914,7 @@ var AuthService = class extends AbstractService {
|
|
|
2899
2914
|
}
|
|
2900
2915
|
static async initialiseForgotPassword(params) {
|
|
2901
2916
|
const language = params.language || "en-US";
|
|
2902
|
-
const response = await
|
|
2917
|
+
const response = await _chunkEIOEYXY3js.JsonApiPost.call(void 0, {
|
|
2903
2918
|
classKey: Modules.Auth,
|
|
2904
2919
|
endpoint: new EndpointCreator({ endpoint: Modules.Auth, id: "forgot" }).generate(),
|
|
2905
2920
|
body: { email: params.email },
|
|
@@ -2928,7 +2943,7 @@ var AuthService = class extends AbstractService {
|
|
|
2928
2943
|
}
|
|
2929
2944
|
static async validateCode(params) {
|
|
2930
2945
|
const language = params.language || "en-US";
|
|
2931
|
-
const apiResponse = await
|
|
2946
|
+
const apiResponse = await _chunkEIOEYXY3js.JsonApiGet.call(void 0, {
|
|
2932
2947
|
classKey: Modules.Auth,
|
|
2933
2948
|
endpoint: new EndpointCreator({ endpoint: Modules.Auth, id: "validate", childEndpoint: params.code }).generate(),
|
|
2934
2949
|
language
|
|
@@ -2972,7 +2987,7 @@ var AuthService = class extends AbstractService {
|
|
|
2972
2987
|
}
|
|
2973
2988
|
static async completeOAuthRegistration(params) {
|
|
2974
2989
|
const endpoint = new EndpointCreator({ endpoint: Modules.Auth, id: "oauth", childEndpoint: "complete" });
|
|
2975
|
-
const response = await
|
|
2990
|
+
const response = await _chunkEIOEYXY3js.JsonApiPost.call(void 0, {
|
|
2976
2991
|
classKey: Modules.Auth,
|
|
2977
2992
|
endpoint: endpoint.generate(),
|
|
2978
2993
|
body: params,
|
|
@@ -4735,7 +4750,7 @@ var StripePromotionCodeService = class {
|
|
|
4735
4750
|
* @returns Validation result with discount details if valid
|
|
4736
4751
|
*/
|
|
4737
4752
|
static async validatePromotionCode(params) {
|
|
4738
|
-
const response = await
|
|
4753
|
+
const response = await _chunkEIOEYXY3js.JsonApiPost.call(void 0, {
|
|
4739
4754
|
classKey: Modules.StripePromotionCode,
|
|
4740
4755
|
endpoint: `${STRIPE_PROMOTION_CODE_ENDPOINT}/validate`,
|
|
4741
4756
|
body: {
|
|
@@ -7830,5 +7845,6 @@ var AuditLogModule = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (facto
|
|
|
7830
7845
|
|
|
7831
7846
|
|
|
7832
7847
|
|
|
7833
|
-
|
|
7834
|
-
|
|
7848
|
+
|
|
7849
|
+
exports.RehydrationFactory = RehydrationFactory; exports.AbstractApiData = AbstractApiData; exports.HttpMethod = HttpMethod; exports.getLastApiTotal = getLastApiTotal; exports.clearLastApiTotal = clearLastApiTotal; exports.setGlobalErrorHandler = setGlobalErrorHandler; exports.getGlobalErrorHandler = getGlobalErrorHandler; exports.AbstractService = AbstractService; exports.configureClientJsonApi = configureClientJsonApi; exports.getClientApiUrl = getClientApiUrl; exports.getClientAppUrl = getClientAppUrl; exports.getClientTrackablePages = getClientTrackablePages; exports.buildClientUrl = buildClientUrl; exports.ClientJsonApiGet = ClientJsonApiGet; exports.ClientJsonApiPost = ClientJsonApiPost; exports.ClientJsonApiPut = ClientJsonApiPut; exports.ClientJsonApiPatch = ClientJsonApiPatch; exports.ClientJsonApiDelete = ClientJsonApiDelete; exports.ClientHttpMethod = ClientHttpMethod; exports.setClientGlobalErrorHandler = setClientGlobalErrorHandler; exports.getClientGlobalErrorHandler = getClientGlobalErrorHandler; exports.ClientAbstractService = ClientAbstractService; exports.ModuleRegistrar = ModuleRegistrar; exports.ModuleRegistry = ModuleRegistry; exports.Modules = Modules; exports.EndpointCreator = EndpointCreator; exports.createJsonApiInclusion = createJsonApiInclusion; exports.rehydrate = rehydrate; exports.rehydrateList = rehydrateList; exports.cn = cn; exports.composeRefs = composeRefs; exports.useComposedRefs = useComposedRefs; exports.useIsMobile = useIsMobile; exports.formatLocalDate = formatLocalDate; exports.formatDate = formatDate; exports.exists = exists; exports.TableOptions = TableOptions; exports.getTableOptions = getTableOptions; exports.getTableComponents = getTableComponents; exports.userObjectSchema = userObjectSchema; exports.entityObjectSchema = entityObjectSchema; exports.getInitials = getInitials; exports.BlockNoteDiffUtil = BlockNoteDiffUtil; exports.BlockNoteWordDiffRendererUtil = BlockNoteWordDiffRendererUtil; exports.getIconByModule = getIconByModule; exports.getIcon = getIcon; exports.getIconByModuleName = getIconByModuleName; exports.getLucideIcon = getLucideIcon; exports.getLucideIconByModule = getLucideIconByModule; exports.getLucideIconByModuleName = getLucideIconByModuleName; exports.showToast = showToast; exports.showError = showError; exports.dismissToast = dismissToast; exports.showCustomToast = showCustomToast; exports.Action = Action; exports.checkPermissions = checkPermissions; exports.checkPermissionsFromServer = checkPermissionsFromServer; exports.getValueFromPath = getValueFromPath; exports.TotpAuthenticator = TotpAuthenticator; exports.TotpAuthenticatorModule = TotpAuthenticatorModule; exports.TotpSetup = TotpSetup; exports.TotpSetupModule = TotpSetupModule; exports.TotpVerify = TotpVerify; exports.TotpVerifyModule = TotpVerifyModule; exports.TotpVerifyLogin = TotpVerifyLogin; exports.TotpVerifyLoginModule = TotpVerifyLoginModule; exports.Passkey = Passkey; exports.PasskeyModule = PasskeyModule; exports.PasskeyRegistrationOptions = PasskeyRegistrationOptions; exports.PasskeyRegistrationOptionsModule = PasskeyRegistrationOptionsModule; exports.PasskeyRegistrationVerify = PasskeyRegistrationVerify; exports.PasskeyRegistrationVerifyModule = PasskeyRegistrationVerifyModule; exports.PasskeyRename = PasskeyRename; exports.PasskeyRenameModule = PasskeyRenameModule; exports.PasskeyVerifyLogin = PasskeyVerifyLogin; exports.PasskeyVerifyLoginModule = PasskeyVerifyLoginModule; exports.PasskeyAuthenticationOptions = PasskeyAuthenticationOptions; exports.PasskeyAuthenticationOptionsModule = PasskeyAuthenticationOptionsModule; exports.TwoFactorEnable = TwoFactorEnable; exports.TwoFactorEnableModule = TwoFactorEnableModule; exports.TwoFactorChallenge = TwoFactorChallenge; exports.TwoFactorChallengeModule = TwoFactorChallengeModule; exports.BackupCodeVerify = BackupCodeVerify; exports.BackupCodeVerifyModule = BackupCodeVerifyModule; exports.configureAuth = configureAuth; exports.getTokenHandler = getTokenHandler; exports.Auth = Auth; exports.AuthService = AuthService; exports.TwoFactorStatus = TwoFactorStatus; exports.TwoFactorService = TwoFactorService; exports.AuthComponent = AuthComponent; exports.AuthModule = AuthModule; exports.TwoFactorStatusModule = TwoFactorStatusModule; exports.BillingService = BillingService; exports.Billing = Billing; exports.BillingModule = BillingModule; exports.PaymentMethod = PaymentMethod; exports.StripeCustomer = StripeCustomer; exports.StripeCustomerService = StripeCustomerService; exports.StripeCustomerModule = StripeCustomerModule; exports.StripePaymentMethodModule = StripePaymentMethodModule; exports.StripeInvoice = StripeInvoice; exports.InvoiceStatus = InvoiceStatus; exports.StripeInvoiceService = StripeInvoiceService; exports.StripeInvoiceModule = StripeInvoiceModule; exports.StripePrice = StripePrice; exports.StripePriceService = StripePriceService; exports.StripePriceModule = StripePriceModule; exports.StripeProduct = StripeProduct; exports.StripeProductService = StripeProductService; exports.StripeProductModule = StripeProductModule; exports.StripeSubscription = StripeSubscription; exports.SubscriptionStatus = SubscriptionStatus; exports.StripeSubscriptionService = StripeSubscriptionService; exports.StripeSubscriptionModule = StripeSubscriptionModule; exports.StripeUsage = StripeUsage; exports.StripeUsageService = StripeUsageService; exports.StripeUsageModule = StripeUsageModule; exports.StripePromotionCodeService = StripePromotionCodeService; exports.StripePromotionCode = StripePromotionCode; exports.StripePromotionCodeModule = StripePromotionCodeModule; exports.Company = Company; exports.CompanyFields = CompanyFields; exports.CompanyService = CompanyService; exports.CompanyModule = CompanyModule; exports.Content = Content; exports.ContentFields = ContentFields; exports.ContentService = ContentService; exports.ContentModule = ContentModule; exports.HowTo = HowTo; exports.HowToModule = HowToModule; exports.HowToFields = HowToFields; exports.HowToService = HowToService; exports.Assistant = Assistant; exports.AssistantModule = AssistantModule; exports.AssistantMessage = AssistantMessage; exports.AssistantService = AssistantService; exports.AssistantMessageModule = AssistantMessageModule; exports.AssistantMessageService = AssistantMessageService; exports.Chunk = Chunk; exports.ChunkModule = ChunkModule; exports.Feature = Feature; exports.FeatureService = FeatureService; exports.FeatureModule = FeatureModule; exports.Module = Module; exports.ModuleModule = ModuleModule; exports.Notification = Notification; exports.NotificationFields = NotificationFields; exports.NotificationService = NotificationService; exports.NotificationModule = NotificationModule; exports.Push = Push; exports.PushService = PushService; exports.PushModule = PushModule; exports.Role = Role; exports.RoleFields = RoleFields; exports.RoleService = RoleService; exports.RoleModule = RoleModule; exports.S3 = S3; exports.S3Module = S3Module; exports.S3Service = S3Service; exports.User = User; exports.UserFields = UserFields; exports.UserService = UserService; exports.AuthorModule = AuthorModule; exports.UserModule = UserModule; exports.OAuthClient = OAuthClient; exports.OAuthModule = OAuthModule; exports.OAuthService = OAuthService; exports.OAUTH_SCOPE_DISPLAY = OAUTH_SCOPE_DISPLAY; exports.AVAILABLE_OAUTH_SCOPES = AVAILABLE_OAUTH_SCOPES; exports.DEFAULT_GRANT_TYPES = DEFAULT_GRANT_TYPES; exports.Waitlist = Waitlist; exports.WaitlistService = WaitlistService; exports.WaitlistStats = WaitlistStats; exports.WaitlistModule = WaitlistModule; exports.WaitlistStatsModule = WaitlistStatsModule; exports.PermissionMapping = PermissionMapping; exports.ModulePaths = ModulePaths; exports.RbacMatrixModel = RbacMatrixModel; exports.PermissionMappingModule = PermissionMappingModule; exports.ModulePathsModule = ModulePathsModule; exports.RbacMatrixModule = RbacMatrixModule; exports.ReferralStats = ReferralStats; exports.ReferralService = ReferralService; exports.ReferralModule = ReferralModule; exports.ReferralStatsModule = ReferralStatsModule; exports.AuditLog = AuditLog; exports.AuditLogService = AuditLogService; exports.AuditLogModule = AuditLogModule;
|
|
7850
|
+
//# sourceMappingURL=chunk-YCMYYYBP.js.map
|