@accon/connect 0.7.0 → 0.8.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/.idea/codeStyles/Project.xml +67 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/connect.iml +12 -0
- package/.idea/inspectionProfiles/Project_Default.xml +11 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/dist/core/interfaces/webhook-input-integration.interface.d.ts +1 -1
- package/dist/core/types/flags.type.d.ts +1 -0
- package/dist/core/types/flags.type.js +1 -0
- package/dist/core/types/flags.type.js.map +1 -1
- package/dist/core/types/integration-event.type.d.ts +1 -1
- package/dist/core/types/integration-event.type.js +1 -0
- package/dist/core/types/integration-event.type.js.map +1 -1
- package/dist/logistics/lalamove/dto/create-lalamove-order.dto.d.ts +14 -0
- package/dist/logistics/lalamove/dto/create-lalamove-order.dto.js +17 -0
- package/dist/logistics/lalamove/dto/create-lalamove-order.dto.js.map +1 -0
- package/dist/logistics/lalamove/lalamove.config.d.ts +25 -0
- package/dist/logistics/lalamove/lalamove.config.js +27 -0
- package/dist/logistics/lalamove/lalamove.config.js.map +1 -0
- package/dist/logistics/lalamove/lalamove.order-output.d.ts +20 -0
- package/dist/logistics/lalamove/lalamove.order-output.js +285 -0
- package/dist/logistics/lalamove/lalamove.order-output.js.map +1 -0
- package/dist/logistics/voa-delivery/dto/create-voa-delivery-order-response.dto.d.ts +4 -0
- package/dist/logistics/voa-delivery/dto/create-voa-delivery-order-response.dto.js +9 -0
- package/dist/logistics/voa-delivery/dto/create-voa-delivery-order-response.dto.js.map +1 -0
- package/dist/logistics/voa-delivery/dto/create-voa-delivery-order.dto.d.ts +42 -0
- package/dist/logistics/voa-delivery/dto/create-voa-delivery-order.dto.js +27 -0
- package/dist/logistics/voa-delivery/dto/create-voa-delivery-order.dto.js.map +1 -0
- package/dist/logistics/voa-delivery/dto/webhook-body.dto.d.ts +8 -0
- package/dist/logistics/voa-delivery/dto/webhook-body.dto.js +13 -0
- package/dist/logistics/voa-delivery/dto/webhook-body.dto.js.map +1 -0
- package/dist/logistics/voa-delivery/voa-delivery.config.d.ts +15 -0
- package/dist/logistics/voa-delivery/voa-delivery.config.js +17 -0
- package/dist/logistics/voa-delivery/voa-delivery.config.js.map +1 -0
- package/dist/logistics/voa-delivery/voa-delivery.order-output.d.ts +24 -0
- package/dist/logistics/voa-delivery/voa-delivery.order-output.js +250 -0
- package/dist/logistics/voa-delivery/voa-delivery.order-output.js.map +1 -0
- package/dist/order/saipos/dto/create-order.dto.d.ts +1 -1
- package/dist/order/saipos/dto/create-order.dto.js.map +1 -1
- package/dist/order/saipos/saipos.order-output.d.ts +8 -8
- package/dist/order/saipos/saipos.order-output.js +11 -12
- package/dist/order/saipos/saipos.order-output.js.map +1 -1
- package/dist/order/totvs-chef/totvs-chef.order-output.d.ts +3 -3
- package/dist/order/totvs-chef/totvs-chef.order-output.js +15 -15
- package/dist/order/totvs-chef/totvs-chef.order-output.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
+
<code_scheme name="Project" version="173">
|
|
3
|
+
<option name="DO_NOT_FORMAT">
|
|
4
|
+
<list>
|
|
5
|
+
<fileSet type="globPattern" pattern="migrations/*" />
|
|
6
|
+
</list>
|
|
7
|
+
</option>
|
|
8
|
+
<HTMLCodeStyleSettings>
|
|
9
|
+
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
10
|
+
</HTMLCodeStyleSettings>
|
|
11
|
+
<JSCodeStyleSettings version="0">
|
|
12
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
13
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
14
|
+
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
15
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
16
|
+
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
17
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
18
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
19
|
+
</JSCodeStyleSettings>
|
|
20
|
+
<TypeScriptCodeStyleSettings version="0">
|
|
21
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
22
|
+
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
23
|
+
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
24
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
25
|
+
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
26
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
27
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
28
|
+
</TypeScriptCodeStyleSettings>
|
|
29
|
+
<VueCodeStyleSettings>
|
|
30
|
+
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
31
|
+
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
32
|
+
</VueCodeStyleSettings>
|
|
33
|
+
<editorconfig>
|
|
34
|
+
<option name="ENABLED" value="false" />
|
|
35
|
+
</editorconfig>
|
|
36
|
+
<codeStyleSettings language="HTML">
|
|
37
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
38
|
+
<indentOptions>
|
|
39
|
+
<option name="INDENT_SIZE" value="2" />
|
|
40
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
41
|
+
<option name="TAB_SIZE" value="2" />
|
|
42
|
+
</indentOptions>
|
|
43
|
+
</codeStyleSettings>
|
|
44
|
+
<codeStyleSettings language="JavaScript">
|
|
45
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
46
|
+
<indentOptions>
|
|
47
|
+
<option name="INDENT_SIZE" value="2" />
|
|
48
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
49
|
+
<option name="TAB_SIZE" value="2" />
|
|
50
|
+
</indentOptions>
|
|
51
|
+
</codeStyleSettings>
|
|
52
|
+
<codeStyleSettings language="TypeScript">
|
|
53
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
54
|
+
<indentOptions>
|
|
55
|
+
<option name="INDENT_SIZE" value="2" />
|
|
56
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
57
|
+
<option name="TAB_SIZE" value="2" />
|
|
58
|
+
</indentOptions>
|
|
59
|
+
</codeStyleSettings>
|
|
60
|
+
<codeStyleSettings language="Vue">
|
|
61
|
+
<option name="SOFT_MARGINS" value="80" />
|
|
62
|
+
<indentOptions>
|
|
63
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
64
|
+
</indentOptions>
|
|
65
|
+
</codeStyleSettings>
|
|
66
|
+
</code_scheme>
|
|
67
|
+
</component>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
7
|
+
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
+
</content>
|
|
9
|
+
<orderEntry type="inheritedJdk" />
|
|
10
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
+
</component>
|
|
12
|
+
</module>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<component name="InspectionProjectProfileManager">
|
|
2
|
+
<profile version="1.0">
|
|
3
|
+
<option name="myName" value="Project Default" />
|
|
4
|
+
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
|
5
|
+
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
|
6
|
+
<option name="processCode" value="true" />
|
|
7
|
+
<option name="processLiterals" value="true" />
|
|
8
|
+
<option name="processComments" value="true" />
|
|
9
|
+
</inspection_tool>
|
|
10
|
+
</profile>
|
|
11
|
+
</component>
|
package/.idea/vcs.xml
ADDED
|
@@ -2,6 +2,6 @@ export type WebhookCallbackEntity = 'IntegrationEvent' | 'OrderEvent';
|
|
|
2
2
|
export type WebhookCallbackAction = 'create' | 'read' | 'update' | 'delete';
|
|
3
3
|
export type WebhookCallback = (entity: WebhookCallbackEntity, action: WebhookCallbackAction, payload: unknown) => Promise<void>;
|
|
4
4
|
export interface WebhookInputIntegration<B = unknown, Q = Record<string, unknown>, H = Record<string, string | string[]>> {
|
|
5
|
-
readonly usesWebhook:
|
|
5
|
+
readonly usesWebhook: boolean;
|
|
6
6
|
onWebhookData(callback: WebhookCallback, body: B, queryParams?: Q, headers?: H): Promise<void>;
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.type.js","sourceRoot":"","sources":["../../../lib/core/types/flags.type.ts"],"names":[],"mappings":";;;AAAA,MAAa,KAAK;IAChB,qBAAqB,CAAY;
|
|
1
|
+
{"version":3,"file":"flags.type.js","sourceRoot":"","sources":["../../../lib/core/types/flags.type.ts"],"names":[],"mappings":";;;AAAA,MAAa,KAAK;IAChB,qBAAqB,CAAY;IACjC,sBAAsB,CAAY;CACnC;AAHD,sBAGC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IntegrationType } from './integration-type.type';
|
|
2
|
-
export type IntegrationEventType = 'INTEGRATION_INITIATED' | 'INTEGRATION_REQUESTED' | 'INTEGRATION_PROCESSING' | 'INTEGRATION_COMPLETED' | 'INTEGRATION_FAILED' | 'INTEGRATION_RETRIED' | 'INTEGRATION_CANCELLED';
|
|
2
|
+
export type IntegrationEventType = 'INTEGRATION_INITIATED' | 'INTEGRATION_REQUESTED' | 'INTEGRATION_PROCESSING' | 'INTEGRATION_COMPLETED' | 'INTEGRATION_FAILED' | 'INTEGRATION_RETRIED' | 'INTEGRATION_CANCELLED' | 'INTEGRATION_WEBHOOK_UPDATE';
|
|
3
3
|
export interface IntegrationEvent {
|
|
4
4
|
integrationName: string;
|
|
5
5
|
integrationType: IntegrationType;
|
|
@@ -9,5 +9,6 @@ exports.IntegrationEventDescriptions = {
|
|
|
9
9
|
INTEGRATION_FAILED: 'Falha na integração',
|
|
10
10
|
INTEGRATION_RETRIED: 'Tentativa de nova integração',
|
|
11
11
|
INTEGRATION_CANCELLED: 'Integração cancelada',
|
|
12
|
+
INTEGRATION_WEBHOOK_UPDATE: 'Atualização via webhook recebida',
|
|
12
13
|
};
|
|
13
14
|
//# sourceMappingURL=integration-event.type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-event.type.js","sourceRoot":"","sources":["../../../lib/core/types/integration-event.type.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"integration-event.type.js","sourceRoot":"","sources":["../../../lib/core/types/integration-event.type.ts"],"names":[],"mappings":";;;AAwBa,QAAA,4BAA4B,GAGrC;IACF,qBAAqB,EAAE,qBAAqB;IAC5C,qBAAqB,EAAE,8CAA8C;IACrE,sBAAsB,EAAE,0CAA0C;IAClE,qBAAqB,EAAE,kCAAkC;IACzD,kBAAkB,EAAE,qBAAqB;IACzC,mBAAmB,EAAE,8BAA8B;IACnD,qBAAqB,EAAE,sBAAsB;IAC7C,0BAA0B,EAAE,kCAAkC;CAC/D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class AddressDto {
|
|
2
|
+
coordinates: {
|
|
3
|
+
lat: string;
|
|
4
|
+
lng: string;
|
|
5
|
+
};
|
|
6
|
+
address: string;
|
|
7
|
+
complement?: string;
|
|
8
|
+
reference?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class Quotation {
|
|
11
|
+
quotationId: string;
|
|
12
|
+
originStopId: string;
|
|
13
|
+
destinationStopId: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Quotation = exports.AddressDto = void 0;
|
|
4
|
+
class AddressDto {
|
|
5
|
+
coordinates;
|
|
6
|
+
address;
|
|
7
|
+
complement;
|
|
8
|
+
reference;
|
|
9
|
+
}
|
|
10
|
+
exports.AddressDto = AddressDto;
|
|
11
|
+
class Quotation {
|
|
12
|
+
quotationId;
|
|
13
|
+
originStopId;
|
|
14
|
+
destinationStopId;
|
|
15
|
+
}
|
|
16
|
+
exports.Quotation = Quotation;
|
|
17
|
+
//# sourceMappingURL=create-lalamove-order.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-lalamove-order.dto.js","sourceRoot":"","sources":["../../../../lib/logistics/lalamove/dto/create-lalamove-order.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,UAAU;IACrB,WAAW,CAGT;IACF,OAAO,CAAS;IAChB,UAAU,CAAU;IACpB,SAAS,CAAU;CACpB;AARD,gCAQC;AAED,MAAa,SAAS;IACpB,WAAW,CAAS;IACpB,YAAY,CAAS;IACrB,iBAAiB,CAAS;CAC3B;AAJD,8BAIC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FromSchema } from 'json-schema-to-ts';
|
|
2
|
+
export declare const LALAMOVE_CONFIG_SCHEMA: {
|
|
3
|
+
readonly $schema: "http://json-schema.org/draft-07/schema#";
|
|
4
|
+
readonly title: "Lalamove Configuration";
|
|
5
|
+
readonly type: "object";
|
|
6
|
+
readonly properties: {
|
|
7
|
+
readonly LALAMOVE_KEY: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly title: "Key";
|
|
10
|
+
readonly description: "Chave fornecida pela Lalamove";
|
|
11
|
+
};
|
|
12
|
+
readonly LALAMOVE_SECRET: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly title: "Secret";
|
|
15
|
+
readonly description: "Código de segredo fornecido pela Lalamove";
|
|
16
|
+
};
|
|
17
|
+
readonly ASSIGN_DRIVER_INSTANTLY: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
readonly title: "Acionar motorista imediatamente após a criação do pedido";
|
|
20
|
+
readonly description: "Escreva o status \"INSTANT\" para acionar o motorista imediatamente após a criação do pedido na Lalamove.";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
readonly required: readonly ["key", "secret"];
|
|
24
|
+
};
|
|
25
|
+
export type LalamoveConfig = FromSchema<typeof LALAMOVE_CONFIG_SCHEMA>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LALAMOVE_CONFIG_SCHEMA = void 0;
|
|
4
|
+
exports.LALAMOVE_CONFIG_SCHEMA = {
|
|
5
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
6
|
+
title: 'Lalamove Configuration',
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
LALAMOVE_KEY: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
title: 'Key',
|
|
12
|
+
description: 'Chave fornecida pela Lalamove',
|
|
13
|
+
},
|
|
14
|
+
LALAMOVE_SECRET: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
title: 'Secret',
|
|
17
|
+
description: 'Código de segredo fornecido pela Lalamove',
|
|
18
|
+
},
|
|
19
|
+
ASSIGN_DRIVER_INSTANTLY: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
title: 'Acionar motorista imediatamente após a criação do pedido',
|
|
22
|
+
description: 'Escreva o status "INSTANT" para acionar o motorista imediatamente após a criação do pedido na Lalamove.',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
required: ['key', 'secret'],
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=lalamove.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lalamove.config.js","sourceRoot":"","sources":["../../../lib/logistics/lalamove/lalamove.config.ts"],"names":[],"mappings":";;;AAEa,QAAA,sBAAsB,GAAG;IACpC,OAAO,EAAE,yCAAyC;IAClD,KAAK,EAAE,wBAAwB;IAC/B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,KAAK;YACZ,WAAW,EAAE,+BAA+B;SAC7C;QACD,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,2CAA2C;SACzD;QACD,uBAAuB,EAAE;YACvB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,0DAA0D;YACjE,WAAW,EACT,yGAAyG;SAC5G;KACF;IACD,QAAQ,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;CACE,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EventsService, IntegrationPayload, Merchant, Order } from '../../core/index.js';
|
|
2
|
+
import { LalamoveConfig } from './lalamove.config';
|
|
3
|
+
import { HttpService } from '@nestjs/axios';
|
|
4
|
+
import { Quotation } from './dto/create-lalamove-order.dto';
|
|
5
|
+
export declare class LalamoveOrderOutput {
|
|
6
|
+
readonly eventsService: EventsService;
|
|
7
|
+
private readonly httpService;
|
|
8
|
+
private readonly logger;
|
|
9
|
+
private readonly LALAMOVE_BASE_URL;
|
|
10
|
+
private readonly TIMEOUT_MS;
|
|
11
|
+
private readonly dispatchEvent;
|
|
12
|
+
constructor(eventsService: EventsService, httpService: HttpService);
|
|
13
|
+
onOrderCreated(payload: IntegrationPayload, config: LalamoveConfig): Promise<void>;
|
|
14
|
+
onOrderUpdated(payload: IntegrationPayload, config: LalamoveConfig): Promise<void>;
|
|
15
|
+
createRide(payload: IntegrationPayload, config: LalamoveConfig): Promise<void>;
|
|
16
|
+
getQuote(order: Order, merchant: Merchant, config: LalamoveConfig): Promise<Quotation>;
|
|
17
|
+
placeOrder(order: Order, merchant: Merchant, quotation: Quotation, config: LalamoveConfig): Promise<void>;
|
|
18
|
+
private getSignature;
|
|
19
|
+
private getHeader;
|
|
20
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
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
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var LalamoveOrderOutput_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.LalamoveOrderOutput = void 0;
|
|
14
|
+
const core_1 = require("../../core/index.js");
|
|
15
|
+
const lalamove_config_1 = require("./lalamove.config");
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const axios_1 = require("@nestjs/axios");
|
|
18
|
+
const rxjs_1 = require("rxjs");
|
|
19
|
+
const node_crypto_1 = require("node:crypto");
|
|
20
|
+
let LalamoveOrderOutput = LalamoveOrderOutput_1 = class LalamoveOrderOutput {
|
|
21
|
+
eventsService;
|
|
22
|
+
httpService;
|
|
23
|
+
logger = new common_1.Logger(LalamoveOrderOutput_1.name);
|
|
24
|
+
LALAMOVE_BASE_URL;
|
|
25
|
+
TIMEOUT_MS = 6_000;
|
|
26
|
+
dispatchEvent;
|
|
27
|
+
constructor(eventsService, httpService) {
|
|
28
|
+
this.eventsService = eventsService;
|
|
29
|
+
this.httpService = httpService;
|
|
30
|
+
this.LALAMOVE_BASE_URL =
|
|
31
|
+
process.env.LALAMOVE_BASE_URL || 'https://rest.lalamove.com';
|
|
32
|
+
this.dispatchEvent = eventsService.createDispatcherFor('Lalamove', 'OrderOutput');
|
|
33
|
+
}
|
|
34
|
+
async onOrderCreated(payload, config) {
|
|
35
|
+
const { order } = payload;
|
|
36
|
+
const orderId = parseInt(order.externalId);
|
|
37
|
+
if (order.orderTiming === 'SCHEDULED') {
|
|
38
|
+
this.logger.verbose('Ignorando pedido agendado');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
if (config.ASSIGN_DRIVER_INSTANTLY?.toLocaleLowerCase().includes('instant')) {
|
|
43
|
+
return await this.createRide(payload, config);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
this.dispatchEvent({
|
|
48
|
+
eventType: 'INTEGRATION_FAILED',
|
|
49
|
+
orderId,
|
|
50
|
+
metadata: { error: error.message || error },
|
|
51
|
+
});
|
|
52
|
+
this.logger.error(`Erro inesperado ao criar pedido na Lalamove: ${error.message}`, error.stack);
|
|
53
|
+
throw new common_1.BadRequestException('Erro inesperado ao criar pedido na Lalamove. Verifique as informações fornecidas.');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async onOrderUpdated(payload, config) {
|
|
57
|
+
const { order, events } = payload;
|
|
58
|
+
const orderId = parseInt(order.externalId);
|
|
59
|
+
if (config.ASSIGN_DRIVER_INSTANTLY?.toLocaleLowerCase().includes('instant') &&
|
|
60
|
+
order.orderTiming === 'INSTANT') {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
if (events?.some((event) => event.eventType === 'READY_FOR_PICKUP') &&
|
|
65
|
+
(!config.ASSIGN_DRIVER_INSTANTLY?.toLocaleLowerCase().includes('instant') ||
|
|
66
|
+
order.orderTiming === 'SCHEDULED')) {
|
|
67
|
+
return await this.createRide(payload, config);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
this.dispatchEvent({
|
|
72
|
+
eventType: 'INTEGRATION_FAILED',
|
|
73
|
+
orderId,
|
|
74
|
+
metadata: { error: error.message || error },
|
|
75
|
+
});
|
|
76
|
+
this.logger.error(`Erro inesperado ao criar pedido na Lalamove: ${error.message}`, error.stack);
|
|
77
|
+
throw new common_1.BadRequestException('Erro inesperado ao criar pedido na Lalamove. Verifique as informações fornecidas.');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async createRide(payload, config) {
|
|
81
|
+
const { order, merchant } = payload;
|
|
82
|
+
const orderId = parseInt(order.externalId);
|
|
83
|
+
if (order.type != 'DELIVERY') {
|
|
84
|
+
this.logger.verbose('Ignorando pedido com tipo diferente de DELIVERY');
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (!merchant) {
|
|
88
|
+
this.logger.error('Informações da loja ausentes');
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
this.dispatchEvent({
|
|
93
|
+
eventType: 'INTEGRATION_INITIATED',
|
|
94
|
+
orderId,
|
|
95
|
+
});
|
|
96
|
+
this.logger.debug(`createRide: Fazendo cotação de motorista para pedido com id: ${order.id}`);
|
|
97
|
+
const quotation = await this.getQuote(order, merchant, config);
|
|
98
|
+
this.logger.debug('createRide: Cotação recebida', quotation);
|
|
99
|
+
this.dispatchEvent({
|
|
100
|
+
eventType: 'INTEGRATION_PROCESSING',
|
|
101
|
+
orderId,
|
|
102
|
+
metadata: { quotation },
|
|
103
|
+
});
|
|
104
|
+
this.logger.verbose('createRide: Criando corrida na Lalamove');
|
|
105
|
+
const response = await this.placeOrder(order, merchant, quotation, config);
|
|
106
|
+
this.logger.debug('createRide: Corrida criada', response);
|
|
107
|
+
this.dispatchEvent({
|
|
108
|
+
eventType: 'INTEGRATION_COMPLETED',
|
|
109
|
+
orderId,
|
|
110
|
+
metadata: { response },
|
|
111
|
+
});
|
|
112
|
+
return response;
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
throw error;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
async getQuote(order, merchant, config) {
|
|
119
|
+
if (!order.delivery.deliveryAddress ||
|
|
120
|
+
!order.delivery.deliveryAddress.coordinates) {
|
|
121
|
+
this.logger.error('Endereço de entrega ou coordenadas ausentes no pedido');
|
|
122
|
+
throw new common_1.BadRequestException('Endereço de entrega ou coordenadas ausentes no pedido.');
|
|
123
|
+
}
|
|
124
|
+
const { deliveryAddress } = order.delivery;
|
|
125
|
+
const destination = {
|
|
126
|
+
coordinates: {
|
|
127
|
+
lat: deliveryAddress.coordinates.latitude.toString(),
|
|
128
|
+
lng: deliveryAddress.coordinates.longitude.toString(),
|
|
129
|
+
},
|
|
130
|
+
address: order.delivery.deliveryAddress.formattedAddress,
|
|
131
|
+
};
|
|
132
|
+
const merchantAddress = merchant.address;
|
|
133
|
+
const origin = {
|
|
134
|
+
coordinates: {
|
|
135
|
+
lat: merchantAddress.latitude.toString(),
|
|
136
|
+
lng: merchantAddress.longitude.toString(),
|
|
137
|
+
},
|
|
138
|
+
address: `${merchantAddress.street}, ${merchantAddress.number}`,
|
|
139
|
+
};
|
|
140
|
+
const body = {
|
|
141
|
+
data: {
|
|
142
|
+
serviceType: 'LALAGO',
|
|
143
|
+
language: 'pt_BR',
|
|
144
|
+
stops: [origin, destination],
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
const path = `/v3/quotations`;
|
|
148
|
+
const url = `${this.LALAMOVE_BASE_URL}${path}`;
|
|
149
|
+
try {
|
|
150
|
+
const response = await (0, rxjs_1.firstValueFrom)(this.httpService.post(url, body, {
|
|
151
|
+
headers: this.getHeader('POST', path, config, body),
|
|
152
|
+
timeout: this.TIMEOUT_MS,
|
|
153
|
+
}));
|
|
154
|
+
const data = response.data?.data;
|
|
155
|
+
if (!data) {
|
|
156
|
+
this.logger.error('Lalamove response:', response.data);
|
|
157
|
+
throw new common_1.BadRequestException('Resposta inválida da API da Lalamove. Dados ausentes.');
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
quotationId: data.quotationId,
|
|
161
|
+
originStopId: data.stops[0].stopId,
|
|
162
|
+
destinationStopId: data.stops[1].stopId,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
if (error.response) {
|
|
167
|
+
const { status, data, headers } = error.response;
|
|
168
|
+
const errors = data?.errors?.map((err) => err.message).join(', ') ||
|
|
169
|
+
'Detalhes não disponíveis';
|
|
170
|
+
this.logger.error(`Erro na API da Lalamove: ${errors}`, JSON.stringify({
|
|
171
|
+
statusCode: status,
|
|
172
|
+
responseData: data,
|
|
173
|
+
responseHeaders: headers,
|
|
174
|
+
}));
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
this.logger.error('Erro na requisição da Lalamove:', error.message);
|
|
178
|
+
}
|
|
179
|
+
throw new common_1.BadRequestException('Erro inesperado ao obter cotação com a Lalamove. Verifique as informações fornecidas.');
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
async placeOrder(order, merchant, quotation, config) {
|
|
183
|
+
const { quotationId, originStopId, destinationStopId } = quotation;
|
|
184
|
+
let complement = '';
|
|
185
|
+
if (order.delivery.deliveryAddress.complement ||
|
|
186
|
+
order.delivery.deliveryAddress.reference) {
|
|
187
|
+
complement = [
|
|
188
|
+
order.delivery.deliveryAddress.complement?.trim(),
|
|
189
|
+
order.delivery.deliveryAddress.reference?.trim()
|
|
190
|
+
? `Referência: ${order.delivery.deliveryAddress.reference.trim()}`
|
|
191
|
+
: '',
|
|
192
|
+
]
|
|
193
|
+
.filter(Boolean)
|
|
194
|
+
.join('\r\n');
|
|
195
|
+
}
|
|
196
|
+
const senderPhone = `+55${merchant.commercialNumber.replace(/\D/g, '')}`;
|
|
197
|
+
const recipientPhone = order.customer?.phone?.number.startsWith('0800')
|
|
198
|
+
? senderPhone
|
|
199
|
+
: `+55${order.customer?.phone.number.replace(/\D/g, '')}`;
|
|
200
|
+
const body = {
|
|
201
|
+
quotationId: quotationId,
|
|
202
|
+
sender: {
|
|
203
|
+
name: merchant.name,
|
|
204
|
+
phone: senderPhone,
|
|
205
|
+
stopId: originStopId,
|
|
206
|
+
},
|
|
207
|
+
recipients: [
|
|
208
|
+
{
|
|
209
|
+
name: order.customer?.name,
|
|
210
|
+
phone: recipientPhone,
|
|
211
|
+
stopId: destinationStopId,
|
|
212
|
+
remarks: complement,
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
};
|
|
216
|
+
const path = `/v3/orders`;
|
|
217
|
+
const url = `${this.LALAMOVE_BASE_URL}${path}`;
|
|
218
|
+
try {
|
|
219
|
+
this.logger.debug(`Criando pedido com corpo: ${JSON.stringify(body)}`);
|
|
220
|
+
const response = await (0, rxjs_1.firstValueFrom)(this.httpService.post(url, { data: body }, {
|
|
221
|
+
headers: this.getHeader('POST', path, config, { data: body }),
|
|
222
|
+
}));
|
|
223
|
+
const createdOrder = response.data?.data;
|
|
224
|
+
if (!createdOrder) {
|
|
225
|
+
this.logger.error(`Resposta inválida da API Lalamove: ${JSON.stringify(response.data)}`);
|
|
226
|
+
throw new common_1.BadRequestException('Dados ausentes na resposta da Lalamove.');
|
|
227
|
+
}
|
|
228
|
+
this.logger.log(`Pedido criado com sucesso: ${JSON.stringify(response.data)}`);
|
|
229
|
+
return response.data;
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
if (error.response) {
|
|
233
|
+
const { status, data } = error.response;
|
|
234
|
+
const errors = data?.errors?.map((err) => err.message).join(': ') ||
|
|
235
|
+
'Detalhes não disponíveis';
|
|
236
|
+
this.logger.error(`Erro na API Lalamove: ${errors}`, JSON.stringify({
|
|
237
|
+
statusCode: status,
|
|
238
|
+
responseData: data,
|
|
239
|
+
}));
|
|
240
|
+
throw new common_1.BadRequestException(`Erro na API Lalamove: ${status} - ${errors}`);
|
|
241
|
+
}
|
|
242
|
+
this.logger.error(`Erro inesperado ao criar pedido na Lalamove: ${error.message}`, error.stack);
|
|
243
|
+
throw new common_1.BadRequestException('Erro inesperado ao criar pedido na Lalamove. Verifique as informações fornecidas.');
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
getSignature(method, path, time, config, body) {
|
|
247
|
+
let _encryptedStr = `${time.toString()}\r\n${method}\r\n${path}\r\n\r\n`;
|
|
248
|
+
if (method === 'POST') {
|
|
249
|
+
const _body = JSON.stringify(body);
|
|
250
|
+
_encryptedStr = _encryptedStr + _body;
|
|
251
|
+
}
|
|
252
|
+
if (!config.LALAMOVE_SECRET) {
|
|
253
|
+
throw new Error('LALAMOVE_SECRET is required for signature generation.');
|
|
254
|
+
}
|
|
255
|
+
return (0, node_crypto_1.createHmac)('sha256', config.LALAMOVE_SECRET)
|
|
256
|
+
.update(_encryptedStr)
|
|
257
|
+
.digest('hex');
|
|
258
|
+
}
|
|
259
|
+
getHeader(method, path, config, body) {
|
|
260
|
+
const time = new Date().getTime().toString();
|
|
261
|
+
return {
|
|
262
|
+
'Content-type': 'application/json',
|
|
263
|
+
Authorization: `hmac ${config.LALAMOVE_KEY}:${time}:${this.getSignature(method, path, time, config, body)}`,
|
|
264
|
+
Market: 'BR',
|
|
265
|
+
'Request-ID': (0, node_crypto_1.randomUUID)(),
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
exports.LalamoveOrderOutput = LalamoveOrderOutput;
|
|
270
|
+
exports.LalamoveOrderOutput = LalamoveOrderOutput = LalamoveOrderOutput_1 = __decorate([
|
|
271
|
+
(0, core_1.RegistryIntegration)({
|
|
272
|
+
id: 'lalamove',
|
|
273
|
+
type: 'OrderOutput',
|
|
274
|
+
title: 'Lalamove',
|
|
275
|
+
category: 'Logistics',
|
|
276
|
+
description: 'Lalamove é uma plataforma de entrega sob demanda que conecta usuários a motoristas para entregas rápidas e eficientes, oferecendo soluções logísticas flexíveis para empresas e indivíduos.',
|
|
277
|
+
logoUrl: 'https://www.lalamove.com/hubfs/Lalamove%20Website%202020/logo.svg',
|
|
278
|
+
websiteUrl: 'https://www.lalamove.com/',
|
|
279
|
+
configSchema: lalamove_config_1.LALAMOVE_CONFIG_SCHEMA,
|
|
280
|
+
}),
|
|
281
|
+
(0, common_1.Injectable)(),
|
|
282
|
+
__metadata("design:paramtypes", [core_1.EventsService,
|
|
283
|
+
axios_1.HttpService])
|
|
284
|
+
], LalamoveOrderOutput);
|
|
285
|
+
//# sourceMappingURL=lalamove.order-output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lalamove.order-output.js","sourceRoot":"","sources":["../../../lib/logistics/lalamove/lalamove.order-output.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,oCAOmB;AACnB,uDAA2E;AAC3E,2CAAyE;AACzE,yCAA4C;AAE5C,+BAAsC;AACtC,6CAAqD;AAc9C,IAAM,mBAAmB,2BAAzB,MAAM,mBAAmB;IAOnB;IACQ;IAPF,MAAM,GAAG,IAAI,eAAM,CAAC,qBAAmB,CAAC,IAAI,CAAC,CAAC;IAC9C,iBAAiB,CAAC;IAClB,UAAU,GAAG,KAAK,CAAC;IACnB,aAAa,CAA6B;IAE3D,YACW,aAA4B,EACpB,WAAwB;QADhC,kBAAa,GAAb,aAAa,CAAe;QACpB,gBAAW,GAAX,WAAW,CAAa;QAEzC,IAAI,CAAC,iBAAiB;YACpB,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,2BAA2B,CAAC;QAC/D,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC,mBAAmB,CACpD,UAAU,EACV,aAAa,CACd,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,cAAc,CAClB,OAA2B,EAC3B,MAAsB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AAI,IAAI,IAAI,CAAC,YAAY,CACrE,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,IAAI,CACL,EAAE;YACH,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,IAAA,wBAAU,GAAE;SAC3B,CAAC;IACJ,CAAC;CACF,CAAA;AAxXY,kDAAmB;8BAAnB,mBAAmB;IAZ/B,IAAA,0BAAmB,EAAC;QACnB,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,WAAW;QACrB,WAAW,EACT,6LAA6L;QAC/L,OAAO,EAAE,mEAAmE;QAC5E,UAAU,EAAE,2BAA2B;QACvC,YAAY,EAAE,wCAAsB;KACrC,CAAC;IACD,IAAA,mBAAU,GAAE;qCAQe,oBAAa;QACP,mBAAW;GARhC,mBAAmB,CAwX/B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateVoaDeliveryOrderResponseDto = void 0;
|
|
4
|
+
const create_voa_delivery_order_dto_1 = require("./create-voa-delivery-order.dto");
|
|
5
|
+
class CreateVoaDeliveryOrderResponseDto extends create_voa_delivery_order_dto_1.CreateOrderDto {
|
|
6
|
+
id;
|
|
7
|
+
}
|
|
8
|
+
exports.CreateVoaDeliveryOrderResponseDto = CreateVoaDeliveryOrderResponseDto;
|
|
9
|
+
//# sourceMappingURL=create-voa-delivery-order-response.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-voa-delivery-order-response.dto.js","sourceRoot":"","sources":["../../../../lib/logistics/voa-delivery/dto/create-voa-delivery-order-response.dto.ts"],"names":[],"mappings":";;;AAAA,mFAAiE;AAEjE,MAAa,iCAAkC,SAAQ,8CAAc;IACnE,EAAE,CAAS;CACZ;AAFD,8EAEC"}
|