@aneuhold/core-ts-lib 1.0.14 → 1.0.16
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/lib/index.d.ts +5 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -2
- package/lib/services/DOFunctionService/DOAuthCheckPassword.d.ts +1 -0
- package/lib/services/DOFunctionService/DOAuthCheckPassword.d.ts.map +1 -0
- package/lib/services/DOFunctionService/DOAuthCheckPassword.js +1 -0
- package/lib/services/DOFunctionService/DOFunctionService.d.ts +46 -0
- package/lib/services/DOFunctionService/DOFunctionService.d.ts.map +1 -0
- package/lib/services/DOFunctionService/DOFunctionService.js +19 -0
- package/lib/services/DOFunctionService/functions/DOAuthCheckPassword.d.ts +1 -0
- package/lib/services/DOFunctionService/functions/DOAuthCheckPassword.d.ts.map +1 -0
- package/lib/services/DOFunctionService/functions/DOAuthCheckPassword.js +1 -0
- package/lib/services/DOFunctionService/functions/authCheckPassword.d.ts +1 -0
- package/lib/services/DOFunctionService/functions/authCheckPassword.d.ts.map +1 -0
- package/lib/services/DOFunctionService/functions/authCheckPassword.js +1 -0
- package/lib/services/DOFunctionService/functionsInfo/authCheckPassword.d.ts +11 -0
- package/lib/services/DOFunctionService/functionsInfo/authCheckPassword.d.ts.map +1 -0
- package/lib/services/DOFunctionService/functionsInfo/authCheckPassword.js +21 -0
- package/lib/services/DOFunctionService.d.ts +27 -1
- package/lib/services/DOFunctionService.d.ts.map +1 -1
- package/lib/services/DOFunctionService.js +23 -1
- package/lib/services/DependencyService.d.ts +13 -0
- package/lib/services/DependencyService.d.ts.map +1 -0
- package/lib/services/DependencyService.js +65 -0
- package/package.json +4 -1
package/lib/index.d.ts
CHANGED
|
@@ -6,9 +6,12 @@ import FileSystemService from './services/applications/FileSystemService/FileSys
|
|
|
6
6
|
import ITermService from './services/applications/ITermService';
|
|
7
7
|
import CLIService from './services/CLIService';
|
|
8
8
|
import ConfigService from './services/ConfigService/ConfigService';
|
|
9
|
-
import
|
|
9
|
+
import DependencyService from './services/DependencyService';
|
|
10
|
+
import DOFunctionService, { DOFunction } from './services/DOFunctionService/DOFunctionService';
|
|
11
|
+
import { DOAuthCheckPasswordInput, DOAuthCheckPasswordOutput, DOAuthCheckPasswordRawOutput } from './services/DOFunctionService/functionsInfo/authCheckPassword';
|
|
10
12
|
import StringService from './services/StringService';
|
|
11
13
|
import CurrentEnv, { OperatingSystemType, ShellType, TerminalType } from './utils/CurrentEnv';
|
|
12
14
|
import Logger from './utils/Logger';
|
|
13
|
-
export { CLIService, StringService, CurrentEnv, ChromeService, DockerService, FileSystemService, sleep, OperatingSystemType, ShellType, Logger, TerminalType, datesAreOnSameDay, ITermService, ConfigService, DOFunctionService };
|
|
15
|
+
export { CLIService, StringService, CurrentEnv, ChromeService, DockerService, FileSystemService, sleep, OperatingSystemType, ShellType, Logger, TerminalType, datesAreOnSameDay, ITermService, ConfigService, DOFunctionService, DependencyService };
|
|
16
|
+
export type { DOAuthCheckPasswordRawOutput, DOAuthCheckPasswordInput, DOAuthCheckPasswordOutput, DOFunction };
|
|
14
17
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,MAAM,yBAAyB,CAAC;AAC5C,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAClE,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAClE,OAAO,iBAAiB,MAAM,6DAA6D,CAAC;AAC5F,OAAO,YAAY,MAAM,sCAAsC,CAAC;AAChE,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,aAAa,MAAM,wCAAwC,CAAC;AACnE,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,UAAU,EAAE,EACjB,mBAAmB,EACnB,SAAS,EACT,YAAY,EACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAGpC,OAAO,EACL,UAAU,EACV,aAAa,EACb,UAAU,EACV,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,KAAK,EACL,mBAAmB,EACnB,SAAS,EACT,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,iBAAiB,EAClB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,MAAM,yBAAyB,CAAC;AAC5C,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAClE,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAClE,OAAO,iBAAiB,MAAM,6DAA6D,CAAC;AAC5F,OAAO,YAAY,MAAM,sCAAsC,CAAC;AAChE,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,aAAa,MAAM,wCAAwC,CAAC;AACnE,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,iBAAiB,EAAE,EACxB,UAAU,EACX,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,EAC7B,MAAM,8DAA8D,CAAC;AACtE,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,UAAU,EAAE,EACjB,mBAAmB,EACnB,SAAS,EACT,YAAY,EACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAGpC,OAAO,EACL,UAAU,EACV,aAAa,EACb,UAAU,EACV,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,KAAK,EACL,mBAAmB,EACnB,SAAS,EACT,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EAClB,CAAC;AAGF,YAAY,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EACzB,UAAU,EACX,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.DOFunctionService = exports.ConfigService = exports.ITermService = exports.datesAreOnSameDay = exports.TerminalType = exports.Logger = exports.ShellType = exports.OperatingSystemType = exports.sleep = exports.FileSystemService = exports.DockerService = exports.ChromeService = exports.CurrentEnv = exports.StringService = exports.CLIService = void 0;
|
|
29
|
+
exports.DependencyService = exports.DOFunctionService = exports.ConfigService = exports.ITermService = exports.datesAreOnSameDay = exports.TerminalType = exports.Logger = exports.ShellType = exports.OperatingSystemType = exports.sleep = exports.FileSystemService = exports.DockerService = exports.ChromeService = exports.CurrentEnv = exports.StringService = exports.CLIService = void 0;
|
|
30
30
|
const dateFunctions_1 = __importDefault(require("./helperFunctions/dateFunctions"));
|
|
31
31
|
exports.datesAreOnSameDay = dateFunctions_1.default;
|
|
32
32
|
const sleep_1 = __importDefault(require("./helperFunctions/sleep"));
|
|
@@ -43,7 +43,9 @@ const CLIService_1 = __importDefault(require("./services/CLIService"));
|
|
|
43
43
|
exports.CLIService = CLIService_1.default;
|
|
44
44
|
const ConfigService_1 = __importDefault(require("./services/ConfigService/ConfigService"));
|
|
45
45
|
exports.ConfigService = ConfigService_1.default;
|
|
46
|
-
const
|
|
46
|
+
const DependencyService_1 = __importDefault(require("./services/DependencyService"));
|
|
47
|
+
exports.DependencyService = DependencyService_1.default;
|
|
48
|
+
const DOFunctionService_1 = __importDefault(require("./services/DOFunctionService/DOFunctionService"));
|
|
47
49
|
exports.DOFunctionService = DOFunctionService_1.default;
|
|
48
50
|
const StringService_1 = __importDefault(require("./services/StringService"));
|
|
49
51
|
exports.StringService = StringService_1.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=DOAuthCheckPassword.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DOAuthCheckPassword.d.ts","sourceRoot":"","sources":["../../../src/services/DOFunctionService/DOAuthCheckPassword.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Raw output from a Digital Ocean function must always be an object with
|
|
3
|
+
* a body property. The body property must also be an object.
|
|
4
|
+
*/
|
|
5
|
+
export type DOFunctionRawOutput<TOutput extends object> = {
|
|
6
|
+
/**
|
|
7
|
+
* The body is an object, which means it will automatically be serialized to
|
|
8
|
+
* JSON and the Content-Type header will be set to application/json.
|
|
9
|
+
*/
|
|
10
|
+
body: DOFunctionOutput<TOutput>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The output from a Digital Ocean function must always be an object. This
|
|
14
|
+
* is the data that actually matters and doesn't require parsing the `body`
|
|
15
|
+
* property.
|
|
16
|
+
*/
|
|
17
|
+
export type DOFunctionOutput<TOutput extends object> = TOutput;
|
|
18
|
+
/**
|
|
19
|
+
* The input to a Digital Ocean function must always be an object.
|
|
20
|
+
*/
|
|
21
|
+
export type DOFunctionInput<TInput extends object> = TInput;
|
|
22
|
+
/**
|
|
23
|
+
* Information about a Digital Ocean function.
|
|
24
|
+
*/
|
|
25
|
+
export type DOFunctionInfo<TInput extends object, TOutput extends object> = {
|
|
26
|
+
url: string;
|
|
27
|
+
call: (args: DOFunctionInput<TInput>) => Promise<DOFunctionOutput<TOutput>>;
|
|
28
|
+
};
|
|
29
|
+
declare const doFunctionsInfo: {
|
|
30
|
+
authCheckPassword: DOFunctionInfo<{
|
|
31
|
+
password: string;
|
|
32
|
+
}, {
|
|
33
|
+
passwordIsCorrect: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
export type DOFunction = keyof typeof doFunctionsInfo;
|
|
37
|
+
/**
|
|
38
|
+
* A service to provide some utility realted to Digital Ocean functions.
|
|
39
|
+
*/
|
|
40
|
+
export default class DOFunctionService {
|
|
41
|
+
static call(functionName: DOFunction, args: (typeof doFunctionsInfo)[DOFunction]['call']['arguments'][0]): Promise<{
|
|
42
|
+
passwordIsCorrect: boolean;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=DOFunctionService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DOFunctionService.d.ts","sourceRoot":"","sources":["../../../src/services/DOFunctionService/DOFunctionService.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,MAAM,IAAI;IACxD;;;OAGG;IACH,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,OAAO,SAAS,MAAM,IAAI,OAAO,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,MAAM,SAAS,MAAM,IAAI,MAAM,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,MAAM,SAAS,MAAM,EAAE,OAAO,SAAS,MAAM,IAAI;IAC1E,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,KAAK,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;CAC7E,CAAC;AAEF,QAAA,MAAM,eAAe;;;;;;CAEpB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,eAAe,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;WACvB,IAAI,CACf,YAAY,EAAE,UAAU,EACxB,IAAI,EAAE,CAAC,OAAO,eAAe,CAAC,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;;;CAKrE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const authCheckPassword_1 = __importDefault(require("./functionsInfo/authCheckPassword"));
|
|
7
|
+
const doFunctionsInfo = {
|
|
8
|
+
authCheckPassword: authCheckPassword_1.default
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A service to provide some utility realted to Digital Ocean functions.
|
|
12
|
+
*/
|
|
13
|
+
class DOFunctionService {
|
|
14
|
+
static async call(functionName, args) {
|
|
15
|
+
const info = doFunctionsInfo[functionName];
|
|
16
|
+
return info.call(args);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.default = DOFunctionService;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=DOAuthCheckPassword.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DOAuthCheckPassword.d.ts","sourceRoot":"","sources":["../../../../src/services/DOFunctionService/functions/DOAuthCheckPassword.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=authCheckPassword.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authCheckPassword.d.ts","sourceRoot":"","sources":["../../../../src/services/DOFunctionService/functions/authCheckPassword.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DOFunctionInfo, DOFunctionInput, DOFunctionOutput, DOFunctionRawOutput } from '../DOFunctionService';
|
|
2
|
+
export type DOAuthCheckPasswordInput = DOFunctionInput<{
|
|
3
|
+
password: string;
|
|
4
|
+
}>;
|
|
5
|
+
export type DOAuthCheckPasswordOutput = DOFunctionOutput<{
|
|
6
|
+
passwordIsCorrect: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
export type DOAuthCheckPasswordRawOutput = DOFunctionRawOutput<DOAuthCheckPasswordOutput>;
|
|
9
|
+
declare const authCheckPasswordInfo: DOFunctionInfo<DOAuthCheckPasswordInput, DOAuthCheckPasswordOutput>;
|
|
10
|
+
export default authCheckPasswordInfo;
|
|
11
|
+
//# sourceMappingURL=authCheckPassword.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authCheckPassword.d.ts","sourceRoot":"","sources":["../../../../src/services/DOFunctionService/functionsInfo/authCheckPassword.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,wBAAwB,GAAG,eAAe,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAC7E,MAAM,MAAM,yBAAyB,GAAG,gBAAgB,CAAC;IACvD,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAAC,CAAC;AACH,MAAM,MAAM,4BAA4B,GACtC,mBAAmB,CAAC,yBAAyB,CAAC,CAAC;AAEjD,QAAA,MAAM,qBAAqB,EAAE,cAAc,CACzC,wBAAwB,EACxB,yBAAyB,CAc1B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
7
|
+
const authCheckPasswordInfo = {
|
|
8
|
+
url: 'https://faas-sfo3-7872a1dd.doserverless.co/api/v1/web/fn-66dd3ef6-c21d-46dc-b7ae-caf2ac8041ec/auth/checkPassword',
|
|
9
|
+
call: async (input) => {
|
|
10
|
+
const result = await (0, node_fetch_1.default)(`${authCheckPasswordInfo.url}`, {
|
|
11
|
+
method: 'POST',
|
|
12
|
+
headers: {
|
|
13
|
+
'Content-Type': 'application/json'
|
|
14
|
+
},
|
|
15
|
+
body: JSON.stringify(input)
|
|
16
|
+
});
|
|
17
|
+
const json = (await result.json());
|
|
18
|
+
return json;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.default = authCheckPasswordInfo;
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Output from a Digital Ocean function must always be an object.
|
|
3
|
+
*/
|
|
4
|
+
export type DOFunctionOutput<TOutput extends object> = {
|
|
5
|
+
/**
|
|
6
|
+
* The body is an object, which means it will automatically be serialized to
|
|
7
|
+
* JSON and the Content-Type header will be set to application/json.
|
|
8
|
+
*/
|
|
9
|
+
body: TOutput;
|
|
10
|
+
};
|
|
11
|
+
export declare const DOFunctionsInfo: {
|
|
12
|
+
authCheckPassword: {
|
|
13
|
+
url: string;
|
|
14
|
+
method: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
declare abstract class DOFunction<TInput extends object, TOutput extends object> {
|
|
18
|
+
abstract url: string;
|
|
19
|
+
abstract method: 'GET' | 'POST';
|
|
20
|
+
abstract call: (args: TInput) => Promise<DOFunctionOutput<TOutput>>;
|
|
21
|
+
}
|
|
22
|
+
interface DOFunction<TInput extends object, TOutput> implements DOFunctionOutput {
|
|
23
|
+
}
|
|
24
|
+
export type DOFunctions = keyof typeof DOFunctionsInfo;
|
|
25
|
+
/**
|
|
26
|
+
* A service to provide some utility realted to Digital Ocean functions.
|
|
3
27
|
*/
|
|
4
28
|
export default class DOFunctionService {
|
|
29
|
+
static call(functionName: DOFunction): any;
|
|
5
30
|
}
|
|
31
|
+
export {};
|
|
6
32
|
//# sourceMappingURL=DOFunctionService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DOFunctionService.d.ts","sourceRoot":"","sources":["../../src/services/DOFunctionService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DOFunctionService.d.ts","sourceRoot":"","sources":["../../src/services/DOFunctionService.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,OAAO,SAAS,MAAM,IAAI;IACrD;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;CAK3B,CAAA;AAED,uBAAe,UAAU,CAAC,MAAM,SAAS,MAAM,EAAE,OAAO,SAAS,MAAM;IACrE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;CACrE;AAYD,UAAU,UAAU,CAAC,MAAM,SAAS,MAAM,EAAE,OAAO,CAAC,YAAW,gBAAgB;CAAA;AAM/E,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,eAAe,CAAC;AAEvD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;WACvB,IAAI,CAAC,YAAY,EAAE,UAAU;CAC3C"}
|
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DOFunctionsInfo = void 0;
|
|
4
|
+
exports.DOFunctionsInfo = {
|
|
5
|
+
authCheckPassword: {
|
|
6
|
+
url: 'https://faas-sfo3-7872a1dd.doserverless.co/api/v1/web/fn-66dd3ef6-c21d-46dc-b7ae-caf2ac8041ec/auth/checkPassword',
|
|
7
|
+
method: 'POST'
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
class DOFunction {
|
|
11
|
+
}
|
|
12
|
+
class DOAuthCheckPassword extends DOFunction {
|
|
13
|
+
url = 'https://faas-sfo3-7872a1dd.doserverless.co/api/v1/web/fn-66dd3ef6-c21d-46dc-b7ae-caf2ac8041ec/auth/checkPassword';
|
|
14
|
+
method = 'POST';
|
|
15
|
+
call(args) {
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
(args);
|
|
19
|
+
then((response) => response.json());
|
|
20
|
+
> {
|
|
21
|
+
url: string,
|
|
22
|
+
method: 'GET' | 'POST',
|
|
23
|
+
call: (args) => Promise
|
|
24
|
+
};
|
|
3
25
|
/**
|
|
4
|
-
* A service to provide some utility
|
|
26
|
+
* A service to provide some utility realted to Digital Ocean functions.
|
|
5
27
|
*/
|
|
6
28
|
class DOFunctionService {
|
|
7
29
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A service which can be used to manage dependencies in the current project
|
|
3
|
+
* in various ways.
|
|
4
|
+
*/
|
|
5
|
+
export default class DependencyService {
|
|
6
|
+
/**
|
|
7
|
+
* Updates the package.json files of all sub-directories based on the root
|
|
8
|
+
* package.json file. This will match any versions of dependencies in the
|
|
9
|
+
* sub-directories to the version in the root package.json file.
|
|
10
|
+
*/
|
|
11
|
+
static updateChildPackageJsons(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=DependencyService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DependencyService.d.ts","sourceRoot":"","sources":["../../src/services/DependencyService.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC;;;;OAIG;WACU,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;CA+DtD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const promises_1 = require("fs/promises");
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const FileSystemService_1 = __importDefault(require("./applications/FileSystemService/FileSystemService"));
|
|
9
|
+
/**
|
|
10
|
+
* A service which can be used to manage dependencies in the current project
|
|
11
|
+
* in various ways.
|
|
12
|
+
*/
|
|
13
|
+
class DependencyService {
|
|
14
|
+
/**
|
|
15
|
+
* Updates the package.json files of all sub-directories based on the root
|
|
16
|
+
* package.json file. This will match any versions of dependencies in the
|
|
17
|
+
* sub-directories to the version in the root package.json file.
|
|
18
|
+
*/
|
|
19
|
+
static async updateChildPackageJsons() {
|
|
20
|
+
// Read the root package.json file
|
|
21
|
+
const rootPackageJsonPath = path_1.default.join(process.cwd(), 'package.json');
|
|
22
|
+
try {
|
|
23
|
+
await (0, promises_1.access)(rootPackageJsonPath);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
throw new Error('No package.json file found in the current directory.');
|
|
27
|
+
}
|
|
28
|
+
const rootPackageJsonData = JSON.parse(await (0, promises_1.readFile)(rootPackageJsonPath, 'utf-8'));
|
|
29
|
+
// Get all files and in the current directory
|
|
30
|
+
const filePaths = await FileSystemService_1.default.getAllFilePathsRelative(process.cwd());
|
|
31
|
+
const packageJsonPaths = filePaths.filter((filePath) => !filePath.includes('node_modules') &&
|
|
32
|
+
!filePath.includes('dist') &&
|
|
33
|
+
!filePath.includes('build') &&
|
|
34
|
+
filePath !== '/package.json' &&
|
|
35
|
+
filePath.endsWith('package.json'));
|
|
36
|
+
const rootDependencies = {
|
|
37
|
+
...rootPackageJsonData.dependencies,
|
|
38
|
+
...rootPackageJsonData.devDependencies
|
|
39
|
+
};
|
|
40
|
+
// Iterate over all package.json files
|
|
41
|
+
await Promise.all(packageJsonPaths.map(async (packageJsonPath) => {
|
|
42
|
+
const fullPackageJsonPath = path_1.default.join(process.cwd(), packageJsonPath);
|
|
43
|
+
const packageJsonData = JSON.parse(await (0, promises_1.readFile)(fullPackageJsonPath, 'utf-8'));
|
|
44
|
+
if (packageJsonData.dependencies) {
|
|
45
|
+
Object.keys(packageJsonData.dependencies).forEach((dependency) => {
|
|
46
|
+
if (rootDependencies[dependency]) {
|
|
47
|
+
packageJsonData.dependencies[dependency] =
|
|
48
|
+
rootDependencies[dependency];
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (packageJsonData.devDependencies) {
|
|
53
|
+
Object.keys(packageJsonData.devDependencies).forEach((dependency) => {
|
|
54
|
+
if (rootDependencies[dependency]) {
|
|
55
|
+
packageJsonData.dependencies[dependency] =
|
|
56
|
+
rootDependencies[dependency];
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
// Write the updated package.json file
|
|
61
|
+
await (0, promises_1.writeFile)(fullPackageJsonPath, JSON.stringify(packageJsonData, null, 2));
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.default = DependencyService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aneuhold/core-ts-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "A core library for all of my TypeScript projects",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
"pushpub": "npm run build && npm version patch && git push && npm publish --access public",
|
|
9
9
|
"build": "tsc",
|
|
10
10
|
"watch": "tsc -w",
|
|
11
|
+
"link:local": "cd lib && yarn link",
|
|
12
|
+
"unlink:local": "cd lib && yarn unlink",
|
|
11
13
|
"upgrade:all": "yarn upgrade --latest",
|
|
12
14
|
"test": "jest"
|
|
13
15
|
},
|
|
@@ -31,6 +33,7 @@
|
|
|
31
33
|
],
|
|
32
34
|
"dependencies": {
|
|
33
35
|
"dotenv": "^16.3.1",
|
|
36
|
+
"node-fetch": "^3.3.2",
|
|
34
37
|
"octokit": "^3.1.2"
|
|
35
38
|
},
|
|
36
39
|
"devDependencies": {
|