-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from ajthinking/quick-wins
Cleanups
- Loading branch information
Showing
38 changed files
with
273 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
# Placeholder | ||
|
||
import NodeDemo from '../../components/demos/NodeDemo' | ||
|
||
<NodeDemo nodeName={'Comment'} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env*.local | ||
.env*.local | ||
.env | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
# datastory | ||
.datastory/cache | ||
.datastory/data | ||
.datastory/executions | ||
.datastory/local*.* | ||
|
||
notes | ||
notes.json | ||
notes.js | ||
notes.md | ||
|
||
src/tinker.ts | ||
|
||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "@data-story/hubspot", | ||
"version": "0.0.71", | ||
"main": "dist/index.js", | ||
"type": "commonjs", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"scripts": { | ||
"watch:tsc": "tsc --watch", | ||
"tinker": "npx ts-node ./src/tinker.ts", | ||
"test": "yarn run -T vitest", | ||
"build": "tsc", | ||
"release": "yarn run -T release-it" | ||
}, | ||
"release-it": { | ||
"git": false, | ||
"npm": { | ||
"publish": false, | ||
"skipChecks": true, | ||
"versionArgs": [ | ||
"--workspaces-update=false" | ||
] | ||
} | ||
}, | ||
"dependencies": { | ||
"@data-story/core": "workspace:*", | ||
"@types/node": "18.14.2", | ||
"axios": "^1.3.4", | ||
"dotenv": "^16.0.3", | ||
"openai": "^3.2.1", | ||
"ws": "^8.12.1" | ||
}, | ||
"devDependencies": { | ||
"@types/glob": "^8.1.0", | ||
"@types/ws": "^8.5.4", | ||
"nodemon": "^2.0.21", | ||
"ts-node": "^10.9.1", | ||
"typescript": "4.9.5", | ||
"webpack": "^5.88.1", | ||
"webpack-cli": "^5.1.4", | ||
"webpack-shebang-plugin": "^1.1.8" | ||
} | ||
} |
Empty file.
Empty file.
58 changes: 58 additions & 0 deletions
58
packages/hubspot/src/computers/crm/entity/basicApi/getById.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { ComputerConfig } from '@data-story/core'; | ||
import { Configuration, OpenAIApi } from 'openai'; | ||
|
||
export const getById: ComputerConfig = { | ||
name: 'getById', | ||
inputs: ['input'], | ||
outputs: ['entity'], | ||
params: [ | ||
{ | ||
name: 'id', | ||
label: 'Id', | ||
help: 'The ID of the entity to retrieve.', | ||
inputMode: { | ||
type: 'Stringable', | ||
multiline: true, | ||
canInterpolate: true, | ||
interpolate: true, | ||
evaluations: [], | ||
casts: [], | ||
value: '', | ||
}, | ||
alternativeInputModes: [], | ||
}, | ||
], | ||
|
||
category: 'API', | ||
|
||
async *run({ input, output }) { | ||
|
||
if(!process.env.OPEN_AI_SECRET) throw Error('OPEN_AI_SECRET env not set') | ||
|
||
const openai = new OpenAIApi( | ||
new Configuration({ | ||
apiKey: process.env.OPEN_AI_SECRET, | ||
}) | ||
); | ||
|
||
while(true) { | ||
const [ incoming ] = input.pull(1) | ||
|
||
const prompt = incoming.params.prompt as string | ||
|
||
const completion = await openai.createCompletion({ | ||
model: 'text-davinci-003', | ||
prompt, | ||
temperature: 0, | ||
max_tokens: 500, | ||
top_p: 1, | ||
frequency_penalty: 0.0, | ||
presence_penalty: 0.0, | ||
}); | ||
|
||
output.pushTo('completions', completion.data.choices) | ||
|
||
yield; | ||
} | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { getById } from './getById'; |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const getAll = () => {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { AskChatGpt } from './AskChatGpt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Application, ComputerConfig, ComputerFactory, ServiceProvider } from '@data-story/core'; | ||
import * as computerConfigs from './computers' | ||
|
||
export const hubspotProvider: ServiceProvider = { | ||
register: (app: Application) => { | ||
const configs = Object.values(computerConfigs as {[key: string]: ComputerConfig}) | ||
app.addComputers(configs); | ||
}, | ||
|
||
boot: (app: Application) => {} | ||
} | ||
|
||
// Contacts.getAll | ||
|
||
// Contacts.getById | ||
// Contacts.create | ||
// Contacts.update | ||
// Contacts.archive | ||
|
||
// Contacts.batch.create | ||
// Contacts.batch.update | ||
// Contacts.batch.archive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { hubspotProvider } from './hubspotProvider' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES6", | ||
"lib": [ | ||
"esnext" | ||
], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"outDir": "dist", | ||
"esModuleInterop": true, | ||
"module": "commonjs", | ||
"sourceMap": true, | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"incremental": true, | ||
"noImplicitAny": true, | ||
"types": [ | ||
"vitest/globals" | ||
], | ||
"declaration": true | ||
}, | ||
"ts-node": { | ||
"compilerOptions": { | ||
"module": "CommonJS" | ||
} | ||
}, | ||
"include": [ | ||
"./src/**/*.ts" | ||
], | ||
"exclude": [ | ||
"./node_modules" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { defineConfig } from 'vitest/config' | ||
|
||
export default defineConfig({ | ||
test: { | ||
globals: true, | ||
coverage: { | ||
all: true, | ||
exclude: [ | ||
'./**/*.test.ts', | ||
'./dist/**', | ||
] | ||
}, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters