zitejs 0.10.5 → 0.10.6

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.
@@ -69,8 +69,8 @@ export type AppFacts = {
69
69
  };
70
70
  /** Written in by `zite()` at build; both false where it didn't build the app. */
71
71
  export declare const builtAppFacts: () => AppFacts;
72
- /** @internal What the app's access mode and a function's own input say of it. */
73
- export declare const functionRules: ({ access, input }: DescribedFunction, facts: AppFacts) => string[];
72
+ /** @internal What the app's access mode says of a function. */
73
+ export declare const functionRules: ({ access }: DescribedFunction, facts: AppFacts) => string[];
74
74
  export declare function describeFunction(id: string, request: Request): Promise<DescribedFunction>;
75
75
  type RouteLike = {
76
76
  id: string;
@@ -35,33 +35,12 @@ const RESERVED_PATHS = [
35
35
  ];
36
36
  const RESERVED_PATH = 'reserved-path: the platform answers this path before the app does; give the route another';
37
37
  const WEBHOOK_PATH_PARAM = "webhook-path-param: a webhook route's path can't have parameters, because its URL is registered once; put the value in the body or query";
38
- const OWNER_INPUTS = ['userId', 'ownerId'];
39
- const inputProperties = (input) => {
40
- const properties = input
41
- ?.properties;
42
- return properties && typeof properties === 'object'
43
- ? Object.keys(properties)
44
- : [];
45
- };
46
- /** @internal What the app's access mode and a function's own input say of it. */
47
- export const functionRules = ({ access, input }, facts) => {
48
- // A role may act for other users, which is what its middleware is for.
49
- const owner = access.kind === 'signedIn' && access.roles.length === 0
50
- ? inputProperties(input).find(key => OWNER_INPUTS.includes(key))
51
- : undefined;
52
- return [
53
- ...(facts.internal && access.kind === 'anyone'
54
- ? [
55
- 'public-in-internal: anyone can call it, and this internal app signs everyone in; make it a signedInFn',
56
- ]
57
- : []),
58
- ...(owner
59
- ? [
60
- `owner-from-input: it takes ${owner} as input, which any caller can set; use context.user.id, or if a role may act for other users, add role(id) to its middleware`,
61
- ]
62
- : []),
63
- ];
64
- };
38
+ /** @internal What the app's access mode says of a function. */
39
+ export const functionRules = ({ access }, facts) => facts.internal && access.kind === 'anyone'
40
+ ? [
41
+ 'public-in-internal: anyone can call it, and this internal app signs everyone in; make it a signedInFn',
42
+ ]
43
+ : [];
65
44
  const accessOf = (chain, problems) => {
66
45
  const kinds = chain
67
46
  .map(ziteMiddlewareKind)
@@ -1 +1 @@
1
- export declare const ZITEJS_VERSION = "0.10.5";
1
+ export declare const ZITEJS_VERSION = "0.10.6";
@@ -1,2 +1,2 @@
1
1
  // Written by scripts/write-version.mjs from package.json.
2
- export const ZITEJS_VERSION = '0.10.5';
2
+ export const ZITEJS_VERSION = '0.10.6';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zitejs",
3
- "version": "0.10.5",
3
+ "version": "0.10.6",
4
4
  "description": "The Zite framework — build apps on Zite Database",
5
5
  "type": "module",
6
6
  "sideEffects": [