diff --git a/.github/workflows/pull-request-checks.yaml b/.github/workflows/pull-request-checks.yaml index 800368824be90..0ad9ec1a294b6 100644 --- a/.github/workflows/pull-request-checks.yaml +++ b/.github/workflows/pull-request-checks.yaml @@ -21,6 +21,7 @@ jobs: - uses: jitterbit/get-changed-files@v1 id: changed_files name: Get changed files + continue-on-error: true - id: md_changed_files name: Spellcheck Markdown files run: |- @@ -93,6 +94,7 @@ jobs: uses: jitterbit/get-changed-files@v1 with: format: 'space-delimited' + continue-on-error: true - name: Lint changed files run: npx eslint --quiet ${{ steps.changed_files_space.outputs.added_modified }} ${{ steps.changed_files_space.outputs.renamed }} - name: Get Changed Files (comma-separated) @@ -100,6 +102,7 @@ jobs: uses: jitterbit/get-changed-files@v1 with: format: 'csv' + continue-on-error: true # NOTE: These steps are kept in this workflow to avoid re-rerunning the rest of the lint job # in the Components Checks workflow - name: Check component keys diff --git a/types/src/index.ts b/types/src/index.ts index 80a5d8183339d..01846d400223c 100644 --- a/types/src/index.ts +++ b/types/src/index.ts @@ -310,15 +310,25 @@ export interface EmitMetadata { ts?: number; } +export interface IdEmitMetadata extends EmitMetadata { + id: string | number; +} + type EmitFunction = { $emit: (event: JSONValue, metadata?: EmitMetadata) => Promise; }; +type IdEmitFunction = { + $emit: (event: JSONValue, metadata: IdEmitMetadata) => Promise; +}; + type PropThis = { [Prop in keyof Props]: Props[Prop] extends App ? any : any }; -export interface Source< +type Modify = Omit & R; + +interface BaseSource< Methods, SourcePropDefinitions > { @@ -337,6 +347,38 @@ export interface Source< run: (this: PropThis & Methods & EmitFunction, options?: SourceRunOptions) => void | Promise; } +export interface LastSource< + Methods, + SourcePropDefinitions +> extends BaseSource< + Methods, + SourcePropDefinitions +> { + dedupe?: "last"; +} + +export type DedupedSource< + Methods, + SourcePropDefinitions +> = Modify, { + dedupe: "greatest" | "unique"; + run: (this: PropThis & Methods & IdEmitFunction, options?: SourceRunOptions) => void | Promise; +}>; + +export type Source< + Methods, + SourcePropDefinitions +> = LastSource< + Methods, + SourcePropDefinitions +> | DedupedSource< + Methods, + SourcePropDefinitions +>; + export function defineSource< Methods, SourcePropDefinitions, diff --git a/types/src/types.test.ts b/types/src/types.test.ts index 7178af09fd261..5812ed35d3d7f 100644 --- a/types/src/types.test.ts +++ b/types/src/types.test.ts @@ -352,3 +352,17 @@ const actionWrongType: Pipedream.Action