@jini-ai/integrations 0.6.15 → 0.6.17
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/CHANGELOG.md +6 -0
- package/dist/api-connections/index.d.ts +1 -1
- package/dist/api-connections/index.js +1 -1
- package/dist/api-connections/token-store/index.d.ts +1 -0
- package/dist/api-connections/token-store/index.js +2 -0
- package/dist/api-connections/token-store/record.d.ts +2 -2
- package/dist/api-connections/token-store/record.js +2 -2
- package/dist/media-providers/sqlite-driver.adapter.d.ts +0 -1
- package/dist/media-providers/sqlite-driver.adapter.js +3 -1
- package/package.json +20 -13
package/CHANGELOG.md
CHANGED
|
@@ -14,5 +14,5 @@ export type { ApiConnectionStatusView } from './status.js';
|
|
|
14
14
|
export type { ApiConnectionDisconnectResult, ApiConnectionRemoteRevocation, ApiConnectionSwitchResult } from './account-actions.js';
|
|
15
15
|
export type { ApiConnectionAccessTokens } from './access-token.js';
|
|
16
16
|
export type { ApiConnectionAccount, ApiConnectionAttempt, ApiConnectionBoundedField, ApiConnectionDescriptor, ApiConnectionIntent, ApiConnectionRecord, ApiConnectionRevocationFailure, ApiConnectionStagedSwitch, ApiConnectionStatus, } from './types.js';
|
|
17
|
-
export { createVaultOAuthTokenStore, parseOAuthTokenVaultMeta, type VaultOAuthTokenStore, type VaultOAuthTokenStoreDeps, type OAuthTokenVaultPort, type ReadConnectionGeneration, type OAuthConnectionOwner, type OAuthConnectionStatus, type OAuthTokenStoreErrorCode, } from './token-store/index.js';
|
|
17
|
+
export { createVaultOAuthTokenStore, parseOAuthTokenVaultMeta, parseTokenPayload, buildTokenPayload, type VaultOAuthTokenStore, type VaultOAuthTokenStoreDeps, type OAuthTokenVaultPort, type ReadConnectionGeneration, type OAuthConnectionOwner, type OAuthConnectionStatus, type OAuthTokenStoreErrorCode, } from './token-store/index.js';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -6,5 +6,5 @@ export { parseApiConnectionDescriptor } from './descriptor.js';
|
|
|
6
6
|
export { createApiConnectionService } from './service.js';
|
|
7
7
|
export { deriveApiConnectionKey, createApiConnectionGenerationReader } from './keys.js';
|
|
8
8
|
export { ApiConnectionError } from './errors.js';
|
|
9
|
-
export { createVaultOAuthTokenStore, parseOAuthTokenVaultMeta, } from './token-store/index.js';
|
|
9
|
+
export { createVaultOAuthTokenStore, parseOAuthTokenVaultMeta, parseTokenPayload, buildTokenPayload, } from './token-store/index.js';
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
* all of it except the `OAuthTokenStoreError` class (hosts read its `code`). */
|
|
3
3
|
export { createVaultOAuthTokenStore, type VaultOAuthTokenStore, type VaultOAuthTokenStoreDeps, type OAuthTokenVaultPort, type ReadConnectionGeneration } from "./vault-token-store.js";
|
|
4
4
|
export { parseOAuthTokenVaultMeta, type OAuthConnectionOwner, type OAuthConnectionStatus } from "./record.js";
|
|
5
|
+
export { parseTokenPayload, buildTokenPayload } from "./record.js";
|
|
5
6
|
export { OAuthTokenStoreError, type OAuthTokenStoreErrorCode } from "./errors.js";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
* all of it except the `OAuthTokenStoreError` class (hosts read its `code`). */
|
|
3
3
|
export { createVaultOAuthTokenStore } from "./vault-token-store.js";
|
|
4
4
|
export { parseOAuthTokenVaultMeta } from "./record.js";
|
|
5
|
+
// Archive adapters rebind through the same codec used by live token reads and writes.
|
|
6
|
+
export { parseTokenPayload, buildTokenPayload } from "./record.js";
|
|
5
7
|
export { OAuthTokenStoreError } from "./errors.js";
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -44,7 +44,7 @@ export declare function buildTokenPayload(required: {
|
|
|
44
44
|
owner: OAuthConnectionOwner;
|
|
45
45
|
generation: number;
|
|
46
46
|
tokens: OAuthTokenSet | null;
|
|
47
|
-
}): VaultMeta;
|
|
47
|
+
}, _options?: Record<string, never>): VaultMeta;
|
|
48
48
|
/** Validates a token set before it is written or after it is read. @throws `invalid-record`. */
|
|
49
49
|
export declare function parseTokenSet({ value }: {
|
|
50
50
|
value: unknown;
|
|
@@ -55,7 +55,7 @@ export declare function parseTokenPayload(required: {
|
|
|
55
55
|
payload: unknown;
|
|
56
56
|
key: string;
|
|
57
57
|
owner: OAuthConnectionOwner;
|
|
58
|
-
}): OAuthTokenPayload;
|
|
58
|
+
}, _options?: Record<string, never>): OAuthTokenPayload;
|
|
59
59
|
/** Generation of the row an install is about to replace, or null when its payload is malformed.
|
|
60
60
|
* An install may overwrite a malformed row or one sealed for another client id of the same
|
|
61
61
|
* key and connection (the host changed its OAuth client): refusing either would lock the
|
|
@@ -39,7 +39,7 @@ export function readRecordMeta({ meta }) {
|
|
|
39
39
|
}
|
|
40
40
|
/** Builds the sealed payload; the owner and key are sealed with the tokens so a row copied or
|
|
41
41
|
* re-pointed to another connection is refused on read. */
|
|
42
|
-
export function buildTokenPayload(required) {
|
|
42
|
+
export function buildTokenPayload(required, _options = {}) {
|
|
43
43
|
const { key, owner, generation, tokens } = required;
|
|
44
44
|
return { format: OAUTH_TOKEN_RECORD_FORMAT, version: PAYLOAD_VERSION, key, generation,
|
|
45
45
|
owner: { workspaceId: owner.workspaceId, pluginId: owner.pluginId, connectionId: owner.connectionId, clientId: owner.clientId },
|
|
@@ -69,7 +69,7 @@ export function parseTokenSet({ value }) {
|
|
|
69
69
|
}
|
|
70
70
|
/** Opens a decrypted payload for one expected key and owner.
|
|
71
71
|
* @throws `owner-mismatch` when it belongs elsewhere, `invalid-record` when malformed. */
|
|
72
|
-
export function parseTokenPayload(required) {
|
|
72
|
+
export function parseTokenPayload(required, _options = {}) {
|
|
73
73
|
const { payload, key, owner } = required;
|
|
74
74
|
if (!isRecord(payload) || payload.format !== OAUTH_TOKEN_RECORD_FORMAT || payload.version !== PAYLOAD_VERSION)
|
|
75
75
|
throw invalid();
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** Native compatibility adapter, loaded only when a host did not inject its own SQLite opener. */
|
|
2
1
|
import type { SqliteSyncOpener } from '@jini-ai/db/sqlite';
|
|
3
2
|
export declare function loadMediaSqliteOpener(_required: Record<string, never>, _optional?: Record<string, never>): Promise<SqliteSyncOpener>;
|
|
4
3
|
//# sourceMappingURL=sqlite-driver.adapter.d.ts.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/** Native compatibility adapter, loaded only when a host did not inject its own SQLite opener. */
|
|
2
|
+
import { loadOptionalPeer } from '@jini-ai/core/optional-peer';
|
|
1
3
|
export async function loadMediaSqliteOpener(_required, _optional = {}) {
|
|
2
|
-
const { default: Database } = await import('better-sqlite3');
|
|
4
|
+
const { default: Database } = await loadOptionalPeer({ feature: 'SQLite storage', dependency: 'better-sqlite3', load: () => import('better-sqlite3') });
|
|
3
5
|
return (file, options) => new Database(file, options);
|
|
4
6
|
}
|
|
5
7
|
//# sourceMappingURL=sqlite-driver.adapter.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/integrations",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.17",
|
|
4
4
|
"description": "Third-party vendor integrations and outbound services, each independently importable: media generation, credentialed HTTP and webhooks.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -20,6 +20,13 @@
|
|
|
20
20
|
"./api-connections": "node",
|
|
21
21
|
"./media-providers/node": "node",
|
|
22
22
|
"./saved-requests": "node"
|
|
23
|
+
},
|
|
24
|
+
"optionalPeers": {
|
|
25
|
+
"@jini-ai/db": "opt-in: database-backed adapters — Database-backed adapters could not load @jini-ai/db. Install @jini-ai/db to enable this feature, or check its installed version and native binaries.",
|
|
26
|
+
"better-sqlite3": "opt-in: sqlite storage; import @jini-ai/integrations/media-providers — SQLite storage could not load better-sqlite3. Install better-sqlite3 to enable this feature, or check its installed version and native binaries.",
|
|
27
|
+
"@jini-ai/platform": "opt-in: platform-backed adapters; import @jini-ai/integrations/media-providers — Platform-backed adapters could not load @jini-ai/platform. Install @jini-ai/platform to enable this feature, or check its installed version and native binaries.",
|
|
28
|
+
"@jini-ai/oauth": "opt-in: oauth connections; import @jini-ai/integrations/api-connections — OAuth connections could not load @jini-ai/oauth. Install @jini-ai/oauth to enable this feature, or check its installed version and native binaries.",
|
|
29
|
+
"@cfworker/json-schema": "opt-in: json schema validation; import @jini-ai/integrations/saved-requests — JSON Schema validation could not load @cfworker/json-schema. Install @cfworker/json-schema to enable this feature, or check its installed version and native binaries."
|
|
23
30
|
}
|
|
24
31
|
},
|
|
25
32
|
"type": "module",
|
|
@@ -103,7 +110,7 @@
|
|
|
103
110
|
"registry": "https://registry.npmjs.org"
|
|
104
111
|
},
|
|
105
112
|
"dependencies": {
|
|
106
|
-
"@jini-ai/core": "^0.6.
|
|
113
|
+
"@jini-ai/core": "^0.6.17"
|
|
107
114
|
},
|
|
108
115
|
"peerDependencies": {
|
|
109
116
|
"@jini-ai/db": "^0.6.10",
|
|
@@ -112,6 +119,17 @@
|
|
|
112
119
|
"@jini-ai/oauth": "^0.6.10",
|
|
113
120
|
"@cfworker/json-schema": "^4.1.1"
|
|
114
121
|
},
|
|
122
|
+
"devDependencies": {
|
|
123
|
+
"@types/better-sqlite3": "^7.6.11",
|
|
124
|
+
"better-sqlite3": "^13.0.0",
|
|
125
|
+
"@vitest/coverage-v8": "^2.1.9",
|
|
126
|
+
"@cfworker/json-schema": "^4.1.1",
|
|
127
|
+
"@jini-ai/db": "^0.6.17",
|
|
128
|
+
"@jini-ai/core": "0.6.17",
|
|
129
|
+
"@jini-ai/platform": "0.6.17",
|
|
130
|
+
"@jini-ai/oauth": "0.6.17",
|
|
131
|
+
"@jini-ai/agent-plugins": "0.6.17"
|
|
132
|
+
},
|
|
115
133
|
"peerDependenciesMeta": {
|
|
116
134
|
"@jini-ai/db": {
|
|
117
135
|
"optional": true
|
|
@@ -129,17 +147,6 @@
|
|
|
129
147
|
"optional": true
|
|
130
148
|
}
|
|
131
149
|
},
|
|
132
|
-
"devDependencies": {
|
|
133
|
-
"@types/better-sqlite3": "^7.6.11",
|
|
134
|
-
"better-sqlite3": "^13.0.0",
|
|
135
|
-
"@vitest/coverage-v8": "^2.1.9",
|
|
136
|
-
"@cfworker/json-schema": "^4.1.1",
|
|
137
|
-
"@jini-ai/db": "^0.6.15",
|
|
138
|
-
"@jini-ai/core": "0.6.15",
|
|
139
|
-
"@jini-ai/oauth": "0.6.15",
|
|
140
|
-
"@jini-ai/agent-plugins": "0.6.15",
|
|
141
|
-
"@jini-ai/platform": "0.6.15"
|
|
142
|
-
},
|
|
143
150
|
"scripts": {
|
|
144
151
|
"build": "tsc -p tsconfig.json",
|
|
145
152
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|