@cravery/core 0.0.64 → 0.0.65

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.
@@ -0,0 +1,4 @@
1
+ export * from "./limits";
2
+ export * from "./operation";
3
+ export * from "./usage";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/access/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./limits"), exports);
18
+ __exportStar(require("./operation"), exports);
19
+ __exportStar(require("./usage"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/access/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB"}
@@ -0,0 +1,5 @@
1
+ import { SubscriptionTier } from "../subscriptions";
2
+ import { Operation } from "./operation";
3
+ export type TierLimits = Record<SubscriptionTier, number>;
4
+ export type LimitsConfig = Record<Operation, TierLimits>;
5
+ //# sourceMappingURL=limits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/types/access/limits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAE1D,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=limits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../src/types/access/limits.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ export declare const OPERATION_VALUES: readonly ["recipeFromUrl", "recipeFromImage", "recipeFromText", "scanIngredients", "scanEquipment", "mealPlan"];
2
+ export type Operation = (typeof OPERATION_VALUES)[number];
3
+ //# sourceMappingURL=operation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/types/access/operation.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,iHAOnB,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OPERATION_VALUES = void 0;
4
+ exports.OPERATION_VALUES = [
5
+ "recipeFromUrl",
6
+ "recipeFromImage",
7
+ "recipeFromText",
8
+ "scanIngredients",
9
+ "scanEquipment",
10
+ "mealPlan",
11
+ ];
12
+ //# sourceMappingURL=operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../src/types/access/operation.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG;IAC9B,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,iBAAiB;IACjB,eAAe;IACf,UAAU;CACF,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Timestamp } from "../core";
2
+ import { Operation } from "./operation";
3
+ export type UsageCounts = Partial<Record<Operation, number>>;
4
+ export interface UsagePeriod {
5
+ counts: UsageCounts;
6
+ updatedAt: Timestamp;
7
+ }
8
+ //# sourceMappingURL=usage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../../src/types/access/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAE7D,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;CACtB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=usage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/types/access/usage.ts"],"names":[],"mappings":""}
@@ -1,3 +1,4 @@
1
+ export * from "./access";
1
2
  export * from "./core";
2
3
  export * from "./equipment";
3
4
  export * from "./ingredients";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./access"), exports);
17
18
  __exportStar(require("./core"), exports);
18
19
  __exportStar(require("./equipment"), exports);
19
20
  __exportStar(require("./ingredients"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,8CAA4B;AAC5B,gDAA8B;AAC9B,4CAA0B;AAC1B,4CAA0B;AAC1B,6CAA2B;AAC3B,kDAAgC;AAChC,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB;AACvB,8CAA4B;AAC5B,gDAA8B;AAC9B,4CAA0B;AAC1B,4CAA0B;AAC1B,6CAA2B;AAC3B,kDAAgC;AAChC,0CAAwB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cravery/core",
3
- "version": "0.0.64",
3
+ "version": "0.0.65",
4
4
  "description": "Clean architecture foundation for Cravery",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,3 @@
1
+ export * from "./limits";
2
+ export * from "./operation";
3
+ export * from "./usage";
@@ -0,0 +1,6 @@
1
+ import { SubscriptionTier } from "../subscriptions";
2
+ import { Operation } from "./operation";
3
+
4
+ export type TierLimits = Record<SubscriptionTier, number>;
5
+
6
+ export type LimitsConfig = Record<Operation, TierLimits>;
@@ -0,0 +1,10 @@
1
+ export const OPERATION_VALUES = [
2
+ "recipeFromUrl",
3
+ "recipeFromImage",
4
+ "recipeFromText",
5
+ "scanIngredients",
6
+ "scanEquipment",
7
+ "mealPlan",
8
+ ] as const;
9
+
10
+ export type Operation = (typeof OPERATION_VALUES)[number];
@@ -0,0 +1,9 @@
1
+ import { Timestamp } from "../core";
2
+ import { Operation } from "./operation";
3
+
4
+ export type UsageCounts = Partial<Record<Operation, number>>;
5
+
6
+ export interface UsagePeriod {
7
+ counts: UsageCounts;
8
+ updatedAt: Timestamp;
9
+ }
@@ -1,15 +1,15 @@
1
- export type PaginationDirection = "forward" | "backward";
2
-
3
- export interface PaginationParams {
4
- limit?: number;
5
- cursor?: string;
6
- direction?: PaginationDirection;
7
- }
8
-
9
- export interface PaginatedResult<T> {
10
- data: T[];
11
- startCursor: string | null;
12
- endCursor: string | null;
13
- hasNextPage: boolean;
14
- hasPreviousPage: boolean;
15
- }
1
+ export type PaginationDirection = "forward" | "backward";
2
+
3
+ export interface PaginationParams {
4
+ limit?: number;
5
+ cursor?: string;
6
+ direction?: PaginationDirection;
7
+ }
8
+
9
+ export interface PaginatedResult<T> {
10
+ data: T[];
11
+ startCursor: string | null;
12
+ endCursor: string | null;
13
+ hasNextPage: boolean;
14
+ hasPreviousPage: boolean;
15
+ }
@@ -1,3 +1,4 @@
1
+ export * from "./access";
1
2
  export * from "./core";
2
3
  export * from "./equipment";
3
4
  export * from "./ingredients";
@@ -1,12 +1,12 @@
1
- import { EntityBase, Locale } from "../core";
2
- import { RequestStatus } from "./request_status";
3
-
4
- export interface Request extends EntityBase {
5
- status: RequestStatus;
6
- locale: Locale;
7
- url?: string;
8
- images?: string[];
9
- text?: string;
10
- recipeId?: string;
11
- error?: string;
12
- }
1
+ import { EntityBase, Locale } from "../core";
2
+ import { RequestStatus } from "./request_status";
3
+
4
+ export interface Request extends EntityBase {
5
+ status: RequestStatus;
6
+ locale: Locale;
7
+ url?: string;
8
+ images?: string[];
9
+ text?: string;
10
+ recipeId?: string;
11
+ error?: string;
12
+ }
@@ -1,7 +1,7 @@
1
- export const REQUEST_STATUS_VALUES = [
2
- "pending",
3
- "processing",
4
- "done",
5
- "failed",
6
- ] as const;
7
- export type RequestStatus = (typeof REQUEST_STATUS_VALUES)[number];
1
+ export const REQUEST_STATUS_VALUES = [
2
+ "pending",
3
+ "processing",
4
+ "done",
5
+ "failed",
6
+ ] as const;
7
+ export type RequestStatus = (typeof REQUEST_STATUS_VALUES)[number];