Skip to content

Commit 8bb80c1

Browse files
committed
Merge remote-tracking branch 'origin/master' into rsgowman/usermetadata_tojson_lastrefreshtime
2 parents 2a92140 + c13aab5 commit 8bb80c1

File tree

251 files changed

+38469
-22737
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+38469
-22737
lines changed

.eslintrc.js

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ module.exports = {
2222
],
2323
extends: [
2424
'eslint:recommended',
25-
'plugin:@typescript-eslint/eslint-recommended',
2625
'plugin:@typescript-eslint/recommended',
2726
],
2827
rules: {
@@ -33,9 +32,19 @@ module.exports = {
3332
// Disabled checks
3433
'@typescript-eslint/no-explicit-any': 0,
3534
'@typescript-eslint/no-use-before-define': 0,
35+
'@typescript-eslint/no-var-requires': 0,
3636

3737
// Required checks
3838
'indent': ['error', 2],
39+
'keyword-spacing': ['error'],
40+
'max-len': [
41+
'error',
42+
{
43+
'code': 120,
44+
'ignoreUrls': true
45+
}
46+
],
47+
'object-curly-spacing': [2, 'always'],
3948
'@typescript-eslint/explicit-function-return-type': [
4049
'error',
4150
{
@@ -44,5 +53,65 @@ module.exports = {
4453
'allowHigherOrderFunctions': true
4554
}
4655
],
56+
'no-unused-vars': 'off', // Must be disabled to enable the next rule
57+
'@typescript-eslint/no-unused-vars': ['error'],
58+
'quotes': ['error', 'single', {'avoidEscape': true}],
59+
'@typescript-eslint/naming-convention': [
60+
'error',
61+
{
62+
"selector": "variable",
63+
"format": ["camelCase", "UPPER_CASE"]
64+
},
65+
{
66+
"selector": "parameter",
67+
"format": ["camelCase"],
68+
"leadingUnderscore": "allow"
69+
},
70+
71+
{
72+
"selector": "memberLike",
73+
"format": ["camelCase"]
74+
},
75+
76+
{
77+
"selector": "typeLike",
78+
"format": ["PascalCase"]
79+
},
80+
81+
// Ignore properties that require quotes (HTTP headers, names that include spaces or dashes etc.).
82+
{
83+
"selector": [
84+
"classProperty",
85+
"objectLiteralProperty",
86+
"typeProperty",
87+
"classMethod",
88+
"objectLiteralMethod",
89+
"typeMethod",
90+
"accessor",
91+
"enumMember"
92+
],
93+
"format": null,
94+
"modifiers": ["requiresQuotes"]
95+
},
96+
97+
// Ignore destructured property names.
98+
{
99+
"selector": "variable",
100+
"modifiers": ["destructured"],
101+
"format": null
102+
},
103+
104+
// Following types are temporarily disabled. We shall incrementally enable them in the
105+
// future, fixing any violations as we go.
106+
{
107+
"selector": [
108+
"classProperty",
109+
"objectLiteralProperty",
110+
"typeProperty",
111+
"enumMember"
112+
],
113+
"format": null
114+
}
115+
],
47116
}
48117
};

.github/actions/send-email/README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Send Email GitHub Action
2+
3+
This is a minimalistic GitHub Action for sending emails using the Mailgun API.
4+
Specify the Mailgun API key along with the Mailgun domain and message to
5+
be sent.
6+
7+
## Inputs
8+
9+
### `api-key`
10+
11+
**Required** Mailgun API key.
12+
13+
### `domain`
14+
15+
**Required** Mailgun domain name.
16+
17+
### `from`
18+
19+
**Required** Sender's email address. Ex: 'Hello User <[email protected]>' (defaults to 'user@{domain}`).
20+
21+
### `to`
22+
23+
**Required** Recipient's email address. You can use commas to separate multiple recipients.
24+
25+
### `cc`
26+
27+
Email addresses to Cc.
28+
29+
### `subject`
30+
31+
**Required** Message subject.
32+
33+
### `text`
34+
35+
Text body of the message.
36+
37+
### `html`
38+
39+
HTML body of the message.
40+
41+
## Example usage
42+
43+
```
44+
- name: Send Email
45+
uses: firebase/firebase-admin-node/.github/actions/send-email
46+
with:
47+
api-key: ${{ secrets.MAILGUN_API_KEY }}
48+
domain: ${{ secrets.MAILGUN_DOMAIN }}
49+
from: 'User <[email protected]>'
50+
html: '<h1>Testing some Mailgun awesomness!</h1>'
51+
52+
```
53+
54+
## Implementation
55+
56+
This Action uses the `mailgun.js` NPM package to send Emails.
57+
58+
When making a code change remember to run `npm run pack` to rebuild the
59+
`dist/index.js` file which is the executable of this Action.

.github/actions/send-email/action.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright 2021 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: 'Send email Action'
16+
description: 'Send emails using Mailgun from GitHub Actions workflows.'
17+
inputs:
18+
api-key:
19+
description: Mailgun API key.
20+
required: true
21+
domain:
22+
description: Mailgun domain name.
23+
required: true
24+
from:
25+
description: Senders name and email address.
26+
required: true
27+
to:
28+
description: Recipient's email address. You can use commas to separate multiple recipients.
29+
required: true
30+
cc:
31+
description: Email addresses to Cc.
32+
required: false
33+
subject:
34+
description: Message subject.
35+
required: true
36+
text:
37+
description: Text body of the message.
38+
required: false
39+
html:
40+
description: HTML body of the message.
41+
required: false
42+
runs:
43+
using: 'node12'
44+
main: 'dist/index.js'

0 commit comments

Comments
 (0)