@inkbox/sdk 0.2.0 → 0.2.2

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.
Files changed (66) hide show
  1. package/README.md +34 -35
  2. package/dist/agent_identity.d.ts +96 -54
  3. package/dist/agent_identity.d.ts.map +1 -1
  4. package/dist/agent_identity.js +119 -86
  5. package/dist/agent_identity.js.map +1 -1
  6. package/dist/credentials.d.ts +11 -0
  7. package/dist/credentials.d.ts.map +1 -1
  8. package/dist/credentials.js +17 -0
  9. package/dist/credentials.js.map +1 -1
  10. package/dist/identities/resources/identities.d.ts +0 -15
  11. package/dist/identities/resources/identities.d.ts.map +1 -1
  12. package/dist/identities/resources/identities.js +0 -18
  13. package/dist/identities/resources/identities.js.map +1 -1
  14. package/dist/identities/types.d.ts +2 -21
  15. package/dist/identities/types.d.ts.map +1 -1
  16. package/dist/identities/types.js +1 -11
  17. package/dist/identities/types.js.map +1 -1
  18. package/dist/index.d.ts +4 -3
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +1 -0
  21. package/dist/index.js.map +1 -1
  22. package/dist/inkbox.d.ts +21 -6
  23. package/dist/inkbox.d.ts.map +1 -1
  24. package/dist/inkbox.js +30 -9
  25. package/dist/inkbox.js.map +1 -1
  26. package/dist/phone/resources/numbers.d.ts +2 -0
  27. package/dist/phone/resources/numbers.d.ts.map +1 -1
  28. package/dist/phone/resources/numbers.js +6 -0
  29. package/dist/phone/resources/numbers.js.map +1 -1
  30. package/dist/phone/resources/texts.d.ts +93 -0
  31. package/dist/phone/resources/texts.d.ts.map +1 -0
  32. package/dist/phone/resources/texts.js +109 -0
  33. package/dist/phone/resources/texts.js.map +1 -0
  34. package/dist/phone/types.d.ts +62 -0
  35. package/dist/phone/types.d.ts.map +1 -1
  36. package/dist/phone/types.js +34 -0
  37. package/dist/phone/types.js.map +1 -1
  38. package/dist/vault/crypto.d.ts +6 -4
  39. package/dist/vault/crypto.d.ts.map +1 -1
  40. package/dist/vault/crypto.js +22 -14
  41. package/dist/vault/crypto.js.map +1 -1
  42. package/dist/vault/resources/vault.d.ts +35 -1
  43. package/dist/vault/resources/vault.d.ts.map +1 -1
  44. package/dist/vault/resources/vault.js +113 -8
  45. package/dist/vault/resources/vault.js.map +1 -1
  46. package/dist/vault/totp.d.ts +73 -0
  47. package/dist/vault/totp.d.ts.map +1 -0
  48. package/dist/vault/totp.js +230 -0
  49. package/dist/vault/totp.js.map +1 -0
  50. package/dist/vault/types.d.ts +3 -0
  51. package/dist/vault/types.d.ts.map +1 -1
  52. package/dist/vault/types.js +4 -0
  53. package/dist/vault/types.js.map +1 -1
  54. package/package.json +2 -1
  55. package/dist/authenticator/resources/accounts.d.ts +0 -70
  56. package/dist/authenticator/resources/accounts.d.ts.map +0 -1
  57. package/dist/authenticator/resources/accounts.js +0 -91
  58. package/dist/authenticator/resources/accounts.js.map +0 -1
  59. package/dist/authenticator/resources/apps.d.ts +0 -38
  60. package/dist/authenticator/resources/apps.d.ts.map +0 -1
  61. package/dist/authenticator/resources/apps.js +0 -52
  62. package/dist/authenticator/resources/apps.js.map +0 -1
  63. package/dist/authenticator/types.d.ts +0 -83
  64. package/dist/authenticator/types.d.ts.map +0 -1
  65. package/dist/authenticator/types.js +0 -43
  66. package/dist/authenticator/types.js.map +0 -1
@@ -1,70 +0,0 @@
1
- /**
2
- * inkbox-authenticator/resources/accounts.ts
3
- *
4
- * Authenticator account CRUD and OTP generation.
5
- */
6
- import { HttpTransport } from "../../_http.js";
7
- import { AuthenticatorAccount, OTPCode } from "../types.js";
8
- export declare class AuthenticatorAccountsResource {
9
- private readonly http;
10
- constructor(http: HttpTransport);
11
- /**
12
- * Create a new authenticator account from an `otpauth://` URI.
13
- *
14
- * @param authenticatorAppId - UUID of the parent authenticator app.
15
- * @param options.otpauthUri - `otpauth://totp/...` or `otpauth://hotp/...` URI.
16
- * @param options.displayName - Optional user-managed label (max 255 characters).
17
- * @param options.description - Optional free-form notes.
18
- */
19
- create(authenticatorAppId: string, options: {
20
- otpauthUri: string;
21
- displayName?: string;
22
- description?: string;
23
- }): Promise<AuthenticatorAccount>;
24
- /**
25
- * List all non-deleted authenticator accounts for an app.
26
- *
27
- * @param authenticatorAppId - UUID of the parent authenticator app.
28
- */
29
- list(authenticatorAppId: string): Promise<AuthenticatorAccount[]>;
30
- /**
31
- * Get a single authenticator account by ID.
32
- *
33
- * @param authenticatorAppId - UUID of the parent authenticator app.
34
- * @param accountId - UUID of the authenticator account.
35
- */
36
- get(authenticatorAppId: string, accountId: string): Promise<AuthenticatorAccount>;
37
- /**
38
- * Update user-managed account metadata.
39
- *
40
- * Only provided fields are applied; omitted fields are left unchanged.
41
- *
42
- * @param authenticatorAppId - UUID of the parent authenticator app.
43
- * @param accountId - UUID of the authenticator account to update.
44
- * @param options.displayName - New label (max 255 characters).
45
- * @param options.description - New notes.
46
- */
47
- update(authenticatorAppId: string, accountId: string, options: {
48
- displayName?: string | null;
49
- description?: string | null;
50
- }): Promise<AuthenticatorAccount>;
51
- /**
52
- * Delete an authenticator account.
53
- *
54
- * @param authenticatorAppId - UUID of the parent authenticator app.
55
- * @param accountId - UUID of the authenticator account to delete.
56
- */
57
- delete(authenticatorAppId: string, accountId: string): Promise<void>;
58
- /**
59
- * Generate the current OTP code for an account.
60
- *
61
- * For TOTP accounts, `validForSeconds` indicates time until expiry.
62
- * For HOTP accounts, the stored counter is incremented atomically
63
- * and `validForSeconds` is `null`.
64
- *
65
- * @param authenticatorAppId - UUID of the parent authenticator app.
66
- * @param accountId - UUID of the authenticator account.
67
- */
68
- generateOtp(authenticatorAppId: string, accountId: string): Promise<OTPCode>;
69
- }
70
- //# sourceMappingURL=accounts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../../src/authenticator/resources/accounts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EACL,oBAAoB,EACpB,OAAO,EAKR,MAAM,aAAa,CAAC;AAErB,qBAAa,6BAA6B;IAC5B,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEhD;;;;;;;OAOG;IACG,MAAM,CACV,kBAAkB,EAAE,MAAM,EAC1B,OAAO,EAAE;QACP,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,GACA,OAAO,CAAC,oBAAoB,CAAC;IAWhC;;;;OAIG;IACG,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAOvE;;;;;OAKG;IACG,GAAG,CACP,kBAAkB,EAAE,MAAM,EAC1B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,oBAAoB,CAAC;IAOhC;;;;;;;;;OASG;IACG,MAAM,CACV,kBAAkB,EAAE,MAAM,EAC1B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE;QACP,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC7B,GACA,OAAO,CAAC,oBAAoB,CAAC;IAWhC;;;;;OAKG;IACG,MAAM,CACV,kBAAkB,EAAE,MAAM,EAC1B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;IAIhB;;;;;;;;;OASG;IACG,WAAW,CACf,kBAAkB,EAAE,MAAM,EAC1B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC;CAMpB"}
@@ -1,91 +0,0 @@
1
- /**
2
- * inkbox-authenticator/resources/accounts.ts
3
- *
4
- * Authenticator account CRUD and OTP generation.
5
- */
6
- import { parseAuthenticatorAccount, parseOTPCode, } from "../types.js";
7
- export class AuthenticatorAccountsResource {
8
- http;
9
- constructor(http) {
10
- this.http = http;
11
- }
12
- /**
13
- * Create a new authenticator account from an `otpauth://` URI.
14
- *
15
- * @param authenticatorAppId - UUID of the parent authenticator app.
16
- * @param options.otpauthUri - `otpauth://totp/...` or `otpauth://hotp/...` URI.
17
- * @param options.displayName - Optional user-managed label (max 255 characters).
18
- * @param options.description - Optional free-form notes.
19
- */
20
- async create(authenticatorAppId, options) {
21
- const body = { otpauth_uri: options.otpauthUri };
22
- if (options.displayName !== undefined)
23
- body["display_name"] = options.displayName;
24
- if (options.description !== undefined)
25
- body["description"] = options.description;
26
- const data = await this.http.post(`/apps/${authenticatorAppId}/accounts`, body);
27
- return parseAuthenticatorAccount(data);
28
- }
29
- /**
30
- * List all non-deleted authenticator accounts for an app.
31
- *
32
- * @param authenticatorAppId - UUID of the parent authenticator app.
33
- */
34
- async list(authenticatorAppId) {
35
- const data = await this.http.get(`/apps/${authenticatorAppId}/accounts`);
36
- return data.map(parseAuthenticatorAccount);
37
- }
38
- /**
39
- * Get a single authenticator account by ID.
40
- *
41
- * @param authenticatorAppId - UUID of the parent authenticator app.
42
- * @param accountId - UUID of the authenticator account.
43
- */
44
- async get(authenticatorAppId, accountId) {
45
- const data = await this.http.get(`/apps/${authenticatorAppId}/accounts/${accountId}`);
46
- return parseAuthenticatorAccount(data);
47
- }
48
- /**
49
- * Update user-managed account metadata.
50
- *
51
- * Only provided fields are applied; omitted fields are left unchanged.
52
- *
53
- * @param authenticatorAppId - UUID of the parent authenticator app.
54
- * @param accountId - UUID of the authenticator account to update.
55
- * @param options.displayName - New label (max 255 characters).
56
- * @param options.description - New notes.
57
- */
58
- async update(authenticatorAppId, accountId, options) {
59
- const body = {};
60
- if ("displayName" in options)
61
- body["display_name"] = options.displayName;
62
- if ("description" in options)
63
- body["description"] = options.description;
64
- const data = await this.http.patch(`/apps/${authenticatorAppId}/accounts/${accountId}`, body);
65
- return parseAuthenticatorAccount(data);
66
- }
67
- /**
68
- * Delete an authenticator account.
69
- *
70
- * @param authenticatorAppId - UUID of the parent authenticator app.
71
- * @param accountId - UUID of the authenticator account to delete.
72
- */
73
- async delete(authenticatorAppId, accountId) {
74
- await this.http.delete(`/apps/${authenticatorAppId}/accounts/${accountId}`);
75
- }
76
- /**
77
- * Generate the current OTP code for an account.
78
- *
79
- * For TOTP accounts, `validForSeconds` indicates time until expiry.
80
- * For HOTP accounts, the stored counter is incremented atomically
81
- * and `validForSeconds` is `null`.
82
- *
83
- * @param authenticatorAppId - UUID of the parent authenticator app.
84
- * @param accountId - UUID of the authenticator account.
85
- */
86
- async generateOtp(authenticatorAppId, accountId) {
87
- const data = await this.http.post(`/apps/${authenticatorAppId}/accounts/${accountId}/generate-otp`);
88
- return parseOTPCode(data);
89
- }
90
- }
91
- //# sourceMappingURL=accounts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../../src/authenticator/resources/accounts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAKL,yBAAyB,EACzB,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,MAAM,OAAO,6BAA6B;IACX;IAA7B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD;;;;;;;OAOG;IACH,KAAK,CAAC,MAAM,CACV,kBAA0B,EAC1B,OAIC;QAED,MAAM,IAAI,GAA4B,EAAE,WAAW,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC;QAC1E,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS;YAAE,IAAI,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;QAClF,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS;YAAE,IAAI,CAAC,aAAa,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;QACjF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAC/B,SAAS,kBAAkB,WAAW,EACtC,IAAI,CACL,CAAC;QACF,OAAO,yBAAyB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED;;;;OA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AAS,kBAAkB,aAAa,SAAS,eAAe,CACjE,CAAC;QACF,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;CACF"}
@@ -1,38 +0,0 @@
1
- /**
2
- * inkbox-authenticator/resources/apps.ts
3
- *
4
- * Authenticator app CRUD operations.
5
- */
6
- import { HttpTransport } from "../../_http.js";
7
- import { AuthenticatorApp } from "../types.js";
8
- export declare class AuthenticatorAppsResource {
9
- private readonly http;
10
- constructor(http: HttpTransport);
11
- /**
12
- * Create a new authenticator app.
13
- *
14
- * @param options.agentHandle - Optional agent identity handle to link this app to.
15
- * If omitted, the app is created unbound.
16
- */
17
- create(options?: {
18
- agentHandle?: string;
19
- }): Promise<AuthenticatorApp>;
20
- /** List all non-deleted authenticator apps for your organisation. */
21
- list(): Promise<AuthenticatorApp[]>;
22
- /**
23
- * Get a single authenticator app by ID.
24
- *
25
- * @param authenticatorAppId - UUID of the authenticator app.
26
- */
27
- get(authenticatorAppId: string): Promise<AuthenticatorApp>;
28
- /**
29
- * Delete an authenticator app.
30
- *
31
- * This also unlinks the app from its identity (if any) and
32
- * deletes all child authenticator accounts.
33
- *
34
- * @param authenticatorAppId - UUID of the authenticator app to delete.
35
- */
36
- delete(authenticatorAppId: string): Promise<void>;
37
- }
38
- //# sourceMappingURL=apps.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../../src/authenticator/resources/apps.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EACL,gBAAgB,EAGjB,MAAM,aAAa,CAAC;AAIrB,qBAAa,yBAAyB;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEhD;;;;;OAKG;IACG,MAAM,CAAC,OAAO,GAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAO/E,qEAAqE;IAC/D,IAAI,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAKzC;;;;OAIG;IACG,GAAG,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAKhE;;;;;;;OAOG;IACG,MAAM,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGxD"}
@@ -1,52 +0,0 @@
1
- /**
2
- * inkbox-authenticator/resources/apps.ts
3
- *
4
- * Authenticator app CRUD operations.
5
- */
6
- import { parseAuthenticatorApp, } from "../types.js";
7
- const BASE = "/apps";
8
- export class AuthenticatorAppsResource {
9
- http;
10
- constructor(http) {
11
- this.http = http;
12
- }
13
- /**
14
- * Create a new authenticator app.
15
- *
16
- * @param options.agentHandle - Optional agent identity handle to link this app to.
17
- * If omitted, the app is created unbound.
18
- */
19
- async create(options = {}) {
20
- const body = {};
21
- if (options.agentHandle !== undefined)
22
- body["agent_handle"] = options.agentHandle;
23
- const data = await this.http.post(BASE, body);
24
- return parseAuthenticatorApp(data);
25
- }
26
- /** List all non-deleted authenticator apps for your organisation. */
27
- async list() {
28
- const data = await this.http.get(BASE);
29
- return data.map(parseAuthenticatorApp);
30
- }
31
- /**
32
- * Get a single authenticator app by ID.
33
- *
34
- * @param authenticatorAppId - UUID of the authenticator app.
35
- */
36
- async get(authenticatorAppId) {
37
- const data = await this.http.get(`${BASE}/${authenticatorAppId}`);
38
- return parseAuthenticatorApp(data);
39
- }
40
- /**
41
- * Delete an authenticator app.
42
- *
43
- * This also unlinks the app from its identity (if any) and
44
- * deletes all child authenticator accounts.
45
- *
46
- * @param authenticatorAppId - UUID of the authenticator app to delete.
47
- */
48
- async delete(authenticatorAppId) {
49
- await this.http.delete(`${BASE}/${authenticatorAppId}`);
50
- }
51
- }
52
- //# sourceMappingURL=apps.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apps.js","sourceRoot":"","sources":["../../../src/authenticator/resources/apps.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p {
5
- id: string;
6
- organizationId: string;
7
- identityId: string | null;
8
- /** "active" | "paused" | "deleted" */
9
- status: string;
10
- createdAt: Date;
11
- updatedAt: Date;
12
- }
13
- export interface AuthenticatorAccount {
14
- id: string;
15
- authenticatorAppId: string;
16
- /** "totp" | "hotp" */
17
- otpType: string;
18
- issuer: string | null;
19
- accountName: string | null;
20
- displayName: string | null;
21
- description: string | null;
22
- /** "sha1" | "sha256" | "sha512" */
23
- algorithm: string;
24
- /** 6 | 8 */
25
- digits: number;
26
- /** TOTP period in seconds; null for HOTP */
27
- period: number | null;
28
- /** HOTP counter; null for TOTP */
29
- counter: number | null;
30
- /** "active" | "deleted" */
31
- status: string;
32
- createdAt: Date;
33
- updatedAt: Date;
34
- }
35
- export interface OTPCode {
36
- otpCode: string;
37
- /** Seconds until code expires; null for HOTP */
38
- validForSeconds: number | null;
39
- /** "totp" | "hotp" */
40
- otpType: string;
41
- /** "sha1" | "sha256" | "sha512" */
42
- algorithm: string;
43
- /** 6 | 8 */
44
- digits: number;
45
- /** TOTP period in seconds; null for HOTP */
46
- period: number | null;
47
- }
48
- export interface RawAuthenticatorApp {
49
- id: string;
50
- organization_id: string;
51
- identity_id: string | null;
52
- status: string;
53
- created_at: string;
54
- updated_at: string;
55
- }
56
- export interface RawAuthenticatorAccount {
57
- id: string;
58
- authenticator_app_id: string;
59
- otp_type: string;
60
- issuer: string | null;
61
- account_name: string | null;
62
- display_name: string | null;
63
- description: string | null;
64
- algorithm: string;
65
- digits: number;
66
- period: number | null;
67
- counter: number | null;
68
- status: string;
69
- created_at: string;
70
- updated_at: string;
71
- }
72
- export interface RawOTPCode {
73
- otp_code: string;
74
- valid_for_seconds: number | null;
75
- otp_type: string;
76
- algorithm: string;
77
- digits: number;
78
- period: number | null;
79
- }
80
- export declare function parseAuthenticatorApp(r: RawAuthenticatorApp): AuthenticatorApp;
81
- export declare function parseAuthenticatorAccount(r: RawAuthenticatorAccount): AuthenticatorAccount;
82
- export declare function parseOTPCode(r: RawOTPCode): OTPCode;
83
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/authenticator/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,EAAE,MAAM,CAAC;IAC3B,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,kCAAkC;IAClC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY;IACZ,MAAM,EAAE,M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C,EAAE,UAAU,GAAG,OAAO,CASnD"}
@@ -1,43 +0,0 @@
1
- /**
2
- * inkbox-authenticator TypeScript SDK — public types.
3
- */
4
- // ---- parsers ----
5
- export function parseAuthenticatorApp(r) {
6
- return {
7
- id: r.id,
8
- organizationId: r.organization_id,
9
- identityId: r.identity_id,
10
- status: r.status,
11
- createdAt: new Date(r.created_at),
12
- updatedAt: new Date(r.updated_at),
13
- };
14
- }
15
- export function parseAuthenticatorAccount(r) {
16
- return {
17
- id: r.id,
18
- authenticatorAppId: r.authenticator_app_id,
19
- otpType: r.otp_type,
20
- issuer: r.issuer,
21
- accountName: r.account_name,
22
- displayName: r.display_name,
23
- description: r.description,
24
- algorithm: r.algorithm,
25
- digits: r.digits,
26
- period: r.period,
27
- counter: r.counter,
28
- status: r.status,
29
- createdAt: new Date(r.created_at),
30
- updatedAt: new Date(r.updated_at),
31
- };
32
- }
33
- export function parseOTPCode(r) {
34
- return {
35
- otpCode: r.otp_code,
36
- validForSeconds: r.valid_for_seconds,
37
- otpType: r.otp_type,
38
- algorithm: r.algorithm,
39
- digits: r.digits,
40
- period: r.period,
41
- };
42
- }
43
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/authenticator/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAwFH,oBAAoB;AAEpB,MAAM,UAAU,qBAAqB,CAAC,CAAsB;IAC1D,OAAO;QACL,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,cAAc,EAAE,CAAC,CAAC,eAAe;QACjC,UAAU,EAAE,CAAC,CAAC,WAAW;QACzB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,SAAS,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC;QACjC,SAAS,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC;KAClC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,CAA0B;IAClE,OAAO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