@deenruv/order-line-attributes-plugin 1.0.0

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.
Files changed (42) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +36 -0
  3. package/dist/plugin-server/index.d.ts +2 -0
  4. package/dist/plugin-server/index.js +77 -0
  5. package/dist/plugin-server/zeus/const.d.ts +6 -0
  6. package/dist/plugin-server/zeus/const.js +3857 -0
  7. package/dist/plugin-server/zeus/index.d.ts +19816 -0
  8. package/dist/plugin-server/zeus/index.js +1101 -0
  9. package/dist/plugin-server/zeus/typedDocumentNode.d.ts +1 -0
  10. package/dist/plugin-server/zeus/typedDocumentNode.js +31 -0
  11. package/dist/plugin-ui/components/AttributesInput.d.ts +16 -0
  12. package/dist/plugin-ui/components/AttributesInput.js +24 -0
  13. package/dist/plugin-ui/components/FacetValues.d.ts +9 -0
  14. package/dist/plugin-ui/components/FacetValues.js +126 -0
  15. package/dist/plugin-ui/components/GroupValue.d.ts +7 -0
  16. package/dist/plugin-ui/components/GroupValue.js +13 -0
  17. package/dist/plugin-ui/components/index.d.ts +3 -0
  18. package/dist/plugin-ui/components/index.js +3 -0
  19. package/dist/plugin-ui/graphql/index.d.ts +1 -0
  20. package/dist/plugin-ui/graphql/index.js +1 -0
  21. package/dist/plugin-ui/graphql/queries.d.ts +24 -0
  22. package/dist/plugin-ui/graphql/queries.js +7 -0
  23. package/dist/plugin-ui/graphql/selectors.d.ts +54 -0
  24. package/dist/plugin-ui/graphql/selectors.js +25 -0
  25. package/dist/plugin-ui/index.d.ts +1 -0
  26. package/dist/plugin-ui/index.js +11 -0
  27. package/dist/plugin-ui/locales/en/facetValues.json +12 -0
  28. package/dist/plugin-ui/locales/en/index.d.ts +13 -0
  29. package/dist/plugin-ui/locales/en/index.js +2 -0
  30. package/dist/plugin-ui/locales/pl/facetValues.json +12 -0
  31. package/dist/plugin-ui/locales/pl/index.d.ts +13 -0
  32. package/dist/plugin-ui/locales/pl/index.js +2 -0
  33. package/dist/plugin-ui/translation-ns.d.ts +1 -0
  34. package/dist/plugin-ui/translation-ns.js +1 -0
  35. package/dist/plugin-ui/tsconfig.json +18 -0
  36. package/dist/plugin-ui/zeus/const.d.ts +6 -0
  37. package/dist/plugin-ui/zeus/const.js +3854 -0
  38. package/dist/plugin-ui/zeus/index.d.ts +19816 -0
  39. package/dist/plugin-ui/zeus/index.js +1093 -0
  40. package/dist/plugin-ui/zeus/typedDocumentNode.d.ts +3 -0
  41. package/dist/plugin-ui/zeus/typedDocumentNode.js +9 -0
  42. package/package.json +50 -0
package/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ # License 1
2
+
3
+ The MIT License
4
+
5
+ Copyright (c) 2025-present Aexol
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
+
13
+ # License 2
14
+
15
+ The MIT License
16
+
17
+ Copyright (c) 2018-2025 Michael Bromley
18
+
19
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # @deenruv/order-line-attributes-plugin
2
+
3
+ Plugin that adds custom attribute fields to OrderLine entities, including discount tracking, modified pricing, text-based attributes with a custom input component, and a selected image relation field.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @deenruv/order-line-attributes-plugin
9
+ ```
10
+
11
+ ## Configuration
12
+
13
+ ```typescript
14
+ import { OrderLineAttributesServerPlugin } from '@deenruv/order-line-attributes-plugin';
15
+
16
+ // In your Deenruv server config:
17
+ plugins: [
18
+ OrderLineAttributesServerPlugin,
19
+ ]
20
+ ```
21
+
22
+ ## Features
23
+
24
+ - `discountBy` (int) — Discount amount applied to the order line
25
+ - `modifiedListPrice` (string, public) — Modified price value for display
26
+ - `attributes` (text) — Free-form attributes field with a custom "attributes-input" UI component
27
+ - `selectedImage` (Asset relation) — Associated image for the order line with a custom "selected-image-input" UI component
28
+ - Multi-language labels and descriptions (English and Polish)
29
+
30
+ ## Admin UI
31
+
32
+ This plugin extends the admin UI with custom input components for order line attributes, including an attributes editor and a facet values selector displayed on the order detail page.
33
+
34
+ ## API Extensions
35
+
36
+ This plugin does not add any GraphQL API extensions. It registers custom fields on the OrderLine entity, which are automatically exposed through the standard Deenruv GraphQL API.
@@ -0,0 +1,2 @@
1
+ export declare class OrderLineAttributesServerPlugin {
2
+ }
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.OrderLineAttributesServerPlugin = void 0;
10
+ const core_1 = require("@deenruv/core");
11
+ const OrderLineCustomFields = [
12
+ {
13
+ name: "discountBy",
14
+ type: "int",
15
+ defaultValue: 0,
16
+ label: [
17
+ { languageCode: core_1.LanguageCode.en, value: "Discount" },
18
+ { languageCode: core_1.LanguageCode.pl, value: "Znizka" },
19
+ ],
20
+ description: [
21
+ { languageCode: core_1.LanguageCode.en, value: "Discount amount" },
22
+ { languageCode: core_1.LanguageCode.pl, value: "Wartość Znizki" },
23
+ ],
24
+ nullable: true,
25
+ },
26
+ {
27
+ name: "modifiedListPrice",
28
+ type: "string",
29
+ public: true,
30
+ label: [
31
+ { languageCode: core_1.LanguageCode.en, value: "Modified price" },
32
+ { languageCode: core_1.LanguageCode.pl, value: "Zmodyfikowana cena" },
33
+ ],
34
+ },
35
+ {
36
+ name: "attributes",
37
+ type: "text",
38
+ label: [
39
+ { languageCode: core_1.LanguageCode.en, value: "Attributes" },
40
+ { languageCode: core_1.LanguageCode.pl, value: "Atrybuty" },
41
+ ],
42
+ description: [
43
+ { languageCode: core_1.LanguageCode.en, value: "Attributes" },
44
+ { languageCode: core_1.LanguageCode.pl, value: "Atrybuty" },
45
+ ],
46
+ nullable: true,
47
+ ui: { component: "attributes-input" },
48
+ },
49
+ {
50
+ name: "selectedImage",
51
+ type: "relation",
52
+ entity: core_1.Asset,
53
+ nullable: true,
54
+ ui: { component: "selected-image-input" },
55
+ label: [
56
+ { languageCode: core_1.LanguageCode.en, value: "Selected image" },
57
+ { languageCode: core_1.LanguageCode.pl, value: "Wybrany obrazek" },
58
+ ],
59
+ description: [
60
+ { languageCode: core_1.LanguageCode.en, value: "Selected image" },
61
+ { languageCode: core_1.LanguageCode.pl, value: "Wybrany obrazek" },
62
+ ],
63
+ },
64
+ ];
65
+ let OrderLineAttributesServerPlugin = class OrderLineAttributesServerPlugin {
66
+ };
67
+ exports.OrderLineAttributesServerPlugin = OrderLineAttributesServerPlugin;
68
+ exports.OrderLineAttributesServerPlugin = OrderLineAttributesServerPlugin = __decorate([
69
+ (0, core_1.DeenruvPlugin)({
70
+ compatibility: "^0.0.20",
71
+ imports: [core_1.PluginCommonModule],
72
+ configuration: (config) => {
73
+ config.customFields.OrderLine.push(...OrderLineCustomFields);
74
+ return config;
75
+ },
76
+ })
77
+ ], OrderLineAttributesServerPlugin);
@@ -0,0 +1,6 @@
1
+ export declare const AllTypesProps: Record<string, any>;
2
+ export declare const ReturnTypes: Record<string, any>;
3
+ export declare const Ops: {
4
+ query: "Query";
5
+ mutation: "Mutation";
6
+ };