@forgecart/sdk 1.2.6 → 1.2.7

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/README.md CHANGED
@@ -2,4 +2,87 @@
2
2
 
3
3
  ForgeCart Client SDK
4
4
 
5
- Full documentation, guides, and API reference: https://docs.forgecart.com
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @forgecart/sdk
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Standalone Admin Client
14
+
15
+ ```typescript
16
+ import { ForgeCartAdminClient } from '@forgecart/sdk';
17
+
18
+ const admin = new ForgeCartAdminClient({
19
+ endpoint: 'https://api.mystore.com/admin-api',
20
+ channelToken: 'my-channel-token',
21
+ adminSecret: 'my-admin-secret',
22
+ });
23
+
24
+ admin.setAuthToken(token);
25
+ const result = await admin.products.products({ take: 10 });
26
+ ```
27
+
28
+ ### Standalone Shop Client
29
+
30
+ ```typescript
31
+ import { ForgeCartShopClient } from '@forgecart/sdk';
32
+
33
+ const shop = new ForgeCartShopClient({
34
+ endpoint: 'https://api.mystore.com/shop-api',
35
+ channelToken: 'my-channel-token',
36
+ });
37
+
38
+ const order = await shop.cart.addItemToOrder({ variantId, quantity: 1 });
39
+ ```
40
+
41
+ ### Union Client (Admin + Shop)
42
+
43
+ ```typescript
44
+ import { ForgeCartClient } from '@forgecart/sdk';
45
+
46
+ const client = new ForgeCartClient({
47
+ endpoint: 'https://api.mystore.com',
48
+ channelToken: 'my-channel-token',
49
+ adminSecret: 'my-admin-secret',
50
+ });
51
+
52
+ client.setAuthToken(token);
53
+ const products = await client.admin.products.products({ take: 10 });
54
+ const order = await client.shop.cart.addItemToOrder({ variantId, quantity: 1 });
55
+ ```
56
+
57
+ ## Namespaces
58
+
59
+ - `client.admin` — entry, fieldDefinition, publish, acfSchema, acf, administrator, analyticsGateway, asset, audienceMembership, audienceSegment, auth, settings, channel, chat, collection, country, address, group, customerGroup, customer, deployment, facet, fulfillmentRequest, fulfillment, hookDispatch, hook, marketingAttribution, marketingEvent, marketingIdentity, onboarding, coupon, draft, modification, note, orderModification, order, payment, manageable, plugin, optionGroup, option, productOption, productVariant, product, promotion, role, scheduledJob, search, seller, shipping, stock, subscription, tax, transaction, zone
60
+ - `client.shop` — acf, auth, cart, checkout, collection, customer, facet, hookDispatch, hook, marketingEvent, marketingIdentity, order, payment, product, search, shipping, subscription
61
+
62
+ ## NestJS Integration
63
+
64
+ ```typescript
65
+ import { ForgeCartGraphQLModule } from '@forgecart/sdk';
66
+
67
+ // Admin only
68
+ @Module({
69
+ imports: [ForgeCartGraphQLModule.forAdmin({
70
+ endpoint: 'https://api.mystore.com/admin-api',
71
+ channelToken: 'my-channel-token',
72
+ })],
73
+ })
74
+ export class AppModule {}
75
+
76
+ // Full union (admin + shop)
77
+ @Module({
78
+ imports: [ForgeCartGraphQLModule.forRoot({
79
+ endpoint: 'https://api.mystore.com',
80
+ channelToken: 'my-channel-token',
81
+ })],
82
+ })
83
+ export class AppModule {}
84
+ ```
85
+
86
+ ---
87
+
88
+ *Auto-generated by @forgecart/client-sdk-generators.*
@@ -538,6 +538,7 @@ export type Channel = {
538
538
  description: Scalars['String']['output'];
539
539
  id: Scalars['ID']['output'];
540
540
  outOfStockThreshold: Scalars['Int']['output'];
541
+ previewUrl: Scalars['String']['output'];
541
542
  pricesIncludeTax: Scalars['Boolean']['output'];
542
543
  secret?: Maybe<Scalars['String']['output']>;
543
544
  seller?: Maybe<Seller>;
@@ -584,6 +585,30 @@ export type ChannelSettings = {
584
585
  shopName?: Maybe<Scalars['String']['output']>;
585
586
  taxOriginScope: Scalars['String']['output'];
586
587
  };
588
+ export type ChatMessage = {
589
+ content: Scalars['String']['output'];
590
+ eventId: Scalars['Int']['output'];
591
+ isFinal: Scalars['Boolean']['output'];
592
+ timestamp: Scalars['Int']['output'];
593
+ toolResult?: Maybe<ToolResultDetail>;
594
+ toolUse?: Maybe<ToolUseDetail>;
595
+ type: ChatMessageType;
596
+ };
597
+ export type ChatMessageType = 'COMPLETE' | 'ERROR' | 'TEXT' | 'THINKING' | 'TOOL_RESULT' | 'TOOL_USE';
598
+ export type ChatQueueItem = {
599
+ content: Scalars['String']['output'];
600
+ id: Scalars['ID']['output'];
601
+ kind: Scalars['String']['output'];
602
+ };
603
+ export type ChatSession = {
604
+ channelToken: Scalars['String']['output'];
605
+ createdAt: Scalars['String']['output'];
606
+ lastActivity: Scalars['String']['output'];
607
+ messageCount: Scalars['Int']['output'];
608
+ sessionId: Scalars['String']['output'];
609
+ status: Scalars['String']['output'];
610
+ userId: Scalars['String']['output'];
611
+ };
587
612
  export type Collection = {
588
613
  createdAt: Scalars['DateTime']['output'];
589
614
  description?: Maybe<Scalars['String']['output']>;
@@ -1146,6 +1171,11 @@ export type EmitCustomEventInput = {
1146
1171
  hookPoint: Scalars['String']['input'];
1147
1172
  payload?: InputMaybe<Scalars['JSON']['input']>;
1148
1173
  };
1174
+ export type EnqueueChatMessageInput = {
1175
+ interrupt: Scalars['Boolean']['input'];
1176
+ message: Scalars['String']['input'];
1177
+ sessionId: Scalars['String']['input'];
1178
+ };
1149
1179
  export type Entry = {
1150
1180
  createdAt: Scalars['DateTime']['output'];
1151
1181
  fields: Array<AcfFieldValueUnion>;
@@ -1630,6 +1660,8 @@ export type Mutation = {
1630
1660
  changeFulfillmentRequestDeliveryMethod: FulfillmentRequest;
1631
1661
  changeSubscriptionPlan: BillingSubscription;
1632
1662
  changeSubscriptionQuantity: BillingSubscription;
1663
+ clearChatHistory: Scalars['Boolean']['output'];
1664
+ closeChatSession: Scalars['Boolean']['output'];
1633
1665
  commitTransaction: DeletionResponse;
1634
1666
  completeDraft: Order;
1635
1667
  completeOnboardingShop: CompleteOnboardingShopResult;
@@ -1709,6 +1741,7 @@ export type Mutation = {
1709
1741
  emit: Scalars['Boolean']['output'];
1710
1742
  enablePlugin: ChannelPlugin;
1711
1743
  enableScheduledJob: ScheduledJob;
1744
+ enqueueChatMessage: Scalars['Int']['output'];
1712
1745
  evaluateAudienceSegment: AudienceSegmentEvaluationResult;
1713
1746
  generateDeviceCode: DeviceCodeResponse;
1714
1747
  holdForQualityControl: StockMovement;
@@ -1756,6 +1789,7 @@ export type Mutation = {
1756
1789
  saveToken: PaymentGatewayToken;
1757
1790
  scaleDeployment: Deployment;
1758
1791
  selectShippingRate: Order;
1792
+ sendChatMessage: Array<ChatMessage>;
1759
1793
  setBillingAddress: Order;
1760
1794
  setConfigurationItemValue?: Maybe<Scalars['Boolean']['output']>;
1761
1795
  setCustomerForDraftOrder: Order;
@@ -1767,6 +1801,7 @@ export type Mutation = {
1767
1801
  setShippingAddress: Order;
1768
1802
  settleRefund: Refund;
1769
1803
  splitFulfillmentRequest: FulfillmentRequest;
1804
+ startChatSession: ChatSession;
1770
1805
  transitionFulfillmentToState: Fulfillment;
1771
1806
  transitionOrderToState: Order;
1772
1807
  triggerScheduledJob: ScheduledJobRun;
@@ -1893,6 +1928,12 @@ export type MutationchangeSubscriptionPlanArgs = {
1893
1928
  export type MutationchangeSubscriptionQuantityArgs = {
1894
1929
  input: ChangeSubscriptionQuantityInput;
1895
1930
  };
1931
+ export type MutationclearChatHistoryArgs = {
1932
+ sessionId: Scalars['ID']['input'];
1933
+ };
1934
+ export type MutationcloseChatSessionArgs = {
1935
+ sessionId: Scalars['ID']['input'];
1936
+ };
1896
1937
  export type MutationcommitTransactionArgs = {
1897
1938
  token: Scalars['String']['input'];
1898
1939
  };
@@ -2129,6 +2170,9 @@ export type MutationenablePluginArgs = {
2129
2170
  export type MutationenableScheduledJobArgs = {
2130
2171
  id: Scalars['ID']['input'];
2131
2172
  };
2173
+ export type MutationenqueueChatMessageArgs = {
2174
+ input: EnqueueChatMessageInput;
2175
+ };
2132
2176
  export type MutationevaluateAudienceSegmentArgs = {
2133
2177
  id: Scalars['ID']['input'];
2134
2178
  };
@@ -2264,6 +2308,9 @@ export type MutationscaleDeploymentArgs = {
2264
2308
  export type MutationselectShippingRateArgs = {
2265
2309
  input: SelectShippingRateInput;
2266
2310
  };
2311
+ export type MutationsendChatMessageArgs = {
2312
+ input: SendChatMessageInput;
2313
+ };
2267
2314
  export type MutationsetBillingAddressArgs = {
2268
2315
  input: SetBillingAddressInput;
2269
2316
  };
@@ -2839,6 +2886,7 @@ export type Query = {
2839
2886
  channelPlugins: Array<ChannelPlugin>;
2840
2887
  channelSettings: ChannelSettings;
2841
2888
  channels: ChannelList;
2889
+ chatQueue: Array<ChatQueueItem>;
2842
2890
  collection?: Maybe<Collection>;
2843
2891
  collections: CollectionList;
2844
2892
  configurationItemValue?: Maybe<Scalars['JSON']['output']>;
@@ -2975,6 +3023,9 @@ export type QuerychannelArgs = {
2975
3023
  export type QuerychannelsArgs = {
2976
3024
  options?: InputMaybe<ListQueryOptions>;
2977
3025
  };
3026
+ export type QuerychatQueueArgs = {
3027
+ sessionId: Scalars['ID']['input'];
3028
+ };
2978
3029
  export type QuerycollectionArgs = {
2979
3030
  id: Scalars['ID']['input'];
2980
3031
  };
@@ -3381,6 +3432,10 @@ export type RespondToHookDispatchInput = {
3381
3432
  id: Scalars['String']['input'];
3382
3433
  subscriberId: Scalars['String']['input'];
3383
3434
  };
3435
+ export type ResumeChatSessionInput = {
3436
+ afterEventId: Scalars['Int']['input'];
3437
+ sessionId: Scalars['String']['input'];
3438
+ };
3384
3439
  export type Role = {
3385
3440
  code: Scalars['String']['output'];
3386
3441
  createdAt: Scalars['DateTime']['output'];
@@ -3754,8 +3809,13 @@ export type StringFilter = {
3754
3809
  notEq?: InputMaybe<Scalars['String']['input']>;
3755
3810
  };
3756
3811
  export type Subscription = {
3812
+ chatMessageStream: ChatMessage;
3757
3813
  deploymentLogs: DeploymentLogEntry;
3758
3814
  hookDispatched: HookDispatchEvent;
3815
+ resumeChatSession: ChatMessage;
3816
+ };
3817
+ export type SubscriptionchatMessageStreamArgs = {
3818
+ input: SendChatMessageInput;
3759
3819
  };
3760
3820
  export type SubscriptiondeploymentLogsArgs = {
3761
3821
  type: DeploymentType;
@@ -3763,6 +3823,9 @@ export type SubscriptiondeploymentLogsArgs = {
3763
3823
  export type SubscriptionhookDispatchedArgs = {
3764
3824
  hookPoints: Array<Scalars['String']['input']>;
3765
3825
  };
3826
+ export type SubscriptionresumeChatSessionArgs = {
3827
+ input: ResumeChatSessionInput;
3828
+ };
3766
3829
  export type SubscriptionCreditBalance = {
3767
3830
  amountCents: Scalars['Int']['output'];
3768
3831
  appliedCents: Scalars['Int']['output'];
@@ -3857,6 +3920,16 @@ export type TaxRateList = {
3857
3920
  items: Array<TaxRate>;
3858
3921
  totalItems: Scalars['Int']['output'];
3859
3922
  };
3923
+ export type ToolResultDetail = {
3924
+ isError: Scalars['Boolean']['output'];
3925
+ result: Scalars['String']['output'];
3926
+ toolId: Scalars['String']['output'];
3927
+ };
3928
+ export type ToolUseDetail = {
3929
+ input: Scalars['String']['output'];
3930
+ toolId: Scalars['String']['output'];
3931
+ toolName: Scalars['String']['output'];
3932
+ };
3860
3933
  export type TrackEventInput = {
3861
3934
  eventType: Scalars['String']['input'];
3862
3935
  occurredAt?: InputMaybe<Scalars['DateTime']['input']>;
@@ -5115,32 +5188,32 @@ export type LogoutMutationVariables = Exact<{
5115
5188
  [key: string]: never;
5116
5189
  }>;
5117
5190
  export type LogoutMutation = Pick<Mutation, 'logout'>;
5118
- export type ChannelFieldFragment = Pick<Channel, 'id' | 'createdAt' | 'updatedAt' | 'code' | 'token' | 'secret' | 'defaultLanguageCode' | 'defaultCurrencyCode' | 'availableLanguageCodes' | 'availableCurrencyCodes' | 'description' | 'pricesIncludeTax' | 'taxProviderCode' | 'trackInventory' | 'outOfStockThreshold' | 'sellerId' | 'defaultTaxZoneId'>;
5191
+ export type ChannelFieldFragment = Pick<Channel, 'id' | 'createdAt' | 'updatedAt' | 'code' | 'token' | 'secret' | 'previewUrl' | 'defaultLanguageCode' | 'defaultCurrencyCode' | 'availableLanguageCodes' | 'availableCurrencyCodes' | 'description' | 'pricesIncludeTax' | 'taxProviderCode' | 'trackInventory' | 'outOfStockThreshold' | 'sellerId' | 'defaultTaxZoneId'>;
5119
5192
  export type ChannelQueryVariables = Exact<{
5120
5193
  id: Scalars['ID']['input'];
5121
5194
  }>;
5122
5195
  export type ChannelQuery = {
5123
- channel?: Maybe<Pick<Channel, 'id' | 'createdAt' | 'updatedAt' | 'code' | 'token' | 'secret' | 'defaultLanguageCode' | 'defaultCurrencyCode' | 'availableLanguageCodes' | 'availableCurrencyCodes' | 'description' | 'pricesIncludeTax' | 'taxProviderCode' | 'trackInventory' | 'outOfStockThreshold' | 'sellerId' | 'defaultTaxZoneId'>>;
5196
+ channel?: Maybe<Pick<Channel, 'id' | 'createdAt' | 'updatedAt' | 'code' | 'token' | 'secret' | 'previewUrl' | 'defaultLanguageCode' | 'defaultCurrencyCode' | 'availableLanguageCodes' | 'availableCurrencyCodes' | 'description' | 'pricesIncludeTax' | 'taxProviderCode' | 'trackInventory' | 'outOfStockThreshold' | 'sellerId' | 'defaultTaxZoneId'>>;
5124
5197
  };
5125
5198
  export type ChannelsQueryVariables = Exact<{
5126
5199
  options?: InputMaybe<ListQueryOptions>;
5127
5200
  }>;
5128
5201
  export type ChannelsQuery = {
5129
5202
  channels: (Pick<ChannelList, 'totalItems'> & {
5130
- items: Array<Pick<Channel, 'id' | 'createdAt' | 'updatedAt' | 'code' | 'token' | 'secret' | 'defaultLanguageCode' | 'defaultCurrencyCode' | 'availableLanguageCodes' | 'availableCurrencyCodes' | 'description' | 'pricesIncludeTax' | 'taxProviderCode' | 'trackInventory' | 'outOfStockThreshold' | 'sellerId' | 'defaultTaxZoneId'>>;
5203
+ items: Array<Pick<Channel, 'id' | 'createdAt' | 'updatedAt' | 'code' | 'token' | 'secret' | 'previewUrl' | 'defaultLanguageCode' | 'defaultCurrencyCode' | 'availableLanguageCodes' | 'availableCurrencyCodes' | 'description' | 'pricesIncludeTax' | 'taxProviderCode' | 'trackInventory' | 'outOfStockThreshold' | 'sellerId' | 'defaultTaxZoneId'>>;
5131
5204
  });
5132
5205
  };
5133
5206
  export type CreateChannelMutationVariables = Exact<{
5134
5207
  input: CreateChannelInput;
5135
5208
  }>;
5136
5209
  export type CreateChannelMutation = {
5137
- createChannel: Pick<Channel, 'id' | 'createdAt' | 'updatedAt' | 'code' | 'token' | 'secret' | 'defaultLanguageCode' | 'defaultCurrencyCode' | 'availableLanguageCodes' | 'availableCurrencyCodes' | 'description' | 'pricesIncludeTax' | 'taxProviderCode' | 'trackInventory' | 'outOfStockThreshold' | 'sellerId' | 'defaultTaxZoneId'>;
5210
+ createChannel: Pick<Channel, 'id' | 'createdAt' | 'updatedAt' | 'code' | 'token' | 'secret' | 'previewUrl' | 'defaultLanguageCode' | 'defaultCurrencyCode' | 'availableLanguageCodes' | 'availableCurrencyCodes' | 'description' | 'pricesIncludeTax' | 'taxProviderCode' | 'trackInventory' | 'outOfStockThreshold' | 'sellerId' | 'defaultTaxZoneId'>;
5138
5211
  };
5139
5212
  export type UpdateChannelMutationVariables = Exact<{
5140
5213
  input: UpdateChannelInput;
5141
5214
  }>;
5142
5215
  export type UpdateChannelMutation = {
5143
- updateChannel: Pick<Channel, 'id' | 'createdAt' | 'updatedAt' | 'code' | 'token' | 'secret' | 'defaultLanguageCode' | 'defaultCurrencyCode' | 'availableLanguageCodes' | 'availableCurrencyCodes' | 'description' | 'pricesIncludeTax' | 'taxProviderCode' | 'trackInventory' | 'outOfStockThreshold' | 'sellerId' | 'defaultTaxZoneId'>;
5216
+ updateChannel: Pick<Channel, 'id' | 'createdAt' | 'updatedAt' | 'code' | 'token' | 'secret' | 'previewUrl' | 'defaultLanguageCode' | 'defaultCurrencyCode' | 'availableLanguageCodes' | 'availableCurrencyCodes' | 'description' | 'pricesIncludeTax' | 'taxProviderCode' | 'trackInventory' | 'outOfStockThreshold' | 'sellerId' | 'defaultTaxZoneId'>;
5144
5217
  };
5145
5218
  export type DeleteChannelMutationVariables = Exact<{
5146
5219
  id: Scalars['ID']['input'];
@@ -5159,7 +5232,7 @@ export type ProvisionChannelMutationVariables = Exact<{
5159
5232
  }>;
5160
5233
  export type ProvisionChannelMutation = {
5161
5234
  provisionChannel: {
5162
- channel: Pick<Channel, 'id' | 'createdAt' | 'updatedAt' | 'code' | 'token' | 'secret' | 'defaultLanguageCode' | 'defaultCurrencyCode' | 'availableLanguageCodes' | 'availableCurrencyCodes' | 'description' | 'pricesIncludeTax' | 'taxProviderCode' | 'trackInventory' | 'outOfStockThreshold' | 'sellerId' | 'defaultTaxZoneId'>;
5235
+ channel: Pick<Channel, 'id' | 'createdAt' | 'updatedAt' | 'code' | 'token' | 'secret' | 'previewUrl' | 'defaultLanguageCode' | 'defaultCurrencyCode' | 'availableLanguageCodes' | 'availableCurrencyCodes' | 'description' | 'pricesIncludeTax' | 'taxProviderCode' | 'trackInventory' | 'outOfStockThreshold' | 'sellerId' | 'defaultTaxZoneId'>;
5163
5236
  channelSettings: (Pick<ChannelSettings, 'id' | 'channelId' | 'shopName' | 'requiresShippingAddressValidation' | 'requireCustomerForCheckout' | 'defaultFulfillmentHandlerCode' | 'defaultPaymentProviderCode' | 'defaultWeightUnit' | 'defaultDimensionUnit'> & {
5164
5237
  manualShippingRates: Array<Pick<ManualShippingRate, 'code' | 'name' | 'amount' | 'currency' | 'estimatedDays'>>;
5165
5238
  });
@@ -5185,6 +5258,62 @@ export type ChannelUpdateSettingsMutation = {
5185
5258
  manualShippingRates: Array<Pick<ManualShippingRate, 'code' | 'name' | 'amount' | 'currency' | 'estimatedDays'>>;
5186
5259
  });
5187
5260
  };
5261
+ export type ChatSessionFieldFragment = Pick<ChatSession, 'sessionId' | 'channelToken' | 'userId' | 'createdAt' | 'lastActivity' | 'messageCount' | 'status'>;
5262
+ export type ChatMessageFieldFragment = (Pick<ChatMessage, 'type' | 'content' | 'timestamp' | 'isFinal' | 'eventId'> & {
5263
+ toolUse?: Maybe<Pick<ToolUseDetail, 'toolId' | 'toolName' | 'input'>>;
5264
+ toolResult?: Maybe<Pick<ToolResultDetail, 'toolId' | 'result' | 'isError'>>;
5265
+ });
5266
+ export type StartChatSessionMutationVariables = Exact<{
5267
+ [key: string]: never;
5268
+ }>;
5269
+ export type StartChatSessionMutation = {
5270
+ startChatSession: Pick<ChatSession, 'sessionId' | 'channelToken' | 'userId' | 'createdAt' | 'lastActivity' | 'messageCount' | 'status'>;
5271
+ };
5272
+ export type SendChatMessageMutationVariables = Exact<{
5273
+ input: SendChatMessageInput;
5274
+ }>;
5275
+ export type SendChatMessageMutation = {
5276
+ sendChatMessage: Array<(Pick<ChatMessage, 'type' | 'content' | 'timestamp' | 'isFinal' | 'eventId'> & {
5277
+ toolUse?: Maybe<Pick<ToolUseDetail, 'toolId' | 'toolName' | 'input'>>;
5278
+ toolResult?: Maybe<Pick<ToolResultDetail, 'toolId' | 'result' | 'isError'>>;
5279
+ })>;
5280
+ };
5281
+ export type ChatMessageStreamSubscriptionVariables = Exact<{
5282
+ input: SendChatMessageInput;
5283
+ }>;
5284
+ export type ChatMessageStreamSubscription = {
5285
+ chatMessageStream: (Pick<ChatMessage, 'type' | 'content' | 'timestamp' | 'isFinal' | 'eventId'> & {
5286
+ toolUse?: Maybe<Pick<ToolUseDetail, 'toolId' | 'toolName' | 'input'>>;
5287
+ toolResult?: Maybe<Pick<ToolResultDetail, 'toolId' | 'result' | 'isError'>>;
5288
+ });
5289
+ };
5290
+ export type ResumeChatSessionSubscriptionVariables = Exact<{
5291
+ input: ResumeChatSessionInput;
5292
+ }>;
5293
+ export type ResumeChatSessionSubscription = {
5294
+ resumeChatSession: (Pick<ChatMessage, 'type' | 'content' | 'timestamp' | 'isFinal' | 'eventId'> & {
5295
+ toolUse?: Maybe<Pick<ToolUseDetail, 'toolId' | 'toolName' | 'input'>>;
5296
+ toolResult?: Maybe<Pick<ToolResultDetail, 'toolId' | 'result' | 'isError'>>;
5297
+ });
5298
+ };
5299
+ export type CloseChatSessionMutationVariables = Exact<{
5300
+ sessionId: Scalars['ID']['input'];
5301
+ }>;
5302
+ export type CloseChatSessionMutation = Pick<Mutation, 'closeChatSession'>;
5303
+ export type ClearChatHistoryMutationVariables = Exact<{
5304
+ sessionId: Scalars['ID']['input'];
5305
+ }>;
5306
+ export type ClearChatHistoryMutation = Pick<Mutation, 'clearChatHistory'>;
5307
+ export type EnqueueChatMessageMutationVariables = Exact<{
5308
+ input: EnqueueChatMessageInput;
5309
+ }>;
5310
+ export type EnqueueChatMessageMutation = Pick<Mutation, 'enqueueChatMessage'>;
5311
+ export type ChatQueueQueryVariables = Exact<{
5312
+ sessionId: Scalars['ID']['input'];
5313
+ }>;
5314
+ export type ChatQueueQuery = {
5315
+ chatQueue: Array<Pick<ChatQueueItem, 'id' | 'kind' | 'content'>>;
5316
+ };
5188
5317
  export type CollectionTranslationFieldFragment = Pick<CollectionTranslation, 'id' | 'languageCode' | 'name' | 'slug' | 'description'>;
5189
5318
  export type CollectionFieldFragment = (Pick<Collection, 'id' | 'createdAt' | 'updatedAt' | 'name' | 'slug' | 'description' | 'isPrivate' | 'isRoot' | 'inheritFilters' | 'position' | 'filters' | 'parentId'> & {
5190
5319
  featuredAsset?: Maybe<Pick<Asset, 'id' | 'name' | 'preview' | 'source'>>;
package/dist/admin.d.ts CHANGED
@@ -12,6 +12,7 @@ export { AudienceSegmentCategory } from './admin.generated';
12
12
  export { AuthCategory } from './admin.generated';
13
13
  export { SettingsCategory } from './admin.generated';
14
14
  export { ChannelCategory } from './admin.generated';
15
+ export { ChatCategory } from './admin.generated';
15
16
  export { CollectionCategory } from './admin.generated';
16
17
  export { CountryCategory } from './admin.generated';
17
18
  export { AddressCategory } from './admin.generated';
@@ -53,3 +54,4 @@ export { SubscriptionCategory } from './admin.generated';
53
54
  export { TaxCategory } from './admin.generated';
54
55
  export { TransactionCategory } from './admin.generated';
55
56
  export { ZoneCategory } from './admin.generated';
57
+ export type * from './admin-types.generated';
@@ -129,6 +129,18 @@ export declare class SettingsCategory {
129
129
  channelSettings(): QueryObservable<Types.ChannelSettingsQuery>;
130
130
  channelUpdateSettings(variables: Types.ChannelUpdateSettingsMutationVariables): QueryObservable<Types.ChannelUpdateSettingsMutation>;
131
131
  }
132
+ export declare class ChatCategory {
133
+ private readonly client;
134
+ constructor(client: BaseGraphQLClient);
135
+ startChatSession(): QueryObservable<Types.StartChatSessionMutation>;
136
+ sendChatMessage(variables: Types.SendChatMessageMutationVariables): QueryObservable<Types.SendChatMessageMutation>;
137
+ chatMessageStream(variables: Types.ChatMessageStreamSubscriptionVariables): Observable<Types.ChatMessageStreamSubscription>;
138
+ resumeChatSession(variables: Types.ResumeChatSessionSubscriptionVariables): Observable<Types.ResumeChatSessionSubscription>;
139
+ closeChatSession(variables: Types.CloseChatSessionMutationVariables): QueryObservable<Types.CloseChatSessionMutation>;
140
+ clearChatHistory(variables: Types.ClearChatHistoryMutationVariables): QueryObservable<Types.ClearChatHistoryMutation>;
141
+ enqueueChatMessage(variables: Types.EnqueueChatMessageMutationVariables): QueryObservable<Types.EnqueueChatMessageMutation>;
142
+ chatQueue(variables: Types.ChatQueueQueryVariables): QueryObservable<Types.ChatQueueQuery>;
143
+ }
132
144
  export declare class CollectionCategory {
133
145
  private readonly client;
134
146
  constructor(client: BaseGraphQLClient);
@@ -617,6 +629,7 @@ export declare class AdminNamespace {
617
629
  private readonly _auth;
618
630
  private readonly _channel;
619
631
  private readonly _settings;
632
+ private readonly _chat;
620
633
  private readonly _collection;
621
634
  private readonly _country;
622
635
  private readonly _customerGroup;
@@ -672,6 +685,7 @@ export declare class AdminNamespace {
672
685
  get auth(): AuthCategory;
673
686
  get channel(): ChannelCategory;
674
687
  get settings(): SettingsCategory;
688
+ get chat(): ChatCategory;
675
689
  get collection(): CollectionCategory;
676
690
  get country(): CountryCategory;
677
691
  get customerGroup(): CustomerGroupCategory;
@@ -727,6 +741,8 @@ export type BillingSubscription = Types.BillingSubscriptionFieldFragment;
727
741
  export type Channel = Types.ChannelFieldFragment;
728
742
  export type ChannelPlugin = Types.ChannelPluginFieldsFragment;
729
743
  export type ChannelSettings = Types.ChannelSettingsFieldFragment;
744
+ export type ChatMessage = Types.ChatMessageFieldFragment;
745
+ export type ChatSession = Types.ChatSessionFieldFragment;
730
746
  export type Collection = Types.CollectionFieldFragment;
731
747
  export type CollectionTranslation = Types.CollectionTranslationFieldFragment;
732
748
  export type Country = Types.CountryFieldFragment;
@@ -7,8 +7,8 @@
7
7
  * Any manual changes will be overwritten on the next generation run.
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.StockCategory = exports.ShippingCategory = exports.SellerCategory = exports.SearchCategory = exports.ScheduledJobCategory = exports.RoleCategory = exports.PromotionCategory = exports.OptionCategory = exports.OptionGroupCategory = exports.ProductCategory = exports.ProductVariantCategory = exports.ProductOptionCategory = exports.ManageableCategory = exports.PluginCategory = exports.PaymentCategory = exports.NoteCategory = exports.ModificationCategory = exports.DraftCategory = exports.CouponCategory = exports.OrderCategory = exports.OrderModificationCategory = exports.OnboardingCategory = exports.MarketingIdentityCategory = exports.MarketingEventCategory = exports.MarketingAttributionCategory = exports.HookCategory = exports.HookDispatchCategory = exports.FulfillmentCategory = exports.FulfillmentRequestCategory = exports.FacetCategory = exports.DeploymentCategory = exports.GroupCategory = exports.AddressCategory = exports.CustomerCategory = exports.CustomerGroupCategory = exports.CountryCategory = exports.CollectionCategory = exports.SettingsCategory = exports.ChannelCategory = exports.AuthCategory = exports.AudienceSegmentCategory = exports.AudienceMembershipCategory = exports.AssetCategory = exports.AnalyticsGatewayCategory = exports.AdministratorCategory = exports.PublishCategory = exports.FieldDefinitionCategory = exports.EntryCategory = exports.AcfCategory = exports.AcfSchemaCategory = void 0;
11
- exports.AdminNamespace = exports.ZoneCategory = exports.TransactionCategory = exports.TaxCategory = exports.SubscriptionCategory = void 0;
10
+ exports.ShippingCategory = exports.SellerCategory = exports.SearchCategory = exports.ScheduledJobCategory = exports.RoleCategory = exports.PromotionCategory = exports.OptionCategory = exports.OptionGroupCategory = exports.ProductCategory = exports.ProductVariantCategory = exports.ProductOptionCategory = exports.ManageableCategory = exports.PluginCategory = exports.PaymentCategory = exports.NoteCategory = exports.ModificationCategory = exports.DraftCategory = exports.CouponCategory = exports.OrderCategory = exports.OrderModificationCategory = exports.OnboardingCategory = exports.MarketingIdentityCategory = exports.MarketingEventCategory = exports.MarketingAttributionCategory = exports.HookCategory = exports.HookDispatchCategory = exports.FulfillmentCategory = exports.FulfillmentRequestCategory = exports.FacetCategory = exports.DeploymentCategory = exports.GroupCategory = exports.AddressCategory = exports.CustomerCategory = exports.CustomerGroupCategory = exports.CountryCategory = exports.CollectionCategory = exports.ChatCategory = exports.SettingsCategory = exports.ChannelCategory = exports.AuthCategory = exports.AudienceSegmentCategory = exports.AudienceMembershipCategory = exports.AssetCategory = exports.AnalyticsGatewayCategory = exports.AdministratorCategory = exports.PublishCategory = exports.FieldDefinitionCategory = exports.EntryCategory = exports.AcfCategory = exports.AcfSchemaCategory = void 0;
11
+ exports.AdminNamespace = exports.ZoneCategory = exports.TransactionCategory = exports.TaxCategory = exports.SubscriptionCategory = exports.StockCategory = void 0;
12
12
  const documents_generated_1 = require("./documents.generated");
13
13
  class AcfSchemaCategory {
14
14
  client;
@@ -308,6 +308,37 @@ class SettingsCategory {
308
308
  }
309
309
  }
310
310
  exports.SettingsCategory = SettingsCategory;
311
+ class ChatCategory {
312
+ client;
313
+ constructor(client) {
314
+ this.client = client;
315
+ }
316
+ startChatSession() {
317
+ return this.client.mutate(documents_generated_1.adminStartChatSessionDocument);
318
+ }
319
+ sendChatMessage(variables) {
320
+ return this.client.mutate(documents_generated_1.adminSendChatMessageDocument, variables);
321
+ }
322
+ chatMessageStream(variables) {
323
+ return this.client.subscribe(documents_generated_1.adminChatMessageStreamDocument, variables);
324
+ }
325
+ resumeChatSession(variables) {
326
+ return this.client.subscribe(documents_generated_1.adminResumeChatSessionDocument, variables);
327
+ }
328
+ closeChatSession(variables) {
329
+ return this.client.mutate(documents_generated_1.adminCloseChatSessionDocument, variables);
330
+ }
331
+ clearChatHistory(variables) {
332
+ return this.client.mutate(documents_generated_1.adminClearChatHistoryDocument, variables);
333
+ }
334
+ enqueueChatMessage(variables) {
335
+ return this.client.mutate(documents_generated_1.adminEnqueueChatMessageDocument, variables);
336
+ }
337
+ chatQueue(variables) {
338
+ return this.client.query(documents_generated_1.adminChatQueueDocument, variables);
339
+ }
340
+ }
341
+ exports.ChatCategory = ChatCategory;
311
342
  class CollectionCategory {
312
343
  client;
313
344
  constructor(client) {
@@ -1537,6 +1568,7 @@ class AdminNamespace {
1537
1568
  _auth;
1538
1569
  _channel;
1539
1570
  _settings;
1571
+ _chat;
1540
1572
  _collection;
1541
1573
  _country;
1542
1574
  _customerGroup;
@@ -1593,6 +1625,7 @@ class AdminNamespace {
1593
1625
  this._auth = new AuthCategory(client);
1594
1626
  this._channel = new ChannelCategory(client);
1595
1627
  this._settings = new SettingsCategory(client);
1628
+ this._chat = new ChatCategory(client);
1596
1629
  this._collection = new CollectionCategory(client);
1597
1630
  this._country = new CountryCategory(client);
1598
1631
  this._customerGroup = new CustomerGroupCategory(client);
@@ -1674,6 +1707,9 @@ class AdminNamespace {
1674
1707
  get settings() {
1675
1708
  return this._settings;
1676
1709
  }
1710
+ get chat() {
1711
+ return this._chat;
1712
+ }
1677
1713
  get collection() {
1678
1714
  return this._collection;
1679
1715
  }