@beseif-solutions/prow-core 1.4.0 → 1.5.1
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/entities/events.d.ts +91 -3
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/entities/events.ts +47 -3
- package/src/index.ts +1 -1
|
@@ -112,24 +112,112 @@ export type ImmediateTrigger<Config extends SetupEventConfig> = CommonEvents<Con
|
|
|
112
112
|
response?: any;
|
|
113
113
|
};
|
|
114
114
|
}>;
|
|
115
|
-
|
|
115
|
+
handle: CoreFunction<{
|
|
116
116
|
credentials: Config[`credentials`];
|
|
117
117
|
inputs: {
|
|
118
118
|
fields: Config[`fields`];
|
|
119
119
|
request: Request;
|
|
120
120
|
setup?: Config[`setup`];
|
|
121
|
+
} & SourcePreferences<Config>;
|
|
122
|
+
outputs: {
|
|
123
|
+
records: Config[`outputs`][];
|
|
124
|
+
flags: Partial<Record<Config[`flags`][`outputs`][number], true>>;
|
|
125
|
+
};
|
|
126
|
+
}>;
|
|
127
|
+
fire?: CoreFunction<{
|
|
128
|
+
credentials: Config[`credentials`];
|
|
129
|
+
inputs: {
|
|
130
|
+
fields: Config[`fields`];
|
|
131
|
+
link: string;
|
|
132
|
+
setup?: any;
|
|
133
|
+
} & SourcePreferences<Config>;
|
|
134
|
+
outputs: {
|
|
135
|
+
done: boolean;
|
|
136
|
+
};
|
|
137
|
+
}>;
|
|
138
|
+
poll?: CoreFunction<{
|
|
139
|
+
credentials: Config[`credentials`];
|
|
140
|
+
inputs: {
|
|
141
|
+
fields: Config[`fields`];
|
|
142
|
+
last_schedule: string;
|
|
143
|
+
limit?: number;
|
|
144
|
+
} & SourcePreferences<Config>;
|
|
145
|
+
outputs: {
|
|
146
|
+
records: Config[`outputs`][];
|
|
147
|
+
flags: Partial<Record<Config[`flags`][`outputs`][number], true>>;
|
|
148
|
+
};
|
|
149
|
+
}>;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
export type DebounceableImmediateTrigger<Config extends SetupEventConfig> = CommonEvents<Config> & {
|
|
153
|
+
type: `trigger`;
|
|
154
|
+
immediate: true;
|
|
155
|
+
outputs: [DefaultConnectableEvent<Config[`flags`][`outputs`][number]>];
|
|
156
|
+
functions: {
|
|
157
|
+
mount?: CoreFunction<{
|
|
158
|
+
credentials: Config[`credentials`];
|
|
159
|
+
inputs: {
|
|
160
|
+
fields: Config[`fields`];
|
|
161
|
+
link: string;
|
|
162
|
+
};
|
|
163
|
+
outputs: {
|
|
164
|
+
done: boolean;
|
|
165
|
+
setup?: Config[`setup`];
|
|
166
|
+
};
|
|
167
|
+
}>;
|
|
168
|
+
check?: CoreFunction<{
|
|
169
|
+
credentials: Config[`credentials`];
|
|
170
|
+
inputs: {
|
|
171
|
+
fields: Config[`fields`];
|
|
172
|
+
link: string;
|
|
173
|
+
setup?: Config[`setup`];
|
|
174
|
+
};
|
|
175
|
+
outputs: {
|
|
176
|
+
done: boolean;
|
|
177
|
+
};
|
|
178
|
+
}>;
|
|
179
|
+
unmount?: CoreFunction<{
|
|
180
|
+
credentials: Config[`credentials`];
|
|
181
|
+
inputs: {
|
|
182
|
+
fields: Config[`fields`];
|
|
183
|
+
link: string;
|
|
184
|
+
setup?: Config[`setup`];
|
|
185
|
+
};
|
|
186
|
+
outputs: {
|
|
187
|
+
done: boolean;
|
|
188
|
+
};
|
|
189
|
+
}>;
|
|
190
|
+
challenge?: CoreFunction<{
|
|
191
|
+
credentials: Config[`credentials`];
|
|
192
|
+
inputs: {
|
|
193
|
+
fields: Config[`fields`];
|
|
194
|
+
link: string;
|
|
195
|
+
request: Request;
|
|
196
|
+
setup?: Config[`setup`];
|
|
121
197
|
};
|
|
122
198
|
outputs: {
|
|
123
199
|
done: boolean;
|
|
124
200
|
response?: any;
|
|
125
201
|
};
|
|
126
202
|
}>;
|
|
127
|
-
|
|
203
|
+
debounce: CoreFunction<{
|
|
128
204
|
credentials: Config[`credentials`];
|
|
129
205
|
inputs: {
|
|
130
206
|
fields: Config[`fields`];
|
|
131
207
|
request: Request;
|
|
132
208
|
setup?: Config[`setup`];
|
|
209
|
+
};
|
|
210
|
+
outputs: {
|
|
211
|
+
done: boolean;
|
|
212
|
+
response: string;
|
|
213
|
+
};
|
|
214
|
+
}>;
|
|
215
|
+
handle: CoreFunction<{
|
|
216
|
+
credentials: Config[`credentials`];
|
|
217
|
+
inputs: {
|
|
218
|
+
fields: Config[`fields`];
|
|
219
|
+
requests: Request[];
|
|
220
|
+
setup?: Config[`setup`];
|
|
133
221
|
} & SourcePreferences<Config>;
|
|
134
222
|
outputs: {
|
|
135
223
|
records: Config[`outputs`][];
|
|
@@ -180,7 +268,7 @@ export type ScheduledTrigger<Config extends EventConfig> = CommonEvents<Config>
|
|
|
180
268
|
}>;
|
|
181
269
|
};
|
|
182
270
|
};
|
|
183
|
-
export type Trigger<Config extends EventConfig = {}> = ImmediateTrigger<Config> | ScheduledTrigger<Config>;
|
|
271
|
+
export type Trigger<Config extends EventConfig = {}> = ImmediateTrigger<Config> | DebounceableImmediateTrigger<Config> | ScheduledTrigger<Config>;
|
|
184
272
|
type StandardOutputWithMemory<Config extends MemoryEventConfig> = {
|
|
185
273
|
output: ObjectOrArray<Config[`outputs`]>;
|
|
186
274
|
flags: Partial<Record<Config[`flags`][`outputs`][number], true>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Core, core, SourceFunctions, StorageFunctions } from './core';
|
|
2
2
|
export { CoreFunction, idSchema } from './entities/commons';
|
|
3
3
|
export { Credentials, credentialsSchema, OAuthCredentials, oauthCredentialsSchema, SessionCredentials, sessionCredentialsSchema, StaticCredentials, staticCredentialsSchema } from './entities/credentials';
|
|
4
|
-
export { Action, actionOutputSchema, actionSchema, AsyncAction, Event, eventSchema, ImmediateTrigger, immediateTriggerSchema, Request, ScheduledTrigger, scheduledTriggerSchema, SyncAction, syncActionSchema, Trigger, triggerOutputSchema, triggerSchema } from './entities/events';
|
|
4
|
+
export { Action, actionOutputSchema, actionSchema, AsyncAction, Event, eventSchema, ImmediateTrigger, DebounceableImmediateTrigger, immediateTriggerSchema, Request, ScheduledTrigger, scheduledTriggerSchema, SyncAction, syncActionSchema, Trigger, triggerOutputSchema, triggerSchema } from './entities/events';
|
|
5
5
|
export { Provider, providerSchema } from './entities/provider';
|
|
6
6
|
export { Source } from './entities/source';
|
|
7
7
|
export { getPath, hasExpression, isDynamic, isExpression, split } from './minified-utils/context';
|
package/package.json
CHANGED
package/src/entities/events.ts
CHANGED
|
@@ -101,14 +101,57 @@ export type ImmediateTrigger<Config extends SetupEventConfig> = CommonEvents<Con
|
|
|
101
101
|
inputs: { fields: Config[`fields`], link: string, request: Request, setup?: Config[`setup`] },
|
|
102
102
|
outputs: { done: boolean, response?: any },
|
|
103
103
|
}>,
|
|
104
|
-
|
|
104
|
+
handle: CoreFunction<{
|
|
105
105
|
credentials: Config[`credentials`],
|
|
106
|
-
inputs: { fields: Config[`fields`], request: Request, setup?: Config[`setup`] }
|
|
106
|
+
inputs: { fields: Config[`fields`], request: Request, setup?: Config[`setup`] } & SourcePreferences<Config>,
|
|
107
|
+
outputs: { records: Config[`outputs`][], flags: Partial<Record<Config[`flags`][`outputs`][number], true>> },
|
|
108
|
+
}>,
|
|
109
|
+
fire?: CoreFunction<{
|
|
110
|
+
credentials: Config[`credentials`],
|
|
111
|
+
inputs: { fields: Config[`fields`], link: string, setup?: any } & SourcePreferences<Config>,
|
|
112
|
+
outputs: { done: boolean },
|
|
113
|
+
}>,
|
|
114
|
+
poll?: CoreFunction<{
|
|
115
|
+
credentials: Config[`credentials`],
|
|
116
|
+
inputs: { fields: Config[`fields`], last_schedule: string, limit?: number } & SourcePreferences<Config>,
|
|
117
|
+
outputs: { records: Config[`outputs`][], flags: Partial<Record<Config[`flags`][`outputs`][number], true>> },
|
|
118
|
+
}>,
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export type DebounceableImmediateTrigger<Config extends SetupEventConfig> = CommonEvents<Config> & {
|
|
123
|
+
type: `trigger`,
|
|
124
|
+
immediate: true,
|
|
125
|
+
outputs: [DefaultConnectableEvent<Config[`flags`][`outputs`][number]>],
|
|
126
|
+
functions: {
|
|
127
|
+
mount?: CoreFunction<{
|
|
128
|
+
credentials: Config[`credentials`],
|
|
129
|
+
inputs: { fields: Config[`fields`], link: string },
|
|
130
|
+
outputs: { done: boolean, setup?: Config[`setup`] },
|
|
131
|
+
}>,
|
|
132
|
+
check?: CoreFunction<{
|
|
133
|
+
credentials: Config[`credentials`],
|
|
134
|
+
inputs: { fields: Config[`fields`], link: string, setup?: Config[`setup`] },
|
|
135
|
+
outputs: { done: boolean },
|
|
136
|
+
}>,
|
|
137
|
+
unmount?: CoreFunction<{
|
|
138
|
+
credentials: Config[`credentials`],
|
|
139
|
+
inputs: { fields: Config[`fields`], link: string, setup?: Config[`setup`] },
|
|
140
|
+
outputs: { done: boolean },
|
|
141
|
+
}>,
|
|
142
|
+
challenge?: CoreFunction<{
|
|
143
|
+
credentials: Config[`credentials`],
|
|
144
|
+
inputs: { fields: Config[`fields`], link: string, request: Request, setup?: Config[`setup`] },
|
|
107
145
|
outputs: { done: boolean, response?: any },
|
|
108
146
|
}>,
|
|
147
|
+
debounce: CoreFunction<{
|
|
148
|
+
credentials: Config[`credentials`],
|
|
149
|
+
inputs: { fields: Config[`fields`], request: Request, setup?: Config[`setup`] },
|
|
150
|
+
outputs: { done: boolean, response: string },
|
|
151
|
+
}>,
|
|
109
152
|
handle: CoreFunction<{
|
|
110
153
|
credentials: Config[`credentials`],
|
|
111
|
-
inputs: { fields: Config[`fields`],
|
|
154
|
+
inputs: { fields: Config[`fields`], requests: Request[], setup?: Config[`setup`] } & SourcePreferences<Config>,
|
|
112
155
|
outputs: { records: Config[`outputs`][], flags: Partial<Record<Config[`flags`][`outputs`][number], true>> },
|
|
113
156
|
}>,
|
|
114
157
|
fire?: CoreFunction<{
|
|
@@ -139,6 +182,7 @@ export type ScheduledTrigger<Config extends EventConfig> = CommonEvents<Config>
|
|
|
139
182
|
|
|
140
183
|
export type Trigger<Config extends EventConfig = {}> =
|
|
141
184
|
| ImmediateTrigger<Config>
|
|
185
|
+
| DebounceableImmediateTrigger<Config>
|
|
142
186
|
| ScheduledTrigger<Config>;
|
|
143
187
|
|
|
144
188
|
type StandardOutputWithMemory<Config extends MemoryEventConfig> = {
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Core, core, SourceFunctions, StorageFunctions } from './core';
|
|
2
2
|
export { CoreFunction, idSchema } from './entities/commons';
|
|
3
3
|
export { Credentials, credentialsSchema, OAuthCredentials, oauthCredentialsSchema, SessionCredentials, sessionCredentialsSchema, StaticCredentials, staticCredentialsSchema } from './entities/credentials';
|
|
4
|
-
export { Action, actionOutputSchema, actionSchema, AsyncAction, Event, eventSchema, ImmediateTrigger, immediateTriggerSchema, Request, ScheduledTrigger, scheduledTriggerSchema, SyncAction, syncActionSchema, Trigger, triggerOutputSchema, triggerSchema } from './entities/events';
|
|
4
|
+
export { Action, actionOutputSchema, actionSchema, AsyncAction, Event, eventSchema, ImmediateTrigger, DebounceableImmediateTrigger, immediateTriggerSchema, Request, ScheduledTrigger, scheduledTriggerSchema, SyncAction, syncActionSchema, Trigger, triggerOutputSchema, triggerSchema } from './entities/events';
|
|
5
5
|
export { Provider, providerSchema } from './entities/provider';
|
|
6
6
|
export { Source } from './entities/source';
|
|
7
7
|
export { getPath, hasExpression, isDynamic, isExpression, split } from './minified-utils/context';
|