Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

5htp-airtable

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

5htp-airtable - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

src/provider/index.ts

4

package.json

@@ -12,3 +12,3 @@ {

],
"version": "0.0.4",
"version": "0.0.5",
"license": "MIT",

@@ -27,3 +27,3 @@ "private": false,

"devDependencies": {
"5htp-core": "^0.3.4-3"
"5htp-core": "^0.3.6-9"
},

@@ -30,0 +30,0 @@ "dependencies": {

@@ -17,6 +17,11 @@ # Airtable Sync for 5HTP

## Changelog
### 0.0.9 (22/12/2023)
* Possibility to create RemoteProviders
## To be done
[] Import typings from 5htp-core (peerdeps)
[] Make reference o
[] Usage doc

@@ -15,11 +15,12 @@ /*----------------------------------

// Specific
export { default as Provider } from './provider';
import AirtableTable, { TMethod, TQueryDataObj } from './table';
import type {
default as DataProvider,
TSyncStats
} from './provider';
import type { default as DataProvider, TSyncStats, TProviderAction } from './provider';
import WebhooksConnector from './webhooks';
import { TFieldType, TTypeHelper } from './typeHelpers';
// Export
export { default as Provider } from './provider';
export { default as ProviderInterface } from './provider/interface';
export { default as RemoteProvider } from './provider/remote';
/*----------------------------------

@@ -166,2 +167,3 @@ - CONST

public Router = this.use('Core/Router');
public Fetch = this.use('Core/Fetch'); // Send request to remote providers

@@ -171,5 +173,7 @@ // Services

// Initialized on start
// Indexes
public providers: {[providerId: string]: DataProvider} = {}
public tableIdToProvider: {[tableId: string]: DataProvider} = {}
private fieldsIdToWatch: string[] = []
public latestSyncTimes: TLatestSyncTimes = {}
private tableMetasByName: TTablesMetadata = {}

@@ -301,6 +305,2 @@ /*----------------------------------

public providers: {[providerId: string]: DataProvider} = {}
public tableIdToProvider: {[tableId: string]: DataProvider} = {}
private fieldsIdToWatch: string[] = []
/**

@@ -380,2 +380,30 @@ * Register a Airtable provider instance to the Airtable Service

public async handleRemoteRequest(
providerId: string,
action: TProviderAction,
data: object
) {
// Get provider via ID
const provider = this.providers[ providerId ];
if (provider === undefined)
throw new Error(`No provider "${providerId}" has been found.`);
// Check if provider.options.remote
if (provider.options.remote !== true)
throw new Error(`Remote access has not been enabled for provider "${providerId}".`);
// Switch action
switch (action) {
case 'create':
return await provider.create( data.record, data.airtableRecord );
case 'update':
return await provider.update( data.records, data.simulate );
case 'delete':
return await provider.delete( data.recordIds );
default:
throw new Error('Unknown action: "' + action + '"')
}
}
/*----------------------------------

@@ -382,0 +410,0 @@ - REPORTING

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc