@venturekit/integrations 0.0.0-dev.20260329093916
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +191 -0
- package/dist/auth/api-keys.d.ts +87 -0
- package/dist/auth/api-keys.d.ts.map +1 -0
- package/dist/auth/api-keys.js +177 -0
- package/dist/auth/api-keys.js.map +1 -0
- package/dist/auth/oauth2.d.ts +141 -0
- package/dist/auth/oauth2.d.ts.map +1 -0
- package/dist/auth/oauth2.js +256 -0
- package/dist/auth/oauth2.js.map +1 -0
- package/dist/http/client.d.ts +124 -0
- package/dist/http/client.d.ts.map +1 -0
- package/dist/http/client.js +239 -0
- package/dist/http/client.js.map +1 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/package.json +66 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @venturekit/integrations
|
|
3
|
+
*
|
|
4
|
+
* Third-party API integration for VentureKit.
|
|
5
|
+
* Provides an HTTP client, OAuth2 token management, and API key handling
|
|
6
|
+
* for calling external APIs from your Lambda functions.
|
|
7
|
+
*
|
|
8
|
+
* ## Quick Start
|
|
9
|
+
*
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { apiClient, oauth2, apiKey, apiKeyHeader } from '@venturekit/integrations';
|
|
12
|
+
*
|
|
13
|
+
* // Simple API client with retry
|
|
14
|
+
* const stripe = apiClient({
|
|
15
|
+
* baseUrl: 'https://api.stripe.com/v1',
|
|
16
|
+
* headers: { Authorization: `Bearer ${process.env.STRIPE_KEY}` },
|
|
17
|
+
* retry: { maxRetries: 3 },
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* // OAuth2 client credentials
|
|
21
|
+
* const auth = oauth2({
|
|
22
|
+
* flow: 'client_credentials',
|
|
23
|
+
* tokenUrl: 'https://oauth.provider.com/token',
|
|
24
|
+
* clientId: process.env.CLIENT_ID!,
|
|
25
|
+
* clientSecret: process.env.CLIENT_SECRET!,
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* const provider = apiClient({
|
|
29
|
+
* baseUrl: 'https://api.provider.com',
|
|
30
|
+
* onRequest: [auth.interceptor()],
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* // API key from SSM Parameter Store
|
|
34
|
+
* const key = apiKey({ ssm: '/myapp/prod/api-key' });
|
|
35
|
+
* const client = apiClient({
|
|
36
|
+
* baseUrl: 'https://api.example.com',
|
|
37
|
+
* onRequest: [apiKeyHeader(key, 'X-Api-Key', '')],
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export { apiClient, ApiError, } from './http/client.js';
|
|
42
|
+
export type { ApiClient, ApiClientOptions, ApiRequestOptions, ApiResponse, RetryOptions, RequestInterceptor, ResponseInterceptor, ErrorInterceptor, } from './http/client.js';
|
|
43
|
+
export { oauth2, createMemoryTokenStore, createDynamoDBTokenStore, } from './auth/oauth2.js';
|
|
44
|
+
export type { OAuth2Client, OAuth2Options, ClientCredentialsOptions, AuthorizationCodeOptions, TokenSet, TokenStore, DynamoDBTokenStoreOptions, } from './auth/oauth2.js';
|
|
45
|
+
export { apiKey, apiKeyHeader, } from './auth/api-keys.js';
|
|
46
|
+
export type { ApiKeyHandle, ApiKeySource, ApiKeyFromEnv, ApiKeyFromSSM, ApiKeyFromSecret, } from './auth/api-keys.js';
|
|
47
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAGH,OAAO,EACL,SAAS,EACT,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,MAAM,EACN,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,YAAY,EACZ,aAAa,EACb,wBAAwB,EACxB,wBAAwB,EACxB,QAAQ,EACR,UAAU,EACV,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,MAAM,EACN,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,GACjB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @venturekit/integrations
|
|
3
|
+
*
|
|
4
|
+
* Third-party API integration for VentureKit.
|
|
5
|
+
* Provides an HTTP client, OAuth2 token management, and API key handling
|
|
6
|
+
* for calling external APIs from your Lambda functions.
|
|
7
|
+
*
|
|
8
|
+
* ## Quick Start
|
|
9
|
+
*
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { apiClient, oauth2, apiKey, apiKeyHeader } from '@venturekit/integrations';
|
|
12
|
+
*
|
|
13
|
+
* // Simple API client with retry
|
|
14
|
+
* const stripe = apiClient({
|
|
15
|
+
* baseUrl: 'https://api.stripe.com/v1',
|
|
16
|
+
* headers: { Authorization: `Bearer ${process.env.STRIPE_KEY}` },
|
|
17
|
+
* retry: { maxRetries: 3 },
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* // OAuth2 client credentials
|
|
21
|
+
* const auth = oauth2({
|
|
22
|
+
* flow: 'client_credentials',
|
|
23
|
+
* tokenUrl: 'https://oauth.provider.com/token',
|
|
24
|
+
* clientId: process.env.CLIENT_ID!,
|
|
25
|
+
* clientSecret: process.env.CLIENT_SECRET!,
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* const provider = apiClient({
|
|
29
|
+
* baseUrl: 'https://api.provider.com',
|
|
30
|
+
* onRequest: [auth.interceptor()],
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* // API key from SSM Parameter Store
|
|
34
|
+
* const key = apiKey({ ssm: '/myapp/prod/api-key' });
|
|
35
|
+
* const client = apiClient({
|
|
36
|
+
* baseUrl: 'https://api.example.com',
|
|
37
|
+
* onRequest: [apiKeyHeader(key, 'X-Api-Key', '')],
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
// HTTP Client
|
|
42
|
+
export { apiClient, ApiError, } from './http/client.js';
|
|
43
|
+
// OAuth2
|
|
44
|
+
export { oauth2, createMemoryTokenStore, createDynamoDBTokenStore, } from './auth/oauth2.js';
|
|
45
|
+
// API Key Management
|
|
46
|
+
export { apiKey, apiKeyHeader, } from './auth/api-keys.js';
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,cAAc;AACd,OAAO,EACL,SAAS,EACT,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAY1B,SAAS;AACT,OAAO,EACL,MAAM,EACN,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAW1B,qBAAqB;AACrB,OAAO,EACL,MAAM,EACN,YAAY,GACb,MAAM,oBAAoB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@venturekit/integrations",
|
|
3
|
+
"version": "0.0.0-dev.20260329093916",
|
|
4
|
+
"description": "VentureKit third-party API integration — HTTP client, OAuth2, API key management, retry, circuit breaker",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/venturekit-dev/venturekit.private.git",
|
|
20
|
+
"directory": "packages/integrations"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"registry": "https://registry.npmjs.org",
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"venturekit",
|
|
28
|
+
"saas",
|
|
29
|
+
"integrations",
|
|
30
|
+
"oauth",
|
|
31
|
+
"api-client"
|
|
32
|
+
],
|
|
33
|
+
"license": "Apache-2.0",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@venturekit/core": "0.0.0-dev.20260329093916"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@aws-sdk/client-dynamodb": "^3.500.0",
|
|
39
|
+
"@aws-sdk/lib-dynamodb": "^3.500.0",
|
|
40
|
+
"@aws-sdk/client-ssm": "^3.500.0",
|
|
41
|
+
"@aws-sdk/client-secrets-manager": "^3.500.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependenciesMeta": {
|
|
44
|
+
"@aws-sdk/client-dynamodb": {
|
|
45
|
+
"optional": true
|
|
46
|
+
},
|
|
47
|
+
"@aws-sdk/lib-dynamodb": {
|
|
48
|
+
"optional": true
|
|
49
|
+
},
|
|
50
|
+
"@aws-sdk/client-ssm": {
|
|
51
|
+
"optional": true
|
|
52
|
+
},
|
|
53
|
+
"@aws-sdk/client-secrets-manager": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/node": "^20.10.0",
|
|
59
|
+
"typescript": "^5.3.0"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"build": "tsc",
|
|
63
|
+
"dev": "tsc --watch",
|
|
64
|
+
"clean": "rm -rf dist"
|
|
65
|
+
}
|
|
66
|
+
}
|