incyclist-services 1.7.28 → 1.7.29

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.
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./service"), exports);
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
3
+ var useValue = arguments.length > 2;
4
+ for (var i = 0; i < initializers.length; i++) {
5
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
6
+ }
7
+ return useValue ? value : void 0;
8
+ };
9
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
10
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
11
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
12
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
13
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
14
+ var _, done = false;
15
+ for (var i = decorators.length - 1; i >= 0; i--) {
16
+ var context = {};
17
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
18
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
19
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
20
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
21
+ if (kind === "accessor") {
22
+ if (result === void 0) continue;
23
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
24
+ if (_ = accept(result.get)) descriptor.get = _;
25
+ if (_ = accept(result.set)) descriptor.set = _;
26
+ if (_ = accept(result.init)) initializers.unshift(_);
27
+ }
28
+ else if (_ = accept(result)) {
29
+ if (kind === "field") initializers.unshift(_);
30
+ else descriptor[key] = _;
31
+ }
32
+ }
33
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
34
+ done = true;
35
+ };
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.useSupportSettingsDisplay = exports.SupportSettingsDisplayService = void 0;
38
+ const api_1 = require("../../../api");
39
+ const decorators_1 = require("../../../base/decorators");
40
+ const service_1 = require("../../../base/service");
41
+ const types_1 = require("../../../base/types");
42
+ const service_2 = require("../../service");
43
+ const DEFAULT_PRIVACY_URL = 'https://incyclist.com/privacy';
44
+ const DEFAULT_SLACK_URL = 'https://join.slack.com/t/incyclist/shared_invite/zt-119wcvtjn-uiZ_Pw6gh5WLc0zT8jkfTg';
45
+ const DEFAULT_STRAVA_URL = 'https://www.strava.com/clubs/1029407';
46
+ const DEFAULT_EMAIL = 'support@incyclist.com';
47
+ const DEFAULT_GITHUB_URL = 'https://github.com/incyclist';
48
+ const DEFAULT_DONATION_URL = 'https://www.paypal.com/paypalme/incyclist';
49
+ let SupportSettingsDisplayService = (() => {
50
+ let _classDecorators = [decorators_1.Singleton];
51
+ let _classDescriptor;
52
+ let _classExtraInitializers = [];
53
+ let _classThis;
54
+ let _classSuper = service_1.IncyclistService;
55
+ let _instanceExtraInitializers = [];
56
+ let _getUserSettings_decorators;
57
+ let _getBindings_decorators;
58
+ var SupportSettingsDisplayService = class extends _classSuper {
59
+ static { _classThis = this; }
60
+ static {
61
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
62
+ _getUserSettings_decorators = [decorators_1.Injectable];
63
+ _getBindings_decorators = [decorators_1.Injectable];
64
+ __esDecorate(this, null, _getUserSettings_decorators, { kind: "method", name: "getUserSettings", static: false, private: false, access: { has: obj => "getUserSettings" in obj, get: obj => obj.getUserSettings }, metadata: _metadata }, null, _instanceExtraInitializers);
65
+ __esDecorate(this, null, _getBindings_decorators, { kind: "method", name: "getBindings", static: false, private: false, access: { has: obj => "getBindings" in obj, get: obj => obj.getBindings }, metadata: _metadata }, null, _instanceExtraInitializers);
66
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
67
+ SupportSettingsDisplayService = _classThis = _classDescriptor.value;
68
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
69
+ __runInitializers(_classThis, _classExtraInitializers);
70
+ }
71
+ initialized = __runInitializers(this, _instanceExtraInitializers);
72
+ observer;
73
+ constructor() {
74
+ super('SupportSettings');
75
+ }
76
+ open() {
77
+ if (this.observer)
78
+ this.close();
79
+ this.observer = new types_1.Observer();
80
+ return this.observer;
81
+ }
82
+ close() {
83
+ this.observer.stop();
84
+ delete this.observer;
85
+ }
86
+ getDisplayProps() {
87
+ return {
88
+ uuid: this.getUserSettings().get('uuid', null),
89
+ appVersion: this.getAppInfo().getAppVersion(),
90
+ uiVersion: this.getAppInfo().getUIVersion(),
91
+ privacyUrl: process.env.PRIVACY_URL ?? DEFAULT_PRIVACY_URL,
92
+ supportUrls: [
93
+ { label: 'Slack', text: 'Incyclist Slack Workspace', url: process.env.PRIVACY_URL ?? DEFAULT_SLACK_URL },
94
+ { label: 'Strava', text: 'Incyclist Strava Club', url: process.env.PRIVACY_URL ?? DEFAULT_STRAVA_URL },
95
+ { label: 'Email', text: process.env.SUPPORT_EMAIL ?? DEFAULT_EMAIL, url: `mailto:${process.env.SUPPORT_EMAIL ?? DEFAULT_EMAIL}` },
96
+ ],
97
+ gitHubUrl: process.env.GITHUB_URL ?? DEFAULT_GITHUB_URL,
98
+ donationUrl: process.env.DONATION_URL ?? DEFAULT_DONATION_URL
99
+ };
100
+ }
101
+ getAppInfo() {
102
+ return this.getBindings().appInfo;
103
+ }
104
+ getUserSettings() {
105
+ return (0, service_2.useUserSettings)();
106
+ }
107
+ getBindings() {
108
+ return (0, api_1.getBindings)();
109
+ }
110
+ };
111
+ return SupportSettingsDisplayService = _classThis;
112
+ })();
113
+ exports.SupportSettingsDisplayService = SupportSettingsDisplayService;
114
+ const useSupportSettingsDisplay = () => new SupportSettingsDisplayService();
115
+ exports.useSupportSettingsDisplay = useSupportSettingsDisplay;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './service';
@@ -0,0 +1,111 @@
1
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
2
+ var useValue = arguments.length > 2;
3
+ for (var i = 0; i < initializers.length; i++) {
4
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
5
+ }
6
+ return useValue ? value : void 0;
7
+ };
8
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
9
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
10
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
11
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
12
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
13
+ var _, done = false;
14
+ for (var i = decorators.length - 1; i >= 0; i--) {
15
+ var context = {};
16
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
17
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
18
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
19
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
20
+ if (kind === "accessor") {
21
+ if (result === void 0) continue;
22
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
23
+ if (_ = accept(result.get)) descriptor.get = _;
24
+ if (_ = accept(result.set)) descriptor.set = _;
25
+ if (_ = accept(result.init)) initializers.unshift(_);
26
+ }
27
+ else if (_ = accept(result)) {
28
+ if (kind === "field") initializers.unshift(_);
29
+ else descriptor[key] = _;
30
+ }
31
+ }
32
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
33
+ done = true;
34
+ };
35
+ import { getBindings } from "../../../api";
36
+ import { Injectable, Singleton } from "../../../base/decorators";
37
+ import { IncyclistService } from "../../../base/service";
38
+ import { Observer } from "../../../base/types";
39
+ import { useUserSettings } from "../../service";
40
+ const DEFAULT_PRIVACY_URL = 'https://incyclist.com/privacy';
41
+ const DEFAULT_SLACK_URL = 'https://join.slack.com/t/incyclist/shared_invite/zt-119wcvtjn-uiZ_Pw6gh5WLc0zT8jkfTg';
42
+ const DEFAULT_STRAVA_URL = 'https://www.strava.com/clubs/1029407';
43
+ const DEFAULT_EMAIL = 'support@incyclist.com';
44
+ const DEFAULT_GITHUB_URL = 'https://github.com/incyclist';
45
+ const DEFAULT_DONATION_URL = 'https://www.paypal.com/paypalme/incyclist';
46
+ let SupportSettingsDisplayService = (() => {
47
+ let _classDecorators = [Singleton];
48
+ let _classDescriptor;
49
+ let _classExtraInitializers = [];
50
+ let _classThis;
51
+ let _classSuper = IncyclistService;
52
+ let _instanceExtraInitializers = [];
53
+ let _getUserSettings_decorators;
54
+ let _getBindings_decorators;
55
+ var SupportSettingsDisplayService = class extends _classSuper {
56
+ static { _classThis = this; }
57
+ static {
58
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
59
+ _getUserSettings_decorators = [Injectable];
60
+ _getBindings_decorators = [Injectable];
61
+ __esDecorate(this, null, _getUserSettings_decorators, { kind: "method", name: "getUserSettings", static: false, private: false, access: { has: obj => "getUserSettings" in obj, get: obj => obj.getUserSettings }, metadata: _metadata }, null, _instanceExtraInitializers);
62
+ __esDecorate(this, null, _getBindings_decorators, { kind: "method", name: "getBindings", static: false, private: false, access: { has: obj => "getBindings" in obj, get: obj => obj.getBindings }, metadata: _metadata }, null, _instanceExtraInitializers);
63
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
64
+ SupportSettingsDisplayService = _classThis = _classDescriptor.value;
65
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
66
+ __runInitializers(_classThis, _classExtraInitializers);
67
+ }
68
+ initialized = __runInitializers(this, _instanceExtraInitializers);
69
+ observer;
70
+ constructor() {
71
+ super('SupportSettings');
72
+ }
73
+ open() {
74
+ if (this.observer)
75
+ this.close();
76
+ this.observer = new Observer();
77
+ return this.observer;
78
+ }
79
+ close() {
80
+ this.observer.stop();
81
+ delete this.observer;
82
+ }
83
+ getDisplayProps() {
84
+ return {
85
+ uuid: this.getUserSettings().get('uuid', null),
86
+ appVersion: this.getAppInfo().getAppVersion(),
87
+ uiVersion: this.getAppInfo().getUIVersion(),
88
+ privacyUrl: process.env.PRIVACY_URL ?? DEFAULT_PRIVACY_URL,
89
+ supportUrls: [
90
+ { label: 'Slack', text: 'Incyclist Slack Workspace', url: process.env.PRIVACY_URL ?? DEFAULT_SLACK_URL },
91
+ { label: 'Strava', text: 'Incyclist Strava Club', url: process.env.PRIVACY_URL ?? DEFAULT_STRAVA_URL },
92
+ { label: 'Email', text: process.env.SUPPORT_EMAIL ?? DEFAULT_EMAIL, url: `mailto:${process.env.SUPPORT_EMAIL ?? DEFAULT_EMAIL}` },
93
+ ],
94
+ gitHubUrl: process.env.GITHUB_URL ?? DEFAULT_GITHUB_URL,
95
+ donationUrl: process.env.DONATION_URL ?? DEFAULT_DONATION_URL
96
+ };
97
+ }
98
+ getAppInfo() {
99
+ return this.getBindings().appInfo;
100
+ }
101
+ getUserSettings() {
102
+ return useUserSettings();
103
+ }
104
+ getBindings() {
105
+ return getBindings();
106
+ }
107
+ };
108
+ return SupportSettingsDisplayService = _classThis;
109
+ })();
110
+ export { SupportSettingsDisplayService };
111
+ export const useSupportSettingsDisplay = () => new SupportSettingsDisplayService();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './service';
@@ -0,0 +1,17 @@
1
+ import { IAppInfo } from "../../../api/appInfo";
2
+ import { IncyclistService } from "../../../base/service";
3
+ import { Observer } from "../../../base/types";
4
+ import { IObserver } from "../../../types";
5
+ import { SupportSettingsDisplayProps } from "./types";
6
+ export declare class SupportSettingsDisplayService extends IncyclistService {
7
+ protected initialized: false;
8
+ protected observer: Observer;
9
+ constructor();
10
+ open(): IObserver;
11
+ close(): void;
12
+ getDisplayProps(): SupportSettingsDisplayProps;
13
+ protected getAppInfo(): IAppInfo;
14
+ protected getUserSettings(): import("../../service").UserSettingsService;
15
+ protected getBindings(): import("../../../api").IncyclistBindings;
16
+ }
17
+ export declare const useSupportSettingsDisplay: () => SupportSettingsDisplayService;
@@ -0,0 +1,14 @@
1
+ export type SupportUrl = {
2
+ label: string;
3
+ text: string;
4
+ url: string;
5
+ };
6
+ export type SupportSettingsDisplayProps = {
7
+ uuid: string;
8
+ appVersion: string;
9
+ uiVersion: string;
10
+ privacyUrl: string;
11
+ supportUrls: Array<SupportUrl>;
12
+ gitHubUrl: string;
13
+ donationUrl: string;
14
+ };
@@ -0,0 +1,2 @@
1
+ export type * from './display/support/types';
2
+ export type * from './display/user/types';
@@ -4,3 +4,4 @@ export type * from './api/types';
4
4
  export type * from './routes/types';
5
5
  export type * from './activities/types';
6
6
  export type * from './ride/types';
7
+ export type * from './settings/types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-services",
3
- "version": "1.7.28",
3
+ "version": "1.7.29",
4
4
  "peerDependencies": {
5
5
  "gd-eventlog": "^0.1.27"
6
6
  },