@glissandoo/lib 1.58.0 → 1.59.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.
- package/functions/group.d.ts +9 -1
- package/functions/index.d.ts +1 -0
- package/functions/index.js +1 -0
- package/functions/regions.js +1 -0
- package/helpers/musicStyles/orders.js +2 -17
- package/models/Customer/index.d.ts +1 -0
- package/models/Customer/index.js +4 -1
- package/models/Customer/types.d.ts +1 -0
- package/models/Group/types.d.ts +2 -0
- package/package.json +1 -1
- package/helpers/firestore.d.ts +0 -11
- package/helpers/firestore.js +0 -196
package/functions/group.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GroupBasicData, GroupCreatedOn, GroupData, GroupStatus } from '../models/Group/types';
|
|
1
|
+
import { GroupBasicData, GroupCreatedOn, GroupData, GroupStatus, GroupTemplateData } from '../models/Group/types';
|
|
2
2
|
export declare namespace GroupFbFunctionsTypes {
|
|
3
3
|
interface PublishParams {
|
|
4
4
|
displayName: string;
|
|
@@ -34,6 +34,14 @@ export declare namespace GroupFbFunctionsTypes {
|
|
|
34
34
|
ignoreRepertoryRules: boolean;
|
|
35
35
|
}
|
|
36
36
|
type EditInstrumentsResult = void;
|
|
37
|
+
interface EditTemplateParams {
|
|
38
|
+
groupId: string;
|
|
39
|
+
templateId: string;
|
|
40
|
+
title: string;
|
|
41
|
+
playerIds: string[];
|
|
42
|
+
updateRelatedFutureEvents: boolean;
|
|
43
|
+
}
|
|
44
|
+
type EditTemplateResult = GroupTemplateData;
|
|
37
45
|
interface RemoveParams {
|
|
38
46
|
groupId: string;
|
|
39
47
|
}
|
package/functions/index.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export declare enum FbFunctionName {
|
|
|
60
60
|
GroupChangeStatus = "group-changeStatus",
|
|
61
61
|
GroupCronSatistactionIndexWeekly = "group-cronSatistactionIndexWeekly",
|
|
62
62
|
GroupEdit = "group-edit",
|
|
63
|
+
GroupEditTemplate = "group-editTemplate",
|
|
63
64
|
GroupEditInstruments = "group-editInstruments",
|
|
64
65
|
GroupGetById = "group-getById",
|
|
65
66
|
GroupOnboardingMessages = "group-onboardingMessages",
|
package/functions/index.js
CHANGED
|
@@ -64,6 +64,7 @@ var FbFunctionName;
|
|
|
64
64
|
FbFunctionName["GroupChangeStatus"] = "group-changeStatus";
|
|
65
65
|
FbFunctionName["GroupCronSatistactionIndexWeekly"] = "group-cronSatistactionIndexWeekly";
|
|
66
66
|
FbFunctionName["GroupEdit"] = "group-edit";
|
|
67
|
+
FbFunctionName["GroupEditTemplate"] = "group-editTemplate";
|
|
67
68
|
FbFunctionName["GroupEditInstruments"] = "group-editInstruments";
|
|
68
69
|
FbFunctionName["GroupGetById"] = "group-getById";
|
|
69
70
|
FbFunctionName["GroupOnboardingMessages"] = "group-onboardingMessages";
|
package/functions/regions.js
CHANGED
|
@@ -35,6 +35,7 @@ const regionByFunctions = {
|
|
|
35
35
|
[index_1.FbFunctionName.GroupPublish]: GCloudRegions.EuropeWest6,
|
|
36
36
|
[index_1.FbFunctionName.GroupEdit]: GCloudRegions.EuropeWest6,
|
|
37
37
|
[index_1.FbFunctionName.GroupEditInstruments]: GCloudRegions.EuropeWest6,
|
|
38
|
+
[index_1.FbFunctionName.GroupEditTemplate]: GCloudRegions.EuropeWest6,
|
|
38
39
|
[index_1.FbFunctionName.GroupRemove]: GCloudRegions.UsCentral1,
|
|
39
40
|
[index_1.FbFunctionName.GroupChangeStatus]: GCloudRegions.EuropeWest6,
|
|
40
41
|
[index_1.FbFunctionName.GroupOnboardingMessages]: GCloudRegions.EuropeWest6,
|
|
@@ -70,15 +70,10 @@ exports.orders = {
|
|
|
70
70
|
instruments_1.DefaultInstrumentId.FluteLow,
|
|
71
71
|
instruments_1.DefaultInstrumentId.Oboe,
|
|
72
72
|
instruments_1.DefaultInstrumentId.EnglishHorn,
|
|
73
|
-
instruments_1.DefaultInstrumentId.Bassoon,
|
|
74
|
-
instruments_1.DefaultInstrumentId.BassoonContra,
|
|
75
|
-
instruments_1.DefaultInstrumentId.ClarinetLittle,
|
|
76
73
|
instruments_1.DefaultInstrumentId.Clarinet,
|
|
77
74
|
instruments_1.DefaultInstrumentId.ClarinetBass,
|
|
78
|
-
instruments_1.DefaultInstrumentId.
|
|
79
|
-
instruments_1.DefaultInstrumentId.
|
|
80
|
-
instruments_1.DefaultInstrumentId.SaxTenor,
|
|
81
|
-
instruments_1.DefaultInstrumentId.SaxBaritone,
|
|
75
|
+
instruments_1.DefaultInstrumentId.Bassoon,
|
|
76
|
+
instruments_1.DefaultInstrumentId.BassoonContra,
|
|
82
77
|
instruments_1.DefaultInstrumentId.FrenchHorn,
|
|
83
78
|
instruments_1.DefaultInstrumentId.FlugeHorn,
|
|
84
79
|
instruments_1.DefaultInstrumentId.Trumpet,
|
|
@@ -109,16 +104,9 @@ exports.orders = {
|
|
|
109
104
|
],
|
|
110
105
|
[index_1.MusicStyleId.BigBand]: [
|
|
111
106
|
instruments_1.DefaultInstrumentId.MusicConductor,
|
|
112
|
-
instruments_1.DefaultInstrumentId.Piccolo,
|
|
113
107
|
instruments_1.DefaultInstrumentId.Flute,
|
|
114
|
-
instruments_1.DefaultInstrumentId.FluteLow,
|
|
115
108
|
instruments_1.DefaultInstrumentId.Oboe,
|
|
116
|
-
instruments_1.DefaultInstrumentId.EnglishHorn,
|
|
117
|
-
instruments_1.DefaultInstrumentId.Bassoon,
|
|
118
|
-
instruments_1.DefaultInstrumentId.BassoonContra,
|
|
119
|
-
instruments_1.DefaultInstrumentId.ClarinetLittle,
|
|
120
109
|
instruments_1.DefaultInstrumentId.Clarinet,
|
|
121
|
-
instruments_1.DefaultInstrumentId.ClarinetBass,
|
|
122
110
|
instruments_1.DefaultInstrumentId.SaxSoprano,
|
|
123
111
|
instruments_1.DefaultInstrumentId.SaxAlto,
|
|
124
112
|
instruments_1.DefaultInstrumentId.SaxTenor,
|
|
@@ -127,11 +115,8 @@ exports.orders = {
|
|
|
127
115
|
instruments_1.DefaultInstrumentId.FlugeHorn,
|
|
128
116
|
instruments_1.DefaultInstrumentId.Trumpet,
|
|
129
117
|
instruments_1.DefaultInstrumentId.Trombone,
|
|
130
|
-
instruments_1.DefaultInstrumentId.TromboneLow,
|
|
131
118
|
instruments_1.DefaultInstrumentId.Euphonium,
|
|
132
119
|
instruments_1.DefaultInstrumentId.Tuba,
|
|
133
|
-
instruments_1.DefaultInstrumentId.Cello,
|
|
134
|
-
instruments_1.DefaultInstrumentId.DoubleBass,
|
|
135
120
|
instruments_1.DefaultInstrumentId.Percussion,
|
|
136
121
|
instruments_1.DefaultInstrumentId.DrumSet,
|
|
137
122
|
],
|
package/models/Customer/index.js
CHANGED
|
@@ -50,7 +50,10 @@ class Customer extends basic_1.default {
|
|
|
50
50
|
return this.data.groupIds || [];
|
|
51
51
|
}
|
|
52
52
|
get glissandooAdminUrl() {
|
|
53
|
-
return (0, glissandooAdmin_1.getGlissandooAdminEntityURL)(collections_1.CollectionNames.
|
|
53
|
+
return (0, glissandooAdmin_1.getGlissandooAdminEntityURL)(collections_1.CollectionNames.Customer, this.id);
|
|
54
|
+
}
|
|
55
|
+
get mrr() {
|
|
56
|
+
return this.data.mrr || 0;
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
exports.default = Customer;
|
package/models/Group/types.d.ts
CHANGED
package/package.json
CHANGED
package/helpers/firestore.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as firestore from '../types/firestore';
|
|
2
|
-
/** Create a DocumentSnapshot. */
|
|
3
|
-
export declare function makeDocumentSnapshot(
|
|
4
|
-
/** Key-value pairs representing data in the document, pass in `{}` to mock the snapshot of
|
|
5
|
-
* a document that doesn't exist.
|
|
6
|
-
*/
|
|
7
|
-
data: {
|
|
8
|
-
[key: string]: unknown;
|
|
9
|
-
},
|
|
10
|
-
/** Full path of the reference (e.g. 'users/alovelace') */
|
|
11
|
-
refPath: string, project: string): firestore.DocumentSnapshot<firestore.DocumentData>;
|
package/helpers/firestore.js
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.makeDocumentSnapshot = void 0;
|
|
27
|
-
const lodash_1 = require("lodash");
|
|
28
|
-
const firestore = __importStar(require("../types/firestore"));
|
|
29
|
-
const firebase = __importStar(require("firebase-admin"));
|
|
30
|
-
/** @internal */
|
|
31
|
-
function testApp() {
|
|
32
|
-
if (typeof testApp.singleton === 'undefined') {
|
|
33
|
-
testApp.init();
|
|
34
|
-
}
|
|
35
|
-
return testApp.singleton;
|
|
36
|
-
}
|
|
37
|
-
/** @internal */
|
|
38
|
-
(function (testApp) {
|
|
39
|
-
testApp.init = () => (testApp.singleton = new testApp.App());
|
|
40
|
-
class App {
|
|
41
|
-
constructor() {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
getApp() {
|
|
45
|
-
if (typeof this.appSingleton === 'undefined') {
|
|
46
|
-
const config = process.env.FIREBASE_CONFIG
|
|
47
|
-
? JSON.parse(process.env.FIREBASE_CONFIG)
|
|
48
|
-
: {};
|
|
49
|
-
this.appSingleton = firebase.initializeApp(config,
|
|
50
|
-
// Give this app a name so it does not conflict with apps that user initialized.
|
|
51
|
-
'firebase-functions-test');
|
|
52
|
-
}
|
|
53
|
-
return this.appSingleton;
|
|
54
|
-
}
|
|
55
|
-
deleteApp() {
|
|
56
|
-
if (this.appSingleton) {
|
|
57
|
-
void this.appSingleton.delete();
|
|
58
|
-
delete this.appSingleton;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
testApp.App = App;
|
|
63
|
-
})(testApp || (testApp = {}));
|
|
64
|
-
/** @internal */
|
|
65
|
-
function objectToValueProto(data) {
|
|
66
|
-
const encodeHelper = (val) => {
|
|
67
|
-
if (typeof val === 'string') {
|
|
68
|
-
return {
|
|
69
|
-
stringValue: val,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
if (typeof val === 'boolean') {
|
|
73
|
-
return {
|
|
74
|
-
booleanValue: val,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
if (typeof val === 'number') {
|
|
78
|
-
if (val % 1 === 0) {
|
|
79
|
-
return {
|
|
80
|
-
integerValue: val,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
doubleValue: val,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
if (val instanceof Date) {
|
|
88
|
-
return {
|
|
89
|
-
timestampValue: val.toISOString(),
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
if (val instanceof Array) {
|
|
93
|
-
const encodedElements = [];
|
|
94
|
-
for (const elem of val) {
|
|
95
|
-
const enc = encodeHelper(elem);
|
|
96
|
-
if (enc) {
|
|
97
|
-
encodedElements.push(enc);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return {
|
|
101
|
-
arrayValue: {
|
|
102
|
-
values: encodedElements,
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
if (val === null) {
|
|
107
|
-
// TODO: Look this up. This is a google.protobuf.NulLValue,
|
|
108
|
-
// and everything in google.protobuf has a customized JSON encoder.
|
|
109
|
-
// OTOH, Firestore's generated .d.ts files don't take this into
|
|
110
|
-
// account and have the default proto layout.
|
|
111
|
-
return {
|
|
112
|
-
nullValue: 'NULL_VALUE',
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
if (val instanceof Buffer || val instanceof Uint8Array) {
|
|
116
|
-
return {
|
|
117
|
-
bytesValue: val,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
if (val instanceof firestore.DocumentReference) {
|
|
121
|
-
const projectId = (0, lodash_1.get)(val, '_referencePath.projectId');
|
|
122
|
-
const database = (0, lodash_1.get)(val, '_referencePath.databaseId');
|
|
123
|
-
const referenceValue = [
|
|
124
|
-
'projects',
|
|
125
|
-
projectId,
|
|
126
|
-
'databases',
|
|
127
|
-
database,
|
|
128
|
-
val.path,
|
|
129
|
-
].join('/');
|
|
130
|
-
return { referenceValue };
|
|
131
|
-
}
|
|
132
|
-
if (val instanceof firestore.Timestamp) {
|
|
133
|
-
return {
|
|
134
|
-
timestampValue: val.toDate().toISOString(),
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
if (val instanceof firestore.GeoPoint) {
|
|
138
|
-
return {
|
|
139
|
-
geoPointValue: {
|
|
140
|
-
latitude: val.latitude,
|
|
141
|
-
longitude: val.longitude,
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
if ((0, lodash_1.isPlainObject)(val)) {
|
|
146
|
-
if (!val)
|
|
147
|
-
return;
|
|
148
|
-
return {
|
|
149
|
-
mapValue: {
|
|
150
|
-
fields: objectToValueProto(val),
|
|
151
|
-
},
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
throw new Error('Cannot encode to a Firestore Value');
|
|
155
|
-
};
|
|
156
|
-
return (0, lodash_1.mapValues)(data, encodeHelper);
|
|
157
|
-
}
|
|
158
|
-
function dateToTimestampProto(timeString) {
|
|
159
|
-
if (typeof timeString === 'undefined') {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
const date = new Date(timeString);
|
|
163
|
-
const seconds = Math.floor(date.getTime() / 1000);
|
|
164
|
-
let nanos = 0;
|
|
165
|
-
if (timeString.length > 20) {
|
|
166
|
-
const nanoString = timeString.substring(20, timeString.length - 1);
|
|
167
|
-
const trailingZeroes = 9 - nanoString.length;
|
|
168
|
-
nanos = parseInt(nanoString, 10) * Math.pow(10, trailingZeroes);
|
|
169
|
-
}
|
|
170
|
-
return { seconds, nanos };
|
|
171
|
-
}
|
|
172
|
-
/** Create a DocumentSnapshot. */
|
|
173
|
-
function makeDocumentSnapshot(
|
|
174
|
-
/** Key-value pairs representing data in the document, pass in `{}` to mock the snapshot of
|
|
175
|
-
* a document that doesn't exist.
|
|
176
|
-
*/
|
|
177
|
-
data,
|
|
178
|
-
/** Full path of the reference (e.g. 'users/alovelace') */
|
|
179
|
-
refPath, project) {
|
|
180
|
-
const firestoreService = firebase.firestore(testApp().getApp());
|
|
181
|
-
const resource = `projects/${project}/databases/(default)/documents/${refPath}`;
|
|
182
|
-
const proto = (0, lodash_1.isEmpty)(data)
|
|
183
|
-
? resource
|
|
184
|
-
: {
|
|
185
|
-
fields: objectToValueProto(data),
|
|
186
|
-
createTime: dateToTimestampProto(new Date().toISOString()),
|
|
187
|
-
updateTime: dateToTimestampProto(new Date().toISOString()),
|
|
188
|
-
name: resource,
|
|
189
|
-
};
|
|
190
|
-
const readTimeProto = dateToTimestampProto(new Date().toISOString());
|
|
191
|
-
/* eslint-disable */
|
|
192
|
-
// @ts-ignore
|
|
193
|
-
return firestoreService.snapshot_(proto, readTimeProto, 'json');
|
|
194
|
-
/* eslint-enable */
|
|
195
|
-
}
|
|
196
|
-
exports.makeDocumentSnapshot = makeDocumentSnapshot;
|