@persei/perseed-api 4.34.4 → 4.34.5

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,6 +1,142 @@
1
- var s = /* @__PURE__ */ ((e) => (e.OUTCOMES = "outcomes", e))(s || {}), r = /* @__PURE__ */ ((e) => (e.VALUECARD = "ValueCard", e.SECTIONCARD = "SectionCard", e.PATIENTLIST = "PatientList", e))(r || {}), t = /* @__PURE__ */ ((e) => (e.QUESTIONNAIRE_CREATE = "questionnaire.create", e.CRF_CREATE = "crf.create", e.CRF_UPDATE = "crf.update", e.CRF_DELETE = "crf.delete", e))(t || {}), l = /* @__PURE__ */ ((e) => (e.JSON_LOGIC = "jsonLogic", e.CUSTOM = "custom", e))(l || {}), o = /* @__PURE__ */ ((e) => (e.CREATION = "creation", e.UPDATE = "update", e))(o || {}), a = /* @__PURE__ */ ((e) => (e.TEXT = "text", e.DATE = "date", e.TIME = "time", e.BOOLEAN = "boolean", e.NUMBER = "number", e.SELECT = "select", e.MULTISELECT = "multiselect", e))(a || {});
2
- function n(e) {
3
- return {
1
+ var c = /* @__PURE__ */ ((e) => (e.OUTCOMES = "outcomes", e))(c || {}), p = /* @__PURE__ */ ((e) => (e.VALUECARD = "ValueCard", e.SECTIONCARD = "SectionCard", e.PATIENTLIST = "PatientList", e))(p || {}), i = /* @__PURE__ */ ((e) => (e.QUESTIONNAIRE_CREATE = "questionnaire.create", e.CRF_CREATE = "crf.create", e.CRF_UPDATE = "crf.update", e.CRF_DELETE = "crf.delete", e.EXTERNAL_API_CALL = "external_api_call", e))(i || {}), d = /* @__PURE__ */ ((e) => (e.JSON_LOGIC = "jsonLogic", e.CUSTOM = "custom", e))(d || {}), m = /* @__PURE__ */ ((e) => (e.CREATION = "creation", e.UPDATE = "update", e))(m || {}), s = /* @__PURE__ */ ((e) => (e.TEXT = "text", e.DATE = "date", e.TIME = "time", e.BOOLEAN = "boolean", e.NUMBER = "number", e.SELECT = "select", e.MULTISELECT = "multiselect", e))(s || {});
2
+ const u = {}, E = {}, h = {}, T = {}, _ = {
3
+ hostName: "mysql",
4
+ ecosystem: {
5
+ demo: {
6
+ userLogin: {
7
+ username: "admin",
8
+ password: "Sebas3210",
9
+ deviceId: "abc123",
10
+ api: !0
11
+ }
12
+ },
13
+ reseaarch: {
14
+ userLogin: {
15
+ username: "testapi2",
16
+ password: "123456",
17
+ deviceId: "abc123",
18
+ api: !0
19
+ }
20
+ },
21
+ caaring: {
22
+ userLogin: {
23
+ username: "root",
24
+ password: "pass4mike",
25
+ deviceId: "abc123",
26
+ api: !0
27
+ }
28
+ },
29
+ ecoapi: {
30
+ userLogin: {
31
+ username: "root",
32
+ password: "123456",
33
+ deviceId: "abc123",
34
+ api: !0
35
+ }
36
+ },
37
+ clinicaal: {},
38
+ clitinerary: {}
39
+ },
40
+ global: {
41
+ dbCredentials: {
42
+ username: "root",
43
+ password: "root",
44
+ database: "perseed"
45
+ }
46
+ },
47
+ rabbitOptions: {
48
+ protocol: "amqp",
49
+ hostname: "localhost",
50
+ port: 5672,
51
+ username: "perseedweb00-dev",
52
+ password: "Z8rLHAkw",
53
+ locale: "en_US",
54
+ frameMax: 0,
55
+ heartbeat: 0,
56
+ vhost: "/"
57
+ },
58
+ AWS: {
59
+ accessKeyId: "AKIA4Z2DUBRURKXKII5S",
60
+ secretAccessKey: "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",
61
+ apiVersion: "latest",
62
+ tmpPath: "tmp/",
63
+ bucket: {
64
+ name: "testing.perseed-files-eu",
65
+ region: "eu-central-1"
66
+ },
67
+ cloudFront: {
68
+ keypairId: "K1BWQQVLE4YU4F",
69
+ privateKeyPath: "/var/www/perseed_api/config/private_key.pem",
70
+ assetsUrl: "https://test.assets.perseed.eu"
71
+ }
72
+ },
73
+ SMS: {
74
+ apiKey: "4|XildLvmjqzABeekAgj9EaLiwpxdGMWgassPaxewu",
75
+ defaultSender: "Caaring"
76
+ },
77
+ perseedAPI: {
78
+ caaring: {
79
+ username: "ecoadmin",
80
+ password: "1CarefulWithPersonalInfo2@",
81
+ deviceId: "ecoadmin@api"
82
+ },
83
+ clinicaal: {
84
+ username: "perseedapiCLI",
85
+ password: "Ukz4s7LL&Ne3KA#",
86
+ deviceId: "ecoadmin@api"
87
+ },
88
+ onqos: {
89
+ username: "perseedapiCLI",
90
+ password: "Ukz4s7LL&Ne3KA#",
91
+ deviceId: "ecoadmin@api"
92
+ },
93
+ demo: {
94
+ username: "admin",
95
+ password: "Sebas3210",
96
+ deviceId: "admin@api"
97
+ },
98
+ reseaarch: {
99
+ username: "ecoadmin",
100
+ password: "1CarefulWithPersonalInfo2@",
101
+ deviceId: "ecoadmin@api"
102
+ },
103
+ testrcr: {
104
+ username: "ecoadmin",
105
+ password: "1CarefulWithPersonalInfo2",
106
+ deviceId: "ecoadmin@api"
107
+ }
108
+ }
109
+ }, b = {}, o = {};
110
+ let n;
111
+ o.existsSync("./credentials/local.json") && (n = JSON.parse(o.readFileSync("./credentials/local.json").toString()));
112
+ const v = {
113
+ local: n || u,
114
+ local_tmp: E,
115
+ test: _,
116
+ testing: b,
117
+ preproduction: h,
118
+ production: T
119
+ };
120
+ function L(e) {
121
+ return e.replace(/\/$/, "");
122
+ }
123
+ const y = process.env.NODE_ENV || "local";
124
+ process.env.PROXY_FILES;
125
+ L(process.env.API_BASE_URL || "https://api.perseed.eu");
126
+ process.env.JWT_SECRET;
127
+ process.env.REFRESH_JWT_SECRET;
128
+ process.env.JWT_ISSUERS;
129
+ process.env.FULL_LOG;
130
+ (process.env.CSP_FRAME_ANCESTORS || "https://tmp.perseed.eu,https://tmp.api.perseed.eu,https://perseed.eu,https://api.perseed.eu,https://perseed.test,https://app.caaring.com,https://app.clinicaal.com,https://app.onqos.com,https://app.reseaarch.com,https://app.clitinerary.com").split(",");
131
+ process.env.ZERO_DATES_SUPPORT;
132
+ process.env.DEBUG_ERRORS ? process.env.DEBUG_ERRORS : process.env.NODE_ENV;
133
+ process.env.DEFAULT_TZ;
134
+ process.env.SENTRY_DSN;
135
+ parseInt(process.env.JOB_RETRIES ?? "5");
136
+ process.env.BODY_SIZE_LIMIT;
137
+ const O = v[y], a = O.externalApis;
138
+ function w(e) {
139
+ const r = {
4
140
  models: {
5
141
  user: {
6
142
  label: e("introspection-schema.models.user.label", "User"),
@@ -9,135 +145,140 @@ function n(e) {
9
145
  fields: [
10
146
  {
11
147
  name: "username",
12
- type: a.TEXT,
148
+ type: s.TEXT,
13
149
  label: e("introspection-schema.models.user.username", "Username")
14
150
  },
15
151
  {
16
152
  name: "created_user",
17
- type: a.TEXT,
153
+ type: s.TEXT,
18
154
  label: e("introspection-schema.models.user.created_user", "Created user")
19
155
  },
20
156
  {
21
157
  name: "created_mode",
22
- type: a.TEXT,
158
+ type: s.TEXT,
23
159
  label: e("introspection-schema.models.user.created_mode", "Created mode")
24
160
  },
25
161
  {
26
162
  name: "mod_user",
27
- type: a.NUMBER,
163
+ type: s.NUMBER,
28
164
  label: e("introspection-schema.models.user.mod_user", "User modified")
29
165
  },
30
166
  {
31
167
  name: "mod_time",
32
- type: a.DATE,
168
+ type: s.DATE,
33
169
  label: e("introspection-schema.models.user.time", "Update date")
34
170
  },
35
171
  {
36
172
  name: "email",
37
- type: a.TEXT,
173
+ type: s.TEXT,
38
174
  label: e("introspection-schema.models.user.email", "Email")
39
175
  },
40
176
  {
41
177
  name: "password",
42
- type: a.TEXT,
178
+ type: s.TEXT,
43
179
  label: e("introspection-schema.models.user.password", "Password")
44
180
  },
45
181
  {
46
182
  name: "displayName",
47
- type: a.TEXT,
183
+ type: s.TEXT,
48
184
  label: e("introspection-schema.models.user.display-name", "Display name")
49
185
  },
50
186
  {
51
187
  name: "blocked",
52
- type: a.BOOLEAN,
188
+ type: s.BOOLEAN,
53
189
  label: e("introspection-schema.models.user.blocked", "Blocked")
54
190
  },
55
191
  {
56
192
  name: "timestamp",
57
- type: a.DATE,
193
+ type: s.DATE,
58
194
  label: e("introspection-schema.models.user.timestamp", "Creation date")
59
195
  },
60
196
  {
61
197
  name: "state",
62
- type: a.BOOLEAN,
198
+ type: s.BOOLEAN,
63
199
  label: e("introspection-schema.models.user.state", "State")
64
200
  },
65
201
  {
66
202
  name: "newRegister",
67
- type: a.BOOLEAN,
203
+ type: s.BOOLEAN,
68
204
  label: e("introspection-schema.models.user.new-register", "New register")
69
205
  },
70
206
  {
71
207
  name: "password_changed_date",
72
- type: a.DATE,
208
+ type: s.DATE,
73
209
  label: e("introspection-schema.models.user.password-changed-date", "Password changed date")
74
210
  },
75
211
  {
76
212
  name: "token",
77
- type: a.TEXT,
213
+ type: s.TEXT,
78
214
  label: e("introspection-schema.models.user.token", "Token")
79
215
  },
80
216
  {
81
217
  name: "type",
82
- type: a.TEXT,
218
+ type: s.TEXT,
83
219
  label: e("introspection-schema.models.user.type", "Type")
84
220
  },
85
221
  {
86
222
  name: "expiry_date",
87
- type: a.DATE,
223
+ type: s.DATE,
88
224
  label: e("introspection-schema.models.user.expiry-date", "Expiry date")
89
225
  },
90
226
  {
91
227
  name: "allow_upload",
92
- type: a.BOOLEAN,
228
+ type: s.BOOLEAN,
93
229
  label: e("introspection-schema.models.user.allow-upload", "Allow upload")
94
230
  },
95
231
  {
96
232
  name: "allow_change_color",
97
- type: a.BOOLEAN,
233
+ type: s.BOOLEAN,
98
234
  label: e("introspection-schema.models.user.allow-change-color", "Allow change color")
99
235
  },
100
236
  {
101
237
  name: "clinic_request",
102
- type: a.BOOLEAN,
238
+ type: s.BOOLEAN,
103
239
  label: e("introspection-schema.models.user.clinic-request", "Clinic request")
104
240
  },
105
241
  {
106
242
  name: "favourite",
107
- type: a.BOOLEAN,
243
+ type: s.BOOLEAN,
108
244
  label: e("introspection-schema.models.user.favourite", "Favourite")
109
245
  },
110
246
  {
111
247
  name: "last_access",
112
- type: a.DATE,
248
+ type: s.DATE,
113
249
  label: e("introspection-schema.models.user.last-access", "Last access")
114
250
  },
115
251
  {
116
252
  name: "temporary_password",
117
- type: a.TEXT,
253
+ type: s.TEXT,
118
254
  label: e("introspection-schema.models.user.temporary-password", "Temporary password")
119
255
  },
120
256
  {
121
257
  name: "currentFailedCount",
122
- type: a.NUMBER,
258
+ type: s.NUMBER,
123
259
  label: e("introspection-schema.models.user.current-failed-count", "Current failed count")
124
260
  },
125
261
  {
126
262
  name: "tokenDate",
127
- type: a.DATE,
263
+ type: s.DATE,
128
264
  label: e("introspection-schema.models.user.token-date", "Token date")
129
265
  }
130
266
  ]
131
267
  }
132
268
  }
133
269
  };
270
+ return a && Object.keys(a).length && (r.externalApis = Object.entries(a).map(([l, t]) => ({
271
+ value: l,
272
+ label: t.label,
273
+ methods: t.method
274
+ }))), r;
134
275
  }
135
276
  export {
136
- t as ApiAction,
137
- l as ConditionsFormat,
138
- r as DashboardWidgetType,
139
- s as DataLoaderType,
140
- a as IntrospectionSchemaType,
141
- o as TriggerAction,
142
- n as getIntrospectionSchema
277
+ i as ApiAction,
278
+ d as ConditionsFormat,
279
+ p as DashboardWidgetType,
280
+ c as DataLoaderType,
281
+ s as IntrospectionSchemaType,
282
+ m as TriggerAction,
283
+ w as getIntrospectionSchema
143
284
  };
@@ -1 +1 @@
1
- (function(s,t){typeof exports=="object"&&typeof module<"u"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(s=typeof globalThis<"u"?globalThis:s||self,t(s["perseed-api"]={}))})(this,function(s){"use strict";var t=(e=>(e.OUTCOMES="outcomes",e))(t||{}),o=(e=>(e.VALUECARD="ValueCard",e.SECTIONCARD="SectionCard",e.PATIENTLIST="PatientList",e))(o||{}),r=(e=>(e.QUESTIONNAIRE_CREATE="questionnaire.create",e.CRF_CREATE="crf.create",e.CRF_UPDATE="crf.update",e.CRF_DELETE="crf.delete",e))(r||{}),n=(e=>(e.JSON_LOGIC="jsonLogic",e.CUSTOM="custom",e))(n||{}),l=(e=>(e.CREATION="creation",e.UPDATE="update",e))(l||{}),a=(e=>(e.TEXT="text",e.DATE="date",e.TIME="time",e.BOOLEAN="boolean",e.NUMBER="number",e.SELECT="select",e.MULTISELECT="multiselect",e))(a||{});function m(e){return{models:{user:{label:e("introspection-schema.models.user.label","User"),relations:[],canJoinPatient:!0,fields:[{name:"username",type:a.TEXT,label:e("introspection-schema.models.user.username","Username")},{name:"created_user",type:a.TEXT,label:e("introspection-schema.models.user.created_user","Created user")},{name:"created_mode",type:a.TEXT,label:e("introspection-schema.models.user.created_mode","Created mode")},{name:"mod_user",type:a.NUMBER,label:e("introspection-schema.models.user.mod_user","User modified")},{name:"mod_time",type:a.DATE,label:e("introspection-schema.models.user.time","Update date")},{name:"email",type:a.TEXT,label:e("introspection-schema.models.user.email","Email")},{name:"password",type:a.TEXT,label:e("introspection-schema.models.user.password","Password")},{name:"displayName",type:a.TEXT,label:e("introspection-schema.models.user.display-name","Display name")},{name:"blocked",type:a.BOOLEAN,label:e("introspection-schema.models.user.blocked","Blocked")},{name:"timestamp",type:a.DATE,label:e("introspection-schema.models.user.timestamp","Creation date")},{name:"state",type:a.BOOLEAN,label:e("introspection-schema.models.user.state","State")},{name:"newRegister",type:a.BOOLEAN,label:e("introspection-schema.models.user.new-register","New register")},{name:"password_changed_date",type:a.DATE,label:e("introspection-schema.models.user.password-changed-date","Password changed date")},{name:"token",type:a.TEXT,label:e("introspection-schema.models.user.token","Token")},{name:"type",type:a.TEXT,label:e("introspection-schema.models.user.type","Type")},{name:"expiry_date",type:a.DATE,label:e("introspection-schema.models.user.expiry-date","Expiry date")},{name:"allow_upload",type:a.BOOLEAN,label:e("introspection-schema.models.user.allow-upload","Allow upload")},{name:"allow_change_color",type:a.BOOLEAN,label:e("introspection-schema.models.user.allow-change-color","Allow change color")},{name:"clinic_request",type:a.BOOLEAN,label:e("introspection-schema.models.user.clinic-request","Clinic request")},{name:"favourite",type:a.BOOLEAN,label:e("introspection-schema.models.user.favourite","Favourite")},{name:"last_access",type:a.DATE,label:e("introspection-schema.models.user.last-access","Last access")},{name:"temporary_password",type:a.TEXT,label:e("introspection-schema.models.user.temporary-password","Temporary password")},{name:"currentFailedCount",type:a.NUMBER,label:e("introspection-schema.models.user.current-failed-count","Current failed count")},{name:"tokenDate",type:a.DATE,label:e("introspection-schema.models.user.token-date","Token date")}]}}}}s.ApiAction=r,s.ConditionsFormat=n,s.DashboardWidgetType=o,s.DataLoaderType=t,s.IntrospectionSchemaType=a,s.TriggerAction=l,s.getIntrospectionSchema=m,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
1
+ (function(a,r){typeof exports=="object"&&typeof module<"u"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(a=typeof globalThis<"u"?globalThis:a||self,r(a["perseed-api"]={}))})(this,function(a){"use strict";var r=(e=>(e.OUTCOMES="outcomes",e))(r||{}),o=(e=>(e.VALUECARD="ValueCard",e.SECTIONCARD="SectionCard",e.PATIENTLIST="PatientList",e))(o||{}),n=(e=>(e.QUESTIONNAIRE_CREATE="questionnaire.create",e.CRF_CREATE="crf.create",e.CRF_UPDATE="crf.update",e.CRF_DELETE="crf.delete",e.EXTERNAL_API_CALL="external_api_call",e))(n||{}),i=(e=>(e.JSON_LOGIC="jsonLogic",e.CUSTOM="custom",e))(i||{}),l=(e=>(e.CREATION="creation",e.UPDATE="update",e))(l||{}),s=(e=>(e.TEXT="text",e.DATE="date",e.TIME="time",e.BOOLEAN="boolean",e.NUMBER="number",e.SELECT="select",e.MULTISELECT="multiselect",e))(s||{});const u={},E={},h={},T={},b={hostName:"mysql",ecosystem:{demo:{userLogin:{username:"admin",password:"Sebas3210",deviceId:"abc123",api:!0}},reseaarch:{userLogin:{username:"testapi2",password:"123456",deviceId:"abc123",api:!0}},caaring:{userLogin:{username:"root",password:"pass4mike",deviceId:"abc123",api:!0}},ecoapi:{userLogin:{username:"root",password:"123456",deviceId:"abc123",api:!0}},clinicaal:{},clitinerary:{}},global:{dbCredentials:{username:"root",password:"root",database:"perseed"}},rabbitOptions:{protocol:"amqp",hostname:"localhost",port:5672,username:"perseedweb00-dev",password:"Z8rLHAkw",locale:"en_US",frameMax:0,heartbeat:0,vhost:"/"},AWS:{accessKeyId:"AKIA4Z2DUBRURKXKII5S",secretAccessKey:"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",apiVersion:"latest",tmpPath:"tmp/",bucket:{name:"testing.perseed-files-eu",region:"eu-central-1"},cloudFront:{keypairId:"K1BWQQVLE4YU4F",privateKeyPath:"/var/www/perseed_api/config/private_key.pem",assetsUrl:"https://test.assets.perseed.eu"}},SMS:{apiKey:"4|XildLvmjqzABeekAgj9EaLiwpxdGMWgassPaxewu",defaultSender:"Caaring"},perseedAPI:{caaring:{username:"ecoadmin",password:"1CarefulWithPersonalInfo2@",deviceId:"ecoadmin@api"},clinicaal:{username:"perseedapiCLI",password:"Ukz4s7LL&Ne3KA#",deviceId:"ecoadmin@api"},onqos:{username:"perseedapiCLI",password:"Ukz4s7LL&Ne3KA#",deviceId:"ecoadmin@api"},demo:{username:"admin",password:"Sebas3210",deviceId:"admin@api"},reseaarch:{username:"ecoadmin",password:"1CarefulWithPersonalInfo2@",deviceId:"ecoadmin@api"},testrcr:{username:"ecoadmin",password:"1CarefulWithPersonalInfo2",deviceId:"ecoadmin@api"}}},_={},c={};let p;c.existsSync("./credentials/local.json")&&(p=JSON.parse(c.readFileSync("./credentials/local.json").toString()));const y={local:p||u,local_tmp:E,test:b,testing:_,preproduction:h,production:T};function v(e){return e.replace(/\/$/,"")}const L=process.env.NODE_ENV||"local";process.env.PROXY_FILES,v(process.env.API_BASE_URL||"https://api.perseed.eu"),process.env.JWT_SECRET,process.env.REFRESH_JWT_SECRET,process.env.JWT_ISSUERS,process.env.FULL_LOG,(process.env.CSP_FRAME_ANCESTORS||"https://tmp.perseed.eu,https://tmp.api.perseed.eu,https://perseed.eu,https://api.perseed.eu,https://perseed.test,https://app.caaring.com,https://app.clinicaal.com,https://app.onqos.com,https://app.reseaarch.com,https://app.clitinerary.com").split(","),process.env.ZERO_DATES_SUPPORT,process.env.DEBUG_ERRORS?process.env.DEBUG_ERRORS:process.env.NODE_ENV,process.env.DEFAULT_TZ,process.env.SENTRY_DSN,parseInt(process.env.JOB_RETRIES??"5"),process.env.BODY_SIZE_LIMIT;const t=y[L].externalApis;function A(e){const d={models:{user:{label:e("introspection-schema.models.user.label","User"),relations:[],canJoinPatient:!0,fields:[{name:"username",type:s.TEXT,label:e("introspection-schema.models.user.username","Username")},{name:"created_user",type:s.TEXT,label:e("introspection-schema.models.user.created_user","Created user")},{name:"created_mode",type:s.TEXT,label:e("introspection-schema.models.user.created_mode","Created mode")},{name:"mod_user",type:s.NUMBER,label:e("introspection-schema.models.user.mod_user","User modified")},{name:"mod_time",type:s.DATE,label:e("introspection-schema.models.user.time","Update date")},{name:"email",type:s.TEXT,label:e("introspection-schema.models.user.email","Email")},{name:"password",type:s.TEXT,label:e("introspection-schema.models.user.password","Password")},{name:"displayName",type:s.TEXT,label:e("introspection-schema.models.user.display-name","Display name")},{name:"blocked",type:s.BOOLEAN,label:e("introspection-schema.models.user.blocked","Blocked")},{name:"timestamp",type:s.DATE,label:e("introspection-schema.models.user.timestamp","Creation date")},{name:"state",type:s.BOOLEAN,label:e("introspection-schema.models.user.state","State")},{name:"newRegister",type:s.BOOLEAN,label:e("introspection-schema.models.user.new-register","New register")},{name:"password_changed_date",type:s.DATE,label:e("introspection-schema.models.user.password-changed-date","Password changed date")},{name:"token",type:s.TEXT,label:e("introspection-schema.models.user.token","Token")},{name:"type",type:s.TEXT,label:e("introspection-schema.models.user.type","Type")},{name:"expiry_date",type:s.DATE,label:e("introspection-schema.models.user.expiry-date","Expiry date")},{name:"allow_upload",type:s.BOOLEAN,label:e("introspection-schema.models.user.allow-upload","Allow upload")},{name:"allow_change_color",type:s.BOOLEAN,label:e("introspection-schema.models.user.allow-change-color","Allow change color")},{name:"clinic_request",type:s.BOOLEAN,label:e("introspection-schema.models.user.clinic-request","Clinic request")},{name:"favourite",type:s.BOOLEAN,label:e("introspection-schema.models.user.favourite","Favourite")},{name:"last_access",type:s.DATE,label:e("introspection-schema.models.user.last-access","Last access")},{name:"temporary_password",type:s.TEXT,label:e("introspection-schema.models.user.temporary-password","Temporary password")},{name:"currentFailedCount",type:s.NUMBER,label:e("introspection-schema.models.user.current-failed-count","Current failed count")},{name:"tokenDate",type:s.DATE,label:e("introspection-schema.models.user.token-date","Token date")}]}}};return t&&Object.keys(t).length&&(d.externalApis=Object.entries(t).map(([O,m])=>({value:O,label:m.label,methods:m.method}))),d}a.ApiAction=n,a.ConditionsFormat=i,a.DashboardWidgetType=o,a.DataLoaderType=r,a.IntrospectionSchemaType=s,a.TriggerAction=l,a.getIntrospectionSchema=A,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
@@ -140,22 +140,25 @@
140
140
  "I18nTextTranslation": {
141
141
  "anyOf": [
142
142
  {
143
- "type": "object",
144
- "properties": {
145
- "default": {
146
- "type": "string"
147
- }
148
- },
149
- "required": ["default"],
150
- "additionalProperties": {
151
- "type": "string"
152
- }
143
+ "$ref": "#/definitions/I18nTextLocales"
153
144
  },
154
145
  {
155
146
  "type": "string"
156
147
  }
157
148
  ]
158
149
  },
150
+ "I18nTextLocales": {
151
+ "type": "object",
152
+ "properties": {
153
+ "default": {
154
+ "type": "string"
155
+ }
156
+ },
157
+ "required": ["default"],
158
+ "additionalProperties": {
159
+ "type": "string"
160
+ }
161
+ },
159
162
  "ColProps": {
160
163
  "type": "object",
161
164
  "properties": {
@@ -374,8 +377,7 @@
374
377
  "type": "boolean"
375
378
  },
376
379
  "aggType": {
377
- "type": "string",
378
- "enum": ["avg", "count", "max", "min", "sum"]
380
+ "$ref": "#/definitions/AggFunction"
379
381
  },
380
382
  "groupBy": {
381
383
  "anyOf": [
@@ -397,9 +399,7 @@
397
399
  "type": "string"
398
400
  },
399
401
  "orderDir": {
400
- "type": "string",
401
- "enum": ["asc", "desc"],
402
- "description": "Any changes here may need changes in Caaring-js packages/perseed-api-client/src/PerseedApiClient.ts"
402
+ "$ref": "#/definitions/OrderDir"
403
403
  }
404
404
  },
405
405
  "required": ["ecosystem", "projectName", "name"],
@@ -409,14 +409,39 @@
409
409
  "required": ["type", "params"],
410
410
  "additionalProperties": false
411
411
  },
412
+ "AggFunction": {
413
+ "type": "string",
414
+ "enum": ["avg", "count", "max", "min", "sum"]
415
+ },
412
416
  "OutcomesGroupBy": {
417
+ "anyOf": [
418
+ {
419
+ "type": "string",
420
+ "const": "name"
421
+ },
422
+ {
423
+ "type": "string",
424
+ "const": "identifier"
425
+ },
426
+ {
427
+ "type": "string",
428
+ "const": "value"
429
+ },
430
+ {
431
+ "$ref": "#/definitions/OutcomesDateFields"
432
+ },
433
+ {
434
+ "$ref": "#/definitions/OutcomeDateField"
435
+ }
436
+ ]
437
+ },
438
+ "OutcomesDateFields": {
439
+ "type": "string",
440
+ "enum": ["from", "to"]
441
+ },
442
+ "OutcomeDateField": {
413
443
  "type": "string",
414
444
  "enum": [
415
- "name",
416
- "identifier",
417
- "value",
418
- "from",
419
- "to",
420
445
  "from.date",
421
446
  "from.day",
422
447
  "from.dayname",
@@ -453,6 +478,11 @@
453
478
  "to.yearweek"
454
479
  ]
455
480
  },
481
+ "OrderDir": {
482
+ "type": "string",
483
+ "enum": ["asc", "desc"],
484
+ "description": "Any changes here may need changes in Caaring-js packages/perseed-api-client/src/PerseedApiClient.ts"
485
+ },
456
486
  "PatientListProps": {
457
487
  "type": "object",
458
488
  "properties": {
@@ -1,6 +1,5 @@
1
- interface I18nTextLocales {
1
+ export interface I18nTextLocales {
2
2
  [locale: string]: string;
3
3
  default: string;
4
4
  }
5
5
  export type I18nTextTranslation = I18nTextLocales | string;
6
- export {};
@@ -1,10 +1,5 @@
1
- import * as data_loaders from './data_loaders';
2
- import * as widgets from './widgets';
1
+ export * from './data_loaders';
2
+ export * from './widgets';
3
3
  export * from './types';
4
4
  export * from './i18n';
5
5
  export * from './col.d';
6
- declare const dashboard: {
7
- data_loaders: typeof data_loaders;
8
- widgets: typeof widgets;
9
- };
10
- export default dashboard;
@@ -1,7 +1,5 @@
1
1
  import { ColProps } from './col';
2
- import { PatientListProps } from './widgets/PatientListProps';
3
- import { SectionCardProps } from './widgets/SectionCardProps';
4
- import { ValueCardProps } from './widgets/ValueCardProps';
2
+ import { PatientListProps, SectionCardProps, ValueCardProps } from './widgets';
5
3
  /**
6
4
  * Any changes here may need changes in Caaring-js packages/perseed-react-ui-components/src/dashboards/types.ts
7
5
  */
@@ -139,22 +139,25 @@
139
139
  "I18nTextTranslation": {
140
140
  "anyOf": [
141
141
  {
142
- "type": "object",
143
- "properties": {
144
- "default": {
145
- "type": "string"
146
- }
147
- },
148
- "required": ["default"],
149
- "additionalProperties": {
150
- "type": "string"
151
- }
142
+ "$ref": "#/definitions/I18nTextLocales"
152
143
  },
153
144
  {
154
145
  "type": "string"
155
146
  }
156
147
  ]
157
148
  },
149
+ "I18nTextLocales": {
150
+ "type": "object",
151
+ "properties": {
152
+ "default": {
153
+ "type": "string"
154
+ }
155
+ },
156
+ "required": ["default"],
157
+ "additionalProperties": {
158
+ "type": "string"
159
+ }
160
+ },
158
161
  "ColProps": {
159
162
  "type": "object",
160
163
  "properties": {
@@ -373,8 +376,7 @@
373
376
  "type": "boolean"
374
377
  },
375
378
  "aggType": {
376
- "type": "string",
377
- "enum": ["avg", "count", "max", "min", "sum"]
379
+ "$ref": "#/definitions/AggFunction"
378
380
  },
379
381
  "groupBy": {
380
382
  "anyOf": [
@@ -396,9 +398,7 @@
396
398
  "type": "string"
397
399
  },
398
400
  "orderDir": {
399
- "type": "string",
400
- "enum": ["asc", "desc"],
401
- "description": "Any changes here may need changes in Caaring-js packages/perseed-api-client/src/PerseedApiClient.ts"
401
+ "$ref": "#/definitions/OrderDir"
402
402
  }
403
403
  },
404
404
  "required": ["ecosystem", "projectName", "name"],
@@ -408,14 +408,39 @@
408
408
  "required": ["type", "params"],
409
409
  "additionalProperties": false
410
410
  },
411
+ "AggFunction": {
412
+ "type": "string",
413
+ "enum": ["avg", "count", "max", "min", "sum"]
414
+ },
411
415
  "OutcomesGroupBy": {
416
+ "anyOf": [
417
+ {
418
+ "type": "string",
419
+ "const": "name"
420
+ },
421
+ {
422
+ "type": "string",
423
+ "const": "identifier"
424
+ },
425
+ {
426
+ "type": "string",
427
+ "const": "value"
428
+ },
429
+ {
430
+ "$ref": "#/definitions/OutcomesDateFields"
431
+ },
432
+ {
433
+ "$ref": "#/definitions/OutcomeDateField"
434
+ }
435
+ ]
436
+ },
437
+ "OutcomesDateFields": {
438
+ "type": "string",
439
+ "enum": ["from", "to"]
440
+ },
441
+ "OutcomeDateField": {
412
442
  "type": "string",
413
443
  "enum": [
414
- "name",
415
- "identifier",
416
- "value",
417
- "from",
418
- "to",
419
444
  "from.date",
420
445
  "from.day",
421
446
  "from.dayname",
@@ -452,6 +477,11 @@
452
477
  "to.yearweek"
453
478
  ]
454
479
  },
480
+ "OrderDir": {
481
+ "type": "string",
482
+ "enum": ["asc", "desc"],
483
+ "description": "Any changes here may need changes in Caaring-js packages/perseed-api-client/src/PerseedApiClient.ts"
484
+ },
455
485
  "PatientListProps": {
456
486
  "type": "object",
457
487
  "properties": {
@@ -160,7 +160,7 @@
160
160
  },
161
161
  "ApiAction": {
162
162
  "type": "string",
163
- "enum": ["questionnaire.create", "crf.create", "crf.update", "crf.delete"]
163
+ "enum": ["questionnaire.create", "crf.create", "crf.update", "crf.delete", "external_api_call"]
164
164
  },
165
165
  "ConditionsFormat": {
166
166
  "type": "string",
@@ -3,7 +3,8 @@ export declare enum ApiAction {
3
3
  QUESTIONNAIRE_CREATE = "questionnaire.create",
4
4
  CRF_CREATE = "crf.create",
5
5
  CRF_UPDATE = "crf.update",
6
- CRF_DELETE = "crf.delete"
6
+ CRF_DELETE = "crf.delete",
7
+ EXTERNAL_API_CALL = "external_api_call"
7
8
  }
8
9
  export type NotifiedAboutType = `model_${ModelName}` | `model_displayer_${ModelName}` | `model_${ModelName}_${TriggerAction}` | `model_displayer_${ModelName}_${TriggerAction}`;
9
10
  export interface CreateTriggerPayload {
@@ -87,5 +88,10 @@ export interface IntrospectionSchemaModel {
87
88
  }
88
89
  export interface IntrospectionSchema {
89
90
  models: Record<string, IntrospectionSchemaModel>;
91
+ externalApis?: {
92
+ value: string;
93
+ label: string;
94
+ methods?: string | string[];
95
+ }[];
90
96
  }
91
97
  export {};
@@ -159,7 +159,7 @@
159
159
  },
160
160
  "ApiAction": {
161
161
  "type": "string",
162
- "enum": ["questionnaire.create", "crf.create", "crf.update", "crf.delete"]
162
+ "enum": ["questionnaire.create", "crf.create", "crf.update", "crf.delete", "external_api_call"]
163
163
  },
164
164
  "ConditionsFormat": {
165
165
  "type": "string",
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * Any changes here may need changes in Caaring-js packages/perseed-api-client/src/PerseedApiClient.ts
3
3
  */
4
- type OrderDir = 'asc' | 'desc';
5
- type AggFunction = 'avg' | 'count' | 'max' | 'min' | 'sum';
6
- type OutcomesDateFields = 'from' | 'to';
7
- type OutcomesDateFunctions = 'date' | 'day' | 'dayname' | 'dayofmonth' | 'dayofweek' | 'dayofyear' | 'hour' | 'minute' | 'month' | 'monthname' | 'time' | 'second' | 'week' | 'weekday' | 'weekofyear' | 'year' | 'yearweek';
8
- type OutcomeDateField = `${OutcomesDateFields}.${OutcomesDateFunctions}`;
4
+ export type OrderDir = 'asc' | 'desc';
5
+ export type AggFunction = 'avg' | 'count' | 'max' | 'min' | 'sum';
6
+ export type OutcomesDateFields = 'from' | 'to';
7
+ export type OutcomesDateFunctions = 'date' | 'day' | 'dayname' | 'dayofmonth' | 'dayofweek' | 'dayofyear' | 'hour' | 'minute' | 'month' | 'monthname' | 'time' | 'second' | 'week' | 'weekday' | 'weekofyear' | 'year' | 'yearweek';
8
+ export type OutcomeDateField = `${OutcomesDateFields}.${OutcomesDateFunctions}`;
9
9
  export type OutcomesGroupBy = 'name' | 'identifier' | 'value' | OutcomesDateFields | OutcomeDateField;
10
- interface OutcomeDateGroup {
10
+ export interface OutcomeDateGroup {
11
11
  [dateGroup: string]: string;
12
12
  }
13
13
  export type Outcome = OutcomeDateGroup & {
@@ -32,4 +32,3 @@ export interface OutcomesParams {
32
32
  orderBy?: string;
33
33
  orderDir?: OrderDir;
34
34
  }
35
- export {};
package/package.json CHANGED
@@ -1,22 +1,16 @@
1
1
  {
2
2
  "name": "@persei/perseed-api",
3
- "version": "4.34.4",
3
+ "version": "4.34.5",
4
4
  "private": false,
5
5
  "main": "./dist/perseed-api.umd.cjs",
6
6
  "module": "./dist/perseed-api.js",
7
7
  "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "import": "./dist/perseed-api.js",
11
- "require": "./dist/perseed-api.umd.cjs"
12
- }
13
- },
14
8
  "files": [
15
9
  "dist"
16
10
  ],
17
11
  "scripts": {
18
- "publish": "npm run precommit && npm run build && npm publish",
19
- "build": "tsc && vite build",
12
+ "publish_package": "npm run precommit && npm run build && npm publish",
13
+ "build": "tsc --noEmit && vite build",
20
14
  "start": "ts-node src/server.ts",
21
15
  "lint": "npm run test:lint",
22
16
  "jshint": "jshint . > report.txt || true",