@atproto/lex-password-session 0.0.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 +413 -0
- package/dist/error.d.ts +8 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +14 -0
- package/dist/error.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/lexicons/com/atproto/server/createAccount.d.ts +3 -0
- package/dist/lexicons/com/atproto/server/createAccount.d.ts.map +1 -0
- package/dist/lexicons/com/atproto/server/createAccount.defs.d.ts +57 -0
- package/dist/lexicons/com/atproto/server/createAccount.defs.d.ts.map +1 -0
- package/dist/lexicons/com/atproto/server/createAccount.defs.js +43 -0
- package/dist/lexicons/com/atproto/server/createAccount.defs.js.map +1 -0
- package/dist/lexicons/com/atproto/server/createAccount.js +10 -0
- package/dist/lexicons/com/atproto/server/createAccount.js.map +1 -0
- package/dist/lexicons/com/atproto/server/createSession.d.ts +3 -0
- package/dist/lexicons/com/atproto/server/createSession.d.ts.map +1 -0
- package/dist/lexicons/com/atproto/server/createSession.defs.d.ts +53 -0
- package/dist/lexicons/com/atproto/server/createSession.defs.d.ts.map +1 -0
- package/dist/lexicons/com/atproto/server/createSession.defs.js +35 -0
- package/dist/lexicons/com/atproto/server/createSession.defs.js.map +1 -0
- package/dist/lexicons/com/atproto/server/createSession.js +10 -0
- package/dist/lexicons/com/atproto/server/createSession.js.map +1 -0
- package/dist/lexicons/com/atproto/server/deleteSession.d.ts +3 -0
- package/dist/lexicons/com/atproto/server/deleteSession.d.ts.map +1 -0
- package/dist/lexicons/com/atproto/server/deleteSession.defs.d.ts +13 -0
- package/dist/lexicons/com/atproto/server/deleteSession.defs.d.ts.map +1 -0
- package/dist/lexicons/com/atproto/server/deleteSession.defs.js +19 -0
- package/dist/lexicons/com/atproto/server/deleteSession.defs.js.map +1 -0
- package/dist/lexicons/com/atproto/server/deleteSession.js +10 -0
- package/dist/lexicons/com/atproto/server/deleteSession.js.map +1 -0
- package/dist/lexicons/com/atproto/server/getSession.d.ts +3 -0
- package/dist/lexicons/com/atproto/server/getSession.d.ts.map +1 -0
- package/dist/lexicons/com/atproto/server/getSession.defs.d.ts +37 -0
- package/dist/lexicons/com/atproto/server/getSession.defs.d.ts.map +1 -0
- package/dist/lexicons/com/atproto/server/getSession.defs.js +27 -0
- package/dist/lexicons/com/atproto/server/getSession.defs.js.map +1 -0
- package/dist/lexicons/com/atproto/server/getSession.js +10 -0
- package/dist/lexicons/com/atproto/server/getSession.js.map +1 -0
- package/dist/lexicons/com/atproto/server/refreshSession.d.ts +3 -0
- package/dist/lexicons/com/atproto/server/refreshSession.d.ts.map +1 -0
- package/dist/lexicons/com/atproto/server/refreshSession.defs.d.ts +43 -0
- package/dist/lexicons/com/atproto/server/refreshSession.defs.d.ts.map +1 -0
- package/dist/lexicons/com/atproto/server/refreshSession.defs.js +30 -0
- package/dist/lexicons/com/atproto/server/refreshSession.defs.js.map +1 -0
- package/dist/lexicons/com/atproto/server/refreshSession.js +10 -0
- package/dist/lexicons/com/atproto/server/refreshSession.js.map +1 -0
- package/dist/lexicons/com/atproto/server.d.ts +6 -0
- package/dist/lexicons/com/atproto/server.d.ts.map +1 -0
- package/dist/lexicons/com/atproto/server.js +13 -0
- package/dist/lexicons/com/atproto/server.js.map +1 -0
- package/dist/lexicons/com/atproto.d.ts +2 -0
- package/dist/lexicons/com/atproto.d.ts.map +1 -0
- package/dist/lexicons/com/atproto.js +9 -0
- package/dist/lexicons/com/atproto.js.map +1 -0
- package/dist/lexicons/com.d.ts +2 -0
- package/dist/lexicons/com.d.ts.map +1 -0
- package/dist/lexicons/com.js +9 -0
- package/dist/lexicons/com.js.map +1 -0
- package/dist/lexicons/index.d.ts +2 -0
- package/dist/lexicons/index.d.ts.map +1 -0
- package/dist/lexicons/index.js +9 -0
- package/dist/lexicons/index.js.map +1 -0
- package/dist/password-session.d.ts +127 -0
- package/dist/password-session.d.ts.map +1 -0
- package/dist/password-session.js +242 -0
- package/dist/password-session.js.map +1 -0
- package/dist/util.d.ts +5 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +46 -0
- package/dist/util.js.map +1 -0
- package/package.json +52 -0
- package/src/error.ts +14 -0
- package/src/index.ts +2 -0
- package/src/lexicons/com/atproto/server/createAccount.defs.ts +56 -0
- package/src/lexicons/com/atproto/server/createAccount.ts +6 -0
- package/src/lexicons/com/atproto/server/createSession.defs.ts +48 -0
- package/src/lexicons/com/atproto/server/createSession.ts +6 -0
- package/src/lexicons/com/atproto/server/deleteSession.defs.ts +32 -0
- package/src/lexicons/com/atproto/server/deleteSession.ts +6 -0
- package/src/lexicons/com/atproto/server/getSession.defs.ts +36 -0
- package/src/lexicons/com/atproto/server/getSession.ts +6 -0
- package/src/lexicons/com/atproto/server/refreshSession.defs.ts +43 -0
- package/src/lexicons/com/atproto/server/refreshSession.ts +6 -0
- package/src/lexicons/com/atproto/server.ts +9 -0
- package/src/lexicons/com/atproto.ts +5 -0
- package/src/lexicons/com.ts +5 -0
- package/src/lexicons/index.ts +5 -0
- package/src/password-session-utils.test.ts +177 -0
- package/src/password-session.test.ts +416 -0
- package/src/password-session.ts +404 -0
- package/src/util.ts +61 -0
- package/tsconfig.build.json +12 -0
- package/tsconfig.json +7 -0
- package/tsconfig.tests.json +9 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.$output = exports.$input = exports.$params = exports.$lxm = exports.main = exports.$nsid = void 0;
|
|
7
|
+
const lex_schema_1 = require("@atproto/lex-schema");
|
|
8
|
+
const $nsid = 'com.atproto.server.createSession';
|
|
9
|
+
exports.$nsid = $nsid;
|
|
10
|
+
/** Create an authentication session. */
|
|
11
|
+
const main =
|
|
12
|
+
/*#__PURE__*/
|
|
13
|
+
lex_schema_1.l.procedure($nsid,
|
|
14
|
+
/*#__PURE__*/ lex_schema_1.l.params(),
|
|
15
|
+
/*#__PURE__*/ lex_schema_1.l.jsonPayload({
|
|
16
|
+
identifier: /*#__PURE__*/ lex_schema_1.l.string(),
|
|
17
|
+
password: /*#__PURE__*/ lex_schema_1.l.string(),
|
|
18
|
+
authFactorToken: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.string()),
|
|
19
|
+
allowTakendown: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.boolean()),
|
|
20
|
+
}),
|
|
21
|
+
/*#__PURE__*/ lex_schema_1.l.jsonPayload({
|
|
22
|
+
accessJwt: /*#__PURE__*/ lex_schema_1.l.string(),
|
|
23
|
+
refreshJwt: /*#__PURE__*/ lex_schema_1.l.string(),
|
|
24
|
+
handle: /*#__PURE__*/ lex_schema_1.l.string({ format: 'handle' }),
|
|
25
|
+
did: /*#__PURE__*/ lex_schema_1.l.string({ format: 'did' }),
|
|
26
|
+
didDoc: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.unknownObject()),
|
|
27
|
+
email: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.string()),
|
|
28
|
+
emailConfirmed: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.boolean()),
|
|
29
|
+
emailAuthFactor: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.boolean()),
|
|
30
|
+
active: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.boolean()),
|
|
31
|
+
status: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.string()),
|
|
32
|
+
}), ['AccountTakedown', 'AuthFactorTokenRequired']);
|
|
33
|
+
exports.main = main;
|
|
34
|
+
exports.$lxm = main.nsid, exports.$params = main.parameters, exports.$input = main.input, exports.$output = main.output;
|
|
35
|
+
//# sourceMappingURL=createSession.defs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSession.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/server/createSession.defs.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oDAAuC;AAEvC,MAAM,KAAK,GAAG,kCAAkC,CAAA;AAEvC,sBAAK;AAEd,wCAAwC;AACxC,MAAM,IAAI;AACR,aAAa;AACb,cAAC,CAAC,SAAS,CACT,KAAK;AACL,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE;AACxB,aAAa,CAAC,cAAC,CAAC,WAAW,CAAC;IAC1B,UAAU,EAAE,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE;IACpC,QAAQ,EAAE,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE;IAClC,eAAe,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE,CAAC;IACnE,cAAc,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,OAAO,EAAE,CAAC;CACpE,CAAC;AACF,aAAa,CAAC,cAAC,CAAC,WAAW,CAAC;IAC1B,SAAS,EAAE,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE;IACnC,UAAU,EAAE,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE;IACpC,MAAM,EAAE,aAAa,CAAC,cAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IACpD,GAAG,EAAE,aAAa,CAAC,cAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC9C,MAAM,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,aAAa,EAAE,CAAC;IACjE,KAAK,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE,CAAC;IACzD,cAAc,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,OAAO,EAAE,CAAC;IACnE,eAAe,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,OAAO,EAAE,CAAC;IACpE,MAAM,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,OAAO,EAAE,CAAC;IAC3D,MAAM,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE,CAAC;CAC3D,CAAC,EACF,CAAC,iBAAiB,EAAE,yBAAyB,CAAC,CAC/C,CAAA;AACM,oBAAI;AAQA,QAAA,IAAI,GAAiB,IAAI,CAAC,IAAI,EACzC,QAAA,OAAO,GAAiB,IAAI,CAAC,UAAU,EACvC,QAAA,MAAM,GAAiB,IAAI,CAAC,KAAK,EACjC,QAAA,OAAO,GAAiB,IAAI,CAAC,MAAM,CAAA","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nimport { l } from '@atproto/lex-schema'\n\nconst $nsid = 'com.atproto.server.createSession'\n\nexport { $nsid }\n\n/** Create an authentication session. */\nconst main =\n /*#__PURE__*/\n l.procedure(\n $nsid,\n /*#__PURE__*/ l.params(),\n /*#__PURE__*/ l.jsonPayload({\n identifier: /*#__PURE__*/ l.string(),\n password: /*#__PURE__*/ l.string(),\n authFactorToken: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),\n allowTakendown: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),\n }),\n /*#__PURE__*/ l.jsonPayload({\n accessJwt: /*#__PURE__*/ l.string(),\n refreshJwt: /*#__PURE__*/ l.string(),\n handle: /*#__PURE__*/ l.string({ format: 'handle' }),\n did: /*#__PURE__*/ l.string({ format: 'did' }),\n didDoc: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.unknownObject()),\n email: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),\n emailConfirmed: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),\n emailAuthFactor: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),\n active: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),\n status: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),\n }),\n ['AccountTakedown', 'AuthFactorTokenRequired'],\n )\nexport { main }\n\nexport type Params = l.InferMethodParams<typeof main>\nexport type Input = l.InferMethodInput<typeof main>\nexport type InputBody = l.InferMethodInputBody<typeof main>\nexport type Output = l.InferMethodOutput<typeof main>\nexport type OutputBody = l.InferMethodOutputBody<typeof main>\n\nexport const $lxm = /*#__PURE__*/ main.nsid,\n $params = /*#__PURE__*/ main.parameters,\n $input = /*#__PURE__*/ main.input,\n $output = /*#__PURE__*/ main.output\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.$defs = void 0;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
tslib_1.__exportStar(require("./createSession.defs.js"), exports);
|
|
9
|
+
exports.$defs = tslib_1.__importStar(require("./createSession.defs.js"));
|
|
10
|
+
//# sourceMappingURL=createSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSession.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/server/createSession.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,kEAAuC;AACvC,yEAAgD","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nexport * from './createSession.defs.js'\nexport * as $defs from './createSession.defs.js'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteSession.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/server/deleteSession.ts"],"names":[],"mappings":"AAIA,cAAc,yBAAyB,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { l } from '@atproto/lex-schema';
|
|
2
|
+
declare const $nsid = "com.atproto.server.deleteSession";
|
|
3
|
+
export { $nsid };
|
|
4
|
+
/** Delete the current session. Requires auth using the 'refreshJwt' (not the 'accessJwt'). */
|
|
5
|
+
declare const main: l.Procedure<"com.atproto.server.deleteSession", l.ParamsSchema<{}>, l.Payload<undefined, undefined>, l.Payload<undefined, undefined>, readonly ["InvalidToken", "ExpiredToken"]>;
|
|
6
|
+
export { main };
|
|
7
|
+
export type Params = l.InferMethodParams<typeof main>;
|
|
8
|
+
export type Input = l.InferMethodInput<typeof main>;
|
|
9
|
+
export type InputBody = l.InferMethodInputBody<typeof main>;
|
|
10
|
+
export type Output = l.InferMethodOutput<typeof main>;
|
|
11
|
+
export type OutputBody = l.InferMethodOutputBody<typeof main>;
|
|
12
|
+
export declare const $lxm: "com.atproto.server.deleteSession", $params: l.ParamsSchema<{}>, $input: l.Payload<undefined, undefined>, $output: l.Payload<undefined, undefined>;
|
|
13
|
+
//# sourceMappingURL=deleteSession.defs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteSession.defs.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/server/deleteSession.defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AAEvC,QAAA,MAAM,KAAK,qCAAqC,CAAA;AAEhD,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,8FAA8F;AAC9F,QAAA,MAAM,IAAI,kLAQP,CAAA;AACH,OAAO,EAAE,IAAI,EAAE,CAAA;AAEf,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,iBAAiB,CAAC,OAAO,IAAI,CAAC,CAAA;AACrD,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,gBAAgB,CAAC,OAAO,IAAI,CAAC,CAAA;AACnD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,oBAAoB,CAAC,OAAO,IAAI,CAAC,CAAA;AAC3D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,iBAAiB,CAAC,OAAO,IAAI,CAAC,CAAA;AACrD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,qBAAqB,CAAC,OAAO,IAAI,CAAC,CAAA;AAE7D,eAAO,MAAM,IAAI,oCAA0B,EACzC,OAAO,oBAAgC,EACvC,MAAM,iCAA2B,EACjC,OAAO,iCAA4B,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.$output = exports.$input = exports.$params = exports.$lxm = exports.main = exports.$nsid = void 0;
|
|
7
|
+
const lex_schema_1 = require("@atproto/lex-schema");
|
|
8
|
+
const $nsid = 'com.atproto.server.deleteSession';
|
|
9
|
+
exports.$nsid = $nsid;
|
|
10
|
+
/** Delete the current session. Requires auth using the 'refreshJwt' (not the 'accessJwt'). */
|
|
11
|
+
const main =
|
|
12
|
+
/*#__PURE__*/
|
|
13
|
+
lex_schema_1.l.procedure($nsid,
|
|
14
|
+
/*#__PURE__*/ lex_schema_1.l.params(),
|
|
15
|
+
/*#__PURE__*/ lex_schema_1.l.payload(),
|
|
16
|
+
/*#__PURE__*/ lex_schema_1.l.payload(), ['InvalidToken', 'ExpiredToken']);
|
|
17
|
+
exports.main = main;
|
|
18
|
+
exports.$lxm = main.nsid, exports.$params = main.parameters, exports.$input = main.input, exports.$output = main.output;
|
|
19
|
+
//# sourceMappingURL=deleteSession.defs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteSession.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/server/deleteSession.defs.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oDAAuC;AAEvC,MAAM,KAAK,GAAG,kCAAkC,CAAA;AAEvC,sBAAK;AAEd,8FAA8F;AAC9F,MAAM,IAAI;AACR,aAAa;AACb,cAAC,CAAC,SAAS,CACT,KAAK;AACL,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE;AACxB,aAAa,CAAC,cAAC,CAAC,OAAO,EAAE;AACzB,aAAa,CAAC,cAAC,CAAC,OAAO,EAAE,EACzB,CAAC,cAAc,EAAE,cAAc,CAAC,CACjC,CAAA;AACM,oBAAI;AAQA,QAAA,IAAI,GAAiB,IAAI,CAAC,IAAI,EACzC,QAAA,OAAO,GAAiB,IAAI,CAAC,UAAU,EACvC,QAAA,MAAM,GAAiB,IAAI,CAAC,KAAK,EACjC,QAAA,OAAO,GAAiB,IAAI,CAAC,MAAM,CAAA","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nimport { l } from '@atproto/lex-schema'\n\nconst $nsid = 'com.atproto.server.deleteSession'\n\nexport { $nsid }\n\n/** Delete the current session. Requires auth using the 'refreshJwt' (not the 'accessJwt'). */\nconst main =\n /*#__PURE__*/\n l.procedure(\n $nsid,\n /*#__PURE__*/ l.params(),\n /*#__PURE__*/ l.payload(),\n /*#__PURE__*/ l.payload(),\n ['InvalidToken', 'ExpiredToken'],\n )\nexport { main }\n\nexport type Params = l.InferMethodParams<typeof main>\nexport type Input = l.InferMethodInput<typeof main>\nexport type InputBody = l.InferMethodInputBody<typeof main>\nexport type Output = l.InferMethodOutput<typeof main>\nexport type OutputBody = l.InferMethodOutputBody<typeof main>\n\nexport const $lxm = /*#__PURE__*/ main.nsid,\n $params = /*#__PURE__*/ main.parameters,\n $input = /*#__PURE__*/ main.input,\n $output = /*#__PURE__*/ main.output\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.$defs = void 0;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
tslib_1.__exportStar(require("./deleteSession.defs.js"), exports);
|
|
9
|
+
exports.$defs = tslib_1.__importStar(require("./deleteSession.defs.js"));
|
|
10
|
+
//# sourceMappingURL=deleteSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteSession.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/server/deleteSession.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,kEAAuC;AACvC,yEAAgD","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nexport * from './deleteSession.defs.js'\nexport * as $defs from './deleteSession.defs.js'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSession.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/server/getSession.ts"],"names":[],"mappings":"AAIA,cAAc,sBAAsB,CAAA;AACpC,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { l } from '@atproto/lex-schema';
|
|
2
|
+
declare const $nsid = "com.atproto.server.getSession";
|
|
3
|
+
export { $nsid };
|
|
4
|
+
/** Get information about the current auth session. Requires auth. */
|
|
5
|
+
declare const main: l.Query<"com.atproto.server.getSession", l.ParamsSchema<{}>, l.Payload<"application/json", l.ObjectSchema<{
|
|
6
|
+
readonly handle: l.StringSchema<{
|
|
7
|
+
readonly format: "handle";
|
|
8
|
+
}>;
|
|
9
|
+
readonly did: l.StringSchema<{
|
|
10
|
+
readonly format: "did";
|
|
11
|
+
}>;
|
|
12
|
+
readonly didDoc: l.OptionalSchema<import("@atproto/lex-client").LexMap>;
|
|
13
|
+
readonly email: l.OptionalSchema<string>;
|
|
14
|
+
readonly emailConfirmed: l.OptionalSchema<boolean>;
|
|
15
|
+
readonly emailAuthFactor: l.OptionalSchema<boolean>;
|
|
16
|
+
readonly active: l.OptionalSchema<boolean>;
|
|
17
|
+
readonly status: l.OptionalSchema<string>;
|
|
18
|
+
}>>, undefined>;
|
|
19
|
+
export { main };
|
|
20
|
+
export type Params = l.InferMethodParams<typeof main>;
|
|
21
|
+
export type Output = l.InferMethodOutput<typeof main>;
|
|
22
|
+
export type OutputBody = l.InferMethodOutputBody<typeof main>;
|
|
23
|
+
export declare const $lxm: "com.atproto.server.getSession", $params: l.ParamsSchema<{}>, $output: l.Payload<"application/json", l.ObjectSchema<{
|
|
24
|
+
readonly handle: l.StringSchema<{
|
|
25
|
+
readonly format: "handle";
|
|
26
|
+
}>;
|
|
27
|
+
readonly did: l.StringSchema<{
|
|
28
|
+
readonly format: "did";
|
|
29
|
+
}>;
|
|
30
|
+
readonly didDoc: l.OptionalSchema<import("@atproto/lex-client").LexMap>;
|
|
31
|
+
readonly email: l.OptionalSchema<string>;
|
|
32
|
+
readonly emailConfirmed: l.OptionalSchema<boolean>;
|
|
33
|
+
readonly emailAuthFactor: l.OptionalSchema<boolean>;
|
|
34
|
+
readonly active: l.OptionalSchema<boolean>;
|
|
35
|
+
readonly status: l.OptionalSchema<string>;
|
|
36
|
+
}>>;
|
|
37
|
+
//# sourceMappingURL=getSession.defs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSession.defs.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/server/getSession.defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AAEvC,QAAA,MAAM,KAAK,kCAAkC,CAAA;AAE7C,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,qEAAqE;AACrE,QAAA,MAAM,IAAI;;;;;;;;;;;;;eAeP,CAAA;AACH,OAAO,EAAE,IAAI,EAAE,CAAA;AAEf,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,iBAAiB,CAAC,OAAO,IAAI,CAAC,CAAA;AACrD,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,iBAAiB,CAAC,OAAO,IAAI,CAAC,CAAA;AACrD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,qBAAqB,CAAC,OAAO,IAAI,CAAC,CAAA;AAE7D,eAAO,MAAM,IAAI,iCAA0B,EACzC,OAAO,oBAAkB,EACzB,OAAO;;;;;;;;;;;;;GAAc,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.$output = exports.$params = exports.$lxm = exports.main = exports.$nsid = void 0;
|
|
7
|
+
const lex_schema_1 = require("@atproto/lex-schema");
|
|
8
|
+
const $nsid = 'com.atproto.server.getSession';
|
|
9
|
+
exports.$nsid = $nsid;
|
|
10
|
+
/** Get information about the current auth session. Requires auth. */
|
|
11
|
+
const main =
|
|
12
|
+
/*#__PURE__*/
|
|
13
|
+
lex_schema_1.l.query($nsid,
|
|
14
|
+
/*#__PURE__*/ lex_schema_1.l.params(),
|
|
15
|
+
/*#__PURE__*/ lex_schema_1.l.jsonPayload({
|
|
16
|
+
handle: /*#__PURE__*/ lex_schema_1.l.string({ format: 'handle' }),
|
|
17
|
+
did: /*#__PURE__*/ lex_schema_1.l.string({ format: 'did' }),
|
|
18
|
+
didDoc: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.unknownObject()),
|
|
19
|
+
email: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.string()),
|
|
20
|
+
emailConfirmed: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.boolean()),
|
|
21
|
+
emailAuthFactor: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.boolean()),
|
|
22
|
+
active: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.boolean()),
|
|
23
|
+
status: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.string()),
|
|
24
|
+
}));
|
|
25
|
+
exports.main = main;
|
|
26
|
+
exports.$lxm = main.nsid, exports.$params = main.parameters, exports.$output = main.output;
|
|
27
|
+
//# sourceMappingURL=getSession.defs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSession.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/server/getSession.defs.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oDAAuC;AAEvC,MAAM,KAAK,GAAG,+BAA+B,CAAA;AAEpC,sBAAK;AAEd,qEAAqE;AACrE,MAAM,IAAI;AACR,aAAa;AACb,cAAC,CAAC,KAAK,CACL,KAAK;AACL,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE;AACxB,aAAa,CAAC,cAAC,CAAC,WAAW,CAAC;IAC1B,MAAM,EAAE,aAAa,CAAC,cAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IACpD,GAAG,EAAE,aAAa,CAAC,cAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC9C,MAAM,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,aAAa,EAAE,CAAC;IACjE,KAAK,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE,CAAC;IACzD,cAAc,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,OAAO,EAAE,CAAC;IACnE,eAAe,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,OAAO,EAAE,CAAC;IACpE,MAAM,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,OAAO,EAAE,CAAC;IAC3D,MAAM,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE,CAAC;CAC3D,CAAC,CACH,CAAA;AACM,oBAAI;AAMA,QAAA,IAAI,GAAiB,IAAI,CAAC,IAAI,EACzC,QAAA,OAAO,GAAG,IAAI,CAAC,UAAU,EACzB,QAAA,OAAO,GAAG,IAAI,CAAC,MAAM,CAAA","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nimport { l } from '@atproto/lex-schema'\n\nconst $nsid = 'com.atproto.server.getSession'\n\nexport { $nsid }\n\n/** Get information about the current auth session. Requires auth. */\nconst main =\n /*#__PURE__*/\n l.query(\n $nsid,\n /*#__PURE__*/ l.params(),\n /*#__PURE__*/ l.jsonPayload({\n handle: /*#__PURE__*/ l.string({ format: 'handle' }),\n did: /*#__PURE__*/ l.string({ format: 'did' }),\n didDoc: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.unknownObject()),\n email: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),\n emailConfirmed: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),\n emailAuthFactor: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),\n active: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),\n status: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),\n }),\n )\nexport { main }\n\nexport type Params = l.InferMethodParams<typeof main>\nexport type Output = l.InferMethodOutput<typeof main>\nexport type OutputBody = l.InferMethodOutputBody<typeof main>\n\nexport const $lxm = /*#__PURE__*/ main.nsid,\n $params = main.parameters,\n $output = main.output\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.$defs = void 0;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
tslib_1.__exportStar(require("./getSession.defs.js"), exports);
|
|
9
|
+
exports.$defs = tslib_1.__importStar(require("./getSession.defs.js"));
|
|
10
|
+
//# sourceMappingURL=getSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSession.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/server/getSession.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,+DAAoC;AACpC,sEAA6C","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nexport * from './getSession.defs.js'\nexport * as $defs from './getSession.defs.js'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshSession.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/server/refreshSession.ts"],"names":[],"mappings":"AAIA,cAAc,0BAA0B,CAAA;AACxC,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { l } from '@atproto/lex-schema';
|
|
2
|
+
declare const $nsid = "com.atproto.server.refreshSession";
|
|
3
|
+
export { $nsid };
|
|
4
|
+
/** Refresh an authentication session. Requires auth using the 'refreshJwt' (not the 'accessJwt'). */
|
|
5
|
+
declare const main: l.Procedure<"com.atproto.server.refreshSession", l.ParamsSchema<{}>, l.Payload<undefined, undefined>, l.Payload<"application/json", l.ObjectSchema<{
|
|
6
|
+
readonly accessJwt: l.StringSchema<{}>;
|
|
7
|
+
readonly refreshJwt: l.StringSchema<{}>;
|
|
8
|
+
readonly handle: l.StringSchema<{
|
|
9
|
+
readonly format: "handle";
|
|
10
|
+
}>;
|
|
11
|
+
readonly did: l.StringSchema<{
|
|
12
|
+
readonly format: "did";
|
|
13
|
+
}>;
|
|
14
|
+
readonly didDoc: l.OptionalSchema<import("@atproto/lex-client").LexMap>;
|
|
15
|
+
readonly email: l.OptionalSchema<string>;
|
|
16
|
+
readonly emailConfirmed: l.OptionalSchema<boolean>;
|
|
17
|
+
readonly emailAuthFactor: l.OptionalSchema<boolean>;
|
|
18
|
+
readonly active: l.OptionalSchema<boolean>;
|
|
19
|
+
readonly status: l.OptionalSchema<string>;
|
|
20
|
+
}>>, readonly ["AccountTakedown", "InvalidToken", "ExpiredToken"]>;
|
|
21
|
+
export { main };
|
|
22
|
+
export type Params = l.InferMethodParams<typeof main>;
|
|
23
|
+
export type Input = l.InferMethodInput<typeof main>;
|
|
24
|
+
export type InputBody = l.InferMethodInputBody<typeof main>;
|
|
25
|
+
export type Output = l.InferMethodOutput<typeof main>;
|
|
26
|
+
export type OutputBody = l.InferMethodOutputBody<typeof main>;
|
|
27
|
+
export declare const $lxm: "com.atproto.server.refreshSession", $params: l.ParamsSchema<{}>, $input: l.Payload<undefined, undefined>, $output: l.Payload<"application/json", l.ObjectSchema<{
|
|
28
|
+
readonly accessJwt: l.StringSchema<{}>;
|
|
29
|
+
readonly refreshJwt: l.StringSchema<{}>;
|
|
30
|
+
readonly handle: l.StringSchema<{
|
|
31
|
+
readonly format: "handle";
|
|
32
|
+
}>;
|
|
33
|
+
readonly did: l.StringSchema<{
|
|
34
|
+
readonly format: "did";
|
|
35
|
+
}>;
|
|
36
|
+
readonly didDoc: l.OptionalSchema<import("@atproto/lex-client").LexMap>;
|
|
37
|
+
readonly email: l.OptionalSchema<string>;
|
|
38
|
+
readonly emailConfirmed: l.OptionalSchema<boolean>;
|
|
39
|
+
readonly emailAuthFactor: l.OptionalSchema<boolean>;
|
|
40
|
+
readonly active: l.OptionalSchema<boolean>;
|
|
41
|
+
readonly status: l.OptionalSchema<string>;
|
|
42
|
+
}>>;
|
|
43
|
+
//# sourceMappingURL=refreshSession.defs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshSession.defs.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/server/refreshSession.defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AAEvC,QAAA,MAAM,KAAK,sCAAsC,CAAA;AAEjD,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,qGAAqG;AACrG,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;kEAmBP,CAAA;AACH,OAAO,EAAE,IAAI,EAAE,CAAA;AAEf,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,iBAAiB,CAAC,OAAO,IAAI,CAAC,CAAA;AACrD,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,gBAAgB,CAAC,OAAO,IAAI,CAAC,CAAA;AACnD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,oBAAoB,CAAC,OAAO,IAAI,CAAC,CAAA;AAC3D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,iBAAiB,CAAC,OAAO,IAAI,CAAC,CAAA;AACrD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,qBAAqB,CAAC,OAAO,IAAI,CAAC,CAAA;AAE7D,eAAO,MAAM,IAAI,qCAA0B,EACzC,OAAO,oBAAgC,EACvC,MAAM,iCAA2B,EACjC,OAAO;;;;;;;;;;;;;;;GAA4B,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.$output = exports.$input = exports.$params = exports.$lxm = exports.main = exports.$nsid = void 0;
|
|
7
|
+
const lex_schema_1 = require("@atproto/lex-schema");
|
|
8
|
+
const $nsid = 'com.atproto.server.refreshSession';
|
|
9
|
+
exports.$nsid = $nsid;
|
|
10
|
+
/** Refresh an authentication session. Requires auth using the 'refreshJwt' (not the 'accessJwt'). */
|
|
11
|
+
const main =
|
|
12
|
+
/*#__PURE__*/
|
|
13
|
+
lex_schema_1.l.procedure($nsid,
|
|
14
|
+
/*#__PURE__*/ lex_schema_1.l.params(),
|
|
15
|
+
/*#__PURE__*/ lex_schema_1.l.payload(),
|
|
16
|
+
/*#__PURE__*/ lex_schema_1.l.jsonPayload({
|
|
17
|
+
accessJwt: /*#__PURE__*/ lex_schema_1.l.string(),
|
|
18
|
+
refreshJwt: /*#__PURE__*/ lex_schema_1.l.string(),
|
|
19
|
+
handle: /*#__PURE__*/ lex_schema_1.l.string({ format: 'handle' }),
|
|
20
|
+
did: /*#__PURE__*/ lex_schema_1.l.string({ format: 'did' }),
|
|
21
|
+
didDoc: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.unknownObject()),
|
|
22
|
+
email: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.string()),
|
|
23
|
+
emailConfirmed: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.boolean()),
|
|
24
|
+
emailAuthFactor: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.boolean()),
|
|
25
|
+
active: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.boolean()),
|
|
26
|
+
status: /*#__PURE__*/ lex_schema_1.l.optional(/*#__PURE__*/ lex_schema_1.l.string()),
|
|
27
|
+
}), ['AccountTakedown', 'InvalidToken', 'ExpiredToken']);
|
|
28
|
+
exports.main = main;
|
|
29
|
+
exports.$lxm = main.nsid, exports.$params = main.parameters, exports.$input = main.input, exports.$output = main.output;
|
|
30
|
+
//# sourceMappingURL=refreshSession.defs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshSession.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/server/refreshSession.defs.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,oDAAuC;AAEvC,MAAM,KAAK,GAAG,mCAAmC,CAAA;AAExC,sBAAK;AAEd,qGAAqG;AACrG,MAAM,IAAI;AACR,aAAa;AACb,cAAC,CAAC,SAAS,CACT,KAAK;AACL,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE;AACxB,aAAa,CAAC,cAAC,CAAC,OAAO,EAAE;AACzB,aAAa,CAAC,cAAC,CAAC,WAAW,CAAC;IAC1B,SAAS,EAAE,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE;IACnC,UAAU,EAAE,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE;IACpC,MAAM,EAAE,aAAa,CAAC,cAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IACpD,GAAG,EAAE,aAAa,CAAC,cAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC9C,MAAM,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,aAAa,EAAE,CAAC;IACjE,KAAK,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE,CAAC;IACzD,cAAc,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,OAAO,EAAE,CAAC;IACnE,eAAe,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,OAAO,EAAE,CAAC;IACpE,MAAM,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,OAAO,EAAE,CAAC;IAC3D,MAAM,EAAE,aAAa,CAAC,cAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAC,CAAC,MAAM,EAAE,CAAC;CAC3D,CAAC,EACF,CAAC,iBAAiB,EAAE,cAAc,EAAE,cAAc,CAAC,CACpD,CAAA;AACM,oBAAI;AAQA,QAAA,IAAI,GAAiB,IAAI,CAAC,IAAI,EACzC,QAAA,OAAO,GAAiB,IAAI,CAAC,UAAU,EACvC,QAAA,MAAM,GAAiB,IAAI,CAAC,KAAK,EACjC,QAAA,OAAO,GAAiB,IAAI,CAAC,MAAM,CAAA","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nimport { l } from '@atproto/lex-schema'\n\nconst $nsid = 'com.atproto.server.refreshSession'\n\nexport { $nsid }\n\n/** Refresh an authentication session. Requires auth using the 'refreshJwt' (not the 'accessJwt'). */\nconst main =\n /*#__PURE__*/\n l.procedure(\n $nsid,\n /*#__PURE__*/ l.params(),\n /*#__PURE__*/ l.payload(),\n /*#__PURE__*/ l.jsonPayload({\n accessJwt: /*#__PURE__*/ l.string(),\n refreshJwt: /*#__PURE__*/ l.string(),\n handle: /*#__PURE__*/ l.string({ format: 'handle' }),\n did: /*#__PURE__*/ l.string({ format: 'did' }),\n didDoc: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.unknownObject()),\n email: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),\n emailConfirmed: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),\n emailAuthFactor: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),\n active: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),\n status: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),\n }),\n ['AccountTakedown', 'InvalidToken', 'ExpiredToken'],\n )\nexport { main }\n\nexport type Params = l.InferMethodParams<typeof main>\nexport type Input = l.InferMethodInput<typeof main>\nexport type InputBody = l.InferMethodInputBody<typeof main>\nexport type Output = l.InferMethodOutput<typeof main>\nexport type OutputBody = l.InferMethodOutputBody<typeof main>\n\nexport const $lxm = /*#__PURE__*/ main.nsid,\n $params = /*#__PURE__*/ main.parameters,\n $input = /*#__PURE__*/ main.input,\n $output = /*#__PURE__*/ main.output\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.$defs = void 0;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
tslib_1.__exportStar(require("./refreshSession.defs.js"), exports);
|
|
9
|
+
exports.$defs = tslib_1.__importStar(require("./refreshSession.defs.js"));
|
|
10
|
+
//# sourceMappingURL=refreshSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshSession.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/server/refreshSession.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,mEAAwC;AACxC,0EAAiD","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nexport * from './refreshSession.defs.js'\nexport * as $defs from './refreshSession.defs.js'\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * as createAccount from './server/createAccount.js';
|
|
2
|
+
export * as createSession from './server/createSession.js';
|
|
3
|
+
export * as deleteSession from './server/deleteSession.js';
|
|
4
|
+
export * as getSession from './server/getSession.js';
|
|
5
|
+
export * as refreshSession from './server/refreshSession.js';
|
|
6
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/lexicons/com/atproto/server.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAA;AAC1D,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAA;AACpD,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.refreshSession = exports.getSession = exports.deleteSession = exports.createSession = exports.createAccount = void 0;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
exports.createAccount = tslib_1.__importStar(require("./server/createAccount.js"));
|
|
9
|
+
exports.createSession = tslib_1.__importStar(require("./server/createSession.js"));
|
|
10
|
+
exports.deleteSession = tslib_1.__importStar(require("./server/deleteSession.js"));
|
|
11
|
+
exports.getSession = tslib_1.__importStar(require("./server/getSession.js"));
|
|
12
|
+
exports.refreshSession = tslib_1.__importStar(require("./server/refreshSession.js"));
|
|
13
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../src/lexicons/com/atproto/server.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,mFAA0D;AAC1D,mFAA0D;AAC1D,mFAA0D;AAC1D,6EAAoD;AACpD,qFAA4D","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nexport * as createAccount from './server/createAccount.js'\nexport * as createSession from './server/createSession.js'\nexport * as deleteSession from './server/deleteSession.js'\nexport * as getSession from './server/getSession.js'\nexport * as refreshSession from './server/refreshSession.js'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atproto.d.ts","sourceRoot":"","sources":["../../../src/lexicons/com/atproto.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.server = void 0;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
exports.server = tslib_1.__importStar(require("./atproto/server.js"));
|
|
9
|
+
//# sourceMappingURL=atproto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atproto.js","sourceRoot":"","sources":["../../../src/lexicons/com/atproto.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,sEAA6C","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nexport * as server from './atproto/server.js'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"com.d.ts","sourceRoot":"","sources":["../../src/lexicons/com.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.atproto = void 0;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
exports.atproto = tslib_1.__importStar(require("./com/atproto.js"));
|
|
9
|
+
//# sourceMappingURL=com.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"com.js","sourceRoot":"","sources":["../../src/lexicons/com.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,oEAA2C","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nexport * as atproto from './com/atproto.js'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lexicons/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.com = void 0;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
exports.com = tslib_1.__importStar(require("./com.js"));
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lexicons/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,wDAA+B","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nexport * as com from './com.js'\n"]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Agent, LexRpcFailure } from '@atproto/lex-client';
|
|
2
|
+
import { com } from './lexicons/index.js';
|
|
3
|
+
export type RefreshFailure = LexRpcFailure<typeof com.atproto.server.refreshSession.main>;
|
|
4
|
+
export type DeleteFailure = LexRpcFailure<typeof com.atproto.server.deleteSession.main>;
|
|
5
|
+
export type SessionData = com.atproto.server.createSession.OutputBody & {
|
|
6
|
+
service: string;
|
|
7
|
+
};
|
|
8
|
+
export type PasswordSessionOptions = {
|
|
9
|
+
/**
|
|
10
|
+
* Custom fetch implementation to use for network requests
|
|
11
|
+
*/
|
|
12
|
+
fetch?: typeof globalThis.fetch;
|
|
13
|
+
/**
|
|
14
|
+
* Called whenever the session is successfully created/refreshed, and new
|
|
15
|
+
* credentials have been obtained. Use this hook to persist the updated
|
|
16
|
+
* session information.
|
|
17
|
+
*
|
|
18
|
+
* If this callback returns a promise, this function will never be called
|
|
19
|
+
* again (on the same process) until the promise resolves.
|
|
20
|
+
*
|
|
21
|
+
* @note this function **must** not throw
|
|
22
|
+
*/
|
|
23
|
+
onUpdated: (this: PasswordSession, data: SessionData) => void | Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Called whenever the session update fails due to an expected error, such as
|
|
26
|
+
* a network issue or server unavailability. This function can be used to log
|
|
27
|
+
* the error or notify the user, but should not assume that the session is
|
|
28
|
+
* invalid.
|
|
29
|
+
*
|
|
30
|
+
* @note this function **must** not throw
|
|
31
|
+
*/
|
|
32
|
+
onUpdateFailure?: (this: PasswordSession, data: SessionData, err: RefreshFailure) => void | Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Called whenever the session is deleted, either due to an explicit logout or
|
|
35
|
+
* because the refresh operation indicated that the session is no longer
|
|
36
|
+
* valid. Use this hook to clean up any persisted session information and
|
|
37
|
+
* update the application state accordingly.
|
|
38
|
+
*
|
|
39
|
+
* @note this function **must** not throw
|
|
40
|
+
*/
|
|
41
|
+
onDeleted: (this: PasswordSession, data: SessionData) => void | Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Called whenever a session deletion fails due to an unexpected error, such
|
|
44
|
+
* as a network issue or server unavailability. This function can be used to
|
|
45
|
+
* log the error or notify the user. When this function is called, the session
|
|
46
|
+
* might still be valid on the server. It is up to the implementation to
|
|
47
|
+
* decide whether to retry the deletion or keep the session active. Ignoring
|
|
48
|
+
* these errors is not recommended as it can lead to orphaned sessions on the
|
|
49
|
+
* server, or security issues if the user believes they have logged out when a
|
|
50
|
+
* bad actor is still using the session. The implementation should consider
|
|
51
|
+
* keeping track of failed deletions and retrying them later, until they
|
|
52
|
+
* succeed.
|
|
53
|
+
*
|
|
54
|
+
* @note this function **must** not throw
|
|
55
|
+
*/
|
|
56
|
+
onDeleteFailure?: (this: PasswordSession, data: SessionData, err: DeleteFailure) => void | Promise<void>;
|
|
57
|
+
};
|
|
58
|
+
export declare class PasswordSession implements Agent {
|
|
59
|
+
#private;
|
|
60
|
+
protected readonly options: PasswordSessionOptions;
|
|
61
|
+
constructor(sessionData: SessionData, options: PasswordSessionOptions);
|
|
62
|
+
get did(): `did:${string}:${string}`;
|
|
63
|
+
get handle(): `${string}.${string}`;
|
|
64
|
+
get session(): SessionData;
|
|
65
|
+
get destroyed(): boolean;
|
|
66
|
+
fetchHandler(path: string, init: RequestInit): Promise<Response>;
|
|
67
|
+
refresh(): Promise<SessionData>;
|
|
68
|
+
logout(): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* @note It is **not** recommended to use {@link PasswordSession} with main
|
|
71
|
+
* account credentials. Instead, it is strongly advised to use OAuth based
|
|
72
|
+
* authentication for main username/password credentials and use
|
|
73
|
+
* {@link PasswordSession} with an app-password, for bots, scripts, or similar
|
|
74
|
+
* use-cases.
|
|
75
|
+
*
|
|
76
|
+
* @throws If unable to create a session. In particular, if the server
|
|
77
|
+
* requires a 2FA token, a {@link LexRpcResponseError} with the
|
|
78
|
+
* `AuthFactorTokenRequired` error code will be thrown.
|
|
79
|
+
*
|
|
80
|
+
*
|
|
81
|
+
* @example Handling 2FA errors
|
|
82
|
+
*
|
|
83
|
+
* ```ts
|
|
84
|
+
* try {
|
|
85
|
+
* const session = await PasswordSession.create({
|
|
86
|
+
* service: 'https://example.com',
|
|
87
|
+
* identifier: 'alice',
|
|
88
|
+
* password: 'correct horse battery staple',
|
|
89
|
+
* })
|
|
90
|
+
* } catch (err) {
|
|
91
|
+
* if (err instanceof LexRpcResponseError && err.error === 'AuthFactorTokenRequired') {
|
|
92
|
+
* // Prompt user for 2FA token and re-attempt session creation
|
|
93
|
+
* }
|
|
94
|
+
* }
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
static create({ service, identifier, password, allowTakendown, authFactorToken, ...options }: PasswordSessionOptions & {
|
|
98
|
+
service: string | URL;
|
|
99
|
+
identifier: string;
|
|
100
|
+
password: string;
|
|
101
|
+
allowTakendown?: boolean;
|
|
102
|
+
authFactorToken?: string;
|
|
103
|
+
}): Promise<PasswordSession>;
|
|
104
|
+
/**
|
|
105
|
+
* Resume an existing session, ensuring it is still valid by refreshing it.
|
|
106
|
+
* Any error thrown here indicates that the session is definitely no longer
|
|
107
|
+
* valid. Network errors will be propagated through the
|
|
108
|
+
* {@link PasswordSessionOptions.onUpdateFailure} hook, and not re-thrown
|
|
109
|
+
* here. This means that a resolved promise does not necessarily indicate a
|
|
110
|
+
* valid session, only that it's refresh did not definitively fail.
|
|
111
|
+
*
|
|
112
|
+
* This is the same as calling {@link PasswordSession.refresh} after
|
|
113
|
+
* constructing the {@link PasswordSession} manually.
|
|
114
|
+
*
|
|
115
|
+
* @throws If, and only if, the session is definitely no longer valid.
|
|
116
|
+
*/
|
|
117
|
+
static resume(data: SessionData, options: PasswordSessionOptions): Promise<PasswordSession>;
|
|
118
|
+
/**
|
|
119
|
+
* Delete a session without having to {@link resume resume()} it first, or
|
|
120
|
+
* provide hooks.
|
|
121
|
+
*
|
|
122
|
+
* @throws In case of unexpected error (network issue, server down, etc)
|
|
123
|
+
* meaning that the session may still be valid.
|
|
124
|
+
*/
|
|
125
|
+
static delete(data: SessionData, options?: Partial<PasswordSessionOptions>): Promise<void>;
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=password-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-session.d.ts","sourceRoot":"","sources":["../src/password-session.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAEL,aAAa,EAGd,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAGzC,MAAM,MAAM,cAAc,GAAG,aAAa,CACxC,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAC9C,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,aAAa,CACvC,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAC7C,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,GAAG;IACtE,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;IAE/B;;;;;;;;;OASG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7E;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,CAChB,IAAI,EAAE,eAAe,EACrB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,cAAc,KAChB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEzB;;;;;;;OAOG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7E;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,EAAE,CAChB,IAAI,EAAE,eAAe,EACrB,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,aAAa,KACf,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1B,CAAA;AAED,qBAAa,eAAgB,YAAW,KAAK;;IAYzC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,sBAAsB;gBADlD,WAAW,EAAE,WAAW,EACL,OAAO,EAAE,sBAAsB;IAWpD,IAAI,GAAG,8BAEN;IAED,IAAI,MAAM,0BAET;IAED,IAAI,OAAO,gBAGV;IAED,IAAI,SAAS,IAAI,OAAO,CAEvB;IAEK,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAkEhE,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC;IAwD/B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAwC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;WACU,MAAM,CAAC,EAClB,OAAO,EACP,UAAU,EACV,QAAQ,EACR,cAAc,EACd,eAAe,EACf,GAAG,OAAO,EACX,EAAE,sBAAsB,GAAG;QAC1B,OAAO,EAAE,MAAM,GAAG,GAAG,CAAA;QACrB,UAAU,EAAE,MAAM,CAAA;QAClB,QAAQ,EAAE,MAAM,CAAA;QAChB,cAAc,CAAC,EAAE,OAAO,CAAA;QACxB,eAAe,CAAC,EAAE,MAAM,CAAA;KACzB,GAAG,OAAO,CAAC,eAAe,CAAC;IA6B5B;;;;;;;;;;;;OAYG;WACU,MAAM,CACjB,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,eAAe,CAAC;IAM3B;;;;;;OAMG;WACU,MAAM,CACjB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,GACxC,OAAO,CAAC,IAAI,CAAC;CAQjB"}
|