@cravery/core 0.0.30 → 0.0.32
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/config/ai.d.ts.map +1 -1
- package/dist/config/ai.js +0 -7
- package/dist/config/ai.js.map +1 -1
- package/dist/types/ai/config.d.ts +2 -3
- package/dist/types/ai/config.d.ts.map +1 -1
- package/dist/types/recipe/recipe.d.ts +0 -9
- package/dist/types/recipe/recipe.d.ts.map +1 -1
- package/package.json +45 -45
- package/src/config/ai.ts +39 -46
- package/src/types/ai/config.ts +28 -30
- package/src/types/recipe/recipe.ts +92 -108
- package/dist/lib/ai/cost.d.ts +0 -22
- package/dist/lib/ai/cost.d.ts.map +0 -1
- package/dist/lib/ai/cost.js +0 -55
- package/dist/lib/ai/cost.js.map +0 -1
- package/dist/lib/ai/embedding.d.ts +0 -5
- package/dist/lib/ai/embedding.d.ts.map +0 -1
- package/dist/lib/ai/embedding.js +0 -43
- package/dist/lib/ai/embedding.js.map +0 -1
- package/dist/lib/ai/errors.d.ts +0 -14
- package/dist/lib/ai/errors.d.ts.map +0 -1
- package/dist/lib/ai/errors.js +0 -40
- package/dist/lib/ai/errors.js.map +0 -1
- package/dist/lib/ai/flow.d.ts +0 -33
- package/dist/lib/ai/flow.d.ts.map +0 -1
- package/dist/lib/ai/flow.js +0 -97
- package/dist/lib/ai/flow.js.map +0 -1
- package/dist/lib/ai/genkit.d.ts +0 -5
- package/dist/lib/ai/genkit.d.ts.map +0 -1
- package/dist/lib/ai/genkit.js +0 -33
- package/dist/lib/ai/genkit.js.map +0 -1
- package/dist/lib/ai/image.d.ts +0 -7
- package/dist/lib/ai/image.d.ts.map +0 -1
- package/dist/lib/ai/image.js +0 -23
- package/dist/lib/ai/image.js.map +0 -1
- package/dist/lib/ai/index.d.ts +0 -7
- package/dist/lib/ai/index.d.ts.map +0 -1
- package/dist/lib/ai/index.js +0 -23
- package/dist/lib/ai/index.js.map +0 -1
- package/dist/lib/api.d.ts +0 -20
- package/dist/lib/api.d.ts.map +0 -1
- package/dist/lib/api.js +0 -79
- package/dist/lib/api.js.map +0 -1
- package/dist/lib/firebase.d.ts +0 -3
- package/dist/lib/firebase.d.ts.map +0 -1
- package/dist/lib/firebase.js +0 -8
- package/dist/lib/firebase.js.map +0 -1
- package/dist/lib/iam.d.ts +0 -6
- package/dist/lib/iam.d.ts.map +0 -1
- package/dist/lib/iam.js +0 -72
- package/dist/lib/iam.js.map +0 -1
- package/dist/lib/index.d.ts +0 -8
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/index.js +0 -24
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/storage.d.ts +0 -6
- package/dist/lib/storage.d.ts.map +0 -1
- package/dist/lib/storage.js +0 -50
- package/dist/lib/storage.js.map +0 -1
- package/dist/lib/usage/index.d.ts +0 -2
- package/dist/lib/usage/index.d.ts.map +0 -1
- package/dist/lib/usage/index.js +0 -18
- package/dist/lib/usage/index.js.map +0 -1
- package/dist/lib/usage/usage.service.d.ts +0 -27
- package/dist/lib/usage/usage.service.d.ts.map +0 -1
- package/dist/lib/usage/usage.service.js +0 -131
- package/dist/lib/usage/usage.service.js.map +0 -1
- package/dist/lib/utils/index.d.ts +0 -3
- package/dist/lib/utils/index.d.ts.map +0 -1
- package/dist/lib/utils/index.js +0 -19
- package/dist/lib/utils/index.js.map +0 -1
- package/dist/lib/utils/sanitize.d.ts +0 -20
- package/dist/lib/utils/sanitize.d.ts.map +0 -1
- package/dist/lib/utils/sanitize.js +0 -40
- package/dist/lib/utils/sanitize.js.map +0 -1
- package/dist/lib/utils/slug.d.ts +0 -13
- package/dist/lib/utils/slug.d.ts.map +0 -1
- package/dist/lib/utils/slug.js +0 -33
- package/dist/lib/utils/slug.js.map +0 -1
- package/dist/types/core/enums/image_type.d.ts +0 -5
- package/dist/types/core/enums/image_type.d.ts.map +0 -1
- package/dist/types/core/enums/image_type.js +0 -7
- package/dist/types/core/enums/image_type.js.map +0 -1
- package/dist/types/core/enums/index.d.ts +0 -6
- package/dist/types/core/enums/index.d.ts.map +0 -1
- package/dist/types/core/enums/index.js +0 -22
- package/dist/types/core/enums/index.js.map +0 -1
- package/dist/types/core/enums/locale.d.ts +0 -5
- package/dist/types/core/enums/locale.d.ts.map +0 -1
- package/dist/types/core/enums/locale.js +0 -7
- package/dist/types/core/enums/locale.js.map +0 -1
- package/dist/types/core/enums/measurement_system.d.ts +0 -5
- package/dist/types/core/enums/measurement_system.d.ts.map +0 -1
- package/dist/types/core/enums/measurement_system.js +0 -7
- package/dist/types/core/enums/measurement_system.js.map +0 -1
- package/dist/types/core/enums/theme.d.ts +0 -5
- package/dist/types/core/enums/theme.d.ts.map +0 -1
- package/dist/types/core/enums/theme.js +0 -7
- package/dist/types/core/enums/theme.js.map +0 -1
- package/dist/types/core/enums/url_type.d.ts +0 -5
- package/dist/types/core/enums/url_type.d.ts.map +0 -1
- package/dist/types/core/enums/url_type.js +0 -15
- package/dist/types/core/enums/url_type.js.map +0 -1
- package/dist/types/iam/enums/index.d.ts +0 -7
- package/dist/types/iam/enums/index.d.ts.map +0 -1
- package/dist/types/iam/enums/index.js +0 -23
- package/dist/types/iam/enums/index.js.map +0 -1
- package/dist/types/iam/enums/profile_status.d.ts +0 -5
- package/dist/types/iam/enums/profile_status.d.ts.map +0 -1
- package/dist/types/iam/enums/profile_status.js +0 -12
- package/dist/types/iam/enums/profile_status.js.map +0 -1
- package/dist/types/iam/enums/subscription_role.d.ts +0 -5
- package/dist/types/iam/enums/subscription_role.d.ts.map +0 -1
- package/dist/types/iam/enums/subscription_role.js +0 -7
- package/dist/types/iam/enums/subscription_role.js.map +0 -1
- package/dist/types/iam/enums/subscription_status.d.ts +0 -5
- package/dist/types/iam/enums/subscription_status.d.ts.map +0 -1
- package/dist/types/iam/enums/subscription_status.js +0 -12
- package/dist/types/iam/enums/subscription_status.js.map +0 -1
- package/dist/types/iam/enums/subscription_tier.d.ts +0 -4
- package/dist/types/iam/enums/subscription_tier.d.ts.map +0 -1
- package/dist/types/iam/enums/subscription_tier.js +0 -6
- package/dist/types/iam/enums/subscription_tier.js.map +0 -1
- package/dist/types/iam/enums/user_role.d.ts +0 -5
- package/dist/types/iam/enums/user_role.d.ts.map +0 -1
- package/dist/types/iam/enums/user_role.js +0 -13
- package/dist/types/iam/enums/user_role.js.map +0 -1
- package/dist/types/iam/enums/user_status.d.ts +0 -5
- package/dist/types/iam/enums/user_status.d.ts.map +0 -1
- package/dist/types/iam/enums/user_status.js +0 -12
- package/dist/types/iam/enums/user_status.js.map +0 -1
- package/dist/types/moderation/enums/index.d.ts +0 -5
- package/dist/types/moderation/enums/index.d.ts.map +0 -1
- package/dist/types/moderation/enums/index.js +0 -21
- package/dist/types/moderation/enums/index.js.map +0 -1
- package/dist/types/moderation/enums/moderation_status.d.ts +0 -5
- package/dist/types/moderation/enums/moderation_status.d.ts.map +0 -1
- package/dist/types/moderation/enums/moderation_status.js +0 -11
- package/dist/types/moderation/enums/moderation_status.js.map +0 -1
- package/dist/types/moderation/enums/priority.d.ts +0 -5
- package/dist/types/moderation/enums/priority.d.ts.map +0 -1
- package/dist/types/moderation/enums/priority.js +0 -7
- package/dist/types/moderation/enums/priority.js.map +0 -1
- package/dist/types/moderation/enums/severity.d.ts +0 -5
- package/dist/types/moderation/enums/severity.d.ts.map +0 -1
- package/dist/types/moderation/enums/severity.js +0 -7
- package/dist/types/moderation/enums/severity.js.map +0 -1
- package/dist/types/moderation/enums/suggestion_category.d.ts +0 -5
- package/dist/types/moderation/enums/suggestion_category.d.ts.map +0 -1
- package/dist/types/moderation/enums/suggestion_category.js +0 -13
- package/dist/types/moderation/enums/suggestion_category.js.map +0 -1
- package/dist/types/recipe/enums/allergen.d.ts +0 -5
- package/dist/types/recipe/enums/allergen.d.ts.map +0 -1
- package/dist/types/recipe/enums/allergen.js +0 -21
- package/dist/types/recipe/enums/allergen.js.map +0 -1
- package/dist/types/recipe/enums/cuisine.d.ts +0 -5
- package/dist/types/recipe/enums/cuisine.d.ts.map +0 -1
- package/dist/types/recipe/enums/cuisine.js +0 -41
- package/dist/types/recipe/enums/cuisine.js.map +0 -1
- package/dist/types/recipe/enums/dietary_tag.d.ts +0 -5
- package/dist/types/recipe/enums/dietary_tag.d.ts.map +0 -1
- package/dist/types/recipe/enums/dietary_tag.js +0 -23
- package/dist/types/recipe/enums/dietary_tag.js.map +0 -1
- package/dist/types/recipe/enums/difficulty.d.ts +0 -5
- package/dist/types/recipe/enums/difficulty.d.ts.map +0 -1
- package/dist/types/recipe/enums/difficulty.js +0 -12
- package/dist/types/recipe/enums/difficulty.js.map +0 -1
- package/dist/types/recipe/enums/index.d.ts +0 -11
- package/dist/types/recipe/enums/index.d.ts.map +0 -1
- package/dist/types/recipe/enums/index.js +0 -27
- package/dist/types/recipe/enums/index.js.map +0 -1
- package/dist/types/recipe/enums/meal_type.d.ts +0 -5
- package/dist/types/recipe/enums/meal_type.d.ts.map +0 -1
- package/dist/types/recipe/enums/meal_type.js +0 -16
- package/dist/types/recipe/enums/meal_type.js.map +0 -1
- package/dist/types/recipe/enums/recipe_source.d.ts +0 -5
- package/dist/types/recipe/enums/recipe_source.d.ts.map +0 -1
- package/dist/types/recipe/enums/recipe_source.js +0 -7
- package/dist/types/recipe/enums/recipe_source.js.map +0 -1
- package/dist/types/recipe/enums/recipe_status.d.ts +0 -5
- package/dist/types/recipe/enums/recipe_status.d.ts.map +0 -1
- package/dist/types/recipe/enums/recipe_status.js +0 -14
- package/dist/types/recipe/enums/recipe_status.js.map +0 -1
- package/dist/types/recipe/enums/spiciness.d.ts +0 -5
- package/dist/types/recipe/enums/spiciness.d.ts.map +0 -1
- package/dist/types/recipe/enums/spiciness.js +0 -7
- package/dist/types/recipe/enums/spiciness.js.map +0 -1
- package/dist/types/recipe/enums/temperature_unit.d.ts +0 -5
- package/dist/types/recipe/enums/temperature_unit.d.ts.map +0 -1
- package/dist/types/recipe/enums/temperature_unit.js +0 -7
- package/dist/types/recipe/enums/temperature_unit.js.map +0 -1
- package/dist/types/recipe/enums/unit.d.ts +0 -5
- package/dist/types/recipe/enums/unit.d.ts.map +0 -1
- package/dist/types/recipe/enums/unit.js +0 -53
- package/dist/types/recipe/enums/unit.js.map +0 -1
- package/dist/types/report/enums/index.d.ts +0 -5
- package/dist/types/report/enums/index.d.ts.map +0 -1
- package/dist/types/report/enums/index.js +0 -21
- package/dist/types/report/enums/index.js.map +0 -1
- package/dist/types/report/enums/report_priority.d.ts +0 -5
- package/dist/types/report/enums/report_priority.d.ts.map +0 -1
- package/dist/types/report/enums/report_priority.js +0 -12
- package/dist/types/report/enums/report_priority.js.map +0 -1
- package/dist/types/report/enums/report_status.d.ts +0 -5
- package/dist/types/report/enums/report_status.d.ts.map +0 -1
- package/dist/types/report/enums/report_status.js +0 -12
- package/dist/types/report/enums/report_status.js.map +0 -1
- package/dist/types/report/enums/report_target_type.d.ts +0 -5
- package/dist/types/report/enums/report_target_type.d.ts.map +0 -1
- package/dist/types/report/enums/report_target_type.js +0 -12
- package/dist/types/report/enums/report_target_type.js.map +0 -1
- package/dist/types/report/enums/report_type.d.ts +0 -5
- package/dist/types/report/enums/report_type.d.ts.map +0 -1
- package/dist/types/report/enums/report_type.js +0 -14
- package/dist/types/report/enums/report_type.js.map +0 -1
package/dist/lib/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
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("./ai"), exports);
|
|
18
|
-
__exportStar(require("./api"), exports);
|
|
19
|
-
__exportStar(require("./firebase"), exports);
|
|
20
|
-
__exportStar(require("./iam"), exports);
|
|
21
|
-
__exportStar(require("./storage"), exports);
|
|
22
|
-
__exportStar(require("./usage"), exports);
|
|
23
|
-
__exportStar(require("./utils"), exports);
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
package/dist/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAqB;AACrB,wCAAsB;AACtB,6CAA2B;AAC3B,wCAAsB;AACtB,4CAA0B;AAC1B,0CAAwB;AACxB,0CAAwB"}
|
package/dist/lib/storage.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/lib/storage.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAiBD,eAAO,MAAM,oBAAoB,GAC/B,YAAY,MAAM,EAClB,MAAM,MAAM,EACZ,cAAa,MAAoB,KAChC,OAAO,CAAC,iBAAiB,CAgC3B,CAAC"}
|
package/dist/lib/storage.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.uploadImageToStorage = void 0;
|
|
4
|
-
const storage_1 = require("firebase-admin/storage");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
function validateStoragePath(path) {
|
|
7
|
-
if (!path || path.length === 0) {
|
|
8
|
-
throw new types_1.ValidationError("Storage path cannot be empty");
|
|
9
|
-
}
|
|
10
|
-
if (path.includes("..")) {
|
|
11
|
-
throw new types_1.ValidationError("Storage path cannot contain '..'", { path });
|
|
12
|
-
}
|
|
13
|
-
if (path.startsWith("/")) {
|
|
14
|
-
throw new types_1.ValidationError("Storage path cannot start with '/'", { path });
|
|
15
|
-
}
|
|
16
|
-
if (path.includes("//")) {
|
|
17
|
-
throw new types_1.ValidationError("Storage path cannot contain '//'", { path });
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
const uploadImageToStorage = async (base64Data, path, contentType = "image/png") => {
|
|
21
|
-
validateStoragePath(path);
|
|
22
|
-
try {
|
|
23
|
-
const bucket = (0, storage_1.getStorage)().bucket();
|
|
24
|
-
const buffer = Buffer.from(base64Data, "base64");
|
|
25
|
-
const file = bucket.file(path);
|
|
26
|
-
const fileExists = await file.exists();
|
|
27
|
-
if (fileExists[0]) {
|
|
28
|
-
await file.delete();
|
|
29
|
-
}
|
|
30
|
-
await file.save(buffer, {
|
|
31
|
-
metadata: {
|
|
32
|
-
contentType,
|
|
33
|
-
cacheControl: "public",
|
|
34
|
-
},
|
|
35
|
-
resumable: false,
|
|
36
|
-
});
|
|
37
|
-
const publicUrl = `https://storage.googleapis.com/${bucket.name}/${path}`;
|
|
38
|
-
return {
|
|
39
|
-
url: publicUrl,
|
|
40
|
-
path,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
catch (_a) {
|
|
44
|
-
const uploadError = new Error("Image upload failed");
|
|
45
|
-
uploadError.name = "UPLOAD_FAILED";
|
|
46
|
-
throw uploadError;
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
exports.uploadImageToStorage = uploadImageToStorage;
|
|
50
|
-
//# sourceMappingURL=storage.js.map
|
package/dist/lib/storage.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
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AAC;QACtB,CAAC;QAED,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACtB,QAAQ,EAAE;gBACR,WAAW;gBACX,YAAY,EAAE,QAAQ;aACvB;YACD,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,kCAAkC,MAAM,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;QAE1E,OAAO;YACL,GAAG,EAAE,SAAS;YACd,IAAI;SACL,CAAC;IACJ,CAAC;IAAC,WAAM,CAAC;QACP,MAAM,WAAW,GAAG,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACrD,WAAW,CAAC,IAAI,GAAG,eAAe,CAAC;QACnC,MAAM,WAAW,CAAC;IACpB,CAAC;AACH,CAAC,CAAC;AApCW,QAAA,oBAAoB,wBAoC/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/usage/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
package/dist/lib/usage/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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("./usage.service"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/usage/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Database } from "firebase-admin/database";
|
|
2
|
-
import { DailyLimitError, MonthlyLimitError, SubscriptionTier } from "../../types";
|
|
3
|
-
import { type UsageType } from "../../config/limits";
|
|
4
|
-
export interface UsageCheckResult {
|
|
5
|
-
allowed: boolean;
|
|
6
|
-
dailyRemaining: number;
|
|
7
|
-
monthlyRemaining: number;
|
|
8
|
-
error?: DailyLimitError | MonthlyLimitError;
|
|
9
|
-
}
|
|
10
|
-
export declare class UsageService {
|
|
11
|
-
private readonly database;
|
|
12
|
-
constructor(database: Database);
|
|
13
|
-
private getDateString;
|
|
14
|
-
private getMonthString;
|
|
15
|
-
private getDailyRef;
|
|
16
|
-
private getMonthlyRef;
|
|
17
|
-
checkLimit(userId: string, type: UsageType, tier: SubscriptionTier): Promise<UsageCheckResult>;
|
|
18
|
-
increment(userId: string, type: UsageType): Promise<void>;
|
|
19
|
-
getUsage(userId: string, type: UsageType): Promise<{
|
|
20
|
-
daily: number;
|
|
21
|
-
monthly: number;
|
|
22
|
-
lifetime: number;
|
|
23
|
-
}>;
|
|
24
|
-
resetDaily(userId: string, type: UsageType): Promise<void>;
|
|
25
|
-
resetMonthly(userId: string, type: UsageType): Promise<void>;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=usage.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usage.service.d.ts","sourceRoot":"","sources":["../../../src/lib/usage/usage.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,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1 = require("../../types");
|
|
5
|
-
const limits_1 = require("../../config/limits");
|
|
6
|
-
class UsageService {
|
|
7
|
-
constructor(database) {
|
|
8
|
-
this.database = database;
|
|
9
|
-
}
|
|
10
|
-
getDateString() {
|
|
11
|
-
return new Date().toISOString().split("T")[0];
|
|
12
|
-
}
|
|
13
|
-
getMonthString() {
|
|
14
|
-
return new Date().toISOString().slice(0, 7);
|
|
15
|
-
}
|
|
16
|
-
getDailyRef(userId, type) {
|
|
17
|
-
return this.database.ref(`usage/${userId}/daily/${type}`);
|
|
18
|
-
}
|
|
19
|
-
getMonthlyRef(userId, type) {
|
|
20
|
-
return this.database.ref(`usage/${userId}/monthly/${type}`);
|
|
21
|
-
}
|
|
22
|
-
async checkLimit(userId, type, tier) {
|
|
23
|
-
const limits = limits_1.LIMITS[tier];
|
|
24
|
-
const dailyLimit = limits.daily[type];
|
|
25
|
-
const monthlyLimit = limits.monthly[type];
|
|
26
|
-
const today = this.getDateString();
|
|
27
|
-
const month = this.getMonthString();
|
|
28
|
-
const [dailySnapshot, monthlySnapshot] = await Promise.all([
|
|
29
|
-
this.getDailyRef(userId, type).get(),
|
|
30
|
-
this.getMonthlyRef(userId, type).get(),
|
|
31
|
-
]);
|
|
32
|
-
let dailyCount = 0;
|
|
33
|
-
let monthlyCount = 0;
|
|
34
|
-
if (dailySnapshot.exists()) {
|
|
35
|
-
const data = dailySnapshot.val();
|
|
36
|
-
if (data.date === today) {
|
|
37
|
-
dailyCount = data.count;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (monthlySnapshot.exists()) {
|
|
41
|
-
const data = monthlySnapshot.val();
|
|
42
|
-
if (data.month === month) {
|
|
43
|
-
monthlyCount = data.count;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const dailyRemaining = dailyLimit === -1 ? Infinity : dailyLimit - dailyCount;
|
|
47
|
-
const monthlyRemaining = monthlyLimit === -1 ? Infinity : monthlyLimit - monthlyCount;
|
|
48
|
-
if (dailyLimit !== -1 && dailyCount >= dailyLimit) {
|
|
49
|
-
return {
|
|
50
|
-
allowed: false,
|
|
51
|
-
dailyRemaining: 0,
|
|
52
|
-
monthlyRemaining,
|
|
53
|
-
error: new types_1.DailyLimitError(`Daily ${type} limit reached (${dailyLimit})`, { type, limit: dailyLimit, count: dailyCount }),
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
if (monthlyLimit !== -1 && monthlyCount >= monthlyLimit) {
|
|
57
|
-
return {
|
|
58
|
-
allowed: false,
|
|
59
|
-
dailyRemaining,
|
|
60
|
-
monthlyRemaining: 0,
|
|
61
|
-
error: new types_1.MonthlyLimitError(`Monthly ${type} limit reached (${monthlyLimit})`, { type, limit: monthlyLimit, count: monthlyCount }),
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
return {
|
|
65
|
-
allowed: true,
|
|
66
|
-
dailyRemaining,
|
|
67
|
-
monthlyRemaining,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
async increment(userId, type) {
|
|
71
|
-
const today = this.getDateString();
|
|
72
|
-
const month = this.getMonthString();
|
|
73
|
-
const dailyRef = this.getDailyRef(userId, type);
|
|
74
|
-
const monthlyRef = this.getMonthlyRef(userId, type);
|
|
75
|
-
const lifetimeRef = this.database.ref(`usage/${userId}/lifetime/total${type.charAt(0).toUpperCase() + type.slice(1)}s`);
|
|
76
|
-
await Promise.all([
|
|
77
|
-
dailyRef.transaction((current) => {
|
|
78
|
-
if (!current || current.date !== today) {
|
|
79
|
-
return { count: 1, date: today };
|
|
80
|
-
}
|
|
81
|
-
return { count: current.count + 1, date: today };
|
|
82
|
-
}),
|
|
83
|
-
monthlyRef.transaction((current) => {
|
|
84
|
-
if (!current || current.month !== month) {
|
|
85
|
-
return { count: 1, month };
|
|
86
|
-
}
|
|
87
|
-
return { count: current.count + 1, month };
|
|
88
|
-
}),
|
|
89
|
-
lifetimeRef.transaction((current) => {
|
|
90
|
-
return (current || 0) + 1;
|
|
91
|
-
}),
|
|
92
|
-
]);
|
|
93
|
-
}
|
|
94
|
-
async getUsage(userId, type) {
|
|
95
|
-
const today = this.getDateString();
|
|
96
|
-
const month = this.getMonthString();
|
|
97
|
-
const [dailySnapshot, monthlySnapshot, lifetimeSnapshot] = await Promise.all([
|
|
98
|
-
this.getDailyRef(userId, type).get(),
|
|
99
|
-
this.getMonthlyRef(userId, type).get(),
|
|
100
|
-
this.database
|
|
101
|
-
.ref(`usage/${userId}/lifetime/total${type.charAt(0).toUpperCase() + type.slice(1)}s`)
|
|
102
|
-
.get(),
|
|
103
|
-
]);
|
|
104
|
-
let daily = 0;
|
|
105
|
-
let monthly = 0;
|
|
106
|
-
const lifetime = lifetimeSnapshot.exists() ? lifetimeSnapshot.val() : 0;
|
|
107
|
-
if (dailySnapshot.exists()) {
|
|
108
|
-
const data = dailySnapshot.val();
|
|
109
|
-
if (data.date === today) {
|
|
110
|
-
daily = data.count;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (monthlySnapshot.exists()) {
|
|
114
|
-
const data = monthlySnapshot.val();
|
|
115
|
-
if (data.month === month) {
|
|
116
|
-
monthly = data.count;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return { daily, monthly, lifetime };
|
|
120
|
-
}
|
|
121
|
-
async resetDaily(userId, type) {
|
|
122
|
-
const today = this.getDateString();
|
|
123
|
-
await this.getDailyRef(userId, type).set({ count: 0, date: today });
|
|
124
|
-
}
|
|
125
|
-
async resetMonthly(userId, type) {
|
|
126
|
-
const month = this.getMonthString();
|
|
127
|
-
await this.getMonthlyRef(userId, type).set({ count: 0, month });
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
exports.UsageService = UsageService;
|
|
131
|
-
//# sourceMappingURL=usage.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usage.service.js","sourceRoot":"","sources":["../../../src/lib/usage/usage.service.ts"],"names":[],"mappings":";;;AACA,uCAIqB;AACrB,gDAA6D;AAm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AAkB,CAAC;YACjD,IAAI,IAAI,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;gBACxB,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YACrB,CAAC;QACH,CAAC;QAED,IAAI,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC;YAC7B,MAAM,IAAI,GAAG,eAAe,CAAC,GAAG,EAAoB,CAAC;YACrD,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;gBACzB,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC;YACvB,CAAC;QACH,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAc,EAAE,IAAe;QAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QACnC,MAAM,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,MAAc,EAAE,IAAe;QAChD,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACpC,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAClE,CAAC;CACF;AAtKD,oCAsKC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
|
package/dist/lib/utils/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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("./sanitize"), exports);
|
|
18
|
-
__exportStar(require("./slug"), exports);
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,yCAAuB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
/**
|
|
3
|
-
* Removes HTML tags and script content from a string.
|
|
4
|
-
* Use for text fields that should not contain HTML (descriptions, bios, etc.)
|
|
5
|
-
*/
|
|
6
|
-
export declare function sanitizeText(text: string): string;
|
|
7
|
-
/**
|
|
8
|
-
* Creates a Zod string schema that sanitizes HTML on transformation.
|
|
9
|
-
* Use in schemas where text input needs to be cleaned.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* const BioSchema = sanitizedString(z.string().max(280));
|
|
13
|
-
*/
|
|
14
|
-
export declare function sanitizedString<T extends z.ZodString>(schema: T): z.ZodEffects<T, string, z.input<T>>;
|
|
15
|
-
/**
|
|
16
|
-
* Escapes HTML special characters to prevent XSS.
|
|
17
|
-
* Use when HTML needs to be displayed as text.
|
|
18
|
-
*/
|
|
19
|
-
export declare function escapeHtml(text: string): string;
|
|
20
|
-
//# sourceMappingURL=sanitize.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,uCAE/D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAS/C"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sanitizeText = sanitizeText;
|
|
4
|
-
exports.sanitizedString = sanitizedString;
|
|
5
|
-
exports.escapeHtml = escapeHtml;
|
|
6
|
-
/**
|
|
7
|
-
* Removes HTML tags and script content from a string.
|
|
8
|
-
* Use for text fields that should not contain HTML (descriptions, bios, etc.)
|
|
9
|
-
*/
|
|
10
|
-
function sanitizeText(text) {
|
|
11
|
-
return text
|
|
12
|
-
.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "")
|
|
13
|
-
.replace(/<[^>]*>/g, "")
|
|
14
|
-
.trim();
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Creates a Zod string schema that sanitizes HTML on transformation.
|
|
18
|
-
* Use in schemas where text input needs to be cleaned.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* const BioSchema = sanitizedString(z.string().max(280));
|
|
22
|
-
*/
|
|
23
|
-
function sanitizedString(schema) {
|
|
24
|
-
return schema.transform(sanitizeText);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Escapes HTML special characters to prevent XSS.
|
|
28
|
-
* Use when HTML needs to be displayed as text.
|
|
29
|
-
*/
|
|
30
|
-
function escapeHtml(text) {
|
|
31
|
-
const htmlEscapes = {
|
|
32
|
-
"&": "&",
|
|
33
|
-
"<": "<",
|
|
34
|
-
">": ">",
|
|
35
|
-
'"': """,
|
|
36
|
-
"'": "'",
|
|
37
|
-
};
|
|
38
|
-
return text.replace(/[&<>"']/g, (char) => htmlEscapes[char]);
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=sanitize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.js","sourceRoot":"","sources":["../../../src/lib/utils/sanitize.ts"],"names":[],"mappings":";;AAMA,oCAKC;AASD,0CAEC;AAMD,gCASC;AAnCD;;;GAGG;AACH,SAAgB,YAAY,CAAC,IAAY;IACvC,OAAO,IAAI;SACR,OAAO,CAAC,qDAAqD,EAAE,EAAE,CAAC;SAClE,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,IAAI,EAAE,CAAC;AACZ,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,eAAe,CAAwB,MAAS;IAC9D,OAAO,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;AACxC,CAAC;AAED;;;GAGG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,MAAM,WAAW,GAA2B;QAC1C,GAAG,EAAE,OAAO;QACZ,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,QAAQ;QACb,GAAG,EAAE,OAAO;KACb,CAAC;IACF,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/D,CAAC"}
|
package/dist/lib/utils/slug.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts an English name to a URL-safe snake_case slug.
|
|
3
|
-
*
|
|
4
|
-
* @param englishName - The English name to convert
|
|
5
|
-
* @returns A slug matching the format: ^[a-z][a-z0-9_]*[a-z0-9]$
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* toSlug("Olive Oil") // "olive_oil"
|
|
9
|
-
* toSlug("Café au lait") // "cafe_au_lait"
|
|
10
|
-
* toSlug("100% Whole Wheat") // "whole_wheat" (numbers at start stripped)
|
|
11
|
-
*/
|
|
12
|
-
export declare function toSlug(englishName: string): string;
|
|
13
|
-
//# sourceMappingURL=slug.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slug.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/slug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAqBlD"}
|
package/dist/lib/utils/slug.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toSlug = toSlug;
|
|
4
|
-
/**
|
|
5
|
-
* Converts an English name to a URL-safe snake_case slug.
|
|
6
|
-
*
|
|
7
|
-
* @param englishName - The English name to convert
|
|
8
|
-
* @returns A slug matching the format: ^[a-z][a-z0-9_]*[a-z0-9]$
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* toSlug("Olive Oil") // "olive_oil"
|
|
12
|
-
* toSlug("Café au lait") // "cafe_au_lait"
|
|
13
|
-
* toSlug("100% Whole Wheat") // "whole_wheat" (numbers at start stripped)
|
|
14
|
-
*/
|
|
15
|
-
function toSlug(englishName) {
|
|
16
|
-
let slug = englishName
|
|
17
|
-
.toLowerCase()
|
|
18
|
-
.normalize("NFD")
|
|
19
|
-
.replace(/[\u0300-\u036f]/g, "") // Remove diacritics
|
|
20
|
-
.replace(/[^a-z0-9]+/g, "_") // Replace non-alphanumeric with _
|
|
21
|
-
.replace(/^_+|_+$/g, "") // Trim underscores
|
|
22
|
-
.replace(/_{2,}/g, "_"); // Collapse multiple underscores
|
|
23
|
-
// Ensure starts with letter (strip leading numbers/underscores)
|
|
24
|
-
slug = slug.replace(/^[0-9_]+/, "");
|
|
25
|
-
// Ensure ends with letter or number (strip trailing underscores)
|
|
26
|
-
slug = slug.replace(/_+$/, "");
|
|
27
|
-
// Handle edge case: if slug is too short or empty
|
|
28
|
-
if (slug.length < 2) {
|
|
29
|
-
throw new Error(`Cannot generate valid slug from: "${englishName}"`);
|
|
30
|
-
}
|
|
31
|
-
return slug;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=slug.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slug.js","sourceRoot":"","sources":["../../../src/lib/utils/slug.ts"],"names":[],"mappings":";;AAWA,wBAqBC;AAhCD;;;;;;;;;;GAUG;AACH,SAAgB,MAAM,CAAC,WAAmB;IACxC,IAAI,IAAI,GAAG,WAAW;SACnB,WAAW,EAAE;SACb,SAAS,CAAC,KAAK,CAAC;SAChB,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,oBAAoB;SACpD,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,kCAAkC;SAC9D,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,mBAAmB;SAC3C,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,gCAAgC;IAE3D,gEAAgE;IAChE,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IAEpC,iEAAiE;IACjE,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAE/B,kDAAkD;IAClD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,qCAAqC,WAAW,GAAG,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
export declare const IMAGE_TYPE_VALUES: readonly ["recipe", "ingredients"];
|
|
3
|
-
export declare const ImageTypeSchema: z.ZodEnum<["recipe", "ingredients"]>;
|
|
4
|
-
export type ImageType = z.infer<typeof ImageTypeSchema>;
|
|
5
|
-
//# sourceMappingURL=image_type.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image_type.d.ts","sourceRoot":"","sources":["../../../../src/types/core/enums/image_type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,eAAO,MAAM,iBAAiB,oCAAqC,CAAC;AACpE,eAAO,MAAM,eAAe,sCAA4B,CAAC;AACzD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ImageTypeSchema = exports.IMAGE_TYPE_VALUES = void 0;
|
|
4
|
-
const genkit_1 = require("genkit");
|
|
5
|
-
exports.IMAGE_TYPE_VALUES = ["recipe", "ingredients"];
|
|
6
|
-
exports.ImageTypeSchema = genkit_1.z.enum(exports.IMAGE_TYPE_VALUES);
|
|
7
|
-
//# sourceMappingURL=image_type.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"image_type.js","sourceRoot":"","sources":["../../../../src/types/core/enums/image_type.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAEd,QAAA,iBAAiB,GAAG,CAAC,QAAQ,EAAE,aAAa,CAAU,CAAC;AACvD,QAAA,eAAe,GAAG,UAAC,CAAC,IAAI,CAAC,yBAAiB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/core/enums/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
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("./image_type"), exports);
|
|
18
|
-
__exportStar(require("./locale"), exports);
|
|
19
|
-
__exportStar(require("./measurement_system"), exports);
|
|
20
|
-
__exportStar(require("./theme"), exports);
|
|
21
|
-
__exportStar(require("./url_type"), exports);
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/core/enums/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2CAAyB;AACzB,uDAAqC;AACrC,0CAAwB;AACxB,6CAA2B"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
export declare const LOCALE_VALUES: readonly ["en", "ar", "es", "fr", "ru"];
|
|
3
|
-
export declare const LocaleSchema: z.ZodEnum<["en", "ar", "es", "fr", "ru"]>;
|
|
4
|
-
export type Locale = (typeof LOCALE_VALUES)[number];
|
|
5
|
-
//# sourceMappingURL=locale.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../../../src/types/core/enums/locale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,eAAO,MAAM,aAAa,yCAA0C,CAAC;AACrE,eAAO,MAAM,YAAY,2CAAwB,CAAC;AAClD,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LocaleSchema = exports.LOCALE_VALUES = void 0;
|
|
4
|
-
const genkit_1 = require("genkit");
|
|
5
|
-
exports.LOCALE_VALUES = ["en", "ar", "es", "fr", "ru"];
|
|
6
|
-
exports.LocaleSchema = genkit_1.z.enum(exports.LOCALE_VALUES);
|
|
7
|
-
//# sourceMappingURL=locale.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../../../src/types/core/enums/locale.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAEd,QAAA,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AACxD,QAAA,YAAY,GAAG,UAAC,CAAC,IAAI,CAAC,qBAAa,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
export declare const MEASUREMENT_SYSTEM_VALUES: readonly ["metric", "imperial"];
|
|
3
|
-
export declare const MeasurementSystemSchema: z.ZodEnum<["metric", "imperial"]>;
|
|
4
|
-
export type MeasurementSystem = (typeof MEASUREMENT_SYSTEM_VALUES)[number];
|
|
5
|
-
//# sourceMappingURL=measurement_system.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"measurement_system.d.ts","sourceRoot":"","sources":["../../../../src/types/core/enums/measurement_system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,eAAO,MAAM,yBAAyB,iCAAkC,CAAC;AACzE,eAAO,MAAM,uBAAuB,mCAAoC,CAAC;AACzE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MeasurementSystemSchema = exports.MEASUREMENT_SYSTEM_VALUES = void 0;
|
|
4
|
-
const genkit_1 = require("genkit");
|
|
5
|
-
exports.MEASUREMENT_SYSTEM_VALUES = ["metric", "imperial"];
|
|
6
|
-
exports.MeasurementSystemSchema = genkit_1.z.enum(exports.MEASUREMENT_SYSTEM_VALUES);
|
|
7
|
-
//# sourceMappingURL=measurement_system.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"measurement_system.js","sourceRoot":"","sources":["../../../../src/types/core/enums/measurement_system.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAEd,QAAA,yBAAyB,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAU,CAAC;AAC5D,QAAA,uBAAuB,GAAG,UAAC,CAAC,IAAI,CAAC,iCAAyB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/types/core/enums/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,eAAO,MAAM,YAAY,sCAAuC,CAAC;AACjE,eAAO,MAAM,WAAW,wCAAuB,CAAC;AAChD,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ThemeSchema = exports.THEME_VALUES = void 0;
|
|
4
|
-
const genkit_1 = require("genkit");
|
|
5
|
-
exports.THEME_VALUES = ["light", "dark", "system"];
|
|
6
|
-
exports.ThemeSchema = genkit_1.z.enum(exports.THEME_VALUES);
|
|
7
|
-
//# sourceMappingURL=theme.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../../src/types/core/enums/theme.ts"],"names":[],"mappings":";;;AAAA,mCAA2B;AAEd,QAAA,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAC;AACpD,QAAA,WAAW,GAAG,UAAC,CAAC,IAAI,CAAC,oBAAY,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { z } from "genkit";
|
|
2
|
-
export declare const URL_TYPE_VALUES: readonly ["facebook", "instagram", "pdf", "pinterest", "tiktok", "website", "youtube"];
|
|
3
|
-
export declare const UrlTypeSchema: z.ZodEnum<["facebook", "instagram", "pdf", "pinterest", "tiktok", "website", "youtube"]>;
|
|
4
|
-
export type UrlType = z.infer<typeof UrlTypeSchema>;
|
|
5
|
-
//# sourceMappingURL=url_type.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"url_type.d.ts","sourceRoot":"","sources":["../../../../src/types/core/enums/url_type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAE3B,eAAO,MAAM,eAAe,wFAQlB,CAAC;AACX,eAAO,MAAM,aAAa,0FAA0B,CAAC;AACrD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UrlTypeSchema = exports.URL_TYPE_VALUES = void 0;
|
|
4
|
-
const genkit_1 = require("genkit");
|
|
5
|
-
exports.URL_TYPE_VALUES = [
|
|
6
|
-
"facebook",
|
|
7
|
-
"instagram",
|
|
8
|
-
"pdf",
|
|
9
|
-
"pinterest",
|
|
10
|
-
"tiktok",
|
|
11
|
-
"website",
|
|
12
|
-
"youtube",
|
|
13
|
-
];
|
|
14
|
-
exports.UrlTypeSchema = genkit_1.z.enum(exports.URL_TYPE_VALUES);
|
|
15
|
-
//# sourceMappingURL=url_type.js.map
|