@opengeni/contracts 0.22.0 → 0.26.1

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.
@@ -0,0 +1,15 @@
1
+ export type ModalCheckpointProviderBinding = {
2
+ version: 1;
3
+ serverUrl: string;
4
+ workspaceName: string;
5
+ environment: string;
6
+ };
7
+ /**
8
+ * One canonical, non-secret identity for the Modal namespace that owns a
9
+ * checkpoint. The same bytes are used for uniqueness, durable storage, and
10
+ * destructive-call fencing.
11
+ */
12
+ export declare function canonicalModalCheckpointProviderBinding(value: unknown): {
13
+ binding: ModalCheckpointProviderBinding;
14
+ key: string;
15
+ } | null;
@@ -0,0 +1,43 @@
1
+ // src/slack-bot-scopes.ts
2
+ var OPENGENI_SLACK_BOT_REQUIRED_SCOPES = [
3
+ "canvases:read",
4
+ "channels:history",
5
+ "channels:read",
6
+ "chat:write",
7
+ "files:read",
8
+ "groups:history",
9
+ "groups:read",
10
+ "im:history",
11
+ "im:read",
12
+ "im:write",
13
+ "mpim:history",
14
+ "mpim:read",
15
+ "users:read"
16
+ ];
17
+ var OPENGENI_SLACK_BOT_SAFE_OPTIONAL_SCOPES = ["team:read"];
18
+ var OPENGENI_SLACK_BOT_FORBIDDEN_SCOPES = ["channels:join", "chat:write.public"];
19
+ function isOpenGeniSlackBotScopeAllowed(scope) {
20
+ return OPENGENI_SLACK_BOT_REQUIRED_SCOPES.includes(scope) || OPENGENI_SLACK_BOT_SAFE_OPTIONAL_SCOPES.includes(scope);
21
+ }
22
+ function areOpenGeniSlackBotScopesAccepted(grantedScopes) {
23
+ return OPENGENI_SLACK_BOT_REQUIRED_SCOPES.every((scope) => grantedScopes.includes(scope)) && grantedScopes.every(isOpenGeniSlackBotScopeAllowed);
24
+ }
25
+ function evaluateOpenGeniSlackBotScopes(grantedScopes) {
26
+ const granted = new Set(grantedScopes);
27
+ const missingRequired = OPENGENI_SLACK_BOT_REQUIRED_SCOPES.filter((scope) => !granted.has(scope));
28
+ const unsupported = [...granted].filter((scope) => !isOpenGeniSlackBotScopeAllowed(scope)).sort();
29
+ return {
30
+ accepted: areOpenGeniSlackBotScopesAccepted(grantedScopes),
31
+ missingRequired,
32
+ unsupported
33
+ };
34
+ }
35
+
36
+ export {
37
+ OPENGENI_SLACK_BOT_REQUIRED_SCOPES,
38
+ OPENGENI_SLACK_BOT_SAFE_OPTIONAL_SCOPES,
39
+ OPENGENI_SLACK_BOT_FORBIDDEN_SCOPES,
40
+ areOpenGeniSlackBotScopesAccepted,
41
+ evaluateOpenGeniSlackBotScopes
42
+ };
43
+ //# sourceMappingURL=chunk-3B3XEYMN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/slack-bot-scopes.ts"],"sourcesContent":["export const OPENGENI_SLACK_BOT_REQUIRED_SCOPES = [\n \"canvases:read\",\n \"channels:history\",\n \"channels:read\",\n \"chat:write\",\n \"files:read\",\n \"groups:history\",\n \"groups:read\",\n \"im:history\",\n \"im:read\",\n \"im:write\",\n \"mpim:history\",\n \"mpim:read\",\n \"users:read\",\n] as const;\n\n/**\n * Optional bot grants that remain inside the shipped bot's read/identity\n * boundary. Every other unrequired scope fails closed, including unknown future\n * Slack scopes, so verification, core routing, and UI eligibility cannot drift.\n */\nexport const OPENGENI_SLACK_BOT_SAFE_OPTIONAL_SCOPES = [\"team:read\"] as const;\n\n/** @deprecated Use evaluateOpenGeniSlackBotScopes; an allowlist is the policy. */\nexport const OPENGENI_SLACK_BOT_FORBIDDEN_SCOPES = [\"channels:join\", \"chat:write.public\"] as const;\n\nexport type OpenGeniSlackBotScopePolicy = {\n accepted: boolean;\n missingRequired: string[];\n unsupported: string[];\n};\n\nfunction isOpenGeniSlackBotScopeAllowed(scope: string): boolean {\n return (\n (OPENGENI_SLACK_BOT_REQUIRED_SCOPES as readonly string[]).includes(scope) ||\n (OPENGENI_SLACK_BOT_SAFE_OPTIONAL_SCOPES as readonly string[]).includes(scope)\n );\n}\n\nexport function areOpenGeniSlackBotScopesAccepted(grantedScopes: readonly string[]): boolean {\n return (\n OPENGENI_SLACK_BOT_REQUIRED_SCOPES.every((scope) => grantedScopes.includes(scope)) &&\n grantedScopes.every(isOpenGeniSlackBotScopeAllowed)\n );\n}\n\nexport function evaluateOpenGeniSlackBotScopes(\n grantedScopes: readonly string[],\n): OpenGeniSlackBotScopePolicy {\n const granted = new Set(grantedScopes);\n const missingRequired = OPENGENI_SLACK_BOT_REQUIRED_SCOPES.filter((scope) => !granted.has(scope));\n const unsupported = [...granted].filter((scope) => !isOpenGeniSlackBotScopeAllowed(scope)).sort();\n return {\n accepted: areOpenGeniSlackBotScopesAccepted(grantedScopes),\n missingRequired,\n unsupported,\n };\n}\n"],"mappings":";AAAO,IAAM,qCAAqC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAOO,IAAM,0CAA0C,CAAC,WAAW;AAG5D,IAAM,sCAAsC,CAAC,iBAAiB,mBAAmB;AAQxF,SAAS,+BAA+B,OAAwB;AAC9D,SACG,mCAAyD,SAAS,KAAK,KACvE,wCAA8D,SAAS,KAAK;AAEjF;AAEO,SAAS,kCAAkC,eAA2C;AAC3F,SACE,mCAAmC,MAAM,CAAC,UAAU,cAAc,SAAS,KAAK,CAAC,KACjF,cAAc,MAAM,8BAA8B;AAEtD;AAEO,SAAS,+BACd,eAC6B;AAC7B,QAAM,UAAU,IAAI,IAAI,aAAa;AACrC,QAAM,kBAAkB,mCAAmC,OAAO,CAAC,UAAU,CAAC,QAAQ,IAAI,KAAK,CAAC;AAChG,QAAM,cAAc,CAAC,GAAG,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,+BAA+B,KAAK,CAAC,EAAE,KAAK;AAChG,SAAO;AAAA,IACL,UAAU,kCAAkC,aAAa;AAAA,IACzD;AAAA,IACA;AAAA,EACF;AACF;","names":[]}