@elasticias/types 0.0.16 → 1.0.1
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.
|
@@ -1,14 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Canonical permission verbs (CRUD + capabilities) — the single source of
|
|
3
|
+
* truth on the frontend. Kept name-identical to the backend `Permissions`
|
|
4
|
+
* constants so a value like `Permissions.Create` greps the same on both sides.
|
|
5
|
+
*
|
|
6
|
+
* - `Read` — view records (queries).
|
|
7
|
+
* - `Create` — create new records.
|
|
8
|
+
* - `Edit` — modify existing records (update). Distinct from `Create`.
|
|
9
|
+
* - `Delete` — remove records.
|
|
10
|
+
* - `Duplicate` / `Print` / `Export` / `Import` — action capabilities.
|
|
11
|
+
*
|
|
12
|
+
* Permissions are matched as plain strings, so an app may grant custom
|
|
13
|
+
* permission strings beyond this set — the enum is the standard vocabulary,
|
|
14
|
+
* open for extension.
|
|
15
|
+
*/
|
|
16
|
+
var Permissions;
|
|
17
|
+
(function (Permissions) {
|
|
18
|
+
Permissions["Read"] = "Read";
|
|
19
|
+
Permissions["Create"] = "Create";
|
|
20
|
+
Permissions["Edit"] = "Edit";
|
|
21
|
+
Permissions["Delete"] = "Delete";
|
|
22
|
+
Permissions["Duplicate"] = "Duplicate";
|
|
23
|
+
Permissions["Print"] = "Print";
|
|
24
|
+
Permissions["Export"] = "Export";
|
|
25
|
+
Permissions["Import"] = "Import";
|
|
26
|
+
})(Permissions || (Permissions = {}));
|
|
27
|
+
/** The standard verbs in their canonical (display/storage) order. */
|
|
28
|
+
const PERMISSIONS = [
|
|
29
|
+
Permissions.Read,
|
|
30
|
+
Permissions.Create,
|
|
31
|
+
Permissions.Edit,
|
|
32
|
+
Permissions.Delete,
|
|
33
|
+
Permissions.Duplicate,
|
|
34
|
+
Permissions.Print,
|
|
35
|
+
Permissions.Export,
|
|
36
|
+
Permissions.Import,
|
|
37
|
+
];
|
|
12
38
|
|
|
13
39
|
var DiscountType;
|
|
14
40
|
(function (DiscountType) {
|
|
@@ -42,5 +68,5 @@ var PosOrderStatus;
|
|
|
42
68
|
* Generated bundle index. Do not edit.
|
|
43
69
|
*/
|
|
44
70
|
|
|
45
|
-
export { DiscountType, ErpOrderStatus, PaymentMethod,
|
|
71
|
+
export { DiscountType, ErpOrderStatus, PERMISSIONS, PaymentMethod, Permissions, PosOrderStatus };
|
|
46
72
|
//# sourceMappingURL=elasticias-types.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elasticias-types.mjs","sources":["../../../../libs/types/src/lib/identity.ts","../../../../libs/types/src/lib/common.ts","../../../../libs/types/src/elasticias-types.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"elasticias-types.mjs","sources":["../../../../libs/types/src/lib/identity.ts","../../../../libs/types/src/lib/common.ts","../../../../libs/types/src/elasticias-types.ts"],"sourcesContent":["/**\n * Canonical permission verbs (CRUD + capabilities) — the single source of\n * truth on the frontend. Kept name-identical to the backend `Permissions`\n * constants so a value like `Permissions.Create` greps the same on both sides.\n *\n * - `Read` — view records (queries).\n * - `Create` — create new records.\n * - `Edit` — modify existing records (update). Distinct from `Create`.\n * - `Delete` — remove records.\n * - `Duplicate` / `Print` / `Export` / `Import` — action capabilities.\n *\n * Permissions are matched as plain strings, so an app may grant custom\n * permission strings beyond this set — the enum is the standard vocabulary,\n * open for extension.\n */\nexport enum Permissions {\n Read = 'Read',\n Create = 'Create',\n Edit = 'Edit',\n Delete = 'Delete',\n Duplicate = 'Duplicate',\n Print = 'Print',\n Export = 'Export',\n Import = 'Import',\n}\n\n/** The standard verbs in their canonical (display/storage) order. */\nexport const PERMISSIONS: readonly Permissions[] = [\n Permissions.Read,\n Permissions.Create,\n Permissions.Edit,\n Permissions.Delete,\n Permissions.Duplicate,\n Permissions.Print,\n Permissions.Export,\n Permissions.Import,\n];\n","export interface PaginationParams {\n pageNumber: number;\n pageSize: number;\n}\n\nexport interface SortParams {\n field: string;\n direction: SortDirection;\n}\n\nexport type SortDirection = 'ASC' | 'DESC';\n\nexport interface ApiResponse<T> {\n data: T;\n success: boolean;\n message?: string;\n errors?: string[];\n}\n\nexport interface PagedResult<T> {\n items: T[];\n totalCount: number;\n totalPages: number;\n pageNumber: number;\n pageSize: number;\n}\n\nexport enum DiscountType {\n PERCENTAGE = 'PERCENTAGE',\n FIXED = 'FIXED',\n}\n\nexport enum PaymentMethod {\n CASH = 'CASH',\n CARD = 'CARD',\n BANK_TRANSFER = 'BANK_TRANSFER',\n LOYALTY_POINTS = 'LOYALTY_POINTS',\n GIFT_CARD = 'GIFT_CARD',\n}\n\nexport enum ErpOrderStatus {\n DRAFT = 'DRAFT',\n SHIPPED = 'SHIPPED',\n INVOICED = 'INVOICED',\n IN_PROGRESS = 'IN_PROGRESS',\n}\n\nexport enum PosOrderStatus {\n PENDING = 'PENDING',\n PAID = 'PAID',\n CANCELLED = 'CANCELLED',\n REFUNDED = 'REFUNDED',\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;AAcG;IACS;AAAZ,CAAA,UAAY,WAAW,EAAA;AACrB,IAAA,WAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,WAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,WAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,WAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,WAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,WAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,WAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,WAAA,CAAA,QAAA,C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cAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,cAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,cAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,cAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACvB,CAAC,EALW,cAAc,KAAd,cAAc,GAAA,EAAA,CAAA,CAAA;;AC/C1B;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -115,16 +115,33 @@ interface BusinessHours {
|
|
|
115
115
|
isClosed: boolean;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Canonical permission verbs (CRUD + capabilities) — the single source of
|
|
120
|
+
* truth on the frontend. Kept name-identical to the backend `Permissions`
|
|
121
|
+
* constants so a value like `Permissions.Create` greps the same on both sides.
|
|
122
|
+
*
|
|
123
|
+
* - `Read` — view records (queries).
|
|
124
|
+
* - `Create` — create new records.
|
|
125
|
+
* - `Edit` — modify existing records (update). Distinct from `Create`.
|
|
126
|
+
* - `Delete` — remove records.
|
|
127
|
+
* - `Duplicate` / `Print` / `Export` / `Import` — action capabilities.
|
|
128
|
+
*
|
|
129
|
+
* Permissions are matched as plain strings, so an app may grant custom
|
|
130
|
+
* permission strings beyond this set — the enum is the standard vocabulary,
|
|
131
|
+
* open for extension.
|
|
132
|
+
*/
|
|
133
|
+
declare enum Permissions {
|
|
119
134
|
Read = "Read",
|
|
120
|
-
|
|
135
|
+
Create = "Create",
|
|
121
136
|
Edit = "Edit",
|
|
122
137
|
Delete = "Delete",
|
|
138
|
+
Duplicate = "Duplicate",
|
|
123
139
|
Print = "Print",
|
|
124
140
|
Export = "Export",
|
|
125
|
-
Import = "Import"
|
|
126
|
-
Duplicate = "Duplicate"
|
|
141
|
+
Import = "Import"
|
|
127
142
|
}
|
|
143
|
+
/** The standard verbs in their canonical (display/storage) order. */
|
|
144
|
+
declare const PERMISSIONS: readonly Permissions[];
|
|
128
145
|
|
|
129
146
|
interface PaginationParams {
|
|
130
147
|
pageNumber: number;
|
|
@@ -212,5 +229,5 @@ interface EmailEventRecord {
|
|
|
212
229
|
reason?: string | null;
|
|
213
230
|
}
|
|
214
231
|
|
|
215
|
-
export { DiscountType, ErpOrderStatus, PaymentMethod,
|
|
232
|
+
export { DiscountType, ErpOrderStatus, PERMISSIONS, PaymentMethod, Permissions, PosOrderStatus };
|
|
216
233
|
export type { ApiResponse, BusinessHours, Cart, CartItem, Category, DeliveryAddress, EmailEventKind, EmailEventRecord, EmailMetrics, EmailMetricsCategoryBreakdown, EmailMetricsDailyPoint, Modifier, ModifierGroup, Order, OrderMode, PagedResult, PaginationParams, Product, SelectedModifier, SortDirection, SortParams, StoreConfig, StoreOrderStatus };
|