@kubun/connector 0.13.1 → 0.14.0
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/lib/index.d.ts +1 -1
- package/lib/types.d.ts +1 -45
- package/package.json +5 -4
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { clusterModelURNs, resolveModelID } from './cluster-utils.js';
|
|
2
2
|
export { connectorClusters, connectorModelIDs } from './models/cluster.js';
|
|
3
3
|
export { externalEntityDefinition } from './models/external-entity.js';
|
|
4
|
-
export type { ActionDefinition, ActionHandler, ActionHandlerFactory, ActionResult, ClientDataProvider, ClientProviderFactory, ConnectorAuth, ConnectorDefinition, ConnectorSyncEventPayload,
|
|
4
|
+
export type { ActionDefinition, ActionHandler, ActionHandlerFactory, ActionResult, ClientDataProvider, ClientProviderFactory, ConnectorAuth, ConnectorDefinition, ConnectorSyncEventPayload, DataProvider, DeviceConnectorAuth, DevicePermission, EntityBatch, EntityRecord, FetchChangesParams, FetchParams, OAuthConnectorAuth, OAuthState, ServerDataProvider, ServerProviderFactory, SyncBoundary, SyncCompleteEvent, SyncErrorEvent, SyncEvent, SyncFailureSample, SyncProgressEvent, SyncState, SyncStateEntry, SyncStateStore, SyncStatus, UserSyncPreferences, WebhookParams, WebhookRegistration, WriteAttachment, } from './types.js';
|
package/lib/types.d.ts
CHANGED
|
@@ -1,43 +1,6 @@
|
|
|
1
|
+
import type { Credential } from '@kubun/credential-types';
|
|
1
2
|
import type { ClustersRecord } from '@kubun/protocol';
|
|
2
3
|
import type { JSONSchema } from 'json-schema-typed';
|
|
3
|
-
export type OAuthProviderDefinition = {
|
|
4
|
-
name: string;
|
|
5
|
-
authorizationEndpoint: string;
|
|
6
|
-
tokenEndpoint: string;
|
|
7
|
-
baseScopes?: Array<string>;
|
|
8
|
-
clientID?: string;
|
|
9
|
-
clientSecret?: string;
|
|
10
|
-
};
|
|
11
|
-
export type Credential = {
|
|
12
|
-
accessToken: string;
|
|
13
|
-
refreshToken?: string;
|
|
14
|
-
expiresAt?: Date;
|
|
15
|
-
scopes: Array<string>;
|
|
16
|
-
accountLabel?: string;
|
|
17
|
-
metadata?: Record<string, unknown>;
|
|
18
|
-
};
|
|
19
|
-
export type CredentialProvider = {
|
|
20
|
-
get(providerName: string, ownerDID: string): Promise<Credential | null>;
|
|
21
|
-
/**
|
|
22
|
-
* `ownerWrappableDID` is the owner's DID in a form that can be encrypted to,
|
|
23
|
-
* and is required only when no credential is stored yet.
|
|
24
|
-
*
|
|
25
|
-
* It is separate from `ownerDID` because that one is a join key and is
|
|
26
|
-
* normalized, and a normalized `did:peer:4` is its short form, which carries
|
|
27
|
-
* no document and so no agreement key. The two coincide for `did:key`. A
|
|
28
|
-
* caller that cannot supply it can still refresh an existing credential but
|
|
29
|
-
* cannot create one — which is the intended asymmetry: minting is the step
|
|
30
|
-
* that decides who will be able to read.
|
|
31
|
-
*/
|
|
32
|
-
set(params: {
|
|
33
|
-
providerName: string;
|
|
34
|
-
ownerDID: string;
|
|
35
|
-
credential: Credential;
|
|
36
|
-
ownerWrappableDID?: string;
|
|
37
|
-
controllerWrappableDID?: string;
|
|
38
|
-
}): Promise<void>;
|
|
39
|
-
delete(providerName: string, ownerDID: string): Promise<void>;
|
|
40
|
-
};
|
|
41
4
|
export type OAuthState = {
|
|
42
5
|
provider: string;
|
|
43
6
|
redirectURL: string;
|
|
@@ -45,13 +8,6 @@ export type OAuthState = {
|
|
|
45
8
|
nonce: string;
|
|
46
9
|
createdAt: number;
|
|
47
10
|
};
|
|
48
|
-
export type TokenResponse = {
|
|
49
|
-
access_token: string;
|
|
50
|
-
refresh_token?: string;
|
|
51
|
-
expires_in?: number;
|
|
52
|
-
token_type: string;
|
|
53
|
-
scope?: string;
|
|
54
|
-
};
|
|
55
11
|
export type SyncStatus = 'idle' | 'syncing' | 'error';
|
|
56
12
|
export type SyncState = {
|
|
57
13
|
checkpoint: unknown;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubun/connector",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"license": "see LICENSE.md",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
"LICENSE.md"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"
|
|
19
|
-
"@kubun/protocol": "^0.
|
|
20
|
-
"@kubun/scalars": "^0.
|
|
18
|
+
"@kubun/credential-types": "^0.14.0",
|
|
19
|
+
"@kubun/protocol": "^0.14.0",
|
|
20
|
+
"@kubun/scalars": "^0.14.0",
|
|
21
|
+
"json-schema-typed": "^8.0.2"
|
|
21
22
|
},
|
|
22
23
|
"publishConfig": {
|
|
23
24
|
"access": "public"
|