@data-fair/lib-common-types 1.4.0 → 1.4.1

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.
@@ -6,6 +6,7 @@ export type Title = string;
6
6
  export type Content = string;
7
7
  export type HTMLContent = string;
8
8
  export type URLOfEventIcon = string;
9
+ export type Type = "user" | "organization";
9
10
  export type CleDuSujet = string;
10
11
  export type LibelleDuSujet = string;
11
12
  export type Visibility = "public" | "private";
@@ -53,10 +54,27 @@ export interface InternationalizedHTMLContent {
53
54
  [k: string]: string;
54
55
  }
55
56
  export interface Emitter {
56
- type: "user" | "organization";
57
+ type: Type;
58
+ /**
59
+ * The unique id of the user or organization
60
+ */
57
61
  id: string;
62
+ /**
63
+ * The display name of the user or organization
64
+ */
58
65
  name: string;
66
+ /**
67
+ * @deprecated
68
+ * If this is set and owner is an organization, this restrict ownership to users of this organization having this role or admin role
69
+ */
70
+ role?: string;
71
+ /**
72
+ * If this is set and owner is an organization, this gives ownership to users of this organization that belong to this department
73
+ */
59
74
  department?: string;
75
+ /**
76
+ * The display name of the department
77
+ */
60
78
  departmentName?: string;
61
79
  }
62
80
  export interface UsedToFillSubscriptionUrlTemplateAndSoCreateNotificationUrl {
@@ -66,4 +84,32 @@ export interface UsedToFillSubscriptionUrlTemplateAndSoCreateNotificationUrl {
66
84
  */
67
85
  [k: string]: string;
68
86
  }
87
+ /**
88
+ * This interface was referenced by `Event`'s JSON-Schema
89
+ * via the `definition` "sender".
90
+ */
91
+ export interface Proprietaire {
92
+ type: Type;
93
+ /**
94
+ * The unique id of the user or organization
95
+ */
96
+ id: string;
97
+ /**
98
+ * The display name of the user or organization
99
+ */
100
+ name: string;
101
+ /**
102
+ * @deprecated
103
+ * If this is set and owner is an organization, this restrict ownership to users of this organization having this role or admin role
104
+ */
105
+ role?: string;
106
+ /**
107
+ * If this is set and owner is an organization, this gives ownership to users of this organization that belong to this department
108
+ */
109
+ department?: string;
110
+ /**
111
+ * The display name of the department
112
+ */
113
+ departmentName?: string;
114
+ }
69
115
 
package/event/schema.d.ts CHANGED
@@ -96,5 +96,41 @@ declare const _default: {
96
96
  description: string;
97
97
  };
98
98
  };
99
+ $defs: {
100
+ sender: {
101
+ type: string;
102
+ title: string;
103
+ additionalProperties: boolean;
104
+ required: string[];
105
+ properties: {
106
+ type: {
107
+ type: string;
108
+ enum: string[];
109
+ title: string;
110
+ };
111
+ id: {
112
+ type: string;
113
+ description: string;
114
+ };
115
+ name: {
116
+ type: string;
117
+ description: string;
118
+ };
119
+ role: {
120
+ type: string;
121
+ deprecated: boolean;
122
+ description: string;
123
+ };
124
+ department: {
125
+ type: string;
126
+ description: string;
127
+ };
128
+ departmentName: {
129
+ type: string;
130
+ description: string;
131
+ };
132
+ };
133
+ };
134
+ };
99
135
  };
100
136
  export default _default;
package/event/schema.js CHANGED
@@ -37,7 +37,7 @@ export default {
37
37
  title: 'URL of event icon'
38
38
  },
39
39
  // sender is the owner of the topic
40
- sender: { $ref: 'https://github.com/data-fair/lib/session-state#/$defs/account', title: 'Emitter' },
40
+ sender: { $ref: '#/$defs/sender', title: 'Emitter' },
41
41
  topic: {
42
42
  type: 'object',
43
43
  additionalProperties: false,
@@ -75,5 +75,41 @@ export default {
75
75
  type: 'object',
76
76
  description: 'Free properties that varie depending on the type of event'
77
77
  }
78
+ },
79
+ $defs: {
80
+ sender: {
81
+ type: 'object',
82
+ title: 'Propriétaire',
83
+ additionalProperties: false,
84
+ required: ['type', 'id', 'name'],
85
+ properties: {
86
+ type: {
87
+ type: 'string',
88
+ enum: ['user', 'organization'],
89
+ title: 'Type'
90
+ },
91
+ id: {
92
+ type: 'string',
93
+ description: 'The unique id of the user or organization'
94
+ },
95
+ name: {
96
+ type: 'string',
97
+ description: 'The display name of the user or organization'
98
+ },
99
+ role: {
100
+ type: 'string',
101
+ deprecated: true,
102
+ description: 'If this is set and owner is an organization, this restrict ownership to users of this organization having this role or admin role'
103
+ },
104
+ department: {
105
+ type: 'string',
106
+ description: 'If this is set and owner is an organization, this gives ownership to users of this organization that belong to this department'
107
+ },
108
+ departmentName: {
109
+ type: 'string',
110
+ description: 'The display name of the department'
111
+ }
112
+ }
113
+ }
78
114
  }
79
115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/lib-common-types",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Shared schemas and built type definitions in the data-fair stack.",
5
5
  "main": "index.js",
6
6
  "scripts": {