@openlup/core 0.11.0 → 0.13.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/AGENTS.md +103 -0
- package/CHANGELOG.md +64 -8
- package/CONTRIBUTING.md +4 -2
- package/MAINTAINERS.md +2 -1
- package/README.md +59 -21
- package/SECURITY.md +4 -4
- package/dist/outbox/index.d.ts +55 -0
- package/dist/outbox/index.js +1 -0
- package/dist/outbox/vocabulary.d.ts +7 -0
- package/dist/outbox/vocabulary.js +36 -0
- package/dist/platform-runtime/index.d.ts +1 -0
- package/dist/platform-runtime/ports.d.ts +24 -0
- package/dist/readiness/contracts.d.ts +121 -0
- package/dist/readiness/contracts.js +2 -0
- package/dist/readiness/declarations.d.ts +45 -0
- package/dist/readiness/declarations.js +58 -0
- package/dist/readiness/index.d.ts +5 -0
- package/dist/readiness/index.js +147 -0
- package/dist/readiness/schemaProbe.d.ts +13 -0
- package/dist/readiness/schemaProbe.js +25 -0
- package/dist/standard-schema/index.d.ts +26 -0
- package/dist/standard-schema/index.js +1 -0
- package/docs/SUBSCRIPTION_ENGINE.md +235 -0
- package/package.json +33 -11
- package/release-gates.json +91 -29
- package/src/outbox/index.ts +44 -0
- package/src/outbox/vocabulary.ts +38 -0
- package/src/platform-runtime/index.ts +2 -0
- package/src/platform-runtime/ports.ts +43 -0
- package/src/readiness/contracts.ts +57 -0
- package/src/readiness/declarations.ts +38 -0
- package/src/readiness/index.ts +97 -0
- package/src/readiness/schemaProbe.ts +24 -0
- package/src/standard-schema/index.ts +17 -0
- package/dist/checkout/idempotency.d.ts +0 -29
- package/dist/checkout/idempotency.js +0 -37
- package/dist/checkout/index.d.ts +0 -2
- package/dist/checkout/index.js +0 -2
- package/src/checkout/idempotency.ts +0 -49
- package/src/checkout/index.ts +0 -2
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reference checkout idempotency-key contract.
|
|
3
|
-
*
|
|
4
|
-
* This module validates the shape of a header-bound idempotency key only. The
|
|
5
|
-
* current product checkout validates body `intent.idempotencyKey`, not this
|
|
6
|
-
* header contract; downstream checkout runtimes must explicitly wire this
|
|
7
|
-
* helper before treating the header as authoritative.
|
|
8
|
-
*
|
|
9
|
-
* Callers own any persistence workflow for inserting, replaying, or completing
|
|
10
|
-
* a checkout idempotency record.
|
|
11
|
-
*/
|
|
12
|
-
/** @beta */
|
|
13
|
-
export declare const CHECKOUT_IDEMPOTENCY_KEY_HEADER = "idempotency-key";
|
|
14
|
-
/** @beta */
|
|
15
|
-
export type CheckoutIdempotencyRejection = {
|
|
16
|
-
reason: "missing";
|
|
17
|
-
message: string;
|
|
18
|
-
} | {
|
|
19
|
-
reason: "malformed";
|
|
20
|
-
message: string;
|
|
21
|
-
};
|
|
22
|
-
/** @beta */
|
|
23
|
-
export declare function validateCheckoutIdempotencyHeader(headerValue: string | undefined | null): {
|
|
24
|
-
ok: true;
|
|
25
|
-
key: string;
|
|
26
|
-
} | {
|
|
27
|
-
ok: false;
|
|
28
|
-
rejection: CheckoutIdempotencyRejection;
|
|
29
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reference checkout idempotency-key contract.
|
|
3
|
-
*
|
|
4
|
-
* This module validates the shape of a header-bound idempotency key only. The
|
|
5
|
-
* current product checkout validates body `intent.idempotencyKey`, not this
|
|
6
|
-
* header contract; downstream checkout runtimes must explicitly wire this
|
|
7
|
-
* helper before treating the header as authoritative.
|
|
8
|
-
*
|
|
9
|
-
* Callers own any persistence workflow for inserting, replaying, or completing
|
|
10
|
-
* a checkout idempotency record.
|
|
11
|
-
*/
|
|
12
|
-
/** @beta */
|
|
13
|
-
export const CHECKOUT_IDEMPOTENCY_KEY_HEADER = "idempotency-key";
|
|
14
|
-
const UUID_V4_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
15
|
-
/** @beta */
|
|
16
|
-
export function validateCheckoutIdempotencyHeader(headerValue) {
|
|
17
|
-
if (headerValue === undefined || headerValue === null || headerValue.trim().length === 0) {
|
|
18
|
-
return {
|
|
19
|
-
ok: false,
|
|
20
|
-
rejection: {
|
|
21
|
-
reason: "missing",
|
|
22
|
-
message: `Missing required ${CHECKOUT_IDEMPOTENCY_KEY_HEADER} header.`,
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
const trimmed = headerValue.trim();
|
|
27
|
-
if (!UUID_V4_PATTERN.test(trimmed)) {
|
|
28
|
-
return {
|
|
29
|
-
ok: false,
|
|
30
|
-
rejection: {
|
|
31
|
-
reason: "malformed",
|
|
32
|
-
message: `${CHECKOUT_IDEMPOTENCY_KEY_HEADER} must be a UUID v4.`,
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
return { ok: true, key: trimmed };
|
|
37
|
-
}
|
package/dist/checkout/index.d.ts
DELETED
package/dist/checkout/index.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reference checkout idempotency-key contract.
|
|
3
|
-
*
|
|
4
|
-
* This module validates the shape of a header-bound idempotency key only. The
|
|
5
|
-
* current product checkout validates body `intent.idempotencyKey`, not this
|
|
6
|
-
* header contract; downstream checkout runtimes must explicitly wire this
|
|
7
|
-
* helper before treating the header as authoritative.
|
|
8
|
-
*
|
|
9
|
-
* Callers own any persistence workflow for inserting, replaying, or completing
|
|
10
|
-
* a checkout idempotency record.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/** @beta */
|
|
14
|
-
export const CHECKOUT_IDEMPOTENCY_KEY_HEADER = "idempotency-key";
|
|
15
|
-
|
|
16
|
-
const UUID_V4_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
17
|
-
|
|
18
|
-
/** @beta */
|
|
19
|
-
export type CheckoutIdempotencyRejection =
|
|
20
|
-
| { reason: "missing"; message: string }
|
|
21
|
-
| { reason: "malformed"; message: string };
|
|
22
|
-
|
|
23
|
-
/** @beta */
|
|
24
|
-
export function validateCheckoutIdempotencyHeader(
|
|
25
|
-
headerValue: string | undefined | null,
|
|
26
|
-
): { ok: true; key: string } | { ok: false; rejection: CheckoutIdempotencyRejection } {
|
|
27
|
-
if (headerValue === undefined || headerValue === null || headerValue.trim().length === 0) {
|
|
28
|
-
return {
|
|
29
|
-
ok: false,
|
|
30
|
-
rejection: {
|
|
31
|
-
reason: "missing",
|
|
32
|
-
message: `Missing required ${CHECKOUT_IDEMPOTENCY_KEY_HEADER} header.`,
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const trimmed = headerValue.trim();
|
|
38
|
-
if (!UUID_V4_PATTERN.test(trimmed)) {
|
|
39
|
-
return {
|
|
40
|
-
ok: false,
|
|
41
|
-
rejection: {
|
|
42
|
-
reason: "malformed",
|
|
43
|
-
message: `${CHECKOUT_IDEMPOTENCY_KEY_HEADER} must be a UUID v4.`,
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return { ok: true, key: trimmed };
|
|
49
|
-
}
|
package/src/checkout/index.ts
DELETED