@echovisionlab/geul-proto 0.1.0
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.
- package/LICENSE.md +6 -0
- package/README.md +6 -0
- package/eslint.config.mjs +15 -0
- package/gen/api/common/v1/common_pb.ts +391 -0
- package/gen/api/common/v1/media_pb.ts +578 -0
- package/gen/api/content/v1/block_catalog.ts +5978 -0
- package/gen/api/content/v1/block_content_pb.ts +11420 -0
- package/gen/api/intra/v1/artist_pb.ts +597 -0
- package/gen/api/intra/v1/campaign_pb.ts +383 -0
- package/gen/api/intra/v1/collaboration_pb.ts +661 -0
- package/gen/api/intra/v1/email_courier_pb.ts +98 -0
- package/gen/api/intra/v1/email_layout_pb.ts +295 -0
- package/gen/api/intra/v1/email_template_pb.ts +384 -0
- package/gen/api/intra/v1/file_ingest_pb.ts +144 -0
- package/gen/api/intra/v1/form_locale_catalog.ts +128 -0
- package/gen/api/intra/v1/form_locale_catalog_parity.json +24 -0
- package/gen/api/intra/v1/form_pb.ts +276 -0
- package/gen/api/intra/v1/gateway_authorization_pb.ts +96 -0
- package/gen/api/intra/v1/label_pb.ts +558 -0
- package/gen/api/intra/v1/map_pb.ts +382 -0
- package/gen/api/intra/v1/menu_pb.ts +282 -0
- package/gen/api/intra/v1/og_pb.ts +335 -0
- package/gen/api/intra/v1/page_pb.ts +572 -0
- package/gen/api/intra/v1/post_pb.ts +657 -0
- package/gen/api/intra/v1/post_series_pb.ts +217 -0
- package/gen/api/intra/v1/privacy_pb.ts +384 -0
- package/gen/api/intra/v1/program_event_pb.ts +390 -0
- package/gen/api/intra/v1/release_pb.ts +462 -0
- package/gen/api/intra/v1/terms_pb.ts +384 -0
- package/gen/api/intra/v1/work_pb.ts +477 -0
- package/gen/api/manage/v1/account_pb.ts +1311 -0
- package/gen/api/manage/v1/admin_pb.ts +681 -0
- package/gen/api/manage/v1/ai_pb.ts +2621 -0
- package/gen/api/manage/v1/artist_pb.ts +1271 -0
- package/gen/api/manage/v1/audience_pb.ts +597 -0
- package/gen/api/manage/v1/campaign_pb.ts +1289 -0
- package/gen/api/manage/v1/category_pb.ts +351 -0
- package/gen/api/manage/v1/client_pb.ts +512 -0
- package/gen/api/manage/v1/collaboration_pb.ts +112 -0
- package/gen/api/manage/v1/comment_pb.ts +530 -0
- package/gen/api/manage/v1/common_pb.ts +192 -0
- package/gen/api/manage/v1/email_layout_pb.ts +487 -0
- package/gen/api/manage/v1/email_suppression_pb.ts +192 -0
- package/gen/api/manage/v1/email_template_pb.ts +683 -0
- package/gen/api/manage/v1/events_pb.ts +3251 -0
- package/gen/api/manage/v1/file_pb.ts +2810 -0
- package/gen/api/manage/v1/form_pb.ts +1046 -0
- package/gen/api/manage/v1/format_pb.ts +321 -0
- package/gen/api/manage/v1/genre_pb.ts +340 -0
- package/gen/api/manage/v1/label_pb.ts +1105 -0
- package/gen/api/manage/v1/mail_adapter_pb.ts +656 -0
- package/gen/api/manage/v1/map_place_pb.ts +572 -0
- package/gen/api/manage/v1/map_theme_pb.ts +691 -0
- package/gen/api/manage/v1/member_pb.ts +1281 -0
- package/gen/api/manage/v1/menu_pb.ts +535 -0
- package/gen/api/manage/v1/page_pb.ts +894 -0
- package/gen/api/manage/v1/post_pb.ts +1475 -0
- package/gen/api/manage/v1/privacy_pb.ts +518 -0
- package/gen/api/manage/v1/program_event_pb.ts +2234 -0
- package/gen/api/manage/v1/release_pb.ts +1168 -0
- package/gen/api/manage/v1/series_pb.ts +1033 -0
- package/gen/api/manage/v1/share_link_pb.ts +351 -0
- package/gen/api/manage/v1/site_setting_pb.ts +623 -0
- package/gen/api/manage/v1/style_pb.ts +340 -0
- package/gen/api/manage/v1/tag_pb.ts +323 -0
- package/gen/api/manage/v1/terms_pb.ts +517 -0
- package/gen/api/manage/v1/track_pb.ts +543 -0
- package/gen/api/manage/v1/translation_pb.ts +1838 -0
- package/gen/api/manage/v1/work_pb.ts +1662 -0
- package/gen/api/open/v1/account_pb.ts +243 -0
- package/gen/api/open/v1/artist_pb.ts +732 -0
- package/gen/api/open/v1/category_pb.ts +143 -0
- package/gen/api/open/v1/client_pb.ts +190 -0
- package/gen/api/open/v1/file_pb.ts +244 -0
- package/gen/api/open/v1/form_pb.ts +698 -0
- package/gen/api/open/v1/label_pb.ts +512 -0
- package/gen/api/open/v1/manifest_pb.ts +326 -0
- package/gen/api/open/v1/map_place_pb.ts +228 -0
- package/gen/api/open/v1/map_theme_pb.ts +400 -0
- package/gen/api/open/v1/member_pb.ts +200 -0
- package/gen/api/open/v1/newsletter_pb.ts +77 -0
- package/gen/api/open/v1/page_pb.ts +236 -0
- package/gen/api/open/v1/post_pb.ts +834 -0
- package/gen/api/open/v1/privacy_pb.ts +257 -0
- package/gen/api/open/v1/program_event_pb.ts +1024 -0
- package/gen/api/open/v1/release_pb.ts +758 -0
- package/gen/api/open/v1/series_pb.ts +210 -0
- package/gen/api/open/v1/share_link_pb.ts +106 -0
- package/gen/api/open/v1/sitemap_pb.ts +188 -0
- package/gen/api/open/v1/tag_pb.ts +136 -0
- package/gen/api/open/v1/terms_pb.ts +257 -0
- package/gen/api/open/v1/translation_pb.ts +103 -0
- package/gen/api/open/v1/work_pb.ts +904 -0
- package/gen/api/policy/v1/access_pb.ts +105 -0
- package/gen/api/policy/v1/spicedb/artist.ts +101 -0
- package/gen/api/policy/v1/spicedb/audience.ts +64 -0
- package/gen/api/policy/v1/spicedb/campaign.ts +49 -0
- package/gen/api/policy/v1/spicedb/core.ts +196 -0
- package/gen/api/policy/v1/spicedb/email_authoring.ts +91 -0
- package/gen/api/policy/v1/spicedb/email_delivery.ts +44 -0
- package/gen/api/policy/v1/spicedb/file.ts +49 -0
- package/gen/api/policy/v1/spicedb/form.ts +54 -0
- package/gen/api/policy/v1/spicedb/internal.ts +350 -0
- package/gen/api/policy/v1/spicedb/label.ts +98 -0
- package/gen/api/policy/v1/spicedb/legal_policy.ts +103 -0
- package/gen/api/policy/v1/spicedb/map_theme.ts +48 -0
- package/gen/api/policy/v1/spicedb/member.ts +47 -0
- package/gen/api/policy/v1/spicedb/menu.ts +48 -0
- package/gen/api/policy/v1/spicedb/page.ts +54 -0
- package/gen/api/policy/v1/spicedb/post.ts +105 -0
- package/gen/api/policy/v1/spicedb/post_series.ts +70 -0
- package/gen/api/policy/v1/spicedb/program_event.ts +66 -0
- package/gen/api/policy/v1/spicedb/program_event_series.ts +62 -0
- package/gen/api/policy/v1/spicedb/reference_data.ts +209 -0
- package/gen/api/policy/v1/spicedb/release.ts +81 -0
- package/gen/api/policy/v1/spicedb/site_settings.ts +49 -0
- package/gen/api/policy/v1/spicedb/translation.ts +46 -0
- package/gen/api/policy/v1/spicedb/work.ts +58 -0
- package/package.json +66 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.14.0 with parameter "target=ts,import_extension=ts"
|
|
2
|
+
// @generated from file api/policy/v1/access.proto (package api.policy.v1, syntax proto3)
|
|
3
|
+
import type {
|
|
4
|
+
GenEnum,
|
|
5
|
+
GenExtension,
|
|
6
|
+
GenFile,
|
|
7
|
+
GenMessage,
|
|
8
|
+
} from "@bufbuild/protobuf/codegenv2";
|
|
9
|
+
import {
|
|
10
|
+
enumDesc,
|
|
11
|
+
extDesc,
|
|
12
|
+
fileDesc,
|
|
13
|
+
messageDesc,
|
|
14
|
+
} from "@bufbuild/protobuf/codegenv2";
|
|
15
|
+
import type { MethodOptions } from "@bufbuild/protobuf/wkt";
|
|
16
|
+
import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt";
|
|
17
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Describes the file api/policy/v1/access.proto.
|
|
21
|
+
*/
|
|
22
|
+
export const file_api_policy_v1_access: GenFile =
|
|
23
|
+
/*@__PURE__*/
|
|
24
|
+
fileDesc(
|
|
25
|
+
"ChphcGkvcG9saWN5L3YxL2FjY2Vzcy5wcm90bxINYXBpLnBvbGljeS52MSJgCgxBY2Nlc3NQb2xpY3kSLgoEcm9sZRgBIAEoDjIgLmFwaS5wb2xpY3kudjEuQXV0aG9yaXphdGlvblJvbGUSEAoIcmVzb3VyY2UYAiABKAkSDgoGYWN0aW9uGAMgASgJKk8KEUF1dGhvcml6YXRpb25Sb2xlEg8KC1VOU1BFQ0lGSUVEEAASCAoEQU5PThABEggKBFVTRVIQAhIKCgZBVVRIT1IQAxIJCgVBRE1JThAEOlUKBmFjY2VzcxIeLmdvb2dsZS5wcm90b2J1Zi5NZXRob2RPcHRpb25zGLmOAyABKAsyGy5hcGkucG9saWN5LnYxLkFjY2Vzc1BvbGljeVIGYWNjZXNzQrUBChFjb20uYXBpLnBvbGljeS52MUILQWNjZXNzUHJvdG9QAVo9Z2l0aHViLmNvbS9kc3ViLWlvL2V2ZW50LWNvbnRyYWN0cy9nZW4vYXBpL3BvbGljeS92MTtwb2xpY3l2MaICA0FQWKoCDUFwaS5Qb2xpY3kuVjHKAg1BcGlcUG9saWN5XFYx4gIZQXBpXFBvbGljeVxWMVxHUEJNZXRhZGF0YeoCD0FwaTo6UG9saWN5OjpWMWIGcHJvdG8z",
|
|
26
|
+
[file_google_protobuf_descriptor],
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* AccessPolicy defines gateway-level policy metadata for an RPC.
|
|
31
|
+
*
|
|
32
|
+
* @generated from message api.policy.v1.AccessPolicy
|
|
33
|
+
*/
|
|
34
|
+
export type AccessPolicy = Message<"api.policy.v1.AccessPolicy"> & {
|
|
35
|
+
/**
|
|
36
|
+
* @generated from field: api.policy.v1.AuthorizationRole role = 1;
|
|
37
|
+
*/
|
|
38
|
+
role: AuthorizationRole;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @generated from field: string resource = 2;
|
|
42
|
+
*/
|
|
43
|
+
resource: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @generated from field: string action = 3;
|
|
47
|
+
*/
|
|
48
|
+
action: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Describes the message api.policy.v1.AccessPolicy.
|
|
53
|
+
* Use `create(AccessPolicySchema)` to create a new message.
|
|
54
|
+
*/
|
|
55
|
+
export const AccessPolicySchema: GenMessage<AccessPolicy> =
|
|
56
|
+
/*@__PURE__*/
|
|
57
|
+
messageDesc(file_api_policy_v1_access, 0);
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* AuthorizationRole is the single site-wide authorization vocabulary used by
|
|
61
|
+
* account projections, manage access policies, and the gateway. Protobuf JSON
|
|
62
|
+
* uses these enum identifiers verbatim.
|
|
63
|
+
*
|
|
64
|
+
* @generated from enum api.policy.v1.AuthorizationRole
|
|
65
|
+
*/
|
|
66
|
+
export enum AuthorizationRole {
|
|
67
|
+
/**
|
|
68
|
+
* @generated from enum value: UNSPECIFIED = 0;
|
|
69
|
+
*/
|
|
70
|
+
UNSPECIFIED = 0,
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @generated from enum value: ANON = 1;
|
|
74
|
+
*/
|
|
75
|
+
ANON = 1,
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @generated from enum value: USER = 2;
|
|
79
|
+
*/
|
|
80
|
+
USER = 2,
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @generated from enum value: AUTHOR = 3;
|
|
84
|
+
*/
|
|
85
|
+
AUTHOR = 3,
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @generated from enum value: ADMIN = 4;
|
|
89
|
+
*/
|
|
90
|
+
ADMIN = 4,
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Describes the enum api.policy.v1.AuthorizationRole.
|
|
95
|
+
*/
|
|
96
|
+
export const AuthorizationRoleSchema: GenEnum<AuthorizationRole> =
|
|
97
|
+
/*@__PURE__*/
|
|
98
|
+
enumDesc(file_api_policy_v1_access, 0);
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @generated from extension: api.policy.v1.AccessPolicy access = 51001;
|
|
102
|
+
*/
|
|
103
|
+
export const access: GenExtension<MethodOptions, AccessPolicy> =
|
|
104
|
+
/*@__PURE__*/
|
|
105
|
+
extDesc(file_api_policy_v1_access, 0);
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// Code generated by scripts/generated/generate-spicedb-catalog.mjs.
|
|
2
|
+
// DO NOT EDIT.
|
|
3
|
+
//
|
|
4
|
+
// Domain: artist — Artist ownership, management, hierarchy, and share links
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
accountIdentityRelationshipSubject,
|
|
8
|
+
createCan,
|
|
9
|
+
createRelationshipMutation,
|
|
10
|
+
createRelationshipSnapshotPlan,
|
|
11
|
+
createResource,
|
|
12
|
+
createResourceLookup,
|
|
13
|
+
platformRelationshipSubject,
|
|
14
|
+
RelationshipOperation,
|
|
15
|
+
resourceRelationshipSubject,
|
|
16
|
+
} from "./internal.ts";
|
|
17
|
+
import type {
|
|
18
|
+
Actor,
|
|
19
|
+
Can,
|
|
20
|
+
RelationshipMutation,
|
|
21
|
+
RelationshipSnapshotPlan,
|
|
22
|
+
Resource,
|
|
23
|
+
ResourceLookup,
|
|
24
|
+
} from "./internal.ts";
|
|
25
|
+
|
|
26
|
+
export const Artist = Object.freeze({
|
|
27
|
+
Resource: (id: string): Resource => createResource("artist", id),
|
|
28
|
+
LookupManage: (): ResourceLookup => createResourceLookup("artist", "manage"),
|
|
29
|
+
Edit: (id: string): Can => createCan("artist", id, "edit", "edit"),
|
|
30
|
+
View: (id: string): Can => createCan("artist", id, "view", "view"),
|
|
31
|
+
Delete: (id: string): Can => createCan("artist", id, "delete", "delete"),
|
|
32
|
+
Publish: (id: string): Can => createCan("artist", id, "publish", "publish"),
|
|
33
|
+
Manage: (id: string): Can => createCan("artist", id, "manage", "manage"),
|
|
34
|
+
ManageParticipants: (id: string): Can =>
|
|
35
|
+
createCan("artist", id, "manage_participants", "manage_participants"),
|
|
36
|
+
ManageShareLinks: (id: string): Can =>
|
|
37
|
+
createCan("artist", id, "manage_share_links", "manage_share_links"),
|
|
38
|
+
RemoveOwner: (id: string): Can =>
|
|
39
|
+
createCan("artist", id, "remove_owner", "platform_admin"),
|
|
40
|
+
Create: (): Can =>
|
|
41
|
+
createCan("platform", "global", "artist.create", "is_admin"),
|
|
42
|
+
List: (): Can => createCan("platform", "global", "artist.list", "is_admin"),
|
|
43
|
+
Snapshot: (id: string): RelationshipSnapshotPlan =>
|
|
44
|
+
createRelationshipSnapshotPlan("artist", id, "platform_admin", "parent"),
|
|
45
|
+
TouchPolicy: (id: string): RelationshipMutation =>
|
|
46
|
+
createRelationshipMutation(
|
|
47
|
+
createResource("artist", id),
|
|
48
|
+
"policy",
|
|
49
|
+
platformRelationshipSubject(),
|
|
50
|
+
RelationshipOperation.Touch,
|
|
51
|
+
),
|
|
52
|
+
DeletePolicy: (id: string): RelationshipMutation =>
|
|
53
|
+
createRelationshipMutation(
|
|
54
|
+
createResource("artist", id),
|
|
55
|
+
"policy",
|
|
56
|
+
platformRelationshipSubject(),
|
|
57
|
+
RelationshipOperation.Delete,
|
|
58
|
+
),
|
|
59
|
+
TouchOwner: (id: string, actor: Actor): RelationshipMutation =>
|
|
60
|
+
createRelationshipMutation(
|
|
61
|
+
createResource("artist", id),
|
|
62
|
+
"owner",
|
|
63
|
+
accountIdentityRelationshipSubject(actor),
|
|
64
|
+
RelationshipOperation.Touch,
|
|
65
|
+
),
|
|
66
|
+
DeleteOwner: (id: string, actor: Actor): RelationshipMutation =>
|
|
67
|
+
createRelationshipMutation(
|
|
68
|
+
createResource("artist", id),
|
|
69
|
+
"owner",
|
|
70
|
+
accountIdentityRelationshipSubject(actor),
|
|
71
|
+
RelationshipOperation.Delete,
|
|
72
|
+
),
|
|
73
|
+
TouchManager: (id: string, actor: Actor): RelationshipMutation =>
|
|
74
|
+
createRelationshipMutation(
|
|
75
|
+
createResource("artist", id),
|
|
76
|
+
"manager",
|
|
77
|
+
accountIdentityRelationshipSubject(actor),
|
|
78
|
+
RelationshipOperation.Touch,
|
|
79
|
+
),
|
|
80
|
+
DeleteManager: (id: string, actor: Actor): RelationshipMutation =>
|
|
81
|
+
createRelationshipMutation(
|
|
82
|
+
createResource("artist", id),
|
|
83
|
+
"manager",
|
|
84
|
+
accountIdentityRelationshipSubject(actor),
|
|
85
|
+
RelationshipOperation.Delete,
|
|
86
|
+
),
|
|
87
|
+
TouchParent: (id: string, parentId: string): RelationshipMutation =>
|
|
88
|
+
createRelationshipMutation(
|
|
89
|
+
createResource("artist", id),
|
|
90
|
+
"parent",
|
|
91
|
+
resourceRelationshipSubject("artist", parentId, ""),
|
|
92
|
+
RelationshipOperation.Touch,
|
|
93
|
+
),
|
|
94
|
+
DeleteParent: (id: string, parentId: string): RelationshipMutation =>
|
|
95
|
+
createRelationshipMutation(
|
|
96
|
+
createResource("artist", id),
|
|
97
|
+
"parent",
|
|
98
|
+
resourceRelationshipSubject("artist", parentId, ""),
|
|
99
|
+
RelationshipOperation.Delete,
|
|
100
|
+
),
|
|
101
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Code generated by scripts/generated/generate-spicedb-catalog.mjs.
|
|
2
|
+
// DO NOT EDIT.
|
|
3
|
+
//
|
|
4
|
+
// Domain: audience — Audience Segment resource policy
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
accountIdentityRelationshipSubject,
|
|
8
|
+
createCan,
|
|
9
|
+
createRelationshipMutation,
|
|
10
|
+
createRelationshipSnapshotPlan,
|
|
11
|
+
createResource,
|
|
12
|
+
platformRelationshipSubject,
|
|
13
|
+
RelationshipOperation,
|
|
14
|
+
resourceRelationshipSubject,
|
|
15
|
+
} from "./internal.ts";
|
|
16
|
+
import type {
|
|
17
|
+
Actor,
|
|
18
|
+
Can,
|
|
19
|
+
RelationshipMutation,
|
|
20
|
+
RelationshipSnapshotPlan,
|
|
21
|
+
Resource,
|
|
22
|
+
} from "./internal.ts";
|
|
23
|
+
|
|
24
|
+
export const AudienceSegment = Object.freeze({
|
|
25
|
+
Resource: (id: string): Resource => createResource("audience_segment", id),
|
|
26
|
+
View: (id: string): Can => createCan("audience_segment", id, "view", "view"),
|
|
27
|
+
Edit: (id: string): Can => createCan("audience_segment", id, "edit", "edit"),
|
|
28
|
+
Delete: (id: string): Can =>
|
|
29
|
+
createCan("audience_segment", id, "delete", "delete"),
|
|
30
|
+
Manage: (id: string): Can =>
|
|
31
|
+
createCan("audience_segment", id, "manage", "manage"),
|
|
32
|
+
Create: (): Can =>
|
|
33
|
+
createCan("platform", "global", "audience_segment.create", "is_admin"),
|
|
34
|
+
List: (): Can =>
|
|
35
|
+
createCan("platform", "global", "audience_segment.list", "is_admin"),
|
|
36
|
+
ListAuthenticatedAccess: (): Can =>
|
|
37
|
+
createCan(
|
|
38
|
+
"platform",
|
|
39
|
+
"global",
|
|
40
|
+
"audience_segment.list_authenticated_access",
|
|
41
|
+
"is_author",
|
|
42
|
+
),
|
|
43
|
+
Snapshot: (id: string): RelationshipSnapshotPlan =>
|
|
44
|
+
createRelationshipSnapshotPlan(
|
|
45
|
+
"audience_segment",
|
|
46
|
+
id,
|
|
47
|
+
"platform_admin",
|
|
48
|
+
"",
|
|
49
|
+
),
|
|
50
|
+
TouchPolicy: (id: string): RelationshipMutation =>
|
|
51
|
+
createRelationshipMutation(
|
|
52
|
+
createResource("audience_segment", id),
|
|
53
|
+
"policy",
|
|
54
|
+
platformRelationshipSubject(),
|
|
55
|
+
RelationshipOperation.Touch,
|
|
56
|
+
),
|
|
57
|
+
DeletePolicy: (id: string): RelationshipMutation =>
|
|
58
|
+
createRelationshipMutation(
|
|
59
|
+
createResource("audience_segment", id),
|
|
60
|
+
"policy",
|
|
61
|
+
platformRelationshipSubject(),
|
|
62
|
+
RelationshipOperation.Delete,
|
|
63
|
+
),
|
|
64
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Code generated by scripts/generated/generate-spicedb-catalog.mjs.
|
|
2
|
+
// DO NOT EDIT.
|
|
3
|
+
//
|
|
4
|
+
// Domain: campaign — Campaign resource policy
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
accountIdentityRelationshipSubject,
|
|
8
|
+
createCan,
|
|
9
|
+
createRelationshipMutation,
|
|
10
|
+
createRelationshipSnapshotPlan,
|
|
11
|
+
createResource,
|
|
12
|
+
platformRelationshipSubject,
|
|
13
|
+
RelationshipOperation,
|
|
14
|
+
resourceRelationshipSubject,
|
|
15
|
+
} from "./internal.ts";
|
|
16
|
+
import type {
|
|
17
|
+
Actor,
|
|
18
|
+
Can,
|
|
19
|
+
RelationshipMutation,
|
|
20
|
+
RelationshipSnapshotPlan,
|
|
21
|
+
Resource,
|
|
22
|
+
} from "./internal.ts";
|
|
23
|
+
|
|
24
|
+
export const Campaign = Object.freeze({
|
|
25
|
+
Resource: (id: string): Resource => createResource("campaign", id),
|
|
26
|
+
View: (id: string): Can => createCan("campaign", id, "view", "view"),
|
|
27
|
+
Edit: (id: string): Can => createCan("campaign", id, "edit", "edit"),
|
|
28
|
+
Delete: (id: string): Can => createCan("campaign", id, "delete", "delete"),
|
|
29
|
+
Manage: (id: string): Can => createCan("campaign", id, "manage", "manage"),
|
|
30
|
+
Create: (): Can =>
|
|
31
|
+
createCan("platform", "global", "campaign.create", "is_admin"),
|
|
32
|
+
List: (): Can => createCan("platform", "global", "campaign.list", "is_admin"),
|
|
33
|
+
Snapshot: (id: string): RelationshipSnapshotPlan =>
|
|
34
|
+
createRelationshipSnapshotPlan("campaign", id, "platform_admin", ""),
|
|
35
|
+
TouchPolicy: (id: string): RelationshipMutation =>
|
|
36
|
+
createRelationshipMutation(
|
|
37
|
+
createResource("campaign", id),
|
|
38
|
+
"policy",
|
|
39
|
+
platformRelationshipSubject(),
|
|
40
|
+
RelationshipOperation.Touch,
|
|
41
|
+
),
|
|
42
|
+
DeletePolicy: (id: string): RelationshipMutation =>
|
|
43
|
+
createRelationshipMutation(
|
|
44
|
+
createResource("campaign", id),
|
|
45
|
+
"policy",
|
|
46
|
+
platformRelationshipSubject(),
|
|
47
|
+
RelationshipOperation.Delete,
|
|
48
|
+
),
|
|
49
|
+
});
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
// Code generated by scripts/generated/generate-spicedb-catalog.mjs.
|
|
2
|
+
// DO NOT EDIT.
|
|
3
|
+
// Shared account-identity, delegation, role, and platform authorization core.
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
accountIdentityRelationshipSubject,
|
|
7
|
+
createActor,
|
|
8
|
+
createCan,
|
|
9
|
+
createDecision,
|
|
10
|
+
createDelegation,
|
|
11
|
+
createRelationshipMutation,
|
|
12
|
+
createResource,
|
|
13
|
+
createSubjectLookup,
|
|
14
|
+
createRole,
|
|
15
|
+
DelegationKind,
|
|
16
|
+
RelationshipOperation,
|
|
17
|
+
resourceRelationshipSubject,
|
|
18
|
+
} from "./internal.ts";
|
|
19
|
+
import type {
|
|
20
|
+
Actor,
|
|
21
|
+
AuthorizationDecision,
|
|
22
|
+
Can,
|
|
23
|
+
Delegation,
|
|
24
|
+
RelationshipMutation,
|
|
25
|
+
RelationshipSnapshotPlan,
|
|
26
|
+
Resource,
|
|
27
|
+
RoleID,
|
|
28
|
+
SubjectLookup,
|
|
29
|
+
} from "./internal.ts";
|
|
30
|
+
|
|
31
|
+
export const spiceDbCatalogFingerprint =
|
|
32
|
+
"b1c92baf58538b463ae2a94d9b26c3c7e920b22bf92ca71841196b017592a2fe" as const;
|
|
33
|
+
|
|
34
|
+
export type {
|
|
35
|
+
Actor,
|
|
36
|
+
Action,
|
|
37
|
+
AuthorizationDecision,
|
|
38
|
+
Can,
|
|
39
|
+
Delegation,
|
|
40
|
+
RelationshipMutation,
|
|
41
|
+
RelationshipSnapshotPlan,
|
|
42
|
+
Resource,
|
|
43
|
+
ResourceLookup,
|
|
44
|
+
RoleID,
|
|
45
|
+
SubjectLookup,
|
|
46
|
+
} from "./internal.ts";
|
|
47
|
+
export { DelegationKind, RelationshipOperation } from "./internal.ts";
|
|
48
|
+
|
|
49
|
+
export const NewAccountIdentityActor = createActor;
|
|
50
|
+
|
|
51
|
+
export function DirectSession(sessionId: string): Delegation {
|
|
52
|
+
return createDelegation(DelegationKind.DirectSession, { sessionId });
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function mcpDelegation(
|
|
56
|
+
kind: typeof DelegationKind.MCPOAuth,
|
|
57
|
+
delegationId: string,
|
|
58
|
+
delegationDisplayName: string,
|
|
59
|
+
): Delegation {
|
|
60
|
+
return createDelegation(kind, {
|
|
61
|
+
delegationId,
|
|
62
|
+
delegationDisplayName,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function MCPOAuth(
|
|
67
|
+
delegationId: string,
|
|
68
|
+
delegationDisplayName: string,
|
|
69
|
+
): Delegation {
|
|
70
|
+
return mcpDelegation(
|
|
71
|
+
DelegationKind.MCPOAuth,
|
|
72
|
+
delegationId,
|
|
73
|
+
delegationDisplayName,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// NewAuthorizationDecision creates an immutable descriptor and performs no I/O.
|
|
78
|
+
export const NewAuthorizationDecision = createDecision;
|
|
79
|
+
|
|
80
|
+
export const Role = Object.freeze({
|
|
81
|
+
Admin: (): RoleID => createRole("admin"),
|
|
82
|
+
Author: (): RoleID => createRole("author"),
|
|
83
|
+
User: (): RoleID => createRole("user"),
|
|
84
|
+
Parse: (value: string): RoleID | undefined => {
|
|
85
|
+
switch (value) {
|
|
86
|
+
case "admin":
|
|
87
|
+
return Role.Admin();
|
|
88
|
+
case "author":
|
|
89
|
+
return Role.Author();
|
|
90
|
+
case "user":
|
|
91
|
+
return Role.User();
|
|
92
|
+
default:
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
TouchMember: (role: RoleID, actor: Actor): RelationshipMutation =>
|
|
97
|
+
createRelationshipMutation(
|
|
98
|
+
createResource("role", role.id),
|
|
99
|
+
"member",
|
|
100
|
+
accountIdentityRelationshipSubject(actor),
|
|
101
|
+
RelationshipOperation.Touch,
|
|
102
|
+
),
|
|
103
|
+
DeleteMember: (role: RoleID, actor: Actor): RelationshipMutation =>
|
|
104
|
+
createRelationshipMutation(
|
|
105
|
+
createResource("role", role.id),
|
|
106
|
+
"member",
|
|
107
|
+
accountIdentityRelationshipSubject(actor),
|
|
108
|
+
RelationshipOperation.Delete,
|
|
109
|
+
),
|
|
110
|
+
TouchAuthorIncludesAdmin: (): RelationshipMutation =>
|
|
111
|
+
createRelationshipMutation(
|
|
112
|
+
createResource("role", Role.Author().id),
|
|
113
|
+
"member",
|
|
114
|
+
resourceRelationshipSubject("role", Role.Admin().id, "member"),
|
|
115
|
+
RelationshipOperation.Touch,
|
|
116
|
+
),
|
|
117
|
+
DeleteAuthorIncludesAdmin: (): RelationshipMutation =>
|
|
118
|
+
createRelationshipMutation(
|
|
119
|
+
createResource("role", Role.Author().id),
|
|
120
|
+
"member",
|
|
121
|
+
resourceRelationshipSubject("role", Role.Admin().id, "member"),
|
|
122
|
+
RelationshipOperation.Delete,
|
|
123
|
+
),
|
|
124
|
+
TouchUserIncludesAuthor: (): RelationshipMutation =>
|
|
125
|
+
createRelationshipMutation(
|
|
126
|
+
createResource("role", Role.User().id),
|
|
127
|
+
"member",
|
|
128
|
+
resourceRelationshipSubject("role", Role.Author().id, "member"),
|
|
129
|
+
RelationshipOperation.Touch,
|
|
130
|
+
),
|
|
131
|
+
DeleteUserIncludesAuthor: (): RelationshipMutation =>
|
|
132
|
+
createRelationshipMutation(
|
|
133
|
+
createResource("role", Role.User().id),
|
|
134
|
+
"member",
|
|
135
|
+
resourceRelationshipSubject("role", Role.Author().id, "member"),
|
|
136
|
+
RelationshipOperation.Delete,
|
|
137
|
+
),
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const platformResource: Resource = createResource("platform", "global");
|
|
141
|
+
|
|
142
|
+
export const Platform = Object.freeze({
|
|
143
|
+
Resource: (): Resource => platformResource,
|
|
144
|
+
IsAdmin: (): Can => createCan("platform", "global", "is_admin", "is_admin"),
|
|
145
|
+
IsAuthor: (): Can =>
|
|
146
|
+
createCan("platform", "global", "is_author", "is_author"),
|
|
147
|
+
IsUser: (): Can => createCan("platform", "global", "is_user", "is_user"),
|
|
148
|
+
LookupAdminSubjects: (): SubjectLookup =>
|
|
149
|
+
createSubjectLookup("platform", "global", "is_admin", "account_identity"),
|
|
150
|
+
LookupAuthorSubjects: (): SubjectLookup =>
|
|
151
|
+
createSubjectLookup("platform", "global", "is_author", "account_identity"),
|
|
152
|
+
LookupUserSubjects: (): SubjectLookup =>
|
|
153
|
+
createSubjectLookup("platform", "global", "is_user", "account_identity"),
|
|
154
|
+
TouchAdminRole: (): RelationshipMutation =>
|
|
155
|
+
createRelationshipMutation(
|
|
156
|
+
platformResource,
|
|
157
|
+
"admin",
|
|
158
|
+
resourceRelationshipSubject("role", Role.Admin().id, "member"),
|
|
159
|
+
RelationshipOperation.Touch,
|
|
160
|
+
),
|
|
161
|
+
DeleteAdminRole: (): RelationshipMutation =>
|
|
162
|
+
createRelationshipMutation(
|
|
163
|
+
platformResource,
|
|
164
|
+
"admin",
|
|
165
|
+
resourceRelationshipSubject("role", Role.Admin().id, "member"),
|
|
166
|
+
RelationshipOperation.Delete,
|
|
167
|
+
),
|
|
168
|
+
TouchAuthorRole: (): RelationshipMutation =>
|
|
169
|
+
createRelationshipMutation(
|
|
170
|
+
platformResource,
|
|
171
|
+
"author",
|
|
172
|
+
resourceRelationshipSubject("role", Role.Author().id, "member"),
|
|
173
|
+
RelationshipOperation.Touch,
|
|
174
|
+
),
|
|
175
|
+
DeleteAuthorRole: (): RelationshipMutation =>
|
|
176
|
+
createRelationshipMutation(
|
|
177
|
+
platformResource,
|
|
178
|
+
"author",
|
|
179
|
+
resourceRelationshipSubject("role", Role.Author().id, "member"),
|
|
180
|
+
RelationshipOperation.Delete,
|
|
181
|
+
),
|
|
182
|
+
TouchUserRole: (): RelationshipMutation =>
|
|
183
|
+
createRelationshipMutation(
|
|
184
|
+
platformResource,
|
|
185
|
+
"user",
|
|
186
|
+
resourceRelationshipSubject("role", Role.User().id, "member"),
|
|
187
|
+
RelationshipOperation.Touch,
|
|
188
|
+
),
|
|
189
|
+
DeleteUserRole: (): RelationshipMutation =>
|
|
190
|
+
createRelationshipMutation(
|
|
191
|
+
platformResource,
|
|
192
|
+
"user",
|
|
193
|
+
resourceRelationshipSubject("role", Role.User().id, "member"),
|
|
194
|
+
RelationshipOperation.Delete,
|
|
195
|
+
),
|
|
196
|
+
});
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Code generated by scripts/generated/generate-spicedb-catalog.mjs.
|
|
2
|
+
// DO NOT EDIT.
|
|
3
|
+
//
|
|
4
|
+
// Domain: email_authoring — Email Template and Email Layout authoring policy
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
accountIdentityRelationshipSubject,
|
|
8
|
+
createCan,
|
|
9
|
+
createRelationshipMutation,
|
|
10
|
+
createRelationshipSnapshotPlan,
|
|
11
|
+
createResource,
|
|
12
|
+
platformRelationshipSubject,
|
|
13
|
+
RelationshipOperation,
|
|
14
|
+
resourceRelationshipSubject,
|
|
15
|
+
} from "./internal.ts";
|
|
16
|
+
import type {
|
|
17
|
+
Actor,
|
|
18
|
+
Can,
|
|
19
|
+
RelationshipMutation,
|
|
20
|
+
RelationshipSnapshotPlan,
|
|
21
|
+
Resource,
|
|
22
|
+
} from "./internal.ts";
|
|
23
|
+
|
|
24
|
+
export const EmailTemplate = Object.freeze({
|
|
25
|
+
Resource: (id: string): Resource => createResource("email_template", id),
|
|
26
|
+
View: (id: string): Can => createCan("email_template", id, "view", "view"),
|
|
27
|
+
Edit: (id: string): Can => createCan("email_template", id, "edit", "edit"),
|
|
28
|
+
Delete: (id: string): Can =>
|
|
29
|
+
createCan("email_template", id, "delete", "delete"),
|
|
30
|
+
Manage: (id: string): Can =>
|
|
31
|
+
createCan("email_template", id, "manage", "manage"),
|
|
32
|
+
Create: (): Can =>
|
|
33
|
+
createCan("platform", "global", "email_template.create", "is_admin"),
|
|
34
|
+
List: (): Can =>
|
|
35
|
+
createCan("platform", "global", "email_template.list", "is_admin"),
|
|
36
|
+
Snapshot: (id: string): RelationshipSnapshotPlan =>
|
|
37
|
+
createRelationshipSnapshotPlan("email_template", id, "platform_admin", ""),
|
|
38
|
+
TouchPolicy: (id: string): RelationshipMutation =>
|
|
39
|
+
createRelationshipMutation(
|
|
40
|
+
createResource("email_template", id),
|
|
41
|
+
"policy",
|
|
42
|
+
platformRelationshipSubject(),
|
|
43
|
+
RelationshipOperation.Touch,
|
|
44
|
+
),
|
|
45
|
+
DeletePolicy: (id: string): RelationshipMutation =>
|
|
46
|
+
createRelationshipMutation(
|
|
47
|
+
createResource("email_template", id),
|
|
48
|
+
"policy",
|
|
49
|
+
platformRelationshipSubject(),
|
|
50
|
+
RelationshipOperation.Delete,
|
|
51
|
+
),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export const EmailLayout = Object.freeze({
|
|
55
|
+
Resource: (id: string): Resource => createResource("email_layout", id),
|
|
56
|
+
View: (id: string): Can => createCan("email_layout", id, "view", "view"),
|
|
57
|
+
Edit: (id: string): Can => createCan("email_layout", id, "edit", "edit"),
|
|
58
|
+
Delete: (id: string): Can =>
|
|
59
|
+
createCan("email_layout", id, "delete", "delete"),
|
|
60
|
+
Manage: (id: string): Can =>
|
|
61
|
+
createCan("email_layout", id, "manage", "manage"),
|
|
62
|
+
Create: (): Can =>
|
|
63
|
+
createCan("platform", "global", "email_layout.create", "is_admin"),
|
|
64
|
+
List: (): Can =>
|
|
65
|
+
createCan("platform", "global", "email_layout.list", "is_admin"),
|
|
66
|
+
PreviewContent: (): Can =>
|
|
67
|
+
createCan("platform", "global", "email_layout.preview_content", "is_admin"),
|
|
68
|
+
Snapshot: (id: string): RelationshipSnapshotPlan =>
|
|
69
|
+
createRelationshipSnapshotPlan("email_layout", id, "platform_admin", ""),
|
|
70
|
+
TouchPolicy: (id: string): RelationshipMutation =>
|
|
71
|
+
createRelationshipMutation(
|
|
72
|
+
createResource("email_layout", id),
|
|
73
|
+
"policy",
|
|
74
|
+
platformRelationshipSubject(),
|
|
75
|
+
RelationshipOperation.Touch,
|
|
76
|
+
),
|
|
77
|
+
DeletePolicy: (id: string): RelationshipMutation =>
|
|
78
|
+
createRelationshipMutation(
|
|
79
|
+
createResource("email_layout", id),
|
|
80
|
+
"policy",
|
|
81
|
+
platformRelationshipSubject(),
|
|
82
|
+
RelationshipOperation.Delete,
|
|
83
|
+
),
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export const EmailEventMapping = Object.freeze({
|
|
87
|
+
Resource: (id: string): Resource => createResource("email_event_mapping", id),
|
|
88
|
+
|
|
89
|
+
Update: (): Can =>
|
|
90
|
+
createCan("platform", "global", "email_event_mapping.update", "is_admin"),
|
|
91
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Code generated by scripts/generated/generate-spicedb-catalog.mjs.
|
|
2
|
+
// DO NOT EDIT.
|
|
3
|
+
//
|
|
4
|
+
// Domain: email_delivery — Mail Adapter and email suppression management policy
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
accountIdentityRelationshipSubject,
|
|
8
|
+
createCan,
|
|
9
|
+
createRelationshipMutation,
|
|
10
|
+
createRelationshipSnapshotPlan,
|
|
11
|
+
createResource,
|
|
12
|
+
platformRelationshipSubject,
|
|
13
|
+
RelationshipOperation,
|
|
14
|
+
resourceRelationshipSubject,
|
|
15
|
+
} from "./internal.ts";
|
|
16
|
+
import type {
|
|
17
|
+
Actor,
|
|
18
|
+
Can,
|
|
19
|
+
RelationshipMutation,
|
|
20
|
+
RelationshipSnapshotPlan,
|
|
21
|
+
Resource,
|
|
22
|
+
} from "./internal.ts";
|
|
23
|
+
|
|
24
|
+
export const MailAdapter = Object.freeze({
|
|
25
|
+
Resource: (id: string): Resource => createResource("mail_adapter", id),
|
|
26
|
+
|
|
27
|
+
List: (): Can =>
|
|
28
|
+
createCan("platform", "global", "mail_adapter.list", "is_admin"),
|
|
29
|
+
Create: (): Can =>
|
|
30
|
+
createCan("platform", "global", "mail_adapter.create", "is_admin"),
|
|
31
|
+
Update: (): Can =>
|
|
32
|
+
createCan("platform", "global", "mail_adapter.update", "is_admin"),
|
|
33
|
+
Delete: (): Can =>
|
|
34
|
+
createCan("platform", "global", "mail_adapter.delete", "is_admin"),
|
|
35
|
+
Test: (): Can =>
|
|
36
|
+
createCan("platform", "global", "mail_adapter.test", "is_admin"),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const EmailSuppression = Object.freeze({
|
|
40
|
+
Resource: (id: string): Resource => createResource("email_suppression", id),
|
|
41
|
+
|
|
42
|
+
Release: (): Can =>
|
|
43
|
+
createCan("platform", "global", "email_suppression.release", "is_admin"),
|
|
44
|
+
});
|