feeef 0.1.1 → 0.1.3
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/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/feeef/feeef.ts","../src/feeef/repositories/orders.ts","../src/feeef/validators/order.ts","../src/feeef/validators/auth.ts","../src/feeef/validators/helpers.ts","../src/core/entities/order.ts","../src/feeef/repositories/repository.ts","../src/feeef/repositories/products.ts","../src/feeef/repositories/stores.ts","../src/feeef/validators/user_stores.ts","../src/feeef/repositories/users.ts","../src/feeef/validators/users.ts","../src/core/entities/store.ts","../src/core/entities/product.ts","../src/core/entities/shipping_method.ts","../src/core/embadded/contact.ts"],"sourcesContent":["import axios, { AxiosInstance } from 'axios'\n// import { buildMemoryStorage, buildWebStorage, setupCache } from 'axios-cache-interceptor'\nimport { OrderRepository } from './repositories/orders.js'\nimport { ProductRepository } from './repositories/products.js'\nimport { StoreRepository } from './repositories/stores.js'\nimport { UserRepository } from './repositories/users.js'\n\n/**\n * Configuration options for the FeeeF module.\n */\nexport interface FeeeFConfig {\n /**\n * The API key to be used for authentication.\n */\n apiKey: string\n\n /**\n * An optional Axios instance to be used for making HTTP requests.\n */\n client?: AxiosInstance\n\n /**\n * Specifies whether caching should be enabled or disabled.\n * If set to a number, it represents the maximum number of seconds to cache the responses.\n * If set to `false`, caching will be disabled (5s).\n * cannot be less than 5 seconds\n */\n cache?: false | number\n\n /**\n * The base URL for the API.\n */\n baseURL?: string\n}\n\n/**\n * Represents the FeeeF class.\n */\nexport class FeeeF {\n /**\n * The API key used for authentication.\n */\n apiKey: string\n\n /**\n * The Axios instance used for making HTTP requests.\n */\n client: AxiosInstance\n\n /**\n * The repository for managing stores.\n */\n stores: StoreRepository\n\n /**\n * The repository for managing products.\n */\n products: ProductRepository\n\n /**\n * The repository for managing users.\n */\n users: UserRepository\n\n /**\n * The repository for managing orders.\n */\n orders: OrderRepository\n\n /**\n * Constructs a new instance of the FeeeF class.\n * @param {FeeeFConfig} config - The configuration object.\n * @param {string} config.apiKey - The API key used for authentication.\n * @param {AxiosInstance} config.client - The Axios instance used for making HTTP requests.\n * @param {boolean | number} config.cache - The caching configuration. Set to `false` to disable caching, or provide a number to set the cache TTL in milliseconds.\n */\n //\n constructor({ apiKey, client, cache, baseURL = 'http://localhost:3333/api/v1' }: FeeeFConfig) {\n console.log(cache)\n this.apiKey = apiKey\n // get th \"cache\" search param\n // const urlParams = new URLSearchParams(window.location.search)\n // const cacheParam = urlParams.get('cache')\n // if is 0 or false, disable cache\n // if (cacheParam == '0') {\n this.client = client || axios\n // } else {\n // this.client = setupCache(client || axios, {\n // ttl: cache === false ? 5 : Math.max(cache!, 5) || 1 * 60 * 1000, // 1 minute by default\n // // for persistent cache use buildWebStorage\n // storage: buildWebStorage(localStorage, 'ff:'),\n // })\n // }\n // set base url\n this.client.defaults.baseURL = baseURL\n this.stores = new StoreRepository(this.client)\n this.products = new ProductRepository(this.client)\n this.users = new UserRepository(this.client)\n this.orders = new OrderRepository(this.client)\n }\n}\n","import vine from '@vinejs/vine'\nimport { InferInput } from '@vinejs/vine/types'\nimport { AxiosInstance } from 'axios'\nimport { CreateOrderSchema, SendOrderSchema } from '../validators/order.js'\nimport { ModelRepository } from './repository.js'\nimport { OrderEntity } from '../../core/entities/order.js'\n/**\n * Represents the options for tracking an order.\n */\nexport interface OrderModelTrackOptions {\n id: string\n params?: Record<string, any>\n}\n/**\n * Represents a repository for managing orders.\n */\nexport class OrderRepository extends ModelRepository<\n OrderEntity,\n InferInput<typeof CreateOrderSchema>,\n InferInput<typeof CreateOrderSchema>\n> {\n /**\n * Constructs a new OrderRepository instance.\n * @param client - The AxiosInstance used for making HTTP requests.\n */\n constructor(client: AxiosInstance) {\n super('orders', client)\n }\n\n /**\n * Sends an order from an anonymous user.\n * @param data - The data representing the order to be sent.\n * @returns A Promise that resolves to the sent OrderEntity.\n */\n async send(data: InferInput<typeof SendOrderSchema>): Promise<OrderEntity> {\n const validator = vine.compile(SendOrderSchema)\n const output = await validator.validate(data)\n const res = await this.client.post(`/${this.resource}/send`, output)\n\n // Return the sent OrderEntity\n return res.data\n }\n\n /**\n * track the order by the order id\n * it will return the order status and history\n * @param options - The options for finding the model.\n * @returns A promise that resolves to the found model.\n */\n async track(options: OrderModelTrackOptions): Promise<OrderEntity> {\n const { id, params } = options\n const res = await this.client.get(`/${this.resource}/${id}`, {\n params: {\n ...params,\n },\n })\n return res.data\n }\n}\n","// import { OrderStatus } from '#core/core'\nimport vine from '@vinejs/vine'\nimport { PhoneShema } from './auth.js'\nimport { OrderStatus } from '../../core/entities/order.js'\n\nexport const OrderItemSchema = vine.object({\n productId: vine.string(),\n // productId: vine.string().exists(async (db, value, field) => {\n // const product = await db.from('products').where('id', value).first()\n // return !!product\n // }),\n productName: vine.string().optional(),\n variant: vine.any().optional(),\n quantity: vine.number(),\n price: vine.number().optional(),\n})\n\nexport const GuestOrderItemSchema = vine.object({\n productId: vine.string(),\n variantPath: vine.string().optional(),\n quantity: vine.number(),\n})\n\nexport const SendOrderSchema = vine.object({\n id: vine.string().optional(),\n customerName: vine.string().optional(),\n customerPhone: vine.string(),\n // customerIp: vine.string().optional(),\n shippingAddress: vine.string().optional(),\n shippingCity: vine.string().optional(),\n shippingState: vine.string().optional(),\n shippingMethodId: vine.string().optional(),\n paymentMethodId: vine.string().optional(),\n items: vine.array(GuestOrderItemSchema).minLength(1),\n // subtotal: vine.number().optional(),\n // shippingPrice: vine.number().optional(),\n // total: vine.number().optional(),\n // discount: vine.number().optional(),\n coupon: vine.string().optional(),\n status: vine.enum(['pending', 'draft']),\n // TODO: validate storeId is exists and not blocked\n storeId: vine.string(),\n metadata: vine.any().optional(),\n})\n\n/// store owner section\n// CreateOrderSchema\nexport const CreateOrderSchema = vine.object({\n id: vine.string().optional(),\n customerName: vine.string().optional(),\n customerPhone: PhoneShema,\n customerIp: vine.string().optional(),\n shippingAddress: vine.string().optional(),\n shippingCity: vine.string().optional(),\n shippingState: vine.string().optional(),\n shippingMethodId: vine.string().optional(),\n paymentMethodId: vine.string().optional(),\n items: vine.array(OrderItemSchema).minLength(1),\n subtotal: vine.number().optional(),\n shippingPrice: vine.number().optional(),\n total: vine.number().optional(),\n discount: vine.number().optional(),\n coupon: vine.string().optional(),\n status: vine.enum(Object.values(OrderStatus)).optional(),\n storeId: vine.string(),\n metadata: vine.any().optional(),\n})\n\n// UpdateOrderSchema\nexport const UpdateOrderSchema = vine.object({\n id: vine.string().optional(),\n customerName: vine.string().optional(),\n customerPhone: PhoneShema.optional(),\n customerIp: vine.string().optional(),\n shippingAddress: vine.string().optional(),\n shippingCity: vine.string().optional(),\n shippingState: vine.string().optional(),\n shippingMethodId: vine.string().optional(),\n paymentMethodId: vine.string().optional(),\n items: vine.array(OrderItemSchema).minLength(1).optional(),\n subtotal: vine.number().optional(),\n shippingPrice: vine.number().optional(),\n total: vine.number().optional(),\n discount: vine.number().optional(),\n coupon: vine.string().optional(),\n status: vine.enum(Object.values(OrderStatus)).optional(),\n storeId: vine.string(),\n metadata: vine.any().optional(),\n})\n","import vine from '@vinejs/vine'\nimport { ImageFileSchema } from './helpers.js'\n\nexport const PhoneShema = vine.string().regex(/^0(5|6|7)\\d{8}$|^0(2)\\d{7}$/)\n\nexport const SignupSchema = vine.object({\n name: vine.string().minLength(2).maxLength(32),\n email: vine.string(),\n // .unique(async (db, value, field) => {\n // const user = await db.from('users').where('email', value).first()\n // return !user\n // })\n phone: PhoneShema\n // .unique(async (db, value, field) => {\n // const user = await db.from('users').where('phone', value).first()\n // return !user\n // })\n .optional(),\n photoFile: ImageFileSchema.optional(),\n photoUrl: vine.string().optional(),\n password: vine.string().minLength(8).maxLength(32),\n})\n\nexport const SigninSchema = vine.object({\n email: vine.string().email(),\n password: vine.string().minLength(8).maxLength(32),\n})\n\nexport const AuthUpdateUserSchema = vine.object({\n name: vine.string().minLength(2).maxLength(32).optional(),\n email: vine\n .string()\n // .unique(async (db, value, field) => {\n // const user = await db.from('users').where('email', value).first()\n // return !user\n // })\n .optional(),\n phone: PhoneShema.optional(),\n // for upload file\n photoFile: vine\n // .file({\n // size: '1mb',\n // extnames: ['jpg', 'jpeg', 'png', 'gif', 'webp'],\n // })\n .any(),\n photoUrl: vine.string().optional(),\n oldPassword: vine.string().minLength(8).maxLength(32).optional(),\n newPassword: vine.string().minLength(8).maxLength(32).notSameAs('oldPassword').optional(),\n})\n","import vine from '@vinejs/vine'\n\nexport const AvatarFileSchema = vine.any()\n// .file({\n// size: '1mb',\n// extnames: ['jpg', 'jpeg', 'png', 'gif', 'webp'],\n// })\n\nexport const ImageFileSchema = vine.any()\n// .file({\n// size: '1mb',\n// extnames: ['jpg', 'jpeg', 'png', 'gif', 'webp'],\n// })\n\nexport const DomainSchema = vine.object({\n name: vine.string().minLength(3).maxLength(32),\n verifiedAt: vine.date().optional(),\n metadata: vine.object({}).optional(),\n})\n\n// decoration\nexport const StoreDecorationSchema = vine.object({\n primary: vine.number().min(0x0).max(0xffffffff),\n onPrimary: vine.number().min(0x0).max(0xffffffff),\n showStoreLogoInHeader: vine.boolean().optional(),\n logoFullHeight: vine.boolean().optional(),\n showStoreNameInHeader: vine.boolean().optional(),\n metadata: vine.any().optional(),\n})\n\n// export const EmbaddedImageSchema = vine.object({\n// url: vine.string().url(),\n// alt: vine.string().optional(),\n// width: vine.number().optional(),\n// height: vine.number().optional(),\n// })\n\nexport const EmbaddedCategorySchema = vine.object({\n name: vine.string().minLength(2).maxLength(32),\n description: vine.string().minLength(2).maxLength(255).optional(),\n photoUrl: vine.string().optional(),\n ondarkPhotoUrl: vine.string().optional(),\n photoFile: AvatarFileSchema.optional(),\n ondarkPhotoFile: AvatarFileSchema.optional(),\n metadata: vine.object({}).optional(),\n})\n\nexport const EmbaddedAddressSchema = vine.object({\n country: vine.string().minLength(2).maxLength(32).optional(),\n state: vine.string().minLength(2).maxLength(32).optional(),\n city: vine.string().minLength(2).maxLength(32).optional(),\n street: vine.string().minLength(2).maxLength(32).optional(),\n zip: vine.string().minLength(2).maxLength(32).optional(),\n metadata: vine.object({}).optional().optional(),\n})\n\nexport const EmbaddedContactSchema = vine.object({\n type: vine.string().minLength(2).maxLength(32),\n value: vine.string().minLength(2).maxLength(255),\n metadata: vine.object({}).optional(),\n})\n\n// StoreBunner\nexport const StoreBunner = vine.object({\n url: vine.string().url().optional(),\n title: vine.string(),\n enabled: vine.boolean().optional(),\n metadata: vine.object({}).optional(),\n})\n","export enum OrderStatus {\n draft = 'draft',\n pending = 'pending',\n review = 'review',\n accepted = 'accepted',\n processing = 'processing',\n completed = 'completed',\n cancelled = 'cancelled',\n}\n\n// PaymentStatus\nexport enum PaymentStatus {\n unpaid = 'unpaid',\n paid = 'paid',\n received = 'received',\n}\nexport enum DeliveryStatus {\n pending = 'pending',\n delivering = 'delivering',\n delivered = 'delivered',\n returned = 'returned',\n}\n\nexport interface OrderEntity {\n id: string\n customerName?: string | null\n customerPhone: string\n customerIp?: string | null\n shippingAddress?: string | null\n shippingCity?: string | null\n shippingState?: string | null\n shippingMethodId?: string | null\n paymentMethodId?: string | null\n items: OrderItem[]\n subtotal: number\n shippingPrice: number\n total: number\n discount: number\n coupon?: string | null\n storeId: string\n metadata: any\n status: OrderStatus\n paymentStatus: PaymentStatus\n deliveryStatus: DeliveryStatus\n createdAt: any\n updatedAt: any\n}\nexport interface OrderItem {\n productId: string\n productName: string\n productPhotoUrl?: string | null\n variantPath?: string\n quantity: number\n price: number\n}\n\n// order track entity\nexport interface OrderTrackEntity {\n id: string\n customerName?: string | null\n customerPhone: string\n customerIp?: string | null\n shippingAddress?: string | null\n shippingCity?: string | null\n shippingState?: string | null\n shippingMethodId?: string | null\n paymentMethodId?: string | null\n items: OrderItem[]\n subtotal: number\n shippingPrice: number\n total: number\n discount: number\n coupon?: string | null\n storeId: string\n metadata: any\n status: OrderStatus\n paymentStatus: PaymentStatus\n deliveryStatus: DeliveryStatus\n createdAt: any\n updatedAt: any\n}\n","import { AxiosInstance } from 'axios'\n\n/**\n * Represents a generic model repository.\n * @template T - The type of the model.\n * @template C - The type of the create options.\n * @template U - The type of the update options.\n */\nexport abstract class ModelRepository<T, C, U> {\n resource: string\n // client\n client: AxiosInstance\n\n /**\n * Constructs a new instance of the ModelRepository class.\n * @param resource - The resource name.\n * @param client - The Axios instance used for making HTTP requests.\n */\n constructor(resource: string, client: AxiosInstance) {\n this.resource = resource\n this.client = client\n }\n\n /**\n * Finds a model by its ID or other criteria.\n * @param options - The options for finding the model.\n * @returns A promise that resolves to the found model.\n */\n async find(options: ModelFindOptions): Promise<T> {\n const { id, by, params } = options\n const res = await this.client.get(`/${this.resource}/${id}`, {\n params: {\n by: by || 'id',\n ...params,\n },\n })\n return res.data\n }\n\n /**\n * Lists models with optional pagination and filtering.\n * @param options - The options for listing the models.\n * @returns A promise that resolves to a list of models.\n */\n async list(options?: ModelListOptions): Promise<ListResponse<T>> {\n const { page, offset, limit, params } = options || {}\n const res = await this.client.get(`/${this.resource}`, {\n params: { page, offset, limit, ...params },\n })\n // if res.data is an array then create ListResponse\n if (Array.isArray(res.data)) {\n return {\n data: res.data,\n }\n } else {\n return {\n data: res.data.data,\n total: res.data.meta.total,\n page: res.data.meta.currentPage,\n limit: res.data.meta.perPage,\n }\n }\n }\n\n /**\n * Creates a new model.\n * @param options - The options for creating the model.\n * @returns A promise that resolves to the created model.\n */\n async create(options: ModelCreateOptions<C>): Promise<T> {\n const { data, params } = options\n const res = await this.client.post(`/${this.resource}`, data, { params })\n return res.data\n }\n\n /**\n * Updates an existing model.\n * @param options - The options for updating the model.\n * @returns A promise that resolves to the updated model.\n */\n async update(options: ModelUpdateOptions<U>): Promise<T> {\n const { id, data, params } = options\n const res = await this.client.put(`/${this.resource}/${id}`, data, {\n params,\n })\n return res.data\n }\n\n /**\n * Deletes a model by its ID or other criteria.\n * @param options - The options for deleting the model.\n * @returns A promise that resolves when the model is deleted.\n */\n async delete(options: ModelFindOptions): Promise<void> {\n const { id, by, params } = options\n await this.client.delete(`/${this.resource}/${id}`, {\n params: {\n by: by || 'id',\n ...params,\n },\n })\n }\n}\n\n/**\n * Represents a list response containing an array of data of type T.\n */\nexport interface ListResponse<T> {\n data: T[]\n total?: number\n page?: number\n limit?: number\n}\n\n/**\n * Represents the options for making a request.\n */\ninterface RequestOptions {\n params?: Record<string, any>\n}\n\nexport interface ModelFindOptions extends RequestOptions {\n /**\n * The ID of the model to find or the value to find by.\n */\n id: string\n /**\n * The field to find by.\n * @default \"id\" - The ID field.\n */\n by?: string\n}\n\n/**\n * Options for listing models.\n */\nexport interface ModelListOptions extends RequestOptions {\n /**\n * The page number to retrieve.\n */\n page?: number\n\n /**\n * The offset from the beginning of the list.\n */\n offset?: number\n\n /**\n * The maximum number of models to retrieve per page.\n */\n limit?: number\n}\n\n/**\n * Represents the options for creating a model.\n * @template T - The type of data being created.\n */\nexport interface ModelCreateOptions<T> extends RequestOptions {\n data: T\n}\n\n/**\n * Represents the options for updating a model.\n * @template T - The type of the data being updated.\n */\nexport interface ModelUpdateOptions<T> extends RequestOptions {\n /**\n * The ID of the model to update.\n */\n id: string\n /**\n * The data to update the model with.\n */\n data: T\n}\n","import { InferInput } from '@vinejs/vine/types'\nimport { AxiosInstance } from 'axios'\nimport { CreateProductSchema, UpdateProductSchema } from '../validators/product.js'\nimport { ModelRepository } from './repository.js'\nimport { ProductEntity } from '../../core/entities/product.js'\n\n/**\n * Represents a repository for managing products.\n */\nexport class ProductRepository extends ModelRepository<\n ProductEntity,\n InferInput<typeof CreateProductSchema>,\n InferInput<typeof UpdateProductSchema>\n> {\n /**\n * Creates a new instance of the ProductRepository class.\n * @param client - The AxiosInstance used for making HTTP requests.\n */\n constructor(client: AxiosInstance) {\n super('products', client)\n }\n}\n","import vine from '@vinejs/vine'\nimport { InferInput } from '@vinejs/vine/types'\nimport { AxiosInstance } from 'axios'\nimport { CreateUserStoreSchema, UpdateUserStoreSchema } from '../validators/user_stores.js'\nimport { ModelRepository, ModelCreateOptions } from './repository.js'\nimport { StoreEntity } from '../../core/entities/store.js'\n\n/**\n * Repository for managing Store entities.\n */\nexport class StoreRepository extends ModelRepository<\n StoreEntity,\n InferInput<typeof CreateUserStoreSchema>,\n InferInput<typeof UpdateUserStoreSchema>\n> {\n /**\n * Constructs a new StoreRepository instance.\n * @param client The AxiosInstance used for making HTTP requests.\n */\n constructor(client: AxiosInstance) {\n super('stores', client)\n }\n\n /**\n * Creates a new Store entity.\n * @param options The options for creating the Store entity.\n * @returns A Promise that resolves to the created Store entity.\n */\n async create(\n options: ModelCreateOptions<InferInput<typeof CreateUserStoreSchema>>\n ): Promise<StoreEntity> {\n const validator = vine.compile(CreateUserStoreSchema)\n const output = await validator.validate(options.data)\n return super.create({ ...options, data: output })\n }\n}\n","import vine from '@vinejs/vine'\nimport {\n AvatarFileSchema,\n EmbaddedContactSchema,\n DomainSchema,\n EmbaddedAddressSchema,\n EmbaddedCategorySchema,\n StoreBunner,\n StoreDecorationSchema,\n} from './helpers.js'\n// \"defaultShippingRates.1\"\nexport const DefaultShippingRatesSchema = vine.array(\n vine.array(vine.number().min(0).max(100000).nullable()).nullable()\n)\n\nexport const CreateUserStoreSchema = vine.object({\n name: vine.string().minLength(2).maxLength(32),\n slug: vine\n .string()\n .regex(/^[a-z0-9-]+$/)\n .minLength(2)\n .maxLength(32),\n // .unique(async (db, value, field) => {\n // const store = await db.from('stores').where('slug', value).first()\n // return !store\n // })\n domain: vine\n .object({\n name: vine.string().minLength(2).maxLength(32),\n })\n .optional(),\n decoration: StoreDecorationSchema.optional(),\n\n banner: StoreBunner.optional(),\n logoUrl: vine.string().optional(),\n ondarkLogoUrl: vine.string().optional(),\n logoFile: AvatarFileSchema.optional(),\n ondarkLogoFile: AvatarFileSchema.optional(),\n categories: vine.array(EmbaddedCategorySchema).optional(),\n title: vine.string().minLength(2).maxLength(255).optional(),\n description: vine.string().minLength(2).maxLength(255).optional(),\n addresses: vine.array(EmbaddedAddressSchema).optional(),\n metadata: vine.object({}).optional(),\n contacts: vine\n .array(\n vine.object({\n type: vine.string().minLength(2).maxLength(32),\n value: vine.string().minLength(2).maxLength(255),\n metadata: vine.object({}).optional(),\n })\n )\n .optional(),\n defaultShippingRates: DefaultShippingRatesSchema.optional(),\n integrations: vine.array(vine.any()).optional(),\n})\n\n// UpdateStoreSchema\nexport const UpdateUserStoreSchema = vine.object({\n name: vine.string().minLength(2).maxLength(32).optional(),\n slug: vine\n .string()\n .regex(/^[a-z0-9-]+$/)\n .minLength(2)\n .maxLength(32)\n // .unique(async (db, value, field) => {\n // const store = await db.from('stores').where('slug', value).first()\n // return !store\n // })\n .optional(),\n domain: DomainSchema.optional(),\n decoration: StoreDecorationSchema.optional(),\n banner: StoreBunner.optional(),\n logoUrl: vine.string().nullable().optional(),\n ondarkLogoUrl: vine.string().nullable().optional(),\n logoFile: AvatarFileSchema.optional(),\n ondarkLogoFile: AvatarFileSchema.optional(),\n categories: vine.array(EmbaddedCategorySchema).optional(),\n title: vine.string().minLength(2).maxLength(255).optional(),\n description: vine.string().minLength(2).maxLength(255).optional(),\n addresses: vine.array(EmbaddedAddressSchema).optional(),\n metadata: vine.object({}).optional(),\n contacts: vine.array(EmbaddedContactSchema).optional(),\n defaultShippingRates: DefaultShippingRatesSchema.optional(),\n integrations: vine.array(vine.any()).optional(),\n})\n","import vine from '@vinejs/vine'\nimport { InferInput } from '@vinejs/vine/types'\nimport { AxiosInstance } from 'axios'\nimport { SigninSchema, AuthUpdateUserSchema } from '../validators/auth.js'\nimport { CreateUserSchema, UpdateUserSchema } from '../validators/users.js'\nimport { ModelRepository } from './repository.js'\nimport { AuthToken, UserEntity } from '../../core/entities/user.js'\n\n/**\n * Represents the response returned by the authentication process.\n */\nexport interface AuthResponse {\n token: AuthToken\n user: UserEntity\n}\n\n/**\n * Represents a repository for managing user data.\n * Extends the ModelRepository class.\n */\nexport class UserRepository extends ModelRepository<\n UserEntity,\n InferInput<typeof CreateUserSchema>,\n InferInput<typeof UpdateUserSchema>\n> {\n /**\n * Represents the authentication response.\n */\n auth: AuthResponse | null = null\n\n /**\n * Constructs a new UserRepository instance.\n * @param client - The AxiosInstance used for making HTTP requests.\n */\n constructor(client: AxiosInstance) {\n super('users', client)\n }\n\n /**\n * Signs in a user with the provided credentials.\n * @param credentials - The user credentials.\n * @returns A promise that resolves to the authentication response.\n */\n async signin(credentials: InferInput<typeof SigninSchema>): Promise<AuthResponse> {\n // validate the input\n const validator = vine.compile(SigninSchema)\n const output = await validator.validate(credentials)\n const res = await this.client.post(`/${this.resource}/auth/signin`, output)\n this.auth = res.data\n return res.data\n }\n\n /**\n * Signs up a new user with the provided credentials.\n * @param credentials - The user credentials.\n * @returns A promise that resolves to the authentication response.\n */\n async signup(credentials: InferInput<typeof CreateUserSchema>): Promise<AuthResponse> {\n // validate the input\n const validator = vine.compile(CreateUserSchema)\n const output = await validator.validate(credentials)\n const res = await this.client.post(`/${this.resource}/auth/signup`, output)\n this.auth = res.data\n return res.data\n }\n\n /**\n * Signs out the currently authenticated user.\n * @returns A promise that resolves when the user is signed out.\n */\n async signout(): Promise<void> {\n this.auth = null\n }\n\n /**\n * Updates the authenticated user's data.\n * @param data - The updated user data.\n * @returns A promise that resolves to the updated user entity.\n */\n async updateMe(data: InferInput<typeof AuthUpdateUserSchema>): Promise<UserEntity> {\n const validator = vine.compile(AuthUpdateUserSchema)\n const output = await validator.validate(data)\n const res = await this.client.put(`/${this.resource}/auth`, output)\n return res.data\n }\n}\n","import vine from '@vinejs/vine'\n\n// User Schemas\n//CreateUserSchema\nexport const CreateUserSchema = vine.object({\n name: vine.string().minLength(2).maxLength(32),\n email: vine.string(),\n // .unique(async (db, value, field) => {\n // const user = await db.from('users').where('email', value).first()\n // return !user\n // }),\n phone: vine\n .string()\n .regex(/^0(5|6|7)\\d{8}$|^0(2)\\d{7}$/)\n // .unique(async (db, value, field) => {\n // const user = await db.from('users').where('phone', value).first()\n // return !user\n // })\n .optional(),\n password: vine.string().minLength(8).maxLength(32),\n // for upload file\n photoFile: vine.any(),\n // .file({\n // size: '1mb',\n // extnames: ['jpg', 'jpeg', 'png', 'gif', 'webp'],\n // })\n // .optional(),\n photoUrl: vine.string().optional(),\n // metadata (any object)\n metadata: vine.object({}).optional(),\n // dates\n emailVerifiedAt: vine.date().optional(),\n phoneVerifiedAt: vine.date().optional(),\n verifiedAt: vine.date().optional(),\n blockedAt: vine.date().optional(),\n})\n\n//UpdateUserSchema\nexport const UpdateUserSchema = vine.object({\n name: vine.string().minLength(2).maxLength(32).optional(),\n email: vine\n .string()\n // .unique(async (db, value, field) => {\n // const user = await db.from('users').where('email', value).first()\n // return !user\n // })\n .optional(),\n phone: vine\n .string()\n // must start with 0 then if secend is (5|6|7) then 8 digits and if secend is (2) then 7 digits\n .regex(/^0(5|6|7)\\d{8}$|^0(2)\\d{7}$/)\n .optional(),\n password: vine.string().minLength(8).maxLength(32).confirmed().optional(),\n // for upload file\n photoFile: vine\n // .file({\n // size: '1mb',\n // extnames: ['jpg', 'jpeg', 'png', 'gif', 'webp'],\n // })\n .any(),\n photoUrl: vine.string().optional(),\n // metadata (any object)\n metadata: vine.object({}).optional(),\n // dates\n emailVerifiedAt: vine.date().optional(),\n phoneVerifiedAt: vine.date().optional(),\n verifiedAt: vine.string().optional(),\n blockedAt: vine.date().optional(),\n})\n","import { EmbaddedAddress } from '../embadded/address.js'\nimport { EmbaddedCategory } from '../embadded/category.js'\nimport { EmbaddedContact } from '../embadded/contact.js'\n// import { OrderEntity } from \"./order.js\";\n// import { ShippingMethodEntity } from \"./shipping_method.js\";\nimport { UserEntity } from './user.js'\nimport { DateTime } from 'luxon'\n\nexport interface StoreEntity {\n id: string\n slug: string\n banner: StoreBanner | null\n action: StoreAction | null\n domain: StoreDomain | null\n decoration: StoreDecoration | null\n name: string\n logoUrl: string | null\n ondarkLogoUrl: string | null\n userId: string\n categories: EmbaddedCategory[]\n title: string | null\n description: string | null\n addresses: EmbaddedAddress[]\n metadata: Record<string, any>\n contacts: EmbaddedContact[]\n integrations: StoreIntegrations\n verifiedAt: any | null\n blockedAt: any | null\n createdAt: any\n updatedAt: any\n // products: ProductEntity[];\n user?: UserEntity\n // orders: OrderEntity[];\n // shippingMethods: ShippingMethodEntity[];\n defaultShippingRates: (number | null)[][] | null\n\n // subscription\n subscription?: any\n due?: number\n\n // StoreConfigs\n configs?: StoreConfigs\n\n // metaPixelIds\n metaPixelIds?: string[]\n}\n\nexport interface StoreConfigs {\n currencies: StoreCurrencyConfig[]\n defaultCurrency: number\n}\n\nexport interface StoreCurrencyConfig {\n code: string\n symbol: string\n precision: number\n rate: number\n}\n\nexport interface StoreDomain {\n name: string\n verifiedAt: any | null\n metadata: Record<string, any>\n}\nexport interface StoreBanner {\n title: string\n url?: string | null\n enabled: boolean\n metadata: Record<string, any>\n}\n\nexport interface StoreDecoration {\n primary: number\n onPrimary?: number\n showStoreLogoInHeader?: boolean\n logoFullHeight?: boolean\n showStoreNameInHeader?: boolean\n metadata?: Record<string, any>\n}\n\nexport interface StoreAction {\n label: string\n url: string\n type: StoreActionType\n}\n\nexport enum StoreActionType {\n link = 'link',\n whatsapp = 'whatsapp',\n telegram = 'telegram',\n phone = 'phone',\n}\nexport interface MetaPixel {\n id: string\n key?: string\n}\nexport interface MetaPixelIntegration {\n id: string\n pixels: MetaPixel[]\n active: boolean\n metadata: Record<string, any>\n}\n\nexport interface StoreIntegrations {\n [key: string]: any\n metadata?: Record<string, any>\n\n // @Default('default') String id,\n // @Default([]) List<MetaPixel> pixels,\n // @Default(true) bool active,\n // @Default({}) Map<String, dynamic> metadata,\n metaPixel?: MetaPixelIntegration\n googleAnalytics?: any\n googleSheet?: any\n sms?: any\n telegram?: any\n yalidine?: any\n maystroDelivery?: any\n echotrak?: any\n procolis?: any\n noest?: any\n}\n\nexport enum StoreSubscriptionStatus {\n active = 'active',\n inactive = 'inactive',\n}\n\nexport enum StoreSubscriptionType {\n free = 'free',\n quota = 'quota',\n percentage = 'percentage',\n}\n\nexport interface StoreSubscription {\n type: StoreSubscriptionType\n status: StoreSubscriptionStatus\n startedAt: DateTime\n expiresAt: DateTime | null\n metadata: Record<string, any>\n}\n\nexport interface StoreFreeSubscription extends StoreSubscription {\n type: StoreSubscriptionType.free\n}\n\nexport interface StoreQuotaSubscription extends StoreSubscription {\n type: StoreSubscriptionType.quota\n quota: number\n}\n// another way is by taking percentage of the sales\nexport interface StorePercentageSubscription extends StoreSubscription {\n type: StoreSubscriptionType.percentage\n percentage: number\n}\n","import { EmbaddedCategory } from '../embadded/category.js'\nimport { ShippingMethodEntity } from './shipping_method.js'\nimport { StoreEntity } from './store.js'\n\nexport interface ProductEntity {\n id: string\n\n slug: string\n\n decoration: ProductDecoration | null\n\n name: string | null\n\n photoUrl: string | null\n\n media: string[]\n\n storeId: string\n\n shippingMethodId?: string | null\n\n category: EmbaddedCategory\n\n title: string | null\n\n description: string | null\n\n body: string | null\n\n // sku\n sku: string | null\n\n price: number\n\n cost: number | null\n\n discount: number | null\n\n stock: number\n\n sold: number\n\n views: number\n\n likes: number\n\n dislikes: number\n\n variant?: ProductVariant | null\n\n metadata: Record<string, any>\n\n status: ProductStatus\n\n type: ProductType\n\n verifiedAt: any | null\n\n blockedAt: any | null\n\n createdAt: any\n\n updatedAt: any\n\n // relations\n store?: StoreEntity\n shippingMethod?: ShippingMethodEntity\n}\n\nexport enum ProductStatus {\n draft = 'draft',\n published = 'published',\n archived = 'archived',\n deleted = 'deleted',\n}\n\nexport interface ProductDecoration {\n metadata: Record<string, any>\n}\n\nexport interface ProductVariant {\n name: string\n options: ProductVariantOption[]\n}\n\nexport interface ProductVariantOption {\n name: string\n sku?: string | null\n price?: number | null\n discount?: number | null\n stock?: number | null\n sold?: number | null\n type?: VariantOptionType\n child?: ProductVariant | null\n mediaIndex?: number | null\n hint?: string | null\n}\n\nexport enum VariantOptionType {\n color = 'color',\n image = 'image',\n text = 'text',\n}\n\nexport enum ProductType {\n physical = 'physical',\n digital = 'digital',\n service = 'service',\n}\n","import { OrderEntity } from './order.js'\n\nexport interface ShippingMethodEntity {\n id: string\n name: string\n description: string | null\n logoUrl: string | null\n ondarkLogoUrl: string | null\n price: number\n forks: number\n sourceId: string\n storeId: string\n rates: (number | null)[][] | null\n status: ShippingMethodStatus\n policy: ShippingMethodPolicy\n verifiedAt: any\n createdAt: any\n updatedAt: any\n orders: OrderEntity[]\n source: ShippingMethodEntity | null\n}\n\nexport enum ShippingMethodStatus {\n draft = 'draft',\n published = 'published',\n archived = 'archived',\n}\n\nexport enum ShippingMethodPolicy {\n private = 'private',\n public = 'public',\n}\n","export enum EmbaddedContactType {\n phone = 'phone',\n email = 'email',\n facebook = 'facebook',\n twitter = 'twitter',\n instagram = 'instagram',\n linkedin = 'linkedin',\n website = 'website',\n whatsapp = 'whatsapp',\n telegram = 'telegram',\n signal = 'signal',\n viber = 'viber',\n skype = 'skype',\n zoom = 'zoom',\n other = 'other',\n}\n\n// EmbaddedContactType is not enum but can only be: \"phone\" | \"email\" | \"facebook\" | \"twitter\" | \"instagram\" | \"linkedin\" | \"website\" | \"whatsapp\" | \"telegram\" | \"signal\" | \"viber\" | \"skype\" | \"zoom\" | \"other\n\nexport interface EmbaddedContact {\n type: EmbaddedContactType\n value: string\n name?: string\n metadata?: Record<string, any>\n}\n"],"mappings":";AAAA,OAAO,WAA8B;;;ACArC,OAAOA,WAAU;;;ACCjB,OAAOC,WAAU;;;ACDjB,OAAOC,WAAU;;;ACAjB,OAAO,UAAU;AAEV,IAAM,mBAAmB,KAAK,IAAI;AAMlC,IAAM,kBAAkB,KAAK,IAAI;AAMjC,IAAM,eAAe,KAAK,OAAO;AAAA,EACtC,MAAM,KAAK,OAAO,EAAE,UAAU,CAAC,EAAE,UAAU,EAAE;AAAA,EAC7C,YAAY,KAAK,KAAK,EAAE,SAAS;AAAA,EACjC,UAAU,KAAK,OAAO,CAAC,CAAC,EAAE,SAAS;AACrC,CAAC;AAGM,IAAM,wBAAwB,KAAK,OAAO;AAAA,EAC/C,SAAS,KAAK,OAAO,EAAE,IAAI,CAAG,EAAE,I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,eAAA,eAAY;AACZ,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,aAAU;AAJA,SAAAA;AAAA,GAAA;AA6BL,IAAK,oBAAL,kBAAKC,uBAAL;AACL,EAAAA,mBAAA,WAAQ;AACR,EAAAA,mBAAA,WAAQ;AACR,EAAAA,mBAAA,UAAO;AAHG,SAAAA;AAAA,GAAA;AAML,IAAK,cAAL,kBAAKC,iBAAL;AACL,EAAAA,aAAA,cAAW;AACX,EAAAA,aAAA,aAAU;AACV,EAAAA,aAAA,aAAU;AAHA,SAAAA;AAAA,GAAA;;;AClFL,IAAK,uBAAL,kBAAKC,0BAAL;AACL,EAAAA,sBAAA,WAAQ;AACR,EAAAA,sBAAA,eAAY;AACZ,EAAAA,sBAAA,cAAW;AAHD,SAAAA;AAAA,GAAA;AAML,IAAK,uBAAL,kBAAKC,0BAAL;AACL,EAAAA,sBAAA,aAAU;AACV,EAAAA,sBAAA,YAAS;AAFC,SAAAA;AAAA,GAAA;;;AC5BL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,WAAQ;AAdE,SAAAA;AAAA,GAAA;","names":["vine","vine","vine","vine","OrderStatus","PaymentStatus","DeliveryStatus","vine","vine","vine","vine","vine","vine","vine","vine","vine","StoreActionType","StoreSubscriptionStatus","StoreSubscriptionType","ProductStatus","VariantOptionType","ProductType","ShippingMethodStatus","ShippingMethodPolicy","EmbaddedContactType"]}
|
|
1
|
+
{"version":3,"sources":["../src/feeef/feeef.ts","../src/feeef/repositories/orders.ts","../src/feeef/validators/order.ts","../src/feeef/validators/auth.ts","../src/feeef/validators/helpers.ts","../src/core/entities/order.ts","../src/feeef/repositories/repository.ts","../src/feeef/repositories/products.ts","../src/feeef/repositories/stores.ts","../src/feeef/validators/user_stores.ts","../src/feeef/repositories/users.ts","../src/feeef/validators/users.ts","../src/core/entities/store.ts","../src/core/entities/product.ts","../src/core/entities/shipping_method.ts","../src/core/embadded/contact.ts"],"sourcesContent":["import axios, { AxiosInstance } from 'axios'\n// import { buildMemoryStorage, buildWebStorage, setupCache } from 'axios-cache-interceptor'\nimport { OrderRepository } from './repositories/orders.js'\nimport { ProductRepository } from './repositories/products.js'\nimport { StoreRepository } from './repositories/stores.js'\nimport { UserRepository } from './repositories/users.js'\n\n/**\n * Configuration options for the FeeeF module.\n */\nexport interface FeeeFConfig {\n /**\n * The API key to be used for authentication.\n */\n apiKey: string\n\n /**\n * An optional Axios instance to be used for making HTTP requests.\n */\n client?: AxiosInstance\n\n /**\n * Specifies whether caching should be enabled or disabled.\n * If set to a number, it represents the maximum number of seconds to cache the responses.\n * If set to `false`, caching will be disabled (5s).\n * cannot be less than 5 seconds\n */\n cache?: false | number\n\n /**\n * The base URL for the API.\n */\n baseURL?: string\n}\n\n/**\n * Represents the FeeeF class.\n */\nexport class FeeeF {\n /**\n * The API key used for authentication.\n */\n apiKey: string\n\n /**\n * The Axios instance used for making HTTP requests.\n */\n client: AxiosInstance\n\n /**\n * The repository for managing stores.\n */\n stores: StoreRepository\n\n /**\n * The repository for managing products.\n */\n products: ProductRepository\n\n /**\n * The repository for managing users.\n */\n users: UserRepository\n\n /**\n * The repository for managing orders.\n */\n orders: OrderRepository\n\n /**\n * Constructs a new instance of the FeeeF class.\n * @param {FeeeFConfig} config - The configuration object.\n * @param {string} config.apiKey - The API key used for authentication.\n * @param {AxiosInstance} config.client - The Axios instance used for making HTTP requests.\n * @param {boolean | number} config.cache - The caching configuration. Set to `false` to disable caching, or provide a number to set the cache TTL in milliseconds.\n */\n //\n constructor({ apiKey, client, cache, baseURL = 'http://localhost:3333/api/v1' }: FeeeFConfig) {\n console.log(cache)\n this.apiKey = apiKey\n // get th \"cache\" search param\n // const urlParams = new URLSearchParams(window.location.search)\n // const cacheParam = urlParams.get('cache')\n // if is 0 or false, disable cache\n // if (cacheParam == '0') {\n this.client = client || axios\n // } else {\n // this.client = setupCache(client || axios, {\n // ttl: cache === false ? 5 : Math.max(cache!, 5) || 1 * 60 * 1000, // 1 minute by default\n // // for persistent cache use buildWebStorage\n // storage: buildWebStorage(localStorage, 'ff:'),\n // })\n // }\n // set base url\n this.client.defaults.baseURL = baseURL\n this.stores = new StoreRepository(this.client)\n this.products = new ProductRepository(this.client)\n this.users = new UserRepository(this.client)\n this.orders = new OrderRepository(this.client)\n }\n}\n","import vine from '@vinejs/vine'\nimport { InferInput } from '@vinejs/vine/types'\nimport { AxiosInstance } from 'axios'\nimport { CreateOrderSchema, SendOrderSchema } from '../validators/order.js'\nimport { ModelRepository } from './repository.js'\nimport { OrderEntity } from '../../core/entities/order.js'\n/**\n * Represents the options for tracking an order.\n */\nexport interface OrderModelTrackOptions {\n id: string\n params?: Record<string, any>\n}\n/**\n * Represents a repository for managing orders.\n */\nexport class OrderRepository extends ModelRepository<\n OrderEntity,\n InferInput<typeof CreateOrderSchema>,\n InferInput<typeof CreateOrderSchema>\n> {\n /**\n * Constructs a new OrderRepository instance.\n * @param client - The AxiosInstance used for making HTTP requests.\n */\n constructor(client: AxiosInstance) {\n super('orders', client)\n }\n\n /**\n * Sends an order from an anonymous user.\n * @param data - The data representing the order to be sent.\n * @returns A Promise that resolves to the sent OrderEntity.\n */\n async send(data: InferInput<typeof SendOrderSchema>): Promise<OrderEntity> {\n const validator = vine.compile(SendOrderSchema)\n const output = await validator.validate(data)\n const res = await this.client.post(`/${this.resource}/send`, output)\n\n // Return the sent OrderEntity\n return res.data\n }\n\n /**\n * track the order by the order id\n * it will return the order status and history\n * @param options - The options for finding the model.\n * @returns A promise that resolves to the found model.\n */\n async track(options: OrderModelTrackOptions): Promise<OrderEntity> {\n const { id, params } = options\n const res = await this.client.get(`/${this.resource}/${id}`, {\n params: {\n ...params,\n },\n })\n return res.data\n }\n}\n","// import { OrderStatus } from '#core/core'\nimport vine from '@vinejs/vine'\nimport { PhoneShema } from './auth.js'\nimport { OrderStatus } from '../../core/entities/order.js'\n\nexport const OrderItemSchema = vine.object({\n productId: vine.string(),\n // productId: vine.string().exists(async (db, value, field) => {\n // const product = await db.from('products').where('id', value).first()\n // return !!product\n // }),\n productName: vine.string().optional(),\n variant: vine.any().optional(),\n quantity: vine.number(),\n price: vine.number().optional(),\n})\n\nexport const GuestOrderItemSchema = vine.object({\n productId: vine.string(),\n variantPath: vine.string().optional(),\n quantity: vine.number(),\n})\n\nexport const SendOrderSchema = vine.object({\n id: vine.string().optional(),\n customerName: vine.string().optional(),\n customerPhone: vine.string(),\n // customerIp: vine.string().optional(),\n shippingAddress: vine.string().optional(),\n shippingCity: vine.string().optional(),\n shippingState: vine.string().optional(),\n shippingMethodId: vine.string().optional(),\n paymentMethodId: vine.string().optional(),\n items: vine.array(GuestOrderItemSchema).minLength(1),\n // subtotal: vine.number().optional(),\n // shippingPrice: vine.number().optional(),\n // total: vine.number().optional(),\n // discount: vine.number().optional(),\n coupon: vine.string().optional(),\n status: vine.enum(['pending', 'draft']),\n // TODO: validate storeId is exists and not blocked\n storeId: vine.string(),\n metadata: vine.any().optional(),\n})\n\n/// store owner section\n// CreateOrderSchema\nexport const CreateOrderSchema = vine.object({\n id: vine.string().optional(),\n customerName: vine.string().optional(),\n customerPhone: PhoneShema,\n customerIp: vine.string().optional(),\n shippingAddress: vine.string().optional(),\n shippingCity: vine.string().optional(),\n shippingState: vine.string().optional(),\n shippingMethodId: vine.string().optional(),\n paymentMethodId: vine.string().optional(),\n items: vine.array(OrderItemSchema).minLength(1),\n subtotal: vine.number().optional(),\n shippingPrice: vine.number().optional(),\n total: vine.number().optional(),\n discount: vine.number().optional(),\n coupon: vine.string().optional(),\n status: vine.enum(Object.values(OrderStatus)).optional(),\n storeId: vine.string(),\n metadata: vine.any().optional(),\n})\n\n// UpdateOrderSchema\nexport const UpdateOrderSchema = vine.object({\n id: vine.string().optional(),\n customerName: vine.string().optional(),\n customerPhone: PhoneShema.optional(),\n customerIp: vine.string().optional(),\n shippingAddress: vine.string().optional(),\n shippingCity: vine.string().optional(),\n shippingState: vine.string().optional(),\n shippingMethodId: vine.string().optional(),\n paymentMethodId: vine.string().optional(),\n items: vine.array(OrderItemSchema).minLength(1).optional(),\n subtotal: vine.number().optional(),\n shippingPrice: vine.number().optional(),\n total: vine.number().optional(),\n discount: vine.number().optional(),\n coupon: vine.string().optional(),\n status: vine.enum(Object.values(OrderStatus)).optional(),\n storeId: vine.string(),\n metadata: vine.any().optional(),\n})\n","import vine from '@vinejs/vine'\nimport { ImageFileSchema } from './helpers.js'\n\nexport const PhoneShema = vine.string().regex(/^0(5|6|7)\\d{8}$|^0(2)\\d{7}$/)\n\nexport const SignupSchema = vine.object({\n name: vine.string().minLength(2).maxLength(32),\n email: vine.string(),\n // .unique(async (db, value, field) => {\n // const user = await db.from('users').where('email', value).first()\n // return !user\n // })\n phone: PhoneShema\n // .unique(async (db, value, field) => {\n // const user = await db.from('users').where('phone', value).first()\n // return !user\n // })\n .optional(),\n photoFile: ImageFileSchema.optional(),\n photoUrl: vine.string().optional(),\n password: vine.string().minLength(8).maxLength(32),\n})\n\nexport const SigninSchema = vine.object({\n email: vine.string().email(),\n password: vine.string().minLength(8).maxLength(32),\n})\n\nexport const AuthUpdateUserSchema = vine.object({\n name: vine.string().minLength(2).maxLength(32).optional(),\n email: vine\n .string()\n // .unique(async (db, value, field) => {\n // const user = await db.from('users').where('email', value).first()\n // return !user\n // })\n .optional(),\n phone: PhoneShema.optional(),\n // for upload file\n photoFile: vine\n // .file({\n // size: '1mb',\n // extnames: ['jpg', 'jpeg', 'png', 'gif', 'webp'],\n // })\n .any(),\n photoUrl: vine.string().optional(),\n oldPassword: vine.string().minLength(8).maxLength(32).optional(),\n newPassword: vine.string().minLength(8).maxLength(32).notSameAs('oldPassword').optional(),\n})\n","import vine from '@vinejs/vine'\n\nexport const AvatarFileSchema = vine.any()\n// .file({\n// size: '1mb',\n// extnames: ['jpg', 'jpeg', 'png', 'gif', 'webp'],\n// })\n\nexport const ImageFileSchema = vine.any()\n// .file({\n// size: '1mb',\n// extnames: ['jpg', 'jpeg', 'png', 'gif', 'webp'],\n// })\n\nexport const DomainSchema = vine.object({\n name: vine.string().minLength(3).maxLength(32),\n verifiedAt: vine.date().optional(),\n metadata: vine.object({}).optional(),\n})\n\n// decoration\nexport const StoreDecorationSchema = vine.object({\n primary: vine.number().min(0x0).max(0xffffffff),\n onPrimary: vine.number().min(0x0).max(0xffffffff),\n showStoreLogoInHeader: vine.boolean().optional(),\n logoFullHeight: vine.boolean().optional(),\n showStoreNameInHeader: vine.boolean().optional(),\n metadata: vine.any().optional(),\n})\n\n// export const EmbaddedImageSchema = vine.object({\n// url: vine.string().url(),\n// alt: vine.string().optional(),\n// width: vine.number().optional(),\n// height: vine.number().optional(),\n// })\n\nexport const EmbaddedCategorySchema = vine.object({\n name: vine.string().minLength(2).maxLength(32),\n description: vine.string().minLength(2).maxLength(255).optional(),\n photoUrl: vine.string().optional(),\n ondarkPhotoUrl: vine.string().optional(),\n photoFile: AvatarFileSchema.optional(),\n ondarkPhotoFile: AvatarFileSchema.optional(),\n metadata: vine.object({}).optional(),\n})\n\nexport const EmbaddedAddressSchema = vine.object({\n country: vine.string().minLength(2).maxLength(32).optional(),\n state: vine.string().minLength(2).maxLength(32).optional(),\n city: vine.string().minLength(2).maxLength(32).optional(),\n street: vine.string().minLength(2).maxLength(32).optional(),\n zip: vine.string().minLength(2).maxLength(32).optional(),\n metadata: vine.object({}).optional().optional(),\n})\n\nexport const EmbaddedContactSchema = vine.object({\n type: vine.string().minLength(2).maxLength(32),\n value: vine.string().minLength(2).maxLength(255),\n metadata: vine.object({}).optional(),\n})\n\n// StoreBunner\nexport const StoreBunner = vine.object({\n url: vine.string().url().optional(),\n title: vine.string(),\n enabled: vine.boolean().optional(),\n metadata: vine.object({}).optional(),\n})\n","export enum OrderStatus {\n draft = 'draft',\n pending = 'pending',\n review = 'review',\n accepted = 'accepted',\n processing = 'processing',\n completed = 'completed',\n cancelled = 'cancelled',\n}\n\n// PaymentStatus\nexport enum PaymentStatus {\n unpaid = 'unpaid',\n paid = 'paid',\n received = 'received',\n}\nexport enum DeliveryStatus {\n pending = 'pending',\n delivering = 'delivering',\n delivered = 'delivered',\n returned = 'returned',\n}\n\nexport interface OrderEntity {\n id: string\n customerName?: string | null\n customerPhone: string\n customerIp?: string | null\n shippingAddress?: string | null\n shippingCity?: string | null\n shippingState?: string | null\n shippingMethodId?: string | null\n paymentMethodId?: string | null\n items: OrderItem[]\n subtotal: number\n shippingPrice: number\n total: number\n discount: number\n coupon?: string | null\n storeId: string\n metadata: any\n status: OrderStatus\n paymentStatus: PaymentStatus\n deliveryStatus: DeliveryStatus\n createdAt: any\n updatedAt: any\n}\nexport interface OrderItem {\n productId: string\n productName: string\n productPhotoUrl?: string | null\n variantPath?: string\n quantity: number\n price: number\n}\n\n// order track entity\nexport interface OrderTrackEntity {\n id: string\n customerName?: string | null\n customerPhone: string\n customerIp?: string | null\n shippingAddress?: string | null\n shippingCity?: string | null\n shippingState?: string | null\n shippingMethodId?: string | null\n paymentMethodId?: string | null\n items: OrderItem[]\n subtotal: number\n shippingPrice: number\n total: number\n discount: number\n coupon?: string | null\n storeId: string\n metadata: any\n status: OrderStatus\n paymentStatus: PaymentStatus\n deliveryStatus: DeliveryStatus\n createdAt: any\n updatedAt: any\n}\n","import { AxiosInstance } from 'axios'\n\n/**\n * Represents a generic model repository.\n * @template T - The type of the model.\n * @template C - The type of the create options.\n * @template U - The type of the update options.\n */\nexport abstract class ModelRepository<T, C, U> {\n resource: string\n // client\n client: AxiosInstance\n\n /**\n * Constructs a new instance of the ModelRepository class.\n * @param resource - The resource name.\n * @param client - The Axios instance used for making HTTP requests.\n */\n constructor(resource: string, client: AxiosInstance) {\n this.resource = resource\n this.client = client\n }\n\n /**\n * Finds a model by its ID or other criteria.\n * @param options - The options for finding the model.\n * @returns A promise that resolves to the found model.\n */\n async find(options: ModelFindOptions): Promise<T> {\n const { id, by, params } = options\n const res = await this.client.get(`/${this.resource}/${id}`, {\n params: {\n by: by || 'id',\n ...params,\n },\n })\n return res.data\n }\n\n /**\n * Lists models with optional pagination and filtering.\n * @param options - The options for listing the models.\n * @returns A promise that resolves to a list of models.\n */\n async list(options?: ModelListOptions): Promise<ListResponse<T>> {\n const { page, offset, limit, params } = options || {}\n const res = await this.client.get(`/${this.resource}`, {\n params: { page, offset, limit, ...params },\n })\n // if res.data is an array then create ListResponse\n if (Array.isArray(res.data)) {\n return {\n data: res.data,\n }\n } else {\n return {\n data: res.data.data,\n total: res.data.meta.total,\n page: res.data.meta.currentPage,\n limit: res.data.meta.perPage,\n }\n }\n }\n\n /**\n * Creates a new model.\n * @param options - The options for creating the model.\n * @returns A promise that resolves to the created model.\n */\n async create(options: ModelCreateOptions<C>): Promise<T> {\n const { data, params } = options\n const res = await this.client.post(`/${this.resource}`, data, { params })\n return res.data\n }\n\n /**\n * Updates an existing model.\n * @param options - The options for updating the model.\n * @returns A promise that resolves to the updated model.\n */\n async update(options: ModelUpdateOptions<U>): Promise<T> {\n const { id, data, params } = options\n const res = await this.client.put(`/${this.resource}/${id}`, data, {\n params,\n })\n return res.data\n }\n\n /**\n * Deletes a model by its ID or other criteria.\n * @param options - The options for deleting the model.\n * @returns A promise that resolves when the model is deleted.\n */\n async delete(options: ModelFindOptions): Promise<void> {\n const { id, by, params } = options\n await this.client.delete(`/${this.resource}/${id}`, {\n params: {\n by: by || 'id',\n ...params,\n },\n })\n }\n}\n\n/**\n * Represents a list response containing an array of data of type T.\n */\nexport interface ListResponse<T> {\n data: T[]\n total?: number\n page?: number\n limit?: number\n}\n\n/**\n * Represents the options for making a request.\n */\ninterface RequestOptions {\n params?: Record<string, any>\n}\n\nexport interface ModelFindOptions extends RequestOptions {\n /**\n * The ID of the model to find or the value to find by.\n */\n id: string\n /**\n * The field to find by.\n * @default \"id\" - The ID field.\n */\n by?: string\n}\n\n/**\n * Options for listing models.\n */\nexport interface ModelListOptions extends RequestOptions {\n /**\n * The page number to retrieve.\n */\n page?: number\n\n /**\n * The offset from the beginning of the list.\n */\n offset?: number\n\n /**\n * The maximum number of models to retrieve per page.\n */\n limit?: number\n}\n\n/**\n * Represents the options for creating a model.\n * @template T - The type of data being created.\n */\nexport interface ModelCreateOptions<T> extends RequestOptions {\n data: T\n}\n\n/**\n * Represents the options for updating a model.\n * @template T - The type of the data being updated.\n */\nexport interface ModelUpdateOptions<T> extends RequestOptions {\n /**\n * The ID of the model to update.\n */\n id: string\n /**\n * The data to update the model with.\n */\n data: T\n}\n","import { InferInput } from '@vinejs/vine/types'\nimport { AxiosInstance } from 'axios'\nimport { CreateProductSchema, UpdateProductSchema } from '../validators/product.js'\nimport { ModelRepository } from './repository.js'\nimport { ProductEntity } from '../../core/entities/product.js'\n\n/**\n * Represents a repository for managing products.\n */\nexport class ProductRepository extends ModelRepository<\n ProductEntity,\n InferInput<typeof CreateProductSchema>,\n InferInput<typeof UpdateProductSchema>\n> {\n /**\n * Creates a new instance of the ProductRepository class.\n * @param client - The AxiosInstance used for making HTTP requests.\n */\n constructor(client: AxiosInstance) {\n super('products', client)\n }\n}\n","import vine from '@vinejs/vine'\nimport { InferInput } from '@vinejs/vine/types'\nimport { AxiosInstance } from 'axios'\nimport { CreateUserStoreSchema, UpdateUserStoreSchema } from '../validators/user_stores.js'\nimport { ModelRepository, ModelCreateOptions } from './repository.js'\nimport { StoreEntity } from '../../core/entities/store.js'\n\n/**\n * Repository for managing Store entities.\n */\nexport class StoreRepository extends ModelRepository<\n StoreEntity,\n InferInput<typeof CreateUserStoreSchema>,\n InferInput<typeof UpdateUserStoreSchema>\n> {\n /**\n * Constructs a new StoreRepository instance.\n * @param client The AxiosInstance used for making HTTP requests.\n */\n constructor(client: AxiosInstance) {\n super('stores', client)\n }\n\n /**\n * Creates a new Store entity.\n * @param options The options for creating the Store entity.\n * @returns A Promise that resolves to the created Store entity.\n */\n async create(\n options: ModelCreateOptions<InferInput<typeof CreateUserStoreSchema>>\n ): Promise<StoreEntity> {\n const validator = vine.compile(CreateUserStoreSchema)\n const output = await validator.validate(options.data)\n return super.create({ ...options, data: output })\n }\n}\n","import vine from '@vinejs/vine'\nimport {\n AvatarFileSchema,\n EmbaddedContactSchema,\n DomainSchema,\n EmbaddedAddressSchema,\n EmbaddedCategorySchema,\n StoreBunner,\n StoreDecorationSchema,\n} from './helpers.js'\n// \"defaultShippingRates.1\"\nexport const DefaultShippingRatesSchema = vine.array(\n vine.array(vine.number().min(0).max(100000).nullable()).nullable()\n)\n\nexport const CreateUserStoreSchema = vine.object({\n name: vine.string().minLength(2).maxLength(32),\n slug: vine\n .string()\n .regex(/^[a-z0-9-]+$/)\n .minLength(2)\n .maxLength(32),\n // .unique(async (db, value, field) => {\n // const store = await db.from('stores').where('slug', value).first()\n // return !store\n // })\n domain: vine\n .object({\n name: vine.string().minLength(2).maxLength(32),\n })\n .optional(),\n decoration: StoreDecorationSchema.optional(),\n\n banner: StoreBunner.optional(),\n logoUrl: vine.string().optional(),\n ondarkLogoUrl: vine.string().optional(),\n logoFile: AvatarFileSchema.optional(),\n ondarkLogoFile: AvatarFileSchema.optional(),\n categories: vine.array(EmbaddedCategorySchema).optional(),\n title: vine.string().minLength(2).maxLength(255).optional(),\n description: vine.string().minLength(2).maxLength(255).optional(),\n addresses: vine.array(EmbaddedAddressSchema).optional(),\n metadata: vine.object({}).optional(),\n contacts: vine\n .array(\n vine.object({\n type: vine.string().minLength(2).maxLength(32),\n value: vine.string().minLength(2).maxLength(255),\n metadata: vine.object({}).optional(),\n })\n )\n .optional(),\n defaultShippingRates: DefaultShippingRatesSchema.optional(),\n integrations: vine.array(vine.any()).optional(),\n})\n\n// UpdateStoreSchema\nexport const UpdateUserStoreSchema = vine.object({\n name: vine.string().minLength(2).maxLength(32).optional(),\n slug: vine\n .string()\n .regex(/^[a-z0-9-]+$/)\n .minLength(2)\n .maxLength(32)\n // .unique(async (db, value, field) => {\n // const store = await db.from('stores').where('slug', value).first()\n // return !store\n // })\n .optional(),\n domain: DomainSchema.optional(),\n decoration: StoreDecorationSchema.optional(),\n banner: StoreBunner.optional(),\n logoUrl: vine.string().nullable().optional(),\n ondarkLogoUrl: vine.string().nullable().optional(),\n logoFile: AvatarFileSchema.optional(),\n ondarkLogoFile: AvatarFileSchema.optional(),\n categories: vine.array(EmbaddedCategorySchema).optional(),\n title: vine.string().minLength(2).maxLength(255).optional(),\n description: vine.string().minLength(2).maxLength(255).optional(),\n addresses: vine.array(EmbaddedAddressSchema).optional(),\n metadata: vine.object({}).optional(),\n contacts: vine.array(EmbaddedContactSchema).optional(),\n defaultShippingRates: DefaultShippingRatesSchema.optional(),\n integrations: vine.array(vine.any()).optional(),\n})\n","import vine from '@vinejs/vine'\nimport { InferInput } from '@vinejs/vine/types'\nimport { AxiosInstance } from 'axios'\nimport { SigninSchema, AuthUpdateUserSchema } from '../validators/auth.js'\nimport { CreateUserSchema, UpdateUserSchema } from '../validators/users.js'\nimport { ModelRepository } from './repository.js'\nimport { AuthToken, UserEntity } from '../../core/entities/user.js'\n\n/**\n * Represents the response returned by the authentication process.\n */\nexport interface AuthResponse {\n token: AuthToken\n user: UserEntity\n}\n\n/**\n * Represents a repository for managing user data.\n * Extends the ModelRepository class.\n */\nexport class UserRepository extends ModelRepository<\n UserEntity,\n InferInput<typeof CreateUserSchema>,\n InferInput<typeof UpdateUserSchema>\n> {\n /**\n * Represents the authentication response.\n */\n auth: AuthResponse | null = null\n\n /**\n * Constructs a new UserRepository instance.\n * @param client - The AxiosInstance used for making HTTP requests.\n */\n constructor(client: AxiosInstance) {\n super('users', client)\n }\n\n /**\n * Signs in a user with the provided credentials.\n * @param credentials - The user credentials.\n * @returns A promise that resolves to the authentication response.\n */\n async signin(credentials: InferInput<typeof SigninSchema>): Promise<AuthResponse> {\n // validate the input\n const validator = vine.compile(SigninSchema)\n const output = await validator.validate(credentials)\n const res = await this.client.post(`/${this.resource}/auth/signin`, output)\n this.auth = res.data\n return res.data\n }\n\n /**\n * Signs up a new user with the provided credentials.\n * @param credentials - The user credentials.\n * @returns A promise that resolves to the authentication response.\n */\n async signup(credentials: InferInput<typeof CreateUserSchema>): Promise<AuthResponse> {\n // validate the input\n const validator = vine.compile(CreateUserSchema)\n const output = await validator.validate(credentials)\n const res = await this.client.post(`/${this.resource}/auth/signup`, output)\n this.auth = res.data\n return res.data\n }\n\n /**\n * Signs out the currently authenticated user.\n * @returns A promise that resolves when the user is signed out.\n */\n async signout(): Promise<void> {\n this.auth = null\n }\n\n /**\n * Updates the authenticated user's data.\n * @param data - The updated user data.\n * @returns A promise that resolves to the updated user entity.\n */\n async updateMe(data: InferInput<typeof AuthUpdateUserSchema>): Promise<UserEntity> {\n const validator = vine.compile(AuthUpdateUserSchema)\n const output = await validator.validate(data)\n const res = await this.client.put(`/${this.resource}/auth`, output)\n return res.data\n }\n}\n","import vine from '@vinejs/vine'\n\n// User Schemas\n//CreateUserSchema\nexport const CreateUserSchema = vine.object({\n name: vine.string().minLength(2).maxLength(32),\n email: vine.string(),\n // .unique(async (db, value, field) => {\n // const user = await db.from('users').where('email', value).first()\n // return !user\n // }),\n phone: vine\n .string()\n .regex(/^0(5|6|7)\\d{8}$|^0(2)\\d{7}$/)\n // .unique(async (db, value, field) => {\n // const user = await db.from('users').where('phone', value).first()\n // return !user\n // })\n .optional(),\n password: vine.string().minLength(8).maxLength(32),\n // for upload file\n photoFile: vine.any(),\n // .file({\n // size: '1mb',\n // extnames: ['jpg', 'jpeg', 'png', 'gif', 'webp'],\n // })\n // .optional(),\n photoUrl: vine.string().optional(),\n // metadata (any object)\n metadata: vine.object({}).optional(),\n // dates\n emailVerifiedAt: vine.date().optional(),\n phoneVerifiedAt: vine.date().optional(),\n verifiedAt: vine.date().optional(),\n blockedAt: vine.date().optional(),\n})\n\n//UpdateUserSchema\nexport const UpdateUserSchema = vine.object({\n name: vine.string().minLength(2).maxLength(32).optional(),\n email: vine\n .string()\n // .unique(async (db, value, field) => {\n // const user = await db.from('users').where('email', value).first()\n // return !user\n // })\n .optional(),\n phone: vine\n .string()\n // must start with 0 then if secend is (5|6|7) then 8 digits and if secend is (2) then 7 digits\n .regex(/^0(5|6|7)\\d{8}$|^0(2)\\d{7}$/)\n .optional(),\n password: vine.string().minLength(8).maxLength(32).confirmed().optional(),\n // for upload file\n photoFile: vine\n // .file({\n // size: '1mb',\n // extnames: ['jpg', 'jpeg', 'png', 'gif', 'webp'],\n // })\n .any(),\n photoUrl: vine.string().optional(),\n // metadata (any object)\n metadata: vine.object({}).optional(),\n // dates\n emailVerifiedAt: vine.date().optional(),\n phoneVerifiedAt: vine.date().optional(),\n verifiedAt: vine.string().optional(),\n blockedAt: vine.date().optional(),\n})\n","import { EmbaddedAddress } from '../embadded/address.js'\nimport { EmbaddedCategory } from '../embadded/category.js'\nimport { EmbaddedContact } from '../embadded/contact.js'\n// import { OrderEntity } from \"./order.js\";\n// import { ShippingMethodEntity } from \"./shipping_method.js\";\nimport { UserEntity } from './user.js'\nimport { DateTime } from 'luxon'\n\nexport interface StoreEntity {\n id: string\n slug: string\n banner: StoreBanner | null\n action: StoreAction | null\n domain: StoreDomain | null\n decoration: StoreDecoration | null\n name: string\n logoUrl: string | null\n ondarkLogoUrl: string | null\n userId: string\n categories: EmbaddedCategory[]\n title: string | null\n description: string | null\n addresses: EmbaddedAddress[]\n address: EmbaddedAddress | null\n metadata: Record<string, any>\n contacts: EmbaddedContact[]\n integrations: StoreIntegrations\n verifiedAt: any | null\n blockedAt: any | null\n createdAt: any\n updatedAt: any\n // products: ProductEntity[];\n user?: UserEntity\n // orders: OrderEntity[];\n // shippingMethods: ShippingMethodEntity[];\n defaultShippingRates: (number | null)[][] | null\n\n // subscription\n subscription?: any\n due?: number\n\n // StoreConfigs\n configs?: StoreConfigs\n\n // metaPixelIds\n metaPixelIds?: string[]\n}\n\nexport interface StoreConfigs {\n currencies: StoreCurrencyConfig[]\n defaultCurrency: number\n}\n\nexport interface StoreCurrencyConfig {\n code: string\n symbol: string\n precision: number\n rate: number\n}\n\nexport interface StoreDomain {\n name: string\n verifiedAt: any | null\n metadata: Record<string, any>\n}\nexport interface StoreBanner {\n title: string\n url?: string | null\n enabled: boolean\n metadata: Record<string, any>\n}\n\nexport interface StoreDecoration {\n primary: number\n onPrimary?: number\n showStoreLogoInHeader?: boolean\n logoFullHeight?: boolean\n showStoreNameInHeader?: boolean\n metadata?: Record<string, any>\n}\n\nexport interface StoreAction {\n label: string\n url: string\n type: StoreActionType\n}\n\nexport enum StoreActionType {\n link = 'link',\n whatsapp = 'whatsapp',\n telegram = 'telegram',\n phone = 'phone',\n}\nexport interface MetaPixel {\n id: string\n key?: string\n}\nexport interface MetaPixelIntegration {\n id: string\n pixels: MetaPixel[]\n active: boolean\n metadata: Record<string, any>\n}\n\nexport interface StoreIntegrations {\n [key: string]: any\n metadata?: Record<string, any>\n\n // @Default('default') String id,\n // @Default([]) List<MetaPixel> pixels,\n // @Default(true) bool active,\n // @Default({}) Map<String, dynamic> metadata,\n metaPixel?: MetaPixelIntegration\n googleAnalytics?: any\n googleSheet?: any\n sms?: any\n telegram?: any\n yalidine?: any\n maystroDelivery?: any\n echotrak?: any\n procolis?: any\n noest?: any\n}\n\nexport enum StoreSubscriptionStatus {\n active = 'active',\n inactive = 'inactive',\n}\n\nexport enum StoreSubscriptionType {\n free = 'free',\n quota = 'quota',\n percentage = 'percentage',\n}\n\nexport interface StoreSubscription {\n type: StoreSubscriptionType\n status: StoreSubscriptionStatus\n startedAt: DateTime\n expiresAt: DateTime | null\n metadata: Record<string, any>\n}\n\nexport interface StoreFreeSubscription extends StoreSubscription {\n type: StoreSubscriptionType.free\n}\n\nexport interface StoreQuotaSubscription extends StoreSubscription {\n type: StoreSubscriptionType.quota\n quota: number\n}\n// another way is by taking percentage of the sales\nexport interface StorePercentageSubscription extends StoreSubscription {\n type: StoreSubscriptionType.percentage\n percentage: number\n}\n","import { EmbaddedCategory } from '../embadded/category.js'\nimport { ShippingMethodEntity } from './shipping_method.js'\nimport { StoreEntity } from './store.js'\n\nexport interface ProductEntity {\n id: string\n\n slug: string\n\n decoration: ProductDecoration | null\n\n name: string | null\n\n photoUrl: string | null\n\n media: string[]\n\n storeId: string\n\n shippingMethodId?: string | null\n\n category: EmbaddedCategory\n\n title: string | null\n\n description: string | null\n\n body: string | null\n\n // sku\n sku: string | null\n\n price: number\n\n cost: number | null\n\n discount: number | null\n\n stock: number\n\n sold: number\n\n views: number\n\n likes: number\n\n dislikes: number\n\n variant?: ProductVariant | null\n\n metadata: Record<string, any>\n\n status: ProductStatus\n\n type: ProductType\n\n verifiedAt: any | null\n\n blockedAt: any | null\n\n createdAt: any\n\n updatedAt: any\n\n // relations\n store?: StoreEntity\n shippingMethod?: ShippingMethodEntity\n}\n\nexport enum ProductStatus {\n draft = 'draft',\n published = 'published',\n archived = 'archived',\n deleted = 'deleted',\n}\n\nexport interface ProductDecoration {\n metadata: Record<string, any>\n}\n\nexport interface ProductVariant {\n name: string\n options: ProductVariantOption[]\n}\n\nexport interface ProductVariantOption {\n name: string\n sku?: string | null\n price?: number | null\n discount?: number | null\n stock?: number | null\n sold?: number | null\n type?: VariantOptionType\n child?: ProductVariant | null\n mediaIndex?: number | null\n hint?: string | null\n value?: any\n}\n\nexport enum VariantOptionType {\n color = 'color',\n image = 'image',\n text = 'text',\n}\n\nexport enum ProductType {\n physical = 'physical',\n digital = 'digital',\n service = 'service',\n}\n","import { OrderEntity } from './order.js'\n\nexport interface ShippingMethodEntity {\n id: string\n name: string\n description: string | null\n logoUrl: string | null\n ondarkLogoUrl: string | null\n price: number\n forks: number\n sourceId: string\n storeId: string\n rates: (number | null)[][] | null\n status: ShippingMethodStatus\n policy: ShippingMethodPolicy\n verifiedAt: any\n createdAt: any\n updatedAt: any\n orders: OrderEntity[]\n source: ShippingMethodEntity | null\n}\n\nexport enum ShippingMethodStatus {\n draft = 'draft',\n published = 'published',\n archived = 'archived',\n}\n\nexport enum ShippingMethodPolicy {\n private = 'private',\n public = 'public',\n}\n","export enum EmbaddedContactType {\n phone = 'phone',\n email = 'email',\n facebook = 'facebook',\n twitter = 'twitter',\n instagram = 'instagram',\n linkedin = 'linkedin',\n website = 'website',\n whatsapp = 'whatsapp',\n telegram = 'telegram',\n signal = 'signal',\n viber = 'viber',\n skype = 'skype',\n zoom = 'zoom',\n other = 'other',\n}\n\n// EmbaddedContactType is not enum but can only be: \"phone\" | \"email\" | \"facebook\" | \"twitter\" | \"instagram\" | \"linkedin\" | \"website\" | \"whatsapp\" | \"telegram\" | \"signal\" | \"viber\" | \"skype\" | \"zoom\" | \"other\n\nexport interface EmbaddedContact {\n type: EmbaddedContactType\n value: string\n name?: string\n metadata?: Record<string, any>\n}\n"],"mappings":";AAAA,OAAO,WAA8B;;;ACArC,OAAOA,WAAU;;;ACCjB,OAAOC,WAAU;;;ACDjB,OAAOC,WAAU;;;ACAjB,OAAO,UAAU;AAEV,IAAM,mBAAmB,KAAK,IAAI;AAMlC,IAAM,kBAAkB,KAAK,IAAI;AAMjC,IAAM,eAAe,KAAK,OAAO;AAAA,EACtC,MAAM,KAAK,OAAO,EAAE,UAAU,CAAC,EAAE,UAAU,EAAE;AAAA,EAC7C,YAAY,KAAK,KAAK,EAAE,SAAS;AAAA,EACjC,UAAU,KAAK,OAAO,CAAC,CAAC,EAAE,SAAS;AACrC,CAAC;AAGM,IAAM,wBAAwB,KAAK,OAAO;AAAA,EAC/C,SAAS,KAAK,OAAO,EAAE,IAAI,CAAG,EAAE,IAAI,UAAU;AAAA,EAC9C,WAAW,KAAK,OAAO,EAAE,IAAI,CAAG,EAAE,IAAI,UAAU;AAAA,EAChD,uBAAuB,KAAK,QAAQ,EAAE,SAAS;AAAA,EA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AA,mBAAA,WAAQ;AACR,EAAAA,mBAAA,WAAQ;AACR,EAAAA,mBAAA,UAAO;AAHG,SAAAA;AAAA,GAAA;AAML,IAAK,cAAL,kBAAKC,iBAAL;AACL,EAAAA,aAAA,cAAW;AACX,EAAAA,aAAA,aAAU;AACV,EAAAA,aAAA,aAAU;AAHA,SAAAA;AAAA,GAAA;;;ACnFL,IAAK,uBAAL,kBAAKC,0BAAL;AACL,EAAAA,sBAAA,WAAQ;AACR,EAAAA,sBAAA,eAAY;AACZ,EAAAA,sBAAA,cAAW;AAHD,SAAAA;AAAA,GAAA;AAML,IAAK,uBAAL,kBAAKC,0BAAL;AACL,EAAAA,sBAAA,aAAU;AACV,EAAAA,sBAAA,YAAS;AAFC,SAAAA;AAAA,GAAA;;;AC5BL,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,aAAU;AACV,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,YAAS;AACT,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,WAAQ;AAdE,SAAAA;AAAA,GAAA;","names":["vine","vine","vine","vine","OrderStatus","PaymentStatus","DeliveryStatus","vine","vine","vine","vine","vine","vine","vine","vine","vine","StoreActionType","StoreSubscriptionStatus","StoreSubscriptionType","ProductStatus","VariantOptionType","ProductType","ShippingMethodStatus","ShippingMethodPolicy","EmbaddedContactType"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "feeef",
|
|
3
3
|
"description": "feeef sdk for javascript",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.3",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.16.0"
|
|
7
7
|
},
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@types/luxon": "^3.4.2"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@vinejs/vine": "^2.
|
|
62
|
+
"@vinejs/vine": "^2.1.0",
|
|
63
63
|
"axios": "^1.6.8",
|
|
64
64
|
"axios-cache-interceptor": "^1.5.1",
|
|
65
65
|
"luxon": "^3.5.0"
|
|
@@ -124,4 +124,4 @@
|
|
|
124
124
|
"sourcemap": true,
|
|
125
125
|
"target": "esnext"
|
|
126
126
|
}
|
|
127
|
-
}
|
|
127
|
+
}
|