@slates/provider 1.0.0-rc.22 → 1.0.0-rc.24
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 +180 -63
- package/dist/index.d.cts +160 -96
- package/dist/index.d.ts +160 -96
- package/dist/index.module.js +177 -63
- package/package.json +2 -2
- package/src/action/action.ts +6 -88
- package/src/action/builder.ts +50 -46
- package/src/action/index.ts +1 -0
- package/src/action/trigger.ts +17 -60
- package/src/action/triggerGroup.ts +332 -0
- package/src/adapter/index.test.ts +35 -14
- package/src/auth/types.ts +8 -0
- package/src/module/resolveDefaultExport.test.ts +3 -3
- package/src/specification/slate.test.ts +105 -0
- package/src/specification/slate.ts +31 -3
- package/src/webhook/graph.ts +2 -2
- package/src/webhook/meta.ts +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -149,6 +149,7 @@ type SlateAuthWithOauth<InputType extends {}, OutputType extends {
|
|
|
149
149
|
description?: string;
|
|
150
150
|
scope: string;
|
|
151
151
|
}[];
|
|
152
|
+
adapters?: string[];
|
|
152
153
|
docs?: SlateAuthDocsReference[];
|
|
153
154
|
inputSchema?: z.ZodType<InputType>;
|
|
154
155
|
onInputChanged?: (params: {
|
|
@@ -213,6 +214,7 @@ type SlateAuthWithToken<InputType extends {}, OutputType extends {
|
|
|
213
214
|
type: 'auth.token';
|
|
214
215
|
name: string;
|
|
215
216
|
key: string;
|
|
217
|
+
adapters?: string[];
|
|
216
218
|
inputSchema?: z.ZodType<InputType>;
|
|
217
219
|
docs?: SlateAuthDocsReference[];
|
|
218
220
|
getOutput: (ctx: {
|
|
@@ -242,6 +244,7 @@ type SlateAuthWithServiceAccount<InputType extends {}, OutputType extends {}> =
|
|
|
242
244
|
type: 'auth.service_account';
|
|
243
245
|
name: string;
|
|
244
246
|
key: string;
|
|
247
|
+
adapters?: string[];
|
|
245
248
|
inputSchema?: z.ZodType<InputType>;
|
|
246
249
|
docs?: SlateAuthDocsReference[];
|
|
247
250
|
getOutput: (ctx: {
|
|
@@ -271,6 +274,7 @@ type SlateAuthWithCustomData<InputType extends {}, OutputType extends {}> = {
|
|
|
271
274
|
type: 'auth.custom';
|
|
272
275
|
name: string;
|
|
273
276
|
key: string;
|
|
277
|
+
adapters?: string[];
|
|
274
278
|
inputSchema?: z.ZodType<InputType>;
|
|
275
279
|
docs?: SlateAuthDocsReference[];
|
|
276
280
|
getOutput: (ctx: {
|
|
@@ -497,6 +501,138 @@ declare class SlateContext<ConfigType extends {}, AuthType extends {}, InputType
|
|
|
497
501
|
declare let runWithContext: <InputType extends {}, RV>(context: SlatePublicContext<InputType>, fn: () => Promise<RV>) => Promise<RV>;
|
|
498
502
|
declare let getCurrentContext: <ConfigType extends {}, AuthType extends {}, InputType extends {}>() => SlateContext<ConfigType, AuthType, InputType>;
|
|
499
503
|
|
|
504
|
+
declare let SlateDefaultPollingIntervalSeconds: number;
|
|
505
|
+
type SlateTriggerRoutingMatcher = Record<string, any>;
|
|
506
|
+
type SlateWebhookTargetOwnership = 'single_user' | 'multi_user';
|
|
507
|
+
interface SlateWebhookTarget {
|
|
508
|
+
webhookTargetIdentifier: string;
|
|
509
|
+
name: string;
|
|
510
|
+
description?: string;
|
|
511
|
+
metadata: Record<string, any>;
|
|
512
|
+
webhookTargetPayload: any;
|
|
513
|
+
targetOwnership: SlateWebhookTargetOwnership;
|
|
514
|
+
}
|
|
515
|
+
type SlateTriggerGroupRoutingMatchersHandler<ConfigType extends {}, AuthType extends {}> = (context: SlateContext<ConfigType, AuthType, {}>) => Promise<SlateTriggerRoutingMatcher[]>;
|
|
516
|
+
type SlateTriggerGroupPollHandler<ConfigType extends {}, AuthType extends {}> = (context: SlateContext<ConfigType, AuthType, {
|
|
517
|
+
state: any | null;
|
|
518
|
+
}>) => Promise<{
|
|
519
|
+
events: {
|
|
520
|
+
payload: any;
|
|
521
|
+
idempotencyKey?: string;
|
|
522
|
+
}[];
|
|
523
|
+
updatedState?: any;
|
|
524
|
+
}>;
|
|
525
|
+
type SlateWebhookTargetListHandler<ConfigType extends {}, AuthType extends {}> = (context: SlateContext<ConfigType, AuthType, {
|
|
526
|
+
pageToken: any | null;
|
|
527
|
+
}>) => Promise<{
|
|
528
|
+
targets: SlateWebhookTarget[];
|
|
529
|
+
nextPageToken: any | null;
|
|
530
|
+
}>;
|
|
531
|
+
type SlateWebhookRegisterHandler<ConfigType extends {}, AuthType extends {}> = (context: SlateContext<ConfigType, AuthType, {
|
|
532
|
+
webhookTargetIdentifier: string;
|
|
533
|
+
webhookTargetPayload: any;
|
|
534
|
+
webhookUrl: string;
|
|
535
|
+
}>) => Promise<{
|
|
536
|
+
webhookRegistrationIdentifier: string;
|
|
537
|
+
webhookRegistrationPayload: any;
|
|
538
|
+
}>;
|
|
539
|
+
type SlateWebhookUnregisterHandler<ConfigType extends {}, AuthType extends {}> = (context: SlateContext<ConfigType, AuthType, {
|
|
540
|
+
webhookRegistrationIdentifier: string;
|
|
541
|
+
webhookRegistrationPayload: any;
|
|
542
|
+
}>) => Promise<unknown>;
|
|
543
|
+
type SlateWebhookManualSetupHandler<FullConfigSchema extends z$1.ZodType<any> = z$1.ZodType<any>> = (context: SlateContext<{}, {}, {
|
|
544
|
+
webhookUrl: string;
|
|
545
|
+
}>) => Promise<{
|
|
546
|
+
webhookSetupDocument: string;
|
|
547
|
+
partialWebhookRegistrationPayload: Partial<z$1.infer<FullConfigSchema>>;
|
|
548
|
+
}>;
|
|
549
|
+
type SlateWebhookManualFinishHandler<UserConfigSchema extends z$1.ZodType<any> = z$1.ZodType<any>, FullConfigSchema extends z$1.ZodType<any> = z$1.ZodType<any>> = (context: SlateContext<{}, {}, {
|
|
550
|
+
webhookUrl: string;
|
|
551
|
+
partialWebhookRegistrationPayload: Partial<z$1.infer<FullConfigSchema>>;
|
|
552
|
+
userWebhookRegistrationPayload: z$1.infer<UserConfigSchema>;
|
|
553
|
+
}>) => Promise<{
|
|
554
|
+
webhookRegistrationPayload: z$1.infer<FullConfigSchema>;
|
|
555
|
+
}>;
|
|
556
|
+
type SlateWebhookProcessHandler = (context: SlateContext<{}, {}, {
|
|
557
|
+
request: Request;
|
|
558
|
+
webhookRegistrationPayload: any;
|
|
559
|
+
}>) => Promise<{
|
|
560
|
+
events: {
|
|
561
|
+
matchers: SlateTriggerRoutingMatcher[];
|
|
562
|
+
payload: any;
|
|
563
|
+
idempotencyKey?: string;
|
|
564
|
+
}[];
|
|
565
|
+
response?: Response | SlateWebhookHttpResponseInit;
|
|
566
|
+
}>;
|
|
567
|
+
interface SlateTriggerGroupPollingParameters<ConfigType extends {}, AuthType extends {}> {
|
|
568
|
+
intervalSeconds: number;
|
|
569
|
+
pollEvents: SlateTriggerGroupPollHandler<ConfigType, AuthType>;
|
|
570
|
+
}
|
|
571
|
+
interface SlateTriggerGroupWebhookAutoRegistrationParameters<ConfigType extends {}, AuthType extends {}> {
|
|
572
|
+
webhookTargetList: SlateWebhookTargetListHandler<ConfigType, AuthType>;
|
|
573
|
+
webhookRegister: SlateWebhookRegisterHandler<ConfigType, AuthType>;
|
|
574
|
+
webhookUnregister: SlateWebhookUnregisterHandler<ConfigType, AuthType>;
|
|
575
|
+
}
|
|
576
|
+
interface SlateTriggerGroupWebhookManualRegistrationParameters<UserConfigSchema extends z$1.ZodType<any> = z$1.ZodType<any>, FullConfigSchema extends z$1.ZodType<any> = z$1.ZodType<any>> {
|
|
577
|
+
userConfigSchema: UserConfigSchema;
|
|
578
|
+
fullConfigSchema: FullConfigSchema;
|
|
579
|
+
setup: SlateWebhookManualSetupHandler<FullConfigSchema>;
|
|
580
|
+
finish?: SlateWebhookManualFinishHandler<UserConfigSchema, FullConfigSchema>;
|
|
581
|
+
}
|
|
582
|
+
interface SlateTriggerGroupWebhookParameters<ConfigType extends {}, AuthType extends {}> {
|
|
583
|
+
autoRegistration?: SlateTriggerGroupWebhookAutoRegistrationParameters<ConfigType, AuthType>;
|
|
584
|
+
manualRegistration?: SlateTriggerGroupWebhookManualRegistrationParameters<any, any>;
|
|
585
|
+
process: SlateWebhookProcessHandler;
|
|
586
|
+
}
|
|
587
|
+
interface SlateTriggerGroupCreateParameters<InputType extends {} = Record<string, unknown>> {
|
|
588
|
+
key: string;
|
|
589
|
+
name: string;
|
|
590
|
+
description?: string;
|
|
591
|
+
metadata?: Record<string, any>;
|
|
592
|
+
eventSchema?: z$1.ZodType<InputType>;
|
|
593
|
+
}
|
|
594
|
+
interface SlateTriggerGroupParameters<ConfigType extends {}, AuthType extends {}, InputType extends {} = Record<string, unknown>> extends SlateTriggerGroupCreateParameters<InputType> {
|
|
595
|
+
source: 'polling' | 'webhook';
|
|
596
|
+
polling?: SlateTriggerGroupPollingParameters<ConfigType, AuthType>;
|
|
597
|
+
webhook?: SlateTriggerGroupWebhookParameters<ConfigType, AuthType>;
|
|
598
|
+
routingMatchers: SlateTriggerGroupRoutingMatchersHandler<ConfigType, AuthType>;
|
|
599
|
+
}
|
|
600
|
+
declare class SlateTriggerGroup<ConfigType extends {}, AuthType extends {}, InputType extends {} = Record<string, unknown>> {
|
|
601
|
+
private readonly _spec;
|
|
602
|
+
private readonly _params;
|
|
603
|
+
private constructor();
|
|
604
|
+
static create<ConfigType extends {}, AuthType extends {}, InputType extends {} = Record<string, unknown>>(spec: SlateSpecification<ConfigType, AuthType>, params: SlateTriggerGroupCreateParameters<InputType>): SlateTriggerGroupBuilder<ConfigType, AuthType, InputType>;
|
|
605
|
+
get spec(): SlateSpecification<ConfigType, AuthType>;
|
|
606
|
+
get key(): string;
|
|
607
|
+
get name(): string;
|
|
608
|
+
get description(): string | undefined;
|
|
609
|
+
get metadata(): Record<string, any> | undefined;
|
|
610
|
+
get eventSchema(): z$1.ZodType<InputType, unknown, z$1.core.$ZodTypeInternals<InputType, unknown>>;
|
|
611
|
+
get source(): "polling" | "webhook";
|
|
612
|
+
get polling(): SlateTriggerGroupPollingParameters<ConfigType, AuthType> | undefined;
|
|
613
|
+
get webhook(): SlateTriggerGroupWebhookParameters<ConfigType, AuthType> | undefined;
|
|
614
|
+
get routingMatchers(): SlateTriggerGroupRoutingMatchersHandler<ConfigType, AuthType>;
|
|
615
|
+
}
|
|
616
|
+
declare class SlateTriggerGroupBuilder<ConfigType extends {}, AuthType extends {}, InputType extends {} = Record<string, unknown>> {
|
|
617
|
+
#private;
|
|
618
|
+
private readonly spec;
|
|
619
|
+
private readonly params;
|
|
620
|
+
private readonly factory;
|
|
621
|
+
constructor(spec: SlateSpecification<ConfigType, AuthType>, params: SlateTriggerGroupCreateParameters<InputType>, factory: (params: SlateTriggerGroupParameters<ConfigType, AuthType, InputType>) => SlateTriggerGroup<ConfigType, AuthType, InputType>);
|
|
622
|
+
polling(props: {
|
|
623
|
+
intervalSeconds?: number;
|
|
624
|
+
pollEvents: SlateTriggerGroupPollHandler<ConfigType, AuthType>;
|
|
625
|
+
}): SlateTriggerGroupBuilder<ConfigType, AuthType, InputType>;
|
|
626
|
+
webhook<UserConfigSchema extends z$1.ZodType<any> = z$1.ZodType<any>, FullConfigSchema extends z$1.ZodType<any> = z$1.ZodType<any>>(props: {
|
|
627
|
+
autoRegistration?: SlateTriggerGroupWebhookAutoRegistrationParameters<ConfigType, AuthType>;
|
|
628
|
+
manualRegistration?: SlateTriggerGroupWebhookManualRegistrationParameters<UserConfigSchema, FullConfigSchema>;
|
|
629
|
+
process: SlateWebhookProcessHandler;
|
|
630
|
+
}): SlateTriggerGroupBuilder<ConfigType, AuthType, InputType>;
|
|
631
|
+
routingMatchers(handler: SlateTriggerGroupRoutingMatchersHandler<ConfigType, AuthType>): SlateTriggerGroupBuilder<ConfigType, AuthType, InputType>;
|
|
632
|
+
build(): SlateTriggerGroup<ConfigType, AuthType, InputType>;
|
|
633
|
+
}
|
|
634
|
+
declare let triggerGroup: <ConfigType extends {}, AuthType extends {}, InputType extends {} = Record<string, unknown>>(spec: SlateSpecification<ConfigType, AuthType>, params: SlateTriggerGroupCreateParameters<InputType>) => SlateTriggerGroupBuilder<ConfigType, AuthType, InputType>;
|
|
635
|
+
|
|
500
636
|
type SlateActionType = 'tool' | 'trigger';
|
|
501
637
|
interface SlateActionScopeClause {
|
|
502
638
|
OR: string[];
|
|
@@ -532,81 +668,26 @@ type SlatePublicToolInvocationHandler<InputType extends {}, OutputType extends {
|
|
|
532
668
|
message: string;
|
|
533
669
|
attachments?: SlateAttachment[];
|
|
534
670
|
}>;
|
|
671
|
+
type SlateTriggerMatchesHandler = (payload: unknown) => boolean;
|
|
535
672
|
type SlateTriggerMappingHandler<ConfigType extends {}, AuthType extends {}, InputType extends {}, OutputType extends {}> = (context: SlateContext<ConfigType, AuthType, InputType>) => Promise<{
|
|
536
673
|
type: string;
|
|
537
674
|
id: string;
|
|
538
675
|
output: OutputType;
|
|
539
676
|
}>;
|
|
540
|
-
type SlateTriggerPollingHandler<ConfigType extends {}, AuthType extends {}, InputType extends {}> = (context: SlateContext<ConfigType, AuthType, {
|
|
541
|
-
state: any | null;
|
|
542
|
-
}>) => Promise<{
|
|
543
|
-
inputs: InputType[];
|
|
544
|
-
updatedState?: any;
|
|
545
|
-
}>;
|
|
546
677
|
interface SlateWebhookHttpResponseInit {
|
|
547
678
|
status?: number;
|
|
548
679
|
headers?: Record<string, string>;
|
|
549
680
|
body?: string | Uint8Array | null;
|
|
550
681
|
}
|
|
551
|
-
type SlateWebhookHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
552
|
-
interface SlateWebhookRequestMatcher {
|
|
553
|
-
method?: string;
|
|
554
|
-
hasQueryParam?: string;
|
|
555
|
-
hasHeader?: string;
|
|
556
|
-
jsonBodyField?: {
|
|
557
|
-
path: string;
|
|
558
|
-
equals?: string;
|
|
559
|
-
};
|
|
560
|
-
formBodyField?: {
|
|
561
|
-
path: string;
|
|
562
|
-
equals?: string;
|
|
563
|
-
};
|
|
564
|
-
}
|
|
565
|
-
interface SlateWebhookHttpOptions {
|
|
566
|
-
methods?: SlateWebhookHttpMethod[];
|
|
567
|
-
sync?: {
|
|
568
|
-
mode: 'never' | 'match' | 'always';
|
|
569
|
-
match?: SlateWebhookRequestMatcher[];
|
|
570
|
-
timeoutMs?: number;
|
|
571
|
-
};
|
|
572
|
-
}
|
|
573
|
-
type SlateTriggerWebhookRequestHandler<ConfigType extends {}, AuthType extends {}, InputType extends {}> = (context: SlateContext<ConfigType, AuthType, {
|
|
574
|
-
request: Request;
|
|
575
|
-
state: any | null;
|
|
576
|
-
registrationDetails: any | null;
|
|
577
|
-
}>) => Promise<{
|
|
578
|
-
inputs: InputType[];
|
|
579
|
-
updatedState?: any;
|
|
580
|
-
response?: Response | SlateWebhookHttpResponseInit;
|
|
581
|
-
}>;
|
|
582
|
-
type SlateTriggerWebhookAutoRegistrationHandler<ConfigType extends {}, AuthType extends {}> = (context: SlateContext<ConfigType, AuthType, {
|
|
583
|
-
webhookBaseUrl: string;
|
|
584
|
-
}>) => Promise<{
|
|
585
|
-
registrationDetails: any;
|
|
586
|
-
state?: any;
|
|
587
|
-
}>;
|
|
588
|
-
type SlateTriggerWebhookAutoUnregistrationHandler<ConfigType extends {}, AuthType extends {}> = (context: SlateContext<ConfigType, AuthType, {
|
|
589
|
-
webhookBaseUrl: string;
|
|
590
|
-
registrationDetails: any;
|
|
591
|
-
state: any | null;
|
|
592
|
-
}>) => Promise<unknown>;
|
|
593
682
|
interface SlateActionParametersTool<ConfigType extends {}, AuthType extends {}, InputType extends {}, OutputType extends {}> {
|
|
594
683
|
type: 'tool';
|
|
595
684
|
handleInvocation: SlateToolInvocationHandler<ConfigType, AuthType, InputType, OutputType>;
|
|
596
685
|
}
|
|
597
|
-
interface SlatePollingOptions {
|
|
598
|
-
intervalInSeconds?: number;
|
|
599
|
-
}
|
|
600
686
|
interface SlateActionParametersTrigger<ConfigType extends {}, AuthType extends {}, InputType extends {}, OutputType extends {}> {
|
|
601
687
|
type: 'trigger';
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
handleRequest?: SlateTriggerWebhookRequestHandler<ConfigType, AuthType, InputType>;
|
|
606
|
-
http?: SlateWebhookHttpOptions;
|
|
607
|
-
pollEvents?: SlateTriggerPollingHandler<ConfigType, AuthType, InputType>;
|
|
608
|
-
autoRegisterWebhook?: SlateTriggerWebhookAutoRegistrationHandler<ConfigType, AuthType>;
|
|
609
|
-
autoUnregisterWebhook?: SlateTriggerWebhookAutoUnregistrationHandler<ConfigType, AuthType>;
|
|
688
|
+
triggerGroup: SlateTriggerGroup<ConfigType, AuthType>;
|
|
689
|
+
matches: SlateTriggerMatchesHandler;
|
|
690
|
+
map: SlateTriggerMappingHandler<ConfigType, AuthType, InputType, OutputType>;
|
|
610
691
|
}
|
|
611
692
|
type SlateActionParametersAny<ConfigType extends {}, AuthType extends {}, InputType extends {}, OutputType extends {}> = SlateActionParametersTool<ConfigType, AuthType, InputType, OutputType> | SlateActionParametersTrigger<ConfigType, AuthType, InputType, OutputType>;
|
|
612
693
|
type SlateActionCreateParameters<ConfigType extends {}, AuthType extends {}, InputType extends {}, OutputType extends {}> = SlateActionParametersAny<ConfigType, AuthType, InputType, OutputType> & SlateActionParameters & {
|
|
@@ -659,18 +740,9 @@ declare class SlateActionBuilder<Type extends SlateActionType, ConfigType extend
|
|
|
659
740
|
authMethods(authMethods: string[]): SlateActionBuilder<Type, ConfigType, AuthType, InputType, OutputType, Result, IsPublic>;
|
|
660
741
|
private validateAuthMethods;
|
|
661
742
|
handleInvocation(handler: IsPublic extends true ? SlatePublicToolInvocationHandler<InputType, OutputType> : SlateToolInvocationHandler<ConfigType, AuthType, InputType, OutputType>): SlateActionBuilder<Type, ConfigType, AuthType, InputType, OutputType, Result, IsPublic>;
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
autoRegisterWebhook?: SlateTriggerWebhookAutoRegistrationHandler<ConfigType, AuthType>;
|
|
666
|
-
autoUnregisterWebhook?: SlateTriggerWebhookAutoUnregistrationHandler<ConfigType, AuthType>;
|
|
667
|
-
http?: SlateWebhookHttpOptions;
|
|
668
|
-
}): SlateActionBuilder<Type, ConfigType, AuthType, InputType, OutputType, Result, IsPublic>;
|
|
669
|
-
polling(props: {
|
|
670
|
-
options?: SlatePollingOptions;
|
|
671
|
-
pollEvents?: SlateTriggerPollingHandler<ConfigType, AuthType, InputType>;
|
|
672
|
-
handleEvent: SlateTriggerMappingHandler<ConfigType, AuthType, InputType, OutputType>;
|
|
673
|
-
}): SlateActionBuilder<Type, ConfigType, AuthType, InputType, OutputType, Result, IsPublic>;
|
|
743
|
+
triggerGroup(group: SlateTriggerGroup<ConfigType, AuthType>): SlateActionBuilder<Type, ConfigType, AuthType, InputType, OutputType, Result, IsPublic>;
|
|
744
|
+
matches(handler: SlateTriggerMatchesHandler): SlateActionBuilder<Type, ConfigType, AuthType, InputType, OutputType, Result, IsPublic>;
|
|
745
|
+
map(handler: SlateTriggerMappingHandler<ConfigType, AuthType, InputType, OutputType>): SlateActionBuilder<Type, ConfigType, AuthType, InputType, OutputType, Result, IsPublic>;
|
|
674
746
|
build(): Result;
|
|
675
747
|
}
|
|
676
748
|
|
|
@@ -725,36 +797,25 @@ declare let allOf: (...inputs: SlateActionScopesInput[]) => SlateActionScopes;
|
|
|
725
797
|
declare let mergeScopes: (...inputs: Array<SlateActionScopes | null | undefined | false>) => SlateActionScopes | undefined;
|
|
726
798
|
declare let validateScopes: (scopes: SlateActionScopes) => SlateActionScopes;
|
|
727
799
|
|
|
728
|
-
declare let SlateDefaultPollingIntervalSeconds: number;
|
|
729
800
|
interface SlateTriggerParameters<ConfigType extends {}, AuthType extends {}, InputType extends {}, OutputType extends {
|
|
730
801
|
type: string;
|
|
731
802
|
}> extends SlateActionParameters {
|
|
732
803
|
type: 'trigger';
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
handleRequest?: SlateTriggerWebhookRequestHandler<ConfigType, AuthType, InputType>;
|
|
737
|
-
http?: SlateWebhookHttpOptions;
|
|
738
|
-
pollEvents?: SlateTriggerPollingHandler<ConfigType, AuthType, InputType>;
|
|
739
|
-
autoRegisterWebhook?: SlateTriggerWebhookAutoRegistrationHandler<ConfigType, AuthType>;
|
|
740
|
-
autoUnregisterWebhook?: SlateTriggerWebhookAutoUnregistrationHandler<ConfigType, AuthType>;
|
|
804
|
+
triggerGroup: SlateTriggerGroup<ConfigType, AuthType>;
|
|
805
|
+
matches: SlateTriggerMatchesHandler;
|
|
806
|
+
map: SlateTriggerMappingHandler<ConfigType, AuthType, InputType, OutputType>;
|
|
741
807
|
}
|
|
742
808
|
declare class SlateTrigger<ConfigType extends {}, AuthType extends {}, InputType extends {}, OutputType extends {
|
|
743
809
|
type: string;
|
|
744
810
|
}> extends SlateAction<'trigger', ConfigType, AuthType, InputType, OutputType> {
|
|
745
811
|
#private;
|
|
746
812
|
private constructor();
|
|
747
|
-
static create<ConfigType extends {}, AuthType extends {}>(spec: SlateSpecification<ConfigType, AuthType>, params: SlateActionParameters): SlateActionBuilder<"trigger", ConfigType, AuthType, {}, {}, SlateTrigger<
|
|
748
|
-
get
|
|
749
|
-
get
|
|
750
|
-
get
|
|
751
|
-
get handleRequest(): SlateTriggerWebhookRequestHandler<ConfigType, AuthType, InputType> | undefined;
|
|
752
|
-
get http(): SlateWebhookHttpOptions | undefined;
|
|
753
|
-
get pollEvents(): SlateTriggerPollingHandler<ConfigType, AuthType, InputType> | undefined;
|
|
754
|
-
get autoRegisterWebhook(): SlateTriggerWebhookAutoRegistrationHandler<ConfigType, AuthType> | undefined;
|
|
755
|
-
get autoUnregisterWebhook(): SlateTriggerWebhookAutoUnregistrationHandler<ConfigType, AuthType> | undefined;
|
|
813
|
+
static create<ConfigType extends {}, AuthType extends {}>(spec: SlateSpecification<ConfigType, AuthType>, params: SlateActionParameters): SlateActionBuilder<"trigger", ConfigType, AuthType, {}, {}, SlateTrigger<any, any, any, any>, false>;
|
|
814
|
+
get triggerGroup(): SlateTriggerGroup<ConfigType, AuthType, Record<string, unknown>>;
|
|
815
|
+
get matches(): SlateTriggerMatchesHandler;
|
|
816
|
+
get map(): SlateTriggerMappingHandler<ConfigType, AuthType, InputType, OutputType>;
|
|
756
817
|
}
|
|
757
|
-
declare let trigger: <ConfigType extends {}, AuthType extends {}>(spec: SlateSpecification<ConfigType, AuthType>, params: SlateActionParameters) => SlateActionBuilder<"trigger", ConfigType, AuthType, {}, {}, SlateTrigger<
|
|
818
|
+
declare let trigger: <ConfigType extends {}, AuthType extends {}>(spec: SlateSpecification<ConfigType, AuthType>, params: SlateActionParameters) => SlateActionBuilder<"trigger", ConfigType, AuthType, {}, {}, SlateTrigger<any, any, any, any>, false>;
|
|
758
819
|
|
|
759
820
|
interface SlateAdapterCapability {
|
|
760
821
|
id: string;
|
|
@@ -779,7 +840,7 @@ declare class SlateAdapterSpec {
|
|
|
779
840
|
};
|
|
780
841
|
tool<ConfigType extends {}, AuthType extends {}>(spec: SlateSpecification<ConfigType, AuthType>, params: SlateActionParameters): SlateActionBuilder<"tool", ConfigType, AuthType, {}, {}, SlateTool<ConfigType, AuthType, any, any>, false>;
|
|
781
842
|
publicTool<ConfigType extends {}, AuthType extends {}>(spec: SlateSpecification<ConfigType, AuthType>, params: SlateActionParameters): SlateActionBuilder<"tool", ConfigType, AuthType, {}, {}, SlateTool<ConfigType, AuthType, any, any>, true>;
|
|
782
|
-
trigger<ConfigType extends {}, AuthType extends {}>(spec: SlateSpecification<ConfigType, AuthType>, params: SlateActionParameters): SlateActionBuilder<"trigger", ConfigType, AuthType, {}, {}, SlateTrigger<
|
|
843
|
+
trigger<ConfigType extends {}, AuthType extends {}>(spec: SlateSpecification<ConfigType, AuthType>, params: SlateActionParameters): SlateActionBuilder<"trigger", ConfigType, AuthType, {}, {}, SlateTrigger<any, any, any, any>, false>;
|
|
783
844
|
register<ConfigType extends {}, AuthType extends {}>(params: {
|
|
784
845
|
tools: SlateTool<ConfigType, AuthType, any, any>[];
|
|
785
846
|
triggers: SlateTrigger<ConfigType, AuthType, any, any>[];
|
|
@@ -981,22 +1042,25 @@ declare class Slate<ConfigType extends {}, AuthType extends {}> {
|
|
|
981
1042
|
private readonly _spec;
|
|
982
1043
|
private readonly _actions;
|
|
983
1044
|
private readonly _adapters;
|
|
1045
|
+
private readonly _triggerGroups;
|
|
984
1046
|
private constructor();
|
|
985
1047
|
static create<ConfigType extends {}, AuthType extends {}>(params: {
|
|
986
1048
|
spec: SlateSpecification<ConfigType, AuthType>;
|
|
987
1049
|
triggers: SlateTrigger<ConfigType, AuthType, any, any>[];
|
|
988
1050
|
tools: SlateTool<ConfigType, AuthType, any, any>[];
|
|
989
1051
|
adapters?: SlateAdapter<ConfigType, AuthType>[];
|
|
1052
|
+
triggerGroups?: SlateTriggerGroup<ConfigType, AuthType>[];
|
|
990
1053
|
}): Slate<ConfigType, AuthType>;
|
|
991
1054
|
get spec(): SlateSpecification<ConfigType, AuthType>;
|
|
992
1055
|
get actions(): (SlateTrigger<ConfigType, AuthType, any, any> | SlateTool<ConfigType, AuthType, any, any>)[];
|
|
993
1056
|
get adapters(): SlateAdapter<ConfigType, AuthType>[];
|
|
1057
|
+
get triggerGroups(): SlateTriggerGroup<ConfigType, AuthType, Record<string, unknown>>[];
|
|
994
1058
|
}
|
|
995
1059
|
|
|
996
1060
|
declare const graphWebhookHttp: {
|
|
997
|
-
methods:
|
|
1061
|
+
methods: string[];
|
|
998
1062
|
sync: {
|
|
999
|
-
mode:
|
|
1063
|
+
mode: string;
|
|
1000
1064
|
match: {
|
|
1001
1065
|
hasQueryParam: string;
|
|
1002
1066
|
}[];
|
|
@@ -1005,9 +1069,9 @@ declare const graphWebhookHttp: {
|
|
|
1005
1069
|
declare let getGraphWebhookValidationResponse: (request: Request) => SlateWebhookHttpResponseInit | null;
|
|
1006
1070
|
|
|
1007
1071
|
declare const metaWebhookHttp: {
|
|
1008
|
-
methods:
|
|
1072
|
+
methods: string[];
|
|
1009
1073
|
sync: {
|
|
1010
|
-
mode:
|
|
1074
|
+
mode: string;
|
|
1011
1075
|
match: {
|
|
1012
1076
|
method: string;
|
|
1013
1077
|
hasQueryParam: string;
|
|
@@ -1016,4 +1080,4 @@ declare const metaWebhookHttp: {
|
|
|
1016
1080
|
};
|
|
1017
1081
|
declare let getMetaWebhookVerificationResponse: (request: Request, expectedVerifyToken: string | undefined) => SlateWebhookHttpResponseInit | null;
|
|
1018
1082
|
|
|
1019
|
-
export { AUTH_CONFIG_SECRET_PLACEHOLDER_PREFIX, type ApiErrorBuildHelpers, type ApiErrorDetailOptions, type ApiErrorResponse, type ApiErrorStatus, type ApiServiceError, AuthConfigSecretRedactor, type BuildApiServiceErrorOptions, type CreateHmacSignatureOptions, GET_FILE_URL_TOOL_ID, type GetFileUrlHandler, type GetFileUrlToolInput, type GetFileUrlToolOutput, 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, SlateAdapter, type SlateAdapterCapability, SlateAdapterSpec, type SlateAdapterSpecParameters, type SlateAddAttachmentContent, type SlateAddAttachmentInput, type SlateAttachment, type SlateAttachmentInlineContent, type SlateAttachmentUploadReferenceContent, 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 SlateDirectUploadInput, type SlateDocsReference, SlateError, type SlateErrorInput, type SlateErrorIssue, type SlateErrorKind, type SlateErrorProviderInfo, type SlateErrorResponse, type SlateErrorUpstreamInfo, type SlateLiveInvocationInfo, type SlateLogEntry, type SlateLogFields, type SlateLogListener, type SlateLogMessageInput, type SlateLogType, SlateLogger, type
|
|
1083
|
+
export { AUTH_CONFIG_SECRET_PLACEHOLDER_PREFIX, type ApiErrorBuildHelpers, type ApiErrorDetailOptions, type ApiErrorResponse, type ApiErrorStatus, type ApiServiceError, AuthConfigSecretRedactor, type BuildApiServiceErrorOptions, type CreateHmacSignatureOptions, GET_FILE_URL_TOOL_ID, type GetFileUrlHandler, type GetFileUrlToolInput, type GetFileUrlToolOutput, 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, SlateAdapter, type SlateAdapterCapability, SlateAdapterSpec, type SlateAdapterSpecParameters, type SlateAddAttachmentContent, type SlateAddAttachmentInput, type SlateAttachment, type SlateAttachmentInlineContent, type SlateAttachmentUploadReferenceContent, 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 SlateDirectUploadInput, type SlateDocsReference, SlateError, type SlateErrorInput, type SlateErrorIssue, type SlateErrorKind, type SlateErrorProviderInfo, type SlateErrorResponse, type SlateErrorUpstreamInfo, type SlateLiveInvocationInfo, type SlateLogEntry, type SlateLogFields, type SlateLogListener, type SlateLogMessageInput, type SlateLogType, SlateLogger, type SlateProviderDocsReference, SlatePublicContext, SlatePublicTool, type SlatePublicToolInvocationHandler, type SlatePublicToolParameters, type SlateServiceErrorData, SlateSpecification, type SlateSpecificationCreateParameters, type SlateSpecificationParameters, SlateTool, type SlateToolInvocationHandler, type SlateToolParameters, SlateTrigger, SlateTriggerGroup, SlateTriggerGroupBuilder, type SlateTriggerGroupCreateParameters, type SlateTriggerGroupParameters, type SlateTriggerGroupPollHandler, type SlateTriggerGroupPollingParameters, type SlateTriggerGroupRoutingMatchersHandler, type SlateTriggerGroupWebhookAutoRegistrationParameters, type SlateTriggerGroupWebhookManualRegistrationParameters, type SlateTriggerGroupWebhookParameters, type SlateTriggerMappingHandler, type SlateTriggerMatchesHandler, type SlateTriggerParameters, type SlateTriggerRoutingMatcher, type SlateTypedDocsReference, type SlateWebhookHttpResponseInit, type SlateWebhookManualFinishHandler, type SlateWebhookManualSetupHandler, type SlateWebhookProcessHandler, type SlateWebhookRegisterHandler, type SlateWebhookTarget, type SlateWebhookTargetListHandler, type SlateWebhookTargetOwnership, type SlateWebhookUnregisterHandler, type VerifyHmacSignatureOptions, adapterSpec, allOf, anyOf, auth, axios, buildApiServiceError, collectApiErrorDetails, config, createApiServiceError, createAuthenticatedAxios, createAxios, createBase64Attachment, createHmacSignature, createSlateError, createTextAttachment, createUrlAttachment, extractApiErrorMessage, getApiErrorResponse, getApiErrorStatus, getBase64ByteLength, getCurrentContext, getFileUrlTool, getFileUrlToolInputSchema, getFileUrlToolOutputSchema, getGraphWebhookValidationResponse, getMetaWebhookVerificationResponse, getOAuthExpiresAtFromExpiresIn, getResponseHeaderValue, getServiceErrorData, graphWebhookHttp, inferSlateErrorFromAxios, isApiErrorRecord, isAxiosErrorLike, isServiceErrorData, mapServiceErrorCode, mapServiceErrorToSlateErrorInput, mergeScopes, metaWebhookHttp, normalizeOAuthTokenResponse, pickDefined, publicTool, redactUrlAttachmentSecrets, requestAxios, requestAxiosData, runWithContext, scopeClause, setIfDefined, spec, statusLabelForApiError, tool, trigger, triggerGroup, uploadAttachmentDirect, validateScopes, verifyHmacSignature };
|