@things-factory/integration-pos 7.0.0-y.0 → 7.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.
- package/client/pages/create-pos-store-popup.js +6 -5
- package/client/pages/integration-pos.js +1 -1
- package/client/pages/pos-xilnex.js +23 -23
- package/dist-server/controllers/index.d.ts +2 -0
- package/dist-server/controllers/pos-api/decorators.d.ts +1 -0
- package/dist-server/controllers/pos-api/decorators.js.map +1 -1
- package/dist-server/controllers/pos-api/index.d.ts +14 -0
- package/dist-server/controllers/pos-api/index.js +1 -1
- package/dist-server/controllers/pos-api/index.js.map +1 -1
- package/dist-server/controllers/xilnex/apis/get-outlet.d.ts +6 -0
- package/dist-server/controllers/xilnex/apis/get-outlet.js +1 -2
- package/dist-server/controllers/xilnex/apis/get-outlet.js.map +1 -1
- package/dist-server/controllers/xilnex/apis/get-outlets.d.ts +9 -0
- package/dist-server/controllers/xilnex/apis/get-outlets.js +1 -2
- package/dist-server/controllers/xilnex/apis/get-outlets.js.map +1 -1
- package/dist-server/controllers/xilnex/apis/index.d.ts +1 -0
- package/dist-server/controllers/xilnex/index.d.ts +1 -0
- package/dist-server/controllers/xilnex/platform-action.d.ts +6 -0
- package/dist-server/controllers/xilnex/platform-action.js.map +1 -1
- package/dist-server/controllers/xilnex/xilnex.d.ts +13 -0
- package/dist-server/engine/connector/index.d.ts +1 -0
- package/dist-server/engine/connector/pos-connector.d.ts +8 -0
- package/dist-server/engine/index.d.ts +2 -0
- package/dist-server/engine/task/index.d.ts +1 -0
- package/dist-server/engine/task/pos-api.d.ts +1 -0
- package/dist-server/engine/task/pos-api.js.map +1 -1
- package/dist-server/entities/index.d.ts +3 -0
- package/dist-server/entities/pos-store.d.ts +20 -0
- package/dist-server/entities/pos-store.js +2 -2
- package/dist-server/entities/pos-store.js.map +1 -1
- package/dist-server/graphql/index.d.ts +6 -0
- package/dist-server/graphql/resolvers/index.d.ts +2 -0
- package/dist-server/graphql/resolvers/index.js +2 -8
- package/dist-server/graphql/resolvers/index.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/create-pos-store.d.ts +6 -0
- package/dist-server/graphql/resolvers/pos/create-pos-store.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/delete-pos-store.d.ts +5 -0
- package/dist-server/graphql/resolvers/pos/delete-pos-stores.d.ts +5 -0
- package/dist-server/graphql/resolvers/pos/index.d.ts +27 -0
- package/dist-server/graphql/resolvers/pos/index.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/pos-store.d.ts +6 -0
- package/dist-server/graphql/resolvers/pos/pos-store.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/pos-stores.d.ts +8 -0
- package/dist-server/graphql/resolvers/pos/pos-stores.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/update-multiple-pos-stores.d.ts +5 -0
- package/dist-server/graphql/resolvers/pos/update-multiple-pos-stores.js.map +1 -1
- package/dist-server/graphql/resolvers/pos/update-pos-store.d.ts +6 -0
- package/dist-server/graphql/resolvers/pos/xilnex/deactivate-xilnex-store.d.ts +5 -0
- package/dist-server/graphql/resolvers/pos/xilnex/generate-xilnex-access-token.d.ts +7 -0
- package/dist-server/graphql/resolvers/pos/xilnex/index.d.ts +11 -0
- package/dist-server/graphql/resolvers/pos-api/index.d.ts +11 -0
- package/dist-server/graphql/resolvers/pos-api/pos-outlet.d.ts +11 -0
- package/dist-server/graphql/types/index.d.ts +4 -0
- package/dist-server/graphql/types/pos/index.d.ts +3 -0
- package/dist-server/graphql/types/pos/new-pos-store.d.ts +1 -0
- package/dist-server/graphql/types/pos/pos-store-list.d.ts +1 -0
- package/dist-server/graphql/types/pos/pos-store-patch.d.ts +1 -0
- package/dist-server/graphql/types/pos/pos-store.d.ts +1 -0
- package/dist-server/graphql/types/pos-api/pos-outlet.d.ts +3 -0
- package/dist-server/index.d.ts +6 -0
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/server/graphql/resolvers/index.ts +2 -8
- package/server/graphql/resolvers/pos/create-pos-store.ts +1 -1
- package/server/graphql/resolvers/pos/index.ts +1 -1
- package/server/graphql/resolvers/pos/pos-store.ts +1 -1
- package/server/graphql/resolvers/pos/pos-stores.ts +1 -1
- package/client/themes/app-theme.css +0 -117
- package/client/themes/layout-theme.css +0 -92
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SingleColumnFormStyles } from '@things-factory/form-ui'
|
|
2
2
|
import { getCodeByName } from '@things-factory/code-base'
|
|
3
3
|
import '@operato/data-grist'
|
|
4
|
-
import { i18next, localize } from '@
|
|
5
|
-
import { client } from '@
|
|
4
|
+
import { i18next, localize } from '@operato/i18n'
|
|
5
|
+
import { client } from '@operato/graphql'
|
|
6
6
|
import { gqlBuilder } from '@things-factory/utils'
|
|
7
7
|
import gql from 'graphql-tag'
|
|
8
8
|
import { css, html, LitElement } from 'lit'
|
|
@@ -24,7 +24,7 @@ class CreatePosStorePopup extends localize(i18next)(LitElement) {
|
|
|
24
24
|
display: flex;
|
|
25
25
|
flex-direction: column;
|
|
26
26
|
overflow-x: overlay;
|
|
27
|
-
background-color: var(--
|
|
27
|
+
background-color: var(--md-sys-color-background);
|
|
28
28
|
}
|
|
29
29
|
.button-container {
|
|
30
30
|
padding: var(--button-container-padding);
|
|
@@ -49,8 +49,9 @@ class CreatePosStorePopup extends localize(i18next)(LitElement) {
|
|
|
49
49
|
<select name="platform">
|
|
50
50
|
<option value="">--${i18next.t('label.please_select_a_platform')}--</option>
|
|
51
51
|
${(this._platforms || []).map(
|
|
52
|
-
platform =>
|
|
53
|
-
|
|
52
|
+
platform => html`
|
|
53
|
+
<option value="${platform && platform.name}">${platform && platform.description}</option>
|
|
54
|
+
`
|
|
54
55
|
)}
|
|
55
56
|
</select>
|
|
56
57
|
|
|
@@ -2,7 +2,7 @@ import { html, css } from 'lit'
|
|
|
2
2
|
import gql from 'graphql-tag'
|
|
3
3
|
import { client, CustomAlert, navigate, PageView } from '@things-factory/shell'
|
|
4
4
|
import { openPopup } from '@operato/layout'
|
|
5
|
-
import { i18next, localize } from '@
|
|
5
|
+
import { i18next, localize } from '@operato/i18n'
|
|
6
6
|
import { gqlBuilder, isMobileDevice } from '@things-factory/utils'
|
|
7
7
|
import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
|
|
8
8
|
|
|
@@ -18,14 +18,14 @@ class PosXilnex extends connect(store)(PageView) {
|
|
|
18
18
|
static get styles() {
|
|
19
19
|
return css`
|
|
20
20
|
:host {
|
|
21
|
-
padding: var(--
|
|
22
|
-
background-color: var(--
|
|
21
|
+
padding: var(--spacing-large, 15px);
|
|
22
|
+
background-color: var(--md-sys-color-background);
|
|
23
23
|
}
|
|
24
24
|
[overview] {
|
|
25
|
-
background-color: var(--
|
|
25
|
+
background-color: var(--md-sys-color-on-primary, #fff);
|
|
26
26
|
border-radius: var(--border-radius);
|
|
27
|
-
margin-bottom: var(--
|
|
28
|
-
padding: var(--
|
|
27
|
+
margin-bottom: var(--spacing-large, 15px);
|
|
28
|
+
padding: var(--spacing-large, 15px);
|
|
29
29
|
box-shadow: var(--box-shadow);
|
|
30
30
|
overflow: hidden;
|
|
31
31
|
}
|
|
@@ -33,21 +33,21 @@ class PosXilnex extends connect(store)(PageView) {
|
|
|
33
33
|
float: left;
|
|
34
34
|
max-width: 100px;
|
|
35
35
|
max-height: 125px;
|
|
36
|
-
margin-right: var(--
|
|
36
|
+
margin-right: var(--spacing-large, 15px);
|
|
37
37
|
}
|
|
38
38
|
[overview] h2 {
|
|
39
39
|
margin: 0;
|
|
40
40
|
padding: 0;
|
|
41
|
-
color: var(--
|
|
41
|
+
color: var(--md-sys-color-primary);
|
|
42
42
|
}
|
|
43
43
|
[overview] span {
|
|
44
44
|
display: block;
|
|
45
|
-
padding-top: var(--
|
|
46
|
-
color: var(--
|
|
45
|
+
padding-top: var(--spacing-small, 4px);
|
|
46
|
+
color: var(--md-sys-color-secondary);
|
|
47
47
|
}
|
|
48
48
|
[overview] span::before {
|
|
49
49
|
content: '⋅';
|
|
50
|
-
margin-right: var(--
|
|
50
|
+
margin-right: var(--spacing-small, 4px);
|
|
51
51
|
}
|
|
52
52
|
textarea:focus,
|
|
53
53
|
input:focus,
|
|
@@ -57,8 +57,8 @@ class PosXilnex extends connect(store)(PageView) {
|
|
|
57
57
|
textarea {
|
|
58
58
|
width: 800px;
|
|
59
59
|
height: 250px;
|
|
60
|
-
border: var(--border-
|
|
61
|
-
background-color: var(--
|
|
60
|
+
border: var(--border-dim-color);
|
|
61
|
+
background-color: var(--md-sys-color-on-primary, #fff);
|
|
62
62
|
}
|
|
63
63
|
[field-2column] {
|
|
64
64
|
display: grid;
|
|
@@ -71,13 +71,13 @@ class PosXilnex extends connect(store)(PageView) {
|
|
|
71
71
|
position: relative;
|
|
72
72
|
}
|
|
73
73
|
label {
|
|
74
|
-
margin-bottom: var(--
|
|
74
|
+
margin-bottom: var(--spacing-small);
|
|
75
75
|
font: var(--label-font);
|
|
76
|
-
color: var(--label-color);
|
|
76
|
+
color: var(--label-color, var(--md-sys-color-on-surface));
|
|
77
77
|
text-transform: var(--label-text-transform);
|
|
78
78
|
}
|
|
79
79
|
input {
|
|
80
|
-
border: var(--border-
|
|
80
|
+
border: var(--border-dim-color);
|
|
81
81
|
border-radius: var(--border-radius);
|
|
82
82
|
margin: var(--input-margin);
|
|
83
83
|
padding: var(--input-padding, 4px);
|
|
@@ -86,13 +86,13 @@ class PosXilnex extends connect(store)(PageView) {
|
|
|
86
86
|
flex: 1;
|
|
87
87
|
}
|
|
88
88
|
[button-primary] {
|
|
89
|
-
background-color: var(--
|
|
90
|
-
border: var(--border-
|
|
89
|
+
background-color: var(--md-sys-color-primary);
|
|
90
|
+
border: var(--border-dim-color);
|
|
91
91
|
border-radius: var(--border-radius);
|
|
92
92
|
margin: 9px 0 9px 9px;
|
|
93
93
|
padding: var(--button-primary-padding, 9px);
|
|
94
94
|
float: right;
|
|
95
|
-
color: var(--
|
|
95
|
+
color: var(--md-sys-color-on-primary, #fff);
|
|
96
96
|
font: bold 16px var(--theme-font);
|
|
97
97
|
text-transform: var(--button-text-transform, capitalize);
|
|
98
98
|
}
|
|
@@ -102,21 +102,21 @@ class PosXilnex extends connect(store)(PageView) {
|
|
|
102
102
|
}
|
|
103
103
|
a {
|
|
104
104
|
display: inline-block;
|
|
105
|
-
border: var(--border-
|
|
105
|
+
border: var(--border-dim-color);
|
|
106
106
|
border-radius: var(--border-radius);
|
|
107
|
-
background-color: var(--
|
|
107
|
+
background-color: var(--md-sys-color-on-primary, #fff);
|
|
108
108
|
margin: 9px 0;
|
|
109
109
|
padding: var(--button-padding, 9px);
|
|
110
110
|
font-size: 14px;
|
|
111
111
|
text-decoration: none;
|
|
112
|
-
color: var(--
|
|
112
|
+
color: var(--md-sys-color-secondary);
|
|
113
113
|
}
|
|
114
114
|
a mwc-icon {
|
|
115
115
|
vertical-align: middle;
|
|
116
|
-
color: var(--
|
|
116
|
+
color: var(--md-sys-color-primary);
|
|
117
117
|
}
|
|
118
118
|
a:hover {
|
|
119
|
-
border-color: var(--
|
|
119
|
+
border-color: var(--md-sys-color-primary);
|
|
120
120
|
}
|
|
121
121
|
`
|
|
122
122
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const api: (target: Object, property: string, descriptor: TypedPropertyDescriptor<any>) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../server/controllers/pos-api/decorators.ts"],"names":[],"mappings":";;;;AAAA,0DAAyB;AACzB,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,kDAAkD,CAAC,CAAA;AAIvE,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAEZ,MAAM,GAAG,GAAG,CAAC,MAAc,EAAE,QAAgB,EAAE,UAAwC,EAAO,EAAE;IACrG,MAAM,MAAM,GAAG,UAAU,CAAC,KAA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,GAAG,IAAI,EAClB,SAAS,GAAG,IAAI,EAChB,MAAM,GAAG,cAAc,EACxB,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;QAE5B,IAAI,YAAY,GAAG,MAAM,WAAW,CAAC,OAAO,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;QAC9D,KAAK,CAAC,SAAS,EAAE,YAAY,CAAC,CAAA;QAE9B,IAAI,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE;YACtC,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE;SAC3E,CAAC,CAAA;QAEF,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;QAE3B,OAAO,MAAM,SAAS,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;IAC7C,CAAC,CAAA;IAED,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA;AApCY,QAAA,GAAG,OAoCf","sourcesContent":["import Debug from 'debug'\nconst debug = Debug('things-factory:integration-pos:pos-api-decorator')\n\nimport { PosStore } from '../../entities'\n\nconst NOOP = v => v\n\nexport const api = (target: Object, property: string, descriptor: TypedPropertyDescriptor<any>): any => {\n const method = descriptor.value\n\n descriptor.value = async function (store: PosStore, request) {\n const POSAPI = this\n\n var { platform } = store\n\n var { action: platformAction, apis } = POSAPI.getPlatform(platform)\n\n var m = apis[method.name]\n if (!m) {\n throw Error(`POS Platform '${platform}' doesn't have API ${method.name}`)\n }\n\n var {\n path,\n method: httpMethod = 'post',\n denormalize = NOOP,\n normalize = NOOP,\n action = platformAction\n } = m.apply(this, [request])\n\n var denormalized = await denormalize(request || {}, { store })\n debug('request', denormalized)\n\n var response = await action.apply(this, [\n { store, method: httpMethod, path, request: denormalized, platformAction }\n ])\n\n debug('response', response)\n\n return await normalize(response, { store })\n }\n\n return descriptor\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PosStore } from '../../entities';
|
|
2
|
+
export declare const POS_STORE_STATUS: {
|
|
3
|
+
ACTIVE: string;
|
|
4
|
+
INACTIVE: string;
|
|
5
|
+
TERMINATED: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class POSAPI {
|
|
8
|
+
static platforms: {};
|
|
9
|
+
static registerPlatform(name: any, action: any, apis: any): void;
|
|
10
|
+
static getPlatform(name: any): any;
|
|
11
|
+
static getPosStore(id: any): Promise<PosStore>;
|
|
12
|
+
static getOutlets(store: any, req: any): any;
|
|
13
|
+
static getOutlet(store: any, req: any): any;
|
|
14
|
+
}
|
|
@@ -31,6 +31,7 @@ class POSAPI {
|
|
|
31
31
|
static getOutlets(store, req) { }
|
|
32
32
|
static getOutlet(store, req) { }
|
|
33
33
|
}
|
|
34
|
+
exports.POSAPI = POSAPI;
|
|
34
35
|
POSAPI.platforms = {};
|
|
35
36
|
tslib_1.__decorate([
|
|
36
37
|
decorators_1.api,
|
|
@@ -44,5 +45,4 @@ tslib_1.__decorate([
|
|
|
44
45
|
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
45
46
|
tslib_1.__metadata("design:returntype", Object)
|
|
46
47
|
], POSAPI, "getOutlet", null);
|
|
47
|
-
exports.POSAPI = POSAPI;
|
|
48
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/controllers/pos-api/index.ts"],"names":[],"mappings":";;;;AAAA,iDAAqD;AAErD,6CAAyC;AACzC,6CAAkC;AAErB,QAAA,gBAAgB,GAAG;IAC9B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,YAAY;CACzB,CAAA;AAED,MAAa,MAAM;IAGjB,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI;QACxC,MAAM,CAAC,SAAS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,OAAO,MAAM,UAAU,CAAC,OAAO,CAAC;YAC9B,KAAK,EAAE,EAAE,EAAE,EAAE;YACb,SAAS,EAAE,CAAC,QAAQ,CAAC;SACtB,CAAC,CAAA;IACJ,CAAC;IAGM,AAAP,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,IAAQ,CAAC;IAG9B,AAAP,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,IAAQ,CAAC;;AA3BtC,wBA4BC;AA3BQ,gBAAS,GAAG,EAAE,CAAA;AAuBd;IADN,gBAAG;;;;8BACiC;AAG9B;IADN,gBAAG;;;;6BACgC","sourcesContent":["import { getRepository } from '@things-factory/shell'\n\nimport { PosStore } from '../../entities'\nimport { api } from './decorators'\n\nexport const POS_STORE_STATUS = {\n ACTIVE: 'active',\n INACTIVE: 'inactive',\n TERMINATED: 'terminated'\n}\n\nexport class POSAPI {\n static platforms = {}\n\n static registerPlatform(name, action, apis) {\n POSAPI.platforms[name] = {\n action,\n apis\n }\n }\n\n static getPlatform(name) {\n return POSAPI.platforms[name]\n }\n\n static async getPosStore(id) {\n const repository = getRepository(PosStore)\n // return await repository.find(id)\n return await repository.findOne({\n where: { id },\n relations: ['domain']\n })\n }\n\n @api\n static getOutlets(store, req): any {}\n\n @api\n static getOutlet(store, req): any {}\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOutlet =
|
|
3
|
+
exports.getOutlet = getOutlet;
|
|
4
4
|
function getOutlet() {
|
|
5
5
|
return {
|
|
6
6
|
method: 'get',
|
|
@@ -13,5 +13,4 @@ function getOutlet() {
|
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
exports.getOutlet = getOutlet;
|
|
17
16
|
//# sourceMappingURL=get-outlet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-outlet.js","sourceRoot":"","sources":["../../../../server/controllers/xilnex/apis/get-outlet.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-outlet.js","sourceRoot":"","sources":["../../../../server/controllers/xilnex/apis/get-outlet.ts"],"names":[],"mappings":";;AAAA,8BAaC;AAbD,SAAgB,SAAS;IACvB,OAAO;QACL,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,oBAAoB;QAC1B,WAAW,CAAC,GAAG;YACb,OAAO,EAAE,CAAA;QACX,CAAC;QACD,SAAS,CAAC,GAAG;YACX,yBACK,GAAG,EACP;QACH,CAAC;KACF,CAAA;AACH,CAAC","sourcesContent":["export function getOutlet() {\n return {\n method: 'get',\n path: '/outlet/{outletNo}',\n denormalize(req) {\n return {}\n },\n normalize(res) {\n return {\n ...res\n }\n }\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOutlets =
|
|
3
|
+
exports.getOutlets = getOutlets;
|
|
4
4
|
const debug = require('debug')('things-factory:integration-pos:xilnex:get-outlets');
|
|
5
5
|
function getOutlets() {
|
|
6
6
|
return {
|
|
@@ -19,5 +19,4 @@ function getOutlets() {
|
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
exports.getOutlets = getOutlets;
|
|
23
22
|
//# sourceMappingURL=get-outlets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-outlets.js","sourceRoot":"","sources":["../../../../server/controllers/xilnex/apis/get-outlets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-outlets.js","sourceRoot":"","sources":["../../../../server/controllers/xilnex/apis/get-outlets.ts"],"names":[],"mappings":";;AAEA,gCAiBC;AAnBD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,mDAAmD,CAAC,CAAA;AAEnF,SAAgB,UAAU;IACxB,OAAO;QACL,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,UAAU;QAChB,WAAW,CAAC,GAAG;YACb,OAAO,EAAE,CAAA;QACX,CAAC;QACD,SAAS,CAAC,GAAG;YACX,KAAK,CAAC,eAAe,EAAE,GAAG,CAAC,CAAA;YAC3B,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAA;YAEvB,OAAO;gBACL,KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,OAAO,CAAC,MAAM;aACtB,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC","sourcesContent":["const debug = require('debug')('things-factory:integration-pos:xilnex:get-outlets')\n\nexport function getOutlets() {\n return {\n method: 'get',\n path: '/outlets',\n denormalize(req) {\n return {}\n },\n normalize(res) {\n debug('response data', res)\n const { outlets } = res\n \n return {\n items: outlets,\n total: outlets.length\n }\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-outlets';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './xilnex';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-action.js","sourceRoot":"","sources":["../../../server/controllers/xilnex/platform-action.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AAEjC,6CAA4C;AAC5C,MAAM,YAAY,GAAG,YAAM,CAAC,GAAG,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAA;AAC3D,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,YAAY,CAAA;AAE1C,SAAS,UAAU,CAAC,IAAI,EAAE,GAAG;IAC3B,IAAI,KAAK,GAAG,EAAE,CAAA;IACd,IAAI,EAAE,GAAG,YAAY,CAAA;IACrB,IAAI,IAAI,CAAA;IAER,OAAO,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"platform-action.js","sourceRoot":"","sources":["../../../server/controllers/xilnex/platform-action.ts"],"names":[],"mappings":";;;AAAA,qCA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EAAE,QAAQ,CAAC,CAAA;IAEjC,IAAI,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAClD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,QAAQ,CAAC,KAAK,CAAA;IACtB,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC,CAAA;AAjBY,QAAA,MAAM,UAiBlB","sourcesContent":["import { Xilnex } from './xilnex'\n\nimport { config } from '@things-factory/env'\nconst xilnexConfig = config.get('posIntegrationXilnex', {})\nconst { apiKey, apiSecret } = xilnexConfig\n\nfunction substitute(path, obj) {\n var props = []\n var re = /{([^}]+)}/g\n var text\n\n while ((text = re.exec(path))) {\n props.push(text[1])\n }\n\n var result = path\n props.forEach(prop => {\n let value = obj[prop.trim()]\n result = result.replace(`{${prop}}`, value === undefined ? '' : value)\n })\n\n return result\n}\n\nexport const action = async ({ store, method = 'get', path, request }) => {\n const client = new Xilnex({\n store: store.storeId,\n accessToken: store.accessToken,\n storeId: store.storeId\n })\n\n const { resource = {}, payload = {} } = request\n\n path = substitute(path, resource)\n\n var response = await client[method](path, payload)\n if (!response.ok) {\n throw response.error\n }\n\n return response.data\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type XilnexConfig = {
|
|
2
|
+
store: string;
|
|
3
|
+
accessToken?: string;
|
|
4
|
+
storeId: string;
|
|
5
|
+
};
|
|
6
|
+
export declare class Xilnex {
|
|
7
|
+
private config;
|
|
8
|
+
constructor(config: XilnexConfig);
|
|
9
|
+
get(path: string, data: any): Promise<any>;
|
|
10
|
+
post(path: string, data?: any): Promise<any>;
|
|
11
|
+
put(path: string, data?: any): Promise<any>;
|
|
12
|
+
delete(path: string, data?: any): Promise<any>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './pos-connector';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Connector, Connection } from '@things-factory/integration-base';
|
|
2
|
+
export declare class POSConnector implements Connector {
|
|
3
|
+
ready(connectionConfigs: any): Promise<void>;
|
|
4
|
+
connect(connection: any): Promise<void>;
|
|
5
|
+
disconnect(connection: Connection): Promise<void>;
|
|
6
|
+
get parameterSpec(): any[];
|
|
7
|
+
get taskPrefixes(): string[];
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './pos-api';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pos-api.js","sourceRoot":"","sources":["../../../server/engine/task/pos-api.ts"],"names":[],"mappings":";;AAAA,uEAAkF;AAClF,iDAAqD;AACrD,iDAA8C;AAE9C,uDAAyD;AACzD,6CAAyC;AAEzC,KAAK,UAAU,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;IAClD,IAAI,EACF,UAAU,EACV,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,EACvC,GAAG,IAAI,CAAA;IAER,IAAI,MAAM,GAAG,oCAAiB,CAAC,2BAA2B,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,CAAA;IACpF,IAAI,CAAC,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"pos-api.js","sourceRoot":"","sources":["../../../server/engine/task/pos-api.ts"],"names":[],"mappings":";;AAAA,uEAAkF;AAClF,iDAAqD;AACrD,iDAA8C;AAE9C,uDAAyD;AACzD,6CAAyC;AAEzC,KAAK,UAAU,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;IAClD,IAAI,EACF,UAAU,EACV,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,EACvC,GAAG,IAAI,CAAA;IAER,IAAI,MAAM,GAAG,oCAAiB,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,KAAK,EAAE,UAAU;KAClB;CACF,CAAA;AAED,+BAAY,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA","sourcesContent":["import { ConnectionManager, TaskRegistry } from '@things-factory/integration-base'\nimport { getRepository } from '@things-factory/shell'\nimport { access } from '@things-factory/utils'\n\nimport { POSAPI as API } from '../../controllers/pos-api'\nimport { PosStore } from '../../entities'\n\nasync function POSAPI(step, { logger, data, domain }) {\n var {\n connection,\n params: { store: name, api, accessor }\n } = step\n\n var client = ConnectionManager.getConnectionInstanceByName(domain, connection) || {}\n if (!client) {\n throw new Error(`no connection : ${connection}`)\n }\n\n if (!api) {\n throw new Error(`no api defined`)\n }\n\n const repository = getRepository(PosStore)\n const store: PosStore = await repository.findOne({\n where: { domain: { id: domain.id }, name }\n })\n\n if (!store) {\n throw new Error(`no store defined`)\n }\n\n var result = await API[api](store, accessor ? access(accessor, data) : {})\n\n return {\n data: result\n }\n}\n\nPOSAPI.parameterSpec = [\n {\n type: 'entity-selector',\n name: 'store',\n label: 'store',\n property: {\n queryName: 'stores',\n valueKey: 'name'\n }\n },\n {\n type: 'select',\n name: 'api',\n label: 'api',\n property: {\n options: ['', 'getPOSInvoices']\n }\n },\n {\n type: 'string',\n name: 'accessor',\n label: 'accessor'\n }\n]\n\nTaskRegistry.registerTaskHandler('pos-api', POSAPI)\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { User } from '@things-factory/auth-base';
|
|
2
|
+
import { Domain } from '@things-factory/shell';
|
|
3
|
+
export declare class PosStore {
|
|
4
|
+
id: string;
|
|
5
|
+
domain: Domain;
|
|
6
|
+
platform: string;
|
|
7
|
+
storeId: string;
|
|
8
|
+
countryCode: string;
|
|
9
|
+
status: string;
|
|
10
|
+
name: string;
|
|
11
|
+
accessInfo: string;
|
|
12
|
+
accessToken: string;
|
|
13
|
+
refreshToken: string;
|
|
14
|
+
store: string;
|
|
15
|
+
description: string;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
creator: User;
|
|
19
|
+
updater: User;
|
|
20
|
+
}
|
|
@@ -7,6 +7,7 @@ const shell_1 = require("@things-factory/shell");
|
|
|
7
7
|
const typeorm_1 = require("typeorm");
|
|
8
8
|
let PosStore = class PosStore {
|
|
9
9
|
};
|
|
10
|
+
exports.PosStore = PosStore;
|
|
10
11
|
tslib_1.__decorate([
|
|
11
12
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
12
13
|
tslib_1.__metadata("design:type", String)
|
|
@@ -89,9 +90,8 @@ tslib_1.__decorate([
|
|
|
89
90
|
}),
|
|
90
91
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
91
92
|
], PosStore.prototype, "updater", void 0);
|
|
92
|
-
PosStore = tslib_1.__decorate([
|
|
93
|
+
exports.PosStore = PosStore = tslib_1.__decorate([
|
|
93
94
|
(0, typeorm_1.Entity)(),
|
|
94
95
|
(0, typeorm_1.Index)('ix_pos-store_0', (store) => [store.domain, store.name], { unique: true })
|
|
95
96
|
], PosStore);
|
|
96
|
-
exports.PosStore = PosStore;
|
|
97
97
|
//# sourceMappingURL=pos-store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pos-store.js","sourceRoot":"","sources":["../../server/entities/pos-store.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,iDAA8C;AAC9C,qCAAsH;AAO/G,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAkEpB,CAAA;
|
|
1
|
+
{"version":3,"file":"pos-store.js","sourceRoot":"","sources":["../../server/entities/pos-store.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,iDAA8C;AAC9C,qCAAsH;AAO/G,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAkEpB,CAAA;AAlEY,4BAAQ;AAEnB;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;oCACrB;AAGV;IADC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,C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GACY,QAAQ,CAkEpB","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\nimport { Column, CreateDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'\n\n@Entity()\n@Index(\n 'ix_pos-store_0',\n (store: PosStore) => [store.domain, store.name], { unique: true }\n)\nexport class PosStore {\n @PrimaryGeneratedColumn('uuid')\n id: string\n\n @ManyToOne(type => Domain)\n domain: Domain\n\n @Column()\n platform: string\n\n @Column({\n nullable: true\n })\n storeId: string\n\n @Column()\n countryCode: string\n\n @Column({\n nullable: true\n })\n status: string\n\n @Column()\n name: string\n\n @Column({\n nullable: true\n })\n accessInfo: string\n\n @Column({\n nullable: true\n })\n accessToken: string\n\n @Column({\n nullable: true\n })\n refreshToken: string\n\n @Column({\n nullable: true\n })\n store: string\n\n @Column({\n nullable: true\n })\n description: string\n\n @CreateDateColumn()\n createdAt: Date\n\n @UpdateDateColumn()\n updatedAt: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n creator: User\n\n @ManyToOne(type => User, {\n nullable: true\n })\n updater: User\n}\n"]}
|
|
@@ -4,12 +4,6 @@ exports.mutations = exports.queries = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const POS = tslib_1.__importStar(require("./pos"));
|
|
6
6
|
const POSAPI = tslib_1.__importStar(require("./pos-api"));
|
|
7
|
-
exports.queries = [
|
|
8
|
-
|
|
9
|
-
POSAPI.Query
|
|
10
|
-
];
|
|
11
|
-
exports.mutations = [
|
|
12
|
-
POS.Mutation,
|
|
13
|
-
POSAPI.Mutation
|
|
14
|
-
];
|
|
7
|
+
exports.queries = [POS.Query, POSAPI.Query];
|
|
8
|
+
exports.mutations = [POS.Mutation, POSAPI.Mutation];
|
|
15
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/graphql/resolvers/index.ts"],"names":[],"mappings":";;;;AAAA,mDAA4B;AAC5B,0DAAmC;AAEtB,QAAA,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/graphql/resolvers/index.ts"],"names":[],"mappings":";;;;AAAA,mDAA4B;AAC5B,0DAAmC;AAEtB,QAAA,OAAO,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAQ,CAAA;AAE1C,QAAA,SAAS,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAA","sourcesContent":["import * as POS from './pos'\nimport * as POSAPI from './pos-api'\n\nexport const queries = [POS.Query, POSAPI.Query] as any\n\nexport const mutations = [POS.Mutation, POSAPI.Mutation]\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-pos-store.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/create-pos-store.ts"],"names":[],"mappings":";;;AAAA,iDAAqD;AAErD,sDAAuD;AACvD,gDAA4C;AAE/B,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,cAAc,CAAC,CAAM,EAAE,EAAE,KAAK,EAAE,EAAE,OAAwB;QAC9D,OAAO,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,+BACvC,MAAM,EAAE,8BAAgB,CAAC,QAAQ,IAC9B,KAAK,KACR,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAC5B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,EAC3B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from '@things-factory/shell'\n\nimport { POS_STORE_STATUS } from '../../../controllers'\nimport { PosStore } from '../../../entities'\n\nexport const createPosStore = {\n async createPosStore(_: any, { store }, context: ResolverContext) {\n return await getRepository(PosStore).save({\n status: POS_STORE_STATUS.INACTIVE,\n ...store,\n domain: context.state.domain,\n creator: context.state.user,\n updater: context.state.user\n })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"create-pos-store.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/create-pos-store.ts"],"names":[],"mappings":";;;AAAA,iDAAqD;AAErD,sDAAuD;AACvD,gDAA4C;AAE/B,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,cAAc,CAAC,CAAM,EAAE,EAAE,KAAK,EAAE,EAAE,OAAwB;QAC9D,OAAO,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAC,IAAI,+BACvC,MAAM,EAAE,8BAAgB,CAAC,QAAQ,IAC9B,KAAK,KACR,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,EAC5B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,EAC3B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from '@things-factory/shell'\n\nimport { POS_STORE_STATUS } from '../../../controllers'\nimport { PosStore } from '../../../entities'\n\nexport const createPosStore = {\n async createPosStore(_: any, { store }, context: ResolverContext): Promise<PosStore> {\n return await getRepository(PosStore).save({\n status: POS_STORE_STATUS.INACTIVE,\n ...store,\n domain: context.state.domain,\n creator: context.state.user,\n updater: context.state.user\n })\n }\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const Query: any;
|
|
2
|
+
export declare const Mutation: {
|
|
3
|
+
deactivateXilnexPosStore(_: any, { id }: {
|
|
4
|
+
id: any;
|
|
5
|
+
}, context: ResolverContext): Promise<any>;
|
|
6
|
+
generateXilnexAccessToken(_: any, { id, appid, token }: {
|
|
7
|
+
id: any;
|
|
8
|
+
appid: any;
|
|
9
|
+
token: any;
|
|
10
|
+
}, context: ResolverContext): Promise<any>;
|
|
11
|
+
deletePosStores(_: any, { names }: {
|
|
12
|
+
names: any;
|
|
13
|
+
}, context: ResolverContext): Promise<boolean>;
|
|
14
|
+
deletePosStore(_: any, { name }: {
|
|
15
|
+
name: any;
|
|
16
|
+
}, context: ResolverContext): Promise<boolean>;
|
|
17
|
+
createPosStore(_: any, { store }: {
|
|
18
|
+
store: any;
|
|
19
|
+
}, context: ResolverContext): Promise<import("../../..").PosStore>;
|
|
20
|
+
updateMultiplePosStore(_: any, { patches }: {
|
|
21
|
+
patches: any;
|
|
22
|
+
}, context: ResolverContext): Promise<any[]>;
|
|
23
|
+
updatePosStore(_: any, { name, patch }: {
|
|
24
|
+
name: any;
|
|
25
|
+
patch: any;
|
|
26
|
+
}, context: ResolverContext): Promise<any>;
|
|
27
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/index.ts"],"names":[],"mappings":";;;;AAAA,2CAA8C;AAC9C,6CAAgD;AAEhD,6EAAqE;AACrE,yDAAmD;AACnD,yDAAmD;AACnD,yDAAmD;AACnD,2DAAqD;AAErD,yDAAkC;AAErB,QAAA,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/index.ts"],"names":[],"mappings":";;;;AAAA,2CAA8C;AAC9C,6CAAgD;AAEhD,6EAAqE;AACrE,yDAAmD;AACnD,yDAAmD;AACnD,yDAAmD;AACnD,2DAAqD;AAErD,yDAAkC;AAErB,QAAA,KAAK,GAAG,8CAChB,8BAAiB,GACjB,4BAAgB,GAChB,MAAM,CAAC,KAAK,CACT,CAAA;AAEK,QAAA,QAAQ,2FAChB,iCAAc,GACd,mDAAsB,GACtB,iCAAc,GACd,iCAAc,GACd,mCAAe,GACf,MAAM,CAAC,QAAQ,EACnB","sourcesContent":["import { posStoreResolver } from './pos-store'\nimport { posStoresResolver } from './pos-stores'\n\nimport { updateMultiplePosStore } from './update-multiple-pos-stores'\nimport { updatePosStore } from './update-pos-store'\nimport { createPosStore } from './create-pos-store'\nimport { deletePosStore } from './delete-pos-store'\nimport { deletePosStores } from './delete-pos-stores'\n\nimport * as Xilnex from './xilnex'\n\nexport const Query = {\n ...posStoresResolver,\n ...posStoreResolver,\n ...Xilnex.Query\n} as any\n\nexport const Mutation = {\n ...updatePosStore,\n ...updateMultiplePosStore,\n ...createPosStore,\n ...deletePosStore,\n ...deletePosStores,\n ...Xilnex.Mutation\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pos-store.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/pos-store.ts"],"names":[],"mappings":";;;AAAA,iDAAqD;AAErD,gDAA4C;AAE/B,QAAA,gBAAgB,GAAG;IAC9B,KAAK,CAAC,QAAQ,CAAC,CAAM,EAAE,EAAE,EAAE,EAAE,EAAE,OAAwB;QACrD,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAA;QAE1C,OAAO,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;YACtD,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;SAC5C,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from '@things-factory/shell'\n\nimport { PosStore } from '../../../entities'\n\nexport const posStoreResolver = {\n async posStore(_: any, { id }, context: ResolverContext) {\n const repository = getRepository(PosStore)\n\n return await getRepository(PosStore).findOne({\n where: { domain: { id: context.state.domain.id }, id },\n relations: ['domain', 'creator', 'updater']\n })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pos-store.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/pos-store.ts"],"names":[],"mappings":";;;AAAA,iDAAqD;AAErD,gDAA4C;AAE/B,QAAA,gBAAgB,GAAG;IAC9B,KAAK,CAAC,QAAQ,CAAC,CAAM,EAAE,EAAE,EAAE,EAAE,EAAE,OAAwB;QACrD,MAAM,UAAU,GAAG,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAA;QAE1C,OAAO,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;YACtD,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;SAC5C,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from '@things-factory/shell'\n\nimport { PosStore } from '../../../entities'\n\nexport const posStoreResolver = {\n async posStore(_: any, { id }, context: ResolverContext): Promise<PosStore> {\n const repository = getRepository(PosStore)\n\n return await getRepository(PosStore).findOne({\n where: { domain: { id: context.state.domain.id }, id },\n relations: ['domain', 'creator', 'updater']\n })\n }\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ListParam } from '@things-factory/shell';
|
|
2
|
+
import { PosStore } from '../../../entities';
|
|
3
|
+
export declare const posStoresResolver: {
|
|
4
|
+
posStores(_: any, params: ListParam, context: ResolverContext): Promise<{
|
|
5
|
+
items: PosStore[];
|
|
6
|
+
total: number;
|
|
7
|
+
}>;
|
|
8
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pos-stores.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/pos-stores.ts"],"names":[],"mappings":";;;AAAA,iDAAmF;AAEnF,gDAA4C;AAE/B,QAAA,iBAAiB,GAAG;IAC/B,KAAK,CAAC,SAAS,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAwB;QACjE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;QAC7D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAC,YAAY,iCAC5D,eAAe,KAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,IAC3C,CAAA;QACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF,CAAA","sourcesContent":["import { convertListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { PosStore } from '../../../entities'\n\nexport const posStoresResolver = {\n async posStores(_: any, params: ListParam, context: ResolverContext) {\n const { domain } = context.state\n const convertedParams = convertListParams(params, { domain })\n const [items, total] = await getRepository(PosStore).findAndCount({\n ...convertedParams,\n relations: ['domain', 'creator', 'updater']\n })\n return { items, total }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"pos-stores.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/pos-stores.ts"],"names":[],"mappings":";;;AAAA,iDAAmF;AAEnF,gDAA4C;AAE/B,QAAA,iBAAiB,GAAG;IAC/B,KAAK,CAAC,SAAS,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAwB;QACjE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;QAC7D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAC,YAAY,iCAC5D,eAAe,KAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,IAC3C,CAAA;QACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF,CAAA","sourcesContent":["import { convertListParams, getRepository, ListParam } from '@things-factory/shell'\n\nimport { PosStore } from '../../../entities'\n\nexport const posStoresResolver = {\n async posStores(_: any, params: ListParam, context: ResolverContext): Promise<{ items: PosStore[]; total: number }> {\n const { domain } = context.state\n const convertedParams = convertListParams(params, { domain })\n const [items, total] = await getRepository(PosStore).findAndCount({\n ...convertedParams,\n relations: ['domain', 'creator', 'updater']\n })\n return { items, total }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-multiple-pos-stores.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/update-multiple-pos-stores.ts"],"names":[],"mappings":";;;AAAA,iDAAqD;AAErD,gDAA4C;AAE/B,QAAA,sBAAsB,GAAG;IACpC,KAAK,CAAC,sBAAsB,CAAC,CAAM,EAAE,EAAE,OAAO,EAAE,EAAE,OAAwB;QACxE,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QACzF,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QACzF,MAAM,YAAY,GAAG,IAAA,qBAAa,EAAC,mBAAQ,CAAC,CAAA;QAE5C,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"update-multiple-pos-stores.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/pos/update-multiple-pos-stores.ts"],"names":[],"mappings":";;;AAAA,iDAAqD;AAErD,gDAA4C;AAE/B,QAAA,sBAAsB,GAAG;IACpC,KAAK,CAAC,sBAAsB,CAAC,CAAM,EAAE,EAAE,OAAO,EAAE,EAAE,OAAwB;QACxE,IAAI,OAAO,GAAG,EAAE,CAAA;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,YAAY,CAAC,IAAI,+CACjC,KAAK,GACL,SAAS,KACZ,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;gBAEF,OAAO,CAAC,IAAI,iCAAM,MAAM,KAAE,MAAM,EAAE,GAAG,IAAG,CAAA;YAC1C,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAA;IAChB,CAAC;CACF,CAAA","sourcesContent":["import { getRepository } from '@things-factory/shell'\n\nimport { PosStore } from '../../../entities'\n\nexport const updateMultiplePosStore = {\n async updateMultiplePosStore(_: any, { patches }, context: ResolverContext) {\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const posStoreRepo = getRepository(PosStore)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await posStoreRepo.save({\n ...newRecord,\n domain: context.state.domain,\n creator: context.state.user,\n updater: context.state.user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const store: PosStore = await posStoreRepo.findOneBy({ id: newRecord.id })\n\n const result = await posStoreRepo.save({\n ...store,\n ...newRecord,\n updater: context.state.user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n}\n"]}
|