@livechat/platform-workflows 0.0.8 → 0.0.10
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/index.d.mts +10 -104
- package/dist/index.d.ts +10 -104
- package/dist/index.js +4496 -4785
- package/dist/index.mjs +3732 -3980
- package/package.json +4 -3
- package/dist/index.cjs +0 -28095
- package/dist/index.d.cts +0 -206
package/dist/index.d.cts
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import { IntegrationNames, GithubClientAuthorization, NetlifyClientAuthorization, VercelClientAuthorization, NeonClientAuthorization, MailchimpClientAuthorization, ShopifyClientAuthorization, HubspotClientAuthorization, BigCommerceClientAuthorization, TextClientAuthorization, initApi as initApi$1, UserSurveyDto, UserDto, ClientInfoDto, AccountDto, AgentDto } from '@livechat/developer-studio-api';
|
|
3
|
-
import AccountsSDK from '@livechat/accounts-sdk';
|
|
4
|
-
|
|
5
|
-
interface WorkflowsConfigBase {
|
|
6
|
-
env: string;
|
|
7
|
-
publicUrl: string;
|
|
8
|
-
}
|
|
9
|
-
interface WorkflowsConfig extends WorkflowsConfigBase {
|
|
10
|
-
accountsUrl: string;
|
|
11
|
-
platformUrl: string;
|
|
12
|
-
adapterUrl: string;
|
|
13
|
-
workflowsApiUr: string;
|
|
14
|
-
dpsApiUrl: string;
|
|
15
|
-
billingApiUrl: string;
|
|
16
|
-
adapterApiUrl: string;
|
|
17
|
-
livechatApiUrl: string;
|
|
18
|
-
textApiUrl: string;
|
|
19
|
-
accountsClientId: string;
|
|
20
|
-
bigcommerceClientId: string;
|
|
21
|
-
githubAppClientId: string;
|
|
22
|
-
githubOauthClientId: string;
|
|
23
|
-
hubpotClientId: string;
|
|
24
|
-
mailchimpClientId: string;
|
|
25
|
-
neonClientId: string;
|
|
26
|
-
netlifyClientId: string;
|
|
27
|
-
shopifyClientId: string;
|
|
28
|
-
vercelClientId: string;
|
|
29
|
-
textClientId: string;
|
|
30
|
-
workflowsAppId: string;
|
|
31
|
-
workflowsWebhooksAppId: string;
|
|
32
|
-
aiAgentId: string;
|
|
33
|
-
pusherKey: string;
|
|
34
|
-
amplitudeKey: string;
|
|
35
|
-
}
|
|
36
|
-
declare function setWorkflowsConfig(newConfig: Partial<WorkflowsConfigBase>): void;
|
|
37
|
-
declare function getWorkflowsConfig(): WorkflowsConfig;
|
|
38
|
-
declare const getWorkflowEnv: (key: keyof WorkflowsConfig) => string;
|
|
39
|
-
|
|
40
|
-
type AuthSource = IntegrationNames.Accounts | IntegrationNames.GitHub | IntegrationNames.Vercel | IntegrationNames.Netlify | IntegrationNames.Neon | IntegrationNames.Mailchimp | IntegrationNames.Shopify | IntegrationNames.HubSpot | IntegrationNames.BigCommerce | IntegrationNames.Text;
|
|
41
|
-
interface AuthState {
|
|
42
|
-
github: {
|
|
43
|
-
raw: GithubClientAuthorization;
|
|
44
|
-
data: {
|
|
45
|
-
isAuthorized?: boolean;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
netlify: {
|
|
49
|
-
raw: NetlifyClientAuthorization;
|
|
50
|
-
data: {
|
|
51
|
-
isAuthorized?: boolean;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
vercel: {
|
|
55
|
-
raw: VercelClientAuthorization;
|
|
56
|
-
data: {
|
|
57
|
-
isAuthorized?: boolean;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
neon: {
|
|
61
|
-
raw: NeonClientAuthorization;
|
|
62
|
-
data: {
|
|
63
|
-
isAuthorized?: boolean;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
mailchimp: {
|
|
67
|
-
raw: MailchimpClientAuthorization;
|
|
68
|
-
data: {
|
|
69
|
-
isAuthorized?: boolean;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
shopify: {
|
|
73
|
-
raw: ShopifyClientAuthorization;
|
|
74
|
-
data: {
|
|
75
|
-
isAuthorized?: boolean;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
hubspot: {
|
|
79
|
-
raw: HubspotClientAuthorization;
|
|
80
|
-
data: {
|
|
81
|
-
isAuthorized?: boolean;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
bigcommerce: {
|
|
85
|
-
raw: BigCommerceClientAuthorization;
|
|
86
|
-
data: {
|
|
87
|
-
isAuthorized?: boolean;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
text: {
|
|
91
|
-
raw: TextClientAuthorization;
|
|
92
|
-
data: {
|
|
93
|
-
isAuthorized?: boolean;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
context: {
|
|
97
|
-
appId?: string;
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
type AuthStateActionParams = {
|
|
101
|
-
[K in keyof Omit<AuthState, "context">]: {
|
|
102
|
-
source: K;
|
|
103
|
-
data: AuthState[K]["raw"];
|
|
104
|
-
};
|
|
105
|
-
}[keyof Omit<AuthState, "context">];
|
|
106
|
-
interface IAuthContext {
|
|
107
|
-
state: AuthState;
|
|
108
|
-
login: ({ source, data }: AuthStateActionParams) => void;
|
|
109
|
-
logout: (source: keyof Omit<AuthState, "context">) => void;
|
|
110
|
-
}
|
|
111
|
-
declare const AuthContext: React.Context<IAuthContext>;
|
|
112
|
-
declare function AuthProvider({ children }: {
|
|
113
|
-
children: React.ReactNode;
|
|
114
|
-
}): JSX.Element;
|
|
115
|
-
|
|
116
|
-
interface ModeContextProps {
|
|
117
|
-
mode: Mode;
|
|
118
|
-
isMarketplaceFullscreenApp: boolean;
|
|
119
|
-
}
|
|
120
|
-
declare const PATHS: {
|
|
121
|
-
MARKETPLACE_FULLSCREEN_APP: string;
|
|
122
|
-
};
|
|
123
|
-
declare enum Mode {
|
|
124
|
-
MarketplaceFullscreenApp = "marketplace-fullscreen-app",
|
|
125
|
-
Regular = "regular"
|
|
126
|
-
}
|
|
127
|
-
declare const ModeContext: React.Context<ModeContextProps>;
|
|
128
|
-
declare function ModeProvider({ children }: {
|
|
129
|
-
children: ReactNode;
|
|
130
|
-
}): JSX.Element;
|
|
131
|
-
declare const useMode: () => ModeContextProps;
|
|
132
|
-
|
|
133
|
-
declare const initApi: (tokens: Parameters<typeof initApi$1>[1]) => void;
|
|
134
|
-
|
|
135
|
-
declare const accountsSDK: AccountsSDK;
|
|
136
|
-
declare const clearRootData: () => void;
|
|
137
|
-
declare const setRootData: ({ access_token, scope, expires_in, }: {
|
|
138
|
-
access_token: string;
|
|
139
|
-
scope?: string | undefined;
|
|
140
|
-
expires_in?: string | undefined;
|
|
141
|
-
}) => void;
|
|
142
|
-
interface RootContextProps {
|
|
143
|
-
isAuthenticated: boolean;
|
|
144
|
-
hasLoginFailed: boolean;
|
|
145
|
-
login: (tokens: Parameters<typeof initApi>[0]) => Promise<void>;
|
|
146
|
-
logout: () => void;
|
|
147
|
-
authorize: (manually?: boolean) => void;
|
|
148
|
-
bootstrap: () => void;
|
|
149
|
-
}
|
|
150
|
-
declare const RootContext: React.Context<RootContextProps>;
|
|
151
|
-
declare function RootProvider({ children }: {
|
|
152
|
-
children: ReactNode;
|
|
153
|
-
}): JSX.Element;
|
|
154
|
-
declare const useRootContext: () => RootContextProps;
|
|
155
|
-
|
|
156
|
-
interface UserAggregate {
|
|
157
|
-
profile: {
|
|
158
|
-
id: string;
|
|
159
|
-
surveys: UserSurveyDto[];
|
|
160
|
-
} & UserDto["profile"];
|
|
161
|
-
auth: ClientInfoDto | Record<string, unknown>;
|
|
162
|
-
features: UserDto["features"];
|
|
163
|
-
meta: {
|
|
164
|
-
name?: string;
|
|
165
|
-
email?: string;
|
|
166
|
-
links: UserDto["links"];
|
|
167
|
-
organization_id: ClientInfoDto["organization_id"];
|
|
168
|
-
license: number;
|
|
169
|
-
roles?: {
|
|
170
|
-
role: string;
|
|
171
|
-
product: string;
|
|
172
|
-
}[];
|
|
173
|
-
avatar_url?: string;
|
|
174
|
-
properties?: {
|
|
175
|
-
avatar_url?: string;
|
|
176
|
-
};
|
|
177
|
-
} & Partial<AccountDto> & Partial<AgentDto>;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
interface UserContextProps {
|
|
181
|
-
user: UserAggregate;
|
|
182
|
-
isUserFetching: boolean;
|
|
183
|
-
updateUser: unknown;
|
|
184
|
-
isUserUpdating: boolean;
|
|
185
|
-
isUserLoaded: boolean;
|
|
186
|
-
isUserAdmin: boolean;
|
|
187
|
-
isUserOwnerOrViceOwner: boolean;
|
|
188
|
-
isUserAgentInLiveChat: boolean;
|
|
189
|
-
userHasAccessToWorkflows: boolean;
|
|
190
|
-
}
|
|
191
|
-
declare const isUserLiveChatAgent: (userInfo: UserAggregate) => boolean;
|
|
192
|
-
declare const isUserOrgAdmin: (userInfo: UserAggregate) => boolean;
|
|
193
|
-
declare const isUserLivechatAdmin: (userInfo: UserAggregate) => boolean;
|
|
194
|
-
declare const isUserOrgOwnerOrViceOwner: (userInfo: UserAggregate) => boolean;
|
|
195
|
-
declare const UserContext: React.Context<UserContextProps>;
|
|
196
|
-
declare function UserProvider({ children }: {
|
|
197
|
-
children: ReactNode;
|
|
198
|
-
}): JSX.Element;
|
|
199
|
-
declare const useUserContext: () => UserContextProps;
|
|
200
|
-
|
|
201
|
-
declare function Flows(): JSX.Element;
|
|
202
|
-
|
|
203
|
-
declare function SettingsSubNav(): JSX.Element;
|
|
204
|
-
declare function Settings(): JSX.Element;
|
|
205
|
-
|
|
206
|
-
export { AuthContext, AuthProvider, type AuthSource, type AuthState, Flows, type IAuthContext, Mode, ModeContext, ModeProvider, PATHS, RootContext, RootProvider, Settings, SettingsSubNav, UserContext, UserProvider, type WorkflowsConfig, type WorkflowsConfigBase, accountsSDK, clearRootData, getWorkflowEnv, getWorkflowsConfig, isUserLiveChatAgent, isUserLivechatAdmin, isUserOrgAdmin, isUserOrgOwnerOrViceOwner, setRootData, setWorkflowsConfig, useMode, useRootContext, useUserContext };
|