@hiliosai/sdk 0.1.24 → 0.1.26
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/index.d.ts +7 -6
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Context, ServiceBroker, ServiceSchema as ServiceSchema$1, ServiceSettingSchema, Service, ActionSchema, ServiceEvents,
|
|
1
|
+
import { Context, ServiceBroker, ServiceSchema as ServiceSchema$1, ServiceSettingSchema, Service, ActionSchema, ServiceEvents, ServiceHooks, Middleware, BrokerOptions } from 'moleculer';
|
|
2
2
|
import env from '@ltv/env';
|
|
3
3
|
export { default as env } from '@ltv/env';
|
|
4
4
|
import { PrismaPg } from '@prisma/adapter-pg';
|
|
@@ -488,6 +488,7 @@ declare enum IntegrationPlatform {
|
|
|
488
488
|
FACEBOOK = "facebook",
|
|
489
489
|
DISCORD = "discord",
|
|
490
490
|
WEBCHAT = "webchat",
|
|
491
|
+
ZALO = "zalo",
|
|
491
492
|
CUSTOM = "custom"
|
|
492
493
|
}
|
|
493
494
|
declare enum IntegrationStatus {
|
|
@@ -677,11 +678,11 @@ type ActionSchemaWithContext<TDatasources = unknown, TParams = unknown> = Pick<A
|
|
|
677
678
|
handler: (ctx: AppContext<TDatasources, InferParamsType<TParams>>) => Promise<unknown> | unknown;
|
|
678
679
|
permissions?: string | string[];
|
|
679
680
|
};
|
|
680
|
-
type ActionHandler<TDatasources = unknown> = (ctx: AppContext<TDatasources>) => Promise<unknown> | unknown;
|
|
681
|
-
type ServiceActionsSchema<TDatasources = unknown> = {
|
|
681
|
+
type ActionHandler<TDatasources = unknown> = (this: Service, ctx: AppContext<TDatasources>) => Promise<unknown> | unknown;
|
|
682
|
+
type ServiceActionsSchema<TDatasources = unknown, TSettings = unknown> = {
|
|
682
683
|
[key: string]: ({
|
|
683
684
|
params?: any;
|
|
684
|
-
handler: (ctx: AppContext<TDatasources, any>) => Promise<unknown> | unknown;
|
|
685
|
+
handler: (this: Service<TSettings>, ctx: AppContext<TDatasources, any>) => Promise<unknown> | unknown;
|
|
685
686
|
permissions?: string | string[];
|
|
686
687
|
} & Pick<ActionSchema, 'name' | 'rest' | 'visibility' | 'service' | 'cache' | 'tracing' | 'bulkhead' | 'circuitBreaker' | 'retryPolicy' | 'fallback' | 'hooks'>) | ActionHandler<TDatasources> | false;
|
|
687
688
|
};
|
|
@@ -689,9 +690,9 @@ interface ServiceSchema<TSettings = unknown, TDatasources = unknown> extends Omi
|
|
|
689
690
|
name: string;
|
|
690
691
|
version?: string | number;
|
|
691
692
|
settings?: TSettings;
|
|
692
|
-
actions?: ServiceActionsSchema<TDatasources>;
|
|
693
|
+
actions?: ServiceActionsSchema<TDatasources, TSettings>;
|
|
693
694
|
events?: ServiceEvents;
|
|
694
|
-
methods?:
|
|
695
|
+
methods?: ThisType<Service<TSettings>>;
|
|
695
696
|
hooks?: ServiceHooks;
|
|
696
697
|
dependencies?: string | string[];
|
|
697
698
|
metadata?: Record<string, any>;
|
package/dist/index.js
CHANGED
|
@@ -1068,6 +1068,7 @@ var IntegrationPlatform = /* @__PURE__ */ ((IntegrationPlatform2) => {
|
|
|
1068
1068
|
IntegrationPlatform2["FACEBOOK"] = "facebook";
|
|
1069
1069
|
IntegrationPlatform2["DISCORD"] = "discord";
|
|
1070
1070
|
IntegrationPlatform2["WEBCHAT"] = "webchat";
|
|
1071
|
+
IntegrationPlatform2["ZALO"] = "zalo";
|
|
1071
1072
|
IntegrationPlatform2["CUSTOM"] = "custom";
|
|
1072
1073
|
return IntegrationPlatform2;
|
|
1073
1074
|
})(IntegrationPlatform || {});
|