Skip to content

Commit

Permalink
Merge branch 'main' into feat/openapi-schema-implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
carlbrugger committed Oct 31, 2023
2 parents 0147d90 + 7ca9341 commit 8209ea5
Show file tree
Hide file tree
Showing 22 changed files with 154 additions and 20 deletions.
63 changes: 52 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions plugins/delimiter-extractor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @flatfile/plugin-delimiter-extractor

## 0.7.6

### Patch Changes

- 59cb901: Export parsers

## 0.7.5

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion plugins/delimiter-extractor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flatfile/plugin-delimiter-extractor",
"version": "0.7.5",
"version": "0.7.6",
"description": "A plugin for parsing a delimited file and extracting it into Flatfile.",
"registryMetadata": {
"category": "extractors"
Expand Down
2 changes: 2 additions & 0 deletions plugins/delimiter-extractor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ export const DelimiterExtractor = (
...restOptions,
})
}

export const delimiterParser = parseBuffer
12 changes: 12 additions & 0 deletions plugins/export-workbook/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @flatfile/plugin-export-workbook

## 0.0.9

### Patch Changes

- 59cb901: Export parsers

## 0.0.8

### Patch Changes

- 53003e9: Add "Next" url to job completion message

## 0.0.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion plugins/export-workbook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flatfile/plugin-export-workbook",
"version": "0.0.7",
"version": "0.0.9",
"description": "A plugin for exporting data in Flatfile to Workbooks.",
"registryMetadata": {
"category": "export"
Expand Down
5 changes: 5 additions & 0 deletions plugins/export-workbook/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ export const run = async (
outcome: {
message:
'Data was successfully written to Excel file and uploaded. You can access the workbook in the "Available Downloads" section of the Files page in Flatfile.',
next: {
type: 'url',
url: `/space/${spaceId}/files?mode=export`,
label: 'Available Downloads',
},
},
})

Expand Down
6 changes: 6 additions & 0 deletions plugins/json-extractor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @flatfile/plugin-json-extractor

## 0.6.7

### Patch Changes

- 59cb901: Export parsers

## 0.6.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion plugins/json-extractor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flatfile/plugin-json-extractor",
"version": "0.6.6",
"version": "0.6.7",
"description": "A plugin for parsing json files in Flatfile.",
"registryMetadata": {
"category": "extractors"
Expand Down
2 changes: 2 additions & 0 deletions plugins/json-extractor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export const JSONExtractor = (options?: {
return Extractor('.json', 'json', parseBuffer, options)
}

export const jsonParser = parseBuffer

/*
* @deprecated use `JSONExtractor` instead
*/
Expand Down
6 changes: 6 additions & 0 deletions plugins/record-hook/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @flatfile/plugin-record-hook

## 1.1.8

### Patch Changes

- 379e1d7: Dependency update

## 1.1.7

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions plugins/record-hook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flatfile/plugin-record-hook",
"version": "1.1.7",
"version": "1.1.8",
"description": "A plugin for writing custom record-level hooks in Flatfile.",
"registryMetadata": {
"category": "records"
Expand Down Expand Up @@ -32,7 +32,7 @@
},
"license": "ISC",
"dependencies": {
"@flatfile/api": "^1.5.30",
"@flatfile/api": "^1.5.33",
"@flatfile/hooks": "^1.3.1",
"@flatfile/listener": "^0.3.15",
"@flatfile/util-common": "^0.2.1",
Expand Down
6 changes: 6 additions & 0 deletions plugins/xlsx-extractor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @flatfile/plugin-record-hook

## 1.8.1

### Patch Changes

- 59cb901: Export parsers

## 1.8.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion plugins/xlsx-extractor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flatfile/plugin-xlsx-extractor",
"version": "1.8.0",
"version": "1.8.1",
"description": "A plugin for parsing xlsx files in Flatfile.",
"registryMetadata": {
"category": "extractors"
Expand Down
2 changes: 2 additions & 0 deletions plugins/xlsx-extractor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export const ExcelExtractor = (options?: ExcelExtractorOptions) => {
)
}

export const excelParser = parseBuffer

/*
* @deprecated use `ExcelExtractor` instead
*/
Expand Down
6 changes: 6 additions & 0 deletions plugins/xml-extractor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @flatfile/plugin-dxp-config

## 0.5.7

### Patch Changes

- 59cb901: Export parsers

## 0.5.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion plugins/xml-extractor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flatfile/plugin-xml-extractor",
"version": "0.5.6",
"version": "0.5.7",
"description": "A plugin for extracting data from XML files.",
"registryMetadata": {
"category": "extractors"
Expand Down
2 changes: 2 additions & 0 deletions plugins/xml-extractor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ export const XMLExtractor = (options?: {
}) => {
return Extractor('.xml', 'xml', parseBuffer, options)
}

export const xmlParser = parseBuffer
6 changes: 6 additions & 0 deletions utils/common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @flatfile/util-common

## 0.2.2

### Patch Changes

- 82da1b9: Added a utility to process all records

## 0.2.1

### Patch Changes
Expand Down
7 changes: 5 additions & 2 deletions utils/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flatfile/util-common",
"version": "0.2.1",
"version": "0.2.2",
"description": "A library containing common utilities and helpers for plugins.",
"keywords": [],
"author": "Carl Brugger",
Expand All @@ -22,5 +22,8 @@
"url": "https://github.com/FlatFilers/flatfile-plugins.git",
"directory": "utils/common"
},
"license": "ISC"
"license": "ISC",
"dependencies": {
"@flatfile/api": "^1.5.32"
}
}
1 change: 1 addition & 0 deletions utils/common/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './async.batch'
export * from './logging.helper'
export * from './process.records'
28 changes: 28 additions & 0 deletions utils/common/src/process.records.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import api, { Flatfile } from '@flatfile/api'

export async function processRecords<R>(
sheetId: string,
callback: (records: Flatfile.RecordsWithLinks) => R,
recordGetOptions?: Omit<Flatfile.records.GetRecordsRequest, 'pageNumber'>
): Promise<R[]> {
let pageNumber = 1
const results: R[] = []

while (true) {
const {
data: { records },
} = await api.records.get(sheetId, {
...recordGetOptions,
pageNumber: pageNumber++,
})

if (records.length === 0) {
break
}

const result = callback(records)
results.push(result)
}

return results
}

0 comments on commit 8209ea5

Please sign in to comment.