@oxy.so/contracts 4.17.0 → 4.22.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/dist/cjs/accountAccess.js +72 -0
- package/dist/cjs/agency.js +112 -1
- package/dist/cjs/applicationRoles.js +211 -0
- package/dist/cjs/client/check.js +9 -0
- package/dist/cjs/client/contentClaims.js +139 -0
- package/dist/cjs/client/index.js +37 -1
- package/dist/cjs/client/safety.js +183 -2
- package/dist/cjs/client/signIn.js +2 -0
- package/dist/cjs/contentClaims.js +246 -0
- package/dist/cjs/index.js +14 -3
- package/dist/cjs/safety.js +430 -1
- package/dist/cjs/serviceToken.js +14 -0
- package/dist/esm/accountAccess.js +69 -0
- package/dist/esm/agency.js +111 -0
- package/dist/esm/applicationRoles.js +207 -0
- package/dist/esm/client/check.js +8 -0
- package/dist/esm/client/contentClaims.js +134 -0
- package/dist/esm/client/index.js +2 -1
- package/dist/esm/client/safety.js +183 -2
- package/dist/esm/client/signIn.js +2 -0
- package/dist/esm/contentClaims.js +229 -0
- package/dist/esm/index.js +5 -1
- package/dist/esm/safety.js +423 -0
- package/dist/esm/serviceToken.js +11 -0
- package/dist/types/accountAccess.d.ts +128 -0
- package/dist/types/accountEmail.d.ts +2 -2
- package/dist/types/agency.d.ts +327 -2
- package/dist/types/agentKeys.d.ts +6 -6
- package/dist/types/applicationRoles.d.ts +438 -0
- package/dist/types/client/agentKeys.d.ts +2 -2
- package/dist/types/client/check.d.ts +3 -0
- package/dist/types/client/contentClaims.d.ts +106 -0
- package/dist/types/client/deviceSession.d.ts +1 -1
- package/dist/types/client/index.d.ts +2 -1
- package/dist/types/client/safety.d.ts +204 -4
- package/dist/types/client/signIn.d.ts +1 -1
- package/dist/types/contentClaims.d.ts +383 -0
- package/dist/types/deviceSession.d.ts +4 -4
- package/dist/types/email/messages.d.ts +4 -4
- package/dist/types/externalIdentity.d.ts +16 -16
- package/dist/types/index.d.ts +6 -2
- package/dist/types/inference/accountBilling.d.ts +2 -2
- package/dist/types/inference/aliaModelRelease.d.ts +8 -8
- package/dist/types/inference/catalogue.d.ts +26 -26
- package/dist/types/inference/inbox.d.ts +4 -4
- package/dist/types/inference/modelDocumentation.d.ts +16 -16
- package/dist/types/inference/providerConnection.d.ts +4 -4
- package/dist/types/inference/realtime.d.ts +74 -74
- package/dist/types/inference/request.d.ts +60 -60
- package/dist/types/inference/usage.d.ts +4 -4
- package/dist/types/products/access.d.ts +4 -4
- package/dist/types/safety.d.ts +2374 -2
- package/dist/types/serviceToken.d.ts +11 -0
- package/dist/types/sessionStatus.d.ts +4 -4
- package/dist/types/signIn.d.ts +5 -5
- package/dist/types/updates.d.ts +6 -6
- package/dist/types/userResponse.d.ts +8 -8
- package/package.json +5 -20
- package/dist/cjs/.tsbuildinfo +0 -1
- package/dist/esm/.tsbuildinfo +0 -1
- package/dist/types/.tsbuildinfo +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Omitted means the existing grant; an explicit set only narrows that authority. */
|
|
3
|
+
export const serviceTokenScopesSchema = z
|
|
4
|
+
.array(z.string().trim().min(1).max(128))
|
|
5
|
+
.min(1)
|
|
6
|
+
.max(100)
|
|
7
|
+
.refine((scopes) => new Set(scopes).size === scopes.length, 'Requested scopes must be unique')
|
|
8
|
+
.transform((scopes) => [...scopes].sort());
|
|
9
|
+
export const serviceTokenOptionsSchema = z
|
|
10
|
+
.object({ scopes: serviceTokenScopesSchema.optional() })
|
|
11
|
+
.strict();
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire contract for `GET /internal/accounts/:accountId/access/:userId`: Oxy
|
|
3
|
+
* answers a trusted first-party service's question "may this person act FOR
|
|
4
|
+
* that account, and with what?" with no session of that person in the request.
|
|
5
|
+
*
|
|
6
|
+
* It exists for the account Oxy never lets anybody act AS: a `channel`
|
|
7
|
+
* ({@link isDelegatedActAsEligibleKind} refuses it). An app publishes to a
|
|
8
|
+
* channel with ITS OWN credential, on behalf of a member Oxy vouches for here,
|
|
9
|
+
* so nobody holds a bearer that speaks as the channel. A long-running import
|
|
10
|
+
* (Oxy Move) has only a service token and `X-Oxy-User-Id`, which the
|
|
11
|
+
* user-facing `GET /accounts/:id/members` refuses; this is its answer.
|
|
12
|
+
*
|
|
13
|
+
* Needs a service token whose application is platform-trusted AND holds the
|
|
14
|
+
* privileged {@link ACCOUNTS_MEMBERSHIP_READ_SCOPE}. The answer is always 200:
|
|
15
|
+
* `access` is `null` for no active membership, an archived account, an unknown
|
|
16
|
+
* account and an unclaimed directory account alike. Callers must treat every
|
|
17
|
+
* other status as a refusal (fail closed), and must not cache the answer longer
|
|
18
|
+
* than the action it authorizes.
|
|
19
|
+
*
|
|
20
|
+
* Platform-agnostic — zod only.
|
|
21
|
+
*/
|
|
22
|
+
import { z } from 'zod';
|
|
23
|
+
/**
|
|
24
|
+
* The scope the endpoint requires.
|
|
25
|
+
*
|
|
26
|
+
* Privileged (staff-granted). Channel membership is sensitive because a channel
|
|
27
|
+
* is anonymous: its members are the people behind a voice that is published
|
|
28
|
+
* without their names, and "is this person a member of that channel" is
|
|
29
|
+
* exactly the fact the channel exists to withhold.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ACCOUNTS_MEMBERSHIP_READ_SCOPE: "accounts:membership:read";
|
|
32
|
+
/**
|
|
33
|
+
* Where the access comes from.
|
|
34
|
+
*
|
|
35
|
+
* - `self` — the person IS the account (a personal account asked about itself).
|
|
36
|
+
* - `direct` — an active membership row on the account.
|
|
37
|
+
* - `inherited` — an active, cascading membership on an ancestor account.
|
|
38
|
+
*/
|
|
39
|
+
export declare const ACCOUNT_ACCESS_SOURCES: readonly ["self", "direct", "inherited"];
|
|
40
|
+
export type AccountAccessSource = (typeof ACCOUNT_ACCESS_SOURCES)[number];
|
|
41
|
+
export declare const accountAccessSourceSchema: z.ZodEnum<["self", "direct", "inherited"]>;
|
|
42
|
+
/**
|
|
43
|
+
* One person's EFFECTIVE access over one account.
|
|
44
|
+
*
|
|
45
|
+
* `role` and `permissions` are strings rather than closed enums on purpose: the
|
|
46
|
+
* role and permission vocabularies are the API's, they grow, and a consumer
|
|
47
|
+
* pinned to an older contracts release must keep reading new ones. Gate on
|
|
48
|
+
* `permissions` (the role's baseline adjusted by per-member grants and
|
|
49
|
+
* revokes), never on `role`.
|
|
50
|
+
*/
|
|
51
|
+
export declare const accountAccessGrantSchema: z.ZodObject<{
|
|
52
|
+
role: z.ZodString;
|
|
53
|
+
permissions: z.ZodArray<z.ZodString, "many">;
|
|
54
|
+
/** Only an active membership grants access, so this is the one value. */
|
|
55
|
+
status: z.ZodLiteral<"active">;
|
|
56
|
+
source: z.ZodEnum<["self", "direct", "inherited"]>;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
status: "active";
|
|
59
|
+
role: string;
|
|
60
|
+
permissions: string[];
|
|
61
|
+
source: "self" | "direct" | "inherited";
|
|
62
|
+
}, {
|
|
63
|
+
status: "active";
|
|
64
|
+
role: string;
|
|
65
|
+
permissions: string[];
|
|
66
|
+
source: "self" | "direct" | "inherited";
|
|
67
|
+
}>;
|
|
68
|
+
export type AccountAccessGrant = z.infer<typeof accountAccessGrantSchema>;
|
|
69
|
+
export declare const accountAccessVerdictSchema: z.ZodEffects<z.ZodObject<{
|
|
70
|
+
accountId: z.ZodString;
|
|
71
|
+
/** `null` when no such account exists. */
|
|
72
|
+
kind: z.ZodNullable<z.ZodEnum<["personal", "organization", "project", "bot", "channel"]>>;
|
|
73
|
+
/** `null` means: this person may not act for this account. */
|
|
74
|
+
access: z.ZodNullable<z.ZodObject<{
|
|
75
|
+
role: z.ZodString;
|
|
76
|
+
permissions: z.ZodArray<z.ZodString, "many">;
|
|
77
|
+
/** Only an active membership grants access, so this is the one value. */
|
|
78
|
+
status: z.ZodLiteral<"active">;
|
|
79
|
+
source: z.ZodEnum<["self", "direct", "inherited"]>;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
status: "active";
|
|
82
|
+
role: string;
|
|
83
|
+
permissions: string[];
|
|
84
|
+
source: "self" | "direct" | "inherited";
|
|
85
|
+
}, {
|
|
86
|
+
status: "active";
|
|
87
|
+
role: string;
|
|
88
|
+
permissions: string[];
|
|
89
|
+
source: "self" | "direct" | "inherited";
|
|
90
|
+
}>>;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
kind: "organization" | "personal" | "project" | "bot" | "channel" | null;
|
|
93
|
+
accountId: string;
|
|
94
|
+
access: {
|
|
95
|
+
status: "active";
|
|
96
|
+
role: string;
|
|
97
|
+
permissions: string[];
|
|
98
|
+
source: "self" | "direct" | "inherited";
|
|
99
|
+
} | null;
|
|
100
|
+
}, {
|
|
101
|
+
kind: "organization" | "personal" | "project" | "bot" | "channel" | null;
|
|
102
|
+
accountId: string;
|
|
103
|
+
access: {
|
|
104
|
+
status: "active";
|
|
105
|
+
role: string;
|
|
106
|
+
permissions: string[];
|
|
107
|
+
source: "self" | "direct" | "inherited";
|
|
108
|
+
} | null;
|
|
109
|
+
}>, {
|
|
110
|
+
kind: "organization" | "personal" | "project" | "bot" | "channel" | null;
|
|
111
|
+
accountId: string;
|
|
112
|
+
access: {
|
|
113
|
+
status: "active";
|
|
114
|
+
role: string;
|
|
115
|
+
permissions: string[];
|
|
116
|
+
source: "self" | "direct" | "inherited";
|
|
117
|
+
} | null;
|
|
118
|
+
}, {
|
|
119
|
+
kind: "organization" | "personal" | "project" | "bot" | "channel" | null;
|
|
120
|
+
accountId: string;
|
|
121
|
+
access: {
|
|
122
|
+
status: "active";
|
|
123
|
+
role: string;
|
|
124
|
+
permissions: string[];
|
|
125
|
+
source: "self" | "direct" | "inherited";
|
|
126
|
+
} | null;
|
|
127
|
+
}>;
|
|
128
|
+
export type AccountAccessVerdict = z.infer<typeof accountAccessVerdictSchema>;
|
|
@@ -24,11 +24,11 @@ export declare const emailVerificationStartRequestSchema: z.ZodObject<{
|
|
|
24
24
|
purpose: z.ZodLiteral<"signup">;
|
|
25
25
|
email: z.ZodString;
|
|
26
26
|
}, "strict", z.ZodTypeAny, {
|
|
27
|
-
purpose: "signup";
|
|
28
27
|
email: string;
|
|
29
|
-
}, {
|
|
30
28
|
purpose: "signup";
|
|
29
|
+
}, {
|
|
31
30
|
email: string;
|
|
31
|
+
purpose: "signup";
|
|
32
32
|
}>;
|
|
33
33
|
export type EmailVerificationStartRequest = z.infer<typeof emailVerificationStartRequestSchema>;
|
|
34
34
|
export interface EmailVerificationStartResponse {
|