@forgecart/sdk 1.0.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/admin-namespace.d.ts +168 -1
- package/dist/admin-namespace.js +442 -9
- package/dist/admin-types.d.ts +433 -4
- package/dist/admin-types.js +2 -1
- package/dist/admin.js +20 -2
- package/dist/index.d.ts +9 -11
- package/dist/index.js +33 -15
- package/dist/shop-namespace.d.ts +3 -1
- package/dist/shop-namespace.js +49 -8
- package/dist/shop-types.d.ts +43 -4
- package/dist/shop-types.js +2 -1
- package/dist/shop.js +20 -2
- package/package.json +10 -5
- package/src/admin-namespace.ts +582 -4
- package/src/admin-types.ts +460 -4
- package/src/index.ts +31 -17
- package/src/shop-namespace.ts +50 -3
- package/src/shop-types.ts +48 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Vendure
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This file was automatically generated and should not be manually edited.
|
|
5
5
|
* To regenerate, run: npm run codegen:ts
|
|
6
6
|
*
|
|
7
|
-
* Generated at: 2025-12-
|
|
7
|
+
* Generated at: 2025-12-15T07:01:16.361Z
|
|
8
8
|
* Generator version: 1.0.0
|
|
9
9
|
*
|
|
10
10
|
* 🤖 Generated with ForgeCart SDK Generator
|
|
@@ -23,6 +23,8 @@ export interface SDKConfig {
|
|
|
23
23
|
headers?: Record<string, string>;
|
|
24
24
|
/** Custom WebSocket implementation (optional, auto-detected if not provided) */
|
|
25
25
|
webSocketImpl?: unknown;
|
|
26
|
+
/** Use HTTP only, skip WebSocket initialization (default: false) */
|
|
27
|
+
httpOnly?: boolean;
|
|
26
28
|
}
|
|
27
29
|
export type ActiveAdministratorQueryVariables = Types.ActiveAdministratorQueryVariables;
|
|
28
30
|
export type ActiveAdministratorQuery = Types.ActiveAdministratorQuery;
|
|
@@ -456,12 +458,51 @@ export type UpdateCustomerNoteMutationResult = Types.UpdateCustomerNoteMutation;
|
|
|
456
458
|
export type DeleteCustomerNoteMutationVariables = Types.DeleteCustomerNoteMutationVariables;
|
|
457
459
|
export type DeleteCustomerNoteMutation = Types.DeleteCustomerNoteMutation;
|
|
458
460
|
export type DeleteCustomerNoteMutationResult = Types.DeleteCustomerNoteMutation;
|
|
461
|
+
export type DeploymentsQueryVariables = Types.DeploymentsQueryVariables;
|
|
462
|
+
export type DeploymentsQuery = Types.DeploymentsQuery;
|
|
463
|
+
export type DeploymentsQueryResult = Types.DeploymentsQuery;
|
|
464
|
+
export type DeploymentQueryVariables = Types.DeploymentQueryVariables;
|
|
465
|
+
export type DeploymentQuery = Types.DeploymentQuery;
|
|
466
|
+
export type DeploymentQueryResult = Types.DeploymentQuery;
|
|
467
|
+
export type DeploymentEnvQueryVariables = Types.DeploymentEnvQueryVariables;
|
|
468
|
+
export type DeploymentEnvQuery = Types.DeploymentEnvQuery;
|
|
469
|
+
export type DeploymentEnvQueryResult = Types.DeploymentEnvQuery;
|
|
470
|
+
export type ChannelInfoQueryVariables = Types.ChannelInfoQueryVariables;
|
|
471
|
+
export type ChannelInfoQuery = Types.ChannelInfoQuery;
|
|
472
|
+
export type ChannelInfoQueryResult = Types.ChannelInfoQuery;
|
|
473
|
+
export type ValidateChannelTokenQueryVariables = Types.ValidateChannelTokenQueryVariables;
|
|
474
|
+
export type ValidateChannelTokenQuery = Types.ValidateChannelTokenQuery;
|
|
475
|
+
export type ValidateChannelTokenQueryResult = Types.ValidateChannelTokenQuery;
|
|
476
|
+
export type CreateDeploymentMutationVariables = Types.CreateDeploymentMutationVariables;
|
|
477
|
+
export type CreateDeploymentMutation = Types.CreateDeploymentMutation;
|
|
478
|
+
export type CreateDeploymentMutationResult = Types.CreateDeploymentMutation;
|
|
479
|
+
export type DeleteDeploymentMutationVariables = Types.DeleteDeploymentMutationVariables;
|
|
480
|
+
export type DeleteDeploymentMutation = Types.DeleteDeploymentMutation;
|
|
481
|
+
export type DeleteDeploymentMutationResult = Types.DeleteDeploymentMutation;
|
|
482
|
+
export type ScaleDeploymentMutationVariables = Types.ScaleDeploymentMutationVariables;
|
|
483
|
+
export type ScaleDeploymentMutation = Types.ScaleDeploymentMutation;
|
|
484
|
+
export type ScaleDeploymentMutationResult = Types.ScaleDeploymentMutation;
|
|
485
|
+
export type SetDeploymentEnvMutationVariables = Types.SetDeploymentEnvMutationVariables;
|
|
486
|
+
export type SetDeploymentEnvMutation = Types.SetDeploymentEnvMutation;
|
|
487
|
+
export type SetDeploymentEnvMutationResult = Types.SetDeploymentEnvMutation;
|
|
488
|
+
export type UnsetDeploymentEnvMutationVariables = Types.UnsetDeploymentEnvMutationVariables;
|
|
489
|
+
export type UnsetDeploymentEnvMutation = Types.UnsetDeploymentEnvMutation;
|
|
490
|
+
export type UnsetDeploymentEnvMutationResult = Types.UnsetDeploymentEnvMutation;
|
|
491
|
+
export type RefreshDeploymentStatusMutationVariables = Types.RefreshDeploymentStatusMutationVariables;
|
|
492
|
+
export type RefreshDeploymentStatusMutation = Types.RefreshDeploymentStatusMutation;
|
|
493
|
+
export type RefreshDeploymentStatusMutationResult = Types.RefreshDeploymentStatusMutation;
|
|
494
|
+
export type DeploymentLogsSubscriptionVariables = Types.DeploymentLogsSubscriptionVariables;
|
|
495
|
+
export type DeploymentLogsSubscription = Types.DeploymentLogsSubscription;
|
|
496
|
+
export type DeploymentLogsSubscriptionResult = Types.DeploymentLogsSubscription;
|
|
459
497
|
export type EntityDuplicatorsQueryVariables = Types.EntityDuplicatorsQueryVariables;
|
|
460
498
|
export type EntityDuplicatorsQuery = Types.EntityDuplicatorsQuery;
|
|
461
499
|
export type EntityDuplicatorsQueryResult = Types.EntityDuplicatorsQuery;
|
|
462
500
|
export type DuplicateEntityMutationVariables = Types.DuplicateEntityMutationVariables;
|
|
463
501
|
export type DuplicateEntityMutation = Types.DuplicateEntityMutation;
|
|
464
502
|
export type DuplicateEntityMutationResult = Types.DuplicateEntityMutation;
|
|
503
|
+
export type EntityEventSubscriptionVariables = Types.EntityEventSubscriptionVariables;
|
|
504
|
+
export type EntityEventSubscription = Types.EntityEventSubscription;
|
|
505
|
+
export type EntityEventSubscriptionResult = Types.EntityEventSubscription;
|
|
465
506
|
export type FacetQueryVariables = Types.FacetQueryVariables;
|
|
466
507
|
export type FacetQuery = Types.FacetQuery;
|
|
467
508
|
export type FacetQueryResult = Types.FacetQuery;
|
|
@@ -991,6 +1032,28 @@ declare class BaseGraphQLClient {
|
|
|
991
1032
|
*/
|
|
992
1033
|
dispose(): void;
|
|
993
1034
|
}
|
|
1035
|
+
export type EventCallback<T = EntityEventPayload> = (event: T) => void;
|
|
1036
|
+
export type BlockingEventCallback<T = EntityEventPayload> = (event: T) => Promise<void>;
|
|
1037
|
+
export interface EventSubscription {
|
|
1038
|
+
unsubscribe: () => void;
|
|
1039
|
+
}
|
|
1040
|
+
export interface EntityEventPayload {
|
|
1041
|
+
channelId: string;
|
|
1042
|
+
eventName: string;
|
|
1043
|
+
eventClass: string;
|
|
1044
|
+
type: string;
|
|
1045
|
+
entityId: string | null;
|
|
1046
|
+
entity: unknown;
|
|
1047
|
+
input: unknown;
|
|
1048
|
+
timestamp: string;
|
|
1049
|
+
}
|
|
1050
|
+
export declare const ProductEvents: readonly ["product.created", "product.updated", "product.deleted", "product.variant.created", "product.variant.updated", "product.variant.deleted", "product.option.created", "product.option.updated", "product.option.deleted", "product.optionGroup.created", "product.optionGroup.updated", "product.optionGroup.deleted", "product.variant.price.updated"];
|
|
1051
|
+
export declare const OrderEvents: readonly ["order.stateTransition", "order.placementStateTransition", "order.line.event", "order.paymentStateTransition", "order.refundStateTransition", "order.coupon.applied", "order.coupon.removed"];
|
|
1052
|
+
export declare const CustomerEvents: readonly ["customer.created", "customer.updated", "customer.deleted", "customer.address.created", "customer.address.updated", "customer.address.deleted", "customer.groupChange", "customer.login", "customer.loginfail"];
|
|
1053
|
+
export declare const FulfillmentEvents: readonly ["fulfillment.created", "fulfillment.stateTransition"];
|
|
1054
|
+
export declare const PaymentEvents: readonly ["payment.stateTransition", "payment.method.created", "payment.method.updated", "payment.method.deleted"];
|
|
1055
|
+
export declare const CatalogEvents: readonly ["collection.created", "collection.updated", "collection.deleted", "collection.modification", "facet.created", "facet.updated", "facet.deleted", "facetValue.created", "facetValue.updated", "facetValue.deleted", "asset.created", "asset.updated", "asset.deleted"];
|
|
1056
|
+
export declare const AllEvents: readonly ["product.created", "product.updated", "product.deleted", "product.variant.created", "product.variant.updated", "product.variant.deleted", "product.option.created", "product.option.updated", "product.option.deleted", "product.optionGroup.created", "product.optionGroup.updated", "product.optionGroup.deleted", "product.variant.price.updated", "order.stateTransition", "order.placementStateTransition", "order.line.event", "order.paymentStateTransition", "order.refundStateTransition", "order.coupon.applied", "order.coupon.removed", "customer.created", "customer.updated", "customer.deleted", "customer.address.created", "customer.address.updated", "customer.address.deleted", "customer.groupChange", "customer.login", "customer.loginfail", "fulfillment.created", "fulfillment.stateTransition", "payment.stateTransition", "payment.method.created", "payment.method.updated", "payment.method.deleted", "collection.created", "collection.updated", "collection.deleted", "collection.modification", "facet.created", "facet.updated", "facet.deleted", "facetValue.created", "facetValue.updated", "facetValue.deleted", "asset.created", "asset.updated", "asset.deleted"];
|
|
994
1057
|
/**
|
|
995
1058
|
* Administrator operations
|
|
996
1059
|
*/
|
|
@@ -1019,6 +1082,7 @@ declare class AdministratorOperations {
|
|
|
1019
1082
|
authenticate(variables: Types.AuthenticateMutationVariables): Promise<Types.AuthenticateMutation>;
|
|
1020
1083
|
/**
|
|
1021
1084
|
* login mutation
|
|
1085
|
+
* Automatically sets the auth token on successful login
|
|
1022
1086
|
*/
|
|
1023
1087
|
login(variables: Types.LoginMutationVariables): Promise<Types.LoginMutation>;
|
|
1024
1088
|
/**
|
|
@@ -1637,6 +1701,61 @@ declare class CustomerOperations {
|
|
|
1637
1701
|
*/
|
|
1638
1702
|
deleteCustomerNote(variables: Types.DeleteCustomerNoteMutationVariables): Promise<Types.DeleteCustomerNoteMutation>;
|
|
1639
1703
|
}
|
|
1704
|
+
/**
|
|
1705
|
+
* Deployment operations
|
|
1706
|
+
*/
|
|
1707
|
+
declare class DeploymentOperations {
|
|
1708
|
+
private client;
|
|
1709
|
+
constructor(client: BaseGraphQLClient);
|
|
1710
|
+
/**
|
|
1711
|
+
* Deployments query
|
|
1712
|
+
*/
|
|
1713
|
+
deployments(): Promise<Types.DeploymentsQuery>;
|
|
1714
|
+
/**
|
|
1715
|
+
* Deployment query
|
|
1716
|
+
*/
|
|
1717
|
+
deployment(variables: Types.DeploymentQueryVariables): Promise<Types.DeploymentQuery>;
|
|
1718
|
+
/**
|
|
1719
|
+
* DeploymentEnv query
|
|
1720
|
+
*/
|
|
1721
|
+
deploymentEnv(variables: Types.DeploymentEnvQueryVariables): Promise<Types.DeploymentEnvQuery>;
|
|
1722
|
+
/**
|
|
1723
|
+
* ChannelInfo query
|
|
1724
|
+
*/
|
|
1725
|
+
channelInfo(): Promise<Types.ChannelInfoQuery>;
|
|
1726
|
+
/**
|
|
1727
|
+
* ValidateChannelToken query
|
|
1728
|
+
*/
|
|
1729
|
+
validateChannelToken(): Promise<Types.ValidateChannelTokenQuery>;
|
|
1730
|
+
/**
|
|
1731
|
+
* CreateDeployment mutation
|
|
1732
|
+
*/
|
|
1733
|
+
createDeployment(variables: Types.CreateDeploymentMutationVariables): Promise<Types.CreateDeploymentMutation>;
|
|
1734
|
+
/**
|
|
1735
|
+
* DeleteDeployment mutation
|
|
1736
|
+
*/
|
|
1737
|
+
deleteDeployment(variables: Types.DeleteDeploymentMutationVariables): Promise<Types.DeleteDeploymentMutation>;
|
|
1738
|
+
/**
|
|
1739
|
+
* ScaleDeployment mutation
|
|
1740
|
+
*/
|
|
1741
|
+
scaleDeployment(variables: Types.ScaleDeploymentMutationVariables): Promise<Types.ScaleDeploymentMutation>;
|
|
1742
|
+
/**
|
|
1743
|
+
* SetDeploymentEnv mutation
|
|
1744
|
+
*/
|
|
1745
|
+
setDeploymentEnv(variables: Types.SetDeploymentEnvMutationVariables): Promise<Types.SetDeploymentEnvMutation>;
|
|
1746
|
+
/**
|
|
1747
|
+
* UnsetDeploymentEnv mutation
|
|
1748
|
+
*/
|
|
1749
|
+
unsetDeploymentEnv(variables: Types.UnsetDeploymentEnvMutationVariables): Promise<Types.UnsetDeploymentEnvMutation>;
|
|
1750
|
+
/**
|
|
1751
|
+
* RefreshDeploymentStatus mutation
|
|
1752
|
+
*/
|
|
1753
|
+
refreshDeploymentStatus(variables: Types.RefreshDeploymentStatusMutationVariables): Promise<Types.RefreshDeploymentStatusMutation>;
|
|
1754
|
+
/**
|
|
1755
|
+
* DeploymentLogs subscription
|
|
1756
|
+
*/
|
|
1757
|
+
deploymentLogs(variables: Types.DeploymentLogsSubscriptionVariables): AsyncIterableIterator<Types.DeploymentLogsSubscription>;
|
|
1758
|
+
}
|
|
1640
1759
|
/**
|
|
1641
1760
|
* EntityDuplication operations
|
|
1642
1761
|
*/
|
|
@@ -1652,6 +1771,17 @@ declare class EntityDuplicationOperations {
|
|
|
1652
1771
|
*/
|
|
1653
1772
|
duplicateEntity(variables: Types.DuplicateEntityMutationVariables): Promise<Types.DuplicateEntityMutation>;
|
|
1654
1773
|
}
|
|
1774
|
+
/**
|
|
1775
|
+
* EntityEvents operations
|
|
1776
|
+
*/
|
|
1777
|
+
declare class EntityEventsOperations {
|
|
1778
|
+
private client;
|
|
1779
|
+
constructor(client: BaseGraphQLClient);
|
|
1780
|
+
/**
|
|
1781
|
+
* entityEvent subscription
|
|
1782
|
+
*/
|
|
1783
|
+
entityEvent(variables: Types.EntityEventSubscriptionVariables): AsyncIterableIterator<Types.EntityEventSubscription>;
|
|
1784
|
+
}
|
|
1655
1785
|
/**
|
|
1656
1786
|
* Facet operations
|
|
1657
1787
|
*/
|
|
@@ -2450,7 +2580,9 @@ export declare class AdminNamespace {
|
|
|
2450
2580
|
readonly customFields: CustomFieldsOperations;
|
|
2451
2581
|
readonly customerGroup: CustomerGroupOperations;
|
|
2452
2582
|
readonly customer: CustomerOperations;
|
|
2583
|
+
readonly deployment: DeploymentOperations;
|
|
2453
2584
|
readonly entityDuplication: EntityDuplicationOperations;
|
|
2585
|
+
readonly entityEvents: EntityEventsOperations;
|
|
2454
2586
|
readonly facet: FacetOperations;
|
|
2455
2587
|
readonly fulfillment: FulfillmentOperations;
|
|
2456
2588
|
readonly globalSettings: GlobalSettingsOperations;
|
|
@@ -2473,6 +2605,13 @@ export declare class AdminNamespace {
|
|
|
2473
2605
|
readonly taxRate: TaxRateOperations;
|
|
2474
2606
|
readonly tax: TaxOperations;
|
|
2475
2607
|
readonly zone: ZoneOperations;
|
|
2608
|
+
private eventRegistry;
|
|
2609
|
+
private eventSubscription;
|
|
2610
|
+
private isListening;
|
|
2611
|
+
private retryCount;
|
|
2612
|
+
private abortController;
|
|
2613
|
+
private static readonly RECONNECT_CONFIG;
|
|
2614
|
+
private static readonly BLOCKING_TIMEOUT_MS;
|
|
2476
2615
|
constructor(config: SDKConfig);
|
|
2477
2616
|
/**
|
|
2478
2617
|
* Set authentication token
|
|
@@ -2487,5 +2626,33 @@ export declare class AdminNamespace {
|
|
|
2487
2626
|
* Dispose of the namespace and close all connections
|
|
2488
2627
|
*/
|
|
2489
2628
|
dispose(): void;
|
|
2629
|
+
/**
|
|
2630
|
+
* Register a non-blocking event handler
|
|
2631
|
+
* The callback will be called for each matching event without waiting
|
|
2632
|
+
*/
|
|
2633
|
+
registerEventHandler(eventName: string, callback: EventCallback): EventSubscription;
|
|
2634
|
+
/**
|
|
2635
|
+
* Register a blocking event handler
|
|
2636
|
+
* The callback must complete within 1000ms or it will timeout
|
|
2637
|
+
*/
|
|
2638
|
+
registerBlockingEventHandler(eventName: string, callback: BlockingEventCallback): EventSubscription;
|
|
2639
|
+
/**
|
|
2640
|
+
* Start listening to events with retry logic
|
|
2641
|
+
*/
|
|
2642
|
+
private ensureEventListening;
|
|
2643
|
+
private startSubscription;
|
|
2644
|
+
private handleReconnect;
|
|
2645
|
+
/**
|
|
2646
|
+
* Dispatch event to registered handlers
|
|
2647
|
+
*/
|
|
2648
|
+
private dispatchEvent;
|
|
2649
|
+
/**
|
|
2650
|
+
* Execute promise with timeout
|
|
2651
|
+
*/
|
|
2652
|
+
private executeWithTimeout;
|
|
2653
|
+
/**
|
|
2654
|
+
* Stop all event listening
|
|
2655
|
+
*/
|
|
2656
|
+
stopEventListening(): void;
|
|
2490
2657
|
}
|
|
2491
2658
|
export {};
|