@forgecart/sdk 1.2.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 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-13T23:18:09.120Z
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
@@ -458,12 +458,51 @@ export type UpdateCustomerNoteMutationResult = Types.UpdateCustomerNoteMutation;
458
458
  export type DeleteCustomerNoteMutationVariables = Types.DeleteCustomerNoteMutationVariables;
459
459
  export type DeleteCustomerNoteMutation = Types.DeleteCustomerNoteMutation;
460
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;
461
497
  export type EntityDuplicatorsQueryVariables = Types.EntityDuplicatorsQueryVariables;
462
498
  export type EntityDuplicatorsQuery = Types.EntityDuplicatorsQuery;
463
499
  export type EntityDuplicatorsQueryResult = Types.EntityDuplicatorsQuery;
464
500
  export type DuplicateEntityMutationVariables = Types.DuplicateEntityMutationVariables;
465
501
  export type DuplicateEntityMutation = Types.DuplicateEntityMutation;
466
502
  export type DuplicateEntityMutationResult = Types.DuplicateEntityMutation;
503
+ export type EntityEventSubscriptionVariables = Types.EntityEventSubscriptionVariables;
504
+ export type EntityEventSubscription = Types.EntityEventSubscription;
505
+ export type EntityEventSubscriptionResult = Types.EntityEventSubscription;
467
506
  export type FacetQueryVariables = Types.FacetQueryVariables;
468
507
  export type FacetQuery = Types.FacetQuery;
469
508
  export type FacetQueryResult = Types.FacetQuery;
@@ -993,6 +1032,28 @@ declare class BaseGraphQLClient {
993
1032
  */
994
1033
  dispose(): void;
995
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"];
996
1057
  /**
997
1058
  * Administrator operations
998
1059
  */
@@ -1021,6 +1082,7 @@ declare class AdministratorOperations {
1021
1082
  authenticate(variables: Types.AuthenticateMutationVariables): Promise<Types.AuthenticateMutation>;
1022
1083
  /**
1023
1084
  * login mutation
1085
+ * Automatically sets the auth token on successful login
1024
1086
  */
1025
1087
  login(variables: Types.LoginMutationVariables): Promise<Types.LoginMutation>;
1026
1088
  /**
@@ -1639,6 +1701,61 @@ declare class CustomerOperations {
1639
1701
  */
1640
1702
  deleteCustomerNote(variables: Types.DeleteCustomerNoteMutationVariables): Promise<Types.DeleteCustomerNoteMutation>;
1641
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
+ }
1642
1759
  /**
1643
1760
  * EntityDuplication operations
1644
1761
  */
@@ -1654,6 +1771,17 @@ declare class EntityDuplicationOperations {
1654
1771
  */
1655
1772
  duplicateEntity(variables: Types.DuplicateEntityMutationVariables): Promise<Types.DuplicateEntityMutation>;
1656
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
+ }
1657
1785
  /**
1658
1786
  * Facet operations
1659
1787
  */
@@ -2452,7 +2580,9 @@ export declare class AdminNamespace {
2452
2580
  readonly customFields: CustomFieldsOperations;
2453
2581
  readonly customerGroup: CustomerGroupOperations;
2454
2582
  readonly customer: CustomerOperations;
2583
+ readonly deployment: DeploymentOperations;
2455
2584
  readonly entityDuplication: EntityDuplicationOperations;
2585
+ readonly entityEvents: EntityEventsOperations;
2456
2586
  readonly facet: FacetOperations;
2457
2587
  readonly fulfillment: FulfillmentOperations;
2458
2588
  readonly globalSettings: GlobalSettingsOperations;
@@ -2475,6 +2605,13 @@ export declare class AdminNamespace {
2475
2605
  readonly taxRate: TaxRateOperations;
2476
2606
  readonly tax: TaxOperations;
2477
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;
2478
2615
  constructor(config: SDKConfig);
2479
2616
  /**
2480
2617
  * Set authentication token
@@ -2489,5 +2626,33 @@ export declare class AdminNamespace {
2489
2626
  * Dispose of the namespace and close all connections
2490
2627
  */
2491
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;
2492
2657
  }
2493
2658
  export {};