@things-factory/operato-hub 4.3.233 → 4.3.235
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/config.development.js +104 -75
- package/dist-server/routers/internal/apis/create-company.js +1 -0
- package/dist-server/routers/internal/apis/create-company.js.map +1 -1
- package/dist-server/routers/internal/powrup-router.js +24 -65
- package/dist-server/routers/internal/powrup-router.js.map +1 -1
- package/package.json +29 -29
- package/server/routers/internal/apis/create-company.ts +1 -0
- package/server/routers/internal/powrup-router.ts +24 -75
package/config.development.js
CHANGED
|
@@ -1,14 +1,40 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
domainType: 'company',
|
|
3
3
|
domainExtType: 'company',
|
|
4
|
+
useVirtualHostBasedDomain: false,
|
|
5
|
+
fallbackRoute: '/',
|
|
4
6
|
subdomainOffset: 2,
|
|
7
|
+
port: 3000,
|
|
8
|
+
inspect: '9260',
|
|
9
|
+
// ormconfig: {
|
|
10
|
+
// name: 'default',
|
|
11
|
+
// type: 'postgres',
|
|
12
|
+
// database: 'dev',
|
|
13
|
+
// username: 'postgres',
|
|
14
|
+
// password: 'abcd1234',
|
|
15
|
+
// host: 'operatov3.cluster-cijhm4n1hbst.ap-southeast-1.rds.amazonaws.com',
|
|
16
|
+
// port: 55432,
|
|
17
|
+
// synchronize: false,
|
|
18
|
+
// logging: true
|
|
19
|
+
// },
|
|
20
|
+
// ormconfig: {
|
|
21
|
+
// name: 'default',
|
|
22
|
+
// type: 'postgres',
|
|
23
|
+
// database: 'v3-hub1',
|
|
24
|
+
// username: 'postgres',
|
|
25
|
+
// password: 'hatio',
|
|
26
|
+
// host: 'localhost',
|
|
27
|
+
// port: 15432,
|
|
28
|
+
// synchronize: true,
|
|
29
|
+
// logging: true
|
|
30
|
+
// },
|
|
5
31
|
ormconfig: {
|
|
6
32
|
name: 'default',
|
|
7
33
|
type: 'postgres',
|
|
8
|
-
database: '
|
|
34
|
+
database: 'dev2',
|
|
9
35
|
username: 'postgres',
|
|
10
36
|
password: 'hatio',
|
|
11
|
-
host: '192.168.0.
|
|
37
|
+
host: '192.168.0.161',
|
|
12
38
|
port: 15432,
|
|
13
39
|
synchronize: true,
|
|
14
40
|
logging: true
|
|
@@ -16,95 +42,105 @@ module.exports = {
|
|
|
16
42
|
// ormconfig: {
|
|
17
43
|
// name: 'default',
|
|
18
44
|
// type: 'postgres',
|
|
19
|
-
// database: '
|
|
45
|
+
// database: 'dev',
|
|
20
46
|
// username: 'postgres',
|
|
21
|
-
// password: '
|
|
22
|
-
// host: '
|
|
23
|
-
// port:
|
|
47
|
+
// password: 'hatio',
|
|
48
|
+
// host: 'localhost',
|
|
49
|
+
// port: 15432,
|
|
24
50
|
// synchronize: true,
|
|
25
|
-
// logging:
|
|
51
|
+
// logging: true
|
|
26
52
|
// },
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
vapidKey: {
|
|
45
|
-
subject: 'mailto:heartyoh@hatiolab.com',
|
|
46
|
-
publicKey: 'BAkVkITsCXBIsYL1yeaBmx5_dn57we-ZXMjirPPHzC2dan82cdEnAio_53PQ-1_w3ykWCBPrrFAWQ_d9N4cFF0o',
|
|
47
|
-
privateKey: '4pmlt3Wk019u7nqU3Q_oGZE6LbUDjjf8DpmAcn9-iss'
|
|
48
|
-
}
|
|
53
|
+
password: {
|
|
54
|
+
lowerCase: true,
|
|
55
|
+
upperCase: false,
|
|
56
|
+
digit: false,
|
|
57
|
+
specialCharacter: false,
|
|
58
|
+
allowRepeat: true,
|
|
59
|
+
useTightPattern: false,
|
|
60
|
+
useLoosePattern: true,
|
|
61
|
+
tightCharacterLength: 4,
|
|
62
|
+
looseCharacterLength: 4,
|
|
63
|
+
history: 2
|
|
64
|
+
},
|
|
65
|
+
sftpFileStorage: {
|
|
66
|
+
type: 's3',
|
|
67
|
+
accessKeyId: 'AKIAUQEOPWEJKL43OMZA',
|
|
68
|
+
secretAccessKey: 'OG2qS0Usg4wyjPWbfv1ahPZzP80/w8z4i8MYHl+e',
|
|
69
|
+
bucketName: 'operato-sftp'
|
|
49
70
|
},
|
|
50
|
-
|
|
71
|
+
// storage: {
|
|
72
|
+
// type: 's3',
|
|
73
|
+
// accessKeyId: 'AKIAUQEOPWEJCDH6AR5H',
|
|
74
|
+
// secretAccessKey: 'AuDAgmODf9EJNB24OveRhTSLV/OJy6IFFoRxe8k2',
|
|
75
|
+
// bucketName: 'opa-one',
|
|
76
|
+
// region: 'ap-southeast-1'
|
|
77
|
+
// },
|
|
78
|
+
uploads: 'uploads',
|
|
79
|
+
attachmentsPath: 'attachments',
|
|
51
80
|
SECRET: '0xD58F835B69D207A76CC5F84a70a1D0d4C79dfC95',
|
|
52
|
-
|
|
81
|
+
logger: {
|
|
82
|
+
file: {
|
|
83
|
+
filename: 'logs/application-%DATE%.log',
|
|
84
|
+
datePattern: 'YYYY-MM-DD-HH',
|
|
85
|
+
zippedArchive: true,
|
|
86
|
+
maxSize: '200m',
|
|
87
|
+
maxFiles: '1m',
|
|
88
|
+
level: 'info'
|
|
89
|
+
}
|
|
90
|
+
},
|
|
53
91
|
email: {
|
|
54
92
|
host: 'smtp.office365.com',
|
|
55
93
|
port: 587,
|
|
56
94
|
secure: false, // true for 465, false for other ports
|
|
57
95
|
auth: {
|
|
58
|
-
user: '
|
|
96
|
+
user: 'noreply@hatiolab.com', // generated ethereal user
|
|
59
97
|
pass: 'h@ti0LAB1008' // generated ethereal password
|
|
60
98
|
},
|
|
61
99
|
secureConnection: false,
|
|
62
100
|
tls: {
|
|
63
101
|
ciphers: 'SSLv3'
|
|
64
|
-
}
|
|
65
|
-
sender: 'no-reply@hatiolab.com'
|
|
102
|
+
}
|
|
66
103
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
104
|
+
sender: 'noreply@hatiolab.com',
|
|
105
|
+
notification: {
|
|
106
|
+
// fcm: {
|
|
107
|
+
// serviceAccount: {
|
|
108
|
+
// project_id: 'operato',
|
|
109
|
+
// private_key:
|
|
110
|
+
// '-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDYNOfyNjPMSeG9\nzU1qs0cpVK5cVfadcUaw5g+hkQZMOMlAA7uqW2eX4vkayj7MzbYUayH+sei8044Q\nJIyl6f26dNX1VT3UgTmSmCS0v48EBEZHCgusrUGFjduLRN6OS6uvrXW1xKA18k9q\nai1C2EHCXF2AE4PTvf239RC1UIOnVePcMtT7rMTdHRO4s8OKVuSDbzIt8k1cV3Zt\nES0YsJlkELqBisYpV//2/ZSILTt39J9JzrVef03X9kkoo9p+YnNyy6tWsfQPfgJO\nybiRGBNxiyJ/E2pxRo/WqU0go9OzYJlGaSUrUx09heNiRD1b0MAOmyPDJz/6AaTk\nkU/A+kLzAgMBAAECggEADQ5s2gtR53VSujk1V/Xe8e0Di99DwaWUj5w6YhcK7/wX\nPdQRN4Fw6RLeLjL7xeG/rCNSwzm6hKSrQJL5zLnWW7XbMdyQRk6jdmnVAEv3zACi\nFH9+eFK3e+Q214XfgWz/v4p/FZdRLCYni5VBNHcwyWxLLS/V1ynzB3KM1sDiTRmI\npcT7+uTtwrKgJq64sXtFE2pYrFxDdCiyqzkhv/2ed4YIowAjpKBbbcCDKeVxVkoz\nC1P4PAzs9EeUuKSWYrWaUjN17lqtRlYeT1ylR1PIJuWqd4cKfgoEgz+lHwRPDCEX\nAYbk3nofiJIPBhSfCHrXS755wK48mY8vMwFdfCPJeQKBgQDsz4tjYTHdat5A25n5\nekwMxZwFQ5OvMV4eulwZUDMypTAYSz1iB6sDlgwKDm5omZIfuneqCEIvrqxV/kx3\n5wV/DANHO3hYxdp/NV7rM23xmqlaKZhHQbDono1Fm/LP6DEmJiD7N2eFKsXYcPpR\nSAIdCv0X3zkDQ4zRi51yJlCXzQKBgQDpufJBxCoXngiQJ2j14lWVAeOOdQ6zh5Ip\nBcDwF0X67cNSN3Wl40bS4yLFdolhEAyj5m0WPuYYXpjzhHhZ0W3V3ItdBkrmwIvy\nWOWu26qN0ZbwxVS2qVpHuj6iHWJKHuDZZUkFtJg3BeeBSOUHSA8TvjnA0xd83xeb\n8ZJasWoFvwKBgQDFs/gQ/gIdcq0exLfluh5nw0qgcmyHpNWJHdjqITS9IX/nqFkU\n0IYLtmdStf2jQiLmbkydHcvz9wZVvLqml67VBHhwLcwpgPULoskd34/4V0Dvzy4c\nv1Esw8H5zVqIDLeLu+VpFjZMzQrjyl6RIWbyTExEc84rVWfpQYAu3qIGOQKBgAFr\nXatEk7TdAtRNSPflTfu/rTAaSeKROjQBkvBiU8x4US1YpOBDBxUUyAtG8wKh5FHC\nfnsaGq+fM3KXJVv2R6J62mXQOfg4xyDLpWlwcBK4aSBBMoiBcsjouqSlZQlqMpdf\nZBgixqHe6U8BsFJg/6ZxC0y+e3AIss4Bo4/lb+1lAoGAFOexvaBh21K6W3inmRW4\nLlkVYJaBJ20OwokXg5aXjBiHxqmk7VLAuFbkpb5LOKH2xPILRQ0OEkn51yVymS3T\n9lLpHOFTQXt5tF2/F7NW7kaQJNlLr/h5jPi3O9XHeFmuaN2z150ZB6zzgjeGKzr8\ni+1fgTsRfDtNw8xkSH9qL1Y=\n-----END PRIVATE KEY-----\n',
|
|
111
|
+
// client_email: 'firebase-adminsdk-xmm2e@operato.iam.gserviceaccount.com'
|
|
112
|
+
// },
|
|
113
|
+
// appConfig: {
|
|
114
|
+
// apiKey: 'AIzaSyDdTM2BTLHSt2LNS0G5QB8G0i4KBXFiG7U',
|
|
115
|
+
// projectId: 'operato',
|
|
116
|
+
// messagingSenderId: 79537064975,
|
|
117
|
+
// appId: '1:79537064975:web:32f53119e9c8c6ee2a277a'
|
|
118
|
+
// },
|
|
119
|
+
// serverKey:
|
|
120
|
+
// 'AAAAEoTHTA8:APA91bGwt-4HT82Dfwf_VwbQaKT0_qHd0Y3tuW41udjWz5Lz0Ko0mEMD6WbHHSILvQpa6yuoGGKCMsrU7VW2qWRrUm3CYpyG9oSwshNm1tIhljAnOuUfwHCoawbVLwf9qlWpHt4dwCoc'
|
|
121
|
+
// },
|
|
122
|
+
// vapidKey: {
|
|
123
|
+
// subject: 'mailto:heartyoh@hatiolab.com',
|
|
124
|
+
// publicKey: 'BAkVkITsCXBIsYL1yeaBmx5_dn57we-ZXMjirPPHzC2dan82cdEnAio_53PQ-1_w3ykWCBPrrFAWQ_d9N4cFF0o',
|
|
125
|
+
// privateKey: '4pmlt3Wk019u7nqU3Q_oGZE6LbUDjjf8DpmAcn9-iss'
|
|
126
|
+
// }
|
|
71
127
|
},
|
|
72
|
-
attachmentsPath: 'attachment',
|
|
73
128
|
fulfillmentIntegrationOperato: {
|
|
74
|
-
host: 'operato.com:3000',
|
|
129
|
+
host: 'operato-h.com:3000',
|
|
75
130
|
protocol: 'http',
|
|
76
131
|
platform: 'operato',
|
|
77
132
|
application: 'Operato MMS',
|
|
78
133
|
appKey: 'a9bf751e622bf146662b240d58971051',
|
|
79
134
|
appSecret: '1c385935dc131c4b902b9bbf6a4798af',
|
|
80
|
-
|
|
81
|
-
callback: 'http://operato.com:9000/callback-operato'
|
|
82
|
-
},
|
|
83
|
-
fulfillmentIntegrationOperatoSftp: {
|
|
84
|
-
host: 'operato.com:3000',
|
|
85
|
-
protocol: 'http',
|
|
86
|
-
platform: 'operato',
|
|
87
|
-
application: 'Operato SFTP',
|
|
88
|
-
appKey: 'd3ebaf18121947931b5902d78adc9a98',
|
|
89
|
-
appSecret: '41e5591dd6597a75ae5d54603494525b',
|
|
90
|
-
type: 'SFTP',
|
|
91
|
-
callback: 'http://operato.com:9000/callback-operato'
|
|
135
|
+
callback: 'http://operato-retail.com:5000/callback-operato'
|
|
92
136
|
},
|
|
93
137
|
marketplaceIntegrationShopee: {
|
|
94
138
|
platform: 'shopee',
|
|
95
139
|
isUAT: false,
|
|
96
140
|
application: 'Operato MMS',
|
|
97
141
|
partnerId: 846025,
|
|
98
|
-
partnerKey: 'd34cfd85a603f196a0d74ebe08043280c1a27788bb36bdffd61e7e0bb1c90b64'
|
|
99
|
-
v2: true
|
|
142
|
+
partnerKey: 'd34cfd85a603f196a0d74ebe08043280c1a27788bb36bdffd61e7e0bb1c90b64'
|
|
100
143
|
},
|
|
101
|
-
// marketplaceIntegrationShopee: {
|
|
102
|
-
// platform: 'shopee',
|
|
103
|
-
// isUAT: false,
|
|
104
|
-
// application: 'Staging MMS',
|
|
105
|
-
// partnerId: 845525,
|
|
106
|
-
// partnerKey: '4a3f4214fd0f0bda970b342a99b6f8705fc7bacad2743cffa7ed67b79840665e'
|
|
107
|
-
// },
|
|
108
144
|
marketplaceIntegrationLazada: {
|
|
109
145
|
platform: 'lazada',
|
|
110
146
|
application: 'operato-mms',
|
|
@@ -112,19 +148,12 @@ module.exports = {
|
|
|
112
148
|
appSecret: 'HB3RTNEXHlVSlBr9SmWF8AjbSUT7a825',
|
|
113
149
|
callback: 'https://maybank.operato-m.com/lazada-callback'
|
|
114
150
|
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
apiKey: 'Et0KqtLvA6e92bDvOywy9eCCud4hpAal8akpqI90'
|
|
123
|
-
},
|
|
124
|
-
sftpFileStorage: {
|
|
125
|
-
type: 's3',
|
|
126
|
-
accessKeyId: 'AKIAUQEOPWEJKL43OMZA',
|
|
127
|
-
secretAccessKey: 'OG2qS0Usg4wyjPWbfv1ahPZzP80/w8z4i8MYHl+e',
|
|
128
|
-
bucketName: 'operato-sftp'
|
|
151
|
+
accountingIntegrationXero: {
|
|
152
|
+
platform: 'xero',
|
|
153
|
+
application: 'Operato WMS',
|
|
154
|
+
apiKey: '6B12D1AAC05347DC92159C2AEC812859',
|
|
155
|
+
apiSecret: 'T139_ItMjObC82mmy7iwnNflhd2iV0kUvDBj0P_201EmA7Sj',
|
|
156
|
+
callback: 'http://operato-h.com:3000/callback-xero',
|
|
157
|
+
hostname: 'http://operato-h.com:3000/'
|
|
129
158
|
}
|
|
130
159
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-company.js","sourceRoot":"","sources":["../../../../server/routers/internal/apis/create-company.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AACtD,uDAA4D;AAC5D,iDAA8C;AAC9C,iDAA+C;AAE/C,kFAAgF;AAChF,oDAA8C;AAEvC,KAAK,UAAU,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;IACtD,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GACvG,OAAO,CAAC,IAAI,CAAA;IAEd,IAAI,SAAS,GAAS,MAAM,EAAE;SAC3B,aAAa,CAAC,gBAAI,CAAC;SACnB,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IAE5E,MAAM,SAAS,GAAG,IAAA,eAAO,EAAC,IAAI,CAAC,CAAA;IAE/B,4BAA4B;IAC5B,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;QACzD,KAAK,EAAE;YACL,YAAY;SACb;KACF,CAAC,CAAA;IAEF,IAAI,UAAU,EAAE;QACd,MAAM,IAAI,qBAAQ,CAAC,KAAK,EAAE,GAAG,IAAI,gBAAgB,CAAC,CAAA;KACnD;IAED,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,cAAM,CAAC,CAAC,OAAO,CAAC;QACvD,KAAK,EA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,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;QACpC,MAAM,EAAE,EAAE;QACV,aAAa,EAAE,YAAY,IAAI,IAAI;QACnC,MAAM;QACN,OAAO;KACR,CAAC,CAAA;IAEF,IAAI,IAAI,GAAG;QACT,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,IAAI,EAAE,OAAO,CAAC,IAAI;KACnB,CAAA;IAED,OAAO,IAAI,CAAA;AACb,CAAC;
|
|
1
|
+
{"version":3,"file":"create-company.js","sourceRoot":"","sources":["../../../../server/routers/internal/apis/create-company.ts"],"names":[],"mappings":";;;AAAA,yDAAsD;AACtD,uDAA4D;AAC5D,iDAA8C;AAC9C,iDAA+C;AAE/C,kFAAgF;AAChF,oDAA8C;AAEvC,KAAK,UAAU,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;IACtD,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GACvG,OAAO,CAAC,IAAI,CAAA;IAEd,IAAI,SAAS,GAAS,MAAM,EAAE;SAC3B,aAAa,CAAC,gBAAI,CAAC;SACnB,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC,CAAA;IAE5E,MAAM,SAAS,GAAG,IAAA,eAAO,EAAC,IAAI,CAAC,CAAA;IAE/B,4BAA4B;IAC5B,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,CAAC,OAAO,CAAC;QACzD,KAAK,EAAE;YACL,YAAY;SACb;KACF,CAAC,CAAA;IAEF,IAAI,UAAU,EAAE;QACd,MAAM,IAAI,qBAAQ,CA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AM,EAAE,CAAC,aAAa,CAAC,gBAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAC5C,MAAM,EAAE,CAAC,aAAa,CAAC,mBAAQ,CAAC,CAAC,IAAI,CAAC;QACpC,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;QACpC,MAAM,EAAE,EAAE;QACV,aAAa,EAAE,YAAY,IAAI,IAAI;QACnC,MAAM;QACN,OAAO;KACR,CAAC,CAAA;IAEF,IAAI,IAAI,GAAG;QACT,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,IAAI,EAAE,OAAO,CAAC,IAAI;KACnB,CAAA;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAhFD,sCAgFC"}
|
|
@@ -29,8 +29,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.powrupRouter = void 0;
|
|
30
30
|
const koa_router_1 = __importDefault(require("koa-router"));
|
|
31
31
|
const typeorm_1 = require("typeorm");
|
|
32
|
-
const biz_base_1 = require("@things-factory/biz-base");
|
|
33
32
|
const integration_base_1 = require("@things-factory/integration-base");
|
|
33
|
+
const shell_1 = require("@things-factory/shell");
|
|
34
34
|
const API = __importStar(require("./apis"));
|
|
35
35
|
const validation_middleware_1 = require("./middlewares/validation-middleware");
|
|
36
36
|
const error_util_1 = require("./utils/error-util");
|
|
@@ -40,7 +40,7 @@ exports.powrupRouter.post('/internal/account/create-user', validation_middleware
|
|
|
40
40
|
try {
|
|
41
41
|
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
42
42
|
const { body } = context.request;
|
|
43
|
-
await getIntegration(context, tx);
|
|
43
|
+
await getIntegration(context, null, tx);
|
|
44
44
|
let data = await API.createUser(body, context, tx);
|
|
45
45
|
context.body = {
|
|
46
46
|
result: { data }
|
|
@@ -58,7 +58,7 @@ exports.powrupRouter.post('/internal/account/update-user', validation_middleware
|
|
|
58
58
|
try {
|
|
59
59
|
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
60
60
|
const { body } = context.request;
|
|
61
|
-
await getIntegration(context, tx);
|
|
61
|
+
await getIntegration(context, null, tx);
|
|
62
62
|
let data = await API.updateUser(body, context, tx);
|
|
63
63
|
context.body = {
|
|
64
64
|
result: { data }
|
|
@@ -76,7 +76,7 @@ exports.powrupRouter.post('/internal/account/create-company', validation_middlew
|
|
|
76
76
|
try {
|
|
77
77
|
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
78
78
|
const { body } = context.request;
|
|
79
|
-
await getIntegration(context, tx);
|
|
79
|
+
await getIntegration(context, null, tx);
|
|
80
80
|
let data = await API.createCompany(body, context, tx);
|
|
81
81
|
context.body = {
|
|
82
82
|
result: { data }
|
|
@@ -111,7 +111,7 @@ exports.powrupRouter.post('/internal/account/create-bizplace', validation_middle
|
|
|
111
111
|
try {
|
|
112
112
|
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
113
113
|
const { body } = context.request;
|
|
114
|
-
await getIntegration(context, tx);
|
|
114
|
+
await getIntegration(context, null, tx);
|
|
115
115
|
let data = await API.createBizplace(body, context, tx);
|
|
116
116
|
context.body = {
|
|
117
117
|
result: { data }
|
|
@@ -129,7 +129,7 @@ exports.powrupRouter.post('/internal/account/update-bizplace', validation_middle
|
|
|
129
129
|
try {
|
|
130
130
|
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
131
131
|
const { body } = context.request;
|
|
132
|
-
await getIntegration(context, tx);
|
|
132
|
+
await getIntegration(context, null, tx);
|
|
133
133
|
let data = await API.updateBizplace(body, context, tx);
|
|
134
134
|
context.body = {
|
|
135
135
|
result: { data }
|
|
@@ -147,7 +147,7 @@ exports.powrupRouter.post('/internal/account/create-partner', validation_middlew
|
|
|
147
147
|
try {
|
|
148
148
|
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
149
149
|
const { body } = context.request;
|
|
150
|
-
await getIntegration(context, tx);
|
|
150
|
+
await getIntegration(context, null, tx);
|
|
151
151
|
let data = await API.createPartner(body, context, tx);
|
|
152
152
|
context.body = {
|
|
153
153
|
result: { data }
|
|
@@ -165,7 +165,7 @@ exports.powrupRouter.post('/internal/account/terminate-partner', validation_midd
|
|
|
165
165
|
try {
|
|
166
166
|
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
167
167
|
const { body } = context.request;
|
|
168
|
-
await getIntegration(context, tx);
|
|
168
|
+
await getIntegration(context, null, tx);
|
|
169
169
|
let data = await API.terminatePartner(body, context, tx);
|
|
170
170
|
context.body = {
|
|
171
171
|
result: { data }
|
|
@@ -183,7 +183,7 @@ exports.powrupRouter.post('/internal/account/invite-user', validation_middleware
|
|
|
183
183
|
try {
|
|
184
184
|
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
185
185
|
const { body } = context.request;
|
|
186
|
-
await getIntegration(context, tx);
|
|
186
|
+
await getIntegration(context, null, tx);
|
|
187
187
|
let data = await API.inviteUser(body, context, tx);
|
|
188
188
|
context.body = {
|
|
189
189
|
result: { data }
|
|
@@ -201,7 +201,7 @@ exports.powrupRouter.post('/internal/account/terminate-user', validation_middlew
|
|
|
201
201
|
try {
|
|
202
202
|
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
203
203
|
const { body } = context.request;
|
|
204
|
-
await getIntegration(context, tx);
|
|
204
|
+
await getIntegration(context, null, tx);
|
|
205
205
|
let data = await API.terminateUser(body, context, tx);
|
|
206
206
|
context.body = {
|
|
207
207
|
result: { data }
|
|
@@ -215,65 +215,24 @@ exports.powrupRouter.post('/internal/account/terminate-user', validation_middlew
|
|
|
215
215
|
(0, error_util_1.throwInternalServerError)(context, e);
|
|
216
216
|
}
|
|
217
217
|
});
|
|
218
|
-
exports.powrupRouter.
|
|
218
|
+
exports.powrupRouter.get('/warehouse/get', async (context, next) => {
|
|
219
219
|
try {
|
|
220
220
|
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
221
|
-
const {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
.getRepository(biz_base_1.Bizplace)
|
|
225
|
-
.findOne({ where: { id: bizplaceId }, relations: ['domain'] });
|
|
226
|
-
if (!bizplace) {
|
|
227
|
-
throw new error_util_1.ApiError('E04', `${bizplaceId} not found`);
|
|
221
|
+
const { apiKey, subdomain } = context.query;
|
|
222
|
+
if (!apiKey) {
|
|
223
|
+
throw new error_util_1.ApiError('E01', apiKey);
|
|
228
224
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
.
|
|
232
|
-
if (existingIntegration) {
|
|
233
|
-
throw new error_util_1.ApiError('E04', `${name} already exist`);
|
|
225
|
+
await getIntegration(context, apiKey, tx);
|
|
226
|
+
if (!subdomain) {
|
|
227
|
+
throw new error_util_1.ApiError('E01', subdomain);
|
|
234
228
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
platform: 'powrup',
|
|
239
|
-
active: true,
|
|
240
|
-
domain: bizplace.domain
|
|
241
|
-
};
|
|
242
|
-
let createdIntegration = await tx.getRepository(integration_base_1.Integration).create(integration);
|
|
243
|
-
let data = {
|
|
244
|
-
id: createdIntegration.id,
|
|
245
|
-
name: createdIntegration.name
|
|
246
|
-
};
|
|
247
|
-
context.body = {
|
|
248
|
-
result: { data }
|
|
249
|
-
};
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
catch (e) {
|
|
253
|
-
if (e instanceof error_util_1.ApiError)
|
|
254
|
-
(0, error_util_1.ApiErrorHandler)(context, e);
|
|
255
|
-
else
|
|
256
|
-
(0, error_util_1.throwInternalServerError)(context, e);
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
exports.powrupRouter.post('/integration/update', validation_middleware_1.validationMiddleware, async (context, next) => {
|
|
260
|
-
try {
|
|
261
|
-
await (0, typeorm_1.getConnection)().transaction(async (tx) => {
|
|
262
|
-
const { body } = context.request;
|
|
263
|
-
const { id, name, description, active } = body;
|
|
264
|
-
let existingIntegration = await tx.getRepository(integration_base_1.Integration).findOne(id);
|
|
265
|
-
if (!existingIntegration) {
|
|
266
|
-
throw new error_util_1.ApiError('E04', `${id} not found`);
|
|
229
|
+
const domain = await tx.getRepository(shell_1.Domain).findOne({ where: { subdomain } });
|
|
230
|
+
if (!domain) {
|
|
231
|
+
throw new error_util_1.ApiError('E04', `${subdomain} not found`);
|
|
267
232
|
}
|
|
268
|
-
await tx.getRepository(integration_base_1.Integration).update({ id: existingIntegration.id }, {
|
|
269
|
-
name: name || existingIntegration.name,
|
|
270
|
-
description: description || existingIntegration.description,
|
|
271
|
-
active: active || existingIntegration.active
|
|
272
|
-
});
|
|
273
|
-
let updatedIntegration = await tx.getRepository(integration_base_1.Integration).findOne(existingIntegration.id);
|
|
274
233
|
let data = {
|
|
275
|
-
id:
|
|
276
|
-
name:
|
|
234
|
+
id: domain.id,
|
|
235
|
+
name: domain.name
|
|
277
236
|
};
|
|
278
237
|
context.body = {
|
|
279
238
|
result: { data }
|
|
@@ -287,9 +246,9 @@ exports.powrupRouter.post('/integration/update', validation_middleware_1.validat
|
|
|
287
246
|
(0, error_util_1.throwInternalServerError)(context, e);
|
|
288
247
|
}
|
|
289
248
|
});
|
|
290
|
-
async function getIntegration(context, tx) {
|
|
249
|
+
async function getIntegration(context, apiKey, tx) {
|
|
291
250
|
const integration = await tx.getRepository(integration_base_1.Integration).findOne({
|
|
292
|
-
where: { name: context.request.body.apiKey }
|
|
251
|
+
where: { name: apiKey || context.request.body.apiKey }
|
|
293
252
|
});
|
|
294
253
|
if (integration) {
|
|
295
254
|
context.state.integration = integration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powrup-router.js","sourceRoot":"","sources":["../../../server/routers/internal/powrup-router.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA+B;AAC/B,qCAAsD;AAEtD,
|
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D,IAAA,qCAAwB,EAAC,OAAO,EAAE,CAAC,CAAC,CAAA;KAC1C;AACH,CAAC,CAAC,CAAA;AAEF,KAAK,UAAU,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAC/C,MAAM,WAAW,GAAgB,MAAM,EAAE,CAAC,aAAa,CAAC,8BAAW,CAAC,CAAC,OAAO,CAAC;QAC3E,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE;KACvD,CAAC,CAAA;IAEF,IAAI,WAAW,EAAE;QACf,OAAO,CAAC,KAAK,CAAC,WAAW,GAAG,WAAW,CAAA;KACxC;SAAM;QACL,MAAM,IAAI,qBAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;KACpC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-hub",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.235",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -55,43 +55,43 @@
|
|
|
55
55
|
"@operato/scene-tab": "^0.1.8",
|
|
56
56
|
"@operato/scene-table": "^0.1.8",
|
|
57
57
|
"@operato/scene-wheel-sorter": "^0.1.8",
|
|
58
|
-
"@things-factory/api": "^4.3.
|
|
58
|
+
"@things-factory/api": "^4.3.234",
|
|
59
59
|
"@things-factory/apptool-ui": "^4.3.227",
|
|
60
|
-
"@things-factory/attachment-base": "^4.3.
|
|
61
|
-
"@things-factory/auth-base": "^4.3.
|
|
62
|
-
"@things-factory/auth-ui": "^4.3.
|
|
63
|
-
"@things-factory/biz-base": "^4.3.
|
|
64
|
-
"@things-factory/biz-ui": "^4.3.
|
|
65
|
-
"@things-factory/board-service": "^4.3.
|
|
66
|
-
"@things-factory/board-ui": "^4.3.
|
|
67
|
-
"@things-factory/code-ui": "^4.3.
|
|
60
|
+
"@things-factory/attachment-base": "^4.3.234",
|
|
61
|
+
"@things-factory/auth-base": "^4.3.234",
|
|
62
|
+
"@things-factory/auth-ui": "^4.3.234",
|
|
63
|
+
"@things-factory/biz-base": "^4.3.234",
|
|
64
|
+
"@things-factory/biz-ui": "^4.3.234",
|
|
65
|
+
"@things-factory/board-service": "^4.3.234",
|
|
66
|
+
"@things-factory/board-ui": "^4.3.234",
|
|
67
|
+
"@things-factory/code-ui": "^4.3.234",
|
|
68
68
|
"@things-factory/component-ui": "^4.3.227",
|
|
69
69
|
"@things-factory/context-ui": "^4.3.227",
|
|
70
|
-
"@things-factory/document-template-ui": "^4.3.
|
|
70
|
+
"@things-factory/document-template-ui": "^4.3.234",
|
|
71
71
|
"@things-factory/export-ui": "^4.3.227",
|
|
72
72
|
"@things-factory/export-ui-csv": "^4.3.227",
|
|
73
73
|
"@things-factory/export-ui-excel": "^4.3.227",
|
|
74
|
-
"@things-factory/geography": "^4.3.
|
|
74
|
+
"@things-factory/geography": "^4.3.234",
|
|
75
75
|
"@things-factory/grist-ui": "^4.3.227",
|
|
76
76
|
"@things-factory/help": "^4.3.227",
|
|
77
77
|
"@things-factory/i18n-base": "^4.3.227",
|
|
78
78
|
"@things-factory/import-ui": "^4.3.227",
|
|
79
79
|
"@things-factory/import-ui-excel": "^4.3.227",
|
|
80
|
-
"@things-factory/integration-accounting": "^4.3.
|
|
81
|
-
"@things-factory/integration-fulfillment": "^4.3.
|
|
82
|
-
"@things-factory/integration-lmd": "^4.3.
|
|
83
|
-
"@things-factory/integration-marketplace": "^4.3.
|
|
84
|
-
"@things-factory/integration-pos": "^4.3.
|
|
85
|
-
"@things-factory/integration-sellercraft": "^4.3.
|
|
86
|
-
"@things-factory/integration-sftp": "^4.3.
|
|
87
|
-
"@things-factory/lite-menu": "^4.3.
|
|
88
|
-
"@things-factory/marketplace-base": "^4.3.
|
|
80
|
+
"@things-factory/integration-accounting": "^4.3.234",
|
|
81
|
+
"@things-factory/integration-fulfillment": "^4.3.234",
|
|
82
|
+
"@things-factory/integration-lmd": "^4.3.234",
|
|
83
|
+
"@things-factory/integration-marketplace": "^4.3.234",
|
|
84
|
+
"@things-factory/integration-pos": "^4.3.234",
|
|
85
|
+
"@things-factory/integration-sellercraft": "^4.3.234",
|
|
86
|
+
"@things-factory/integration-sftp": "^4.3.234",
|
|
87
|
+
"@things-factory/lite-menu": "^4.3.234",
|
|
88
|
+
"@things-factory/marketplace-base": "^4.3.234",
|
|
89
89
|
"@things-factory/more-ui": "^4.3.227",
|
|
90
|
-
"@things-factory/notification": "^4.3.
|
|
90
|
+
"@things-factory/notification": "^4.3.234",
|
|
91
91
|
"@things-factory/pdf": "^4.3.227",
|
|
92
|
-
"@things-factory/product-ui": "^4.3.
|
|
93
|
-
"@things-factory/resource-ui": "^4.3.
|
|
94
|
-
"@things-factory/sales-base": "^4.3.
|
|
92
|
+
"@things-factory/product-ui": "^4.3.234",
|
|
93
|
+
"@things-factory/resource-ui": "^4.3.234",
|
|
94
|
+
"@things-factory/sales-base": "^4.3.234",
|
|
95
95
|
"@things-factory/scene-data-transform": "^4.3.227",
|
|
96
96
|
"@things-factory/scene-excel": "^4.3.227",
|
|
97
97
|
"@things-factory/scene-firebase": "^4.3.227",
|
|
@@ -103,11 +103,11 @@
|
|
|
103
103
|
"@things-factory/scene-mqtt": "^4.3.227",
|
|
104
104
|
"@things-factory/scene-restful": "^4.3.227",
|
|
105
105
|
"@things-factory/scene-visualizer": "^4.3.227",
|
|
106
|
-
"@things-factory/setting-ui": "^4.3.
|
|
106
|
+
"@things-factory/setting-ui": "^4.3.234",
|
|
107
107
|
"@things-factory/shell": "^4.3.227",
|
|
108
108
|
"@things-factory/system-ui": "^4.3.227",
|
|
109
|
-
"@things-factory/warehouse-base": "^4.3.
|
|
110
|
-
"@things-factory/worksheet-base": "^4.3.
|
|
109
|
+
"@things-factory/warehouse-base": "^4.3.234",
|
|
110
|
+
"@things-factory/worksheet-base": "^4.3.235",
|
|
111
111
|
"cron-parser": "^4.7.0",
|
|
112
112
|
"koa2-swagger-ui": "^5.0.2",
|
|
113
113
|
"swagger-jsdoc": "^5.0.0",
|
|
@@ -119,5 +119,5 @@
|
|
|
119
119
|
"resolutions": {
|
|
120
120
|
"core-js": "^3.16.0"
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "76d957b60aa3ade7db5bb563a723f59d81548c75"
|
|
123
123
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Router from 'koa-router'
|
|
2
2
|
import { EntityManager, getConnection } from 'typeorm'
|
|
3
3
|
|
|
4
|
-
import { Bizplace } from '@things-factory/biz-base'
|
|
5
4
|
import { Integration } from '@things-factory/integration-base'
|
|
5
|
+
import { Domain } from '@things-factory/shell'
|
|
6
6
|
|
|
7
7
|
import * as API from './apis'
|
|
8
8
|
import { validationMiddleware } from './middlewares/validation-middleware'
|
|
@@ -17,7 +17,7 @@ powrupRouter.post('/internal/account/create-user', validationMiddleware, async (
|
|
|
17
17
|
await getConnection().transaction(async (tx: EntityManager) => {
|
|
18
18
|
const { body } = context.request
|
|
19
19
|
|
|
20
|
-
await getIntegration(context, tx)
|
|
20
|
+
await getIntegration(context, null, tx)
|
|
21
21
|
|
|
22
22
|
let data = await API.createUser(body, context, tx)
|
|
23
23
|
|
|
@@ -36,7 +36,7 @@ powrupRouter.post('/internal/account/update-user', validationMiddleware, async (
|
|
|
36
36
|
await getConnection().transaction(async (tx: EntityManager) => {
|
|
37
37
|
const { body } = context.request
|
|
38
38
|
|
|
39
|
-
await getIntegration(context, tx)
|
|
39
|
+
await getIntegration(context, null, tx)
|
|
40
40
|
|
|
41
41
|
let data = await API.updateUser(body, context, tx)
|
|
42
42
|
|
|
@@ -55,7 +55,7 @@ powrupRouter.post('/internal/account/create-company', validationMiddleware, asyn
|
|
|
55
55
|
await getConnection().transaction(async (tx: EntityManager) => {
|
|
56
56
|
const { body } = context.request
|
|
57
57
|
|
|
58
|
-
await getIntegration(context, tx)
|
|
58
|
+
await getIntegration(context, null, tx)
|
|
59
59
|
|
|
60
60
|
let data = await API.createCompany(body, context, tx)
|
|
61
61
|
|
|
@@ -91,7 +91,7 @@ powrupRouter.post('/internal/account/create-bizplace', validationMiddleware, asy
|
|
|
91
91
|
await getConnection().transaction(async (tx: EntityManager) => {
|
|
92
92
|
const { body } = context.request
|
|
93
93
|
|
|
94
|
-
await getIntegration(context, tx)
|
|
94
|
+
await getIntegration(context, null, tx)
|
|
95
95
|
|
|
96
96
|
let data = await API.createBizplace(body, context, tx)
|
|
97
97
|
|
|
@@ -110,7 +110,7 @@ powrupRouter.post('/internal/account/update-bizplace', validationMiddleware, asy
|
|
|
110
110
|
await getConnection().transaction(async (tx: EntityManager) => {
|
|
111
111
|
const { body } = context.request
|
|
112
112
|
|
|
113
|
-
await getIntegration(context, tx)
|
|
113
|
+
await getIntegration(context, null, tx)
|
|
114
114
|
|
|
115
115
|
let data = await API.updateBizplace(body, context, tx)
|
|
116
116
|
|
|
@@ -128,7 +128,7 @@ powrupRouter.post('/internal/account/create-partner', validationMiddleware, asyn
|
|
|
128
128
|
try {
|
|
129
129
|
await getConnection().transaction(async (tx: EntityManager) => {
|
|
130
130
|
const { body } = context.request
|
|
131
|
-
await getIntegration(context, tx)
|
|
131
|
+
await getIntegration(context, null, tx)
|
|
132
132
|
|
|
133
133
|
let data = await API.createPartner(body, context, tx)
|
|
134
134
|
|
|
@@ -146,7 +146,7 @@ powrupRouter.post('/internal/account/terminate-partner', validationMiddleware, a
|
|
|
146
146
|
try {
|
|
147
147
|
await getConnection().transaction(async (tx: EntityManager) => {
|
|
148
148
|
const { body } = context.request
|
|
149
|
-
await getIntegration(context, tx)
|
|
149
|
+
await getIntegration(context, null, tx)
|
|
150
150
|
|
|
151
151
|
let data = await API.terminatePartner(body, context, tx)
|
|
152
152
|
|
|
@@ -164,7 +164,7 @@ powrupRouter.post('/internal/account/invite-user', validationMiddleware, async (
|
|
|
164
164
|
try {
|
|
165
165
|
await getConnection().transaction(async (tx: EntityManager) => {
|
|
166
166
|
const { body } = context.request
|
|
167
|
-
await getIntegration(context, tx)
|
|
167
|
+
await getIntegration(context, null, tx)
|
|
168
168
|
|
|
169
169
|
let data = await API.inviteUser(body, context, tx)
|
|
170
170
|
|
|
@@ -182,7 +182,7 @@ powrupRouter.post('/internal/account/terminate-user', validationMiddleware, asyn
|
|
|
182
182
|
try {
|
|
183
183
|
await getConnection().transaction(async (tx: EntityManager) => {
|
|
184
184
|
const { body } = context.request
|
|
185
|
-
await getIntegration(context, tx)
|
|
185
|
+
await getIntegration(context, null, tx)
|
|
186
186
|
|
|
187
187
|
let data = await API.terminateUser(body, context, tx)
|
|
188
188
|
|
|
@@ -196,81 +196,30 @@ powrupRouter.post('/internal/account/terminate-user', validationMiddleware, asyn
|
|
|
196
196
|
}
|
|
197
197
|
})
|
|
198
198
|
|
|
199
|
-
powrupRouter.
|
|
199
|
+
powrupRouter.get('/warehouse/get', async (context, next) => {
|
|
200
200
|
try {
|
|
201
201
|
await getConnection().transaction(async (tx: EntityManager) => {
|
|
202
|
-
const {
|
|
203
|
-
|
|
204
|
-
const { bizplaceId, name, description } = body
|
|
202
|
+
const { apiKey, subdomain } = context.query
|
|
205
203
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
.findOne({ where: { id: bizplaceId }, relations: ['domain'] })
|
|
209
|
-
|
|
210
|
-
if (!bizplace) {
|
|
211
|
-
throw new ApiError('E04', `${bizplaceId} not found`)
|
|
204
|
+
if (!apiKey) {
|
|
205
|
+
throw new ApiError('E01', apiKey)
|
|
212
206
|
}
|
|
213
207
|
|
|
214
|
-
|
|
215
|
-
.getRepository(Integration)
|
|
216
|
-
.findOne({ where: { name, domain: bizplace.domain } })
|
|
217
|
-
|
|
218
|
-
if (existingIntegration) {
|
|
219
|
-
throw new ApiError('E04', `${name} already exist`)
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
let integration: Integration = {
|
|
223
|
-
name,
|
|
224
|
-
description,
|
|
225
|
-
platform: 'powrup',
|
|
226
|
-
active: true,
|
|
227
|
-
domain: bizplace.domain
|
|
228
|
-
}
|
|
208
|
+
await getIntegration(context, apiKey, tx)
|
|
229
209
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
let data = {
|
|
233
|
-
id: createdIntegration.id,
|
|
234
|
-
name: createdIntegration.name
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
context.body = {
|
|
238
|
-
result: { data }
|
|
210
|
+
if (!subdomain) {
|
|
211
|
+
throw new ApiError('E01', subdomain)
|
|
239
212
|
}
|
|
240
|
-
})
|
|
241
|
-
} catch (e) {
|
|
242
|
-
if (e instanceof ApiError) ApiErrorHandler(context, e)
|
|
243
|
-
else throwInternalServerError(context, e)
|
|
244
|
-
}
|
|
245
|
-
})
|
|
246
213
|
|
|
247
|
-
|
|
248
|
-
try {
|
|
249
|
-
await getConnection().transaction(async (tx: EntityManager) => {
|
|
250
|
-
const { body } = context.request
|
|
251
|
-
|
|
252
|
-
const { id, name, description, active } = body
|
|
214
|
+
const domain: Domain = await tx.getRepository(Domain).findOne({ where: { subdomain } })
|
|
253
215
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
if (!existingIntegration) {
|
|
257
|
-
throw new ApiError('E04', `${id} not found`)
|
|
216
|
+
if (!domain) {
|
|
217
|
+
throw new ApiError('E04', `${subdomain} not found`)
|
|
258
218
|
}
|
|
259
219
|
|
|
260
|
-
await tx.getRepository(Integration).update(
|
|
261
|
-
{ id: existingIntegration.id },
|
|
262
|
-
{
|
|
263
|
-
name: name || existingIntegration.name,
|
|
264
|
-
description: description || existingIntegration.description,
|
|
265
|
-
active: active || existingIntegration.active
|
|
266
|
-
}
|
|
267
|
-
)
|
|
268
|
-
|
|
269
|
-
let updatedIntegration: Integration = await tx.getRepository(Integration).findOne(existingIntegration.id)
|
|
270
|
-
|
|
271
220
|
let data = {
|
|
272
|
-
id:
|
|
273
|
-
name:
|
|
221
|
+
id: domain.id,
|
|
222
|
+
name: domain.name
|
|
274
223
|
}
|
|
275
224
|
|
|
276
225
|
context.body = {
|
|
@@ -283,9 +232,9 @@ powrupRouter.post('/integration/update', validationMiddleware, async (context, n
|
|
|
283
232
|
}
|
|
284
233
|
})
|
|
285
234
|
|
|
286
|
-
async function getIntegration(context, tx) {
|
|
235
|
+
async function getIntegration(context, apiKey, tx) {
|
|
287
236
|
const integration: Integration = await tx.getRepository(Integration).findOne({
|
|
288
|
-
where: { name: context.request.body.apiKey }
|
|
237
|
+
where: { name: apiKey || context.request.body.apiKey }
|
|
289
238
|
})
|
|
290
239
|
|
|
291
240
|
if (integration) {
|