@portalshq/capability-identity 0.1.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/README.md +5 -0
- package/package.json +13 -0
- package/src/identity-provider.ts +29 -0
- package/src/index.ts +1 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@portalshq/capability-identity",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/portalshq/portals-cloud"
|
|
7
|
+
},
|
|
8
|
+
"description": "Federated audience identity, persistent across every channel — current and future, platform-provided and developer-created.",
|
|
9
|
+
"main": "src/index.ts",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@portalshq/contracts": "*"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One identity per audience member, scoped to read across every channel
|
|
3
|
+
* they've ever touched. This is the "Netflix history, but spanning every
|
|
4
|
+
* developer-built channel" requirement — without this capability, every
|
|
5
|
+
* channel re-implements its own login and the cross-channel marketplace
|
|
6
|
+
* vision doesn't work.
|
|
7
|
+
*/
|
|
8
|
+
export interface AudienceIdentity {
|
|
9
|
+
userId: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ChannelHistoryEntry {
|
|
14
|
+
channelId: string;
|
|
15
|
+
sessionId: string;
|
|
16
|
+
lastInteractionAt: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class IdentityProvider {
|
|
20
|
+
async getIdentity(userId: string): Promise<AudienceIdentity> {
|
|
21
|
+
throw new Error("IdentityProvider.getIdentity: not yet implemented");
|
|
22
|
+
}
|
|
23
|
+
async recordInteraction(entry: ChannelHistoryEntry): Promise<void> {
|
|
24
|
+
throw new Error("IdentityProvider.recordInteraction: not yet implemented");
|
|
25
|
+
}
|
|
26
|
+
async getHistory(userId: string): Promise<ChannelHistoryEntry[]> {
|
|
27
|
+
throw new Error("IdentityProvider.getHistory: not yet implemented");
|
|
28
|
+
}
|
|
29
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./identity-provider";
|