@grupolapa/desarrollos-sdk 0.3.0 → 0.4.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/README.md CHANGED
@@ -34,15 +34,43 @@ OpenAPI metadata is available at:
34
34
  https://grupolapa.com/api/public/v1/desarrollos/openapi.json
35
35
  ```
36
36
 
37
- UONDR and external configurable-cotizador agents should use the dedicated
38
- cross-project guide:
37
+ Building a partner website that hosts the configurable cotizador? Read this
38
+ single self-contained guide; it needs no other document:
39
+
40
+ ```txt
41
+ https://grupolapa.com/api/public/v1/desarrollos/partner-agent.json
42
+ ```
43
+
44
+ It covers environment setup, the journey call order, every error code, the
45
+ frozen UONDR embed protocol `1.0` contract, and the host page requirements.
46
+
47
+ Maintaining UONDR itself uses the cross-project contract reference:
39
48
 
40
49
  ```txt
41
50
  https://grupolapa.com/api/public/v1/desarrollos/uondr-agent.json
42
51
  ```
43
52
 
44
- It distinguishes already available Lapa and SDK tools from the required UONDR
45
- partner APIs, iframe protocol, and production website work.
53
+ ## Embed Protocol
54
+
55
+ `@grupolapa/desarrollos-sdk/embed` carries the iframe contract shared with
56
+ UONDR. `UONDR_EMBED_PROTOCOL_CONTRACT` is a frozen literal mirrored
57
+ byte-for-byte in the UONDR repository and verified by contract tests in both;
58
+ `UONDR_EMBED_PROTOCOL_CONTRACT_DIGEST` lets a consumer confirm it matches the
59
+ deployed guide.
60
+
61
+ ```ts
62
+ import {
63
+ createUondrCommand,
64
+ postUondrCommand,
65
+ UondrEventGuard,
66
+ UONDR_EMBED_PROTOCOL_CONTRACT,
67
+ UONDR_EMBED_PROTOCOL_CONTRACT_DIGEST,
68
+ } from "@grupolapa/desarrollos-sdk/embed";
69
+ ```
70
+
71
+ Never post to a wildcard target origin. Derive it from the `embedUrl` Lapa
72
+ returns, and note that the configurator resolves its parent origin from
73
+ `document.referrer`, so the host page must not send a strict `Referrer-Policy`.
46
74
 
47
75
  ## Browser Reads and Quotes
48
76
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { DesarrollosApiError } from "./http.js";
2
2
  import type { CompleteJourneyConfigurationRequest, CreateJourneyCheckoutRequest, CreateJourneyConfiguratorSessionRequest, CreateJourneyQuoteRequest, CreateJourneyRequest, DesarrollosApiBaseOptions, CreatePublicReservationRequest, GetJourneyRequest, GetPublicReservationRequest, UpdateJourneyLeadRequest, UpdateJourneySelectionRequest } from "./types.js";
3
3
  export { DesarrollosApiError };
4
+ export { JOURNEY_STATUSES } from "./types.js";
4
5
  export type * from "./types.js";
5
6
  export * from "./embed-protocol.js";
6
7
  export declare function createDesarrollosClient(options: DesarrollosApiBaseOptions): {
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { DesarrollosApiError, createDesarrollosApiRequester } from "./http.js";
2
2
  export { DesarrollosApiError };
3
+ export { JOURNEY_STATUSES } from "./types.js";
3
4
  export * from "./embed-protocol.js";
4
5
  export function createDesarrollosClient(options) {
5
6
  const api = createDesarrollosApiRequester(options);
package/dist/types.d.ts CHANGED
@@ -422,7 +422,15 @@ export interface PublicSessionResponse {
422
422
  tokenType: "Bearer";
423
423
  }
424
424
  export type JourneyErrorCode = "origin_denied" | "mapping_not_found" | "configuration_required" | "configuration_invalid" | "quote_expired" | "unit_unavailable" | "hold_conflict" | "payment_conflict" | "rate_limited" | "session_expired";
425
- export type JourneyStatus = "active" | "payment_pending" | "operation_pending" | "completed" | "paid_conflict" | "expired";
425
+ /**
426
+ * Every journey status the public API can return, in lifecycle order.
427
+ *
428
+ * These are wire values, not Lapa's internal persisted statuses. The serializer
429
+ * collapses `checkout_started` and `paid` into `payment_pending`, and reports
430
+ * `cancelled` as `expired`. Branch on these; the internal names never arrive.
431
+ */
432
+ export declare const JOURNEY_STATUSES: readonly ["active", "payment_pending", "operation_pending", "completed", "paid_conflict", "expired"];
433
+ export type JourneyStatus = (typeof JOURNEY_STATUSES)[number];
426
434
  export type JourneyConfigurationStatus = "required" | "completed" | "invalid" | "superseded";
427
435
  export type JourneyQuoteStatus = "active" | "expired" | "superseded" | "consumed";
428
436
  export type JourneyHoldStatus = "acquiring" | "active" | "confirmed" | "released" | "expired" | "conflict";
package/dist/types.js CHANGED
@@ -1 +1,15 @@
1
- export {};
1
+ /**
2
+ * Every journey status the public API can return, in lifecycle order.
3
+ *
4
+ * These are wire values, not Lapa's internal persisted statuses. The serializer
5
+ * collapses `checkout_started` and `paid` into `payment_pending`, and reports
6
+ * `cancelled` as `expired`. Branch on these; the internal names never arrive.
7
+ */
8
+ export const JOURNEY_STATUSES = [
9
+ "active",
10
+ "payment_pending",
11
+ "operation_pending",
12
+ "completed",
13
+ "paid_conflict",
14
+ "expired",
15
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grupolapa/desarrollos-sdk",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Framework-agnostic TypeScript SDK for Grupo LAPA public desarrollo integrations.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",