avvir 0.3.35 → 0.3.37
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 +14 -13
- package/dist/esm/config.js +2 -2
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/converters/purpose_type_converter.js +2 -2
- package/dist/esm/converters/purpose_type_converter.js.map +1 -1
- package/dist/esm/mixins/add_logging_to_instance_methods.d.ts +1 -1
- package/dist/esm/mixins/add_logging_to_instance_methods.js +3 -4
- package/dist/esm/mixins/add_logging_to_instance_methods.js.map +1 -1
- package/dist/esm/models/api/api_user_for_organization.d.ts +3 -1
- package/dist/esm/models/api/api_user_for_organization.js +3 -1
- package/dist/esm/models/api/api_user_for_organization.js.map +1 -1
- package/dist/esm/package.json +3 -0
- package/dist/esm/utilities/make_errors_pretty.js +3 -3
- package/dist/esm/utilities/make_errors_pretty.js.map +1 -1
- package/package.json +9 -2
- package/source/config.ts +2 -2
- package/source/converters/purpose_type_converter.ts +2 -2
- package/source/mixins/add_logging_to_instance_methods.ts +3 -5
- package/source/models/api/api_user_for_organization.ts +5 -1
- package/source/utilities/make_errors_pretty.ts +3 -3
package/dist/avvir_api.node.js
CHANGED
|
@@ -1539,10 +1539,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1539
1539
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1540
1540
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
1541
1541
|
/* harmony export */ });
|
|
1542
|
-
var
|
|
1542
|
+
/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2681);
|
|
1543
|
+
/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(underscore__WEBPACK_IMPORTED_MODULE_0__);
|
|
1544
|
+
|
|
1543
1545
|
var configuration = { logFetch: false };
|
|
1544
1546
|
var addEnvironmentVariablesToConfiguration = function () {
|
|
1545
|
-
|
|
1547
|
+
(0,underscore__WEBPACK_IMPORTED_MODULE_0__.forEach)(configuration, function (value, varName) {
|
|
1546
1548
|
var envValue = process.env[varName];
|
|
1547
1549
|
if (envValue && envValue != "") {
|
|
1548
1550
|
configuration[varName] = envValue;
|
|
@@ -2042,7 +2044,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2042
2044
|
|
|
2043
2045
|
|
|
2044
2046
|
|
|
2045
|
-
var apiPurposeTypeByPurposeType =
|
|
2047
|
+
var apiPurposeTypeByPurposeType = (0,underscore__WEBPACK_IMPORTED_MODULE_0__.invert)(_models_enums_purpose_type__WEBPACK_IMPORTED_MODULE_1__["default"]);
|
|
2046
2048
|
var purposeTypeByApiPurposeType = _models_enums_purpose_type__WEBPACK_IMPORTED_MODULE_1__["default"];
|
|
2047
2049
|
var PurposeTypeConverter = /** @class */ (function () {
|
|
2048
2050
|
function PurposeTypeConverter() {
|
|
@@ -2294,8 +2296,7 @@ function addInstantGetterAndSetterToApiModel(modelInstance, propertyName, initia
|
|
|
2294
2296
|
"use strict";
|
|
2295
2297
|
__webpack_require__.r(__webpack_exports__);
|
|
2296
2298
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2297
|
-
/* harmony export */ "addLoggingToInstanceMethods": () => (/* binding */ addLoggingToInstanceMethods)
|
|
2298
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
2299
|
+
/* harmony export */ "addLoggingToInstanceMethods": () => (/* binding */ addLoggingToInstanceMethods)
|
|
2299
2300
|
/* harmony export */ });
|
|
2300
2301
|
/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2681);
|
|
2301
2302
|
/* harmony import */ var underscore__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(underscore__WEBPACK_IMPORTED_MODULE_0__);
|
|
@@ -2326,10 +2327,9 @@ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from
|
|
|
2326
2327
|
};
|
|
2327
2328
|
|
|
2328
2329
|
function addLoggingToInstanceMethods(instance, instanceName, ignoredMethods) {
|
|
2329
|
-
var
|
|
2330
|
-
var instanceMethods = underscore__WEBPACK_IMPORTED_MODULE_0___default().methods(instance);
|
|
2330
|
+
var instanceMethods = (0,underscore__WEBPACK_IMPORTED_MODULE_0__.methods)(instance);
|
|
2331
2331
|
if (ignoredMethods) {
|
|
2332
|
-
instanceMethods =
|
|
2332
|
+
instanceMethods = underscore__WEBPACK_IMPORTED_MODULE_0__.without.apply(void 0, __spreadArray([instanceMethods], __read(ignoredMethods), false));
|
|
2333
2333
|
}
|
|
2334
2334
|
instanceMethods.forEach(function (methodName) {
|
|
2335
2335
|
if (!ignoredMethods.includes(methodName)) {
|
|
@@ -2352,7 +2352,6 @@ function addLoggingToInstanceMethods(instance, instanceName, ignoredMethods) {
|
|
|
2352
2352
|
}
|
|
2353
2353
|
});
|
|
2354
2354
|
}
|
|
2355
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addLoggingToInstanceMethods);
|
|
2356
2355
|
|
|
2357
2356
|
|
|
2358
2357
|
/***/ }),
|
|
@@ -4303,7 +4302,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4303
4302
|
/* harmony export */ });
|
|
4304
4303
|
var ApiUserForOrganization = /** @class */ (function () {
|
|
4305
4304
|
function ApiUserForOrganization(_a) {
|
|
4306
|
-
var _b = _a === void 0 ? {} : _a, id = _b.id, name = _b.name, email = _b.email, role = _b.role, projects = _b.projects, accessType = _b.accessType, inviteStatus = _b.inviteStatus, masterformatCodes = _b.masterformatCodes, latestInvitationExpiry = _b.latestInvitationExpiry;
|
|
4305
|
+
var _b = _a === void 0 ? {} : _a, id = _b.id, name = _b.name, email = _b.email, role = _b.role, projects = _b.projects, accessType = _b.accessType, inviteStatus = _b.inviteStatus, masterformatCodes = _b.masterformatCodes, latestInvitationExpiry = _b.latestInvitationExpiry, accountCreationTime = _b.accountCreationTime, accountAcceptedTime = _b.accountAcceptedTime;
|
|
4307
4306
|
this.id = id;
|
|
4308
4307
|
this.name = name;
|
|
4309
4308
|
this.email = email;
|
|
@@ -4313,6 +4312,8 @@ var ApiUserForOrganization = /** @class */ (function () {
|
|
|
4313
4312
|
this.inviteStatus = inviteStatus;
|
|
4314
4313
|
this.masterformatCodes = masterformatCodes;
|
|
4315
4314
|
this.latestInvitationExpiry = latestInvitationExpiry;
|
|
4315
|
+
this.accountCreationTime = accountCreationTime;
|
|
4316
|
+
this.accountAcceptedTime = accountAcceptedTime;
|
|
4316
4317
|
}
|
|
4317
4318
|
return ApiUserForOrganization;
|
|
4318
4319
|
}());
|
|
@@ -5962,12 +5963,12 @@ var makeErrorsPrettyForFunction = function (actionName, action, displayErrorMess
|
|
|
5962
5963
|
var getFunctionNames = function (clazz) {
|
|
5963
5964
|
var builtinProperties = ["length", "constructor", "name", "prototype"];
|
|
5964
5965
|
// TODO it might make sense to check the type of each property
|
|
5965
|
-
return
|
|
5966
|
+
return underscore__WEBPACK_IMPORTED_MODULE_0__.without.apply(void 0, __spreadArray([Object.getOwnPropertyNames(clazz)], __read(builtinProperties), false));
|
|
5966
5967
|
};
|
|
5967
5968
|
var makeErrorsPretty = function (apiClass, options) {
|
|
5968
5969
|
if (options === void 0) { options = { exclude: [], overrideErrorMessage: [] }; }
|
|
5969
5970
|
var functionNames = getFunctionNames(apiClass);
|
|
5970
|
-
|
|
5971
|
+
(0,underscore__WEBPACK_IMPORTED_MODULE_0__.forEach)(functionNames, function (functionName) {
|
|
5971
5972
|
var isExcluded = options.exclude && options.exclude.includes(functionName);
|
|
5972
5973
|
var displayErrorMessage = !options.overrideErrorMessage || !options.overrideErrorMessage.includes(functionName);
|
|
5973
5974
|
if (!isExcluded) {
|
|
@@ -6360,7 +6361,7 @@ function importAll(directoryContext, target) {
|
|
|
6360
6361
|
directoryContext.keys().forEach(filePath => {
|
|
6361
6362
|
|
|
6362
6363
|
let moduleExports = directoryContext(filePath);
|
|
6363
|
-
|
|
6364
|
+
(0,underscore__WEBPACK_IMPORTED_MODULE_1__.forEach)(moduleExports, (moduleExport, exportName) => {
|
|
6364
6365
|
// if (exportName !== 'default') {
|
|
6365
6366
|
target[exportName] = moduleExport;
|
|
6366
6367
|
// }
|
package/dist/esm/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { forEach } from "underscore";
|
|
2
2
|
let configuration = { logFetch: false };
|
|
3
3
|
const addEnvironmentVariablesToConfiguration = () => {
|
|
4
|
-
|
|
4
|
+
forEach(configuration, (value, varName) => {
|
|
5
5
|
const envValue = process.env[varName];
|
|
6
6
|
if (envValue && envValue != "") {
|
|
7
7
|
configuration[varName] = envValue;
|
package/dist/esm/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../source/config.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../source/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AAEnC,IAAI,aAAa,GAAyB,EAAC,QAAQ,EAAE,KAAK,EAAC,CAAC;AAE5D,MAAM,sCAAsC,GAAG,GAAG,EAAE;IAClD,OAAO,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,QAAQ,IAAI,QAAQ,IAAI,EAAE,EAAE;YAC9B,aAAa,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC;SACnC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAA;AAED,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,aAAa,GAAG;QACd,iBAAiB,EAAE,yBAAyB;QAC5C,iBAAiB,EAAE,IAAI;KACxB,CAAA;IACD,sCAAsC,EAAE,CAAA;AAC1C,CAAC,CAAA;AAED,MAAM,0BAA0B,GAAG,GAAG,EAAE;IACtC,aAAa,GAAG;QACd,iBAAiB,EAAE,iCAAiC;QACpD,iBAAiB,EAAE,YAAY;KAChC,CAAA;IACD,sCAAsC,EAAE,CAAA;AAC1C,CAAC,CAAA;AAED,MAAM,0BAA0B,GAAG,GAAG,EAAE;IACtC,aAAa,GAAG;QACd,iBAAiB,EAAE,sBAAsB;QACzC,iBAAiB,EAAE,YAAY;KAChC,CAAA;IACD,sCAAsC,EAAE,CAAA;AAC1C,CAAC,CAAA;AAED,MAAM,+BAA+B,GAAG,GAAG,EAAE;IAC3C,aAAa,GAAG;QACd,iBAAiB,EAAE,sBAAsB;QACzC,iBAAiB,EAAE,kBAAkB;KACtC,CAAA;IACD,sCAAsC,EAAE,CAAA;AAC1C,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACjC,sCAAsC,EAAE,CAAA;IACxC,aAAa,GAAG;QACd,iBAAiB,EAAE,uBAAuB;QAC1C,iBAAiB,EAAE,OAAO;KAC3B,CAAA;AACH,CAAC,CAAA;AAED,MAAM,uCAAuC,GAAG,GAAG,EAAE;IACnD,8BAA8B,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAChE,CAAC,CAAA;AAED,MAAM,8BAA8B,GAAG,CAAC,GAAG,EAAE,EAAE;IAC7C,IAAG,GAAG,KAAK,YAAY,EAAC;QACtB,0BAA0B,EAAE,CAAA;KAC7B;SAAM,IAAG,GAAG,KAAK,kBAAkB,EAAC;QACnC,+BAA+B,EAAE,CAAA;KAClC;SAAM,IAAG,GAAG,KAAK,OAAO,EAAC;QACxB,qBAAqB,EAAE,CAAA;KACxB;SAAM,IAAG,GAAG,KAAI,IAAI,EAAE;QACrB,kBAAkB,EAAE,CAAA;KACrB;SAAM;QACL,0BAA0B,EAAE,CAAA;KAC7B;AACH,CAAC,CAAA;AAED,uCAAuC,EAAE,CAAA;AAEzC,MAAM,kBAAkB,GAAG,CAAC,EAAC,KAAK,EAAM,EAAE,EAAE;IAC1C,MAAM,KAAK,CAAC;AACd,CAAC,CAAA;AAED,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AAED,MAAM,MAAM,GAAG;IACb,0BAA0B;IAC1B,0BAA0B;IAC1B,kBAAkB;IAClB,+BAA+B;IAC/B,qBAAqB;IACrB,gBAAgB;IAChB,kBAAkB;IAClB,8BAA8B;IAC9B,uCAAuC;CACxC,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// noinspection JSDeprecatedSymbols
|
|
2
|
-
import
|
|
2
|
+
import { invert } from "underscore";
|
|
3
3
|
import PurposeType from "../models/enums/purpose_type";
|
|
4
4
|
import { isApiPurposeType } from "../models";
|
|
5
|
-
const apiPurposeTypeByPurposeType =
|
|
5
|
+
const apiPurposeTypeByPurposeType = invert(PurposeType);
|
|
6
6
|
const purposeTypeByApiPurposeType = PurposeType;
|
|
7
7
|
export class PurposeTypeConverter {
|
|
8
8
|
static toApiPurposeType(fileKey) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purpose_type_converter.js","sourceRoot":"","sources":["../../../source/converters/purpose_type_converter.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC,OAAO,
|
|
1
|
+
{"version":3,"file":"purpose_type_converter.js","sourceRoot":"","sources":["../../../source/converters/purpose_type_converter.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC,OAAO,EAAC,MAAM,EAAC,MAAM,YAAY,CAAC;AAClC,OAAO,WAA+C,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAiB,gBAAgB,EAAC,MAAM,WAAW,CAAC;AAE3D,MAAM,2BAA2B,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAExD,MAAM,2BAA2B,GAAG,WAAW,CAAC;AAEhD,MAAM,OAAO,oBAAoB;IAC/B,MAAM,CAAC,gBAAgB,CAAC,OAA2C;QACjE,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE;YAC7B,OAAO,OAAO,CAAC;SAChB;QACD,OAAO,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,cAA8B;QACjD,OAAO,2BAA2B,CAAC,cAAc,CAAC,CAAC;IACrD,CAAC;CACF;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -2,4 +2,4 @@ declare type Methods<Object, K extends keyof Object = keyof Object> = Object[K]
|
|
|
2
2
|
export declare function addLoggingToInstanceMethods<Instance extends {
|
|
3
3
|
[key: string]: ((_: any) => any) | any;
|
|
4
4
|
}>(instance: Instance, instanceName: string, ignoredMethods?: Methods<Instance>[]): void;
|
|
5
|
-
export
|
|
5
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { methods, without } from "underscore";
|
|
2
2
|
export function addLoggingToInstanceMethods(instance, instanceName, ignoredMethods) {
|
|
3
|
-
let instanceMethods =
|
|
3
|
+
let instanceMethods = methods(instance);
|
|
4
4
|
if (ignoredMethods) {
|
|
5
|
-
instanceMethods =
|
|
5
|
+
instanceMethods = without(instanceMethods, ...ignoredMethods);
|
|
6
6
|
}
|
|
7
7
|
instanceMethods.forEach((methodName) => {
|
|
8
8
|
if (!ignoredMethods.includes(methodName)) {
|
|
@@ -21,5 +21,4 @@ export function addLoggingToInstanceMethods(instance, instanceName, ignoredMetho
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
export default addLoggingToInstanceMethods;
|
|
25
24
|
//# sourceMappingURL=add_logging_to_instance_methods.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add_logging_to_instance_methods.js","sourceRoot":"","sources":["../../../source/mixins/add_logging_to_instance_methods.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"add_logging_to_instance_methods.js","sourceRoot":"","sources":["../../../source/mixins/add_logging_to_instance_methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AAG5C,MAAM,UAAU,2BAA2B,CAA8D,QAAkB,EAAE,YAAoB,EAAE,cAAoC;IACrL,IAAI,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACxC,IAAI,cAAc,EAAE;QAClB,eAAe,GAAG,OAAO,CAAC,eAAe,EAAE,GAAG,cAAc,CAAC,CAAC;KAC/D;IACD,eAAe,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;QACrC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;YACxC,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;YACzE,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,YAAY,EAAE;gBAC1C,MAAM,cAAc,GAAa,QAAQ,CAAC,UAAU,CAAC,CAAC;gBACtD,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,UAAU,EAAE;oBAC1C,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE;wBACjB,OAAO,CAAC,GAAG,CAAC,WAAW,YAAY,IAAI,UAAU,IAAI,IAAI,GAAG,CAAC,CAAC;wBAC9D,OAAO,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC;oBAChD,CAAC;oBACD,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,KAAK;iBACpB,CAAC,CAAC;aACJ;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -10,6 +10,8 @@ export declare class ApiUserForOrganization {
|
|
|
10
10
|
inviteStatus: string;
|
|
11
11
|
masterformatCodes: string[];
|
|
12
12
|
latestInvitationExpiry: DateLike;
|
|
13
|
-
|
|
13
|
+
accountCreationTime: DateLike;
|
|
14
|
+
accountAcceptedTime: DateLike;
|
|
15
|
+
constructor({ id, name, email, role, projects, accessType, inviteStatus, masterformatCodes, latestInvitationExpiry, accountCreationTime, accountAcceptedTime }?: Partial<ApiUserForOrganization>);
|
|
14
16
|
}
|
|
15
17
|
export default ApiUserForOrganization;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export class ApiUserForOrganization {
|
|
2
|
-
constructor({ id, name, email, role, projects, accessType, inviteStatus, masterformatCodes, latestInvitationExpiry } = {}) {
|
|
2
|
+
constructor({ id, name, email, role, projects, accessType, inviteStatus, masterformatCodes, latestInvitationExpiry, accountCreationTime, accountAcceptedTime } = {}) {
|
|
3
3
|
this.id = id;
|
|
4
4
|
this.name = name;
|
|
5
5
|
this.email = email;
|
|
@@ -9,6 +9,8 @@ export class ApiUserForOrganization {
|
|
|
9
9
|
this.inviteStatus = inviteStatus;
|
|
10
10
|
this.masterformatCodes = masterformatCodes;
|
|
11
11
|
this.latestInvitationExpiry = latestInvitationExpiry;
|
|
12
|
+
this.accountCreationTime = accountCreationTime;
|
|
13
|
+
this.accountAcceptedTime = accountAcceptedTime;
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
16
|
export default ApiUserForOrganization;
|
|
@@ -1 +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;
|
|
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;IAa/B,YAAY,EAAC,EAAE,EAAE,IAAI,EAAG,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,mBAAmB,KAAqC,EAAE;QAC/L,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,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;QAC3C,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;QACrD,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;QAC/C,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACnD,CAAC;CACJ;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forEach, without } from "underscore";
|
|
2
2
|
import checkFetchStatus from "./check_fetch_status";
|
|
3
3
|
import Config from "../config";
|
|
4
4
|
const makeErrorsPrettyForFunction = (actionName, action, displayErrorMessage) => {
|
|
@@ -17,11 +17,11 @@ const makeErrorsPrettyForFunction = (actionName, action, displayErrorMessage) =>
|
|
|
17
17
|
const getFunctionNames = (clazz) => {
|
|
18
18
|
let builtinProperties = ["length", "constructor", "name", "prototype"];
|
|
19
19
|
// TODO it might make sense to check the type of each property
|
|
20
|
-
return
|
|
20
|
+
return without(Object.getOwnPropertyNames(clazz), ...builtinProperties);
|
|
21
21
|
};
|
|
22
22
|
const makeErrorsPretty = (apiClass, options = { exclude: [], overrideErrorMessage: [] }) => {
|
|
23
23
|
let functionNames = getFunctionNames(apiClass);
|
|
24
|
-
|
|
24
|
+
forEach(functionNames, (functionName) => {
|
|
25
25
|
let isExcluded = options.exclude && options.exclude.includes(functionName);
|
|
26
26
|
let displayErrorMessage = !options.overrideErrorMessage || !options.overrideErrorMessage.includes(functionName);
|
|
27
27
|
if (!isExcluded) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make_errors_pretty.js","sourceRoot":"","sources":["../../../source/utilities/make_errors_pretty.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"make_errors_pretty.js","sourceRoot":"","sources":["../../../source/utilities/make_errors_pretty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AAC5C,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,MAAM,2BAA2B,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE;IAC9E,OAAO,CAAC,GAAG,YAAY,EAAE,EAAE;QACzB,OAAO,MAAM,CAAC,GAAG,YAAY,CAAC;aAC3B,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;aACnE,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,OAAO,MAAM,CAAC,kBAAkB,CAAC;gBAC/B,KAAK;gBACL,MAAM,EAAE,UAAU;gBAClB,SAAS,EAAE,YAAY;aACxB,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IAEN,CAAC,CAAA;AACH,CAAC,CAAA;AACD,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,EAAE;IACjC,IAAI,iBAAiB,GAAG,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IACvE,8DAA8D;IAC9D,OAAO,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,GAAG,iBAAiB,CAAC,CAAA;AACzE,CAAC,CAAA;AAED,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,OAAO,GAAG,EAAC,OAAO,EAAE,EAAE,EAAE,oBAAoB,EAAE,EAAE,EAAC,EAAE,EAAE;IACvF,IAAI,aAAa,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC/C,OAAO,CAAC,aAAa,EAAE,CAAC,YAAY,EAAE,EAAE;QACtC,IAAI,UAAU,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAC3E,IAAI,mBAAmB,GAAG,CAAC,OAAO,CAAC,oBAAoB,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAChH,IAAI,CAAC,UAAU,EAAE;YACf,QAAQ,CAAC,YAAY,CAAC,GAAG,2BAA2B,CAAC,YAAY,EAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CAAC,CAAC;SACjH;IACH,CAAC,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA;AAED,eAAe,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "avvir",
|
|
3
3
|
"repository": "git@github.com:Avvir/avvir-javascript-client.git",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.37",
|
|
5
5
|
"description": "Javascript client for Avvir APIs",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"module": "dist/esm/index.js",
|
|
8
8
|
"types": "dist/esm/index.d.ts",
|
|
9
9
|
"main": "dist/avvir_api.node.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
"import": "./dist/esm/index.js",
|
|
12
|
+
"default": "./dist/esm/index.js",
|
|
13
|
+
"node": "./dist/avvir_api.node.js"
|
|
14
|
+
},
|
|
10
15
|
"files": [
|
|
11
16
|
"dist/*",
|
|
12
17
|
"dist/**",
|
|
@@ -19,9 +24,10 @@
|
|
|
19
24
|
"Firefox ESR"
|
|
20
25
|
],
|
|
21
26
|
"scripts": {
|
|
22
|
-
"build": "yarn build-esm && yarn build-web",
|
|
27
|
+
"build": "yarn build-esm && yarn build-web && yarn copy-dist-files",
|
|
23
28
|
"build-esm": "tsc --project tsconfig.esm.json",
|
|
24
29
|
"build-web": "yarn run webpack",
|
|
30
|
+
"copy-dist-files": "copyfiles --error -u 1 \"dist_files/**/*\" dist",
|
|
25
31
|
"clean": "rimraf ./dist",
|
|
26
32
|
"prepublishOnly": "yarn rebuild",
|
|
27
33
|
"rebuild": "yarn clean && yarn build",
|
|
@@ -49,6 +55,7 @@
|
|
|
49
55
|
"chai-roughly": "^1.0.0",
|
|
50
56
|
"chai-spies": "^1.0.0",
|
|
51
57
|
"chai-things": "^0.2.0",
|
|
58
|
+
"copyfiles": "^2.4.1",
|
|
52
59
|
"deepmerge": "^4.2.2",
|
|
53
60
|
"fetch-mock": "^9.11.0",
|
|
54
61
|
"mocha": "^8.2.1",
|
package/source/config.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import {forEach} from "underscore";
|
|
2
2
|
|
|
3
3
|
let configuration: {[key: string]: any} = {logFetch: false};
|
|
4
4
|
|
|
5
5
|
const addEnvironmentVariablesToConfiguration = () => {
|
|
6
|
-
|
|
6
|
+
forEach(configuration, (value, varName) => {
|
|
7
7
|
const envValue = process.env[varName];
|
|
8
8
|
if (envValue && envValue != "") {
|
|
9
9
|
configuration[varName] = envValue;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// noinspection JSDeprecatedSymbols
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import {invert} from "underscore";
|
|
4
4
|
import PurposeType, {PurposeType as PurposeTypeString} from "../models/enums/purpose_type";
|
|
5
5
|
import {ApiPurposeType, isApiPurposeType} from "../models";
|
|
6
6
|
|
|
7
|
-
const apiPurposeTypeByPurposeType =
|
|
7
|
+
const apiPurposeTypeByPurposeType = invert(PurposeType);
|
|
8
8
|
|
|
9
9
|
const purposeTypeByApiPurposeType = PurposeType;
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {methods, without} from "underscore";
|
|
2
2
|
|
|
3
3
|
type Methods<Object, K extends keyof Object = keyof Object> = Object[K] extends Function ? K : never
|
|
4
4
|
export function addLoggingToInstanceMethods<Instance extends { [key: string]: ((_: any) => any) | any }>(instance: Instance, instanceName: string, ignoredMethods?: Methods<Instance>[]) {
|
|
5
|
-
let instanceMethods =
|
|
5
|
+
let instanceMethods = methods(instance);
|
|
6
6
|
if (ignoredMethods) {
|
|
7
|
-
instanceMethods =
|
|
7
|
+
instanceMethods = without(instanceMethods, ...ignoredMethods);
|
|
8
8
|
}
|
|
9
9
|
instanceMethods.forEach((methodName) => {
|
|
10
10
|
if (!ignoredMethods.includes(methodName)) {
|
|
@@ -23,5 +23,3 @@ export function addLoggingToInstanceMethods<Instance extends { [key: string]: ((
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
export default addLoggingToInstanceMethods;
|
|
@@ -11,8 +11,10 @@ export class ApiUserForOrganization {
|
|
|
11
11
|
inviteStatus: string
|
|
12
12
|
masterformatCodes: string[]
|
|
13
13
|
latestInvitationExpiry: DateLike
|
|
14
|
+
accountCreationTime: DateLike
|
|
15
|
+
accountAcceptedTime: DateLike
|
|
14
16
|
|
|
15
|
-
constructor({id, name, email, role, projects, accessType, inviteStatus, masterformatCodes, latestInvitationExpiry}: Partial<ApiUserForOrganization> = {}) {
|
|
17
|
+
constructor({id, name, email, role, projects, accessType, inviteStatus, masterformatCodes, latestInvitationExpiry, accountCreationTime, accountAcceptedTime}: Partial<ApiUserForOrganization> = {}) {
|
|
16
18
|
this.id = id;
|
|
17
19
|
this.name = name;
|
|
18
20
|
this.email = email;
|
|
@@ -22,6 +24,8 @@ export class ApiUserForOrganization {
|
|
|
22
24
|
this.inviteStatus = inviteStatus;
|
|
23
25
|
this.masterformatCodes = masterformatCodes;
|
|
24
26
|
this.latestInvitationExpiry = latestInvitationExpiry;
|
|
27
|
+
this.accountCreationTime = accountCreationTime;
|
|
28
|
+
this.accountAcceptedTime = accountAcceptedTime;
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {forEach, without} from "underscore";
|
|
2
2
|
import checkFetchStatus from "./check_fetch_status";
|
|
3
3
|
import Config from "../config";
|
|
4
4
|
|
|
@@ -19,12 +19,12 @@ const makeErrorsPrettyForFunction = (actionName, action, displayErrorMessage) =>
|
|
|
19
19
|
const getFunctionNames = (clazz) => {
|
|
20
20
|
let builtinProperties = ["length", "constructor", "name", "prototype"];
|
|
21
21
|
// TODO it might make sense to check the type of each property
|
|
22
|
-
return
|
|
22
|
+
return without(Object.getOwnPropertyNames(clazz), ...builtinProperties)
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
const makeErrorsPretty = (apiClass, options = {exclude: [], overrideErrorMessage: []}) => {
|
|
26
26
|
let functionNames = getFunctionNames(apiClass);
|
|
27
|
-
|
|
27
|
+
forEach(functionNames, (functionName) => {
|
|
28
28
|
let isExcluded = options.exclude && options.exclude.includes(functionName);
|
|
29
29
|
let displayErrorMessage = !options.overrideErrorMessage || !options.overrideErrorMessage.includes(functionName);
|
|
30
30
|
if (!isExcluded) {
|