avvir 0.3.26 → 0.3.27
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/avvir_api.node.js +33 -0
- package/dist/esm/api/organization_api.d.ts +2 -0
- package/dist/esm/api/organization_api.js +4 -0
- package/dist/esm/api/organization_api.js.map +1 -1
- package/dist/esm/models/api/api_user_for_organization.d.ts +12 -0
- package/dist/esm/models/api/api_user_for_organization.js +13 -0
- package/dist/esm/models/api/api_user_for_organization.js.map +1 -0
- package/package.json +1 -1
- package/source/api/organization_api.ts +7 -0
- package/source/models/api/api_user_for_organization.ts +24 -0
package/dist/avvir_api.node.js
CHANGED
|
@@ -645,6 +645,10 @@ var OrganizationApi = /** @class */ (function () {
|
|
|
645
645
|
var url = _utilities_http__WEBPACK_IMPORTED_MODULE_0__["default"].baseUrl() + "/client-accounts/" + organizationId + "/name";
|
|
646
646
|
return _utilities_http__WEBPACK_IMPORTED_MODULE_0__["default"].get(url, user);
|
|
647
647
|
};
|
|
648
|
+
OrganizationApi.getUsersForOrganization = function (organizationId, user) {
|
|
649
|
+
var url = _utilities_http__WEBPACK_IMPORTED_MODULE_0__["default"].baseUrl() + "/client-accounts/" + organizationId + "/users";
|
|
650
|
+
return _utilities_http__WEBPACK_IMPORTED_MODULE_0__["default"].get(url, user);
|
|
651
|
+
};
|
|
648
652
|
OrganizationApi.createOrganization = function (organization, user) {
|
|
649
653
|
var url = _utilities_http__WEBPACK_IMPORTED_MODULE_0__["default"].baseUrl() + "/client-accounts";
|
|
650
654
|
return _utilities_http__WEBPACK_IMPORTED_MODULE_0__["default"].post(url, user, organization);
|
|
@@ -4037,6 +4041,34 @@ var ApiUserAction = /** @class */ (function () {
|
|
|
4037
4041
|
|
|
4038
4042
|
|
|
4039
4043
|
|
|
4044
|
+
/***/ }),
|
|
4045
|
+
|
|
4046
|
+
/***/ 9943:
|
|
4047
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4048
|
+
|
|
4049
|
+
"use strict";
|
|
4050
|
+
__webpack_require__.r(__webpack_exports__);
|
|
4051
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
4052
|
+
/* harmony export */ "ApiUserForOrganization": () => (/* binding */ ApiUserForOrganization),
|
|
4053
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
4054
|
+
/* harmony export */ });
|
|
4055
|
+
var ApiUserForOrganization = /** @class */ (function () {
|
|
4056
|
+
function ApiUserForOrganization(_a) {
|
|
4057
|
+
var _b = _a === void 0 ? {} : _a, name = _b.name, email = _b.email, role = _b.role, projects = _b.projects, accessType = _b.accessType, inviteStatus = _b.inviteStatus, masterformatCodes = _b.masterformatCodes;
|
|
4058
|
+
this.name = name;
|
|
4059
|
+
this.email = email;
|
|
4060
|
+
this.role = role;
|
|
4061
|
+
this.projects = projects;
|
|
4062
|
+
this.accessType = accessType;
|
|
4063
|
+
this.inviteStatus = inviteStatus;
|
|
4064
|
+
this.masterformatCodes = masterformatCodes;
|
|
4065
|
+
}
|
|
4066
|
+
return ApiUserForOrganization;
|
|
4067
|
+
}());
|
|
4068
|
+
|
|
4069
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ApiUserForOrganization);
|
|
4070
|
+
|
|
4071
|
+
|
|
4040
4072
|
/***/ }),
|
|
4041
4073
|
|
|
4042
4074
|
/***/ 3911:
|
|
@@ -5859,6 +5891,7 @@ var map = {
|
|
|
5859
5891
|
"./models/api/api_team_member.ts": 7836,
|
|
5860
5892
|
"./models/api/api_user.ts": 9217,
|
|
5861
5893
|
"./models/api/api_user_action.ts": 121,
|
|
5894
|
+
"./models/api/api_user_for_organization.ts": 9943,
|
|
5862
5895
|
"./models/api/api_user_permission.ts": 3911,
|
|
5863
5896
|
"./models/api/api_view.ts": 3779,
|
|
5864
5897
|
"./models/api/api_work_package.ts": 4113,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import ApiOrganization from "../models/api/api_organization";
|
|
2
2
|
import { User } from "../utilities/get_authorization_headers";
|
|
3
|
+
import ApiUserForOrganization from "../models/api/api_user_for_organization";
|
|
3
4
|
export default class OrganizationApi {
|
|
4
5
|
static listOrganizations(user: User): Promise<ApiOrganization[]>;
|
|
5
6
|
static getOrganization(organizationId: string, user: User): Promise<ApiOrganization>;
|
|
6
7
|
static getOrganizationName(organizationId: string, user: User): Promise<string>;
|
|
8
|
+
static getUsersForOrganization(organizationId: string, user: User): Promise<ApiUserForOrganization[]>;
|
|
7
9
|
static createOrganization(organization: ApiOrganization, user: User): Promise<{
|
|
8
10
|
firebaseId: string;
|
|
9
11
|
}>;
|
|
@@ -13,6 +13,10 @@ export default class OrganizationApi {
|
|
|
13
13
|
let url = `${Http.baseUrl()}/client-accounts/${organizationId}/name`;
|
|
14
14
|
return Http.get(url, user);
|
|
15
15
|
}
|
|
16
|
+
static getUsersForOrganization(organizationId, user) {
|
|
17
|
+
let url = `${Http.baseUrl()}/client-accounts/${organizationId}/users`;
|
|
18
|
+
return Http.get(url, user);
|
|
19
|
+
}
|
|
16
20
|
static createOrganization(organization, user) {
|
|
17
21
|
let url = `${Http.baseUrl()}/client-accounts`;
|
|
18
22
|
return Http.post(url, user, organization);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization_api.js","sourceRoot":"","sources":["../../../source/api/organization_api.ts"],"names":[],"mappings":"AAGA,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"organization_api.js","sourceRoot":"","sources":["../../../source/api/organization_api.ts"],"names":[],"mappings":"AAGA,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAI/D,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC,MAAM,CAAC,iBAAiB,CAAC,IAAU;QACjC,IAAI,GAAG,GAAG,GAAG,IAAI,C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AC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import UserRole from "../enums/user_role";
|
|
2
|
+
export declare class ApiUserForOrganization {
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
role: UserRole;
|
|
6
|
+
projects: string[];
|
|
7
|
+
accessType: string;
|
|
8
|
+
inviteStatus: string;
|
|
9
|
+
masterformatCodes: string[];
|
|
10
|
+
constructor({ name, email, role, projects, accessType, inviteStatus, masterformatCodes }?: Partial<ApiUserForOrganization>);
|
|
11
|
+
}
|
|
12
|
+
export default ApiUserForOrganization;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class ApiUserForOrganization {
|
|
2
|
+
constructor({ name, email, role, projects, accessType, inviteStatus, masterformatCodes } = {}) {
|
|
3
|
+
this.name = name;
|
|
4
|
+
this.email = email;
|
|
5
|
+
this.role = role;
|
|
6
|
+
this.projects = projects;
|
|
7
|
+
this.accessType = accessType;
|
|
8
|
+
this.inviteStatus = inviteStatus;
|
|
9
|
+
this.masterformatCodes = masterformatCodes;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export default ApiUserForOrganization;
|
|
13
|
+
//# sourceMappingURL=api_user_for_organization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api_user_for_organization.js","sourceRoot":"","sources":["../../../../source/models/api/api_user_for_organization.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,sBAAsB;IAS/B,YAAY,EAAC,IAAI,EAAG,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,KAAqC,EAAE;QACzH,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC/C,CAAC;CACJ;AAED,eAAe,sBAAsB,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,6 +3,8 @@ import ApiOrganization from "../models/api/api_organization";
|
|
|
3
3
|
import {User} from "../utilities/get_authorization_headers";
|
|
4
4
|
import Http from "../utilities/http";
|
|
5
5
|
import makeErrorsPretty from "../utilities/make_errors_pretty";
|
|
6
|
+
import {List} from "underscore";
|
|
7
|
+
import ApiUserForOrganization from "../models/api/api_user_for_organization";
|
|
6
8
|
|
|
7
9
|
export default class OrganizationApi {
|
|
8
10
|
static listOrganizations(user: User): Promise<ApiOrganization[]> {
|
|
@@ -20,6 +22,11 @@ export default class OrganizationApi {
|
|
|
20
22
|
return Http.get(url, user);
|
|
21
23
|
}
|
|
22
24
|
|
|
25
|
+
static getUsersForOrganization(organizationId: string, user: User):Promise<ApiUserForOrganization[]> {
|
|
26
|
+
let url = `${Http.baseUrl()}/client-accounts/${organizationId}/users`;
|
|
27
|
+
return Http.get(url, user);
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
static createOrganization(organization: ApiOrganization, user: User): Promise<{ firebaseId: string }> {
|
|
24
31
|
let url = `${Http.baseUrl()}/client-accounts`;
|
|
25
32
|
return Http.post(url, user, organization);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import UserRole from "../enums/user_role";
|
|
2
|
+
import {List} from "underscore";
|
|
3
|
+
|
|
4
|
+
export class ApiUserForOrganization {
|
|
5
|
+
name: string
|
|
6
|
+
email: string
|
|
7
|
+
role: UserRole
|
|
8
|
+
projects: string[]
|
|
9
|
+
accessType: string
|
|
10
|
+
inviteStatus: string
|
|
11
|
+
masterformatCodes: string[]
|
|
12
|
+
|
|
13
|
+
constructor({name, email, role, projects, accessType, inviteStatus, masterformatCodes}: Partial<ApiUserForOrganization> = {}) {
|
|
14
|
+
this.name = name;
|
|
15
|
+
this.email = email;
|
|
16
|
+
this.role = role;
|
|
17
|
+
this.projects = projects;
|
|
18
|
+
this.accessType = accessType;
|
|
19
|
+
this.inviteStatus = inviteStatus;
|
|
20
|
+
this.masterformatCodes = masterformatCodes;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default ApiUserForOrganization;
|