@beam3_dev/api_module 0.0.18 → 0.0.19

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/dist/wb3Api.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "uuid";
2
2
  import "luxon";
3
3
  import { requirejs as C, widget as v } from "@widget-lab/3ddashboard-utils";
4
- function x(e, t) {
4
+ function _(e, t) {
5
5
  C(["DS/WAFData/WAFData"], (i) => {
6
6
  i.authenticatedRequest(e, t);
7
7
  });
@@ -9,8 +9,8 @@ function x(e, t) {
9
9
  function A(e, t = void 0, i = void 0) {
10
10
  C(
11
11
  ["DS/i3DXCompassServices/i3DXCompassServices"],
12
- (l) => {
13
- (!e || e === "") && (e = v.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), l.getPlatformServices({
12
+ (r) => {
13
+ (!e || e === "") && (e = v.getValue("PlatFormInstanceId")), (!e || e === "") && (e = void 0), r.getPlatformServices({
14
14
  platformId: e,
15
15
  onComplete: t,
16
16
  onFailure: i
@@ -21,60 +21,60 @@ function A(e, t = void 0, i = void 0) {
21
21
  function T() {
22
22
  let e = {};
23
23
  return C(["DS/PlatformAPI/PlatformAPI"], (t) => {
24
- const i = t.getTenant(), l = t.getUser(), o = t.getAllApplicationConfigurations(), r = t.getWidgetTenant(), d = t.getApplicationConfiguration(
24
+ const i = t.getTenant(), r = t.getUser(), o = t.getAllApplicationConfigurations(), l = t.getWidgetTenant(), d = t.getApplicationConfiguration(
25
25
  "com.3ds.wp.passport.cors"
26
26
  );
27
27
  e = {
28
28
  tenant: i,
29
- user: l,
29
+ user: r,
30
30
  appsConfiguration: o,
31
- widgetTenant: r,
31
+ widgetTenant: l,
32
32
  appConf: d
33
33
  };
34
34
  }), console.log("%cRETOUR API :", "color:blue", e), e;
35
35
  }
36
36
  const P = new FileReader();
37
37
  P.onload = () => console.log(P.result);
38
- function y(e, t = void 0, i = void 0, l = void 0, o = void 0, r = void 0) {
38
+ function y(e, t = void 0, i = void 0, r = void 0, o = void 0, l = void 0) {
39
39
  const d = `${e.space}/resources/modeler/pno/person?current=true&select=preferredcredentials&select=collabspaces&xrequestedwith=xmlhttprequest`;
40
- x(d, {
40
+ _(d, {
41
41
  method: "GET",
42
42
  onComplete(a) {
43
43
  const n = JSON.parse(a);
44
44
  let c = "", S, m, u;
45
45
  if (t) {
46
- let _ = n.collabspaces.find((p) => p.title === t);
47
- if (_) {
46
+ let x = n.collabspaces.find((p) => p.title === t);
47
+ if (x) {
48
48
  S = t;
49
- let p = _.couples;
49
+ let p = x.couples;
50
50
  p = p.filter(
51
51
  (s, f, g) => f === g.findIndex(
52
52
  (h) => h.organization.pid === s.organization.pid && h.role.pid === s.role.pid
53
53
  )
54
54
  ), i && (Array.isArray(i) ? i.forEach((s) => {
55
55
  u || p.forEach((f) => {
56
- if (s === f.role.name && l === f.organization.title)
57
- u = s, m = l;
56
+ if (s === f.role.name && r === f.organization.title)
57
+ u = s, m = r;
58
58
  else if (s === f.role.name) {
59
59
  let g = p.filter(
60
60
  (h) => h.role.name === s
61
61
  );
62
- g.length === 1 ? (u = g[0].role.name, m = g[0].organization.title) : r(g);
62
+ g.length === 1 ? (u = g[0].role.name, m = g[0].organization.title) : l(g);
63
63
  }
64
64
  });
65
65
  }) : p.forEach((s) => {
66
- if (i === s.role.name && l === s.organization.title)
67
- u = i, m = l;
66
+ if (i === s.role.name && r === s.organization.title)
67
+ u = i, m = r;
68
68
  else if (i === s.role.name) {
69
69
  let f = p.filter(
70
70
  (g) => g.role.name === i
71
71
  );
72
- f.length === 1 ? (u = f[0].role.name, m = f[0].organization.title) : r(f);
72
+ f.length === 1 ? (u = f[0].role.name, m = f[0].organization.title) : l(f);
73
73
  }
74
74
  }));
75
75
  }
76
76
  }
77
- S && m && u ? (c = u + "." + m + "." + S, o(c)) : n.preferredcredentials ? (c = n.preferredcredentials.role.name + "." + n.preferredcredentials.organization.title + "." + n.preferredcredentials.collabspace.title, o(c)) : r && (c = u + "." + m + "." + S, r(c));
77
+ S && m && u ? (c = u + "." + m + "." + S, o(c)) : n.preferredcredentials ? (c = n.preferredcredentials.role.name + "." + n.preferredcredentials.organization.title + "." + n.preferredcredentials.collabspace.title, o(c)) : l && (c = u + "." + m + "." + S, l(c));
78
78
  },
79
79
  onFailure(a) {
80
80
  console.log("Erreur de récupération du contexte de sécurité. => ", a);
@@ -83,9 +83,9 @@ function y(e, t = void 0, i = void 0, l = void 0, o = void 0, r = void 0) {
83
83
  }
84
84
  //!SECTION
85
85
  function D(e, t = void 0, i = void 0) {
86
- const l = e.space + "/api/index/tk";
87
- x(l, {
88
- onComplete(o, r, d) {
86
+ const r = e.space + "/api/index/tk";
87
+ _(r, {
88
+ onComplete(o, l, d) {
89
89
  var n;
90
90
  const a = JSON.parse(o);
91
91
  t && (e.token = (n = a == null ? void 0 : a.result) == null ? void 0 : n.ServerToken, t(a));
@@ -96,19 +96,19 @@ function D(e, t = void 0, i = void 0) {
96
96
  });
97
97
  }
98
98
  function O(e, t = void 0, i = void 0) {
99
- const l = e.space + "/api/user/getcurrent/";
99
+ const r = e.space + "/api/user/getcurrent/";
100
100
  D(
101
101
  e,
102
102
  (o) => {
103
- x(l, {
103
+ _(r, {
104
104
  method: "GET",
105
105
  headers: { "X-DS-SWYM-CSRFTOKEN": o.result.ServerToken },
106
- onComplete(r, d, a) {
107
- const n = JSON.parse(r);
106
+ onComplete(l, d, a) {
107
+ const n = JSON.parse(l);
108
108
  t && t(n.result);
109
109
  },
110
- onFailure(r) {
111
- i && i(r);
110
+ onFailure(l) {
111
+ i && i(l);
112
112
  }
113
113
  });
114
114
  },
@@ -118,13 +118,13 @@ function O(e, t = void 0, i = void 0) {
118
118
  function F(e, t = void 0, i = void 0) {
119
119
  A(
120
120
  null,
121
- (l) => {
122
- let o = [], r = [], d, a = {};
123
- for (let n of l)
124
- "3DSpace" in n && (r.push({
121
+ (r) => {
122
+ let o = [], l = [], d, a = {};
123
+ for (let n of r)
124
+ "3DSpace" in n && (l.push({
125
125
  label: `${n.displayName} ( ${n.platformId} )`,
126
- value: `${r.length}`
127
- }), r.sort(), o.push(n));
126
+ value: `${l.length}`
127
+ }), l.sort(), o.push(n));
128
128
  for (let [n, c] of o.entries())
129
129
  c.platformId === e.tenant && (a = c, d = n);
130
130
  v.addPreference({
@@ -132,7 +132,7 @@ function F(e, t = void 0, i = void 0) {
132
132
  type: "list",
133
133
  label: "Tenant",
134
134
  defaultValue: d,
135
- options: r
135
+ options: l
136
136
  }), Object.keys(a).length > 0, y(
137
137
  e.space,
138
138
  "ESPACE COMMUN",
@@ -153,87 +153,16 @@ function F(e, t = void 0, i = void 0) {
153
153
  }
154
154
  );
155
155
  },
156
- (l) => {
157
- console.log("** _getPlatformServices Erreur **", l);
156
+ (r) => {
157
+ console.log("** _getPlatformServices Erreur **", r);
158
158
  }
159
159
  );
160
160
  }
161
161
  module.exports = { getActiveServices: F };
162
- function b(e) {
162
+ function R(e) {
163
163
  const t = "Hello " + e;
164
164
  return console.log(t), t;
165
165
  }
166
- const E = {
167
- sayHello: b
168
- // _3DSwym_get_version,
169
- // _3DSwym_getAllNews,
170
- // _3DSwym_getFamiliarPeople,
171
- // _3DSpace_Create_Doc,
172
- // _3DSpace_csrf,
173
- // _3DSpace_download_doc,
174
- // _3DSpace_download_multidoc,
175
- // _3DSpace_file_update_csr,
176
- // _3DSpace_file_update,
177
- // _3DSpace_file_url_csr,
178
- // _3DSpace_file_url,
179
- // _3DSpace_get_csrf,
180
- // _3DSpace_get_docInfo,
181
- // _3DSpace_get_downloadTicket_multidoc,
182
- // _3DSpace_get_securityContexts,
183
- // _3DSpace_lifecycle_changeRevision,
184
- // _3DSpace_lifecycle_changeState,
185
- // _3DSpace_lifecycle_getGraph,
186
- // _3DSpace_lifecycle_getNextRevision,
187
- // _3DSpace_lifecycle_getNextStates,
188
- // _3DSwim_getAllCommunities,
189
- // _3DSwim_getMembersCommunity,
190
- // _3DSwym_buildDirectMessage,
191
- // _3DSwym_deleteIdea,
192
- // _3DSwym_findCommunityToInstantMSG,
193
- // _3DSwym_get_AllSWYMIdeas,
194
- // _3DSwym_get_currentUser,
195
- // _3DSwym_get_findUser,
196
- // _3DSwym_getIdeaStatusMaturity,
197
- // _3DSwym_getSWYMIdea,
198
- // _3DSwym_postIdea,
199
- // _3DSwym_sendMessageData,
200
- // _AppMngt_get_info_user,
201
- // _AppMngt_get_users,
202
- // _getPlateformInfos,
203
- // _getPlatformServices,
204
- // _httpCallAuthenticated,
205
- // _setDraggable,
206
- // _setDroppable,
207
- // _setupTagger,
208
- // addTagToDoc,
209
- // compass_getListAdditionalApps,
210
- // couleurs,
211
- // createUserGroups,
212
- // dataMixing,
213
- // deleteUserGroups,
214
- // findAdresse,
215
- // get_3DSpace_csrf,
216
- // getActiveServices,
217
- // getAllContextSecurity,
218
- // getCommunes,
219
- // getComplementUG,
220
- // getCSRFToken,
221
- // getDataFrom3DSpace,
222
- // getDataFromGouvFr,
223
- // getDatasByTenant,
224
- // getDatasFrom3DSpace,
225
- // getDownloadDocument,
226
- // getInfoDocTags,
227
- // getUserGroupsList,
228
- // getUsersGroupRules,
229
- // patchUserGroups,
230
- // patchUserGroupsControl,
231
- // pushDataIn3DSpace,
232
- // readUserGroupControl,
233
- // removeTagToDoc,
234
- // updateEvent,
235
- // UUID,
236
- };
237
166
  export {
238
- E as default
167
+ R as sayHello
239
168
  };
@@ -1,2 +1,2 @@
1
- (function(m,x){typeof exports=="object"&&typeof module<"u"?module.exports=x(require("uuid"),require("luxon"),require("@widget-lab/3ddashboard-utils")):typeof define=="function"&&define.amd?define(["uuid","luxon","@widget-lab/3ddashboard-utils"],x):(m=typeof globalThis<"u"?globalThis:m||self,m["@beam3_dev/api_module"]=x(m.uuid,m.luxon,m._3ddashboardUtils))})(this,function(m,x,h){"use strict";function _(e,t){h.requirejs(["DS/WAFData/WAFData"],i=>{i.authenticatedRequest(e,t)})}function w(e,t=void 0,i=void 0){h.requirejs(["DS/i3DXCompassServices/i3DXCompassServices"],r=>{(!e||e==="")&&(e=h.widget.getValue("PlatFormInstanceId")),(!e||e==="")&&(e=void 0),r.getPlatformServices({platformId:e,onComplete:t,onFailure:i})}),v(),t&&t(v())}function v(){let e={};return h.requirejs(["DS/PlatformAPI/PlatformAPI"],t=>{const i=t.getTenant(),r=t.getUser(),o=t.getAllApplicationConfigurations(),l=t.getWidgetTenant(),d=t.getApplicationConfiguration("com.3ds.wp.passport.cors");e={tenant:i,user:r,appsConfiguration:o,widgetTenant:l,appConf:d}}),console.log("%cRETOUR API :","color:blue",e),e}const P=new FileReader;P.onload=()=>console.log(P.result);function A(e,t=void 0,i=void 0,r=void 0,o=void 0,l=void 0){const d=`${e.space}/resources/modeler/pno/person?current=true&select=preferredcredentials&select=collabspaces&xrequestedwith=xmlhttprequest`;_(d,{method:"GET",onComplete(s){const n=JSON.parse(s);let f="",C,S,c;if(t){let y=n.collabspaces.find(p=>p.title===t);if(y){C=t;let p=y.couples;p=p.filter((a,u,g)=>u===g.findIndex(T=>T.organization.pid===a.organization.pid&&T.role.pid===a.role.pid)),i&&(Array.isArray(i)?i.forEach(a=>{c||p.forEach(u=>{if(a===u.role.name&&r===u.organization.title)c=a,S=r;else if(a===u.role.name){let g=p.filter(T=>T.role.name===a);g.length===1?(c=g[0].role.name,S=g[0].organization.title):l(g)}})}):p.forEach(a=>{if(i===a.role.name&&r===a.organization.title)c=i,S=r;else if(i===a.role.name){let u=p.filter(g=>g.role.name===i);u.length===1?(c=u[0].role.name,S=u[0].organization.title):l(u)}}))}}C&&S&&c?(f=c+"."+S+"."+C,o(f)):n.preferredcredentials?(f=n.preferredcredentials.role.name+"."+n.preferredcredentials.organization.title+"."+n.preferredcredentials.collabspace.title,o(f)):l&&(f=c+"."+S+"."+C,l(f))},onFailure(s){console.log("Erreur de récupération du contexte de sécurité. => ",s)}})}//!SECTION
2
- function q(e,t=void 0,i=void 0){const r=e.space+"/api/index/tk";_(r,{onComplete(o,l,d){var n;const s=JSON.parse(o);t&&(e.token=(n=s==null?void 0:s.result)==null?void 0:n.ServerToken,t(s))},onFailure(o){i&&i(o)}})}function D(e,t=void 0,i=void 0){const r=e.space+"/api/user/getcurrent/";q(e,o=>{_(r,{method:"GET",headers:{"X-DS-SWYM-CSRFTOKEN":o.result.ServerToken},onComplete(l,d,s){const n=JSON.parse(l);t&&t(n.result)},onFailure(l){i&&i(l)}})},i)}function O(e,t=void 0,i=void 0){w(null,r=>{let o=[],l=[],d,s={};for(let n of r)"3DSpace"in n&&(l.push({label:`${n.displayName} ( ${n.platformId} )`,value:`${l.length}`}),l.sort(),o.push(n));for(let[n,f]of o.entries())f.platformId===e.tenant&&(s=f,d=n);h.widget.addPreference({name:"_CurrentTenantID_",type:"list",label:"Tenant",defaultValue:d,options:l}),Object.keys(s).length>0,A(e.space,"ESPACE COMMUN",["VPLMProjectLeader","VPLMCreator"],void 0,n=>e.ctx=n,n=>{console.log("on Error CTX =>",n)}),D(e,n=>{t&&t(n,s)},n=>{i&&i(n)})},r=>{console.log("** _getPlatformServices Erreur **",r)})}module.exports={getActiveServices:O};function F(e){const t="Hello "+e;return console.log(t),t}return{sayHello:F}});
1
+ (function(u,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("uuid"),require("luxon"),require("@widget-lab/3ddashboard-utils")):typeof define=="function"&&define.amd?define(["exports","uuid","luxon","@widget-lab/3ddashboard-utils"],x):(u=typeof globalThis<"u"?globalThis:u||self,x(u["@beam3_dev/api_module"]=u["@beam3_dev/api_module"]||{},u.uuid,u.luxon,u._3ddashboardUtils))})(this,function(u,x,F,h){"use strict";function _(e,t){h.requirejs(["DS/WAFData/WAFData"],i=>{i.authenticatedRequest(e,t)})}function w(e,t=void 0,i=void 0){h.requirejs(["DS/i3DXCompassServices/i3DXCompassServices"],r=>{(!e||e==="")&&(e=h.widget.getValue("PlatFormInstanceId")),(!e||e==="")&&(e=void 0),r.getPlatformServices({platformId:e,onComplete:t,onFailure:i})}),v(),t&&t(v())}function v(){let e={};return h.requirejs(["DS/PlatformAPI/PlatformAPI"],t=>{const i=t.getTenant(),r=t.getUser(),o=t.getAllApplicationConfigurations(),l=t.getWidgetTenant(),c=t.getApplicationConfiguration("com.3ds.wp.passport.cors");e={tenant:i,user:r,appsConfiguration:o,widgetTenant:l,appConf:c}}),console.log("%cRETOUR API :","color:blue",e),e}const y=new FileReader;y.onload=()=>console.log(y.result);function A(e,t=void 0,i=void 0,r=void 0,o=void 0,l=void 0){const c=`${e.space}/resources/modeler/pno/person?current=true&select=preferredcredentials&select=collabspaces&xrequestedwith=xmlhttprequest`;_(c,{method:"GET",onComplete(s){const n=JSON.parse(s);let d="",C,S,p;if(t){let P=n.collabspaces.find(g=>g.title===t);if(P){C=t;let g=P.couples;g=g.filter((a,f,m)=>f===m.findIndex(T=>T.organization.pid===a.organization.pid&&T.role.pid===a.role.pid)),i&&(Array.isArray(i)?i.forEach(a=>{p||g.forEach(f=>{if(a===f.role.name&&r===f.organization.title)p=a,S=r;else if(a===f.role.name){let m=g.filter(T=>T.role.name===a);m.length===1?(p=m[0].role.name,S=m[0].organization.title):l(m)}})}):g.forEach(a=>{if(i===a.role.name&&r===a.organization.title)p=i,S=r;else if(i===a.role.name){let f=g.filter(m=>m.role.name===i);f.length===1?(p=f[0].role.name,S=f[0].organization.title):l(f)}}))}}C&&S&&p?(d=p+"."+S+"."+C,o(d)):n.preferredcredentials?(d=n.preferredcredentials.role.name+"."+n.preferredcredentials.organization.title+"."+n.preferredcredentials.collabspace.title,o(d)):l&&(d=p+"."+S+"."+C,l(d))},onFailure(s){console.log("Erreur de récupération du contexte de sécurité. => ",s)}})}//!SECTION
2
+ function O(e,t=void 0,i=void 0){const r=e.space+"/api/index/tk";_(r,{onComplete(o,l,c){var n;const s=JSON.parse(o);t&&(e.token=(n=s==null?void 0:s.result)==null?void 0:n.ServerToken,t(s))},onFailure(o){i&&i(o)}})}function b(e,t=void 0,i=void 0){const r=e.space+"/api/user/getcurrent/";O(e,o=>{_(r,{method:"GET",headers:{"X-DS-SWYM-CSRFTOKEN":o.result.ServerToken},onComplete(l,c,s){const n=JSON.parse(l);t&&t(n.result)},onFailure(l){i&&i(l)}})},i)}function q(e,t=void 0,i=void 0){w(null,r=>{let o=[],l=[],c,s={};for(let n of r)"3DSpace"in n&&(l.push({label:`${n.displayName} ( ${n.platformId} )`,value:`${l.length}`}),l.sort(),o.push(n));for(let[n,d]of o.entries())d.platformId===e.tenant&&(s=d,c=n);h.widget.addPreference({name:"_CurrentTenantID_",type:"list",label:"Tenant",defaultValue:c,options:l}),Object.keys(s).length>0,A(e.space,"ESPACE COMMUN",["VPLMProjectLeader","VPLMCreator"],void 0,n=>e.ctx=n,n=>{console.log("on Error CTX =>",n)}),b(e,n=>{t&&t(n,s)},n=>{i&&i(n)})},r=>{console.log("** _getPlatformServices Erreur **",r)})}module.exports={getActiveServices:q};function D(e){const t="Hello "+e;return console.log(t),t}u.sayHello=D,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beam3_dev/api_module",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "type": "module",
5
5
  "main": "./dist/wb3Api.umd.cjs",
6
6
  "module": "./dist/wb3Api.js",