@beseif-solutions/prow-core 0.3.15 → 0.4.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.
|
@@ -169,13 +169,14 @@ export type ScheduledTrigger<Config extends EventConfig> = CommonEvents<Config>
|
|
|
169
169
|
};
|
|
170
170
|
};
|
|
171
171
|
export type Trigger<Config extends EventConfig = {}> = ImmediateTrigger<Config> | ScheduledTrigger<Config>;
|
|
172
|
-
type
|
|
172
|
+
type StandardOutputWithMemory<Config extends MemoryEventConfig> = {
|
|
173
173
|
output: ObjectOrArray<Config[`outputs`]>;
|
|
174
174
|
flags: Partial<Record<Config[`flags`][`outputs`][number], true>>;
|
|
175
|
+
memory?: Config[`memory`];
|
|
175
176
|
};
|
|
176
|
-
type
|
|
177
|
+
type OnlyMemoryOutput<Config extends MemoryEventConfig> = {
|
|
177
178
|
memory: Config[`memory`];
|
|
178
|
-
}
|
|
179
|
+
};
|
|
179
180
|
export type SyncAction<Config extends MemoryEventConfig> = CommonEvents<Config> & {
|
|
180
181
|
type: `action`;
|
|
181
182
|
inputs: [DefaultConnectableEvent<Config[`flags`][`inputs`][number]>, ...AdditionalConnectableEvent<Config[`flags`][`inputs`][number]>[]];
|
|
@@ -188,7 +189,7 @@ export type SyncAction<Config extends MemoryEventConfig> = CommonEvents<Config>
|
|
|
188
189
|
flags: Partial<Record<Config[`flags`][`inputs`][number], true>>;
|
|
189
190
|
memory?: Config[`memory`];
|
|
190
191
|
} & SourcePreferences<Config>;
|
|
191
|
-
outputs:
|
|
192
|
+
outputs: StandardOutputWithMemory<Config> | OnlyMemoryOutput<Config>;
|
|
192
193
|
}>;
|
|
193
194
|
};
|
|
194
195
|
};
|
|
@@ -209,7 +210,7 @@ export type AsyncAction<Config extends MemoryEventConfig> = CommonEvents<Config>
|
|
|
209
210
|
outputs: {
|
|
210
211
|
done: boolean;
|
|
211
212
|
memory?: Config[`memory`];
|
|
212
|
-
}
|
|
213
|
+
} | StandardOutputWithMemory<Config>;
|
|
213
214
|
}>;
|
|
214
215
|
handle: CoreFunction<{
|
|
215
216
|
credentials: Config[`credentials`];
|
|
@@ -218,7 +219,7 @@ export type AsyncAction<Config extends MemoryEventConfig> = CommonEvents<Config>
|
|
|
218
219
|
request: Request;
|
|
219
220
|
memory?: Config[`memory`];
|
|
220
221
|
} & SourcePreferences<Config>;
|
|
221
|
-
outputs:
|
|
222
|
+
outputs: StandardOutputWithMemory<Config>;
|
|
222
223
|
}>;
|
|
223
224
|
fire?: CoreFunction<{
|
|
224
225
|
credentials: Config[`credentials`];
|
package/dist/entities/events.js
CHANGED
|
@@ -134,10 +134,8 @@ const actionOutputSchema = () => joi_1.default.alternatives(joi_1.default.object
|
|
|
134
134
|
flags: joi_1.default.object()
|
|
135
135
|
.pattern(joi_1.default.string(), joi_1.default.valid(true))
|
|
136
136
|
.required(),
|
|
137
|
+
memory: joi_1.default.object(),
|
|
137
138
|
}), joi_1.default.object({
|
|
138
139
|
memory: joi_1.default.object().required(),
|
|
139
|
-
|
|
140
|
-
flags: joi_1.default.object()
|
|
141
|
-
.pattern(joi_1.default.string(), joi_1.default.valid(true)),
|
|
142
|
-
}).and(`output`, `flags`));
|
|
140
|
+
}));
|
|
143
141
|
exports.actionOutputSchema = actionOutputSchema;
|
package/package.json
CHANGED
|
@@ -33,7 +33,7 @@ export type OAuthCredentials<Config extends CredentialsConfig = {}> = CommonCred
|
|
|
33
33
|
}>,
|
|
34
34
|
connect: CoreFunction<{
|
|
35
35
|
credentials: undefined,
|
|
36
|
-
inputs: { redirect: string, code: string },
|
|
36
|
+
inputs: { redirect: string, code: string } & Record<string, any>,
|
|
37
37
|
outputs: {
|
|
38
38
|
username?: string,
|
|
39
39
|
credentials: Config[`credentials`],
|
package/src/entities/events.ts
CHANGED
|
@@ -135,12 +135,15 @@ export type Trigger<Config extends EventConfig = {}> =
|
|
|
135
135
|
| ImmediateTrigger<Config>
|
|
136
136
|
| ScheduledTrigger<Config>;
|
|
137
137
|
|
|
138
|
-
type
|
|
139
|
-
|
|
138
|
+
type StandardOutputWithMemory<Config extends MemoryEventConfig> = {
|
|
139
|
+
output: ObjectOrArray<Config[`outputs`]>,
|
|
140
|
+
flags: Partial<Record<Config[`flags`][`outputs`][number], true>>,
|
|
141
|
+
memory?: Config[`memory`],
|
|
142
|
+
};
|
|
140
143
|
|
|
141
|
-
type
|
|
144
|
+
type OnlyMemoryOutput<Config extends MemoryEventConfig> = {
|
|
142
145
|
memory: Config[`memory`],
|
|
143
|
-
}
|
|
146
|
+
};
|
|
144
147
|
|
|
145
148
|
export type SyncAction<Config extends MemoryEventConfig> = CommonEvents<Config> & {
|
|
146
149
|
type: `action`,
|
|
@@ -150,7 +153,7 @@ export type SyncAction<Config extends MemoryEventConfig> = CommonEvents<Config>
|
|
|
150
153
|
execute: CoreFunction<{
|
|
151
154
|
credentials: Config[`credentials`],
|
|
152
155
|
inputs: { fields: Config[`fields`], flags: Partial<Record<Config[`flags`][`inputs`][number], true>>, memory?: Config[`memory`] } & SourcePreferences<Config>,
|
|
153
|
-
outputs:
|
|
156
|
+
outputs: StandardOutputWithMemory<Config> | OnlyMemoryOutput<Config>,
|
|
154
157
|
}>,
|
|
155
158
|
},
|
|
156
159
|
};
|
|
@@ -164,12 +167,12 @@ export type AsyncAction<Config extends MemoryEventConfig> = CommonEvents<Config>
|
|
|
164
167
|
execute: CoreFunction<{
|
|
165
168
|
credentials: Config[`credentials`],
|
|
166
169
|
inputs: { fields: Config[`fields`], flags: Partial<Record<Config[`flags`][`inputs`][number], true>>, link: string, memory?: Config[`memory`] } & SourcePreferences<Config>,
|
|
167
|
-
outputs: { done: boolean, memory?: Config[`memory`] }
|
|
170
|
+
outputs: { done: boolean, memory?: Config[`memory`] } | StandardOutputWithMemory<Config>,
|
|
168
171
|
}>,
|
|
169
172
|
handle: CoreFunction<{
|
|
170
173
|
credentials: Config[`credentials`],
|
|
171
174
|
inputs: { fields: Config[`fields`], request: Request, memory?: Config[`memory`] } & SourcePreferences<Config>,
|
|
172
|
-
outputs:
|
|
175
|
+
outputs: StandardOutputWithMemory<Config>,
|
|
173
176
|
}>,
|
|
174
177
|
fire?: CoreFunction<{
|
|
175
178
|
credentials: Config[`credentials`],
|
|
@@ -346,7 +349,7 @@ export const triggerOutputSchema = () =>
|
|
|
346
349
|
|
|
347
350
|
export const actionOutputSchema = () =>
|
|
348
351
|
Joi.alternatives(
|
|
349
|
-
// standard output
|
|
352
|
+
// standard output + memory
|
|
350
353
|
Joi.object({
|
|
351
354
|
output: Joi.alternatives(
|
|
352
355
|
Joi.array(),
|
|
@@ -355,15 +358,10 @@ export const actionOutputSchema = () =>
|
|
|
355
358
|
flags: Joi.object()
|
|
356
359
|
.pattern(Joi.string(), Joi.valid(true))
|
|
357
360
|
.required(),
|
|
361
|
+
memory: Joi.object(),
|
|
358
362
|
}),
|
|
359
|
-
// memory output
|
|
363
|
+
// only memory output
|
|
360
364
|
Joi.object({
|
|
361
365
|
memory: Joi.object().required(),
|
|
362
|
-
|
|
363
|
-
Joi.array(),
|
|
364
|
-
Joi.object(),
|
|
365
|
-
),
|
|
366
|
-
flags: Joi.object()
|
|
367
|
-
.pattern(Joi.string(), Joi.valid(true)),
|
|
368
|
-
}).and(`output`, `flags`),
|
|
366
|
+
}),
|
|
369
367
|
);
|