-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
82 changed files
with
2,581 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"name": "supergood", | ||
"version": "1.3.0", | ||
"description": "", | ||
"main": "dist/src/index.js", | ||
"types": "dist/src/index.d.ts", | ||
"author": "Alex Klarfeld", | ||
"license": "ISC", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/supergoodsystems/supergood-js.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/supergoodsystems/supergood-js/issues" | ||
}, | ||
"homepage": "https://supergood.ai/", | ||
"files": [ | ||
"dist" | ||
], | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org" | ||
}, | ||
"engines": { | ||
"node": ">=14", | ||
"npm": ">=6.0.0" | ||
}, | ||
"scripts": { | ||
"check:publish-ready": "yarn build && yarn test", | ||
"preversion": "yarn check:publish-ready", | ||
"postversion": "git add package.json && git commit -m \"chore: update $npm_package_name to v$npm_package_version\" && git tag $npm_package_name@$npm_package_version", | ||
"prepublishOnly": "yarn check:publish-ready", | ||
"postpublish": "git push origin && git push origin --tags", | ||
"test": "yarn run test:unit && yarn run test:e2e", | ||
"test:unit": "jest -c test/jest.unit.config.js", | ||
"test:e2e": "node ./test/mock-server & jest -c test/jest.e2e.config.js", | ||
"posttest:e2e": "kill -9 $(lsof -t -i:3001)", | ||
"clean": "rm -rf dist/ && rm -rf supergood-*.log", | ||
"build": "yarn run clean && tsc -p ./tsconfig.lib.json" | ||
}, | ||
"dependencies": { | ||
"headers-polyfill": "^4.0.2", | ||
"lodash": "^4.17.19", | ||
"node-cache": "^5.1.2", | ||
"pino": "^8.16.2", | ||
"signal-exit": "^3.0.7", | ||
"ts-essentials": "^9.4.1", | ||
"web-encoding": "^1.1.5" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^29.5.8", | ||
"@types/json-server": "^0.14.4", | ||
"@types/lodash": "^4.14.202", | ||
"@types/signal-exit": "^3.0.1", | ||
"@types/superagent": "^4.1.16", | ||
"@typescript-eslint/parser": "^5.49.0", | ||
"axios": "^1.4.0", | ||
"dotenv": "^16.0.3", | ||
"eslint": "^8.32.0", | ||
"eslint-config-prettier": "^8.6.0", | ||
"eslint-plugin-jest": "^27.1.3", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"jest": "^29.2.1", | ||
"jest-extended": "^4.0.2", | ||
"jest-mock-server": "^0.1.0", | ||
"json-server": "^0.17.0", | ||
"openai": "^4.10.0", | ||
"openid-client": "5.6.1", | ||
"postgres": "^3.3.4", | ||
"prettier": "^2.8.1", | ||
"superagent": "^8.0.9", | ||
"ts-jest": "^29.0.5", | ||
"typescript": "^4.9.4", | ||
"undici": "^5.23.0" | ||
} | ||
} |
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 @@ | ||
import { HeaderOptionType, EventRequestType, ErrorPayloadType, TelemetryType } from './types'; | ||
declare const postError: (errorSinkUrl: string, errorPayload: ErrorPayloadType, options: HeaderOptionType) => Promise<string | null>; | ||
declare const postEvents: (eventSinkUrl: string, data: Array<EventRequestType>, options: HeaderOptionType) => Promise<string>; | ||
declare const postTelemetry: (telemetryUrl: string, data: TelemetryType, options: HeaderOptionType) => Promise<string>; | ||
declare const fetchRemoteConfig: (configUrl: string, options: HeaderOptionType) => Promise<any>; | ||
export { postError, postEvents, fetchRemoteConfig, postTelemetry }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,60 @@ | ||
declare const defaultConfig: { | ||
flushInterval: number; | ||
remoteConfigFetchInterval: number; | ||
timeout: number; | ||
eventSinkEndpoint: string; | ||
errorSinkEndpoint: string; | ||
remoteConfigFetchEndpoint: string; | ||
telemetryEndpoint: string; | ||
useRemoteConfig: boolean; | ||
useTelemetry: boolean; | ||
allowLocalUrls: boolean; | ||
allowIpAddresses: boolean; | ||
logRequestHeaders: boolean; | ||
logRequestBody: boolean; | ||
logResponseHeaders: boolean; | ||
logResponseBody: boolean; | ||
ignoredDomains: never[]; | ||
forceRedactAll: boolean; | ||
redactByDefault: boolean; | ||
allowedDomains: never[]; | ||
cacheTtl: number; | ||
proxyConfig: {}; | ||
waitAfterClose: number; | ||
}; | ||
declare const errors: { | ||
CACHING_RESPONSE: string; | ||
CACHING_REQUEST: string; | ||
DUMPING_DATA_TO_DISK: string; | ||
POSTING_EVENTS: string; | ||
POSTING_ERRORS: string; | ||
POSTING_TELEMETRY: string; | ||
FETCHING_CONFIG: string; | ||
WRITING_TO_DISK: string; | ||
TEST_ERROR: string; | ||
UNAUTHORIZED: string; | ||
NO_CLIENT_ID: string; | ||
NO_CLIENT_SECRET: string; | ||
}; | ||
declare const SensitiveKeyActions: { | ||
REDACT: string; | ||
ALLOW: string; | ||
}; | ||
declare const EndpointActions: { | ||
ALLOW: string; | ||
IGNORE: string; | ||
}; | ||
declare const TestErrorPath = "/api/supergood-test-error"; | ||
declare const LocalClientId = "local-client-id"; | ||
declare const LocalClientSecret = "local-client-secret"; | ||
declare const ContentType: { | ||
Json: string; | ||
Text: string; | ||
EventStream: string; | ||
}; | ||
declare const SupergoodProxyHeaders: { | ||
upstreamHeader: string; | ||
clientId: string; | ||
clientSecret: string; | ||
}; | ||
export { defaultConfig, errors, TestErrorPath, LocalClientId, LocalClientSecret, SensitiveKeyActions, EndpointActions, ContentType, SupergoodProxyHeaders }; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,46 @@ | ||
import { ConfigType, MetadataType, SupergoodContext } from './types'; | ||
declare const _default: { | ||
close: (force?: boolean) => Promise<boolean>; | ||
flushCache: ({ force }?: { | ||
force: boolean; | ||
}) => Promise<void>; | ||
waitAndFlushCache: ({ force }?: { | ||
force: boolean; | ||
}) => Promise<void>; | ||
withTags: <TRet>(options: { | ||
tags: Record<string, string | number | string[]>; | ||
trace?: string | undefined; | ||
}, fn: () => Promise<TRet>) => Promise<TRet>; | ||
init: <TConfig extends Partial<ConfigType>>({ clientId, clientSecret, config, metadata, tags, trace, isWithinContext }?: { | ||
clientId?: string | undefined; | ||
clientSecret?: string | undefined; | ||
config?: TConfig | undefined; | ||
metadata?: Partial<MetadataType> | undefined; | ||
tags?: Record<string, string | number | string[]> | undefined; | ||
trace?: string | undefined; | ||
isWithinContext?: (() => boolean) | undefined; | ||
}, baseUrl?: string, baseTelemetryUrl?: string, baseProxyURL?: string) => TConfig extends { | ||
useRemoteConfig: false; | ||
} ? void : Promise<void>; | ||
withCapture: <TRet_1>({ clientId, clientSecret, config, tags, trace, baseUrl, baseTelemetryUrl }: { | ||
clientId?: string | undefined; | ||
clientSecret?: string | undefined; | ||
config?: Partial<ConfigType> | undefined; | ||
tags?: Record<string, string | number | string[]> | undefined; | ||
trace?: string | undefined; | ||
baseUrl?: string | undefined; | ||
baseTelemetryUrl?: string | undefined; | ||
}, fn: () => Promise<TRet_1>) => Promise<TRet_1>; | ||
startCapture: ({ clientId, clientSecret, config, tags, trace, baseUrl, baseTelemetryUrl }: { | ||
clientId?: string | undefined; | ||
clientSecret?: string | undefined; | ||
config?: Partial<ConfigType> | undefined; | ||
tags?: Record<string, string | number | string[]> | undefined; | ||
trace?: string | undefined; | ||
baseUrl?: string | undefined; | ||
baseTelemetryUrl?: string | undefined; | ||
}) => Promise<void>; | ||
stopCapture: () => void; | ||
getAsyncLocalStorage: () => SupergoodContext | undefined; | ||
}; | ||
export = _default; |
Oops, something went wrong.