@voyantjs/promotions 0.83.0 → 0.84.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/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/workflow-bulk-reindex.d.ts +0 -19
- package/dist/workflow-bulk-reindex.d.ts.map +1 -1
- package/dist/workflow-bulk-reindex.js +1 -6
- package/dist/workflow-runtime.d.ts +17 -0
- package/dist/workflow-runtime.d.ts.map +1 -0
- package/dist/workflow-runtime.js +9 -0
- package/package.json +13 -8
package/dist/index.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ export { PROMOTION_CHANGED_EVENT, type PromotionChangedAffected, type PromotionC
|
|
|
7
7
|
export { type NewPromotionalOffer, type NewPromotionalOfferProduct, type NewPromotionalOfferRedemption, type PromotionalOffer, type PromotionalOfferDiscountType, type PromotionalOfferProduct, type PromotionalOfferRedemption, promotionalOfferDiscountTypeEnum, promotionalOfferProducts, promotionalOfferRedemptions, promotionalOffers, } from "./schema.js";
|
|
8
8
|
export { type OfferMutationRuntime, type PromotionsService, promotionsService, recomputeOfferLinks, resolveScopeProductIds, } from "./service.js";
|
|
9
9
|
export { type InsertPromotionalOffer, type InsertPromotionalOfferInput, insertPromotionalOfferSchema, type PromotionalOfferConditions, type PromotionalOfferListQuery, type PromotionalOfferScope, type PromotionalOfferScopeKind, promotionalOfferConditionsSchema, promotionalOfferListQuerySchema, promotionalOfferScopeSchema, type UpdatePromotionalOffer, type UpdatePromotionalOfferInput, updatePromotionalOfferSchema, } from "./validation.js";
|
|
10
|
-
export {
|
|
10
|
+
export { type BulkReindexProductsInput, type BulkReindexProductsOutput, bulkReindexProductsWorkflow, promotionAffectedAllFilter, } from "./workflow-bulk-reindex.js";
|
|
11
|
+
export { BULK_REINDEX_SERVICE_KEY, type BulkReindexProductsService, } from "./workflow-runtime.js";
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAKvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAEnD,eAAO,MAAM,gBAAgB,EAAE,MAI9B,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,UAGlC,CAAA;AAED,OAAO,EACL,uBAAuB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,EAClC,KAAK,gBAAgB,EACrB,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,gCAAgC,EAChC,wBAAwB,EACxB,2BAA2B,EAC3B,iBAAiB,GAClB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,4BAA4B,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,gCAAgC,EAChC,+BAA+B,EAC/B,2BAA2B,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,4BAA4B,GAC7B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,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 export { PROMOTION_CHANGED_EVENT, } from "./events.js";
|
|
|
13
13
|
export { promotionalOfferDiscountTypeEnum, promotionalOfferProducts, promotionalOfferRedemptions, promotionalOffers, } from "./schema.js";
|
|
14
14
|
export { promotionsService, recomputeOfferLinks, resolveScopeProductIds, } from "./service.js";
|
|
15
15
|
export { insertPromotionalOfferSchema, promotionalOfferConditionsSchema, promotionalOfferListQuerySchema, promotionalOfferScopeSchema, updatePromotionalOfferSchema, } from "./validation.js";
|
|
16
|
-
export {
|
|
16
|
+
export { bulkReindexProductsWorkflow, promotionAffectedAllFilter, } from "./workflow-bulk-reindex.js";
|
|
17
|
+
export { BULK_REINDEX_SERVICE_KEY, } from "./workflow-runtime.js";
|
|
@@ -18,25 +18,6 @@
|
|
|
18
18
|
* the codebase for cross-module behavior (workflow → ctx.services.resolve).
|
|
19
19
|
*/
|
|
20
20
|
import { type PromotionChangedSource } from "./events.js";
|
|
21
|
-
/**
|
|
22
|
-
* Service-container key the operator template registers a concrete
|
|
23
|
-
* implementation against. Kept stable + exported so consumers don't have
|
|
24
|
-
* to repeat the magic string.
|
|
25
|
-
*/
|
|
26
|
-
export declare const BULK_REINDEX_SERVICE_KEY: "promotions:bulk-reindex-products";
|
|
27
|
-
/**
|
|
28
|
-
* Contract the operator template implements. The workflow body resolves
|
|
29
|
-
* this from `ctx.services` and calls into it from steps.
|
|
30
|
-
*
|
|
31
|
-
* Two methods so the workflow can split enumeration from per-product
|
|
32
|
-
* reindex — that's what makes the parallel-step pattern viable on edge
|
|
33
|
-
* runtime. A single `reindexAllProducts()` would have to do everything in
|
|
34
|
-
* one step, which is what we're trying to avoid.
|
|
35
|
-
*/
|
|
36
|
-
export interface BulkReindexProductsService {
|
|
37
|
-
listAllProductIds(): Promise<string[]>;
|
|
38
|
-
reindexProduct(productId: string): Promise<void>;
|
|
39
|
-
}
|
|
40
21
|
export interface BulkReindexProductsInput {
|
|
41
22
|
/** The offer that triggered the reindex (for logging / correlation). */
|
|
42
23
|
offerId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-bulk-reindex.d.ts","sourceRoot":"","sources":["../src/workflow-bulk-reindex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAA2B,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"workflow-bulk-reindex.d.ts","sourceRoot":"","sources":["../src/workflow-bulk-reindex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAA2B,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGlF,MAAM,WAAW,wBAAwB;IACvC,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,sBAAsB,CAAA;CAC/B;AAED,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAA;CAClB;AAKD,eAAO,MAAM,2BAA2B,uGAuBtC,CAAA;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,8DAYtC,CAAA"}
|
|
@@ -19,12 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { trigger, workflow } from "@voyantjs/workflows";
|
|
21
21
|
import { PROMOTION_CHANGED_EVENT } from "./events.js";
|
|
22
|
-
|
|
23
|
-
* Service-container key the operator template registers a concrete
|
|
24
|
-
* implementation against. Kept stable + exported so consumers don't have
|
|
25
|
-
* to repeat the magic string.
|
|
26
|
-
*/
|
|
27
|
-
export const BULK_REINDEX_SERVICE_KEY = "promotions:bulk-reindex-products";
|
|
22
|
+
import { BULK_REINDEX_SERVICE_KEY } from "./workflow-runtime.js";
|
|
28
23
|
/** Cap on concurrent per-product reindex steps to avoid hammering the index. */
|
|
29
24
|
const REINDEX_CONCURRENCY = 8;
|
|
30
25
|
export const bulkReindexProductsWorkflow = workflow({
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime constants and contracts that workflow hosts may import without
|
|
3
|
+
* loading the promotions module, routes, schemas, or workflow declarations.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Service-container key the operator template registers a concrete
|
|
7
|
+
* implementation against.
|
|
8
|
+
*/
|
|
9
|
+
export declare const BULK_REINDEX_SERVICE_KEY: "promotions:bulk-reindex-products";
|
|
10
|
+
/**
|
|
11
|
+
* Contract the operator template implements for the bulk-reindex workflow.
|
|
12
|
+
*/
|
|
13
|
+
export interface BulkReindexProductsService {
|
|
14
|
+
listAllProductIds(): Promise<string[]>;
|
|
15
|
+
reindexProduct(productId: string): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=workflow-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-runtime.d.ts","sourceRoot":"","sources":["../src/workflow-runtime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAG,kCAA2C,CAAA;AAEnF;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IACtC,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACjD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime constants and contracts that workflow hosts may import without
|
|
3
|
+
* loading the promotions module, routes, schemas, or workflow declarations.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Service-container key the operator template registers a concrete
|
|
7
|
+
* implementation against.
|
|
8
|
+
*/
|
|
9
|
+
export const BULK_REINDEX_SERVICE_KEY = "promotions:bulk-reindex-products";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/promotions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.84.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -34,6 +34,11 @@
|
|
|
34
34
|
"import": "./dist/service.js",
|
|
35
35
|
"default": "./dist/service.js"
|
|
36
36
|
},
|
|
37
|
+
"./workflow-runtime": {
|
|
38
|
+
"types": "./dist/workflow-runtime.d.ts",
|
|
39
|
+
"import": "./dist/workflow-runtime.js",
|
|
40
|
+
"default": "./dist/workflow-runtime.js"
|
|
41
|
+
},
|
|
37
42
|
"./service-catalog-plane-promotions": {
|
|
38
43
|
"types": "./dist/service-catalog-plane-promotions.d.ts",
|
|
39
44
|
"import": "./dist/service-catalog-plane-promotions.js",
|
|
@@ -64,13 +69,13 @@
|
|
|
64
69
|
"drizzle-orm": "^0.45.2",
|
|
65
70
|
"hono": "^4.12.10",
|
|
66
71
|
"zod": "^4.3.6",
|
|
67
|
-
"@voyantjs/catalog": "0.
|
|
68
|
-
"@voyantjs/core": "0.
|
|
69
|
-
"@voyantjs/db": "0.
|
|
70
|
-
"@voyantjs/hono": "0.
|
|
71
|
-
"@voyantjs/products": "0.
|
|
72
|
-
"@voyantjs/storefront": "0.
|
|
73
|
-
"@voyantjs/workflows": "0.
|
|
72
|
+
"@voyantjs/catalog": "0.84.0",
|
|
73
|
+
"@voyantjs/core": "0.84.0",
|
|
74
|
+
"@voyantjs/db": "0.84.0",
|
|
75
|
+
"@voyantjs/hono": "0.84.0",
|
|
76
|
+
"@voyantjs/products": "0.84.0",
|
|
77
|
+
"@voyantjs/storefront": "0.84.0",
|
|
78
|
+
"@voyantjs/workflows": "0.84.0"
|
|
74
79
|
},
|
|
75
80
|
"devDependencies": {
|
|
76
81
|
"typescript": "^6.0.2",
|