@coast/service-common 1.0.7 → 1.0.9

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.
Files changed (59) hide show
  1. package/package.json +8 -6
  2. package/dist/lib/models/Constants.d.ts +0 -4
  3. package/dist/lib/models/Constants.js +0 -7
  4. package/dist/lib/models/coast-api/CoastApiModuleAsyncOptions.d.ts +0 -7
  5. package/dist/lib/models/coast-api/CoastApiModuleAsyncOptions.js +0 -2
  6. package/dist/lib/models/coast-api/CoastApiOptions.d.ts +0 -4
  7. package/dist/lib/models/coast-api/CoastApiOptions.js +0 -2
  8. package/dist/lib/models/coast-api/CoastApiRequests.d.ts +0 -70
  9. package/dist/lib/models/coast-api/CoastApiRequests.js +0 -254
  10. package/dist/lib/models/coast-api/WorkflowEntityGqlFields.d.ts +0 -3
  11. package/dist/lib/models/coast-api/WorkflowEntityGqlFields.js +0 -14
  12. package/dist/lib/models/coast-api/WorkflowTemplateGqlFields.d.ts +0 -3
  13. package/dist/lib/models/coast-api/WorkflowTemplateGqlFields.js +0 -129
  14. package/dist/lib/models/logger/LogLevel.d.ts +0 -8
  15. package/dist/lib/models/logger/LogLevel.js +0 -12
  16. package/dist/lib/models/logger/LoggerModuleAsyncOptions.d.ts +0 -7
  17. package/dist/lib/models/logger/LoggerModuleAsyncOptions.js +0 -2
  18. package/dist/lib/models/logger/LoggerOptions.d.ts +0 -5
  19. package/dist/lib/models/logger/LoggerOptions.js +0 -2
  20. package/dist/lib/modules/coast-api/CoastApiClient.d.ts +0 -46
  21. package/dist/lib/modules/coast-api/CoastApiClient.js +0 -124
  22. package/dist/lib/modules/coast-api/CoastApiClientGqlError.d.ts +0 -12
  23. package/dist/lib/modules/coast-api/CoastApiClientGqlError.js +0 -10
  24. package/dist/lib/modules/coast-api/CoastApiModule.d.ts +0 -6
  25. package/dist/lib/modules/coast-api/CoastApiModule.js +0 -42
  26. package/dist/lib/modules/logger/CoastLogger.d.ts +0 -8
  27. package/dist/lib/modules/logger/CoastLogger.js +0 -6
  28. package/dist/lib/modules/logger/LoggerModule.d.ts +0 -7
  29. package/dist/lib/modules/logger/LoggerModule.js +0 -56
  30. package/dist/lib/modules/logger/PinoLogger.d.ts +0 -13
  31. package/dist/lib/modules/logger/PinoLogger.js +0 -81
  32. package/dist/lib/modules/logger/SilentLogger.d.ts +0 -8
  33. package/dist/lib/modules/logger/SilentLogger.js +0 -22
  34. package/dist/lib/modules/trace/Trace.d.ts +0 -5
  35. package/dist/lib/modules/trace/Trace.js +0 -2
  36. package/dist/lib/modules/trace/TraceId.d.ts +0 -3
  37. package/dist/lib/modules/trace/TraceId.js +0 -6
  38. package/dist/lib/modules/trace/TraceInterceptor.d.ts +0 -8
  39. package/dist/lib/modules/trace/TraceInterceptor.js +0 -30
  40. package/dist/lib/modules/trace/TraceManager.d.ts +0 -9
  41. package/dist/lib/modules/trace/TraceManager.js +0 -40
  42. package/dist/lib/modules/trace/TraceModule.d.ts +0 -2
  43. package/dist/lib/modules/trace/TraceModule.js +0 -22
  44. package/dist/lib/modules/trace/Traceable.d.ts +0 -4
  45. package/dist/lib/modules/trace/Traceable.js +0 -2
  46. package/dist/lib/modules/utils/graphql/GqlRequestBody.d.ts +0 -8
  47. package/dist/lib/modules/utils/graphql/GqlRequestBody.js +0 -2
  48. package/dist/lib/modules/utils/graphql/GqlResponse.d.ts +0 -14
  49. package/dist/lib/modules/utils/graphql/GqlResponse.js +0 -2
  50. package/dist/lib/modules/utils/streams/Generators.d.ts +0 -5
  51. package/dist/lib/modules/utils/streams/Generators.js +0 -34
  52. package/dist/lib/modules/utils/streams/test/GeneratorsTest.d.ts +0 -1
  53. package/dist/lib/modules/utils/streams/test/GeneratorsTest.js +0 -49
  54. package/dist/test/ModuleTest.d.ts +0 -1
  55. package/dist/test/ModuleTest.js +0 -14
  56. package/dist/test/TestApp.d.ts +0 -2
  57. package/dist/test/TestApp.js +0 -14
  58. package/dist/test/TestModule.d.ts +0 -2
  59. package/dist/test/TestModule.js +0 -41
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const common_test_1 = require("@paradoxical-io/common-test");
4
- const Generators_1 = require("../Generators");
5
- test('take async', async () => {
6
- const data = [];
7
- for await (const i of Generators_1.Generators.take(infinityAsync(), 10)) {
8
- data.push(i);
9
- }
10
- (0, common_test_1.safeExpect)(data).toEqual([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
11
- });
12
- test('chunked async', async () => {
13
- const data = [];
14
- const chunked = Generators_1.Generators.chunked(infinityAsync(), 2);
15
- for await (const i of Generators_1.Generators.take(chunked, 2)) {
16
- data.push(i);
17
- }
18
- (0, common_test_1.safeExpect)(data).toEqual([
19
- [0, 1],
20
- [2, 3],
21
- ]);
22
- });
23
- test('chunked async with end', async () => {
24
- const data = [];
25
- const chunked = Generators_1.Generators.chunked(Generators_1.Generators.take(infinityAsync(), 10), 4);
26
- for await (const i of Generators_1.Generators.take(chunked, 3)) {
27
- data.push(i);
28
- }
29
- (0, common_test_1.safeExpect)(data).toEqual([
30
- [0, 1, 2, 3],
31
- [4, 5, 6, 7],
32
- [8, 9],
33
- ]);
34
- });
35
- test('map async', async () => {
36
- const data = [];
37
- const mapped = Generators_1.Generators.map(infinityAsync(), (i) => i.toString());
38
- for await (const i of Generators_1.Generators.take(mapped, 2)) {
39
- data.push(i);
40
- }
41
- (0, common_test_1.safeExpect)(data).toEqual(['0', '1']);
42
- });
43
- async function* infinityAsync() {
44
- let start = 0;
45
- while (true) {
46
- yield start;
47
- start++;
48
- }
49
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const common_test_1 = require("@paradoxical-io/common-test");
4
- const CoastApiClient_1 = require("../lib/modules/coast-api/CoastApiClient");
5
- const CoastLogger_1 = require("../lib/modules/logger/CoastLogger");
6
- const TestApp_1 = require("./TestApp");
7
- test('TestModule', async () => {
8
- const app = await (0, TestApp_1.initTestApp)();
9
- (0, common_test_1.safeExpect)(app).toBeDefined();
10
- const logger = app.get(CoastLogger_1.CoastLogger);
11
- (0, common_test_1.safeExpect)(logger).toBeDefined();
12
- const apiClient = app.get(CoastApiClient_1.CoastApiClient);
13
- (0, common_test_1.safeExpect)(apiClient).toBeDefined();
14
- });
@@ -1,2 +0,0 @@
1
- import { INestApplication } from '@nestjs/common';
2
- export declare function initTestApp(): Promise<INestApplication>;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initTestApp = initTestApp;
4
- const testing_1 = require("@nestjs/testing");
5
- const TestModule_1 = require("./TestModule");
6
- let app;
7
- async function initTestApp() {
8
- const moduleFixture = await testing_1.Test.createTestingModule({
9
- imports: [TestModule_1.TestModule],
10
- }).compile();
11
- app = moduleFixture.createNestApplication({});
12
- await app.init();
13
- return app;
14
- }
@@ -1,2 +0,0 @@
1
- export declare class TestModule {
2
- }
@@ -1,41 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.TestModule = void 0;
10
- const common_1 = require("@nestjs/common");
11
- const config_1 = require("@nestjs/config");
12
- const CoastApiModule_1 = require("../lib/modules/coast-api/CoastApiModule");
13
- const LoggerModule_1 = require("../lib/modules/logger/LoggerModule");
14
- let TestModule = class TestModule {
15
- };
16
- exports.TestModule = TestModule;
17
- exports.TestModule = TestModule = __decorate([
18
- (0, common_1.Module)({
19
- imports: [
20
- config_1.ConfigModule.forRoot({
21
- isGlobal: true,
22
- }),
23
- LoggerModule_1.LoggerModule.forRootAsync({
24
- imports: [config_1.ConfigModule],
25
- inject: [config_1.ConfigService],
26
- useFactory: async (configService) => ({
27
- level: configService.get('LOG_LEVEL'),
28
- pretty: configService.get('LOG_PRETTY'),
29
- }),
30
- }),
31
- CoastApiModule_1.CoastApiModule.forRootAsync({
32
- imports: [config_1.ConfigModule],
33
- inject: [config_1.ConfigService],
34
- useFactory: async (configService) => ({
35
- endpoint: configService.getOrThrow('COAST_API_ENDPOINT'),
36
- authToken: configService.getOrThrow('COAST_API_AUTH_TOKEN'),
37
- }),
38
- }),
39
- ],
40
- })
41
- ], TestModule);