@feedmepos/mf-common 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/auth.d.ts CHANGED
@@ -18,7 +18,7 @@ export declare class FeedMeAuth {
18
18
  static setBaseUrl(isDev: boolean): void;
19
19
  private static startBackground;
20
20
  static initialize(clientId: string): void;
21
- static prompt(root?: HTMLElement): void;
21
+ static signIn(root?: HTMLElement): void;
22
22
  static onAuthStateChanged(callback: (user: FeedMeUser | null, token: string | null) => void): void;
23
23
  static signOut(): void;
24
24
  static unmountPrompt(): void;
@@ -30,6 +30,7 @@ export declare class FeedMeAuth {
30
30
  phoneNumber?: string | null | undefined;
31
31
  } | null;
32
32
  static get token(): string | null;
33
+ static getCustomToken(): Promise<string>;
33
34
  static refreshToken(): Promise<string>;
34
35
  static getUserClaims(): Promise<{
35
36
  /** in seconds since the Unix epoch. */
package/dist/store.d.ts CHANGED
@@ -22,15 +22,14 @@ export declare class FmpUser {
22
22
  photoURL?: string | null;
23
23
  displayName?: string | null;
24
24
  phoneNumber?: string | null;
25
- private _token;
26
- private _tokenExpiredAt;
25
+ token: string;
26
+ tokenExpiredAt: Date;
27
27
  setToken(token: string, tokenExpiredAt: Date): void;
28
28
  private _adminPermissions;
29
29
  setAdminPermisssions(permissions: FdoPermissionRule[]): void;
30
30
  private _permissions;
31
31
  setPermisssions(permissions: FdoPermissionRule[]): void;
32
32
  get permissions(): FdoPermissionRule[];
33
- getIdToken(): Promise<string>;
34
33
  }
35
34
  type FmNamespace = 'prod' | 'dev';
36
35
  export declare const useCore: import("pinia").StoreDefinition<"portal-core", import("pinia")._UnwrapAll<Pick<{
@@ -40,6 +39,70 @@ export declare const useCore: import("pinia").StoreDefinition<"portal-core", imp
40
39
  photoURL?: string | null | undefined;
41
40
  displayName?: string | null | undefined;
42
41
  phoneNumber?: string | null | undefined;
42
+ token: string;
43
+ tokenExpiredAt: {
44
+ toString: () => string;
45
+ toDateString: () => string;
46
+ toTimeString: () => string;
47
+ toLocaleString: {
48
+ (): string;
49
+ (locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined): string;
50
+ (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
51
+ };
52
+ toLocaleDateString: {
53
+ (): string;
54
+ (locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined): string;
55
+ (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
56
+ };
57
+ toLocaleTimeString: {
58
+ (): string;
59
+ (locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined): string;
60
+ (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
61
+ };
62
+ valueOf: () => number;
63
+ getTime: () => number;
64
+ getFullYear: () => number;
65
+ getUTCFullYear: () => number;
66
+ getMonth: () => number;
67
+ getUTCMonth: () => number;
68
+ getDate: () => number;
69
+ getUTCDate: () => number;
70
+ getDay: () => number;
71
+ getUTCDay: () => number;
72
+ getHours: () => number;
73
+ getUTCHours: () => number;
74
+ getMinutes: () => number;
75
+ getUTCMinutes: () => number;
76
+ getSeconds: () => number;
77
+ getUTCSeconds: () => number;
78
+ getMilliseconds: () => number;
79
+ getUTCMilliseconds: () => number;
80
+ getTimezoneOffset: () => number;
81
+ setTime: (time: number) => number;
82
+ setMilliseconds: (ms: number) => number;
83
+ setUTCMilliseconds: (ms: number) => number;
84
+ setSeconds: (sec: number, ms?: number | undefined) => number;
85
+ setUTCSeconds: (sec: number, ms?: number | undefined) => number;
86
+ setMinutes: (min: number, sec?: number | undefined, ms?: number | undefined) => number;
87
+ setUTCMinutes: (min: number, sec?: number | undefined, ms?: number | undefined) => number;
88
+ setHours: (hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => number;
89
+ setUTCHours: (hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => number;
90
+ setDate: (date: number) => number;
91
+ setUTCDate: (date: number) => number;
92
+ setMonth: (month: number, date?: number | undefined) => number;
93
+ setUTCMonth: (month: number, date?: number | undefined) => number;
94
+ setFullYear: (year: number, month?: number | undefined, date?: number | undefined) => number;
95
+ setUTCFullYear: (year: number, month?: number | undefined, date?: number | undefined) => number;
96
+ toUTCString: () => string;
97
+ toISOString: () => string;
98
+ toJSON: (key?: any) => string;
99
+ [Symbol.toPrimitive]: {
100
+ (hint: "default"): string;
101
+ (hint: "string"): string;
102
+ (hint: "number"): number;
103
+ (hint: string): string | number;
104
+ };
105
+ };
43
106
  setToken: (token: string, tokenExpiredAt: Date) => void;
44
107
  setAdminPermisssions: (permissions: FdoPermissionRule[]) => void;
45
108
  setPermisssions: (permissions: FdoPermissionRule[]) => void;
@@ -52,11 +115,8 @@ export declare const useCore: import("pinia").StoreDefinition<"portal-core", imp
52
115
  actions: string | string[];
53
116
  subject: string | string[];
54
117
  }[];
55
- getIdToken: () => Promise<string>;
56
118
  } | null>;
57
119
  setUser: (user: FeedMeUser | null) => Promise<void>;
58
- signIn: () => Promise<void>;
59
- signOut: () => void;
60
120
  fetchUserAdminPermissions: () => Promise<void>;
61
121
  fetchUserPermissions: () => Promise<void>;
62
122
  namespace: import("vue").Ref<FmNamespace>;
@@ -201,6 +261,70 @@ export declare const useCore: import("pinia").StoreDefinition<"portal-core", imp
201
261
  photoURL?: string | null | undefined;
202
262
  displayName?: string | null | undefined;
203
263
  phoneNumber?: string | null | undefined;
264
+ token: string;
265
+ tokenExpiredAt: {
266
+ toString: () => string;
267
+ toDateString: () => string;
268
+ toTimeString: () => string;
269
+ toLocaleString: {
270
+ (): string;
271
+ (locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined): string;
272
+ (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
273
+ };
274
+ toLocaleDateString: {
275
+ (): string;
276
+ (locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined): string;
277
+ (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
278
+ };
279
+ toLocaleTimeString: {
280
+ (): string;
281
+ (locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined): string;
282
+ (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
283
+ };
284
+ valueOf: () => number;
285
+ getTime: () => number;
286
+ getFullYear: () => number;
287
+ getUTCFullYear: () => number;
288
+ getMonth: () => number;
289
+ getUTCMonth: () => number;
290
+ getDate: () => number;
291
+ getUTCDate: () => number;
292
+ getDay: () => number;
293
+ getUTCDay: () => number;
294
+ getHours: () => number;
295
+ getUTCHours: () => number;
296
+ getMinutes: () => number;
297
+ getUTCMinutes: () => number;
298
+ getSeconds: () => number;
299
+ getUTCSeconds: () => number;
300
+ getMilliseconds: () => number;
301
+ getUTCMilliseconds: () => number;
302
+ getTimezoneOffset: () => number;
303
+ setTime: (time: number) => number;
304
+ setMilliseconds: (ms: number) => number;
305
+ setUTCMilliseconds: (ms: number) => number;
306
+ setSeconds: (sec: number, ms?: number | undefined) => number;
307
+ setUTCSeconds: (sec: number, ms?: number | undefined) => number;
308
+ setMinutes: (min: number, sec?: number | undefined, ms?: number | undefined) => number;
309
+ setUTCMinutes: (min: number, sec?: number | undefined, ms?: number | undefined) => number;
310
+ setHours: (hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => number;
311
+ setUTCHours: (hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => number;
312
+ setDate: (date: number) => number;
313
+ setUTCDate: (date: number) => number;
314
+ setMonth: (month: number, date?: number | undefined) => number;
315
+ setUTCMonth: (month: number, date?: number | undefined) => number;
316
+ setFullYear: (year: number, month?: number | undefined, date?: number | undefined) => number;
317
+ setUTCFullYear: (year: number, month?: number | undefined, date?: number | undefined) => number;
318
+ toUTCString: () => string;
319
+ toISOString: () => string;
320
+ toJSON: (key?: any) => string;
321
+ [Symbol.toPrimitive]: {
322
+ (hint: "default"): string;
323
+ (hint: "string"): string;
324
+ (hint: "number"): number;
325
+ (hint: string): string | number;
326
+ };
327
+ };
204
328
  setToken: (token: string, tokenExpiredAt: Date) => void;
205
329
  setAdminPermisssions: (permissions: FdoPermissionRule[]) => void;
206
330
  setPermisssions: (permissions: FdoPermissionRule[]) => void;
@@ -213,11 +337,8 @@ export declare const useCore: import("pinia").StoreDefinition<"portal-core", imp
213
337
  actions: string | string[];
214
338
  subject: string | string[];
215
339
  }[];
216
- getIdToken: () => Promise<string>;
217
340
  } | null>;
218
341
  setUser: (user: FeedMeUser | null) => Promise<void>;
219
- signIn: () => Promise<void>;
220
- signOut: () => void;
221
342
  fetchUserAdminPermissions: () => Promise<void>;
222
343
  fetchUserPermissions: () => Promise<void>;
223
344
  namespace: import("vue").Ref<FmNamespace>;
@@ -362,6 +483,70 @@ export declare const useCore: import("pinia").StoreDefinition<"portal-core", imp
362
483
  photoURL?: string | null | undefined;
363
484
  displayName?: string | null | undefined;
364
485
  phoneNumber?: string | null | undefined;
486
+ token: string;
487
+ tokenExpiredAt: {
488
+ toString: () => string;
489
+ toDateString: () => string;
490
+ toTimeString: () => string;
491
+ toLocaleString: {
492
+ (): string;
493
+ (locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined): string;
494
+ (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
495
+ };
496
+ toLocaleDateString: {
497
+ (): string;
498
+ (locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined): string;
499
+ (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
500
+ };
501
+ toLocaleTimeString: {
502
+ (): string;
503
+ (locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined): string;
504
+ (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string;
505
+ };
506
+ valueOf: () => number;
507
+ getTime: () => number;
508
+ getFullYear: () => number;
509
+ getUTCFullYear: () => number;
510
+ getMonth: () => number;
511
+ getUTCMonth: () => number;
512
+ getDate: () => number;
513
+ getUTCDate: () => number;
514
+ getDay: () => number;
515
+ getUTCDay: () => number;
516
+ getHours: () => number;
517
+ getUTCHours: () => number;
518
+ getMinutes: () => number;
519
+ getUTCMinutes: () => number;
520
+ getSeconds: () => number;
521
+ getUTCSeconds: () => number;
522
+ getMilliseconds: () => number;
523
+ getUTCMilliseconds: () => number;
524
+ getTimezoneOffset: () => number;
525
+ setTime: (time: number) => number;
526
+ setMilliseconds: (ms: number) => number;
527
+ setUTCMilliseconds: (ms: number) => number;
528
+ setSeconds: (sec: number, ms?: number | undefined) => number;
529
+ setUTCSeconds: (sec: number, ms?: number | undefined) => number;
530
+ setMinutes: (min: number, sec?: number | undefined, ms?: number | undefined) => number;
531
+ setUTCMinutes: (min: number, sec?: number | undefined, ms?: number | undefined) => number;
532
+ setHours: (hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => number;
533
+ setUTCHours: (hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => number;
534
+ setDate: (date: number) => number;
535
+ setUTCDate: (date: number) => number;
536
+ setMonth: (month: number, date?: number | undefined) => number;
537
+ setUTCMonth: (month: number, date?: number | undefined) => number;
538
+ setFullYear: (year: number, month?: number | undefined, date?: number | undefined) => number;
539
+ setUTCFullYear: (year: number, month?: number | undefined, date?: number | undefined) => number;
540
+ toUTCString: () => string;
541
+ toISOString: () => string;
542
+ toJSON: (key?: any) => string;
543
+ [Symbol.toPrimitive]: {
544
+ (hint: "default"): string;
545
+ (hint: "string"): string;
546
+ (hint: "number"): number;
547
+ (hint: string): string | number;
548
+ };
549
+ };
365
550
  setToken: (token: string, tokenExpiredAt: Date) => void;
366
551
  setAdminPermisssions: (permissions: FdoPermissionRule[]) => void;
367
552
  setPermisssions: (permissions: FdoPermissionRule[]) => void;
@@ -374,11 +559,8 @@ export declare const useCore: import("pinia").StoreDefinition<"portal-core", imp
374
559
  actions: string | string[];
375
560
  subject: string | string[];
376
561
  }[];
377
- getIdToken: () => Promise<string>;
378
562
  } | null>;
379
563
  setUser: (user: FeedMeUser | null) => Promise<void>;
380
- signIn: () => Promise<void>;
381
- signOut: () => void;
382
564
  fetchUserAdminPermissions: () => Promise<void>;
383
565
  fetchUserPermissions: () => Promise<void>;
384
566
  namespace: import("vue").Ref<FmNamespace>;
@@ -516,5 +698,5 @@ export declare const useCore: import("pinia").StoreDefinition<"portal-core", imp
516
698
  readBusinesses: () => Promise<FmpBusiness | undefined>;
517
699
  changeBusiness: (business: FmpBusiness | undefined) => Promise<void>;
518
700
  setCurrentApp: (app: string) => void;
519
- }, "setUser" | "signIn" | "signOut" | "fetchUserAdminPermissions" | "fetchUserPermissions" | "readRestaurants" | "setNamespace" | "changeCountry" | "readBusinesses" | "changeBusiness" | "setCurrentApp">>;
701
+ }, "setUser" | "fetchUserAdminPermissions" | "fetchUserPermissions" | "readRestaurants" | "setNamespace" | "changeCountry" | "readBusinesses" | "changeBusiness" | "setCurrentApp">>;
520
702
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-common",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -18,18 +18,6 @@
18
18
  "publishConfig": {
19
19
  "registry": "https://registry.npmjs.org"
20
20
  },
21
- "scripts": {
22
- "dev": "vite",
23
- "build": "run-p type-check \"build-only\"",
24
- "build:mf": "vite build --mode fmmf",
25
- "build:vitePreset": "vite build --mode vite-preset",
26
- "build:dts": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.app.json --outDir ./dist && mv ./dist/src/* dist",
27
- "publish-npm": "pnpm build:mf && pnpm build:dts && pnpm build:vitePreset && pnpm publish --no-git-checks",
28
- "build-only": "pnpm build:mf && pnpm build:dts && pnpm build:vitePreset",
29
- "type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
30
- "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
31
- "format": "prettier --write src/"
32
- },
33
21
  "dependencies": {
34
22
  "@feedmepos/core": "^2.0.0",
35
23
  "@feedmepos/ui-library": "^0.0.14",
@@ -58,5 +46,17 @@
58
46
  "vite-plugin-dts": "^3.6.0",
59
47
  "vite-plugin-externalize-dependencies": "^0.10.0",
60
48
  "vue-tsc": "^1.8.11"
49
+ },
50
+ "scripts": {
51
+ "dev": "vite",
52
+ "build": "run-p type-check \"build-only\"",
53
+ "build:mf": "vite build --mode fmmf",
54
+ "build:vitePreset": "vite build --mode vite-preset",
55
+ "build:dts": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.app.json --outDir ./dist && mv ./dist/src/* dist",
56
+ "publish-npm": "pnpm build:mf && pnpm build:dts && pnpm build:vitePreset && pnpm publish --no-git-checks",
57
+ "build-only": "pnpm build:mf && pnpm build:dts && pnpm build:vitePreset",
58
+ "type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
59
+ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
60
+ "format": "prettier --write src/"
61
61
  }
62
62
  }