@manta-eu/client 0.4.0 → 0.5.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/generated/graphql.d.ts +33 -1
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +20 -0
- package/dist/generated/graphql.js.map +1 -1
- package/dist/shared/chat-manager.d.ts +12 -0
- package/dist/shared/chat-manager.d.ts.map +1 -1
- package/dist/shared/chat-manager.js +14 -0
- package/dist/shared/chat-manager.js.map +1 -1
- package/package.json +5 -5
- package/src/generated/graphql.ts +73 -0
- package/src/shared/chat-manager.ts +18 -0
package/src/generated/graphql.ts
CHANGED
|
@@ -106,6 +106,7 @@ export type GQLAbortUploadResponse = {
|
|
|
106
106
|
|
|
107
107
|
export type GQLAccessibleDatastore = {
|
|
108
108
|
__typename?: "AccessibleDatastore";
|
|
109
|
+
datastoresInSubtree?: Maybe<Scalars["Int"]["output"]>;
|
|
109
110
|
depth: Scalars["Int"]["output"];
|
|
110
111
|
id: Scalars["String"]["output"];
|
|
111
112
|
live?: Maybe<Scalars["Boolean"]["output"]>;
|
|
@@ -572,6 +573,13 @@ export type GQLCreateMemoryResponse = {
|
|
|
572
573
|
memory?: Maybe<GQLMemory>;
|
|
573
574
|
};
|
|
574
575
|
|
|
576
|
+
export type GQLCreateStripeBillingPortalSessionResponse = {
|
|
577
|
+
__typename?: "CreateStripeBillingPortalSessionResponse";
|
|
578
|
+
error?: Maybe<Scalars["String"]["output"]>;
|
|
579
|
+
success: Scalars["Boolean"]["output"];
|
|
580
|
+
url?: Maybe<Scalars["String"]["output"]>;
|
|
581
|
+
};
|
|
582
|
+
|
|
575
583
|
export type GQLCreateStripeCheckoutSessionResponse = {
|
|
576
584
|
__typename?: "CreateStripeCheckoutSessionResponse";
|
|
577
585
|
error?: Maybe<Scalars["String"]["output"]>;
|
|
@@ -858,6 +866,7 @@ export type GQLDatastoreSubscription = {
|
|
|
858
866
|
|
|
859
867
|
export type GQLDatastoreTreeNode = {
|
|
860
868
|
__typename?: "DatastoreTreeNode";
|
|
869
|
+
accessibleId: Scalars["String"]["output"];
|
|
861
870
|
datastoreId?: Maybe<Scalars["String"]["output"]>;
|
|
862
871
|
depth: Scalars["Int"]["output"];
|
|
863
872
|
id: Scalars["String"]["output"];
|
|
@@ -1672,6 +1681,7 @@ export type GQLMutation = {
|
|
|
1672
1681
|
createDataConnection: GQLDataConnectionTestState;
|
|
1673
1682
|
createInferalIntegration: GQLCreateInferalIntegrationResponse;
|
|
1674
1683
|
createMemory: GQLCreateMemoryResponse;
|
|
1684
|
+
createStripeBillingPortalSession: GQLCreateStripeBillingPortalSessionResponse;
|
|
1675
1685
|
createStripeCheckoutSession: GQLCreateStripeCheckoutSessionResponse;
|
|
1676
1686
|
dashSetupConnect: GQLDashSetupProgress;
|
|
1677
1687
|
deleteActionPlan: GQLDeleteActionPlanResponse;
|
|
@@ -1819,6 +1829,11 @@ export type GQLMutationCreateMemoryArgs = {
|
|
|
1819
1829
|
input: GQLCreateMemoryInput;
|
|
1820
1830
|
};
|
|
1821
1831
|
|
|
1832
|
+
export type GQLMutationCreateStripeBillingPortalSessionArgs = {
|
|
1833
|
+
datastoreId: Scalars["String"]["input"];
|
|
1834
|
+
returnUrl: Scalars["String"]["input"];
|
|
1835
|
+
};
|
|
1836
|
+
|
|
1822
1837
|
export type GQLMutationCreateStripeCheckoutSessionArgs = {
|
|
1823
1838
|
cancelUrl: Scalars["String"]["input"];
|
|
1824
1839
|
datastoreId: Scalars["String"]["input"];
|
|
@@ -3530,6 +3545,21 @@ export type GQLCreateMemoryMutation = {
|
|
|
3530
3545
|
};
|
|
3531
3546
|
};
|
|
3532
3547
|
|
|
3548
|
+
export type GQLCreateStripeBillingPortalSessionMutationVariables = Exact<{
|
|
3549
|
+
datastoreId: Scalars["String"]["input"];
|
|
3550
|
+
returnUrl: Scalars["String"]["input"];
|
|
3551
|
+
}>;
|
|
3552
|
+
|
|
3553
|
+
export type GQLCreateStripeBillingPortalSessionMutation = {
|
|
3554
|
+
__typename?: "Mutation";
|
|
3555
|
+
createStripeBillingPortalSession: {
|
|
3556
|
+
__typename?: "CreateStripeBillingPortalSessionResponse";
|
|
3557
|
+
success: boolean;
|
|
3558
|
+
url?: string | null;
|
|
3559
|
+
error?: string | null;
|
|
3560
|
+
};
|
|
3561
|
+
};
|
|
3562
|
+
|
|
3533
3563
|
export type GQLCreateStripeCheckoutSessionMutationVariables = Exact<{
|
|
3534
3564
|
datastoreId: Scalars["String"]["input"];
|
|
3535
3565
|
priceId: Scalars["String"]["input"];
|
|
@@ -5211,6 +5241,7 @@ export type GQLDatastoreTreeQuery = {
|
|
|
5211
5241
|
datastoreTree: Array<{
|
|
5212
5242
|
__typename?: "DatastoreTreeNode";
|
|
5213
5243
|
id: string;
|
|
5244
|
+
accessibleId: string;
|
|
5214
5245
|
name: string;
|
|
5215
5246
|
depth: number;
|
|
5216
5247
|
organizationId: string;
|
|
@@ -6623,6 +6654,47 @@ export const useCreateMemoryMutation = <TError = unknown, TContext = unknown>(
|
|
|
6623
6654
|
});
|
|
6624
6655
|
};
|
|
6625
6656
|
|
|
6657
|
+
export const CreateStripeBillingPortalSessionDocument = `
|
|
6658
|
+
mutation CreateStripeBillingPortalSession($datastoreId: String!, $returnUrl: String!) {
|
|
6659
|
+
createStripeBillingPortalSession(
|
|
6660
|
+
datastoreId: $datastoreId
|
|
6661
|
+
returnUrl: $returnUrl
|
|
6662
|
+
) {
|
|
6663
|
+
success
|
|
6664
|
+
url
|
|
6665
|
+
error
|
|
6666
|
+
}
|
|
6667
|
+
}
|
|
6668
|
+
`;
|
|
6669
|
+
|
|
6670
|
+
export const useCreateStripeBillingPortalSessionMutation = <TError = unknown, TContext = unknown>(
|
|
6671
|
+
client: GraphQLClient,
|
|
6672
|
+
options?: UseMutationOptions<
|
|
6673
|
+
GQLCreateStripeBillingPortalSessionMutation,
|
|
6674
|
+
TError,
|
|
6675
|
+
GQLCreateStripeBillingPortalSessionMutationVariables,
|
|
6676
|
+
TContext
|
|
6677
|
+
>,
|
|
6678
|
+
headers?: RequestInit["headers"],
|
|
6679
|
+
) => {
|
|
6680
|
+
return useMutation<
|
|
6681
|
+
GQLCreateStripeBillingPortalSessionMutation,
|
|
6682
|
+
TError,
|
|
6683
|
+
GQLCreateStripeBillingPortalSessionMutationVariables,
|
|
6684
|
+
TContext
|
|
6685
|
+
>({
|
|
6686
|
+
mutationKey: ["CreateStripeBillingPortalSession"],
|
|
6687
|
+
mutationFn: (variables?: GQLCreateStripeBillingPortalSessionMutationVariables) =>
|
|
6688
|
+
fetcher<GQLCreateStripeBillingPortalSessionMutation, GQLCreateStripeBillingPortalSessionMutationVariables>(
|
|
6689
|
+
client,
|
|
6690
|
+
CreateStripeBillingPortalSessionDocument,
|
|
6691
|
+
variables,
|
|
6692
|
+
headers,
|
|
6693
|
+
)(),
|
|
6694
|
+
...options,
|
|
6695
|
+
});
|
|
6696
|
+
};
|
|
6697
|
+
|
|
6626
6698
|
export const CreateStripeCheckoutSessionDocument = `
|
|
6627
6699
|
mutation CreateStripeCheckoutSession($datastoreId: String!, $priceId: String!, $successUrl: String!, $cancelUrl: String!) {
|
|
6628
6700
|
createStripeCheckoutSession(
|
|
@@ -10296,6 +10368,7 @@ export const DatastoreTreeDocument = `
|
|
|
10296
10368
|
query DatastoreTree {
|
|
10297
10369
|
datastoreTree {
|
|
10298
10370
|
id
|
|
10371
|
+
accessibleId
|
|
10299
10372
|
name
|
|
10300
10373
|
depth
|
|
10301
10374
|
organizationId
|
|
@@ -9,6 +9,22 @@ export const thinkChatFacetPath = "think-chat";
|
|
|
9
9
|
export const defaultConversationName = "New chat";
|
|
10
10
|
export const defaultFolderName = "New folder";
|
|
11
11
|
|
|
12
|
+
export const conversationModeSchema = z.enum(["datastore", "group"]);
|
|
13
|
+
export type ConversationMode = z.infer<typeof conversationModeSchema>;
|
|
14
|
+
export const chatModeQueryParam = "mode";
|
|
15
|
+
|
|
16
|
+
export function chatModeQuery(mode: ConversationMode | undefined): Record<string, string> {
|
|
17
|
+
return mode === "group" ? { [chatModeQueryParam]: mode } : {};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function withChatModeQueryParam(href: string, mode: ConversationMode | undefined): string {
|
|
21
|
+
if (mode !== "group") return href;
|
|
22
|
+
|
|
23
|
+
const url = new URL(href, "http://placeholder");
|
|
24
|
+
url.searchParams.set(chatModeQueryParam, mode);
|
|
25
|
+
return `${url.pathname}${url.search}${url.hash}`;
|
|
26
|
+
}
|
|
27
|
+
|
|
12
28
|
export const chatManagerScopeSchema = z.strictObject({
|
|
13
29
|
version: z.literal(1),
|
|
14
30
|
realm: z.string().min(1),
|
|
@@ -16,6 +32,8 @@ export const chatManagerScopeSchema = z.strictObject({
|
|
|
16
32
|
userId: z.string().min(1),
|
|
17
33
|
// Present for a custom app's token, so each app keeps its own chats; absent keeps the web app's chats where they are.
|
|
18
34
|
customAppClientId: z.string().min(1).optional(),
|
|
35
|
+
// Present only for a group view's manager, so every other manager keeps its name.
|
|
36
|
+
mode: z.literal("group").optional(),
|
|
19
37
|
});
|
|
20
38
|
|
|
21
39
|
export type ChatManagerScope = z.infer<typeof chatManagerScopeSchema>;
|