Compare commits

..

10 Commits
v6.04 ... v6.05

Author SHA1 Message Date
Jay Lee
537a926618 Update build.yml 2021-06-11 09:49:39 -04:00
Jay Lee
f791a59b1d GAM 6.05 2021-06-11 09:30:42 -04:00
Jay Lee
0b8e41f993 cleanup 2021-06-11 09:29:32 -04:00
Ross Scroggs
f540fa2a38 Unescape \r and \n in chatmessage text so multiline messages can be created from command line (#1387)
* Unescape \r and \n in chatmessage text so multiline messages can be created

* Bring gam report activity list up to date
2021-06-10 09:33:51 -04:00
Ross Scroggs
2d7bc2f34a Check that required arguments are present (#1386)
* Check that required arguments are present

* Correct chat message documentation
2021-06-07 15:56:09 -04:00
Jay Lee
c2dea0a4d7 add a few new user attribute types 2021-06-04 15:55:50 -04:00
Jay Lee
42cbfbf8ed Update macos-install.sh 2021-06-02 14:02:37 -04:00
Jay Lee
137e79b012 Update macos-install.sh 2021-06-02 13:49:34 -04:00
Jay Lee
5849ed3ecc Update build.yml 2021-06-02 10:04:30 -04:00
Ross Scroggs
d3dc1e1197 Add chat commands (#1384) 2021-05-27 21:07:55 -04:00
6 changed files with 51 additions and 25 deletions

View File

@@ -7,12 +7,7 @@ export distpath="dist/"
export gampath="${distpath}gam" export gampath="${distpath}gam"
rm -rf $gampath rm -rf $gampath
export specfile="gam.spec" export specfile="gam.spec"
if [ "$macver" == "10.15.7" ]; then $python -OO -m PyInstaller --clean --noupx --strip --distpath "${gampath}" --target-architecture $PLATFORM "${specfile}"
youtoo=""
else
youtoo=""
fi
$python -OO -m PyInstaller --clean --noupx --strip --distpath "${gampath}" $youtoo "${specfile}"
export gam="${gampath}/gam" export gam="${gampath}/gam"
$gam version extended $gam version extended
export GAMVERSION=`$gam version simple` export GAMVERSION=`$gam version simple`

View File

@@ -18,7 +18,7 @@ env:
MIN_OPENSSL_VERSION: "1.1.1k" MIN_OPENSSL_VERSION: "1.1.1k"
PATCHELF_VERSION: "0.12" PATCHELF_VERSION: "0.12"
# PYINSTALLER_VERSION can be full commit hash or version like v4.20 # PYINSTALLER_VERSION can be full commit hash or version like v4.20
PYINSTALLER_VERSION: "416f42b548b513fc29219eb7b4210751938b8603" PYINSTALLER_VERSION: "e5dbb051bd3d53d6c2c70cbd87270eec1765da2e"
jobs: jobs:
build: build:
@@ -104,7 +104,7 @@ jobs:
path: | path: |
~/python ~/python
~/ssl ~/ssl
key: ${{ matrix.os }}-${{ matrix.jid }}-20210511 key: ${{ matrix.os }}-${{ matrix.jid }}-20210611
- name: Set env variables - name: Set env variables
env: env:

View File

@@ -158,6 +158,7 @@ If an item contains spaces, it should be surrounded by ".
<CalendarColorIndex> ::= <Number in range 1-24> <CalendarColorIndex> ::= <Number in range 1-24>
<CalendarItem> ::= <EmailAddress>|<String> <CalendarItem> ::= <EmailAddress>|<String>
<ChatRoom> ::= <String> <ChatRoom> ::= <String>
<ChatSpace> ::= <String>
<ClientID> ::= <String> <ClientID> ::= <String>
<ColorValue> ::= <ColorName>|<ColorHex> <ColorValue> ::= <ColorName>|<ColorHex>
<CollaboratorItem> ::= <EmailAddress>|<UniqueID>|<String> <CollaboratorItem> ::= <EmailAddress>|<UniqueID>|<String>
@@ -895,23 +896,27 @@ gam delete resoldsubscription <CustomerID> <SKUID> cancel|downgrade|transfer_to_
gam info resoldsubscriptions <CustomerID> [customer_auth_token <String>] gam info resoldsubscriptions <CustomerID> [customer_auth_token <String>]
<ActivityApplicationName> ::= <ActivityApplicationName> ::=
access|accesstransparency| access_transparency|
admin| admin|
calendar|calendars| calendar|
chat| chat|
drive|doc|docs| chrome|
enterprisegroups|groupsenterprise| context_aware_access|
data_studio|
drive|
gcp| gcp|
google+|gplus| gplus|
group|groups| groups|
hangoutsmeet|meet| groups_enterprise|
jamboard| jamboard|
login|logins| keep|
login|
meet|
mobile| mobile|
oauthtoken|token|tokens|
rules| rules|
saml| saml|
useraccounts token|
user_accounts
<ReportsApp> ::= <ReportsApp> ::=
accounts| accounts|
@@ -1167,6 +1172,14 @@ gam print browsertokens [todrive]
[fields <BrowserTokenFieldNameList>] [fields <BrowserTokenFieldNameList>]
[sortheaders] [sortheaders]
gam print chatspaces [todrive]
gam print chatmembers space <ChatSpace> [todrive]
gam create chatmessage space <ChatSpace> [thread <String>]
(text <String>)|(textfile <FileName> [charset <CharSet>])
gam delete chatmessage name <String>
gam update chatmessage name <String>
(text <String>)|(textfile <FileName> [charset <CharSet>])
<CrOSAction> ::= <CrOSAction> ::=
deprovision_same_model_replace| deprovision_same_model_replace|
deprovision_different_model_replace| deprovision_different_model_replace|

View File

@@ -797,7 +797,7 @@ def doGAMVersion(checkForArgs=True):
'passlib', 'passlib',
'python-dateutil', 'python-dateutil',
'yubikey-manager', 'yubikey-manager',
'yomama'] ]
for lib in libs: for lib in libs:
try: try:
print(f'{lib} {lib_version(lib)}') print(f'{lib} {lib_version(lib)}')

View File

@@ -77,6 +77,9 @@ def print_members():
i += 1 i += 1
else: else:
controlflow.invalid_argument_exit(myarg, "gam print chatmembers") controlflow.invalid_argument_exit(myarg, "gam print chatmembers")
if not space:
controlflow.system_error_exit(2,
'space <ChatSpace> is required.')
try: try:
results = gapi.get_all_pages(chat.spaces().members(), 'list', 'memberships', parent=space) results = gapi.get_all_pages(chat.spaces().members(), 'list', 'memberships', parent=space)
except googleapiclient.errors.HttpError as err: except googleapiclient.errors.HttpError as err:
@@ -99,7 +102,7 @@ def create_message():
while i < len(sys.argv): while i < len(sys.argv):
myarg = sys.argv[i].lower() myarg = sys.argv[i].lower()
if myarg == 'text': if myarg == 'text':
body['text'] = sys.argv[i+1] body['text'] = sys.argv[i+1].replace('\\r', '\r').replace('\\n', '\n')
i += 2 i += 2
elif myarg == 'textfile': elif myarg == 'textfile':
filename = sys.argv[i + 1] filename = sys.argv[i + 1]
@@ -115,6 +118,12 @@ def create_message():
i += 2 i += 2
else: else:
controlflow.invalid_argument_exit(myarg, "gam create chat") controlflow.invalid_argument_exit(myarg, "gam create chat")
if not space:
controlflow.system_error_exit(2,
'space <ChatSpace> is required.')
if 'text' not in body:
controlflow.system_error_exit(2,
'text <String> or textfile <FileName> is required.')
if len(body['text']) > 4096: if len(body['text']) > 4096:
body['text'] = body['text'][:4095] body['text'] = body['text'][:4095]
print('WARNING: trimmed message longer than 4k to be 4k in length.') print('WARNING: trimmed message longer than 4k to be 4k in length.')
@@ -143,6 +152,9 @@ def delete_message():
i += 2 i += 2
else: else:
controlflow.invalid_argument_exit(myarg, "gam delete chat") controlflow.invalid_argument_exit(myarg, "gam delete chat")
if not name:
controlflow.system_error_exit(2,
'name <String> is required.')
try: try:
gapi.call(chat.spaces().messages(), gapi.call(chat.spaces().messages(),
'delete', 'delete',
@@ -160,7 +172,7 @@ def update_message():
while i < len(sys.argv): while i < len(sys.argv):
myarg = sys.argv[i].lower() myarg = sys.argv[i].lower()
if myarg == 'text': if myarg == 'text':
body['text'] = sys.argv[i+1] body['text'] = sys.argv[i+1].replace('\\r', '\r').replace('\\n', '\n')
i += 2 i += 2
elif myarg == 'textfile': elif myarg == 'textfile':
filename = sys.argv[i + 1] filename = sys.argv[i + 1]
@@ -171,6 +183,12 @@ def update_message():
i += 2 i += 2
else: else:
controlflow.invalid_argument_exit(myarg, "gam update chat") controlflow.invalid_argument_exit(myarg, "gam update chat")
if not name:
controlflow.system_error_exit(2,
'name <String> is required.')
if 'text' not in body:
controlflow.system_error_exit(2,
'text <String> or textfile <FileName> is required.')
if len(body['text']) > 4096: if len(body['text']) > 4096:
body['text'] = body['text'][:4095] body['text'] = body['text'][:4095]
print('WARNING: trimmed message longer than 4k to be 4k in length.') print('WARNING: trimmed message longer than 4k to be 4k in length.')

View File

@@ -8,7 +8,7 @@ import platform
import re import re
GAM_AUTHOR = 'Jay Lee <jay0lee@gmail.com>' GAM_AUTHOR = 'Jay Lee <jay0lee@gmail.com>'
GAM_VERSION = '6.04' GAM_VERSION = '6.05'
GAM_LICENSE = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' GAM_LICENSE = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
GAM_URL = 'https://git.io/gam' GAM_URL = 'https://git.io/gam'
@@ -1520,7 +1520,7 @@ USER_EXTERNALID_TYPES = [
] ]
USER_GENDER_TYPES = ['female', 'male', 'unknown'] USER_GENDER_TYPES = ['female', 'male', 'unknown']
USER_IM_TYPES = ['home', 'work', 'other'] USER_IM_TYPES = ['home', 'work', 'other']
USER_KEYWORD_TYPES = ['occupation', 'outlook'] USER_KEYWORD_TYPES = ['occupation', 'outlook', 'mission']
USER_LOCATION_TYPES = ['default', 'desk'] USER_LOCATION_TYPES = ['default', 'desk']
USER_ORGANIZATION_TYPES = ['domain_only', 'school', 'unknown', 'work'] USER_ORGANIZATION_TYPES = ['domain_only', 'school', 'unknown', 'work']
USER_PHONE_TYPES = [ USER_PHONE_TYPES = [
@@ -1535,7 +1535,7 @@ USER_RELATION_TYPES = [
] ]
USER_WEBSITE_TYPES = [ USER_WEBSITE_TYPES = [
'app_install_page', 'blog', 'ftp', 'home', 'home_page', 'other', 'profile', 'app_install_page', 'blog', 'ftp', 'home', 'home_page', 'other', 'profile',
'reservations', 'work' 'reservations', 'resume', 'work'
] ]
WEBCOLOR_MAP = { WEBCOLOR_MAP = {