@atproto/oauth-client-browser 0.3.41 → 0.4.0-next.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/dist/browser-oauth-client.d.ts +4 -1
- package/dist/browser-oauth-client.d.ts.map +1 -1
- package/dist/browser-oauth-client.js +24 -38
- package/dist/browser-oauth-client.js.map +1 -1
- package/dist/browser-oauth-database.d.ts +2 -2
- package/dist/browser-oauth-database.d.ts.map +1 -1
- package/dist/browser-oauth-database.js +19 -35
- package/dist/browser-oauth-database.js.map +1 -1
- package/dist/browser-runtime-implementation.d.ts +1 -1
- package/dist/browser-runtime-implementation.d.ts.map +1 -1
- package/dist/browser-runtime-implementation.js +4 -13
- package/dist/browser-runtime-implementation.js.map +1 -1
- package/dist/errors.js +2 -11
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -25
- package/dist/index.js.map +1 -1
- package/dist/indexed-db/db-index.js +8 -17
- package/dist/indexed-db/db-index.js.map +1 -1
- package/dist/indexed-db/db-object-store.js +13 -22
- package/dist/indexed-db/db-object-store.js.map +1 -1
- package/dist/indexed-db/db-transaction.d.ts +1 -1
- package/dist/indexed-db/db-transaction.d.ts.map +1 -1
- package/dist/indexed-db/db-transaction.js +13 -29
- package/dist/indexed-db/db-transaction.js.map +1 -1
- package/dist/indexed-db/db.d.ts +1 -1
- package/dist/indexed-db/db.d.ts.map +1 -1
- package/dist/indexed-db/db.js +13 -34
- package/dist/indexed-db/db.js.map +1 -1
- package/dist/indexed-db/index.js +4 -20
- package/dist/indexed-db/index.js.map +1 -1
- package/dist/indexed-db/schema.js +1 -2
- package/dist/indexed-db/util.js +2 -6
- package/dist/indexed-db/util.js.map +1 -1
- package/dist/indexed-db-store.js +5 -19
- package/dist/indexed-db-store.js.map +1 -1
- package/dist/util.js +3 -6
- package/dist/util.js.map +1 -1
- package/package.json +14 -13
package/dist/util.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildLoopbackClientId = buildLoopbackClientId;
|
|
4
|
-
const oauth_types_1 = require("@atproto/oauth-types");
|
|
1
|
+
import { isLoopbackHost } from '@atproto/oauth-types';
|
|
5
2
|
/**
|
|
6
3
|
* @example
|
|
7
4
|
* ```ts
|
|
8
5
|
* const clientId = buildLoopbackClientId(window.location)
|
|
9
6
|
* ```
|
|
10
7
|
*/
|
|
11
|
-
function buildLoopbackClientId(location, localhost = '127.0.0.1') {
|
|
12
|
-
if (!
|
|
8
|
+
export function buildLoopbackClientId(location, localhost = '127.0.0.1') {
|
|
9
|
+
if (!isLoopbackHost(location.hostname)) {
|
|
13
10
|
throw new TypeError(`Expected a loopback host, got ${location.hostname}`);
|
|
14
11
|
}
|
|
15
12
|
const redirectUri = `http://${location.hostname === 'localhost' ? localhost : location.hostname}${location.port && !location.port.startsWith(':') ? `:${location.port}` : location.port}${location.pathname}`;
|
package/dist/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AASrD;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAIC,EACD,SAAS,GAAG,WAAW;IAEvB,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,SAAS,CAAC,iCAAiC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC3E,CAAC;IAED,MAAM,WAAW,GAAG,UAAU,QAAQ,CAAC,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAA;IAE7M,OAAO,mBACL,QAAQ,CAAC,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,QAC5C,iBAAiB,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAA;AACpD,CAAC","sourcesContent":["import { isLoopbackHost } from '@atproto/oauth-types'\n\nexport type Simplify<T> = { [K in keyof T]: T[K] } & NonNullable<unknown>\nexport type TupleUnion<U extends string, R extends any[] = []> = {\n [S in U]: Exclude<U, S> extends never\n ? [...R, S]\n : TupleUnion<Exclude<U, S>, [...R, S]>\n}[U]\n\n/**\n * @example\n * ```ts\n * const clientId = buildLoopbackClientId(window.location)\n * ```\n */\nexport function buildLoopbackClientId(\n location: {\n hostname: string\n pathname: string\n port: string\n },\n localhost = '127.0.0.1',\n): string {\n if (!isLoopbackHost(location.hostname)) {\n throw new TypeError(`Expected a loopback host, got ${location.hostname}`)\n }\n\n const redirectUri = `http://${location.hostname === 'localhost' ? localhost : location.hostname}${location.port && !location.port.startsWith(':') ? `:${location.port}` : location.port}${location.pathname}`\n\n return `http://localhost${\n location.pathname === '/' ? '' : location.pathname\n }?redirect_uri=${encodeURIComponent(redirectUri)}`\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/oauth-client-browser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0-next.0",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": ">=22"
|
|
6
|
+
},
|
|
4
7
|
"license": "MIT",
|
|
5
8
|
"description": "ATPROTO OAuth client for the browser (relies on WebCrypto & Indexed DB)",
|
|
6
9
|
"keywords": [
|
|
@@ -18,9 +21,7 @@
|
|
|
18
21
|
"url": "https://github.com/bluesky-social/atproto",
|
|
19
22
|
"directory": "packages/oauth/oauth-client-browser"
|
|
20
23
|
},
|
|
21
|
-
"type": "
|
|
22
|
-
"main": "dist/index.js",
|
|
23
|
-
"types": "dist/index.d.ts",
|
|
24
|
+
"type": "module",
|
|
24
25
|
"exports": {
|
|
25
26
|
".": {
|
|
26
27
|
"types": "./dist/index.d.ts",
|
|
@@ -32,17 +33,17 @@
|
|
|
32
33
|
],
|
|
33
34
|
"dependencies": {
|
|
34
35
|
"core-js": "^3",
|
|
35
|
-
"@atproto-labs/did-resolver": "^0.
|
|
36
|
-
"@atproto-labs/
|
|
37
|
-
"@atproto
|
|
38
|
-
"@atproto/
|
|
39
|
-
"@atproto/jwk": "^0.
|
|
40
|
-
"@atproto/
|
|
41
|
-
"@atproto/
|
|
42
|
-
"@atproto/oauth-types": "^0.
|
|
36
|
+
"@atproto-labs/did-resolver": "^0.3.0-next.0",
|
|
37
|
+
"@atproto-labs/simple-store": "^0.4.0-next.0",
|
|
38
|
+
"@atproto/did": "^0.4.0-next.0",
|
|
39
|
+
"@atproto/jwk": "^0.7.0-next.0",
|
|
40
|
+
"@atproto/jwk-webcrypto": "^0.3.0-next.0",
|
|
41
|
+
"@atproto/oauth-client": "^0.7.0-next.0",
|
|
42
|
+
"@atproto-labs/handle-resolver": "^0.4.0-next.0",
|
|
43
|
+
"@atproto/oauth-types": "^0.7.0-next.0"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
|
-
"typescript": "^
|
|
46
|
+
"typescript": "^6.0.3"
|
|
46
47
|
},
|
|
47
48
|
"scripts": {
|
|
48
49
|
"build": "tsc --build tsconfig.build.json"
|