@temboplus/afloat 0.1.53 → 0.1.54
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/esm/src/features/auth/access/repository.d.ts +11 -0
- package/esm/src/features/auth/access/repository.d.ts.map +1 -0
- package/esm/src/features/auth/access/repository.js +25 -0
- package/esm/src/features/auth/index.d.ts +4 -0
- package/esm/src/features/auth/index.d.ts.map +1 -1
- package/esm/src/features/auth/index.js +4 -0
- package/esm/src/features/auth/profile/repository.d.ts +11 -0
- package/esm/src/features/auth/profile/repository.d.ts.map +1 -0
- package/esm/src/features/auth/profile/repository.js +25 -0
- package/package.json +1 -1
- package/script/src/features/auth/access/repository.d.ts +11 -0
- package/script/src/features/auth/access/repository.d.ts.map +1 -0
- package/script/src/features/auth/access/repository.js +29 -0
- package/script/src/features/auth/index.d.ts +4 -0
- package/script/src/features/auth/index.d.ts.map +1 -1
- package/script/src/features/auth/index.js +4 -0
- package/script/src/features/auth/profile/repository.d.ts +11 -0
- package/script/src/features/auth/profile/repository.d.ts.map +1 -0
- package/script/src/features/auth/profile/repository.js +29 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Profile } from "../../../models/index.js";
|
|
2
|
+
import { TokenRequiredRepository } from "../../../shared/token_required_repository.js";
|
|
3
|
+
import { accessContract } from "./contract.js";
|
|
4
|
+
export declare class AccessRepository extends TokenRequiredRepository<typeof accessContract> {
|
|
5
|
+
/**
|
|
6
|
+
* Initializes an instance of ProfileRepository.
|
|
7
|
+
*/
|
|
8
|
+
constructor();
|
|
9
|
+
getCurrentProfile(token: string): Promise<Profile>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../../src/src/features/auth/access/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,qBAAa,gBACX,SAAQ,uBAAuB,CAAC,OAAO,cAAc,CAAC;IACtD;;OAEG;;IAKG,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAazD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Profile } from "../../../models/index.js";
|
|
2
|
+
import { APIError } from "../../../errors/api_error.js";
|
|
3
|
+
import { TokenRequiredRepository } from "../../../shared/token_required_repository.js";
|
|
4
|
+
import { accessContract } from "./contract.js";
|
|
5
|
+
export class AccessRepository extends TokenRequiredRepository {
|
|
6
|
+
/**
|
|
7
|
+
* Initializes an instance of ProfileRepository.
|
|
8
|
+
*/
|
|
9
|
+
constructor() {
|
|
10
|
+
super("auth", accessContract, "");
|
|
11
|
+
}
|
|
12
|
+
async getCurrentProfile(token) {
|
|
13
|
+
this.setToken(token);
|
|
14
|
+
const result = await this.client.getAccessList();
|
|
15
|
+
if (result.status === 200) {
|
|
16
|
+
const profile = Profile.from(result.body);
|
|
17
|
+
if (profile)
|
|
18
|
+
return profile;
|
|
19
|
+
}
|
|
20
|
+
throw new APIError({
|
|
21
|
+
message: "An error occurred while trying to get the current access list",
|
|
22
|
+
statusCode: 502,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/features/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/features/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Profile } from "../../../models/index.js";
|
|
2
|
+
import { profileContract } from "./contract.js";
|
|
3
|
+
import { TokenRequiredRepository } from "../../../shared/token_required_repository.js";
|
|
4
|
+
export declare class ProfileRepository extends TokenRequiredRepository<typeof profileContract> {
|
|
5
|
+
/**
|
|
6
|
+
* Initializes an instance of ProfileRepository.
|
|
7
|
+
*/
|
|
8
|
+
constructor();
|
|
9
|
+
getCurrentProfile(token: string): Promise<Profile>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../../src/src/features/auth/profile/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAEvF,qBAAa,iBAAkB,SAAQ,uBAAuB,CAAC,OAAO,eAAe,CAAC;IACpF;;OAEG;;IAKG,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAazD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Profile } from "../../../models/index.js";
|
|
2
|
+
import { APIError } from "../../../errors/api_error.js";
|
|
3
|
+
import { profileContract } from "./contract.js";
|
|
4
|
+
import { TokenRequiredRepository } from "../../../shared/token_required_repository.js";
|
|
5
|
+
export class ProfileRepository extends TokenRequiredRepository {
|
|
6
|
+
/**
|
|
7
|
+
* Initializes an instance of ProfileRepository.
|
|
8
|
+
*/
|
|
9
|
+
constructor() {
|
|
10
|
+
super("profile", profileContract, "");
|
|
11
|
+
}
|
|
12
|
+
async getCurrentProfile(token) {
|
|
13
|
+
this.setToken(token);
|
|
14
|
+
const result = await this.client.getCurrentProfile();
|
|
15
|
+
if (result.status === 200) {
|
|
16
|
+
const profile = Profile.from(result.body);
|
|
17
|
+
if (profile)
|
|
18
|
+
return profile;
|
|
19
|
+
}
|
|
20
|
+
throw new APIError({
|
|
21
|
+
message: "An error occurred while trying to get the current profile",
|
|
22
|
+
statusCode: 502,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Profile } from "../../../models/index.js";
|
|
2
|
+
import { TokenRequiredRepository } from "../../../shared/token_required_repository.js";
|
|
3
|
+
import { accessContract } from "./contract.js";
|
|
4
|
+
export declare class AccessRepository extends TokenRequiredRepository<typeof accessContract> {
|
|
5
|
+
/**
|
|
6
|
+
* Initializes an instance of ProfileRepository.
|
|
7
|
+
*/
|
|
8
|
+
constructor();
|
|
9
|
+
getCurrentProfile(token: string): Promise<Profile>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../../src/src/features/auth/access/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,qBAAa,gBACX,SAAQ,uBAAuB,CAAC,OAAO,cAAc,CAAC;IACtD;;OAEG;;IAKG,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAazD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccessRepository = void 0;
|
|
4
|
+
const index_js_1 = require("../../../models/index.js");
|
|
5
|
+
const api_error_js_1 = require("../../../errors/api_error.js");
|
|
6
|
+
const token_required_repository_js_1 = require("../../../shared/token_required_repository.js");
|
|
7
|
+
const contract_js_1 = require("./contract.js");
|
|
8
|
+
class AccessRepository extends token_required_repository_js_1.TokenRequiredRepository {
|
|
9
|
+
/**
|
|
10
|
+
* Initializes an instance of ProfileRepository.
|
|
11
|
+
*/
|
|
12
|
+
constructor() {
|
|
13
|
+
super("auth", contract_js_1.accessContract, "");
|
|
14
|
+
}
|
|
15
|
+
async getCurrentProfile(token) {
|
|
16
|
+
this.setToken(token);
|
|
17
|
+
const result = await this.client.getAccessList();
|
|
18
|
+
if (result.status === 200) {
|
|
19
|
+
const profile = index_js_1.Profile.from(result.body);
|
|
20
|
+
if (profile)
|
|
21
|
+
return profile;
|
|
22
|
+
}
|
|
23
|
+
throw new api_error_js_1.APIError({
|
|
24
|
+
message: "An error occurred while trying to get the current access list",
|
|
25
|
+
statusCode: 502,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.AccessRepository = AccessRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/features/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/features/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA"}
|
|
@@ -15,3 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./manager.js"), exports);
|
|
18
|
+
__exportStar(require("./repository.js"), exports);
|
|
19
|
+
__exportStar(require("./profile/repository.js"), exports);
|
|
20
|
+
__exportStar(require("./identity/repository.js"), exports);
|
|
21
|
+
__exportStar(require("./access/repository.js"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Profile } from "../../../models/index.js";
|
|
2
|
+
import { profileContract } from "./contract.js";
|
|
3
|
+
import { TokenRequiredRepository } from "../../../shared/token_required_repository.js";
|
|
4
|
+
export declare class ProfileRepository extends TokenRequiredRepository<typeof profileContract> {
|
|
5
|
+
/**
|
|
6
|
+
* Initializes an instance of ProfileRepository.
|
|
7
|
+
*/
|
|
8
|
+
constructor();
|
|
9
|
+
getCurrentProfile(token: string): Promise<Profile>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../../src/src/features/auth/profile/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAEvF,qBAAa,iBAAkB,SAAQ,uBAAuB,CAAC,OAAO,eAAe,CAAC;IACpF;;OAEG;;IAKG,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAazD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProfileRepository = void 0;
|
|
4
|
+
const index_js_1 = require("../../../models/index.js");
|
|
5
|
+
const api_error_js_1 = require("../../../errors/api_error.js");
|
|
6
|
+
const contract_js_1 = require("./contract.js");
|
|
7
|
+
const token_required_repository_js_1 = require("../../../shared/token_required_repository.js");
|
|
8
|
+
class ProfileRepository extends token_required_repository_js_1.TokenRequiredRepository {
|
|
9
|
+
/**
|
|
10
|
+
* Initializes an instance of ProfileRepository.
|
|
11
|
+
*/
|
|
12
|
+
constructor() {
|
|
13
|
+
super("profile", contract_js_1.profileContract, "");
|
|
14
|
+
}
|
|
15
|
+
async getCurrentProfile(token) {
|
|
16
|
+
this.setToken(token);
|
|
17
|
+
const result = await this.client.getCurrentProfile();
|
|
18
|
+
if (result.status === 200) {
|
|
19
|
+
const profile = index_js_1.Profile.from(result.body);
|
|
20
|
+
if (profile)
|
|
21
|
+
return profile;
|
|
22
|
+
}
|
|
23
|
+
throw new api_error_js_1.APIError({
|
|
24
|
+
message: "An error occurred while trying to get the current profile",
|
|
25
|
+
statusCode: 502,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.ProfileRepository = ProfileRepository;
|