@digital-alchemy/core 0.1.0
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/LICENSE +21 -0
- package/README.md +47 -0
- package/dist/automation/automation.module.d.ts +61 -0
- package/dist/automation/automation.module.js +70 -0
- package/dist/automation/automation.module.js.map +1 -0
- package/dist/automation/extensions/aggressive-scenes.extension.d.ts +22 -0
- package/dist/automation/extensions/aggressive-scenes.extension.js +125 -0
- package/dist/automation/extensions/aggressive-scenes.extension.js.map +1 -0
- package/dist/automation/extensions/circadian.extension.d.ts +11 -0
- package/dist/automation/extensions/circadian.extension.js +87 -0
- package/dist/automation/extensions/circadian.extension.js.map +1 -0
- package/dist/automation/extensions/index.d.ts +7 -0
- package/dist/automation/extensions/index.js +11 -0
- package/dist/automation/extensions/index.js.map +1 -0
- package/dist/automation/extensions/light-manager.extension.d.ts +26 -0
- package/dist/automation/extensions/light-manager.extension.js +260 -0
- package/dist/automation/extensions/light-manager.extension.js.map +1 -0
- package/dist/automation/extensions/managed-switch.extension.d.ts +3 -0
- package/dist/automation/extensions/managed-switch.extension.js +73 -0
- package/dist/automation/extensions/managed-switch.extension.js.map +1 -0
- package/dist/automation/extensions/room.extension.d.ts +11 -0
- package/dist/automation/extensions/room.extension.js +179 -0
- package/dist/automation/extensions/room.extension.js.map +1 -0
- package/dist/automation/extensions/sequence-matcher.extension.d.ts +3 -0
- package/dist/automation/extensions/sequence-matcher.extension.js +126 -0
- package/dist/automation/extensions/sequence-matcher.extension.js.map +1 -0
- package/dist/automation/extensions/solar-calc.extension.d.ts +20 -0
- package/dist/automation/extensions/solar-calc.extension.js +105 -0
- package/dist/automation/extensions/solar-calc.extension.js.map +1 -0
- package/dist/automation/helpers/events.helper.d.ts +33 -0
- package/dist/automation/helpers/events.helper.js +14 -0
- package/dist/automation/helpers/events.helper.js.map +1 -0
- package/dist/automation/helpers/index.d.ts +7 -0
- package/dist/automation/helpers/index.js +11 -0
- package/dist/automation/helpers/index.js.map +1 -0
- package/dist/automation/helpers/managed-switch.helper.d.ts +41 -0
- package/dist/automation/helpers/managed-switch.helper.js +3 -0
- package/dist/automation/helpers/managed-switch.helper.js.map +1 -0
- package/dist/automation/helpers/metrics.helper.d.ts +13 -0
- package/dist/automation/helpers/metrics.helper.js +30 -0
- package/dist/automation/helpers/metrics.helper.js.map +1 -0
- package/dist/automation/helpers/reftimes.helper.d.ts +54 -0
- package/dist/automation/helpers/reftimes.helper.js +33 -0
- package/dist/automation/helpers/reftimes.helper.js.map +1 -0
- package/dist/automation/helpers/scene.helper.d.ts +97 -0
- package/dist/automation/helpers/scene.helper.js +5 -0
- package/dist/automation/helpers/scene.helper.js.map +1 -0
- package/dist/automation/helpers/sequence.helper.d.ts +55 -0
- package/dist/automation/helpers/sequence.helper.js +3 -0
- package/dist/automation/helpers/sequence.helper.js.map +1 -0
- package/dist/automation/helpers/solar.helper.d.ts +3 -0
- package/dist/automation/helpers/solar.helper.js +262 -0
- package/dist/automation/helpers/solar.helper.js.map +1 -0
- package/dist/automation/index.d.ts +3 -0
- package/dist/automation/index.js +10 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/boilerplate/extensions/cache.extension.d.ts +24 -0
- package/dist/boilerplate/extensions/cache.extension.js +96 -0
- package/dist/boilerplate/extensions/cache.extension.js.map +1 -0
- package/dist/boilerplate/extensions/configuration.extension.d.ts +23 -0
- package/dist/boilerplate/extensions/configuration.extension.js +98 -0
- package/dist/boilerplate/extensions/configuration.extension.js.map +1 -0
- package/dist/boilerplate/extensions/fetch.extension.d.ts +20 -0
- package/dist/boilerplate/extensions/fetch.extension.js +154 -0
- package/dist/boilerplate/extensions/fetch.extension.js.map +1 -0
- package/dist/boilerplate/extensions/index.d.ts +6 -0
- package/dist/boilerplate/extensions/index.js +10 -0
- package/dist/boilerplate/extensions/index.js.map +1 -0
- package/dist/boilerplate/extensions/logger.extension.d.ts +39 -0
- package/dist/boilerplate/extensions/logger.extension.js +159 -0
- package/dist/boilerplate/extensions/logger.extension.js.map +1 -0
- package/dist/boilerplate/extensions/scheduler.extension.d.ts +21 -0
- package/dist/boilerplate/extensions/scheduler.extension.js +117 -0
- package/dist/boilerplate/extensions/scheduler.extension.js.map +1 -0
- package/dist/boilerplate/extensions/wiring.extension.d.ts +101 -0
- package/dist/boilerplate/extensions/wiring.extension.js +452 -0
- package/dist/boilerplate/extensions/wiring.extension.js.map +1 -0
- package/dist/boilerplate/helpers/cache-memory.helper.d.ts +7 -0
- package/dist/boilerplate/helpers/cache-memory.helper.js +65 -0
- package/dist/boilerplate/helpers/cache-memory.helper.js.map +1 -0
- package/dist/boilerplate/helpers/cache-redis.helper.d.ts +7 -0
- package/dist/boilerplate/helpers/cache-redis.helper.js +69 -0
- package/dist/boilerplate/helpers/cache-redis.helper.js.map +1 -0
- package/dist/boilerplate/helpers/config-environment-loader.helper.d.ts +2 -0
- package/dist/boilerplate/helpers/config-environment-loader.helper.js +56 -0
- package/dist/boilerplate/helpers/config-environment-loader.helper.js.map +1 -0
- package/dist/boilerplate/helpers/config-file-loader.helper.d.ts +4 -0
- package/dist/boilerplate/helpers/config-file-loader.helper.js +87 -0
- package/dist/boilerplate/helpers/config-file-loader.helper.js.map +1 -0
- package/dist/boilerplate/helpers/config.helper.d.ts +102 -0
- package/dist/boilerplate/helpers/config.helper.js +32 -0
- package/dist/boilerplate/helpers/config.helper.js.map +1 -0
- package/dist/boilerplate/helpers/errors.helper.d.ts +39 -0
- package/dist/boilerplate/helpers/errors.helper.js +76 -0
- package/dist/boilerplate/helpers/errors.helper.js.map +1 -0
- package/dist/boilerplate/helpers/events.helper.d.ts +3 -0
- package/dist/boilerplate/helpers/events.helper.js +11 -0
- package/dist/boilerplate/helpers/events.helper.js.map +1 -0
- package/dist/boilerplate/helpers/fetch.helper.d.ts +170 -0
- package/dist/boilerplate/helpers/fetch.helper.js +173 -0
- package/dist/boilerplate/helpers/fetch.helper.js.map +1 -0
- package/dist/boilerplate/helpers/index.d.ts +12 -0
- package/dist/boilerplate/helpers/index.js +16 -0
- package/dist/boilerplate/helpers/index.js.map +1 -0
- package/dist/boilerplate/helpers/lifecycle.helper.d.ts +43 -0
- package/dist/boilerplate/helpers/lifecycle.helper.js +13 -0
- package/dist/boilerplate/helpers/lifecycle.helper.js.map +1 -0
- package/dist/boilerplate/helpers/metrics.helper.d.ts +73 -0
- package/dist/boilerplate/helpers/metrics.helper.js +141 -0
- package/dist/boilerplate/helpers/metrics.helper.js.map +1 -0
- package/dist/boilerplate/helpers/testing.helper.d.ts +13 -0
- package/dist/boilerplate/helpers/testing.helper.js +91 -0
- package/dist/boilerplate/helpers/testing.helper.js.map +1 -0
- package/dist/boilerplate/helpers/wiring.helper.d.ts +155 -0
- package/dist/boilerplate/helpers/wiring.helper.js +5 -0
- package/dist/boilerplate/helpers/wiring.helper.js.map +1 -0
- package/dist/boilerplate/index.d.ts +2 -0
- package/dist/boilerplate/index.js +6 -0
- package/dist/boilerplate/index.js.map +1 -0
- package/dist/gotify/extensions/application.extension.d.ts +13 -0
- package/dist/gotify/extensions/application.extension.js +52 -0
- package/dist/gotify/extensions/application.extension.js.map +1 -0
- package/dist/gotify/extensions/client.extension.d.ts +8 -0
- package/dist/gotify/extensions/client.extension.js +38 -0
- package/dist/gotify/extensions/client.extension.js.map +1 -0
- package/dist/gotify/extensions/fetch.extension.d.ts +2 -0
- package/dist/gotify/extensions/fetch.extension.js +14 -0
- package/dist/gotify/extensions/fetch.extension.js.map +1 -0
- package/dist/gotify/extensions/index.d.ts +4 -0
- package/dist/gotify/extensions/index.js +8 -0
- package/dist/gotify/extensions/index.js.map +1 -0
- package/dist/gotify/extensions/message.extension.d.ts +8 -0
- package/dist/gotify/extensions/message.extension.js +37 -0
- package/dist/gotify/extensions/message.extension.js.map +1 -0
- package/dist/gotify/gotify.module.d.ts +29 -0
- package/dist/gotify/gotify.module.js +33 -0
- package/dist/gotify/gotify.module.js.map +1 -0
- package/dist/gotify/helpers/api.d.ts +346 -0
- package/dist/gotify/helpers/api.js +14 -0
- package/dist/gotify/helpers/api.js.map +1 -0
- package/dist/gotify/helpers/events.helper.d.ts +6 -0
- package/dist/gotify/helpers/events.helper.js +5 -0
- package/dist/gotify/helpers/events.helper.js.map +1 -0
- package/dist/gotify/helpers/index.d.ts +2 -0
- package/dist/gotify/helpers/index.js +6 -0
- package/dist/gotify/helpers/index.js.map +1 -0
- package/dist/gotify/index.d.ts +3 -0
- package/dist/gotify/index.js +7 -0
- package/dist/gotify/index.js.map +1 -0
- package/dist/hass/dynamic.d.ts +1126 -0
- package/dist/hass/dynamic.js +153 -0
- package/dist/hass/dynamic.js.map +1 -0
- package/dist/hass/extensions/call-proxy.extension.d.ts +4 -0
- package/dist/hass/extensions/call-proxy.extension.js +88 -0
- package/dist/hass/extensions/call-proxy.extension.js.map +1 -0
- package/dist/hass/extensions/entity-manager.extension.d.ts +61 -0
- package/dist/hass/extensions/entity-manager.extension.js +214 -0
- package/dist/hass/extensions/entity-manager.extension.js.map +1 -0
- package/dist/hass/extensions/fetch-api.extension.d.ts +26 -0
- package/dist/hass/extensions/fetch-api.extension.js +166 -0
- package/dist/hass/extensions/fetch-api.extension.js.map +1 -0
- package/dist/hass/extensions/index.d.ts +5 -0
- package/dist/hass/extensions/index.js +9 -0
- package/dist/hass/extensions/index.js.map +1 -0
- package/dist/hass/extensions/utilities.extension.d.ts +9 -0
- package/dist/hass/extensions/utilities.extension.js +43 -0
- package/dist/hass/extensions/utilities.extension.js.map +1 -0
- package/dist/hass/extensions/websocket-api.extension.d.ts +39 -0
- package/dist/hass/extensions/websocket-api.extension.js +363 -0
- package/dist/hass/extensions/websocket-api.extension.js.map +1 -0
- package/dist/hass/hass.module.d.ts +53 -0
- package/dist/hass/hass.module.js +59 -0
- package/dist/hass/hass.module.js.map +1 -0
- package/dist/hass/helpers/backup.helper.d.ts +11 -0
- package/dist/hass/helpers/backup.helper.js +3 -0
- package/dist/hass/helpers/backup.helper.js.map +1 -0
- package/dist/hass/helpers/constants.helper.d.ts +54 -0
- package/dist/hass/helpers/constants.helper.js +63 -0
- package/dist/hass/helpers/constants.helper.js.map +1 -0
- package/dist/hass/helpers/entity-state.helper.d.ts +45 -0
- package/dist/hass/helpers/entity-state.helper.js +9 -0
- package/dist/hass/helpers/entity-state.helper.js.map +1 -0
- package/dist/hass/helpers/fetch/calendar.d.ts +54 -0
- package/dist/hass/helpers/fetch/calendar.js +3 -0
- package/dist/hass/helpers/fetch/calendar.js.map +1 -0
- package/dist/hass/helpers/fetch/configuration.d.ts +34 -0
- package/dist/hass/helpers/fetch/configuration.js +3 -0
- package/dist/hass/helpers/fetch/configuration.js.map +1 -0
- package/dist/hass/helpers/fetch/index.d.ts +4 -0
- package/dist/hass/helpers/fetch/index.js +8 -0
- package/dist/hass/helpers/fetch/index.js.map +1 -0
- package/dist/hass/helpers/fetch/server-log.d.ts +10 -0
- package/dist/hass/helpers/fetch/server-log.js +20 -0
- package/dist/hass/helpers/fetch/server-log.js.map +1 -0
- package/dist/hass/helpers/fetch/service-list.d.ts +51 -0
- package/dist/hass/helpers/fetch/service-list.js +3 -0
- package/dist/hass/helpers/fetch/service-list.js.map +1 -0
- package/dist/hass/helpers/index.d.ts +7 -0
- package/dist/hass/helpers/index.js +11 -0
- package/dist/hass/helpers/index.js.map +1 -0
- package/dist/hass/helpers/metrics.helper.d.ts +13 -0
- package/dist/hass/helpers/metrics.helper.js +30 -0
- package/dist/hass/helpers/metrics.helper.js.map +1 -0
- package/dist/hass/helpers/utility.helper.d.ts +57 -0
- package/dist/hass/helpers/utility.helper.js +34 -0
- package/dist/hass/helpers/utility.helper.js.map +1 -0
- package/dist/hass/helpers/websocket.helper.d.ts +129 -0
- package/dist/hass/helpers/websocket.helper.js +3 -0
- package/dist/hass/helpers/websocket.helper.js.map +1 -0
- package/dist/hass/index.d.ts +4 -0
- package/dist/hass/index.js +8 -0
- package/dist/hass/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/nexus/entities.extension.d.ts +2 -0
- package/dist/nexus/entities.extension.js +51 -0
- package/dist/nexus/entities.extension.js.map +1 -0
- package/dist/nexus/main.d.ts +9 -0
- package/dist/nexus/main.js +28 -0
- package/dist/nexus/main.js.map +1 -0
- package/dist/synapse/extensions/binary-sensor.extension.d.ts +19 -0
- package/dist/synapse/extensions/binary-sensor.extension.js +84 -0
- package/dist/synapse/extensions/binary-sensor.extension.js.map +1 -0
- package/dist/synapse/extensions/button.extension.d.ts +10 -0
- package/dist/synapse/extensions/button.extension.js +46 -0
- package/dist/synapse/extensions/button.extension.js.map +1 -0
- package/dist/synapse/extensions/index.d.ts +6 -0
- package/dist/synapse/extensions/index.js +10 -0
- package/dist/synapse/extensions/index.js.map +1 -0
- package/dist/synapse/extensions/registry.extension.d.ts +21 -0
- package/dist/synapse/extensions/registry.extension.js +207 -0
- package/dist/synapse/extensions/registry.extension.js.map +1 -0
- package/dist/synapse/extensions/scene.extension.d.ts +9 -0
- package/dist/synapse/extensions/scene.extension.js +37 -0
- package/dist/synapse/extensions/scene.extension.js.map +1 -0
- package/dist/synapse/extensions/sensor.extension.d.ts +25 -0
- package/dist/synapse/extensions/sensor.extension.js +154 -0
- package/dist/synapse/extensions/sensor.extension.js.map +1 -0
- package/dist/synapse/extensions/switch.extension.d.ts +19 -0
- package/dist/synapse/extensions/switch.extension.js +95 -0
- package/dist/synapse/extensions/switch.extension.js.map +1 -0
- package/dist/synapse/helpers/device-class.helper.d.ts +323 -0
- package/dist/synapse/helpers/device-class.helper.js +241 -0
- package/dist/synapse/helpers/device-class.helper.js.map +1 -0
- package/dist/synapse/helpers/index.d.ts +3 -0
- package/dist/synapse/helpers/index.js +7 -0
- package/dist/synapse/helpers/index.js.map +1 -0
- package/dist/synapse/helpers/metrics.helper.d.ts +13 -0
- package/dist/synapse/helpers/metrics.helper.js +30 -0
- package/dist/synapse/helpers/metrics.helper.js.map +1 -0
- package/dist/synapse/helpers/utility.helper.d.ts +1 -0
- package/dist/synapse/helpers/utility.helper.js +3 -0
- package/dist/synapse/helpers/utility.helper.js.map +1 -0
- package/dist/synapse/index.d.ts +3 -0
- package/dist/synapse/index.js +7 -0
- package/dist/synapse/index.js.map +1 -0
- package/dist/synapse/synapse.module.d.ts +29 -0
- package/dist/synapse/synapse.module.js +41 -0
- package/dist/synapse/synapse.module.js.map +1 -0
- package/dist/type-writer/build.extension.d.ts +2 -0
- package/dist/type-writer/build.extension.js +53 -0
- package/dist/type-writer/build.extension.js.map +1 -0
- package/dist/type-writer/main.d.ts +17 -0
- package/dist/type-writer/main.js +36 -0
- package/dist/type-writer/main.js.map +1 -0
- package/dist/type-writer/type-writer.extension.d.ts +2 -0
- package/dist/type-writer/type-writer.extension.js +212 -0
- package/dist/type-writer/type-writer.extension.js.map +1 -0
- package/dist/utilities/extensions/index.d.ts +3 -0
- package/dist/utilities/extensions/index.js +7 -0
- package/dist/utilities/extensions/index.js.map +1 -0
- package/dist/utilities/extensions/is.extension.d.ts +38 -0
- package/dist/utilities/extensions/is.extension.js +104 -0
- package/dist/utilities/extensions/is.extension.js.map +1 -0
- package/dist/utilities/extensions/zcc-testing.extension.d.ts +4 -0
- package/dist/utilities/extensions/zcc-testing.extension.js +9 -0
- package/dist/utilities/extensions/zcc-testing.extension.js.map +1 -0
- package/dist/utilities/extensions/zcc.extension.d.ts +20 -0
- package/dist/utilities/extensions/zcc.extension.js +66 -0
- package/dist/utilities/extensions/zcc.extension.js.map +1 -0
- package/dist/utilities/helpers/async.helper.d.ts +2 -0
- package/dist/utilities/helpers/async.helper.js +26 -0
- package/dist/utilities/helpers/async.helper.js.map +1 -0
- package/dist/utilities/helpers/context.helper.d.ts +7 -0
- package/dist/utilities/helpers/context.helper.js +3 -0
- package/dist/utilities/helpers/context.helper.js.map +1 -0
- package/dist/utilities/helpers/cron.helper.d.ts +87 -0
- package/dist/utilities/helpers/cron.helper.js +92 -0
- package/dist/utilities/helpers/cron.helper.js.map +1 -0
- package/dist/utilities/helpers/extend.helper.d.ts +2 -0
- package/dist/utilities/helpers/extend.helper.js +68 -0
- package/dist/utilities/helpers/extend.helper.js.map +1 -0
- package/dist/utilities/helpers/index.d.ts +5 -0
- package/dist/utilities/helpers/index.js +9 -0
- package/dist/utilities/helpers/index.js.map +1 -0
- package/dist/utilities/helpers/utilities.helper.d.ts +63 -0
- package/dist/utilities/helpers/utilities.helper.js +93 -0
- package/dist/utilities/helpers/utilities.helper.js.map +1 -0
- package/dist/utilities/index.d.ts +2 -0
- package/dist/utilities/index.js +6 -0
- package/dist/utilities/index.js.map +1 -0
- package/package.json +101 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Dayjs } from "dayjs";
|
|
3
|
+
import { EventEmitter } from "events";
|
|
4
|
+
import { Logger } from "pino";
|
|
5
|
+
import { CronExpression, TBlackHole, TContext } from "../..";
|
|
6
|
+
import { ILogger, LIB_BOILERPLATE, TCache } from "..";
|
|
7
|
+
import { AnyConfig, BooleanConfig, InternalConfig, NumberConfig, OptionalModuleConfiguration, StringArrayConfig, StringConfig } from "./config.helper";
|
|
8
|
+
import { TChildLifecycle, TLifecycleBase } from "./lifecycle.helper";
|
|
9
|
+
export type TServiceReturn<OBJECT extends object = object> = void | OBJECT;
|
|
10
|
+
export type TModuleMappings = Record<string, ServiceFunction>;
|
|
11
|
+
export type TResolvedModuleMappings = Record<string, TServiceReturn>;
|
|
12
|
+
export type ApplicationConfigurationOptions<S extends ServiceMap, C extends OptionalModuleConfiguration> = {
|
|
13
|
+
name: keyof LoadedModules;
|
|
14
|
+
services: S;
|
|
15
|
+
libraries?: LibraryDefinition<ServiceMap, OptionalModuleConfiguration>[];
|
|
16
|
+
configuration?: C;
|
|
17
|
+
/**
|
|
18
|
+
* Define which services should be initialized first. Any remaining services are done at the end in no set order
|
|
19
|
+
*/
|
|
20
|
+
priorityInit?: Extract<keyof S, string>[];
|
|
21
|
+
};
|
|
22
|
+
export type TConfigurable<S extends ServiceMap = ServiceMap, C extends OptionalModuleConfiguration = OptionalModuleConfiguration> = LibraryDefinition<S, C> | ApplicationDefinition<S, C>;
|
|
23
|
+
export type TGetConfig<PARENT extends TConfigurable = TConfigurable> = <K extends keyof ExtractConfig<PARENT>>(key: K) => CastConfigResult<ExtractConfig<PARENT>[K]>;
|
|
24
|
+
export type GetApisResult<S extends ServiceMap> = {
|
|
25
|
+
[K in keyof S]: ReturnType<S[K]> extends Promise<infer AsyncResult> ? AsyncResult : ReturnType<S[K]>;
|
|
26
|
+
};
|
|
27
|
+
type ExtractConfig<T> = T extends LibraryDefinition<ServiceMap, infer C> ? C : T extends ApplicationDefinition<ServiceMap, infer C> ? C : never;
|
|
28
|
+
export type Schedule = string | CronExpression;
|
|
29
|
+
export type ScheduleItem = {
|
|
30
|
+
start: () => void;
|
|
31
|
+
stop: () => void;
|
|
32
|
+
};
|
|
33
|
+
export type SchedulerOptions = {
|
|
34
|
+
context: TContext;
|
|
35
|
+
exec: () => TBlackHole;
|
|
36
|
+
/**
|
|
37
|
+
* if provided, specific metrics will be kept and labelled with provided label
|
|
38
|
+
*
|
|
39
|
+
* - execution count
|
|
40
|
+
* - errors
|
|
41
|
+
* - execution duration
|
|
42
|
+
*/
|
|
43
|
+
label?: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* General code scheduling functions
|
|
47
|
+
*
|
|
48
|
+
* Each method returns a stop function, for temporary scheduling items
|
|
49
|
+
*/
|
|
50
|
+
export type TScheduler = {
|
|
51
|
+
/**
|
|
52
|
+
* Run code on a cron schedule
|
|
53
|
+
*/
|
|
54
|
+
cron: (options: SchedulerOptions & {
|
|
55
|
+
schedule: Schedule | Schedule[];
|
|
56
|
+
}) => () => TBlackHole;
|
|
57
|
+
/**
|
|
58
|
+
* Run code on a regular periodic interval
|
|
59
|
+
*/
|
|
60
|
+
interval: (options: SchedulerOptions & {
|
|
61
|
+
interval: number;
|
|
62
|
+
}) => () => void;
|
|
63
|
+
/**
|
|
64
|
+
* Run code at a different time every {period}
|
|
65
|
+
*
|
|
66
|
+
* Calls `next` at start, and as determined by `reset`.
|
|
67
|
+
*
|
|
68
|
+
* Next returns the date/time for the next execution
|
|
69
|
+
*/
|
|
70
|
+
sliding: (options: SchedulerOptions & {
|
|
71
|
+
reset: Schedule;
|
|
72
|
+
next: () => Dayjs;
|
|
73
|
+
}) => () => TBlackHole;
|
|
74
|
+
};
|
|
75
|
+
export interface LoadedModules {
|
|
76
|
+
boilerplate: typeof LIB_BOILERPLATE;
|
|
77
|
+
}
|
|
78
|
+
type CastConfigResult<T extends AnyConfig> = T extends StringConfig<infer STRING> ? STRING : T extends BooleanConfig ? boolean : T extends NumberConfig ? number : T extends StringArrayConfig ? string[] : T extends InternalConfig<infer VALUE> ? VALUE : never;
|
|
79
|
+
export type TInjectedConfig = {
|
|
80
|
+
[ModuleName in keyof ModuleConfigs]: ConfigTypes<ModuleConfigs[ModuleName]>;
|
|
81
|
+
};
|
|
82
|
+
export type TServiceParams = {
|
|
83
|
+
cache: TCache;
|
|
84
|
+
context: TContext;
|
|
85
|
+
event: EventEmitter;
|
|
86
|
+
lifecycle: TLifecycleBase;
|
|
87
|
+
logger: ILogger;
|
|
88
|
+
scheduler: TScheduler;
|
|
89
|
+
config: TInjectedConfig;
|
|
90
|
+
} & {
|
|
91
|
+
[K in keyof LoadedModules]: GetApis<LoadedModules[K]>;
|
|
92
|
+
};
|
|
93
|
+
type ModuleConfigs = {
|
|
94
|
+
[K in keyof LoadedModules]: LoadedModules[K] extends LibraryDefinition<ServiceMap, infer Config> ? Config : LoadedModules[K] extends ApplicationDefinition<ServiceMap, infer Config> ? Config : never;
|
|
95
|
+
};
|
|
96
|
+
type ConfigTypes<Config> = {
|
|
97
|
+
[Key in keyof Config]: Config[Key] extends AnyConfig ? CastConfigResult<Config[Key]> : never;
|
|
98
|
+
};
|
|
99
|
+
export type GetApis<T> = T extends LibraryDefinition<infer S, OptionalModuleConfiguration> ? GetApisResult<S> : T extends ApplicationDefinition<infer S, OptionalModuleConfiguration> ? GetApisResult<S> : never;
|
|
100
|
+
export type Loader<PARENT extends TConfigurable> = <K extends keyof PARENT["services"]>(serviceName: K) => ReturnType<PARENT["services"][K]> extends Promise<infer AsyncResult> ? AsyncResult : ReturnType<PARENT["services"][K]>;
|
|
101
|
+
export type ServiceFunction<R = unknown> = (params: TServiceParams) => R | Promise<R>;
|
|
102
|
+
export type ServiceMap = Record<string, ServiceFunction>;
|
|
103
|
+
export type LibraryConfigurationOptions<S extends ServiceMap, C extends OptionalModuleConfiguration> = {
|
|
104
|
+
name: keyof LoadedModules;
|
|
105
|
+
services: S;
|
|
106
|
+
configuration?: C;
|
|
107
|
+
/**
|
|
108
|
+
* Define which services should be initialized first. Any remaining services are done at the end in no set order
|
|
109
|
+
*/
|
|
110
|
+
priorityInit?: Extract<keyof S, string>[];
|
|
111
|
+
};
|
|
112
|
+
type onErrorCallback = () => void;
|
|
113
|
+
export type PartialConfiguration = Partial<{
|
|
114
|
+
[ModuleName in keyof ModuleConfigs]: Partial<ConfigTypes<ModuleConfigs[ModuleName]>>;
|
|
115
|
+
}>;
|
|
116
|
+
export type BootstrapOptions = {
|
|
117
|
+
/**
|
|
118
|
+
* default: true
|
|
119
|
+
*/
|
|
120
|
+
handleGlobalErrors?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* default values to use for configurations, before user values come in
|
|
123
|
+
*/
|
|
124
|
+
configuration?: PartialConfiguration;
|
|
125
|
+
/**
|
|
126
|
+
* use this logger, instead of the baked in one. Maybe you want some custom transports or something? Put your customized thing here
|
|
127
|
+
*/
|
|
128
|
+
customLogger?: Logger;
|
|
129
|
+
/**
|
|
130
|
+
* application level flags
|
|
131
|
+
*/
|
|
132
|
+
flags?: Record<string, boolean | number | string>;
|
|
133
|
+
};
|
|
134
|
+
export declare const WIRE_PROJECT: unique symbol;
|
|
135
|
+
type Wire = {
|
|
136
|
+
/**
|
|
137
|
+
* Internal method used in bootstrapping, do not call elsewhere
|
|
138
|
+
*
|
|
139
|
+
* - initializes lifecycle
|
|
140
|
+
* - attaches event emitters
|
|
141
|
+
*/
|
|
142
|
+
[WIRE_PROJECT]: () => Promise<TChildLifecycle>;
|
|
143
|
+
};
|
|
144
|
+
export type LibraryDefinition<S extends ServiceMap, C extends OptionalModuleConfiguration> = LibraryConfigurationOptions<S, C> & Wire & {
|
|
145
|
+
lifecycle: TChildLifecycle;
|
|
146
|
+
onError: (callback: onErrorCallback) => void;
|
|
147
|
+
};
|
|
148
|
+
export type ApplicationDefinition<S extends ServiceMap, C extends OptionalModuleConfiguration> = ApplicationConfigurationOptions<S, C> & Wire & {
|
|
149
|
+
booted: boolean;
|
|
150
|
+
bootstrap: (options?: BootstrapOptions) => Promise<void>;
|
|
151
|
+
lifecycle: TChildLifecycle;
|
|
152
|
+
onError: (callback: onErrorCallback) => void;
|
|
153
|
+
teardown: () => Promise<void>;
|
|
154
|
+
};
|
|
155
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wiring.helper.js","sourceRoot":"","sources":["../../../src/boilerplate/helpers/wiring.helper.ts"],"names":[],"mappings":";;;AAgPa,QAAA,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/boilerplate/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,oDAA0B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TServiceParams } from "../..";
|
|
2
|
+
import { Application, ApplicationParameters, Message } from "../helpers";
|
|
3
|
+
export declare function GotifyApplication({ logger, gotify }: TServiceParams): {
|
|
4
|
+
create(body: ApplicationParameters): Promise<Application>;
|
|
5
|
+
delete(id: number): Promise<void>;
|
|
6
|
+
deleteMessages(id: number): Promise<void>;
|
|
7
|
+
getMessages(id: number, params?: {
|
|
8
|
+
limit?: number;
|
|
9
|
+
since?: number;
|
|
10
|
+
}): Promise<Message[]>;
|
|
11
|
+
list(): Promise<Application[]>;
|
|
12
|
+
update(id: number, body: ApplicationParameters): Promise<Application>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GotifyApplication = void 0;
|
|
4
|
+
function GotifyApplication({ logger, gotify }) {
|
|
5
|
+
return {
|
|
6
|
+
async create(body) {
|
|
7
|
+
logger.trace(`application create`);
|
|
8
|
+
return await gotify.fetch({
|
|
9
|
+
body,
|
|
10
|
+
method: "post",
|
|
11
|
+
url: `/application`,
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
async delete(id) {
|
|
15
|
+
logger.trace(`application delete`);
|
|
16
|
+
return await gotify.fetch({
|
|
17
|
+
method: "delete",
|
|
18
|
+
url: `/application/${id}`,
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
async deleteMessages(id) {
|
|
22
|
+
logger.trace(`application deleteMessages`);
|
|
23
|
+
return await gotify.fetch({
|
|
24
|
+
method: "delete",
|
|
25
|
+
url: `/application/${id}/message`,
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
async getMessages(id, params) {
|
|
29
|
+
logger.trace(`application getMessages`);
|
|
30
|
+
return await gotify.fetch({
|
|
31
|
+
params,
|
|
32
|
+
url: `/application/${id}/message`,
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
async list() {
|
|
36
|
+
logger.trace(`application list`);
|
|
37
|
+
return await gotify.fetch({
|
|
38
|
+
url: `/application`,
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
async update(id, body) {
|
|
42
|
+
logger.trace(`application update`);
|
|
43
|
+
return await gotify.fetch({
|
|
44
|
+
body,
|
|
45
|
+
method: "put",
|
|
46
|
+
url: `/application/${id}`,
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
exports.GotifyApplication = GotifyApplication;
|
|
52
|
+
//# sourceMappingURL=application.extension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application.extension.js","sourceRoot":"","sources":["../../../src/gotify/extensions/application.extension.ts"],"names":[],"mappings":";;;AAGA,SAAgB,iBAAiB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAkB;IAClE,OAAO;QACL,KAAK,CAAC,MAAM,CAAC,IAA2B;YACtC,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACnC,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;gBACxB,IAAI;gBACJ,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,cAAc;aACpB,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,EAAU;YACrB,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACnC,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;gBACxB,MAAM,EAAE,QAAQ;gBAChB,GAAG,EAAE,gBAAgB,EAAE,EAAE;aAC1B,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,cAAc,CAAC,EAAU;YAC7B,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;YAC3C,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;gBACxB,MAAM,EAAE,QAAQ;gBAChB,GAAG,EAAE,gBAAgB,EAAE,UAAU;aAClC,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,WAAW,CACf,EAAU,EACV,MAA2C;YAE3C,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;YACxC,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;gBACxB,MAAM;gBACN,GAAG,EAAE,gBAAgB,EAAE,UAAU;aAClC,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,IAAI;YACR,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;YACjC,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;gBACxB,GAAG,EAAE,cAAc;aACpB,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,MAAM,CACV,EAAU,EACV,IAA2B;YAE3B,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACnC,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;gBACxB,IAAI;gBACJ,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,gBAAgB,EAAE,EAAE;aAC1B,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAzDD,8CAyDC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TServiceParams } from "../..";
|
|
2
|
+
import { Client } from "..";
|
|
3
|
+
export declare function GotifyClient({ logger, gotify }: TServiceParams): {
|
|
4
|
+
create(body: Client): Promise<Client>;
|
|
5
|
+
delete(id: number): Promise<unknown>;
|
|
6
|
+
list(): Promise<Client>;
|
|
7
|
+
update(id: number, body: Client): Promise<Client>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GotifyClient = void 0;
|
|
4
|
+
function GotifyClient({ logger, gotify }) {
|
|
5
|
+
return {
|
|
6
|
+
async create(body) {
|
|
7
|
+
logger.trace(`client create`);
|
|
8
|
+
return await gotify.fetch({
|
|
9
|
+
body,
|
|
10
|
+
method: "post",
|
|
11
|
+
url: "/client",
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
async delete(id) {
|
|
15
|
+
logger.trace(`client delete`);
|
|
16
|
+
return await gotify.fetch({
|
|
17
|
+
method: "delete",
|
|
18
|
+
url: `/client/${id}`,
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
async list() {
|
|
22
|
+
logger.trace(`client list`);
|
|
23
|
+
return await gotify.fetch({
|
|
24
|
+
url: "/client",
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
async update(id, body) {
|
|
28
|
+
logger.trace(`client update`);
|
|
29
|
+
return await gotify.fetch({
|
|
30
|
+
body,
|
|
31
|
+
method: "put",
|
|
32
|
+
url: `/client/${id}`,
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.GotifyClient = GotifyClient;
|
|
38
|
+
//# sourceMappingURL=client.extension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.extension.js","sourceRoot":"","sources":["../../../src/gotify/extensions/client.extension.ts"],"names":[],"mappings":";;;AAGA,SAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,MAAM,EAAkB;IAC7D,OAAO;QACL,KAAK,CAAC,MAAM,CAAC,IAAY;YACvB,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YAC9B,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;gBACxB,IAAI;gBACJ,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,SAAS;aACf,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,EAAU;YACrB,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YAC9B,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;gBACxB,MAAM,EAAE,QAAQ;gBAChB,GAAG,EAAE,WAAW,EAAE,EAAE;aACrB,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,IAAI;YACR,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YAC5B,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;gBACxB,GAAG,EAAE,SAAS;aACf,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,IAAY;YACnC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YAC9B,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;gBACxB,IAAI;gBACJ,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,WAAW,EAAE,EAAE;aACrB,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAnCD,oCAmCC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GotifyFetch = void 0;
|
|
4
|
+
const __1 = require("../..");
|
|
5
|
+
function GotifyFetch({ context, config, lifecycle }) {
|
|
6
|
+
const fetcher = __1.ZCC.createFetcher({ context });
|
|
7
|
+
lifecycle.onPostConfig(() => {
|
|
8
|
+
fetcher.setBaseUrl(config.gotify.BASE_URL);
|
|
9
|
+
fetcher.setHeaders({ ["X-Gotify-Key"]: config.gotify.TOKEN });
|
|
10
|
+
});
|
|
11
|
+
return fetcher.fetch;
|
|
12
|
+
}
|
|
13
|
+
exports.GotifyFetch = GotifyFetch;
|
|
14
|
+
//# sourceMappingURL=fetch.extension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.extension.js","sourceRoot":"","sources":["../../../src/gotify/extensions/fetch.extension.ts"],"names":[],"mappings":";;;AAAA,6BAA4C;AAE5C,SAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAkB;IACxE,MAAM,OAAO,GAAG,OAAG,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAE/C,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE;QAC1B,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC3C,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,KAAK,CAAC;AACvB,CAAC;AATD,kCASC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./application.extension.js"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./client.extension.js"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./fetch.extension.js"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./message.extension"), exports);
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/gotify/extensions/index.ts"],"names":[],"mappings":";;;AAAA,qEAA2C;AAC3C,gEAAsC;AACtC,+DAAqC;AACrC,8DAAoC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TServiceParams } from "../..";
|
|
2
|
+
import { Message } from "..";
|
|
3
|
+
export declare function GotifyMessage({ logger, gotify }: TServiceParams): {
|
|
4
|
+
create(body: Message): Promise<Message>;
|
|
5
|
+
delete(id: number): Promise<unknown>;
|
|
6
|
+
deleteAll(): Promise<unknown>;
|
|
7
|
+
list(): Promise<Message>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GotifyMessage = void 0;
|
|
4
|
+
function GotifyMessage({ logger, gotify }) {
|
|
5
|
+
return {
|
|
6
|
+
async create(body) {
|
|
7
|
+
logger.trace(`message create`);
|
|
8
|
+
return await gotify.fetch({
|
|
9
|
+
body,
|
|
10
|
+
method: "post",
|
|
11
|
+
url: "/message",
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
async delete(id) {
|
|
15
|
+
logger.trace(`message delete`);
|
|
16
|
+
return await gotify.fetch({
|
|
17
|
+
method: "delete",
|
|
18
|
+
url: `/message/${id}`,
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
async deleteAll() {
|
|
22
|
+
logger.trace(`message deleteAll`);
|
|
23
|
+
return await gotify.fetch({
|
|
24
|
+
method: "delete",
|
|
25
|
+
url: `/message`,
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
async list() {
|
|
29
|
+
logger.trace(`message list`);
|
|
30
|
+
return await gotify.fetch({
|
|
31
|
+
url: "/message",
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
exports.GotifyMessage = GotifyMessage;
|
|
37
|
+
//# sourceMappingURL=message.extension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.extension.js","sourceRoot":"","sources":["../../../src/gotify/extensions/message.extension.ts"],"names":[],"mappings":";;;AAGA,SAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,MAAM,EAAkB;IAC9D,OAAO;QACL,KAAK,CAAC,MAAM,CAAC,IAAa;YACxB,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAC/B,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;gBACxB,IAAI;gBACJ,MAAM,EAAE,MAAM;gBACd,GAAG,EAAE,UAAU;aAChB,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,EAAU;YACrB,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAC/B,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;gBACxB,MAAM,EAAE,QAAQ;gBAChB,GAAG,EAAE,YAAY,EAAE,EAAE;aACtB,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,SAAS;YACb,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;YAClC,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;gBACxB,MAAM,EAAE,QAAQ;gBAChB,GAAG,EAAE,UAAU;aAChB,CAAC,CAAC;QACL,CAAC;QAED,KAAK,CAAC,IAAI;YACR,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;YAC7B,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC;gBACxB,GAAG,EAAE,UAAU;aAChB,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAlCD,sCAkCC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { GotifyApplication, GotifyClient, GotifyFetch } from "./extensions";
|
|
2
|
+
import { GotifyMessage } from "./extensions";
|
|
3
|
+
export declare const LIB_GOTIFY: import("..").LibraryDefinition<{
|
|
4
|
+
application: typeof GotifyApplication;
|
|
5
|
+
client: typeof GotifyClient;
|
|
6
|
+
fetch: typeof GotifyFetch;
|
|
7
|
+
message: typeof GotifyMessage;
|
|
8
|
+
}, {
|
|
9
|
+
BASE_URL: {
|
|
10
|
+
description: string;
|
|
11
|
+
required: true;
|
|
12
|
+
type: "string";
|
|
13
|
+
};
|
|
14
|
+
CHANNEL_MAPPING: {
|
|
15
|
+
default: {};
|
|
16
|
+
description: string;
|
|
17
|
+
type: "record";
|
|
18
|
+
};
|
|
19
|
+
TOKEN: {
|
|
20
|
+
description: string;
|
|
21
|
+
required: true;
|
|
22
|
+
type: "string";
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
declare module "../boilerplate" {
|
|
26
|
+
interface LoadedModules {
|
|
27
|
+
gotify: typeof LIB_GOTIFY;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LIB_GOTIFY = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const extensions_1 = require("./extensions");
|
|
6
|
+
const extensions_2 = require("./extensions");
|
|
7
|
+
exports.LIB_GOTIFY = (0, __1.CreateLibrary)({
|
|
8
|
+
configuration: {
|
|
9
|
+
BASE_URL: {
|
|
10
|
+
description: "Base URL for server",
|
|
11
|
+
required: true,
|
|
12
|
+
type: "string",
|
|
13
|
+
},
|
|
14
|
+
CHANNEL_MAPPING: {
|
|
15
|
+
default: {},
|
|
16
|
+
description: "Mapping of application names to tokens. Keep your keys out of the code!",
|
|
17
|
+
type: "record",
|
|
18
|
+
},
|
|
19
|
+
TOKEN: {
|
|
20
|
+
description: "Application token",
|
|
21
|
+
required: true,
|
|
22
|
+
type: "string",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
name: "gotify",
|
|
26
|
+
services: {
|
|
27
|
+
application: extensions_1.GotifyApplication,
|
|
28
|
+
client: extensions_1.GotifyClient,
|
|
29
|
+
fetch: extensions_1.GotifyFetch,
|
|
30
|
+
message: extensions_2.GotifyMessage,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=gotify.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gotify.module.js","sourceRoot":"","sources":["../../src/gotify/gotify.module.ts"],"names":[],"mappings":";;;AAAA,0BAAmC;AACnC,6CAA4E;AAC5E,6CAA6C;AAEhC,QAAA,UAAU,GAAG,IAAA,iBAAa,EAAC;IACtC,aAAa,EAAE;QACb,QAAQ,EAAE;YACR,WAAW,EAAE,qBAAqB;YAClC,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ;SACf;QACD,eAAe,EAAE;YACf,OAAO,EAAE,EAAE;YACX,WAAW,EACT,yEAAyE;YAC3E,IAAI,EAAE,QAAQ;SACf;QACD,KAAK,EAAE;YACL,WAAW,EAAE,mBAAmB;YAChC,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,QAAQ;SACf;KACF;IACD,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR,WAAW,EAAE,8BAAiB;QAC9B,MAAM,EAAE,yBAAY;QACpB,KAAK,EAAE,wBAAW;QAClB,OAAO,EAAE,0BAAa;KACvB;CACF,CAAC,CAAC"}
|