@vimine/sdk 0.2.0 → 0.3.3
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/README.md +1 -1
- package/dist/elements.d.ts +217 -5
- package/dist/elements.js +627 -123
- package/dist/elements.js.map +1 -1
- package/dist/generated.d.ts +64 -9
- package/dist/generated.js +3 -1
- package/dist/generated.js.map +1 -1
- package/dist/public.d.ts +12 -4
- package/dist/public.js +3 -2
- package/dist/public.js.map +1 -1
- package/dist/types.d.ts +74 -5
- package/dist/types.js.map +1 -1
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ if (result) location.assign(result.returnTo || '/');
|
|
|
29
29
|
// 3. usa l'API per conto del socio
|
|
30
30
|
const me = await vimine.me.get();
|
|
31
31
|
const membership = await vimine.membership.get(); // stato, verdetto, scadenza, token della tessera
|
|
32
|
-
await vimine.membership.request({ accept_statuto: { version: 3 } });
|
|
32
|
+
await vimine.membership.request({ accept_statuto: { version: 3 }, privacy_notice: { version: 2 } });
|
|
33
33
|
await vimine.membership.acceptStatuto({ version: 3 });
|
|
34
34
|
const card = await vimine.membership.card(); // { token: 'vmt_…', nbf, exp }
|
|
35
35
|
await vimine.connections.revoke('vmc_altra_app');
|
package/dist/elements.d.ts
CHANGED
|
@@ -1,6 +1,173 @@
|
|
|
1
|
-
import { Vimine, type VimineOptions } from
|
|
1
|
+
import { Vimine, type VimineOptions } from "./index.js";
|
|
2
|
+
declare const STRINGS: {
|
|
3
|
+
it: {
|
|
4
|
+
signIn: string;
|
|
5
|
+
signOut: string;
|
|
6
|
+
loading: string;
|
|
7
|
+
notSignedIn: string;
|
|
8
|
+
noMembership: string;
|
|
9
|
+
notActive: string;
|
|
10
|
+
error: string;
|
|
11
|
+
noEvents: string;
|
|
12
|
+
free: string;
|
|
13
|
+
places: string;
|
|
14
|
+
register: string;
|
|
15
|
+
signInToRegister: string;
|
|
16
|
+
joinAndBook: string;
|
|
17
|
+
alreadyMember: string;
|
|
18
|
+
registered: string;
|
|
19
|
+
reserved: string;
|
|
20
|
+
details: string;
|
|
21
|
+
reason: Record<string, string>;
|
|
22
|
+
};
|
|
23
|
+
en: {
|
|
24
|
+
signIn: string;
|
|
25
|
+
signOut: string;
|
|
26
|
+
loading: string;
|
|
27
|
+
notSignedIn: string;
|
|
28
|
+
noMembership: string;
|
|
29
|
+
notActive: string;
|
|
30
|
+
error: string;
|
|
31
|
+
noEvents: string;
|
|
32
|
+
free: string;
|
|
33
|
+
places: string;
|
|
34
|
+
register: string;
|
|
35
|
+
signInToRegister: string;
|
|
36
|
+
joinAndBook: string;
|
|
37
|
+
alreadyMember: string;
|
|
38
|
+
registered: string;
|
|
39
|
+
reserved: string;
|
|
40
|
+
details: string;
|
|
41
|
+
reason: Record<string, string>;
|
|
42
|
+
};
|
|
43
|
+
"zh-Hans": {
|
|
44
|
+
signIn: string;
|
|
45
|
+
signOut: string;
|
|
46
|
+
loading: string;
|
|
47
|
+
notSignedIn: string;
|
|
48
|
+
noMembership: string;
|
|
49
|
+
notActive: string;
|
|
50
|
+
error: string;
|
|
51
|
+
noEvents: string;
|
|
52
|
+
free: string;
|
|
53
|
+
places: string;
|
|
54
|
+
register: string;
|
|
55
|
+
signInToRegister: string;
|
|
56
|
+
joinAndBook: string;
|
|
57
|
+
alreadyMember: string;
|
|
58
|
+
registered: string;
|
|
59
|
+
reserved: string;
|
|
60
|
+
details: string;
|
|
61
|
+
reason: Record<string, string>;
|
|
62
|
+
};
|
|
63
|
+
"zh-Hant": {
|
|
64
|
+
signIn: string;
|
|
65
|
+
signOut: string;
|
|
66
|
+
loading: string;
|
|
67
|
+
notSignedIn: string;
|
|
68
|
+
noMembership: string;
|
|
69
|
+
notActive: string;
|
|
70
|
+
error: string;
|
|
71
|
+
noEvents: string;
|
|
72
|
+
free: string;
|
|
73
|
+
places: string;
|
|
74
|
+
register: string;
|
|
75
|
+
signInToRegister: string;
|
|
76
|
+
joinAndBook: string;
|
|
77
|
+
alreadyMember: string;
|
|
78
|
+
registered: string;
|
|
79
|
+
reserved: string;
|
|
80
|
+
details: string;
|
|
81
|
+
reason: Record<string, string>;
|
|
82
|
+
};
|
|
83
|
+
fr: {
|
|
84
|
+
signIn: string;
|
|
85
|
+
signOut: string;
|
|
86
|
+
loading: string;
|
|
87
|
+
notSignedIn: string;
|
|
88
|
+
noMembership: string;
|
|
89
|
+
notActive: string;
|
|
90
|
+
error: string;
|
|
91
|
+
noEvents: string;
|
|
92
|
+
free: string;
|
|
93
|
+
places: string;
|
|
94
|
+
register: string;
|
|
95
|
+
signInToRegister: string;
|
|
96
|
+
joinAndBook: string;
|
|
97
|
+
alreadyMember: string;
|
|
98
|
+
registered: string;
|
|
99
|
+
reserved: string;
|
|
100
|
+
details: string;
|
|
101
|
+
reason: Record<string, string>;
|
|
102
|
+
};
|
|
103
|
+
es: {
|
|
104
|
+
signIn: string;
|
|
105
|
+
signOut: string;
|
|
106
|
+
loading: string;
|
|
107
|
+
notSignedIn: string;
|
|
108
|
+
noMembership: string;
|
|
109
|
+
notActive: string;
|
|
110
|
+
error: string;
|
|
111
|
+
noEvents: string;
|
|
112
|
+
free: string;
|
|
113
|
+
places: string;
|
|
114
|
+
register: string;
|
|
115
|
+
signInToRegister: string;
|
|
116
|
+
joinAndBook: string;
|
|
117
|
+
alreadyMember: string;
|
|
118
|
+
registered: string;
|
|
119
|
+
reserved: string;
|
|
120
|
+
details: string;
|
|
121
|
+
reason: Record<string, string>;
|
|
122
|
+
};
|
|
123
|
+
de: {
|
|
124
|
+
signIn: string;
|
|
125
|
+
signOut: string;
|
|
126
|
+
loading: string;
|
|
127
|
+
notSignedIn: string;
|
|
128
|
+
noMembership: string;
|
|
129
|
+
notActive: string;
|
|
130
|
+
error: string;
|
|
131
|
+
noEvents: string;
|
|
132
|
+
free: string;
|
|
133
|
+
places: string;
|
|
134
|
+
register: string;
|
|
135
|
+
signInToRegister: string;
|
|
136
|
+
joinAndBook: string;
|
|
137
|
+
alreadyMember: string;
|
|
138
|
+
registered: string;
|
|
139
|
+
reserved: string;
|
|
140
|
+
details: string;
|
|
141
|
+
reason: Record<string, string>;
|
|
142
|
+
};
|
|
143
|
+
"pt-BR": {
|
|
144
|
+
signIn: string;
|
|
145
|
+
signOut: string;
|
|
146
|
+
loading: string;
|
|
147
|
+
notSignedIn: string;
|
|
148
|
+
noMembership: string;
|
|
149
|
+
notActive: string;
|
|
150
|
+
error: string;
|
|
151
|
+
noEvents: string;
|
|
152
|
+
free: string;
|
|
153
|
+
places: string;
|
|
154
|
+
register: string;
|
|
155
|
+
signInToRegister: string;
|
|
156
|
+
joinAndBook: string;
|
|
157
|
+
alreadyMember: string;
|
|
158
|
+
registered: string;
|
|
159
|
+
reserved: string;
|
|
160
|
+
details: string;
|
|
161
|
+
reason: Record<string, string>;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
type Lang = keyof typeof STRINGS;
|
|
165
|
+
/** The elements' language for a page's tag, or null when they do not speak it (`preview`: drafts included). */
|
|
166
|
+
export declare const matchLang: (tag: string, preview?: boolean) => Lang | null;
|
|
2
167
|
/** The client the elements use. Call once; pass your own instance to share it with the rest of the page. */
|
|
3
|
-
export declare function defineVimineElements(options: VimineOptions | Vimine
|
|
168
|
+
export declare function defineVimineElements(options: VimineOptions | Vimine, elements?: {
|
|
169
|
+
previewLanguages?: boolean;
|
|
170
|
+
}): Vimine;
|
|
4
171
|
/** `<vimine-sign-in scope="…" return-to="/area" label="…" handle-redirect>` — a sign-in / sign-out button. */
|
|
5
172
|
export declare class VimineSignIn extends HTMLElement {
|
|
6
173
|
private unsubscribe;
|
|
@@ -16,15 +183,59 @@ export declare class VimineCard extends HTMLElement {
|
|
|
16
183
|
disconnectedCallback(): void;
|
|
17
184
|
private render;
|
|
18
185
|
}
|
|
19
|
-
/**
|
|
186
|
+
/** The hosted enrolment page of an association, in a language: the frame's address, and where a hand-off lands. */
|
|
187
|
+
/**
|
|
188
|
+
* How the hosted enrolment page looks inside the host site: its scheme, the accent of its buttons, links and the
|
|
189
|
+
* association's name, and the ground behind its cards (`transparent`: the host page shows through). The page reads them
|
|
190
|
+
* from its address — a framed page cannot see the host's CSS — and ignores anything that is not a colour or a keyword.
|
|
191
|
+
*/
|
|
192
|
+
export type EnrollAppearance = {
|
|
193
|
+
scheme?: "light" | "dark";
|
|
194
|
+
accent?: string;
|
|
195
|
+
background?: string;
|
|
196
|
+
font?: Typeface;
|
|
197
|
+
};
|
|
198
|
+
/** The faces the hosted page offers — served by Vimine itself — or `system`, the device's own. They set everything. */
|
|
199
|
+
export declare const TYPEFACES: readonly ["system", "inter", "roboto", "open-sans", "montserrat", "nunito", "lora", "merriweather", "roboto-slab"];
|
|
200
|
+
export type Typeface = (typeof TYPEFACES)[number];
|
|
201
|
+
export declare const enrollUrl: (appUrl: string, slug: string, lang: string, appearance?: EnrollAppearance) => string;
|
|
202
|
+
/**
|
|
203
|
+
* The same page, opened FROM an event: the person joins the association and asks for a place at the event in one go.
|
|
204
|
+
* The request carries the event; the place is confirmed, or held until the membership is active.
|
|
205
|
+
*/
|
|
206
|
+
export declare const eventEnrollUrl: (appUrl: string, slug: string, event: string, lang: string) => string;
|
|
207
|
+
/**
|
|
208
|
+
* `<vimine-enroll slug="…" app-url="https://app.vimine.network" height="900" lang="en">` — the hosted enrolment form.
|
|
209
|
+
*
|
|
210
|
+
* Styled like the other elements, through CSS custom properties on the element or any ancestor:
|
|
211
|
+
*
|
|
212
|
+
* vimine-enroll { --vimine-scheme: light; --vimine-accent: #1e3a5f; --vimine-background: transparent; }
|
|
213
|
+
*
|
|
214
|
+
* `--vimine-scheme` the page's scheme; `--vimine-accent` its buttons, links and the association's name (moved towards
|
|
215
|
+
* the page's ink when it would not read on its cards); `--vimine-background` the ground behind the cards;
|
|
216
|
+
* `--vimine-typeface` the face of the whole page, fields included — one of TYPEFACES, served by Vimine (a framed page
|
|
217
|
+
* cannot use the host's fonts). The frame is styled once, when the element connects.
|
|
218
|
+
*
|
|
219
|
+
* The form opens in the element's language (`lang` on the element or the page; Italian by default). Someone who already
|
|
220
|
+
* has a Vimine account need not fill it: the form offers *Continua su Vimine*, which opens the hosted page in a new
|
|
221
|
+
* tab — there their session is recognised and they join in one step (the association's statuto and privacy notice, and
|
|
222
|
+
* nothing they have already told Vimine). It is a hand-off and not a sign-in inside the frame because a browser keeps a
|
|
223
|
+
* framed page's session apart from the same site opened directly; the frame's sandbox lets that tab open as an ordinary
|
|
224
|
+
* page (`allow-popups-to-escape-sandbox`).
|
|
225
|
+
*/
|
|
20
226
|
export declare class VimineEnroll extends HTMLElement {
|
|
21
227
|
connectedCallback(): void;
|
|
22
228
|
}
|
|
23
229
|
/**
|
|
24
230
|
* `<vimine-events slug="…" filter="upcoming" limit="10" detail-url="/eventi/{slug}">` — the association's events:
|
|
25
231
|
* the public ones for a visitor (no sign-in), every published one for a signed-in member, each with its registration
|
|
26
|
-
* types (contribution, places left) and a register button (`registrations:write`)
|
|
27
|
-
* `
|
|
232
|
+
* types (contribution, places left) and a register button (`registrations:write`). Fires `vimine-registration`
|
|
233
|
+
* `{ registration }` after a registration. `detail-url` (with `{slug}`) adds a details link.
|
|
234
|
+
*
|
|
235
|
+
* A VISITOR is offered a way in, not a bare sign-in: *Iscriviti all’associazione e prenota* opens the association's
|
|
236
|
+
* hosted enrolment page with the event (a new tab; `app-url` as on `<vimine-enroll>`) — they join and ask for the place
|
|
237
|
+
* in one go — and *Sono già socio: accedi* signs a member in here. The first is shown while the event has a registration
|
|
238
|
+
* that can be had and the association takes enrolment requests; otherwise the sign-in alone.
|
|
28
239
|
*/
|
|
29
240
|
export declare class VimineEvents extends HTMLElement {
|
|
30
241
|
private unsubscribe;
|
|
@@ -35,3 +246,4 @@ export declare class VimineEvents extends HTMLElement {
|
|
|
35
246
|
private card;
|
|
36
247
|
private typeRow;
|
|
37
248
|
}
|
|
249
|
+
export {};
|