@parlor/capabilities 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +15 -2
- package/dist/adapters/capacitor.d.ts +3 -0
- package/dist/adapters/capacitor.d.ts.map +1 -0
- package/dist/adapters/capacitor.js +24 -0
- package/dist/adapters/capacitor.js.map +1 -0
- package/dist/adapters/tauri.d.ts +3 -0
- package/dist/adapters/tauri.d.ts.map +1 -0
- package/dist/adapters/tauri.js +24 -0
- package/dist/adapters/tauri.js.map +1 -0
- package/dist/adapters/types.d.ts +18 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +2 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/adapters/web.d.ts +3 -0
- package/dist/adapters/web.d.ts.map +1 -0
- package/dist/adapters/web.js +17 -0
- package/dist/adapters/web.js.map +1 -0
- package/dist/auth-browser/capacitor.d.ts +15 -0
- package/dist/auth-browser/capacitor.d.ts.map +1 -0
- package/dist/auth-browser/capacitor.js +16 -0
- package/dist/auth-browser/capacitor.js.map +1 -0
- package/dist/auth-browser/index.d.ts +7 -0
- package/dist/auth-browser/index.d.ts.map +1 -0
- package/dist/auth-browser/index.js +10 -0
- package/dist/auth-browser/index.js.map +1 -0
- package/dist/auth-browser/interface.d.ts +9 -0
- package/dist/auth-browser/interface.d.ts.map +1 -0
- package/dist/auth-browser/interface.js +2 -0
- package/dist/auth-browser/interface.js.map +1 -0
- package/dist/auth-browser/scheme.d.ts +2 -0
- package/dist/auth-browser/scheme.d.ts.map +1 -0
- package/dist/auth-browser/scheme.js +4 -0
- package/dist/auth-browser/scheme.js.map +1 -0
- package/dist/auth-browser/tauri.d.ts +6 -0
- package/dist/auth-browser/tauri.d.ts.map +1 -0
- package/dist/auth-browser/tauri.js +20 -0
- package/dist/auth-browser/tauri.js.map +1 -0
- package/dist/auth-browser/web.d.ts +5 -0
- package/dist/auth-browser/web.d.ts.map +1 -0
- package/dist/auth-browser/web.js +15 -0
- package/dist/auth-browser/web.js.map +1 -0
- package/dist/capability.d.ts +21 -0
- package/dist/capability.d.ts.map +1 -0
- package/dist/capability.js +21 -0
- package/dist/capability.js.map +1 -0
- package/dist/deep-link/capacitor.d.ts +16 -0
- package/dist/deep-link/capacitor.d.ts.map +1 -0
- package/dist/deep-link/capacitor.js +28 -0
- package/dist/deep-link/capacitor.js.map +1 -0
- package/dist/deep-link/index.d.ts +7 -0
- package/dist/deep-link/index.d.ts.map +1 -0
- package/dist/deep-link/index.js +10 -0
- package/dist/deep-link/index.js.map +1 -0
- package/dist/deep-link/interface.d.ts +5 -0
- package/dist/deep-link/interface.d.ts.map +1 -0
- package/dist/deep-link/interface.js +2 -0
- package/dist/deep-link/interface.js.map +1 -0
- package/dist/deep-link/tauri.d.ts +8 -0
- package/dist/deep-link/tauri.d.ts.map +1 -0
- package/dist/deep-link/tauri.js +28 -0
- package/dist/deep-link/tauri.js.map +1 -0
- package/dist/deep-link/web.d.ts +4 -0
- package/dist/deep-link/web.d.ts.map +1 -0
- package/dist/deep-link/web.js +20 -0
- package/dist/deep-link/web.js.map +1 -0
- package/dist/device-key/capacitor.d.ts +32 -0
- package/dist/device-key/capacitor.d.ts.map +1 -0
- package/dist/device-key/capacitor.js +9 -0
- package/dist/device-key/capacitor.js.map +1 -0
- package/dist/device-key/encoding.d.ts +12 -0
- package/dist/device-key/encoding.d.ts.map +1 -0
- package/dist/device-key/encoding.js +45 -0
- package/dist/device-key/encoding.js.map +1 -0
- package/dist/device-key/index.d.ts +8 -0
- package/dist/device-key/index.d.ts.map +1 -0
- package/dist/device-key/index.js +11 -0
- package/dist/device-key/index.js.map +1 -0
- package/dist/device-key/interface.d.ts +74 -0
- package/dist/device-key/interface.d.ts.map +1 -0
- package/dist/device-key/interface.js +7 -0
- package/dist/device-key/interface.js.map +1 -0
- package/dist/device-key/native.d.ts +38 -0
- package/dist/device-key/native.d.ts.map +1 -0
- package/dist/device-key/native.js +67 -0
- package/dist/device-key/native.js.map +1 -0
- package/dist/device-key/tauri.d.ts +8 -0
- package/dist/device-key/tauri.d.ts.map +1 -0
- package/dist/device-key/tauri.js +16 -0
- package/dist/device-key/tauri.js.map +1 -0
- package/dist/device-key/web.d.ts +11 -0
- package/dist/device-key/web.d.ts.map +1 -0
- package/dist/device-key/web.js +210 -0
- package/dist/device-key/web.js.map +1 -0
- package/dist/files/capacitor.d.ts +19 -0
- package/dist/files/capacitor.d.ts.map +1 -0
- package/dist/files/capacitor.js +47 -0
- package/dist/files/capacitor.js.map +1 -0
- package/dist/files/index.d.ts +7 -0
- package/dist/files/index.d.ts.map +1 -0
- package/dist/files/index.js +10 -0
- package/dist/files/index.js.map +1 -0
- package/dist/files/interface.d.ts +29 -0
- package/dist/files/interface.d.ts.map +1 -0
- package/dist/files/interface.js +2 -0
- package/dist/files/interface.js.map +1 -0
- package/dist/files/mime.d.ts +11 -0
- package/dist/files/mime.d.ts.map +1 -0
- package/dist/files/mime.js +56 -0
- package/dist/files/mime.js.map +1 -0
- package/dist/files/tauri.d.ts +27 -0
- package/dist/files/tauri.d.ts.map +1 -0
- package/dist/files/tauri.js +46 -0
- package/dist/files/tauri.js.map +1 -0
- package/dist/files/web.d.ts +21 -0
- package/dist/files/web.d.ts.map +1 -0
- package/dist/files/web.js +82 -0
- package/dist/files/web.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/local-agent-host/capacitor.d.ts +5 -0
- package/dist/local-agent-host/capacitor.d.ts.map +1 -0
- package/dist/local-agent-host/capacitor.js +11 -0
- package/dist/local-agent-host/capacitor.js.map +1 -0
- package/dist/local-agent-host/index.d.ts +7 -0
- package/dist/local-agent-host/index.d.ts.map +1 -0
- package/dist/local-agent-host/index.js +10 -0
- package/dist/local-agent-host/index.js.map +1 -0
- package/dist/local-agent-host/interface.d.ts +62 -0
- package/dist/local-agent-host/interface.d.ts.map +1 -0
- package/dist/local-agent-host/interface.js +2 -0
- package/dist/local-agent-host/interface.js.map +1 -0
- package/dist/local-agent-host/tauri.d.ts +10 -0
- package/dist/local-agent-host/tauri.d.ts.map +1 -0
- package/dist/local-agent-host/tauri.js +38 -0
- package/dist/local-agent-host/tauri.js.map +1 -0
- package/dist/local-agent-host/web.d.ts +5 -0
- package/dist/local-agent-host/web.d.ts.map +1 -0
- package/dist/local-agent-host/web.js +11 -0
- package/dist/local-agent-host/web.js.map +1 -0
- package/dist/notifications/capacitor.d.ts +28 -0
- package/dist/notifications/capacitor.d.ts.map +1 -0
- package/dist/notifications/capacitor.js +39 -0
- package/dist/notifications/capacitor.js.map +1 -0
- package/dist/notifications/index.d.ts +7 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +10 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/notifications/interface.d.ts +14 -0
- package/dist/notifications/interface.d.ts.map +1 -0
- package/dist/notifications/interface.js +2 -0
- package/dist/notifications/interface.js.map +1 -0
- package/dist/notifications/tauri.d.ts +12 -0
- package/dist/notifications/tauri.d.ts.map +1 -0
- package/dist/notifications/tauri.js +28 -0
- package/dist/notifications/tauri.js.map +1 -0
- package/dist/notifications/web.d.ts +15 -0
- package/dist/notifications/web.d.ts.map +1 -0
- package/dist/notifications/web.js +23 -0
- package/dist/notifications/web.js.map +1 -0
- package/dist/runtime.d.ts +3 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +9 -0
- package/dist/runtime.js.map +1 -0
- package/dist/session-store/capacitor.d.ts +17 -0
- package/dist/session-store/capacitor.d.ts.map +1 -0
- package/dist/session-store/capacitor.js +21 -0
- package/dist/session-store/capacitor.js.map +1 -0
- package/dist/session-store/index.d.ts +8 -0
- package/dist/session-store/index.d.ts.map +1 -0
- package/dist/session-store/index.js +11 -0
- package/dist/session-store/index.js.map +1 -0
- package/dist/session-store/interface.d.ts +9 -0
- package/dist/session-store/interface.d.ts.map +1 -0
- package/dist/session-store/interface.js +2 -0
- package/dist/session-store/interface.js.map +1 -0
- package/dist/session-store/keychain.d.ts +13 -0
- package/dist/session-store/keychain.d.ts.map +1 -0
- package/dist/session-store/keychain.js +36 -0
- package/dist/session-store/keychain.js.map +1 -0
- package/dist/session-store/local.d.ts +10 -0
- package/dist/session-store/local.d.ts.map +1 -0
- package/dist/session-store/local.js +15 -0
- package/dist/session-store/local.js.map +1 -0
- package/dist/session-store/tauri.d.ts +10 -0
- package/dist/session-store/tauri.d.ts.map +1 -0
- package/dist/session-store/tauri.js +24 -0
- package/dist/session-store/tauri.js.map +1 -0
- package/dist/session-store/web.d.ts +5 -0
- package/dist/session-store/web.d.ts.map +1 -0
- package/dist/session-store/web.js +11 -0
- package/dist/session-store/web.js.map +1 -0
- package/package.json +95 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/notifications/web.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,gBAAgB,CAC9B,MAAM,GAAsC,GAAG,EAAE,CAC9C,UAAiD,CAAC,YAAY;IAEjE,OAAO;QACL,QAAQ,EAAE,KAAK;QACf,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,KAAK,SAAS;QACvC,MAAM,EAAE,GAAG,EAAE;YACX,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;YACrB,IAAI,CAAC,GAAG;gBAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;YAC/D,OAAO;gBACL,UAAU,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,UAAU;gBAChC,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,iBAAiB,EAAE;gBACtC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;oBAC7B,IAAI,GAAG,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;wBACjC,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;oBAClE,CAAC;oBACD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;oBAC7C,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC;gBAC/C,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { CapabilityAdapter } from \"../capability.js\";\nimport type { NotificationPermission, Notifications } from \"./interface.js\";\n\ninterface NotificationApi {\n readonly permission: NotificationPermission;\n requestPermission(): Promise<NotificationPermission>;\n new (\n title: string,\n options?: { body?: string | undefined; tag?: string | undefined },\n ): { close(): void };\n}\n\nexport function webNotifications(\n getApi: () => NotificationApi | undefined = () =>\n (globalThis as { Notification?: NotificationApi }).Notification,\n): CapabilityAdapter<Notifications> {\n return {\n platform: \"web\",\n available: () => getApi() !== undefined,\n create: () => {\n const api = getApi();\n if (!api) throw new Error(\"Notification API is not available\");\n return {\n permission: () => api.permission,\n request: () => api.requestPermission(),\n show: async (title, options) => {\n if (api.permission !== \"granted\") {\n throw new Error(\"Notification permission has not been granted\");\n }\n const notification = new api(title, options);\n return { close: () => notification.close() };\n },\n };\n },\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,WAAW,GAAG,OAAO,CAAC;AAOrD,wBAAgB,cAAc,CAAC,OAAO,GAAE,OAAoB,GAAG,QAAQ,CAKtE"}
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,cAAc,CAAC,OAAO,GAAY,UAAU;IAC1D,MAAM,CAAC,GAAG,OAA0B,CAAC;IACrC,IAAI,CAAC,CAAC,mBAAmB;QAAE,OAAO,OAAO,CAAC;IAC1C,IAAI,CAAC,CAAC,SAAS,EAAE,gBAAgB,EAAE,EAAE;QAAE,OAAO,WAAW,CAAC;IAC1D,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["export type Platform = \"web\" | \"capacitor\" | \"tauri\";\n\ninterface PlatformGlobals {\n __TAURI_INTERNALS__?: unknown;\n Capacitor?: { isNativePlatform?: () => boolean };\n}\n\nexport function detectPlatform(globals: unknown = globalThis): Platform {\n const g = globals as PlatformGlobals;\n if (g.__TAURI_INTERNALS__) return \"tauri\";\n if (g.Capacitor?.isNativePlatform?.()) return \"capacitor\";\n return \"web\";\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CapabilityAdapter } from "../capability.js";
|
|
2
|
+
import type { SessionStore } from "./interface.js";
|
|
3
|
+
import { type StorageLike } from "./local.js";
|
|
4
|
+
/** The `ParlorSessionStore` native plugin: the iOS Keychain. */
|
|
5
|
+
export interface CapacitorSessionModule {
|
|
6
|
+
ParlorSessionStore: {
|
|
7
|
+
get(): Promise<{
|
|
8
|
+
value?: string;
|
|
9
|
+
}>;
|
|
10
|
+
set(options: {
|
|
11
|
+
value?: string;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** The iOS Keychain; the webview's own storage where the plugin has no implementation. */
|
|
16
|
+
export declare function capacitorSessionStore(storage?: () => StorageLike, load?: () => Promise<CapacitorSessionModule>): CapabilityAdapter<SessionStore>;
|
|
17
|
+
//# sourceMappingURL=capacitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capacitor.d.ts","sourceRoot":"","sources":["../../src/session-store/capacitor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAEjE,gEAAgE;AAChE,MAAM,WAAW,sBAAsB;IACrC,kBAAkB,EAAE;QAClB,GAAG,IAAI,OAAO,CAAC;YAAE,KAAK,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACnC,GAAG,CAAC,OAAO,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAA;SAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KACjD,CAAC;CACH;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,MAAM,WAA2C,EAC1D,IAAI,GAAE,MAAM,OAAO,CAAC,sBAAsB,CACF,GACvC,iBAAiB,CAAC,YAAY,CAAC,CAiBjC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { hasIosPlugin } from "../device-key/native.js";
|
|
2
|
+
import { detectPlatform } from "../runtime.js";
|
|
3
|
+
import { keychainSessionStore } from "./keychain.js";
|
|
4
|
+
import { localSessionStore } from "./local.js";
|
|
5
|
+
/** The iOS Keychain; the webview's own storage where the plugin has no implementation. */
|
|
6
|
+
export function capacitorSessionStore(storage = () => globalThis.localStorage, load = () => import("@parlor/capacitor-device-key")) {
|
|
7
|
+
return {
|
|
8
|
+
platform: "capacitor",
|
|
9
|
+
available: () => detectPlatform() === "capacitor",
|
|
10
|
+
create: async () => {
|
|
11
|
+
if (!hasIosPlugin())
|
|
12
|
+
return localSessionStore(storage());
|
|
13
|
+
const { ParlorSessionStore } = await load();
|
|
14
|
+
return keychainSessionStore({
|
|
15
|
+
get: async () => (await ParlorSessionStore.get()).value,
|
|
16
|
+
set: (token) => ParlorSessionStore.set(token === undefined ? {} : { value: token }),
|
|
17
|
+
}, storage());
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=capacitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capacitor.js","sourceRoot":"","sources":["../../src/session-store/capacitor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAoB,MAAM,YAAY,CAAC;AAUjE,0FAA0F;AAC1F,MAAM,UAAU,qBAAqB,CACnC,OAAO,GAAsB,GAAG,EAAE,CAAC,UAAU,CAAC,YAAY,EAC1D,IAAI,GAA0C,GAAG,EAAE,CACjD,MAAM,CAAC,8BAA8B,CAAC;IAExC,OAAO;QACL,QAAQ,EAAE,WAAW;QACrB,SAAS,EAAE,GAAG,EAAE,CAAC,cAAc,EAAE,KAAK,WAAW;QACjD,MAAM,EAAE,KAAK,IAAI,EAAE;YACjB,IAAI,CAAC,YAAY,EAAE;gBAAE,OAAO,iBAAiB,CAAC,OAAO,EAAE,CAAC,CAAC;YACzD,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;YAC5C,OAAO,oBAAoB,CACzB;gBACE,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,kBAAkB,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK;gBACvD,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACb,kBAAkB,CAAC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;aACtE,EACD,OAAO,EAAE,CACV,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { CapabilityAdapter } from \"../capability.js\";\nimport { hasIosPlugin } from \"../device-key/native.js\";\nimport { detectPlatform } from \"../runtime.js\";\nimport type { SessionStore } from \"./interface.js\";\nimport { keychainSessionStore } from \"./keychain.js\";\nimport { localSessionStore, type StorageLike } from \"./local.js\";\n\n/** The `ParlorSessionStore` native plugin: the iOS Keychain. */\nexport interface CapacitorSessionModule {\n ParlorSessionStore: {\n get(): Promise<{ value?: string }>;\n set(options: { value?: string }): Promise<void>;\n };\n}\n\n/** The iOS Keychain; the webview's own storage where the plugin has no implementation. */\nexport function capacitorSessionStore(\n storage: () => StorageLike = () => globalThis.localStorage,\n load: () => Promise<CapacitorSessionModule> = () =>\n import(\"@parlor/capacitor-device-key\"),\n): CapabilityAdapter<SessionStore> {\n return {\n platform: \"capacitor\",\n available: () => detectPlatform() === \"capacitor\",\n create: async () => {\n if (!hasIosPlugin()) return localSessionStore(storage());\n const { ParlorSessionStore } = await load();\n return keychainSessionStore(\n {\n get: async () => (await ParlorSessionStore.get()).value,\n set: (token) =>\n ParlorSessionStore.set(token === undefined ? {} : { value: token }),\n },\n storage(),\n );\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SessionStore } from "./interface.js";
|
|
2
|
+
export type { SessionStore } from "./interface.js";
|
|
3
|
+
export { capacitorSessionStore } from "./capacitor.js";
|
|
4
|
+
export { localSessionStore, SESSION_STORAGE_KEY, type StorageLike } from "./local.js";
|
|
5
|
+
export { tauriSessionStore } from "./tauri.js";
|
|
6
|
+
export { webSessionStore } from "./web.js";
|
|
7
|
+
export declare const sessionStore: import("../capability.js").CapabilityDefinition<SessionStore>;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/session-store/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,eAAO,MAAM,YAAY,+DAGvB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { platformAdapters } from "#adapters";
|
|
2
|
+
import { defineCapability } from "../capability.js";
|
|
3
|
+
export { capacitorSessionStore } from "./capacitor.js";
|
|
4
|
+
export { localSessionStore, SESSION_STORAGE_KEY } from "./local.js";
|
|
5
|
+
export { tauriSessionStore } from "./tauri.js";
|
|
6
|
+
export { webSessionStore } from "./web.js";
|
|
7
|
+
export const sessionStore = defineCapability({
|
|
8
|
+
name: "sessionStore",
|
|
9
|
+
adapters: platformAdapters.sessionStore,
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/session-store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAoB,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAe;IACzD,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,gBAAgB,CAAC,YAAY;CACxC,CAAC,CAAC","sourcesContent":["import { platformAdapters } from \"#adapters\";\n\nimport { defineCapability } from \"../capability.js\";\nimport type { SessionStore } from \"./interface.js\";\n\nexport type { SessionStore } from \"./interface.js\";\nexport { capacitorSessionStore } from \"./capacitor.js\";\nexport { localSessionStore, SESSION_STORAGE_KEY, type StorageLike } from \"./local.js\";\nexport { tauriSessionStore } from \"./tauri.js\";\nexport { webSessionStore } from \"./web.js\";\n\nexport const sessionStore = defineCapability<SessionStore>({\n name: \"sessionStore\",\n adapters: platformAdapters.sessionStore,\n});\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a native shell keeps its bearer session. A browser needs none: the session rides
|
|
3
|
+
* in a cookie the page cannot read.
|
|
4
|
+
*/
|
|
5
|
+
export interface SessionStore {
|
|
6
|
+
get(): Promise<string | undefined>;
|
|
7
|
+
set(token: string | undefined): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/session-store/interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACnC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/session-store/interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Where a native shell keeps its bearer session. A browser needs none: the session rides\n * in a cookie the page cannot read.\n */\nexport interface SessionStore {\n get(): Promise<string | undefined>;\n set(token: string | undefined): Promise<void>;\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SessionStore } from "./interface.js";
|
|
2
|
+
import { type StorageLike } from "./local.js";
|
|
3
|
+
export interface NativeSession {
|
|
4
|
+
get(): Promise<string | undefined>;
|
|
5
|
+
set(token: string | undefined): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The token lives in the platform keychain only. A token an earlier release left in the
|
|
9
|
+
* webview's storage moves over on the first read and is deleted there; a failed move is
|
|
10
|
+
* retried by the next call.
|
|
11
|
+
*/
|
|
12
|
+
export declare function keychainSessionStore(native: NativeSession, legacy: StorageLike): SessionStore;
|
|
13
|
+
//# sourceMappingURL=keychain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keychain.d.ts","sourceRoot":"","sources":["../../src/session-store/keychain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,WAAW,aAAa;IAC5B,GAAG,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACnC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,WAAW,GAClB,YAAY,CAyBd"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SESSION_STORAGE_KEY } from "./local.js";
|
|
2
|
+
/**
|
|
3
|
+
* The token lives in the platform keychain only. A token an earlier release left in the
|
|
4
|
+
* webview's storage moves over on the first read and is deleted there; a failed move is
|
|
5
|
+
* retried by the next call.
|
|
6
|
+
*/
|
|
7
|
+
export function keychainSessionStore(native, legacy) {
|
|
8
|
+
let migrated;
|
|
9
|
+
const move = async () => {
|
|
10
|
+
const old = legacy.getItem(SESSION_STORAGE_KEY);
|
|
11
|
+
if (old === null)
|
|
12
|
+
return;
|
|
13
|
+
if ((await native.get()) === undefined)
|
|
14
|
+
await native.set(old);
|
|
15
|
+
legacy.removeItem(SESSION_STORAGE_KEY);
|
|
16
|
+
};
|
|
17
|
+
const migrate = () => {
|
|
18
|
+
const attempt = (migrated ??= move());
|
|
19
|
+
attempt.catch(() => {
|
|
20
|
+
if (migrated === attempt)
|
|
21
|
+
migrated = undefined;
|
|
22
|
+
});
|
|
23
|
+
return attempt;
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
get: async () => {
|
|
27
|
+
await migrate();
|
|
28
|
+
return native.get();
|
|
29
|
+
},
|
|
30
|
+
set: async (token) => {
|
|
31
|
+
await migrate();
|
|
32
|
+
await native.set(token);
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=keychain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keychain.js","sourceRoot":"","sources":["../../src/session-store/keychain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAoB,MAAM,YAAY,CAAC;AAOnE;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAqB,EACrB,MAAmB;IAEnB,IAAI,QAAmC,CAAC;IACxC,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE;QACtB,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAChD,IAAI,GAAG,KAAK,IAAI;YAAE,OAAO;QACzB,IAAI,CAAC,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,SAAS;YAAE,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9D,MAAM,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;IACzC,CAAC,CAAC;IACF,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,MAAM,OAAO,GAAG,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC,CAAC;QACtC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE;YACjB,IAAI,QAAQ,KAAK,OAAO;gBAAE,QAAQ,GAAG,SAAS,CAAC;QACjD,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;IACF,OAAO;QACL,GAAG,EAAE,KAAK,IAAI,EAAE;YACd,MAAM,OAAO,EAAE,CAAC;YAChB,OAAO,MAAM,CAAC,GAAG,EAAE,CAAC;QACtB,CAAC;QACD,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACnB,MAAM,OAAO,EAAE,CAAC;YAChB,MAAM,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { SessionStore } from \"./interface.js\";\nimport { SESSION_STORAGE_KEY, type StorageLike } from \"./local.js\";\n\nexport interface NativeSession {\n get(): Promise<string | undefined>;\n set(token: string | undefined): Promise<void>;\n}\n\n/**\n * The token lives in the platform keychain only. A token an earlier release left in the\n * webview's storage moves over on the first read and is deleted there; a failed move is\n * retried by the next call.\n */\nexport function keychainSessionStore(\n native: NativeSession,\n legacy: StorageLike,\n): SessionStore {\n let migrated: Promise<void> | undefined;\n const move = async () => {\n const old = legacy.getItem(SESSION_STORAGE_KEY);\n if (old === null) return;\n if ((await native.get()) === undefined) await native.set(old);\n legacy.removeItem(SESSION_STORAGE_KEY);\n };\n const migrate = () => {\n const attempt = (migrated ??= move());\n attempt.catch(() => {\n if (migrated === attempt) migrated = undefined;\n });\n return attempt;\n };\n return {\n get: async () => {\n await migrate();\n return native.get();\n },\n set: async (token) => {\n await migrate();\n await native.set(token);\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SessionStore } from "./interface.js";
|
|
2
|
+
export declare const SESSION_STORAGE_KEY = "parlor.session";
|
|
3
|
+
export interface StorageLike {
|
|
4
|
+
getItem(key: string): string | null;
|
|
5
|
+
setItem(key: string, value: string): void;
|
|
6
|
+
removeItem(key: string): void;
|
|
7
|
+
}
|
|
8
|
+
/** The baseline for native shells until their keystore adapters land: the webview's own storage. */
|
|
9
|
+
export declare function localSessionStore(storage: StorageLike): SessionStore;
|
|
10
|
+
//# sourceMappingURL=local.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../src/session-store/local.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AAEpD,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,oGAAoG;AACpG,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,GAAG,YAAY,CASpE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const SESSION_STORAGE_KEY = "parlor.session";
|
|
2
|
+
/** The baseline for native shells until their keystore adapters land: the webview's own storage. */
|
|
3
|
+
export function localSessionStore(storage) {
|
|
4
|
+
return {
|
|
5
|
+
get: () => Promise.resolve(storage.getItem(SESSION_STORAGE_KEY) ?? undefined),
|
|
6
|
+
set: (token) => {
|
|
7
|
+
if (token === undefined)
|
|
8
|
+
storage.removeItem(SESSION_STORAGE_KEY);
|
|
9
|
+
else
|
|
10
|
+
storage.setItem(SESSION_STORAGE_KEY, token);
|
|
11
|
+
return Promise.resolve();
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../src/session-store/local.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAQpD,oGAAoG;AACpG,MAAM,UAAU,iBAAiB,CAAC,OAAoB;IACpD,OAAO;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,SAAS,CAAC;QAC7E,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE;YACb,IAAI,KAAK,KAAK,SAAS;gBAAE,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;;gBAC5D,OAAO,CAAC,OAAO,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;YACjD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { SessionStore } from \"./interface.js\";\n\nexport const SESSION_STORAGE_KEY = \"parlor.session\";\n\nexport interface StorageLike {\n getItem(key: string): string | null;\n setItem(key: string, value: string): void;\n removeItem(key: string): void;\n}\n\n/** The baseline for native shells until their keystore adapters land: the webview's own storage. */\nexport function localSessionStore(storage: StorageLike): SessionStore {\n return {\n get: () => Promise.resolve(storage.getItem(SESSION_STORAGE_KEY) ?? undefined),\n set: (token) => {\n if (token === undefined) storage.removeItem(SESSION_STORAGE_KEY);\n else storage.setItem(SESSION_STORAGE_KEY, token);\n return Promise.resolve();\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CapabilityAdapter } from "../capability.js";
|
|
2
|
+
import type { TauriInvoke } from "../device-key/tauri.js";
|
|
3
|
+
import type { SessionStore } from "./interface.js";
|
|
4
|
+
import { type StorageLike } from "./local.js";
|
|
5
|
+
/**
|
|
6
|
+
* The macOS Keychain through the generated `parlor_session_*` commands; the webview's own
|
|
7
|
+
* storage in a shell without a working one, such as a project generated by an older version.
|
|
8
|
+
*/
|
|
9
|
+
export declare function tauriSessionStore(storage?: () => StorageLike, load?: () => Promise<TauriInvoke>): CapabilityAdapter<SessionStore>;
|
|
10
|
+
//# sourceMappingURL=tauri.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tauri.d.ts","sourceRoot":"","sources":["../../src/session-store/tauri.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAEjE;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,MAAM,WAA2C,EAC1D,IAAI,GAAE,MAAM,OAAO,CAAC,WAAW,CAAwC,GACtE,iBAAiB,CAAC,YAAY,CAAC,CAkBjC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { hasNativeCommand } from "../device-key/native.js";
|
|
2
|
+
import { detectPlatform } from "../runtime.js";
|
|
3
|
+
import { keychainSessionStore } from "./keychain.js";
|
|
4
|
+
import { localSessionStore } from "./local.js";
|
|
5
|
+
/**
|
|
6
|
+
* The macOS Keychain through the generated `parlor_session_*` commands; the webview's own
|
|
7
|
+
* storage in a shell without a working one, such as a project generated by an older version.
|
|
8
|
+
*/
|
|
9
|
+
export function tauriSessionStore(storage = () => globalThis.localStorage, load = () => import("@tauri-apps/api/core")) {
|
|
10
|
+
return {
|
|
11
|
+
platform: "tauri",
|
|
12
|
+
available: () => detectPlatform() === "tauri",
|
|
13
|
+
create: async () => {
|
|
14
|
+
if (!(await hasNativeCommand(load, "parlor_session_get")))
|
|
15
|
+
return localSessionStore(storage());
|
|
16
|
+
const { invoke } = await load();
|
|
17
|
+
return keychainSessionStore({
|
|
18
|
+
get: async () => (await invoke("parlor_session_get")) ?? undefined,
|
|
19
|
+
set: (token) => invoke("parlor_session_set", { token: token ?? null }),
|
|
20
|
+
}, storage());
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=tauri.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tauri.js","sourceRoot":"","sources":["../../src/session-store/tauri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAoB,MAAM,YAAY,CAAC;AAEjE;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAO,GAAsB,GAAG,EAAE,CAAC,UAAU,CAAC,YAAY,EAC1D,IAAI,GAA+B,GAAG,EAAE,CAAC,MAAM,CAAC,sBAAsB,CAAC;IAEvE,OAAO;QACL,QAAQ,EAAE,OAAO;QACjB,SAAS,EAAE,GAAG,EAAE,CAAC,cAAc,EAAE,KAAK,OAAO;QAC7C,MAAM,EAAE,KAAK,IAAI,EAAE;YACjB,IAAI,CAAC,CAAC,MAAM,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;gBACvD,OAAO,iBAAiB,CAAC,OAAO,EAAE,CAAC,CAAC;YACtC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;YAChC,OAAO,oBAAoB,CACzB;gBACE,GAAG,EAAE,KAAK,IAAI,EAAE,CACd,CAAC,MAAM,MAAM,CAAgB,oBAAoB,CAAC,CAAC,IAAI,SAAS;gBAClE,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAO,oBAAoB,EAAE,EAAE,KAAK,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC;aAC7E,EACD,OAAO,EAAE,CACV,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { CapabilityAdapter } from \"../capability.js\";\nimport { hasNativeCommand } from \"../device-key/native.js\";\nimport type { TauriInvoke } from \"../device-key/tauri.js\";\nimport { detectPlatform } from \"../runtime.js\";\nimport type { SessionStore } from \"./interface.js\";\nimport { keychainSessionStore } from \"./keychain.js\";\nimport { localSessionStore, type StorageLike } from \"./local.js\";\n\n/**\n * The macOS Keychain through the generated `parlor_session_*` commands; the webview's own\n * storage in a shell without a working one, such as a project generated by an older version.\n */\nexport function tauriSessionStore(\n storage: () => StorageLike = () => globalThis.localStorage,\n load: () => Promise<TauriInvoke> = () => import(\"@tauri-apps/api/core\"),\n): CapabilityAdapter<SessionStore> {\n return {\n platform: \"tauri\",\n available: () => detectPlatform() === \"tauri\",\n create: async () => {\n if (!(await hasNativeCommand(load, \"parlor_session_get\")))\n return localSessionStore(storage());\n const { invoke } = await load();\n return keychainSessionStore(\n {\n get: async () =>\n (await invoke<string | null>(\"parlor_session_get\")) ?? undefined,\n set: (token) => invoke<void>(\"parlor_session_set\", { token: token ?? null }),\n },\n storage(),\n );\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CapabilityAdapter } from "../capability.js";
|
|
2
|
+
import type { SessionStore } from "./interface.js";
|
|
3
|
+
/** Never available: the browser carries the session in an HttpOnly cookie. */
|
|
4
|
+
export declare function webSessionStore(): CapabilityAdapter<SessionStore>;
|
|
5
|
+
//# sourceMappingURL=web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../src/session-store/web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,8EAA8E;AAC9E,wBAAgB,eAAe,IAAI,iBAAiB,CAAC,YAAY,CAAC,CAQjE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Never available: the browser carries the session in an HttpOnly cookie. */
|
|
2
|
+
export function webSessionStore() {
|
|
3
|
+
return {
|
|
4
|
+
platform: "web",
|
|
5
|
+
available: () => false,
|
|
6
|
+
create: () => {
|
|
7
|
+
throw new Error("The web keeps its session in a cookie.");
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/session-store/web.ts"],"names":[],"mappings":"AAGA,8EAA8E;AAC9E,MAAM,UAAU,eAAe;IAC7B,OAAO;QACL,QAAQ,EAAE,KAAK;QACf,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK;QACtB,MAAM,EAAE,GAAG,EAAE;YACX,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC5D,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { CapabilityAdapter } from \"../capability.js\";\nimport type { SessionStore } from \"./interface.js\";\n\n/** Never available: the browser carries the session in an HttpOnly cookie. */\nexport function webSessionStore(): CapabilityAdapter<SessionStore> {\n return {\n platform: \"web\",\n available: () => false,\n create: () => {\n throw new Error(\"The web keeps its session in a cookie.\");\n },\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,98 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parlor/capabilities",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"homepage": "https://cychien.github.io/parlor",
|
|
5
|
+
"bugs": "https://github.com/cychien/parlor/issues",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/cychien/parlor.git",
|
|
10
|
+
"directory": "packages/capabilities"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"type": "module",
|
|
16
|
+
"imports": {
|
|
17
|
+
"#adapters": {
|
|
18
|
+
"parlor-tauri": "./dist/adapters/tauri.js",
|
|
19
|
+
"parlor-capacitor": "./dist/adapters/capacitor.js",
|
|
20
|
+
"default": "./dist/adapters/web.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"import": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./encoding": {
|
|
29
|
+
"types": "./dist/device-key/encoding.d.ts",
|
|
30
|
+
"import": "./dist/device-key/encoding.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@capacitor/app": "^8.1.2",
|
|
35
|
+
"@capacitor/filesystem": "^8.1.5",
|
|
36
|
+
"@capacitor/local-notifications": "^8.3.1",
|
|
37
|
+
"@capacitor/share": "^8.0.3",
|
|
38
|
+
"@tauri-apps/api": "^2.12.1",
|
|
39
|
+
"@tauri-apps/plugin-deep-link": "^2.6.1",
|
|
40
|
+
"@tauri-apps/plugin-dialog": "^2.8.3",
|
|
41
|
+
"@tauri-apps/plugin-fs": "^2.7.1",
|
|
42
|
+
"@tauri-apps/plugin-notification": "^2.5.1",
|
|
43
|
+
"@types/node": "^24.14.0",
|
|
44
|
+
"happy-dom": "^20.14.5",
|
|
45
|
+
"typescript": "^7.0.2",
|
|
46
|
+
"vitest": "^5.0.3",
|
|
47
|
+
"@parlor/capacitor-device-key": "0.2.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@capacitor/app": ">=8",
|
|
51
|
+
"@capacitor/filesystem": ">=8",
|
|
52
|
+
"@capacitor/local-notifications": ">=8",
|
|
53
|
+
"@capacitor/share": ">=8",
|
|
54
|
+
"@parlor/capacitor-device-key": ">=0",
|
|
55
|
+
"@tauri-apps/api": ">=2",
|
|
56
|
+
"@tauri-apps/plugin-deep-link": ">=2",
|
|
57
|
+
"@tauri-apps/plugin-dialog": ">=2",
|
|
58
|
+
"@tauri-apps/plugin-fs": ">=2",
|
|
59
|
+
"@tauri-apps/plugin-notification": ">=2"
|
|
60
|
+
},
|
|
61
|
+
"peerDependenciesMeta": {
|
|
62
|
+
"@capacitor/app": {
|
|
63
|
+
"optional": true
|
|
64
|
+
},
|
|
65
|
+
"@capacitor/filesystem": {
|
|
66
|
+
"optional": true
|
|
67
|
+
},
|
|
68
|
+
"@capacitor/local-notifications": {
|
|
69
|
+
"optional": true
|
|
70
|
+
},
|
|
71
|
+
"@capacitor/share": {
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
74
|
+
"@parlor/capacitor-device-key": {
|
|
75
|
+
"optional": true
|
|
76
|
+
},
|
|
77
|
+
"@tauri-apps/api": {
|
|
78
|
+
"optional": true
|
|
79
|
+
},
|
|
80
|
+
"@tauri-apps/plugin-deep-link": {
|
|
81
|
+
"optional": true
|
|
82
|
+
},
|
|
83
|
+
"@tauri-apps/plugin-dialog": {
|
|
84
|
+
"optional": true
|
|
85
|
+
},
|
|
86
|
+
"@tauri-apps/plugin-fs": {
|
|
87
|
+
"optional": true
|
|
88
|
+
},
|
|
89
|
+
"@tauri-apps/plugin-notification": {
|
|
90
|
+
"optional": true
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"scripts": {
|
|
94
|
+
"build": "tsc -p tsconfig.json",
|
|
95
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
96
|
+
"test": "vitest run"
|
|
97
|
+
}
|
|
6
98
|
}
|