@warmhub/sdk-ts 0.134.0 → 0.136.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/CHANGELOG.md +8 -0
- package/changelog.json +10 -0
- package/dist/checkpoint.js +1 -1
- package/dist/chunk-7T6CND6V.js +10 -0
- package/dist/chunk-7T6CND6V.js.map +1 -0
- package/dist/{chunk-LUVEYT45.js → chunk-SRE4N5LD.js} +15 -15
- package/dist/chunk-SRE4N5LD.js.map +1 -0
- package/dist/index.d.ts +189 -1
- package/dist/index.js +1 -1
- package/dist/react.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-GUV5WOJK.js +0 -10
- package/dist/chunk-GUV5WOJK.js.map +0 -1
- package/dist/chunk-LUVEYT45.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -216,6 +216,14 @@ type CommitRealOperationResult$1 = {
|
|
|
216
216
|
} | {
|
|
217
217
|
reason: 'dependency_failed';
|
|
218
218
|
producerOpIndexes: Array<number>;
|
|
219
|
+
} | {
|
|
220
|
+
reason: 'name_taken';
|
|
221
|
+
name: string;
|
|
222
|
+
takenBy?: {
|
|
223
|
+
shape: string;
|
|
224
|
+
durableId: string;
|
|
225
|
+
};
|
|
226
|
+
suggestedName?: string;
|
|
219
227
|
} | {
|
|
220
228
|
reason: 'invalid_token';
|
|
221
229
|
};
|
|
@@ -250,6 +258,14 @@ type CommitDiagnostic$1 = {
|
|
|
250
258
|
} | {
|
|
251
259
|
reason: 'dependency_failed';
|
|
252
260
|
producerOpIndexes: Array<number>;
|
|
261
|
+
} | {
|
|
262
|
+
reason: 'name_taken';
|
|
263
|
+
name: string;
|
|
264
|
+
takenBy?: {
|
|
265
|
+
shape: string;
|
|
266
|
+
durableId: string;
|
|
267
|
+
};
|
|
268
|
+
suggestedName?: string;
|
|
253
269
|
} | {
|
|
254
270
|
reason: 'invalid_token';
|
|
255
271
|
};
|
|
@@ -504,6 +520,14 @@ type CommitValidateResult$1 = {
|
|
|
504
520
|
} | {
|
|
505
521
|
reason: 'dependency_failed';
|
|
506
522
|
producerOpIndexes: Array<number>;
|
|
523
|
+
} | {
|
|
524
|
+
reason: 'name_taken';
|
|
525
|
+
name: string;
|
|
526
|
+
takenBy?: {
|
|
527
|
+
shape: string;
|
|
528
|
+
durableId: string;
|
|
529
|
+
};
|
|
530
|
+
suggestedName?: string;
|
|
507
531
|
} | {
|
|
508
532
|
reason: 'invalid_token';
|
|
509
533
|
};
|
|
@@ -605,6 +629,14 @@ type CommitValidateResult$1 = {
|
|
|
605
629
|
} | {
|
|
606
630
|
reason: 'dependency_failed';
|
|
607
631
|
producerOpIndexes: Array<number>;
|
|
632
|
+
} | {
|
|
633
|
+
reason: 'name_taken';
|
|
634
|
+
name: string;
|
|
635
|
+
takenBy?: {
|
|
636
|
+
shape: string;
|
|
637
|
+
durableId: string;
|
|
638
|
+
};
|
|
639
|
+
suggestedName?: string;
|
|
608
640
|
} | {
|
|
609
641
|
reason: 'invalid_token';
|
|
610
642
|
};
|
|
@@ -705,6 +737,14 @@ type CommitValidateResult$1 = {
|
|
|
705
737
|
} | {
|
|
706
738
|
reason: 'dependency_failed';
|
|
707
739
|
producerOpIndexes: Array<number>;
|
|
740
|
+
} | {
|
|
741
|
+
reason: 'name_taken';
|
|
742
|
+
name: string;
|
|
743
|
+
takenBy?: {
|
|
744
|
+
shape: string;
|
|
745
|
+
durableId: string;
|
|
746
|
+
};
|
|
747
|
+
suggestedName?: string;
|
|
708
748
|
} | {
|
|
709
749
|
reason: 'invalid_token';
|
|
710
750
|
};
|
|
@@ -969,6 +1009,14 @@ type OperationEventReceipt$1 = {
|
|
|
969
1009
|
} | {
|
|
970
1010
|
reason: 'dependency_failed';
|
|
971
1011
|
producerOpIndexes: Array<number>;
|
|
1012
|
+
} | {
|
|
1013
|
+
reason: 'name_taken';
|
|
1014
|
+
name: string;
|
|
1015
|
+
takenBy?: {
|
|
1016
|
+
shape: string;
|
|
1017
|
+
durableId: string;
|
|
1018
|
+
};
|
|
1019
|
+
suggestedName?: string;
|
|
972
1020
|
} | {
|
|
973
1021
|
reason: 'invalid_token';
|
|
974
1022
|
};
|
|
@@ -1464,6 +1512,14 @@ type ComponentInstallResult$1 = {
|
|
|
1464
1512
|
} | {
|
|
1465
1513
|
reason: 'dependency_failed';
|
|
1466
1514
|
producerOpIndexes: Array<number>;
|
|
1515
|
+
} | {
|
|
1516
|
+
reason: 'name_taken';
|
|
1517
|
+
name: string;
|
|
1518
|
+
takenBy?: {
|
|
1519
|
+
shape: string;
|
|
1520
|
+
durableId: string;
|
|
1521
|
+
};
|
|
1522
|
+
suggestedName?: string;
|
|
1467
1523
|
} | {
|
|
1468
1524
|
reason: 'invalid_token';
|
|
1469
1525
|
};
|
|
@@ -1742,6 +1798,14 @@ type ComponentUninstallResult$1 = {
|
|
|
1742
1798
|
} | {
|
|
1743
1799
|
reason: 'dependency_failed';
|
|
1744
1800
|
producerOpIndexes: Array<number>;
|
|
1801
|
+
} | {
|
|
1802
|
+
reason: 'name_taken';
|
|
1803
|
+
name: string;
|
|
1804
|
+
takenBy?: {
|
|
1805
|
+
shape: string;
|
|
1806
|
+
durableId: string;
|
|
1807
|
+
};
|
|
1808
|
+
suggestedName?: string;
|
|
1745
1809
|
} | {
|
|
1746
1810
|
reason: 'invalid_token';
|
|
1747
1811
|
};
|
|
@@ -2453,6 +2517,14 @@ type StreamAppendResult$1 = {
|
|
|
2453
2517
|
} | {
|
|
2454
2518
|
reason: 'dependency_failed';
|
|
2455
2519
|
producerOpIndexes: Array<number>;
|
|
2520
|
+
} | {
|
|
2521
|
+
reason: 'name_taken';
|
|
2522
|
+
name: string;
|
|
2523
|
+
takenBy?: {
|
|
2524
|
+
shape: string;
|
|
2525
|
+
durableId: string;
|
|
2526
|
+
};
|
|
2527
|
+
suggestedName?: string;
|
|
2456
2528
|
} | {
|
|
2457
2529
|
reason: 'invalid_token';
|
|
2458
2530
|
};
|
|
@@ -2565,6 +2637,14 @@ type StreamAppendResult$1 = {
|
|
|
2565
2637
|
} | {
|
|
2566
2638
|
reason: 'dependency_failed';
|
|
2567
2639
|
producerOpIndexes: Array<number>;
|
|
2640
|
+
} | {
|
|
2641
|
+
reason: 'name_taken';
|
|
2642
|
+
name: string;
|
|
2643
|
+
takenBy?: {
|
|
2644
|
+
shape: string;
|
|
2645
|
+
durableId: string;
|
|
2646
|
+
};
|
|
2647
|
+
suggestedName?: string;
|
|
2568
2648
|
} | {
|
|
2569
2649
|
reason: 'invalid_token';
|
|
2570
2650
|
};
|
|
@@ -2706,6 +2786,14 @@ type StreamAppendResult$1 = {
|
|
|
2706
2786
|
} | {
|
|
2707
2787
|
reason: 'dependency_failed';
|
|
2708
2788
|
producerOpIndexes: Array<number>;
|
|
2789
|
+
} | {
|
|
2790
|
+
reason: 'name_taken';
|
|
2791
|
+
name: string;
|
|
2792
|
+
takenBy?: {
|
|
2793
|
+
shape: string;
|
|
2794
|
+
durableId: string;
|
|
2795
|
+
};
|
|
2796
|
+
suggestedName?: string;
|
|
2709
2797
|
} | {
|
|
2710
2798
|
reason: 'invalid_token';
|
|
2711
2799
|
};
|
|
@@ -2884,6 +2972,14 @@ type StreamingSubmissionRow$1 = {
|
|
|
2884
2972
|
} | {
|
|
2885
2973
|
reason: 'dependency_failed';
|
|
2886
2974
|
producerOpIndexes: Array<number>;
|
|
2975
|
+
} | {
|
|
2976
|
+
reason: 'name_taken';
|
|
2977
|
+
name: string;
|
|
2978
|
+
takenBy?: {
|
|
2979
|
+
shape: string;
|
|
2980
|
+
durableId: string;
|
|
2981
|
+
};
|
|
2982
|
+
suggestedName?: string;
|
|
2887
2983
|
} | {
|
|
2888
2984
|
reason: 'invalid_token';
|
|
2889
2985
|
};
|
|
@@ -3225,6 +3321,14 @@ type CommitApplyCompatibilityResult$1 = {
|
|
|
3225
3321
|
} | {
|
|
3226
3322
|
reason: 'dependency_failed';
|
|
3227
3323
|
producerOpIndexes: Array<number>;
|
|
3324
|
+
} | {
|
|
3325
|
+
reason: 'name_taken';
|
|
3326
|
+
name: string;
|
|
3327
|
+
takenBy?: {
|
|
3328
|
+
shape: string;
|
|
3329
|
+
durableId: string;
|
|
3330
|
+
};
|
|
3331
|
+
suggestedName?: string;
|
|
3228
3332
|
} | {
|
|
3229
3333
|
reason: 'invalid_token';
|
|
3230
3334
|
};
|
|
@@ -3341,6 +3445,14 @@ type CommitApplyCompatibilityResult$1 = {
|
|
|
3341
3445
|
} | {
|
|
3342
3446
|
reason: 'dependency_failed';
|
|
3343
3447
|
producerOpIndexes: Array<number>;
|
|
3448
|
+
} | {
|
|
3449
|
+
reason: 'name_taken';
|
|
3450
|
+
name: string;
|
|
3451
|
+
takenBy?: {
|
|
3452
|
+
shape: string;
|
|
3453
|
+
durableId: string;
|
|
3454
|
+
};
|
|
3455
|
+
suggestedName?: string;
|
|
3344
3456
|
} | {
|
|
3345
3457
|
reason: 'invalid_token';
|
|
3346
3458
|
};
|
|
@@ -3719,6 +3831,14 @@ type CollectionMutationCompatibilityResult = {
|
|
|
3719
3831
|
} | {
|
|
3720
3832
|
reason: 'dependency_failed';
|
|
3721
3833
|
producerOpIndexes: Array<number>;
|
|
3834
|
+
} | {
|
|
3835
|
+
reason: 'name_taken';
|
|
3836
|
+
name: string;
|
|
3837
|
+
takenBy?: {
|
|
3838
|
+
shape: string;
|
|
3839
|
+
durableId: string;
|
|
3840
|
+
};
|
|
3841
|
+
suggestedName?: string;
|
|
3722
3842
|
} | {
|
|
3723
3843
|
reason: 'invalid_token';
|
|
3724
3844
|
};
|
|
@@ -3868,6 +3988,14 @@ type CollectionMutationCompatibilityResult = {
|
|
|
3868
3988
|
} | {
|
|
3869
3989
|
reason: 'dependency_failed';
|
|
3870
3990
|
producerOpIndexes: Array<number>;
|
|
3991
|
+
} | {
|
|
3992
|
+
reason: 'name_taken';
|
|
3993
|
+
name: string;
|
|
3994
|
+
takenBy?: {
|
|
3995
|
+
shape: string;
|
|
3996
|
+
durableId: string;
|
|
3997
|
+
};
|
|
3998
|
+
suggestedName?: string;
|
|
3871
3999
|
} | {
|
|
3872
4000
|
reason: 'invalid_token';
|
|
3873
4001
|
};
|
|
@@ -4218,6 +4346,14 @@ type RenameCompatibilityResult = {
|
|
|
4218
4346
|
} | {
|
|
4219
4347
|
reason: 'dependency_failed';
|
|
4220
4348
|
producerOpIndexes: Array<number>;
|
|
4349
|
+
} | {
|
|
4350
|
+
reason: 'name_taken';
|
|
4351
|
+
name: string;
|
|
4352
|
+
takenBy?: {
|
|
4353
|
+
shape: string;
|
|
4354
|
+
durableId: string;
|
|
4355
|
+
};
|
|
4356
|
+
suggestedName?: string;
|
|
4221
4357
|
} | {
|
|
4222
4358
|
reason: 'invalid_token';
|
|
4223
4359
|
};
|
|
@@ -4339,6 +4475,14 @@ type RenameCompatibilityResult = {
|
|
|
4339
4475
|
} | {
|
|
4340
4476
|
reason: 'dependency_failed';
|
|
4341
4477
|
producerOpIndexes: Array<number>;
|
|
4478
|
+
} | {
|
|
4479
|
+
reason: 'name_taken';
|
|
4480
|
+
name: string;
|
|
4481
|
+
takenBy?: {
|
|
4482
|
+
shape: string;
|
|
4483
|
+
durableId: string;
|
|
4484
|
+
};
|
|
4485
|
+
suggestedName?: string;
|
|
4342
4486
|
} | {
|
|
4343
4487
|
reason: 'invalid_token';
|
|
4344
4488
|
};
|
|
@@ -4692,6 +4836,14 @@ type ShapeChangeCompatibilityResult = {
|
|
|
4692
4836
|
} | {
|
|
4693
4837
|
reason: 'dependency_failed';
|
|
4694
4838
|
producerOpIndexes: Array<number>;
|
|
4839
|
+
} | {
|
|
4840
|
+
reason: 'name_taken';
|
|
4841
|
+
name: string;
|
|
4842
|
+
takenBy?: {
|
|
4843
|
+
shape: string;
|
|
4844
|
+
durableId: string;
|
|
4845
|
+
};
|
|
4846
|
+
suggestedName?: string;
|
|
4695
4847
|
} | {
|
|
4696
4848
|
reason: 'invalid_token';
|
|
4697
4849
|
};
|
|
@@ -4816,6 +4968,14 @@ type ShapeChangeCompatibilityResult = {
|
|
|
4816
4968
|
} | {
|
|
4817
4969
|
reason: 'dependency_failed';
|
|
4818
4970
|
producerOpIndexes: Array<number>;
|
|
4971
|
+
} | {
|
|
4972
|
+
reason: 'name_taken';
|
|
4973
|
+
name: string;
|
|
4974
|
+
takenBy?: {
|
|
4975
|
+
shape: string;
|
|
4976
|
+
durableId: string;
|
|
4977
|
+
};
|
|
4978
|
+
suggestedName?: string;
|
|
4819
4979
|
} | {
|
|
4820
4980
|
reason: 'invalid_token';
|
|
4821
4981
|
};
|
|
@@ -5170,6 +5330,14 @@ type ShapeRemoveCompatibilityResult = {
|
|
|
5170
5330
|
} | {
|
|
5171
5331
|
reason: 'dependency_failed';
|
|
5172
5332
|
producerOpIndexes: Array<number>;
|
|
5333
|
+
} | {
|
|
5334
|
+
reason: 'name_taken';
|
|
5335
|
+
name: string;
|
|
5336
|
+
takenBy?: {
|
|
5337
|
+
shape: string;
|
|
5338
|
+
durableId: string;
|
|
5339
|
+
};
|
|
5340
|
+
suggestedName?: string;
|
|
5173
5341
|
} | {
|
|
5174
5342
|
reason: 'invalid_token';
|
|
5175
5343
|
};
|
|
@@ -5295,6 +5463,14 @@ type ShapeRemoveCompatibilityResult = {
|
|
|
5295
5463
|
} | {
|
|
5296
5464
|
reason: 'dependency_failed';
|
|
5297
5465
|
producerOpIndexes: Array<number>;
|
|
5466
|
+
} | {
|
|
5467
|
+
reason: 'name_taken';
|
|
5468
|
+
name: string;
|
|
5469
|
+
takenBy?: {
|
|
5470
|
+
shape: string;
|
|
5471
|
+
durableId: string;
|
|
5472
|
+
};
|
|
5473
|
+
suggestedName?: string;
|
|
5298
5474
|
} | {
|
|
5299
5475
|
reason: 'invalid_token';
|
|
5300
5476
|
};
|
|
@@ -5361,6 +5537,10 @@ type ShapeGetResult = {
|
|
|
5361
5537
|
dataHash: string;
|
|
5362
5538
|
} | null;
|
|
5363
5539
|
componentRef?: string;
|
|
5540
|
+
composition?: Array<{
|
|
5541
|
+
wref: string;
|
|
5542
|
+
fields: Record<string, unknown>;
|
|
5543
|
+
}>;
|
|
5364
5544
|
};
|
|
5365
5545
|
type ShapeListResult = {
|
|
5366
5546
|
items: Array<{
|
|
@@ -6963,7 +7143,11 @@ declare class PartialStreamSubmissionError extends Error {
|
|
|
6963
7143
|
* @see https://docs.warmhub.ai/sdk-reference/classes/allstreamoperationsfailederror/
|
|
6964
7144
|
*/
|
|
6965
7145
|
declare class AllStreamOperationsFailedError extends Error {
|
|
6966
|
-
|
|
7146
|
+
/**
|
|
7147
|
+
* Shared inner code when every failure agrees; aggregate code otherwise.
|
|
7148
|
+
* @see https://docs.warmhub.ai/sdk-reference/classes/allstreamoperationsfailederror/#code
|
|
7149
|
+
*/
|
|
7150
|
+
readonly code: string;
|
|
6967
7151
|
/**
|
|
6968
7152
|
* Every exact immutable receipt returned for the rejected submission.
|
|
6969
7153
|
* @see https://docs.warmhub.ai/sdk-reference/classes/allstreamoperationsfailederror/#receipts
|
|
@@ -8301,6 +8485,8 @@ type ShapeListOptions = {
|
|
|
8301
8485
|
/** @internal */
|
|
8302
8486
|
type ShapeGetOptions = {
|
|
8303
8487
|
includeRetracted?: boolean;
|
|
8488
|
+
/** Return the frozen composed Shape versions and their fields. */
|
|
8489
|
+
includeComposition?: boolean;
|
|
8304
8490
|
};
|
|
8305
8491
|
/** @internal */
|
|
8306
8492
|
type ShapeCreateOptions = {
|
|
@@ -9467,6 +9653,8 @@ declare function isWarmHubError(error: unknown): error is WarmHubError;
|
|
|
9467
9653
|
* retry with backoff and surface the message if it persists.
|
|
9468
9654
|
* - `RATE_LIMITED` — caller exceeded the budget; retry after the
|
|
9469
9655
|
* {@link WarmHubError.retryAfter} interval.
|
|
9656
|
+
* A completed {@link AllStreamOperationsFailedError} returns `false` even
|
|
9657
|
+
* when its shared operation code is `RATE_LIMITED`.
|
|
9470
9658
|
*
|
|
9471
9659
|
* All other kinds — including backend pass-through domain codes such as
|
|
9472
9660
|
* `SHAPE_MISMATCH` or `WREF_UNRESOLVABLE` — return `false`. This is a
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{t as AllStreamOperationsFailedError,A as CliCallVerificationError,E as DEFAULT_API_URL,q as DEFAULT_STREAM_CHUNK_SIZE,b as MAX_COMMIT_VALIDATION_ENCODED_BYTES,a as MAX_COMMIT_VALIDATION_OPERATIONS,r as MAX_STREAM_APPEND_OPERATION_COUNT,C as OperationBuilder,s as PartialStreamSubmissionError,i as RepositoryExportError,j as RepositoryExportSession,z as SDK_VERSION,n as StreamSubmissionAggregator,y as StreamingSubmissionOutcomeUnknownError,O as WarmHubClient,H as WarmHubError,h as applyRepositoryExportDelta,f as collectDurableTokens,e as commitValidateRequestBodyBytes,M as connectionErrorMessage,v as countStreamAppendResultStatuses,c as createCommitValidateInput,p as createOperationEventRequestId,o as createOperationEventSubmissionId,k as createRepositoryExportSession,d as encodeCommitValidateRequestBody,g as getResponseDecorations,L as isConnectionError,w as isDefiniteStreamAppendRejection,K as isRetryable,J as isWarmHubError,D as normalizeWref,l as readRepositoryExportStream,F as resolveFunctionLogMode,m as restoreRepositoryExportSession,G as sanitizeErrorMessage,N as sdkVersionIsBelowMinimum,u as streamAppendResultStatus,x as submitOperationsViaStream,I as toWarmHubError,B as verifyCliCall}from'./chunk-
|
|
1
|
+
export{t as AllStreamOperationsFailedError,A as CliCallVerificationError,E as DEFAULT_API_URL,q as DEFAULT_STREAM_CHUNK_SIZE,b as MAX_COMMIT_VALIDATION_ENCODED_BYTES,a as MAX_COMMIT_VALIDATION_OPERATIONS,r as MAX_STREAM_APPEND_OPERATION_COUNT,C as OperationBuilder,s as PartialStreamSubmissionError,i as RepositoryExportError,j as RepositoryExportSession,z as SDK_VERSION,n as StreamSubmissionAggregator,y as StreamingSubmissionOutcomeUnknownError,O as WarmHubClient,H as WarmHubError,h as applyRepositoryExportDelta,f as collectDurableTokens,e as commitValidateRequestBodyBytes,M as connectionErrorMessage,v as countStreamAppendResultStatuses,c as createCommitValidateInput,p as createOperationEventRequestId,o as createOperationEventSubmissionId,k as createRepositoryExportSession,d as encodeCommitValidateRequestBody,g as getResponseDecorations,L as isConnectionError,w as isDefiniteStreamAppendRejection,K as isRetryable,J as isWarmHubError,D as normalizeWref,l as readRepositoryExportStream,F as resolveFunctionLogMode,m as restoreRepositoryExportSession,G as sanitizeErrorMessage,N as sdkVersionIsBelowMinimum,u as streamAppendResultStatus,x as submitOperationsViaStream,I as toWarmHubError,B as verifyCliCall}from'./chunk-7T6CND6V.js';export{v as CLI_INSTALL_REPO_HEADER,w as CLI_SIGNATURE_HEADER,x as CLI_TIMESTAMP_HEADER,f as CONTENT_FIELD_LIMIT_ERROR,e as MAX_CONTENT_FIELD_BYTES,q as MAX_WREFS_PER_THING_VERSION,E as ORG_AUTH_SCOPES,A as REPO_AUTH_SCOPES,g as contentFieldLimitError,F as isKnownOrgAuthScope,B as isKnownRepoAuthScope,G as operationEventStreamRequestId,ba as validateAgainstShape}from'./chunk-SRE4N5LD.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/react.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {O}from'./chunk-
|
|
1
|
+
import {O}from'./chunk-7T6CND6V.js';export{E as DEFAULT_API_URL,z as SDK_VERSION,O as WarmHubClient,H as WarmHubError,I as toWarmHubError}from'./chunk-7T6CND6V.js';import'./chunk-SRE4N5LD.js';import {createContext,useMemo,useState,useEffect,useContext}from'react';import {jsx}from'react/jsx-runtime';var p=createContext(null),f=createContext({isAuthenticated:false,isLoading:true});function P({apiUrl:e,children:t,auth:o,client:s,decorateResponses:r}){let n=s?.name,u=s?.version,i=o.getAccessToken,a=useMemo(()=>new O({apiUrl:e,accessToken:async()=>await i()??void 0,client:{name:n,version:u},decorateResponses:r}),[e,n,u,r,i]);return jsx(p.Provider,{value:a,children:jsx(g,{auth:o,client:a,children:t})})}function g({auth:e,client:t,children:o}){let[s,r]=useState(null),n=e.isAuthenticated&&s===t;useEffect(()=>{if(!e.isAuthenticated){r(null);return}let i=false;return t.auth.sync().then(()=>{i||r(t);}).catch(a=>{console.error("auth.sync failed:",a),i||r(t);}),()=>{i=true;}},[e.isAuthenticated,t]);let u=useMemo(()=>({isAuthenticated:e.isAuthenticated&&n,isLoading:e.isLoading||e.isAuthenticated&&!n}),[e.isAuthenticated,e.isLoading,n]);return e.isLoading||e.isAuthenticated&&!n?null:jsx(f.Provider,{value:u,children:o})}function v(){let e=useContext(p);if(!e)throw new Error("useWarmHubClient must be used within a WarmHubProvider");return e}function S(){return useContext(f)}export{P as WarmHubProvider,S as useWarmHubAuth,v as useWarmHubClient};//# sourceMappingURL=react.js.map
|
|
2
2
|
//# sourceMappingURL=react.js.map
|
package/package.json
CHANGED