@slates/provider 1.0.0-rc.15 → 1.0.0-rc.17
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.cjs +414 -5
- package/dist/index.d.cts +190 -1
- package/dist/index.d.ts +190 -1
- package/dist/index.module.js +388 -2
- package/package.json +2 -2
- package/src/action/action.ts +50 -1
- package/src/action/builder.ts +26 -2
- package/src/action/trigger.ts +9 -1
- package/src/auth/index.ts +1 -0
- package/src/auth/oauth.test.ts +83 -0
- package/src/auth/oauth.ts +150 -0
- package/src/auth/types.ts +31 -6
- package/src/axios/http.test.ts +83 -0
- package/src/axios/index.ts +59 -1
- package/src/context/context.ts +8 -0
- package/src/crypto/hmac.test.ts +40 -0
- package/src/crypto/hmac.ts +32 -0
- package/src/crypto/index.ts +1 -0
- package/src/error/api.test.ts +114 -0
- package/src/error/api.ts +236 -0
- package/src/error/index.ts +1 -0
- package/src/file/index.test.ts +36 -0
- package/src/file/index.ts +27 -0
- package/src/index.ts +4 -0
- package/src/object/index.test.ts +38 -0
- package/src/object/index.ts +12 -0
- package/src/webhook/graph.test.ts +37 -0
- package/src/webhook/graph.ts +22 -0
- package/src/webhook/index.ts +2 -0
- package/src/webhook/meta.test.ts +52 -0
- package/src/webhook/meta.ts +43 -0
package/dist/index.d.ts
CHANGED
|
@@ -145,8 +145,10 @@ type SlateAuthWithToken<InputType extends {}, OutputType extends {
|
|
|
145
145
|
docs?: SlateAuthDocsReference[];
|
|
146
146
|
getOutput: (ctx: {
|
|
147
147
|
input: InputType;
|
|
148
|
+
config?: SlateAuthCallbackConfig;
|
|
148
149
|
}) => Promise<{
|
|
149
150
|
output: OutputType;
|
|
151
|
+
scopes?: string[];
|
|
150
152
|
}>;
|
|
151
153
|
onInputChanged?: (params: {
|
|
152
154
|
previousInput: InputType;
|
|
@@ -158,6 +160,8 @@ type SlateAuthWithToken<InputType extends {}, OutputType extends {
|
|
|
158
160
|
getProfile?: (ctx: {
|
|
159
161
|
output: OutputType;
|
|
160
162
|
input: InputType;
|
|
163
|
+
scopes: string[];
|
|
164
|
+
config?: SlateAuthCallbackConfig;
|
|
161
165
|
}) => Promise<{
|
|
162
166
|
profile: Record<string, any>;
|
|
163
167
|
}>;
|
|
@@ -170,8 +174,10 @@ type SlateAuthWithServiceAccount<InputType extends {}, OutputType extends {}> =
|
|
|
170
174
|
docs?: SlateAuthDocsReference[];
|
|
171
175
|
getOutput: (ctx: {
|
|
172
176
|
input: InputType;
|
|
177
|
+
config?: SlateAuthCallbackConfig;
|
|
173
178
|
}) => Promise<{
|
|
174
179
|
output: OutputType;
|
|
180
|
+
scopes?: string[];
|
|
175
181
|
}>;
|
|
176
182
|
onInputChanged?: (params: {
|
|
177
183
|
previousInput: InputType;
|
|
@@ -183,6 +189,8 @@ type SlateAuthWithServiceAccount<InputType extends {}, OutputType extends {}> =
|
|
|
183
189
|
getProfile?: (ctx: {
|
|
184
190
|
output: OutputType;
|
|
185
191
|
input: InputType;
|
|
192
|
+
scopes: string[];
|
|
193
|
+
config?: SlateAuthCallbackConfig;
|
|
186
194
|
}) => Promise<{
|
|
187
195
|
profile: Record<string, any>;
|
|
188
196
|
}>;
|
|
@@ -195,8 +203,10 @@ type SlateAuthWithCustomData<InputType extends {}, OutputType extends {}> = {
|
|
|
195
203
|
docs?: SlateAuthDocsReference[];
|
|
196
204
|
getOutput: (ctx: {
|
|
197
205
|
input: InputType;
|
|
206
|
+
config?: SlateAuthCallbackConfig;
|
|
198
207
|
}) => Promise<{
|
|
199
208
|
output: OutputType;
|
|
209
|
+
scopes?: string[];
|
|
200
210
|
}>;
|
|
201
211
|
handleTokenRefresh?: (ctx: {
|
|
202
212
|
output: OutputType;
|
|
@@ -204,6 +214,7 @@ type SlateAuthWithCustomData<InputType extends {}, OutputType extends {}> = {
|
|
|
204
214
|
clientId: string;
|
|
205
215
|
clientSecret: string;
|
|
206
216
|
scopes: string[];
|
|
217
|
+
config?: SlateAuthCallbackConfig;
|
|
207
218
|
}) => Promise<{
|
|
208
219
|
output: OutputType;
|
|
209
220
|
input?: InputType;
|
|
@@ -218,6 +229,8 @@ type SlateAuthWithCustomData<InputType extends {}, OutputType extends {}> = {
|
|
|
218
229
|
getProfile?: (ctx: {
|
|
219
230
|
output: OutputType;
|
|
220
231
|
input: InputType;
|
|
232
|
+
scopes: string[];
|
|
233
|
+
config?: SlateAuthCallbackConfig;
|
|
221
234
|
}) => Promise<{
|
|
222
235
|
profile: Record<string, any>;
|
|
223
236
|
}>;
|
|
@@ -261,6 +274,34 @@ declare class SlateAuth<OutputType extends {} = {}> {
|
|
|
261
274
|
}
|
|
262
275
|
declare let auth: <OutputType extends {} = {}>() => SlateAuth<OutputType>;
|
|
263
276
|
|
|
277
|
+
type OAuthTokenResponse = {
|
|
278
|
+
access_token?: unknown;
|
|
279
|
+
refresh_token?: unknown;
|
|
280
|
+
expires_in?: unknown;
|
|
281
|
+
[key: string]: unknown;
|
|
282
|
+
};
|
|
283
|
+
type OAuthRefreshTokenFallbackMode = 'nullish' | 'falsy';
|
|
284
|
+
type OAuthExpiresAtOptions = {
|
|
285
|
+
nowMs?: number;
|
|
286
|
+
providerLabel?: string;
|
|
287
|
+
operation?: string;
|
|
288
|
+
required?: boolean;
|
|
289
|
+
expiresInType?: 'number' | 'numberLike';
|
|
290
|
+
message?: string;
|
|
291
|
+
};
|
|
292
|
+
type NormalizeOAuthTokenResponseOptions = OAuthExpiresAtOptions & {
|
|
293
|
+
previousRefreshToken?: string;
|
|
294
|
+
refreshTokenFallbackMode?: OAuthRefreshTokenFallbackMode;
|
|
295
|
+
accessTokenMessage?: string;
|
|
296
|
+
expiresInMessage?: string;
|
|
297
|
+
};
|
|
298
|
+
declare let getOAuthExpiresAtFromExpiresIn: (expiresIn: unknown, options?: OAuthExpiresAtOptions) => string | undefined;
|
|
299
|
+
declare let normalizeOAuthTokenResponse: (data: unknown, options?: NormalizeOAuthTokenResponseOptions) => {
|
|
300
|
+
token: string;
|
|
301
|
+
refreshToken: string | undefined;
|
|
302
|
+
expiresAt: string | undefined;
|
|
303
|
+
};
|
|
304
|
+
|
|
264
305
|
declare class SlateConfig<ConfigType extends {}> {
|
|
265
306
|
#private;
|
|
266
307
|
private constructor();
|
|
@@ -328,6 +369,7 @@ declare class SlateContext<ConfigType extends {}, AuthType extends {}, InputType
|
|
|
328
369
|
get event(): Readonly<InputType>;
|
|
329
370
|
get state(): "state" extends keyof InputType ? InputType["state"] : never;
|
|
330
371
|
get request(): "request" extends keyof InputType ? InputType["request"] : never;
|
|
372
|
+
get registrationDetails(): "registrationDetails" extends keyof InputType ? InputType["registrationDetails"] : never;
|
|
331
373
|
get auth(): Readonly<AuthType>;
|
|
332
374
|
recordHttpTrace(trace: SlateHttpTrace): void;
|
|
333
375
|
getHttpTraces(): {
|
|
@@ -396,6 +438,7 @@ interface SlateActionParameters {
|
|
|
396
438
|
};
|
|
397
439
|
metadata?: Record<string, any>;
|
|
398
440
|
scopes?: SlateActionScopes;
|
|
441
|
+
authMethods?: string[];
|
|
399
442
|
docs?: SlateActionDocsReference[];
|
|
400
443
|
}
|
|
401
444
|
type SlateToolInvocationHandler<ConfigType extends {}, AuthType extends {}, InputType extends {}, OutputType extends {}> = (context: SlateContext<ConfigType, AuthType, InputType>) => Promise<{
|
|
@@ -414,12 +457,41 @@ type SlateTriggerPollingHandler<ConfigType extends {}, AuthType extends {}, Inpu
|
|
|
414
457
|
inputs: InputType[];
|
|
415
458
|
updatedState?: any;
|
|
416
459
|
}>;
|
|
460
|
+
interface SlateWebhookHttpResponseInit {
|
|
461
|
+
status?: number;
|
|
462
|
+
headers?: Record<string, string>;
|
|
463
|
+
body?: string | Uint8Array | null;
|
|
464
|
+
}
|
|
465
|
+
type SlateWebhookHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
466
|
+
interface SlateWebhookRequestMatcher {
|
|
467
|
+
method?: string;
|
|
468
|
+
hasQueryParam?: string;
|
|
469
|
+
hasHeader?: string;
|
|
470
|
+
jsonBodyField?: {
|
|
471
|
+
path: string;
|
|
472
|
+
equals?: string;
|
|
473
|
+
};
|
|
474
|
+
formBodyField?: {
|
|
475
|
+
path: string;
|
|
476
|
+
equals?: string;
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
interface SlateWebhookHttpOptions {
|
|
480
|
+
methods?: SlateWebhookHttpMethod[];
|
|
481
|
+
sync?: {
|
|
482
|
+
mode: 'never' | 'match' | 'always';
|
|
483
|
+
match?: SlateWebhookRequestMatcher[];
|
|
484
|
+
timeoutMs?: number;
|
|
485
|
+
};
|
|
486
|
+
}
|
|
417
487
|
type SlateTriggerWebhookRequestHandler<ConfigType extends {}, AuthType extends {}, InputType extends {}> = (context: SlateContext<ConfigType, AuthType, {
|
|
418
488
|
request: Request;
|
|
419
489
|
state: any | null;
|
|
490
|
+
registrationDetails: any | null;
|
|
420
491
|
}>) => Promise<{
|
|
421
492
|
inputs: InputType[];
|
|
422
493
|
updatedState?: any;
|
|
494
|
+
response?: Response | SlateWebhookHttpResponseInit;
|
|
423
495
|
}>;
|
|
424
496
|
type SlateTriggerWebhookAutoRegistrationHandler<ConfigType extends {}, AuthType extends {}> = (context: SlateContext<ConfigType, AuthType, {
|
|
425
497
|
webhookBaseUrl: string;
|
|
@@ -445,6 +517,7 @@ interface SlateActionParametersTrigger<ConfigType extends {}, AuthType extends {
|
|
|
445
517
|
polling?: SlatePollingOptions;
|
|
446
518
|
handleEvent: SlateTriggerMappingHandler<ConfigType, AuthType, InputType, OutputType>;
|
|
447
519
|
handleRequest?: SlateTriggerWebhookRequestHandler<ConfigType, AuthType, InputType>;
|
|
520
|
+
http?: SlateWebhookHttpOptions;
|
|
448
521
|
pollEvents?: SlateTriggerPollingHandler<ConfigType, AuthType, InputType>;
|
|
449
522
|
autoRegisterWebhook?: SlateTriggerWebhookAutoRegistrationHandler<ConfigType, AuthType>;
|
|
450
523
|
autoUnregisterWebhook?: SlateTriggerWebhookAutoUnregistrationHandler<ConfigType, AuthType>;
|
|
@@ -479,6 +552,7 @@ declare abstract class SlateAction<Type extends SlateActionType, ConfigType exte
|
|
|
479
552
|
get constraints(): string[] | undefined;
|
|
480
553
|
get metadata(): Record<string, any> | undefined;
|
|
481
554
|
get scopes(): SlateActionScopes | undefined;
|
|
555
|
+
get authMethods(): string[] | undefined;
|
|
482
556
|
get docs(): SlateActionDocsReference[] | undefined;
|
|
483
557
|
}
|
|
484
558
|
|
|
@@ -492,12 +566,15 @@ declare class SlateActionBuilder<Type extends SlateActionType, ConfigType extend
|
|
|
492
566
|
input<NewInputType extends {}>(schema: z.ZodType<NewInputType>): SlateActionBuilder<Type, ConfigType, AuthType, NewInputType, OutputType, Result>;
|
|
493
567
|
output<NewOutputType extends {}>(schema: z.ZodType<NewOutputType>): SlateActionBuilder<Type, ConfigType, AuthType, InputType, NewOutputType, Result>;
|
|
494
568
|
scopes(scopes: SlateActionScopes): SlateActionBuilder<Type, ConfigType, AuthType, InputType, OutputType, Result>;
|
|
569
|
+
authMethods(authMethods: string[]): SlateActionBuilder<Type, ConfigType, AuthType, InputType, OutputType, Result>;
|
|
570
|
+
private validateAuthMethods;
|
|
495
571
|
handleInvocation(handler: SlateToolInvocationHandler<ConfigType, AuthType, InputType, OutputType>): SlateActionBuilder<Type, ConfigType, AuthType, InputType, OutputType, Result>;
|
|
496
572
|
webhook(props: {
|
|
497
573
|
handleEvent: SlateTriggerMappingHandler<ConfigType, AuthType, InputType, OutputType>;
|
|
498
574
|
handleRequest: SlateTriggerWebhookRequestHandler<ConfigType, AuthType, InputType>;
|
|
499
575
|
autoRegisterWebhook?: SlateTriggerWebhookAutoRegistrationHandler<ConfigType, AuthType>;
|
|
500
576
|
autoUnregisterWebhook?: SlateTriggerWebhookAutoUnregistrationHandler<ConfigType, AuthType>;
|
|
577
|
+
http?: SlateWebhookHttpOptions;
|
|
501
578
|
}): SlateActionBuilder<Type, ConfigType, AuthType, InputType, OutputType, Result>;
|
|
502
579
|
polling(props: {
|
|
503
580
|
options?: SlatePollingOptions;
|
|
@@ -536,6 +613,7 @@ interface SlateTriggerParameters<ConfigType extends {}, AuthType extends {}, Inp
|
|
|
536
613
|
polling?: SlatePollingOptions;
|
|
537
614
|
handleEvent: SlateTriggerMappingHandler<ConfigType, AuthType, InputType, OutputType>;
|
|
538
615
|
handleRequest?: SlateTriggerWebhookRequestHandler<ConfigType, AuthType, InputType>;
|
|
616
|
+
http?: SlateWebhookHttpOptions;
|
|
539
617
|
pollEvents?: SlateTriggerPollingHandler<ConfigType, AuthType, InputType>;
|
|
540
618
|
autoRegisterWebhook?: SlateTriggerWebhookAutoRegistrationHandler<ConfigType, AuthType>;
|
|
541
619
|
autoUnregisterWebhook?: SlateTriggerWebhookAutoUnregistrationHandler<ConfigType, AuthType>;
|
|
@@ -550,12 +628,69 @@ declare class SlateTrigger<ConfigType extends {}, AuthType extends {}, InputType
|
|
|
550
628
|
get source(): "polling" | "webhook";
|
|
551
629
|
get handleEvent(): SlateTriggerMappingHandler<ConfigType, AuthType, InputType, OutputType>;
|
|
552
630
|
get handleRequest(): SlateTriggerWebhookRequestHandler<ConfigType, AuthType, InputType> | undefined;
|
|
631
|
+
get http(): SlateWebhookHttpOptions | undefined;
|
|
553
632
|
get pollEvents(): SlateTriggerPollingHandler<ConfigType, AuthType, InputType> | undefined;
|
|
554
633
|
get autoRegisterWebhook(): SlateTriggerWebhookAutoRegistrationHandler<ConfigType, AuthType> | undefined;
|
|
555
634
|
get autoUnregisterWebhook(): SlateTriggerWebhookAutoUnregistrationHandler<ConfigType, AuthType> | undefined;
|
|
556
635
|
}
|
|
557
636
|
declare let trigger: <ConfigType extends {}, AuthType extends {}>(spec: SlateSpecification<ConfigType, AuthType>, params: SlateActionParameters) => SlateActionBuilder<"trigger", ConfigType, AuthType, {}, {}, SlateTrigger<any, any, any, any>>;
|
|
558
637
|
|
|
638
|
+
type ApiErrorStatus = number | string;
|
|
639
|
+
type ApiServiceError = ServiceError<ErrorRecord<any, any>>;
|
|
640
|
+
type ApiErrorResponse = {
|
|
641
|
+
status?: ApiErrorStatus;
|
|
642
|
+
statusText?: string;
|
|
643
|
+
data?: unknown;
|
|
644
|
+
};
|
|
645
|
+
type ApiErrorDetailOptions = {
|
|
646
|
+
detailKeys?: readonly string[];
|
|
647
|
+
nestedKeys?: readonly string[];
|
|
648
|
+
includeNumbers?: boolean;
|
|
649
|
+
separator?: string;
|
|
650
|
+
fallbackMessage?: string;
|
|
651
|
+
};
|
|
652
|
+
type ApiErrorBuildHelpers = {
|
|
653
|
+
collectDetails: (value: unknown, details: string[], options?: ApiErrorDetailOptions) => void;
|
|
654
|
+
extractMessage: (error: unknown, options?: ApiErrorDetailOptions) => string;
|
|
655
|
+
getResponse: (error: unknown) => ApiErrorResponse | undefined;
|
|
656
|
+
getStatus: (error: unknown) => ApiErrorStatus | undefined;
|
|
657
|
+
isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
658
|
+
statusLabelFor: (status?: ApiErrorStatus, statusText?: string) => string;
|
|
659
|
+
};
|
|
660
|
+
type BuildApiServiceErrorOptions = ApiErrorDetailOptions & {
|
|
661
|
+
providerLabel: string;
|
|
662
|
+
reason: string;
|
|
663
|
+
operation?: string;
|
|
664
|
+
extractMessage?: (error: unknown, helpers: ApiErrorBuildHelpers) => string | undefined;
|
|
665
|
+
extractResponse?: (error: unknown, helpers: ApiErrorBuildHelpers) => ApiErrorResponse | undefined;
|
|
666
|
+
extractStatus?: (error: unknown, response: ApiErrorResponse | undefined, helpers: ApiErrorBuildHelpers) => ApiErrorStatus | undefined;
|
|
667
|
+
extractUpstreamCode?: (error: unknown, response: ApiErrorResponse | undefined, helpers: ApiErrorBuildHelpers) => string | undefined;
|
|
668
|
+
formatMessage?: (parts: {
|
|
669
|
+
providerLabel: string;
|
|
670
|
+
operation: string;
|
|
671
|
+
statusLabel: string;
|
|
672
|
+
message: string;
|
|
673
|
+
response?: ApiErrorResponse;
|
|
674
|
+
status?: ApiErrorStatus;
|
|
675
|
+
}) => string;
|
|
676
|
+
parent?: unknown;
|
|
677
|
+
};
|
|
678
|
+
declare let isApiErrorRecord: (value: unknown) => value is Record<string, unknown>;
|
|
679
|
+
declare let collectApiErrorDetails: (value: unknown, details: string[], options?: ApiErrorDetailOptions) => void;
|
|
680
|
+
declare let getApiErrorResponse: (error: unknown) => ApiErrorResponse | undefined;
|
|
681
|
+
declare let getApiErrorStatus: (error: unknown) => ApiErrorStatus | undefined;
|
|
682
|
+
declare let statusLabelForApiError: (status?: ApiErrorStatus, statusText?: string) => string;
|
|
683
|
+
declare let extractApiErrorMessage: (error: unknown, options?: ApiErrorDetailOptions & {
|
|
684
|
+
response?: ApiErrorResponse;
|
|
685
|
+
}) => string;
|
|
686
|
+
declare let createApiServiceError: (message: string, options?: {
|
|
687
|
+
reason?: string;
|
|
688
|
+
upstreamStatus?: ApiErrorStatus;
|
|
689
|
+
upstreamCode?: string;
|
|
690
|
+
parent?: unknown;
|
|
691
|
+
}) => ServiceError<ErrorRecord<"bad_request", 400>>;
|
|
692
|
+
declare let buildApiServiceError: (error: unknown, options: BuildApiServiceErrorOptions) => ServiceError<ErrorRecord<"bad_request", 400>>;
|
|
693
|
+
|
|
559
694
|
declare class SlateError extends Error {
|
|
560
695
|
cause?: unknown;
|
|
561
696
|
data: SlateErrorResponse;
|
|
@@ -641,9 +776,40 @@ declare let mapServiceErrorToSlateErrorInput: (error: ServiceError<ErrorRecord<a
|
|
|
641
776
|
interface SlateAxiosDefaults extends CreateAxiosDefaults {
|
|
642
777
|
errorMapping?: SlateAxiosErrorOptions;
|
|
643
778
|
}
|
|
779
|
+
type SlateAxiosErrorAdapter = (error: unknown, operation: string) => unknown;
|
|
780
|
+
interface SlateAuthenticatedAxiosDefaults extends SlateAxiosDefaults {
|
|
781
|
+
authHeader?: {
|
|
782
|
+
name?: string;
|
|
783
|
+
value: string;
|
|
784
|
+
};
|
|
785
|
+
contentType?: string | false;
|
|
786
|
+
errorAdapter?: (error: unknown) => unknown;
|
|
787
|
+
}
|
|
644
788
|
declare let createAxios: (config?: SlateAxiosDefaults) => AxiosInstance;
|
|
789
|
+
declare let createAuthenticatedAxios: (config: SlateAuthenticatedAxiosDefaults) => AxiosInstance;
|
|
790
|
+
declare let requestAxios: <T = unknown>(operation: string, request: () => Promise<AxiosResponse<T>>, errorAdapter: SlateAxiosErrorAdapter) => Promise<AxiosResponse<T, any, {}>>;
|
|
791
|
+
declare let requestAxiosData: <T = unknown>(operation: string, request: () => Promise<AxiosResponse<T>>, errorAdapter: SlateAxiosErrorAdapter) => Promise<T>;
|
|
645
792
|
declare let axios: AxiosInstance;
|
|
646
793
|
|
|
794
|
+
interface CreateHmacSignatureOptions {
|
|
795
|
+
secret: string | Uint8Array;
|
|
796
|
+
payload: string | Uint8Array;
|
|
797
|
+
algorithm?: string;
|
|
798
|
+
digest: 'hex' | 'base64';
|
|
799
|
+
prefix?: string;
|
|
800
|
+
}
|
|
801
|
+
interface VerifyHmacSignatureOptions extends CreateHmacSignatureOptions {
|
|
802
|
+
signature: string;
|
|
803
|
+
}
|
|
804
|
+
declare let createHmacSignature: ({ secret, payload, algorithm, digest, prefix }: CreateHmacSignatureOptions) => string;
|
|
805
|
+
declare let verifyHmacSignature: (options: VerifyHmacSignatureOptions) => boolean;
|
|
806
|
+
|
|
807
|
+
declare let getResponseHeaderValue: (headers: unknown, name: string) => string | undefined;
|
|
808
|
+
declare let getBase64ByteLength: (contentBase64: string) => number;
|
|
809
|
+
|
|
810
|
+
declare let pickDefined: <T extends object>(value: T) => Partial<T> & Record<string, unknown>;
|
|
811
|
+
declare let setIfDefined: (target: Record<string, unknown>, key: string, value: unknown) => Record<string, unknown>;
|
|
812
|
+
|
|
647
813
|
declare class Slate<ConfigType extends {}, AuthType extends {}> {
|
|
648
814
|
private readonly _spec;
|
|
649
815
|
private readonly _actions;
|
|
@@ -657,4 +823,27 @@ declare class Slate<ConfigType extends {}, AuthType extends {}> {
|
|
|
657
823
|
get actions(): (SlateTrigger<ConfigType, AuthType, any, any> | SlateTool<ConfigType, AuthType, any, any>)[];
|
|
658
824
|
}
|
|
659
825
|
|
|
660
|
-
|
|
826
|
+
declare const graphWebhookHttp: {
|
|
827
|
+
methods: "POST"[];
|
|
828
|
+
sync: {
|
|
829
|
+
mode: "match";
|
|
830
|
+
match: {
|
|
831
|
+
hasQueryParam: string;
|
|
832
|
+
}[];
|
|
833
|
+
};
|
|
834
|
+
};
|
|
835
|
+
declare let getGraphWebhookValidationResponse: (request: Request) => SlateWebhookHttpResponseInit | null;
|
|
836
|
+
|
|
837
|
+
declare const metaWebhookHttp: {
|
|
838
|
+
methods: ("GET" | "POST")[];
|
|
839
|
+
sync: {
|
|
840
|
+
mode: "match";
|
|
841
|
+
match: {
|
|
842
|
+
method: string;
|
|
843
|
+
hasQueryParam: string;
|
|
844
|
+
}[];
|
|
845
|
+
};
|
|
846
|
+
};
|
|
847
|
+
declare let getMetaWebhookVerificationResponse: (request: Request, expectedVerifyToken: string | undefined) => SlateWebhookHttpResponseInit | null;
|
|
848
|
+
|
|
849
|
+
export { type ApiErrorBuildHelpers, type ApiErrorDetailOptions, type ApiErrorResponse, type ApiErrorStatus, type ApiServiceError, type BuildApiServiceErrorOptions, type CreateHmacSignatureOptions, type NormalizeOAuthTokenResponseOptions, type OAuthExpiresAtOptions, type OAuthRefreshTokenFallbackMode, type OAuthTokenResponse, Slate, SlateAction, SlateActionBuilder, type SlateActionCreateParameters, type SlateActionDocsReference, type SlateActionParameters, type SlateActionParametersAny, type SlateActionParametersTool, type SlateActionParametersTrigger, type SlateActionScopeClause, type SlateActionScopeClauseInput, type SlateActionScopeValue, type SlateActionScopes, type SlateActionScopesInput, type SlateActionType, type SlateAttachment, type SlateAttachmentInlineContent, type SlateAttachmentUrlContent, SlateAuth, type SlateAuthDocsReference, type SlateAuthType, type SlateAuthWithCustomData, type SlateAuthWithNone, type SlateAuthWithOauth, type SlateAuthWithServiceAccount, type SlateAuthWithToken, type SlateAuthenticatedAxiosDefaults, type SlateAxiosDefaults, type SlateAxiosErrorAdapter, type SlateAxiosErrorOptions, SlateConfig, type SlateConfigDocsReference, SlateContext, SlateDeclarationError, SlateDefaultPollingIntervalSeconds, type SlateDocsReference, SlateError, type SlateErrorInput, type SlateErrorIssue, type SlateErrorKind, type SlateErrorProviderInfo, type SlateErrorResponse, type SlateErrorUpstreamInfo, type SlateLogEntry, type SlateLogFields, type SlateLogListener, type SlateLogMessageInput, type SlateLogType, SlateLogger, type SlatePollingOptions, type SlateProviderDocsReference, type SlateServiceErrorData, SlateSpecification, type SlateSpecificationCreateParameters, type SlateSpecificationParameters, SlateTool, type SlateToolInvocationHandler, type SlateToolParameters, SlateTrigger, type SlateTriggerMappingHandler, type SlateTriggerParameters, type SlateTriggerPollingHandler, type SlateTriggerWebhookAutoRegistrationHandler, type SlateTriggerWebhookAutoUnregistrationHandler, type SlateTriggerWebhookRequestHandler, type SlateTypedDocsReference, type SlateWebhookHttpMethod, type SlateWebhookHttpOptions, type SlateWebhookHttpResponseInit, type SlateWebhookRequestMatcher, type VerifyHmacSignatureOptions, allOf, anyOf, auth, axios, buildApiServiceError, collectApiErrorDetails, config, createApiServiceError, createAuthenticatedAxios, createAxios, createBase64Attachment, createHmacSignature, createSlateError, createTextAttachment, createUrlAttachment, extractApiErrorMessage, getApiErrorResponse, getApiErrorStatus, getBase64ByteLength, getCurrentContext, getGraphWebhookValidationResponse, getMetaWebhookVerificationResponse, getOAuthExpiresAtFromExpiresIn, getResponseHeaderValue, getServiceErrorData, graphWebhookHttp, inferSlateErrorFromAxios, isApiErrorRecord, isAxiosErrorLike, isServiceErrorData, mapServiceErrorCode, mapServiceErrorToSlateErrorInput, mergeScopes, metaWebhookHttp, normalizeOAuthTokenResponse, pickDefined, requestAxios, requestAxiosData, runWithContext, scopeClause, setIfDefined, spec, statusLabelForApiError, tool, trigger, validateScopes, verifyHmacSignature };
|