@oatscenter/trellis 0.100.0-rc.7 → 0.100.0-rc.9

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.
Files changed (34) hide show
  1. package/auth/authority.js +3 -0
  2. package/auth/protocol_wasm/client/trellis_protocol_wasm_bg.wasm +0 -0
  3. package/auth/protocol_wasm/provider/trellis_protocol_wasm_bg.wasm +0 -0
  4. package/auth/protocol_wasm.d.ts +2 -0
  5. package/caller.d.ts +1 -1
  6. package/caller.js +7 -1
  7. package/generated_support.js +8 -1
  8. package/internal_sdk/generated/apis/auth/mod.d.ts +109 -1
  9. package/internal_sdk/generated/apis/auth/mod.js +131 -5
  10. package/internal_sdk/generated/apis/core/mod.js +4 -4
  11. package/internal_sdk/generated/apis/events/mod.js +4 -4
  12. package/internal_sdk/generated/apis/health/mod.js +4 -4
  13. package/internal_sdk/generated/apis/jobs/mod.js +4 -4
  14. package/internal_sdk/generated/apis/state/mod.js +4 -4
  15. package/internal_sdk/generated/apps/cli/mod.d.ts +35 -0
  16. package/internal_sdk/generated/apps/cli/mod.js +42 -0
  17. package/internal_sdk/generated/apps/console/mod.d.ts +35 -0
  18. package/internal_sdk/generated/apps/console/mod.js +42 -0
  19. package/internal_sdk/generated/package.json +2 -2
  20. package/internal_sdk/generated/participants/eventsRuntime/mod.d.ts +9 -0
  21. package/internal_sdk/generated/participants/eventsRuntime/mod.js +13 -4
  22. package/internal_sdk/generated/participants/healthRuntime/mod.js +4 -4
  23. package/internal_sdk/generated/participants/jobsRuntime/mod.d.ts +9 -0
  24. package/internal_sdk/generated/participants/jobsRuntime/mod.js +13 -4
  25. package/internal_sdk/generated/participants/platform/mod.d.ts +10 -1
  26. package/internal_sdk/generated/participants/platform/mod.js +15 -6
  27. package/internal_sdk/generated/types/_internal/p0.d.ts +268 -0
  28. package/internal_sdk/generated/types/_internal/p0.js +136 -0
  29. package/internal_sdk/generated/types/index.d.ts +54 -0
  30. package/internal_sdk/generated/types/index.js +27 -0
  31. package/package.json +3 -2
  32. package/service/runtime/service.js +74 -6
  33. package/session.d.ts +10 -1
  34. package/session.js +32 -3
package/auth/authority.js CHANGED
@@ -63,6 +63,9 @@ export class VerifiedAuthority {
63
63
  }),
64
64
  ...(text(profile.email) && { email: text(profile.email) }),
65
65
  emailVerified: profile.emailVerified === true,
66
+ ...(text(profile.avatarUrl) && {
67
+ avatarUrl: text(profile.avatarUrl),
68
+ }),
66
69
  }
67
70
  : undefined;
68
71
  return {
@@ -187,6 +187,8 @@ export type CallerUser = {
187
187
  familyName?: string;
188
188
  email?: string;
189
189
  emailVerified: boolean;
190
+ /** Stable Trellis-hosted photo URL; a new photo gets a new URL. */
191
+ avatarUrl?: string;
190
192
  };
191
193
  /** Cryptographically authenticated request binding, before dispatch authorization. */
192
194
  export type VerifySessionRequestResult = {
package/caller.d.ts CHANGED
@@ -148,7 +148,7 @@ export type CallerRuntime<TContract extends GeneratedCaller> = CallerSelectedAct
148
148
  transfer: Trellis["transfer"];
149
149
  wait(): AsyncResult<void, BaseError>;
150
150
  };
151
- type OptionalCapability<TContract extends GeneratedCaller> = TContract["uses"][number]["optionalCapabilities"][number];
151
+ type OptionalCapability<TContract extends GeneratedCaller> = TContract["uses"][number]["optionalCapabilities"][number] | TContract["uses"][number]["actions"][number]["optionalCapabilities"][number];
152
152
  type OptionalResource<TContract extends GeneratedCaller> = {
153
153
  [Name in keyof CallerResources<TContract>]: CallerResources<TContract>[Name] extends {
154
154
  availability: "optional";
package/caller.js CHANGED
@@ -26,7 +26,13 @@ export function createCallerRuntime(session, contract, resources = {}) {
26
26
  runtime.connection.bindAuthorityAvailability(runtime.ownAuthority, (snapshot, installed) => {
27
27
  const capabilities = {};
28
28
  for (const selection of contract.uses) {
29
- for (const capability of selection.optionalCapabilities) {
29
+ // A requested group also reports each member that allows a selected
30
+ // action, so an app can gate on one member held without the group.
31
+ const keys = new Set([
32
+ ...selection.optionalCapabilities,
33
+ ...selection.actions.flatMap((action) => action.optionalCapabilities),
34
+ ]);
35
+ for (const capability of keys) {
30
36
  // An authority carries a group's members, not the group itself.
31
37
  capabilities[capability] =
32
38
  snapshot !== undefined &&
@@ -119,8 +119,15 @@ function jsonValue(value) {
119
119
  if (prototype === Object.prototype || prototype === null) {
120
120
  const result = {};
121
121
  for (const [key, item] of Object.entries(value)) {
122
+ // Define rather than assign: assigning `__proto__` would invoke the
123
+ // inherited setter instead of keeping it as an ordinary JSON key.
122
124
  if (item !== undefined)
123
- result[key] = jsonValue(item);
125
+ Object.defineProperty(result, key, {
126
+ value: jsonValue(item),
127
+ enumerable: true,
128
+ writable: true,
129
+ configurable: true,
130
+ });
124
131
  }
125
132
  return result;
126
133
  }
@@ -145,6 +145,14 @@ export type OIDCRoleMappingsListInput = Types0.AuthOIDCRoleMappingsListRequest;
145
145
  export type OIDCRoleMappingsListOutput = Types0.AuthOIDCRoleMappingsListResponse;
146
146
  export type OIDCRoleMappingsPutInput = Types0.AuthOIDCRoleMappingPutRequest;
147
147
  export type OIDCRoleMappingsPutOutput = Types0.AuthOIDCRoleMappingPutResponse;
148
+ export type PortalThemesDeleteInput = Types0.AuthPortalThemeDeleteRequest;
149
+ export type PortalThemesDeleteOutput = Types0.AuthMutationResult;
150
+ export type PortalThemesGetInput = Types0.AuthPortalThemeGetRequest;
151
+ export type PortalThemesGetOutput = Types0.AuthPortalThemeGetResponse;
152
+ export type PortalThemesListInput = Types0.AuthPageRequest;
153
+ export type PortalThemesListOutput = Types0.AuthPortalThemesListResponse;
154
+ export type PortalThemesPutInput = Types0.AuthPortalThemePutRequest;
155
+ export type PortalThemesPutOutput = Types0.AuthPortalThemeGetResponse;
148
156
  export type PrincipalsEffectiveAccessInput = Types0.AuthPrincipalRequest;
149
157
  export type PrincipalsEffectiveAccessOutput = Types0.AuthEffectiveAccessResponse;
150
158
  export type ResourceBindingsQueryInput = Types0.AuthResourceBindingsQueryRequest;
@@ -179,6 +187,16 @@ export type ServiceInstancesProvisionInput = Types0.AuthInstanceProvisionRequest
179
187
  export type ServiceInstancesProvisionOutput = Types0.AuthInstanceProvisionResponse;
180
188
  export type ServiceInstancesRemoveInput = Types0.AuthInstanceMutationRequest;
181
189
  export type ServiceInstancesRemoveOutput = Types0.AuthInstanceMutationResponse;
190
+ export type ServiceUpdatesDecideInput = Types0.AuthServiceUpdateDecideRequest;
191
+ export type ServiceUpdatesDecideOutput = Types0.AuthServiceUpdateResponse;
192
+ export type ServiceUpdatesGetInput = Types0.AuthServiceUpdateStatusRequest;
193
+ export type ServiceUpdatesGetOutput = Types0.AuthServiceUpdateResponse;
194
+ export type ServiceUpdatesListInput = Types0.AuthServiceUpdatesListRequest;
195
+ export type ServiceUpdatesListOutput = Types0.AuthServiceUpdatesListResponse;
196
+ export type ServiceUpdatesStatusInput = Types0.AuthServiceUpdateStatusRequest;
197
+ export type ServiceUpdatesStatusOutput = Types0.AuthServiceUpdateResponse;
198
+ export type ServiceUpdatesSubmitInput = Types0.AuthServiceUpdateSubmitRequest;
199
+ export type ServiceUpdatesSubmitOutput = Types0.AuthServiceUpdateResponse;
182
200
  export type SessionsListInput = Types0.AuthPageRequest;
183
201
  export type SessionsListOutput = Types0.AuthSessionsListResponse;
184
202
  export type SessionsLogoutInput = Types0.AuthEmpty;
@@ -738,6 +756,46 @@ declare const __api: {
738
756
  readonly download: false;
739
757
  readonly pagination: undefined;
740
758
  };
759
+ readonly "rpc:PortalThemes.Delete": {
760
+ readonly kind: "rpc";
761
+ readonly descriptorName: "rpc:PortalThemes.Delete";
762
+ readonly subject: "rpc.v1.auth.PortalThemes.Delete";
763
+ readonly input: typeof Types0.AuthPortalThemeDeleteRequestCodec;
764
+ readonly output: typeof Types0.AuthMutationResultCodec;
765
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
766
+ readonly download: false;
767
+ readonly pagination: undefined;
768
+ };
769
+ readonly "rpc:PortalThemes.Get": {
770
+ readonly kind: "rpc";
771
+ readonly descriptorName: "rpc:PortalThemes.Get";
772
+ readonly subject: "rpc.v1.auth.PortalThemes.Get";
773
+ readonly input: typeof Types0.AuthPortalThemeGetRequestCodec;
774
+ readonly output: typeof Types0.AuthPortalThemeGetResponseCodec;
775
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
776
+ readonly download: false;
777
+ readonly pagination: undefined;
778
+ };
779
+ readonly "rpc:PortalThemes.List": {
780
+ readonly kind: "rpc";
781
+ readonly descriptorName: "rpc:PortalThemes.List";
782
+ readonly subject: "rpc.v1.auth.PortalThemes.List";
783
+ readonly input: typeof Types0.AuthPageRequestCodec;
784
+ readonly output: typeof Types0.AuthPortalThemesListResponseCodec;
785
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
786
+ readonly download: false;
787
+ readonly pagination: "cursor";
788
+ };
789
+ readonly "rpc:PortalThemes.Put": {
790
+ readonly kind: "rpc";
791
+ readonly descriptorName: "rpc:PortalThemes.Put";
792
+ readonly subject: "rpc.v1.auth.PortalThemes.Put";
793
+ readonly input: typeof Types0.AuthPortalThemePutRequestCodec;
794
+ readonly output: typeof Types0.AuthPortalThemeGetResponseCodec;
795
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
796
+ readonly download: false;
797
+ readonly pagination: undefined;
798
+ };
741
799
  readonly "rpc:Principals.EffectiveAccess": {
742
800
  readonly kind: "rpc";
743
801
  readonly descriptorName: "rpc:Principals.EffectiveAccess";
@@ -908,6 +966,56 @@ declare const __api: {
908
966
  readonly download: false;
909
967
  readonly pagination: undefined;
910
968
  };
969
+ readonly "rpc:ServiceUpdates.Decide": {
970
+ readonly kind: "rpc";
971
+ readonly descriptorName: "rpc:ServiceUpdates.Decide";
972
+ readonly subject: "rpc.v1.auth.ServiceUpdates.Decide";
973
+ readonly input: typeof Types0.AuthServiceUpdateDecideRequestCodec;
974
+ readonly output: typeof Types0.AuthServiceUpdateResponseCodec;
975
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
976
+ readonly download: false;
977
+ readonly pagination: undefined;
978
+ };
979
+ readonly "rpc:ServiceUpdates.Get": {
980
+ readonly kind: "rpc";
981
+ readonly descriptorName: "rpc:ServiceUpdates.Get";
982
+ readonly subject: "rpc.v1.auth.ServiceUpdates.Get";
983
+ readonly input: typeof Types0.AuthServiceUpdateStatusRequestCodec;
984
+ readonly output: typeof Types0.AuthServiceUpdateResponseCodec;
985
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
986
+ readonly download: false;
987
+ readonly pagination: undefined;
988
+ };
989
+ readonly "rpc:ServiceUpdates.List": {
990
+ readonly kind: "rpc";
991
+ readonly descriptorName: "rpc:ServiceUpdates.List";
992
+ readonly subject: "rpc.v1.auth.ServiceUpdates.List";
993
+ readonly input: typeof Types0.AuthServiceUpdatesListRequestCodec;
994
+ readonly output: typeof Types0.AuthServiceUpdatesListResponseCodec;
995
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
996
+ readonly download: false;
997
+ readonly pagination: "cursor";
998
+ };
999
+ readonly "rpc:ServiceUpdates.Status": {
1000
+ readonly kind: "rpc";
1001
+ readonly descriptorName: "rpc:ServiceUpdates.Status";
1002
+ readonly subject: "rpc.v1.auth.ServiceUpdates.Status";
1003
+ readonly input: typeof Types0.AuthServiceUpdateStatusRequestCodec;
1004
+ readonly output: typeof Types0.AuthServiceUpdateResponseCodec;
1005
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
1006
+ readonly download: false;
1007
+ readonly pagination: undefined;
1008
+ };
1009
+ readonly "rpc:ServiceUpdates.Submit": {
1010
+ readonly kind: "rpc";
1011
+ readonly descriptorName: "rpc:ServiceUpdates.Submit";
1012
+ readonly subject: "rpc.v1.auth.ServiceUpdates.Submit";
1013
+ readonly input: typeof Types0.AuthServiceUpdateSubmitRequestCodec;
1014
+ readonly output: typeof Types0.AuthServiceUpdateResponseCodec;
1015
+ readonly errors: readonly [typeof AuthError, typeof UnexpectedError, typeof ValidationError];
1016
+ readonly download: false;
1017
+ readonly pagination: undefined;
1018
+ };
911
1019
  readonly "rpc:Sessions.List": {
912
1020
  readonly kind: "rpc";
913
1021
  readonly descriptorName: "rpc:Sessions.List";
@@ -1104,5 +1212,5 @@ declare const __api: {
1104
1212
  readonly packageEvidence: unknown;
1105
1213
  };
1106
1214
  export declare const API: typeof __api;
1107
- export declare const API_DIGEST: "TlJ5mH8wSh3ySLe_wbZTBhdAXBmi9fKVJ-dYof_YezI";
1215
+ export declare const API_DIGEST: "70efFyG36wPgi_tjvIJYT_R_MTMH121LVRkPutD2xk0";
1108
1216
  export {};