@glissandoo/lib 1.0.24 → 1.0.26

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.
@@ -70,5 +70,6 @@ export declare enum FbFunctionName {
70
70
  PartnershipPlanRemove = "partnershipPlan-remove",
71
71
  PartnershipPlanOnUpdate = "partnershipPlan-onUpdate",
72
72
  PartnershipGroupAdd = "partnershipGroup-add",
73
- PartnershipGroupRemove = "partnershipGroup-remove"
73
+ PartnershipGroupRemove = "partnershipGroup-remove",
74
+ MiscAddSubscriber = "misc-addSubscriber"
74
75
  }
@@ -75,4 +75,5 @@ var FbFunctionName;
75
75
  FbFunctionName["PartnershipPlanOnUpdate"] = "partnershipPlan-onUpdate";
76
76
  FbFunctionName["PartnershipGroupAdd"] = "partnershipGroup-add";
77
77
  FbFunctionName["PartnershipGroupRemove"] = "partnershipGroup-remove";
78
+ FbFunctionName["MiscAddSubscriber"] = "misc-addSubscriber";
78
79
  })(FbFunctionName = exports.FbFunctionName || (exports.FbFunctionName = {}));
@@ -6,4 +6,8 @@ export declare namespace MiscFbFunctionsTypes {
6
6
  valid: boolean;
7
7
  message: string;
8
8
  }
9
+ interface MiscAddSubscriberParams {
10
+ email: string;
11
+ }
12
+ type MiscAddSubscriberResult = void;
9
13
  }
@@ -81,6 +81,7 @@ const regionByFunctions = {
81
81
  [index_1.FbFunctionName.PartnershipPlanOnUpdate]: GCloudRegions.EuropeWest6,
82
82
  [index_1.FbFunctionName.PartnershipGroupAdd]: GCloudRegions.EuropeWest6,
83
83
  [index_1.FbFunctionName.PartnershipGroupRemove]: GCloudRegions.EuropeWest6,
84
+ [index_1.FbFunctionName.MiscAddSubscriber]: GCloudRegions.EuropeWest6,
84
85
  };
85
86
  const getFunctionRegion = (fn) => regionByFunctions[fn] || defaultRegion;
86
87
  exports.getFunctionRegion = getFunctionRegion;
package/helpers/auth.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { LanguagesTypes } from '../lang';
1
2
  import { GroupPlayerRole } from '../models/Group/Player/types';
2
3
  export interface AuthUserClaims {
3
4
  groups?: Record<string, GroupPlayerRole>;
@@ -17,4 +18,4 @@ export interface AuthURLParams {
17
18
  error?: string;
18
19
  return_to?: string;
19
20
  }
20
- export declare const getRedirectSignIn: (params?: AuthURLParams | undefined) => string;
21
+ export declare const getAuthURL: (path: string, lang: LanguagesTypes, params?: AuthURLParams | undefined) => string;
package/helpers/auth.js CHANGED
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRedirectSignIn = exports.AuthErrors = void 0;
4
- const SIGNIN_PAGE = 'https://auth.glissandoo.com/signin';
3
+ exports.getAuthURL = exports.AuthErrors = void 0;
4
+ const lang_1 = require("../lang");
5
+ const AUTH_HOST = 'https://auth.glissandoo.com';
5
6
  var AuthErrors;
6
7
  (function (AuthErrors) {
7
8
  AuthErrors["NoSuperAdmin"] = "error.auth.notSuperadmin";
@@ -11,8 +12,8 @@ var AuthErrors;
11
12
  AuthErrors["NoPartnerhispAdmin"] = "error.auth.noPartnershipAdmin";
12
13
  AuthErrors["Unauthenticated"] = "error.auth.unauthenticated";
13
14
  })(AuthErrors = exports.AuthErrors || (exports.AuthErrors = {}));
14
- const getRedirectSignIn = (params) => {
15
- const url = new URL(SIGNIN_PAGE);
15
+ const getAuthURL = (path, lang, params) => {
16
+ const url = new URL(lang === lang_1.defaultLocale ? path : path, AUTH_HOST);
16
17
  if (params) {
17
18
  for (const param of Object.entries(params)) {
18
19
  url.searchParams.set(param[0], param[1]);
@@ -20,4 +21,4 @@ const getRedirectSignIn = (params) => {
20
21
  }
21
22
  return url.toString();
22
23
  };
23
- exports.getRedirectSignIn = getRedirectSignIn;
24
+ exports.getAuthURL = getAuthURL;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",