@alwatr/type
Advanced tools
+24
-0
@@ -6,2 +6,26 @@ # Change Log | ||
| # [0.31.0](https://github.com/AliMD/alwatr/compare/v0.30.0...v0.31.0) (2023-05-08) | ||
| ### Bug Fixes | ||
| - **com-pwa/new-order:** debugging ([9027eb0](https://github.com/AliMD/alwatr/commit/9027eb013e6803b1f77dc7cbf4cc14704f49557d)) | ||
| - **type/service-response:** default generics ([04dfe54](https://github.com/AliMD/alwatr/commit/04dfe549c272878756544481f0a0d301d6e3c228)) | ||
| - **type:** fix `ComUser` ([670660f](https://github.com/AliMD/alwatr/commit/670660fb3b18e63ad54d22a76297b982c77533be)) | ||
| - **type:** Stringifyable ([058381b](https://github.com/AliMD/alwatr/commit/058381b50641ba44f4ac60e2173b5b91449e58cd)) | ||
| - **validator:** array support ([08f5215](https://github.com/AliMD/alwatr/commit/08f521534a0e937e5cf0f92bf5ca274838f41f93)) | ||
| ### Features | ||
| - **com-pwa:** `sing-in` process ([407e9c6](https://github.com/AliMD/alwatr/commit/407e9c640899efdd2bc4633bb966665c6f9b00be)) | ||
| - **com-pwa:** change order_shipping_car i18n key ([b8f7daa](https://github.com/AliMD/alwatr/commit/b8f7daa2622506d45e85274db38dbe20a2518f1f)) | ||
| - **com-pwa:** validate shipping form and item list before enable submit ([9af59d7](https://github.com/AliMD/alwatr/commit/9af59d72a2678249776d738ea79e4f248a442c5c)) | ||
| - **type/com:** ComUser/permissions ([a962366](https://github.com/AliMD/alwatr/commit/a9623669a83f1cce0f96428d5c2d126ad3e5984b)) | ||
| - **type/com:** order schema ([d1aacdb](https://github.com/AliMD/alwatr/commit/d1aacdb56cb9995bc05d54bb78bc67e3f629e12c)) | ||
| - **type/com:** qtyStep const ([3c928d4](https://github.com/AliMD/alwatr/commit/3c928d406859c85cf939827ece98db6fc39ff914)) | ||
| - **type:** ArrayItems ([4f20d8a](https://github.com/AliMD/alwatr/commit/4f20d8ab312787d3073a43594e813bcddeb99aeb)) | ||
| - **type:** MaybeArray ([0c61708](https://github.com/AliMD/alwatr/commit/0c6170890faad306a052c3d8242df21f780ef1c3)) | ||
| - **type:** SingleOrArray, Prop, Values, Merge ([c3d2a86](https://github.com/AliMD/alwatr/commit/c3d2a8669f4ae83abeb69a1cfef51ecc23c76a10)) | ||
| - **type:** user permissions ([aff0853](https://github.com/AliMD/alwatr/commit/aff08538d183e3f6b2d637e56fe2f2281c4da768)) | ||
| - **type:** UserAuth ([c902144](https://github.com/AliMD/alwatr/commit/c9021444743c5a0a5a333688830cd0a7dd7d9867)) | ||
| # [0.30.0](https://github.com/AliMD/alwatr/compare/v0.29.0...v0.30.0) (2023-03-06) | ||
@@ -8,0 +32,0 @@ |
@@ -5,4 +5,5 @@ import type { MultiLangStringObj } from './i18n.js'; | ||
| import type { StringifyableRecord } from './type-helper.js'; | ||
| import type { User } from './user.js'; | ||
| export declare const ladingTypeCS: readonly ["hand", "pallet"]; | ||
| export declare const carTypeCS: readonly ["nissan", "one_wheel", "ten_wheel", "trolley"]; | ||
| export declare const carTypeCS: readonly ["nissan", "one", "ten_wheel", "trolley"]; | ||
| export declare const carTypePriceCS: readonly [110000, 140000, 170000, 200000]; | ||
@@ -12,2 +13,3 @@ export declare const timePeriodCS: readonly ["auto", "1_2w", "2_3w", "3_4w"]; | ||
| export declare const orderStatusCS: readonly ["draft", "registered", "processing", "payment_pending", "preparing", "shipping", "delayed", "on_hold", "canceled", "refunded"]; | ||
| export declare const tileQtyStep = 3.6; | ||
| export interface Product extends AlwatrDocumentObject { | ||
@@ -105,3 +107,29 @@ /** | ||
| } | ||
| export declare const orderLadingSchema: { | ||
| export declare const userPermissionsCS: readonly ["*", "user/patch"]; | ||
| export type UserPermission = typeof userPermissionsCS[number]; | ||
| export interface ComUser extends User { | ||
| permissions?: Array<UserPermission>; | ||
| shopName?: string; | ||
| } | ||
| export declare const orderInfoSchema: { | ||
| id: StringConstructor; | ||
| status: StringConstructor; | ||
| itemList: { | ||
| productId: StringConstructor; | ||
| price: NumberConstructor; | ||
| finalPrice: NumberConstructor; | ||
| qty: NumberConstructor; | ||
| }[]; | ||
| shippingInfo: { | ||
| recipientName: StringConstructor; | ||
| recipientNationalCode: StringConstructor; | ||
| address: StringConstructor; | ||
| carType: StringConstructor; | ||
| ladingType: StringConstructor; | ||
| timePeriod: StringConstructor; | ||
| }; | ||
| totalPrice: NumberConstructor; | ||
| finalTotalPrice: NumberConstructor; | ||
| }; | ||
| export declare const orderShippingInfoSchema: { | ||
| recipientName: StringConstructor; | ||
@@ -108,0 +136,0 @@ recipientNationalCode: StringConstructor; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"customer-order-management.d.ts","sourceRoot":"","sources":["src/customer-order-management.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAI1D,eAAO,MAAM,YAAY,6BAA8B,CAAC;AACxD,eAAO,MAAM,SAAS,0DAA2D,CAAC;AAClF,eAAO,MAAM,cAAc,2CAAgD,CAAC;AAC5E,eAAO,MAAM,YAAY,2CAA4C,CAAC;AACtE,eAAO,MAAM,cAAc,gCAAiC,CAAC;AAC7D,eAAO,MAAM,aAAa,0IAWhB,CAAC;AAIX,MAAM,WAAW,OAAQ,SAAQ,oBAAoB;IACnD;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,KAAK,EAAE,kBAAkB,CAAC;IAE1B;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;CACd;AAED,MAAM,WAAW,YAAa,SAAQ,oBAAoB;IACxD;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,KAAM,SAAQ,oBAAoB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C,WAAW,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAID,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;CAsB3B,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;CAA+B,CAAC"} |
| // -- Const value -- | ||
| export const ladingTypeCS = ['hand', 'pallet']; | ||
| export const carTypeCS = ['nissan', 'one_wheel', 'ten_wheel', 'trolley']; | ||
| export const carTypeCS = ['nissan', 'one', 'ten_wheel', 'trolley']; | ||
| export const carTypePriceCS = [110000, 140000, 170000, 200000]; | ||
@@ -19,11 +19,29 @@ export const timePeriodCS = ['auto', '1_2w', '2_3w', '3_4w']; | ||
| ]; | ||
| export const tileQtyStep = 3.6; | ||
| export const userPermissionsCS = ['*', 'user/patch']; | ||
| // -- Schema -- | ||
| export const orderLadingSchema = { | ||
| recipientName: String, | ||
| recipientNationalCode: String, | ||
| address: String, | ||
| carType: String, | ||
| ladingType: String, | ||
| timePeriod: String, | ||
| export const orderInfoSchema = { | ||
| id: String, | ||
| status: String, | ||
| itemList: [{ | ||
| productId: String, | ||
| price: Number, | ||
| finalPrice: Number, | ||
| qty: Number, | ||
| }], | ||
| shippingInfo: { | ||
| recipientName: String, | ||
| recipientNationalCode: String, | ||
| address: String, | ||
| carType: String, | ||
| ladingType: String, | ||
| timePeriod: String, | ||
| }, | ||
| // discount: Number, | ||
| // discountType: String, | ||
| totalPrice: Number, | ||
| // ladingPrice: Number, | ||
| finalTotalPrice: Number, | ||
| }; | ||
| export const orderShippingInfoSchema = orderInfoSchema.shippingInfo; | ||
| //# sourceMappingURL=customer-order-management.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"customer-order-management.js","sourceRoot":"","sources":["src/customer-order-management.ts"],"names":[],"mappings":"AAKA,oBAAoB;AAEpB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAU,CAAC;AACxD,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,CAAU,CAAC;AAClF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAO,EAAE,MAAO,EAAE,MAAO,EAAE,MAAO,CAAU,CAAC;AAC5E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AACtE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAU,CAAC;AAC7D,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO;IACP,YAAY;IACZ,YAAY;IACZ,iBAAiB;IACjB,WAAW;IACX,UAAU;IACV,SAAS;IACT,SAAS;IACT,UAAU;IACV,UAAU;CACF,CAAC;AAuHX,eAAe;AAEf,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,aAAa,EAAE,MAAM;IACrB,qBAAqB,EAAE,MAAM;IAC7B,OAAO,EAAE,MAAM;IACf,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,MAAM;IAClB,UAAU,EAAE,MAAM;CACnB,CAAC","sourcesContent":["import type {MultiLangStringObj} from './i18n.js';\nimport type {Photo} from './photo.js';\nimport type {AlwatrDocumentObject} from './storage.js';\nimport type {StringifyableRecord} from './type-helper.js';\n\n// -- Const value --\n\nexport const ladingTypeCS = ['hand', 'pallet'] as const;\nexport const carTypeCS = ['nissan', 'one_wheel', 'ten_wheel', 'trolley'] as const;\nexport const carTypePriceCS = [110_000, 140_000, 170_000, 200_000] as const;\nexport const timePeriodCS = ['auto', '1_2w', '2_3w', '3_4w'] as const;\nexport const discountTypeCS = ['number', 'percent'] as const;\nexport const orderStatusCS = [\n 'draft',\n 'registered',\n 'processing',\n 'payment_pending',\n 'preparing',\n 'shipping',\n 'delayed',\n 'on_hold',\n 'canceled',\n 'refunded',\n] as const;\n\n// -- Document object --\n\nexport interface Product extends AlwatrDocumentObject {\n /**\n * Product global unique id.\n */\n id: string;\n\n /**\n * Product title\n */\n title: MultiLangStringObj;\n\n /**\n * Product image\n */\n image: Photo;\n}\n\nexport interface ProductPrice extends AlwatrDocumentObject {\n /**\n * Product global unique id.\n */\n id: string;\n\n /**\n * Product price in this list.\n */\n price: number;\n}\n\nexport interface Order extends AlwatrDocumentObject {\n /**\n * Order auto incremental unique id.\n */\n id: string;\n\n /**\n * Order Status\n */\n status: (typeof orderStatusCS)[number];\n\n /**\n * Order cart list.\n */\n itemList: Array<OrderItem>;\n\n /**\n * Delivery info\n */\n shippingInfo: Partial<OrderShippingInfo>;\n\n discount: number;\n discountType: (typeof discountTypeCS)[number];\n\n /**\n * The total price of this order exclude lading and discounts.\n */\n totalPrice: number;\n\n /**\n * The cost of lading the order.\n */\n ladingPrice: number;\n\n /**\n * The final total price of this order include lading and discounts.\n */\n finalTotalPrice: number;\n\n /**\n * Customer device uuid.\n */\n clientId: string;\n\n /**\n * Customer device ip address.\n */\n remoteAddress: string;\n}\n\nexport interface OrderDraft extends Partial<Order> {\n id: 'new';\n status: 'draft';\n}\n\n// -- child types --\n\nexport interface OrderItem extends StringifyableRecord {\n productId: string;\n\n /**\n * The selling price of single product in the market.\n */\n price: number;\n\n /**\n * The selling price of a product after any discounts to this buyer.\n */\n finalPrice: number;\n\n /**\n * Quantity of this item.\n */\n qty: number;\n}\n\nexport interface OrderShippingInfo extends StringifyableRecord {\n recipientName: string;\n recipientNationalCode: string;\n address: string;\n description: string,\n ladingType: (typeof ladingTypeCS)[number];\n carType: (typeof carTypeCS)[number];\n timePeriod: (typeof timePeriodCS)[number];\n}\n\n// -- Schema --\n\nexport const orderLadingSchema = {\n recipientName: String,\n recipientNationalCode: String,\n address: String,\n carType: String,\n ladingType: String,\n timePeriod: String,\n};\n"]} | ||
| {"version":3,"file":"customer-order-management.js","sourceRoot":"","sources":["src/customer-order-management.ts"],"names":[],"mappings":"AAMA,oBAAoB;AAEpB,MAAM,CAAC,MAAM,Y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uB,GAAG,eAAe,CAAC,YAAY,CAAC","sourcesContent":["import type {MultiLangStringObj} from './i18n.js';\nimport type {Photo} from './photo.js';\nimport type {AlwatrDocumentObject} from './storage.js';\nimport type {StringifyableRecord} from './type-helper.js';\nimport type {User} from './user.js';\n\n// -- Const value --\n\nexport const ladingTypeCS = ['hand', 'pallet'] as const;\nexport const carTypeCS = ['nissan', 'one', 'ten_wheel', 'trolley'] as const;\nexport const carTypePriceCS = [110_000, 140_000, 170_000, 200_000] as const;\nexport const timePeriodCS = ['auto', '1_2w', '2_3w', '3_4w'] as const;\nexport const discountTypeCS = ['number', 'percent'] as const;\nexport const orderStatusCS = [\n 'draft',\n 'registered',\n 'processing',\n 'payment_pending',\n 'preparing',\n 'shipping',\n 'delayed',\n 'on_hold',\n 'canceled',\n 'refunded',\n] as const;\n\nexport const tileQtyStep = 3.6;\n\n// -- Document object --\n\nexport interface Product extends AlwatrDocumentObject {\n /**\n * Product global unique id.\n */\n id: string;\n\n /**\n * Product title\n */\n title: MultiLangStringObj;\n\n /**\n * Product image\n */\n image: Photo;\n}\n\nexport interface ProductPrice extends AlwatrDocumentObject {\n /**\n * Product global unique id.\n */\n id: string;\n\n /**\n * Product price in this list.\n */\n price: number;\n}\n\nexport interface Order extends AlwatrDocumentObject {\n /**\n * Order auto incremental unique id.\n */\n id: string;\n\n /**\n * Order Status\n */\n status: (typeof orderStatusCS)[number];\n\n /**\n * Order cart list.\n */\n itemList: Array<OrderItem>;\n\n /**\n * Delivery info\n */\n shippingInfo: Partial<OrderShippingInfo>;\n\n discount: number;\n discountType: (typeof discountTypeCS)[number];\n\n /**\n * The total price of this order exclude lading and discounts.\n */\n totalPrice: number;\n\n /**\n * The cost of lading the order.\n */\n ladingPrice: number;\n\n /**\n * The final total price of this order include lading and discounts.\n */\n finalTotalPrice: number;\n\n /**\n * Customer device uuid.\n */\n clientId: string;\n\n /**\n * Customer device ip address.\n */\n remoteAddress: string;\n}\n\nexport interface OrderDraft extends Partial<Order> {\n id: 'new';\n status: 'draft';\n}\n\n// -- child types --\n\nexport interface OrderItem extends StringifyableRecord {\n productId: string;\n\n /**\n * The selling price of single product in the market.\n */\n price: number;\n\n /**\n * The selling price of a product after any discounts to this buyer.\n */\n finalPrice: number;\n\n /**\n * Quantity of this item.\n */\n qty: number;\n}\n\nexport interface OrderShippingInfo extends StringifyableRecord {\n recipientName: string;\n recipientNationalCode: string;\n address: string;\n description: string,\n ladingType: (typeof ladingTypeCS)[number];\n carType: (typeof carTypeCS)[number];\n timePeriod: (typeof timePeriodCS)[number];\n}\n\nexport const userPermissionsCS = ['*', 'user/patch'] as const;\nexport type UserPermission = typeof userPermissionsCS[number];\n\nexport interface ComUser extends User {\n permissions?: Array<UserPermission>;\n shopName?: string;\n}\n\n// -- Schema --\n\nexport const orderInfoSchema = {\n id: String,\n status: String,\n itemList: [{\n productId: String,\n price: Number,\n finalPrice: Number,\n qty: Number,\n }],\n shippingInfo: {\n recipientName: String,\n recipientNationalCode: String,\n address: String,\n carType: String,\n ladingType: String,\n timePeriod: String,\n },\n // discount: Number,\n // discountType: String,\n totalPrice: Number,\n // ladingPrice: Number,\n finalTotalPrice: Number,\n};\n\nexport const orderShippingInfoSchema = orderInfoSchema.shippingInfo;\n\n"]} |
+2
-2
| { | ||
| "name": "@alwatr/type", | ||
| "version": "0.30.0", | ||
| "version": "0.31.0", | ||
| "description": "Alwatr projects common entities types", | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
| }, | ||
| "gitHead": "36f55780ccdcb1acc07400b0cdb3fe7b0df56cca" | ||
| "gitHead": "896e64b58eed6e9048e870557ecf399d42705612" | ||
| } |
@@ -13,3 +13,3 @@ import { StringifyableRecord } from './type-helper.js'; | ||
| } | ||
| export interface AlwatrServiceResponseSuccess<TData extends StringifyableRecord> extends StringifyableRecord { | ||
| export interface AlwatrServiceResponseSuccess<TData extends StringifyableRecord = StringifyableRecord> extends StringifyableRecord { | ||
| ok: true; | ||
@@ -21,3 +21,3 @@ statusCode?: number; | ||
| } | ||
| export interface AlwatrServiceResponseSuccessWithMeta<TData extends StringifyableRecord, TMeta extends StringifyableRecord> extends StringifyableRecord { | ||
| export interface AlwatrServiceResponseSuccessWithMeta<TData extends StringifyableRecord = StringifyableRecord, TMeta extends StringifyableRecord = StringifyableRecord> extends StringifyableRecord { | ||
| ok: true; | ||
@@ -29,3 +29,3 @@ statusCode?: number; | ||
| } | ||
| export type AlwatrServiceResponse<TData extends StringifyableRecord, TMeta extends StringifyableRecord> = AlwatrServiceResponseSuccess<TData> | AlwatrServiceResponseSuccessWithMeta<TData, TMeta> | AlwatrServiceResponseFailed; | ||
| export type AlwatrServiceResponse<TData extends StringifyableRecord = StringifyableRecord, TMeta extends StringifyableRecord = StringifyableRecord> = AlwatrServiceResponseSuccess<TData> | AlwatrServiceResponseSuccessWithMeta<TData, TMeta> | AlwatrServiceResponseFailed; | ||
| //# sourceMappingURL=service-response.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"service-response.d.ts","sourceRoot":"","sources":["src/service-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAErD,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAE7G,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC3D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AACvD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAExE,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE,EAAE,EAAE,KAAK,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,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AG,OAAO,CAAC,CAAC;AAExE,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE,EAAE,EAAE,KAAK,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,IAAI,CAAC,EAAE,KAAK,CAAC;CACd;AAED,MAAM,WAAW,4BAA4B,CAAC,KAAK,SAAS,mBAAmB,GAAG,mBAAmB,CACnG,SAAQ,mBAAmB;IAC3B,EAAE,EAAE,IAAI,CAAC;IACT,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;CACb;AAED,MAAM,WAAW,oCAAoC,CACnD,KAAK,SAAS,mBAAmB,GAAG,mBAAmB,EACvD,KAAK,SAAS,mBAAmB,GAAG,mBAAmB,CACvD,SAAQ,mBAAmB;IAC3B,EAAE,EAAE,IAAI,CAAC;IACT,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,KAAK,CAAC;CACb;AAED,MAAM,MAAM,qBAAqB,CAC/B,KAAK,SAAS,mBAAmB,GAAG,mBAAmB,EACvD,KAAK,SAAS,mBAAmB,GAAG,mBAAmB,IAErD,4BAA4B,CAAC,KAAK,CAAC,GACnC,oCAAoC,CAAC,KAAK,EAAE,KAAK,CAAC,GAClD,2BAA2B,CAAC"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"service-response.js","sourceRoot":"","sources":["src/service-response.ts"],"names":[],"mappings":"","sourcesContent":["import {StringifyableRecord} from './type-helper.js';\n\nexport type Methods = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'TRACE' | 'OPTIONS' | 'PATCH';\n\nexport type ParamKeyType = 'string' | 'number' | 'boolean';\nexport type ParamValueType = string | number | boolean;\nexport type QueryParameters = Record<string, string | number | boolean>;\n\nexport interface AlwatrServiceResponseFailed extends StringifyableRecord {\n ok: false;\n statusCode: number;\n errorCode: string;\n meta?: StringifyableRecord;\n data?: never;\n}\n\nexport interface AlwatrServiceResponseSuccess<TData extends StringifyableRecord> extends StringifyableRecord {\n ok: true;\n statusCode?: number;\n errorCode?: never;\n meta?: never;\n data: TData;\n}\n\nexport interface AlwatrServiceResponseSuccessWithMeta<\n TData extends StringifyableRecord,\n TMeta extends StringifyableRecord\n> extends StringifyableRecord {\n ok: true;\n statusCode?: number;\n errorCode?: never;\n meta: TMeta;\n data: TData;\n}\n\nexport type AlwatrServiceResponse<TData extends StringifyableRecord, TMeta extends StringifyableRecord> =\n | AlwatrServiceResponseSuccess<TData>\n | AlwatrServiceResponseSuccessWithMeta<TData, TMeta>\n | AlwatrServiceResponseFailed;\n"]} | ||
| {"version":3,"file":"service-response.js","sourceRoot":"","sources":["src/service-response.ts"],"names":[],"mappings":"","sourcesContent":["import {StringifyableRecord} from './type-helper.js';\n\nexport type Methods = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'TRACE' | 'OPTIONS' | 'PATCH';\n\nexport type ParamKeyType = 'string' | 'number' | 'boolean';\nexport type ParamValueType = string | number | boolean;\nexport type QueryParameters = Record<string, string | number | boolean>;\n\nexport interface AlwatrServiceResponseFailed extends StringifyableRecord {\n ok: false;\n statusCode: number;\n errorCode: string;\n meta?: StringifyableRecord;\n data?: never;\n}\n\nexport interface AlwatrServiceResponseSuccess<TData extends StringifyableRecord = StringifyableRecord>\n extends StringifyableRecord {\n ok: true;\n statusCode?: number;\n errorCode?: never;\n meta?: never;\n data: TData;\n}\n\nexport interface AlwatrServiceResponseSuccessWithMeta<\n TData extends StringifyableRecord = StringifyableRecord,\n TMeta extends StringifyableRecord = StringifyableRecord\n> extends StringifyableRecord {\n ok: true;\n statusCode?: number;\n errorCode?: never;\n meta: TMeta;\n data: TData;\n}\n\nexport type AlwatrServiceResponse<\n TData extends StringifyableRecord = StringifyableRecord,\n TMeta extends StringifyableRecord = StringifyableRecord\n> =\n | AlwatrServiceResponseSuccess<TData>\n | AlwatrServiceResponseSuccessWithMeta<TData, TMeta>\n | AlwatrServiceResponseFailed;\n"]} |
+2
-5
@@ -0,1 +1,2 @@ | ||
| import { AlwatrServiceResponseSuccessWithMeta } from './service-response.js'; | ||
| import { StringifyableRecord } from './type-helper.js'; | ||
@@ -17,7 +18,3 @@ export interface AlwatrDocumentObject extends StringifyableRecord { | ||
| } | ||
| export interface AlwatrDocumentStorage<T extends AlwatrDocumentObject> extends StringifyableRecord { | ||
| ok: true; | ||
| data: Record<string, T>; | ||
| meta: AlwatrStorageMeta; | ||
| } | ||
| export type AlwatrDocumentStorage<T extends AlwatrDocumentObject = AlwatrDocumentObject> = AlwatrServiceResponseSuccessWithMeta<Record<string, T>, AlwatrStorageMeta>; | ||
| //# sourceMappingURL=storage.d.ts.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["src/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAOD,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,oBAAoB,CAAE,SAAQ,mBAAmB;IAChG,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACxB,IAAI,EAAE,iBAAiB,CAAC;CACzB"} | ||
| {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["src/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,oCAAoC,EAAC,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAErD,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAOD,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,IACrF,oCAAoC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC"} |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"storage.js","sourceRoot":"","sources":["src/storage.ts"],"names":[],"mappings":"","sourcesContent":["import {StringifyableRecord} from './type-helper.js';\n\nexport interface AlwatrDocumentObject extends StringifyableRecord {\n id: string;\n meta?: {\n rev: number;\n created: number;\n updated: number;\n };\n}\n\nexport interface AlwatrStorageMeta extends StringifyableRecord {\n id: string;\n formatVersion: number;\n reversion: number;\n lastUpdated: number;\n lastAutoId: number;\n}\n\n// export type AlwatrDocumentStorage<T extends AlwatrDocumentObject> = Omit<\n// AlwatrServiceResponseSuccessWithMeta<Record<string, T>, AlwatrStorageMeta>,\n// 'statusCode' | 'errorCode'\n// >;\n\nexport interface AlwatrDocumentStorage<T extends AlwatrDocumentObject> extends StringifyableRecord {\n ok: true;\n data: Record<string, T>;\n meta: AlwatrStorageMeta;\n}\n"]} | ||
| {"version":3,"file":"storage.js","sourceRoot":"","sources":["src/storage.ts"],"names":[],"mappings":"","sourcesContent":["import {AlwatrServiceResponseSuccessWithMeta} from './service-response.js';\nimport {StringifyableRecord} from './type-helper.js';\n\nexport interface AlwatrDocumentObject extends StringifyableRecord {\n id: string;\n meta?: {\n rev: number;\n created: number;\n updated: number;\n };\n}\n\nexport interface AlwatrStorageMeta extends StringifyableRecord {\n id: string;\n formatVersion: number;\n reversion: number;\n lastUpdated: number;\n lastAutoId: number;\n}\n\n// export type AlwatrDocumentStorage<T extends AlwatrDocumentObject> = Omit<\n// AlwatrServiceResponseSuccessWithMeta<Record<string, T>, AlwatrStorageMeta>,\n// 'statusCode' | 'errorCode'\n// >;\n\nexport type AlwatrDocumentStorage<T extends AlwatrDocumentObject = AlwatrDocumentObject> =\n AlwatrServiceResponseSuccessWithMeta<Record<string, T>, AlwatrStorageMeta>;\n"]} |
+5
-0
| export type Constructor<T> = new (...args: any[]) => T; | ||
| export type MaybePromise<T> = T | Promise<T>; | ||
| export type SingleOrArray<T> = T | Array<T>; | ||
| export type OmitFirstParam<F> = F extends (x: any, ...args: infer A) => infer R ? (...args: A) => R : never; | ||
@@ -13,2 +14,6 @@ /** | ||
| } | ||
| export type Prop<T, K> = K extends keyof T ? T[K] : never; | ||
| export type Values<T> = T[keyof T]; | ||
| export type ArrayItems<T> = T extends Array<infer K> ? K : T; | ||
| export type Merge<M, N> = Omit<M, keyof N> & N; | ||
| //# sourceMappingURL=type-helper.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"type-helper.d.ts","sourceRoot":"","sources":["src/type-helper.ts"],"names":[],"mappings":"AAEA,MAAM,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GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,GAC9B,KAAK,CAAC,aAAa,CAAC,CAAC;AAE3B,MAAM,WAAW,mBAAmB;IAClC,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;CAC5B;AAED,MAAM,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAE1D,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AACnC,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE7D,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"type-helper.js","sourceRoot":"","sources":["src/type-helper.ts"],"names":[],"mappings":"AAAA,uDAAuD","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport type Constructor<T> = new (...args: any[]) => T;\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type OmitFirstParam<F> = F extends (x: any, ...args: infer A) => infer R ? (...args: A) => R : never;\n\n/**\n * Object that can be JSON.stringify.\n */\nexport type Stringifyable =\n | string\n | number\n | boolean\n | null\n | undefined\n | { [P: string]: Stringifyable }\n | Array<Stringifyable>;\n\n\nexport interface StringifyableRecord {\n [P: string]: Stringifyable;\n}\n"]} | ||
| {"version":3,"file":"type-helper.js","sourceRoot":"","sources":["src/type-helper.ts"],"names":[],"mappings":"AAAA,uDAAuD","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport type Constructor<T> = new (...args: any[]) => T;\n\nexport type MaybePromise<T> = T | Promise<T>;\nexport type SingleOrArray<T> = T | Array<T>;\n\nexport type OmitFirstParam<F> = F extends (x: any, ...args: infer A) => infer R ? (...args: A) => R : never;\n\n/**\n * Object that can be JSON.stringify.\n */\nexport type Stringifyable =\n | string\n | number\n | boolean\n | null\n | undefined\n | { [P: string]: Stringifyable }\n | Array<Stringifyable>;\n\nexport interface StringifyableRecord {\n [P: string]: Stringifyable;\n}\n\nexport type Prop<T, K> = K extends keyof T ? T[K] : never;\n\nexport type Values<T> = T[keyof T];\nexport type ArrayItems<T> = T extends Array<infer K> ? K : T;\n\nexport type Merge<M, N> = Omit<M, keyof N> & N;\n"]} |
+33
-3
@@ -10,9 +10,39 @@ import type { AlwatrDocumentObject } from './storage.js'; | ||
| /** | ||
| * User full name | ||
| * Link pass epoch number, started from 1 and increased by token revoke. | ||
| */ | ||
| lpe: number; | ||
| /** | ||
| * User authorization permissions list. | ||
| */ | ||
| permissions?: Array<string>; | ||
| fullName: string; | ||
| gender?: Gender; | ||
| phoneNumber: number; | ||
| gender: Gender; | ||
| email?: string; | ||
| phoneNumber?: string; | ||
| landlinePhone?: string; | ||
| /** | ||
| * Country Code. | ||
| */ | ||
| country: string; | ||
| /** | ||
| * Province Code. | ||
| */ | ||
| province?: string; | ||
| /** | ||
| * City Code. | ||
| */ | ||
| city?: string; | ||
| /** | ||
| * User full address. | ||
| */ | ||
| address?: string; | ||
| /** | ||
| * Postal code | ||
| */ | ||
| postalCode?: string; | ||
| } | ||
| export interface UserAuth { | ||
| id: string; | ||
| token: string; | ||
| } | ||
| //# sourceMappingURL=user.d.ts.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["src/user.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,QAAQ,6BAA8B,CAAC;AACpD,MAAM,MAAM,MAAM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+0,1 @@ | ||
| {"version":3,"file":"user.js","sourceRoot":"","sources":["src/user.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAU,CAAC","sourcesContent":["import type {AlwatrDocumentObject} from './storage.js';\n\nexport const genderCS = ['male', 'female'] as const;\nexport type Gender = typeof genderCS[number];\n\nexport interface User extends AlwatrDocumentObject {\n /**\n * User global unique id (verifiable)\n */\n id: string;\n\n /**\n * User full name\n */\n fullName: string;\n\n gender?: Gender;\n\n email?: string;\n\n phoneNumber?: string;\n}\n"]} | ||
| {"version":3,"file":"user.js","sourceRoot":"","sources":["src/user.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAU,CAAC","sourcesContent":["import type {AlwatrDocumentObject} from './storage.js';\n\nexport const genderCS = ['male', 'female'] as const;\nexport type Gender = typeof genderCS[number];\n\nexport interface User extends AlwatrDocumentObject {\n /**\n * User global unique id (verifiable)\n */\n id: string;\n\n /**\n * Link pass epoch number, started from 1 and increased by token revoke.\n */\n lpe: number;\n\n /**\n * User authorization permissions list.\n */\n permissions?: Array<string>;\n\n fullName: string;\n\n phoneNumber: number;\n\n gender: Gender;\n\n email?: string;\n\n landlinePhone?: string;\n\n /**\n * Country Code.\n */\n country: string;\n\n /**\n * Province Code.\n */\n province?: string;\n\n /**\n * City Code.\n */\n city?: string;\n\n /**\n * User full address.\n */\n address?: string;\n\n /**\n * Postal code\n */\n postalCode?: string;\n}\n\nexport interface UserAuth {\n id: string;\n token: string;\n}\n"]} |
46867
20.25%425
22.48%