@beseif-solutions/prow-core 0.2.0 → 0.2.2

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.
@@ -172,7 +172,7 @@ type MemoryOutput<Config extends MemoryEventConfig = {
172
172
  }> = {
173
173
  memory: Config[`memory`];
174
174
  } & (StandardOutput<Config> | {});
175
- export type Action<Config extends MemoryEventConfig = {
175
+ export type SyncAction<Config extends MemoryEventConfig = {
176
176
  fields: Record<string, any>;
177
177
  memory: Record<string, any>;
178
178
  }> = CommonEvents<Config> & {
@@ -227,6 +227,7 @@ export type AsyncAction<Config extends SetupEventConfig = {
227
227
  inputs: {
228
228
  fields: Config[`fields`];
229
229
  flags: Partial<Record<Config[`flags`][`inputs`][number], true>>;
230
+ link: string;
230
231
  setup?: Config[`setup`];
231
232
  };
232
233
  outputs: {
@@ -256,6 +257,9 @@ export type AsyncAction<Config extends SetupEventConfig = {
256
257
  }>;
257
258
  };
258
259
  };
260
+ export type Action<Config extends EventConfig = {
261
+ fields: Record<string, any>;
262
+ }> = SyncAction<Config> | AsyncAction<Config>;
259
263
  export type Event<Config extends EventConfig = {
260
264
  fields: Record<string, any>;
261
265
  }> = Action<Config> | Trigger<Config>;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { Core, core } 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, syncActionSchema, Trigger, triggerOutputSchema, triggerSchema } from './entities/events';
4
+ export { Action, actionOutputSchema, actionSchema, AsyncAction, Event, eventSchema, ImmediateTrigger, 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 { alter, extract, Field, fieldSchema, fieldsSchema, File, SelectFieldChoice, validate, ValidationResult } from './minified-utils/fields';
@@ -241,7 +241,7 @@ const getSimpleFieldSchema = (field) => {
241
241
  case `any`:
242
242
  typeSchema = anySchema();
243
243
  if (field.allow_nullish) {
244
- typeSchema = typeSchema.allow(null, ``, 0, undefined);
244
+ typeSchema = typeSchema.allow(null, ``, 0);
245
245
  }
246
246
  break;
247
247
  case `boolean`:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beseif-solutions/prow-core",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Prow core functionalities and classes",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -131,7 +131,7 @@ type MemoryOutput<Config extends MemoryEventConfig = { memory: Record<string, an
131
131
  memory: Config[`memory`],
132
132
  } & (StandardOutput<Config> | {});
133
133
 
134
- export type Action<Config extends MemoryEventConfig = { fields: Record<string, any>, memory: Record<string, any> }> = CommonEvents<Config> & {
134
+ export type SyncAction<Config extends MemoryEventConfig = { fields: Record<string, any>, memory: Record<string, any> }> = CommonEvents<Config> & {
135
135
  type: `action`,
136
136
  inputs: [DefaultConnectableEvent<Config[`flags`][`inputs`][number]>, ...AdditionalConnectableEvent<Config[`flags`][`inputs`][number]>[]],
137
137
  outputs: [DefaultConnectableEvent<Config[`flags`][`outputs`][number]>, ...(AdditionalConnectableEvent<Config[`flags`][`outputs`][number]> | ErrorConnectableEvent<Config[`flags`][`outputs`][number]>)[]],
@@ -162,7 +162,7 @@ export type AsyncAction<Config extends SetupEventConfig = { fields: Record<strin
162
162
  }>,
163
163
  execute: CoreFunction<{
164
164
  credentials: Config[`credentials`],
165
- inputs: { fields: Config[`fields`], flags: Partial<Record<Config[`flags`][`inputs`][number], true>>, setup?: Config[`setup`] },
165
+ inputs: { fields: Config[`fields`], flags: Partial<Record<Config[`flags`][`inputs`][number], true>>, link: string, setup?: Config[`setup`] },
166
166
  outputs: { done: boolean, setup?: Config[`setup`] },
167
167
  }>,
168
168
  handle: CoreFunction<{
@@ -177,6 +177,9 @@ export type AsyncAction<Config extends SetupEventConfig = { fields: Record<strin
177
177
  }>,
178
178
  },
179
179
  };
180
+ export type Action<Config extends EventConfig = { fields: Record<string, any> }> =
181
+ | SyncAction<Config>
182
+ | AsyncAction<Config>;
180
183
 
181
184
  export type Event<Config extends EventConfig = { fields: Record<string, any> }> =
182
185
  | Action<Config>
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { Core, core } 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, syncActionSchema, Trigger, triggerOutputSchema, triggerSchema } from './entities/events';
4
+ export { Action, actionOutputSchema, actionSchema, AsyncAction, Event, eventSchema, ImmediateTrigger, 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 { alter, extract, Field, fieldSchema, fieldsSchema, File, SelectFieldChoice, validate, ValidationResult } from './minified-utils/fields';
@@ -462,7 +462,7 @@ const getSimpleFieldSchema = (field: Field) => {
462
462
  case `any`:
463
463
  typeSchema = anySchema();
464
464
  // allow null values for any type
465
- if (field.allow_nullish) { typeSchema = typeSchema.allow(null, ``, 0, undefined); }
465
+ if (field.allow_nullish) { typeSchema = typeSchema.allow(null, ``, 0); }
466
466
  break;
467
467
  case `boolean`:
468
468
  typeSchema = Joi.bool();