@floristcloud/api-lib 1.2.184 → 1.2.186

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.
@@ -1604,6 +1604,7 @@ exports.ERRORS = {
1604
1604
  // CSRF
1605
1605
  CSRF_TOKEN_MISSING: { code: 'CSRF001', message: 'CSRF token is missing', httpCode: 403 },
1606
1606
  CSRF_TOKEN_INVALID: { code: 'CSRF002', message: 'CSRF token is invalid', httpCode: 403 },
1607
+ CSRF_ORIGIN_FORBIDDEN: { code: 'CSRF003', message: 'Cross-origin request is not allowed', httpCode: 403 },
1607
1608
  // MOBILE AUTH
1608
1609
  MOBILE_BROWSER_REQUEST_REJECTED: { code: 'MOB001', message: 'Browser requests are not allowed on this endpoint', httpCode: 403 },
1609
1610
  MOBILE_RATE_LIMIT_EXCEEDED: { code: 'MOB002', message: 'Too many requests to mobile login endpoint', httpCode: 429 },
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeliveryPricingSplitGroupSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const money_schema_1 = require("../money.schema");
6
+ exports.DeliveryPricingSplitGroupSchema = zod_1.z.object({
7
+ deliveryDate: zod_1.z.string().nullable().describe('ISO arrival date for transit; null for the stock order.'),
8
+ isInTransit: zod_1.z.boolean(),
9
+ subtotal: money_schema_1.MoneySchema,
10
+ thresholdSubtotal: money_schema_1.MoneySchema.nullable(),
11
+ cost: money_schema_1.MoneySchema,
12
+ });
@@ -5,10 +5,15 @@ const zod_1 = require("zod");
5
5
  const money_schema_1 = require("../money.schema");
6
6
  const delivery_pricing_tier_schema_1 = require("../settings/delivery-pricing-tier.schema");
7
7
  const delivery_pricing_in_transit_mode_enum_1 = require("../../enum/delivery-pricing-in-transit-mode.enum");
8
+ const delivery_pricing_split_group_schema_1 = require("./delivery-pricing-split-group.schema");
8
9
  exports.DeliveryPricingSchema = zod_1.z.object({
9
- cost: money_schema_1.MoneySchema,
10
+ cost: money_schema_1.MoneySchema.describe('Delivery cost; when splitGroups is present, the sum of future order delivery costs.'),
10
11
  inStockSubtotal: money_schema_1.MoneySchema,
11
- thresholdSubtotal: money_schema_1.MoneySchema.nullable(),
12
+ thresholdSubtotal: money_schema_1.MoneySchema.nullable().describe('Threshold basis for this order, or only the stock group in a split preview; null without stock in a split preview or without applicable tiers.'),
13
+ splitGroups: zod_1.z
14
+ .array(delivery_pricing_split_group_schema_1.DeliveryPricingSplitGroupSchema)
15
+ .nullable()
16
+ .describe('Future orders for a SAME_RULES cart preview with multiple groups; null otherwise. All groups use the shared tiers.'),
12
17
  isInTransit: zod_1.z.boolean(),
13
18
  tiers: zod_1.z.array(delivery_pricing_tier_schema_1.DeliveryPricingTierSchema),
14
19
  inTransitMode: zod_1.z.nativeEnum(delivery_pricing_in_transit_mode_enum_1.DeliveryPricingInTransitModeEnum),
@@ -29,6 +29,7 @@ __exportStar(require("./update-cart-delivery-request.schema"), exports);
29
29
  __exportStar(require("./update-cart-request.schema"), exports);
30
30
  __exportStar(require("./update-cart-response.schema"), exports);
31
31
  __exportStar(require("./delivery-pricing.schema"), exports);
32
+ __exportStar(require("./delivery-pricing-split-group.schema"), exports);
32
33
  __exportStar(require("./get-order-delivery-pricing-request.schema"), exports);
33
34
  __exportStar(require("./get-order-delivery-pricing-response.schema"), exports);
34
35
  __exportStar(require("./order-vat-transition-request.schema"), exports);
package/constant/error.ts CHANGED
@@ -1666,6 +1666,7 @@ export const ERRORS = {
1666
1666
  // CSRF
1667
1667
  CSRF_TOKEN_MISSING: { code: 'CSRF001', message: 'CSRF token is missing', httpCode: 403 },
1668
1668
  CSRF_TOKEN_INVALID: { code: 'CSRF002', message: 'CSRF token is invalid', httpCode: 403 },
1669
+ CSRF_ORIGIN_FORBIDDEN: { code: 'CSRF003', message: 'Cross-origin request is not allowed', httpCode: 403 },
1669
1670
 
1670
1671
  // MOBILE AUTH
1671
1672
  MOBILE_BROWSER_REQUEST_REJECTED: { code: 'MOB001', message: 'Browser requests are not allowed on this endpoint', httpCode: 403 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floristcloud/api-lib",
3
- "version": "1.2.184",
3
+ "version": "1.2.186",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { MoneySchema } from '../money.schema';
3
+
4
+ export const DeliveryPricingSplitGroupSchema = z.object({
5
+ deliveryDate: z.string().nullable().describe('ISO arrival date for transit; null for the stock order.'),
6
+ isInTransit: z.boolean(),
7
+ subtotal: MoneySchema,
8
+ thresholdSubtotal: MoneySchema.nullable(),
9
+ cost: MoneySchema,
10
+ });
@@ -2,11 +2,18 @@ import { z } from 'zod';
2
2
  import { MoneySchema } from '../money.schema';
3
3
  import { DeliveryPricingTierSchema } from '../settings/delivery-pricing-tier.schema';
4
4
  import { DeliveryPricingInTransitModeEnum } from '../../enum/delivery-pricing-in-transit-mode.enum';
5
+ import { DeliveryPricingSplitGroupSchema } from './delivery-pricing-split-group.schema';
5
6
 
6
7
  export const DeliveryPricingSchema = z.object({
7
- cost: MoneySchema,
8
+ cost: MoneySchema.describe('Delivery cost; when splitGroups is present, the sum of future order delivery costs.'),
8
9
  inStockSubtotal: MoneySchema,
9
- thresholdSubtotal: MoneySchema.nullable(),
10
+ thresholdSubtotal: MoneySchema.nullable().describe(
11
+ 'Threshold basis for this order, or only the stock group in a split preview; null without stock in a split preview or without applicable tiers.',
12
+ ),
13
+ splitGroups: z
14
+ .array(DeliveryPricingSplitGroupSchema)
15
+ .nullable()
16
+ .describe('Future orders for a SAME_RULES cart preview with multiple groups; null otherwise. All groups use the shared tiers.'),
10
17
  isInTransit: z.boolean(),
11
18
  tiers: z.array(DeliveryPricingTierSchema),
12
19
  inTransitMode: z.nativeEnum(DeliveryPricingInTransitModeEnum),
@@ -14,6 +14,7 @@ export * from './update-cart-request.schema';
14
14
  export * from './update-cart-response.schema';
15
15
 
16
16
  export * from './delivery-pricing.schema';
17
+ export * from './delivery-pricing-split-group.schema';
17
18
  export * from './get-order-delivery-pricing-request.schema';
18
19
  export * from './get-order-delivery-pricing-response.schema';
19
20