Skip to content

Commit

Permalink
support defining static dir
Browse files Browse the repository at this point in the history
  • Loading branch information
reddec committed Jun 1, 2020
1 parent f5acf42 commit c4ad43b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions assets/bindata.go
Git LFS file not shown
5 changes: 4 additions & 1 deletion clients/python/lambda_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from dataclasses import dataclass

from typing import Any, List, Optional
from base64 import decodebytes, encodebytes
from typing import Any, List, Optional



Expand Down Expand Up @@ -68,6 +68,7 @@ class Manifest:
tokens: 'Optional[Any]'
aliases: 'Optional[Any]'
cron: 'Optional[List[Schedule]]'
static: 'Optional[str]'

def to_json(self) -> dict:
return {
Expand All @@ -89,6 +90,7 @@ def to_json(self) -> dict:
"tokens": self.tokens,
"aliases": self.aliases,
"cron": [x.to_json() for x in self.cron],
"static": self.static,
}

@staticmethod
Expand All @@ -112,6 +114,7 @@ def from_json(payload: dict) -> 'Manifest':
tokens=payload['tokens'],
aliases=payload['aliases'],
cron=[Schedule.from_json(x) for x in (payload['cron'] or [])],
static=payload['static'],
)


Expand Down
3 changes: 3 additions & 0 deletions clients/python/project_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class Manifest:
tokens: 'Optional[Any]'
aliases: 'Optional[Any]'
cron: 'Optional[List[Schedule]]'
static: 'Optional[str]'

def to_json(self) -> dict:
return {
Expand All @@ -130,6 +131,7 @@ def to_json(self) -> dict:
"tokens": self.tokens,
"aliases": self.aliases,
"cron": [x.to_json() for x in self.cron],
"static": self.static,
}

@staticmethod
Expand All @@ -153,6 +155,7 @@ def from_json(payload: dict) -> 'Manifest':
tokens=payload['tokens'],
aliases=payload['aliases'],
cron=[Schedule.from_json(x) for x in (payload['cron'] or [])],
static=payload['static'],
)


Expand Down
1 change: 1 addition & 0 deletions clients/ts/lambda_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface Manifest {
tokens: any | null
aliases: JsonStringSet | null
cron: Array<Schedule> | null
static: string | null
}

export type JsonDuration = string; // suffixes: ns, us, ms, s, m, h
Expand Down
1 change: 1 addition & 0 deletions clients/ts/project_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export interface Manifest {
tokens: any | null
aliases: JsonStringSet | null
cron: Array<Schedule> | null
static: string | null
}

export type JsonDuration = string; // suffixes: ns, us, ms, s, m, h
Expand Down
1 change: 1 addition & 0 deletions docs/api/lambda_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ EOF
| tokens | `map[string]string` | |
| aliases | `JsonStringSet` | |
| cron | `[]Schedule` | |
| static | `string` | |

### Token

Expand Down
1 change: 1 addition & 0 deletions types/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type Manifest struct {
Tokens map[string]string `json:"tokens,omitempty"` // limit request by value in Authorization header (token => title)
Aliases JsonStringSet `json:"aliases,omitempty"` // aliases to the current app
Cron []Schedule `json:"cron,omitempty"` // crontab expression and action name to invoke
Static string `json:"static,omitempty"` // relative path to static folder
}

type Schedule struct {
Expand Down

0 comments on commit c4ad43b

Please sign in to comment.