@nx-ddd/x 19.85.0 → 19.86.1
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/package.json +4 -4
- package/src/lib/x.config.d.ts +1 -0
- package/src/lib/x.providers.d.ts +12 -0
- package/src/lib/x.providers.js +13 -0
- package/src/lib/x.service.impl.d.ts +0 -10
- package/src/lib/x.service.impl.js +0 -8
- package/src/lib/x.service.mock.d.ts +7 -1
- package/src/lib/x.service.mock.js +26 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx-ddd/x",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.86.1",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"homepage": "https://github.com/xx-machina/plaform/tree/main/packages/@nx-ddd/x",
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
|
12
12
|
"@angular/core": "19.1.4",
|
|
13
|
-
"@nx-ddd/common": "19.
|
|
14
|
-
"@nx-ddd/core": "19.
|
|
15
|
-
"@nx-ddd/firestore": "19.
|
|
13
|
+
"@nx-ddd/common": "19.86.1",
|
|
14
|
+
"@nx-ddd/core": "19.86.1",
|
|
15
|
+
"@nx-ddd/firestore": "19.86.1",
|
|
16
16
|
"class-validator": "^0.14.0",
|
|
17
17
|
"dayjs": "1.11.13",
|
|
18
18
|
"tslib": "^2.3.0",
|
package/src/lib/x.config.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { XConfig } from './x.config';
|
|
2
|
+
import { XServiceImpl } from './x.service.impl';
|
|
3
|
+
import { XServiceMockSendImpl } from './x.service.mock';
|
|
4
|
+
export declare function provideXConfig(config: XConfig): ({
|
|
5
|
+
provide: import("@angular/core").InjectionToken<XServiceImpl>;
|
|
6
|
+
useClass: typeof XServiceMockSendImpl;
|
|
7
|
+
useValue?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
provide: import("@angular/core").InjectionToken<XConfig>;
|
|
10
|
+
useValue: XConfig;
|
|
11
|
+
useClass?: undefined;
|
|
12
|
+
})[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.provideXConfig = provideXConfig;
|
|
4
|
+
const x_config_1 = require("./x.config");
|
|
5
|
+
const x_service_1 = require("./x.service");
|
|
6
|
+
const x_service_impl_1 = require("./x.service.impl");
|
|
7
|
+
const x_service_mock_1 = require("./x.service.mock");
|
|
8
|
+
function provideXConfig(config) {
|
|
9
|
+
return [
|
|
10
|
+
{ provide: x_service_1.X_SERVICE, useClass: config.mockSend ? x_service_mock_1.XServiceMockSendImpl : x_service_impl_1.XServiceImpl },
|
|
11
|
+
{ provide: x_config_1.X_CONFIG, useValue: config },
|
|
12
|
+
];
|
|
13
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { MessageEvent } from './domain/models/message-event';
|
|
2
2
|
import { TwitterToken } from './domain/models/token';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
|
-
import { XConfig } from './x.config';
|
|
5
4
|
import { ApiResponseError, TwitterApi } from 'twitter-api-v2';
|
|
6
5
|
import { TwitterUser } from './domain/models';
|
|
7
6
|
export declare class XServiceImpl {
|
|
@@ -48,12 +47,3 @@ export declare class XServiceImpl {
|
|
|
48
47
|
like(tweetId: string): Promise<void>;
|
|
49
48
|
isApiResponseError(error: any): error is ApiResponseError;
|
|
50
49
|
}
|
|
51
|
-
export declare function provideXConfig(config: XConfig): ({
|
|
52
|
-
provide: import("@angular/core").InjectionToken<XServiceImpl>;
|
|
53
|
-
useClass: typeof XServiceImpl;
|
|
54
|
-
useValue?: undefined;
|
|
55
|
-
} | {
|
|
56
|
-
provide: import("@angular/core").InjectionToken<XConfig>;
|
|
57
|
-
useValue: XConfig;
|
|
58
|
-
useClass?: undefined;
|
|
59
|
-
})[];
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.XServiceImpl = void 0;
|
|
4
|
-
exports.provideXConfig = provideXConfig;
|
|
5
4
|
const tslib_1 = require("tslib");
|
|
6
5
|
const core_1 = require("@angular/core");
|
|
7
6
|
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
8
7
|
const x_config_1 = require("./x.config");
|
|
9
8
|
const twitter_api_v2_1 = require("twitter-api-v2");
|
|
10
|
-
const x_service_1 = require("./x.service");
|
|
11
9
|
let XServiceImpl = class XServiceImpl {
|
|
12
10
|
constructor() {
|
|
13
11
|
this.config = (0, core_1.inject)(x_config_1.X_CONFIG);
|
|
@@ -251,9 +249,3 @@ exports.XServiceImpl = XServiceImpl;
|
|
|
251
249
|
exports.XServiceImpl = XServiceImpl = tslib_1.__decorate([
|
|
252
250
|
(0, core_1.Injectable)()
|
|
253
251
|
], XServiceImpl);
|
|
254
|
-
function provideXConfig(config) {
|
|
255
|
-
return [
|
|
256
|
-
{ provide: x_service_1.X_SERVICE, useClass: XServiceImpl },
|
|
257
|
-
{ provide: x_config_1.X_CONFIG, useValue: config },
|
|
258
|
-
];
|
|
259
|
-
}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { TwitterApi } from "twitter-api-v2";
|
|
2
|
+
import { XServiceImpl } from './x.service.impl';
|
|
3
|
+
export declare class XServiceMockSendImpl extends XServiceImpl {
|
|
4
|
+
sendReply(client: TwitterApi | undefined, tweetId: string, text: string): Promise<void>;
|
|
5
|
+
reply(client: TwitterApi | undefined, tweetId: string, text: string): Promise<void>;
|
|
6
|
+
sendDirectMessage(client: TwitterApi | undefined, recipientId: string, text: string): Promise<any>;
|
|
7
|
+
}
|
|
@@ -1,2 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.XServiceMockSendImpl = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@angular/core");
|
|
6
|
+
const x_service_impl_1 = require("./x.service.impl");
|
|
7
|
+
let XServiceMockSendImpl = class XServiceMockSendImpl extends x_service_impl_1.XServiceImpl {
|
|
8
|
+
sendReply() {
|
|
9
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (client = this.consumerClient, tweetId, text) {
|
|
10
|
+
console.warn(`[XServiceMockSendImpl] sendReply skipped (mockSend=true). tweetId: ${tweetId}, text: ${text}`);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
reply() {
|
|
14
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (client = this.consumerClient, tweetId, text) {
|
|
15
|
+
console.warn(`[XServiceMockSendImpl] reply skipped (mockSend=true). tweetId: ${tweetId}, text: ${text}`);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
sendDirectMessage() {
|
|
19
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (client = this.consumerClient, recipientId, text) {
|
|
20
|
+
console.warn(`[XServiceMockSendImpl] sendDirectMessage skipped (mockSend=true). recipientId: ${recipientId}, text: ${text}`);
|
|
21
|
+
return {};
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
exports.XServiceMockSendImpl = XServiceMockSendImpl;
|
|
26
|
+
exports.XServiceMockSendImpl = XServiceMockSendImpl = tslib_1.__decorate([
|
|
27
|
+
(0, core_1.Injectable)()
|
|
28
|
+
], XServiceMockSendImpl);
|