@oxy.so/contracts 6.5.0 → 6.7.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.
|
@@ -65,6 +65,11 @@ exports.APPLICATION_ROLE_ERROR_CODES = {
|
|
|
65
65
|
alreadyRevoked: 'ALREADY_REVOKED',
|
|
66
66
|
/** 403: the bearer's session belongs to a DIFFERENT application. */
|
|
67
67
|
sessionApplicationMismatch: 'SESSION_APPLICATION_MISMATCH',
|
|
68
|
+
/**
|
|
69
|
+
* 409: the application is one of Oxy's own. Its operator keys and the roles
|
|
70
|
+
* holding them are declared in code (ADR 0056), never in the Console.
|
|
71
|
+
*/
|
|
72
|
+
firstPartyRolesInCode: 'FIRST_PARTY_ROLES_IN_CODE',
|
|
68
73
|
};
|
|
69
74
|
/** Whether `value` is a well-formed application permission key. */
|
|
70
75
|
function isApplicationPermissionKey(value) {
|
|
@@ -130,6 +135,12 @@ exports.declareApplicationPermissionsRequestSchema = zod_1.z
|
|
|
130
135
|
exports.applicationPermissionSchema = zod_1.z.object({
|
|
131
136
|
key: exports.applicationPermissionKeySchema,
|
|
132
137
|
description: zod_1.z.string(),
|
|
138
|
+
/**
|
|
139
|
+
* The owning account's roles whose members hold this key (ADR 0056). Set only
|
|
140
|
+
* on a first-party application's keys, which are declared in code; empty for
|
|
141
|
+
* a key held through per-person grants.
|
|
142
|
+
*/
|
|
143
|
+
heldByAccountRoles: zod_1.z.array(zod_1.z.string()),
|
|
133
144
|
declaredAt: isoTimestamp,
|
|
134
145
|
declaredByUserId: id.nullable(),
|
|
135
146
|
retiredAt: isoTimestamp.nullable(),
|
package/dist/cjs/safety.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.safetyOrganizationsResponseSchema = exports.safetyOrganizationsInputSchema = exports.safetyOrganizationIdentitySchema = exports.safetyPeopleResponseSchema = exports.safetyPeopleInputSchema = exports.safetyPersonSchema = exports.safetySessionValidationSchema = exports.safetySessionInputSchema = exports.purchaseReviewInputSchema = exports.supervisionReviewInputSchema = exports.supervisionContactInputSchema = exports.supervisionAcceptInputSchema = exports.supervisionInviteInputSchema = void 0;
|
|
3
|
+
exports.confirmPurchaseSchema = exports.reservePurchaseSchema = exports.purchaseApprovalListSchema = exports.purchaseApprovalSummarySchema = exports.purchaseApprovalSchema = exports.purchaseEffectsSchema = exports.purchaseApprovalLineSchema = exports.supervisionContactsResponseSchema = exports.supervisionStateSchema = exports.supervisionContactSchema = exports.supervisionInvitationSchema = exports.supervisionSchema = exports.safetyRequesterSchema = exports.messagingSessionsResponseSchema = exports.messagingSessionsInputSchema = exports.notificationAccessBatchResponseSchema = exports.notificationAccessBatchInputSchema = exports.notificationAccessInputSchema = exports.messageAccessBatchResponseSchema = exports.deliveryAccessBatchInputSchema = exports.messageAccessBatchInputSchema = exports.deliveryAccessInputSchema = exports.contentAccessBatchResponseSchema = exports.contentAccessBatchInputSchema = exports.publicationPoliciesResponseSchema = exports.publicationPoliciesInputSchema = exports.publicationPolicySchema = exports.contentAccessInputSchema = exports.CONTENT_CLASSIFICATIONS = exports.contactAccessResponseSchema = exports.contactAccessInputSchema = exports.messageAccessInputSchema = exports.MESSAGE_ACCESS_MAX_INPUT_BYTES = exports.MESSAGE_ACCESS_MAX_PARTICIPANT_SLOTS = exports.MESSAGE_ACCESS_MAX_SUPERVISED_PARTICIPANTS = exports.MESSAGE_ACCESS_MAX_PARTICIPANTS = exports.MESSAGE_ACCESS_MAX_RESOURCES = exports.profileAccessBatchResponseSchema = exports.profileAccessBatchInputSchema = exports.safetyDecisionSchema = exports.SAFETY_DECISION_REASONS = exports.profileAccessDecisionSchema = exports.profileAccessInputSchema = exports.SUPERVISION_STATUSES = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SUPERVISION_CHANGED_EVENT = exports.SUPERVISED_ACTIONS = exports.SAFETY_POLICY_VERSION = exports.PURCHASE_APPROVAL_STATUSES = void 0;
|
|
4
|
+
exports.safetyOrganizationsResponseSchema = exports.safetyOrganizationsInputSchema = exports.safetyOrganizationIdentitySchema = exports.safetyPeopleResponseSchema = exports.safetyPeopleInputSchema = exports.safetyPersonSchema = exports.safetySessionValidationSchema = exports.safetySessionInputSchema = exports.purchaseReviewInputSchema = exports.supervisionReviewInputSchema = exports.supervisionContactInputSchema = exports.supervisionAcceptInputSchema = exports.supervisionInviteInputSchema = exports.safetyErrorSchema = exports.SAFETY_ERROR_CODES = exports.cancelPurchaseSchema = void 0;
|
|
5
5
|
const numberChecks_1 = require("./numberChecks");
|
|
6
6
|
const stringChecks_1 = require("./stringChecks");
|
|
7
7
|
const zod_1 = require("zod");
|
|
@@ -172,6 +172,25 @@ const messageBatch = (schema) => zod_1.z
|
|
|
172
172
|
exports.messageAccessBatchInputSchema = messageBatch(exports.messageAccessInputSchema);
|
|
173
173
|
exports.deliveryAccessBatchInputSchema = messageBatch(exports.deliveryAccessInputSchema);
|
|
174
174
|
exports.messageAccessBatchResponseSchema = exports.contentAccessBatchResponseSchema;
|
|
175
|
+
/**
|
|
176
|
+
* May `actorAccountId`'s activity notify `recipientAccountId`? A reviewed
|
|
177
|
+
* background consumer asks before a socket emit or push, with no human proof:
|
|
178
|
+
* the decision covers blocks in either direction, availability and supervised
|
|
179
|
+
* contact approval, and discloses nothing else.
|
|
180
|
+
*/
|
|
181
|
+
exports.notificationAccessInputSchema = zod_1.z
|
|
182
|
+
.object({ resourceId, actorAccountId: accountId, recipientAccountId: accountId })
|
|
183
|
+
.strict();
|
|
184
|
+
exports.notificationAccessBatchInputSchema = zod_1.z
|
|
185
|
+
.object({
|
|
186
|
+
items: zod_1.z
|
|
187
|
+
.array(exports.notificationAccessInputSchema)
|
|
188
|
+
.min(1)
|
|
189
|
+
.max(100)
|
|
190
|
+
.refine((items) => new Set(items.map((item) => item.resourceId)).size === items.length, 'Resource IDs must be unique'),
|
|
191
|
+
})
|
|
192
|
+
.strict();
|
|
193
|
+
exports.notificationAccessBatchResponseSchema = exports.contentAccessBatchResponseSchema;
|
|
175
194
|
/** Live socket-recipient proof; a request ID correlates the result and never identifies an account. */
|
|
176
195
|
exports.messagingSessionsInputSchema = zod_1.z
|
|
177
196
|
.object({
|
|
@@ -61,6 +61,11 @@ export const APPLICATION_ROLE_ERROR_CODES = {
|
|
|
61
61
|
alreadyRevoked: 'ALREADY_REVOKED',
|
|
62
62
|
/** 403: the bearer's session belongs to a DIFFERENT application. */
|
|
63
63
|
sessionApplicationMismatch: 'SESSION_APPLICATION_MISMATCH',
|
|
64
|
+
/**
|
|
65
|
+
* 409: the application is one of Oxy's own. Its operator keys and the roles
|
|
66
|
+
* holding them are declared in code (ADR 0056), never in the Console.
|
|
67
|
+
*/
|
|
68
|
+
firstPartyRolesInCode: 'FIRST_PARTY_ROLES_IN_CODE',
|
|
64
69
|
};
|
|
65
70
|
/** Whether `value` is a well-formed application permission key. */
|
|
66
71
|
export function isApplicationPermissionKey(value) {
|
|
@@ -126,6 +131,12 @@ export const declareApplicationPermissionsRequestSchema = z
|
|
|
126
131
|
export const applicationPermissionSchema = z.object({
|
|
127
132
|
key: applicationPermissionKeySchema,
|
|
128
133
|
description: z.string(),
|
|
134
|
+
/**
|
|
135
|
+
* The owning account's roles whose members hold this key (ADR 0056). Set only
|
|
136
|
+
* on a first-party application's keys, which are declared in code; empty for
|
|
137
|
+
* a key held through per-person grants.
|
|
138
|
+
*/
|
|
139
|
+
heldByAccountRoles: z.array(z.string()),
|
|
129
140
|
declaredAt: isoTimestamp,
|
|
130
141
|
declaredByUserId: id.nullable(),
|
|
131
142
|
retiredAt: isoTimestamp.nullable(),
|
package/dist/esm/safety.js
CHANGED
|
@@ -162,6 +162,25 @@ const messageBatch = (schema) => z
|
|
|
162
162
|
export const messageAccessBatchInputSchema = messageBatch(messageAccessInputSchema);
|
|
163
163
|
export const deliveryAccessBatchInputSchema = messageBatch(deliveryAccessInputSchema);
|
|
164
164
|
export const messageAccessBatchResponseSchema = contentAccessBatchResponseSchema;
|
|
165
|
+
/**
|
|
166
|
+
* May `actorAccountId`'s activity notify `recipientAccountId`? A reviewed
|
|
167
|
+
* background consumer asks before a socket emit or push, with no human proof:
|
|
168
|
+
* the decision covers blocks in either direction, availability and supervised
|
|
169
|
+
* contact approval, and discloses nothing else.
|
|
170
|
+
*/
|
|
171
|
+
export const notificationAccessInputSchema = z
|
|
172
|
+
.object({ resourceId, actorAccountId: accountId, recipientAccountId: accountId })
|
|
173
|
+
.strict();
|
|
174
|
+
export const notificationAccessBatchInputSchema = z
|
|
175
|
+
.object({
|
|
176
|
+
items: z
|
|
177
|
+
.array(notificationAccessInputSchema)
|
|
178
|
+
.min(1)
|
|
179
|
+
.max(100)
|
|
180
|
+
.refine((items) => new Set(items.map((item) => item.resourceId)).size === items.length, 'Resource IDs must be unique'),
|
|
181
|
+
})
|
|
182
|
+
.strict();
|
|
183
|
+
export const notificationAccessBatchResponseSchema = contentAccessBatchResponseSchema;
|
|
165
184
|
/** Live socket-recipient proof; a request ID correlates the result and never identifies an account. */
|
|
166
185
|
export const messagingSessionsInputSchema = z
|
|
167
186
|
.object({
|
|
@@ -59,6 +59,11 @@ export declare const APPLICATION_ROLE_ERROR_CODES: {
|
|
|
59
59
|
readonly alreadyRevoked: "ALREADY_REVOKED";
|
|
60
60
|
/** 403: the bearer's session belongs to a DIFFERENT application. */
|
|
61
61
|
readonly sessionApplicationMismatch: "SESSION_APPLICATION_MISMATCH";
|
|
62
|
+
/**
|
|
63
|
+
* 409: the application is one of Oxy's own. Its operator keys and the roles
|
|
64
|
+
* holding them are declared in code (ADR 0056), never in the Console.
|
|
65
|
+
*/
|
|
66
|
+
readonly firstPartyRolesInCode: "FIRST_PARTY_ROLES_IN_CODE";
|
|
62
67
|
};
|
|
63
68
|
export type ApplicationRoleErrorCode = (typeof APPLICATION_ROLE_ERROR_CODES)[keyof typeof APPLICATION_ROLE_ERROR_CODES];
|
|
64
69
|
/** Whether `value` is a well-formed application permission key. */
|
|
@@ -87,6 +92,7 @@ export declare const declareApplicationPermissionsRequestSchema: z.ZodObject<{
|
|
|
87
92
|
export declare const applicationPermissionSchema: z.ZodObject<{
|
|
88
93
|
key: z.ZodString;
|
|
89
94
|
description: z.ZodString;
|
|
95
|
+
heldByAccountRoles: z.ZodArray<z.ZodString>;
|
|
90
96
|
declaredAt: z.ZodString;
|
|
91
97
|
declaredByUserId: z.ZodNullable<z.ZodString>;
|
|
92
98
|
retiredAt: z.ZodNullable<z.ZodString>;
|
|
@@ -96,6 +102,7 @@ export declare const applicationPermissionListSchema: z.ZodObject<{
|
|
|
96
102
|
items: z.ZodArray<z.ZodObject<{
|
|
97
103
|
key: z.ZodString;
|
|
98
104
|
description: z.ZodString;
|
|
105
|
+
heldByAccountRoles: z.ZodArray<z.ZodString>;
|
|
99
106
|
declaredAt: z.ZodString;
|
|
100
107
|
declaredByUserId: z.ZodNullable<z.ZodString>;
|
|
101
108
|
retiredAt: z.ZodNullable<z.ZodString>;
|
|
@@ -106,6 +113,7 @@ export declare const declareApplicationPermissionsResponseSchema: z.ZodObject<{
|
|
|
106
113
|
items: z.ZodArray<z.ZodObject<{
|
|
107
114
|
key: z.ZodString;
|
|
108
115
|
description: z.ZodString;
|
|
116
|
+
heldByAccountRoles: z.ZodArray<z.ZodString>;
|
|
109
117
|
declaredAt: z.ZodString;
|
|
110
118
|
declaredByUserId: z.ZodNullable<z.ZodString>;
|
|
111
119
|
retiredAt: z.ZodNullable<z.ZodString>;
|
package/dist/types/safety.d.ts
CHANGED
|
@@ -231,6 +231,48 @@ export declare const messageAccessBatchResponseSchema: z.ZodObject<{
|
|
|
231
231
|
}, z.core.$strict>;
|
|
232
232
|
export type MessageAccessBatchInput = z.infer<typeof messageAccessBatchInputSchema>;
|
|
233
233
|
export type DeliveryAccessBatchInput = z.infer<typeof deliveryAccessBatchInputSchema>;
|
|
234
|
+
/**
|
|
235
|
+
* May `actorAccountId`'s activity notify `recipientAccountId`? A reviewed
|
|
236
|
+
* background consumer asks before a socket emit or push, with no human proof:
|
|
237
|
+
* the decision covers blocks in either direction, availability and supervised
|
|
238
|
+
* contact approval, and discloses nothing else.
|
|
239
|
+
*/
|
|
240
|
+
export declare const notificationAccessInputSchema: z.ZodObject<{
|
|
241
|
+
resourceId: z.ZodString;
|
|
242
|
+
actorAccountId: z.ZodString;
|
|
243
|
+
recipientAccountId: z.ZodString;
|
|
244
|
+
}, z.core.$strict>;
|
|
245
|
+
export declare const notificationAccessBatchInputSchema: z.ZodObject<{
|
|
246
|
+
items: z.ZodArray<z.ZodObject<{
|
|
247
|
+
resourceId: z.ZodString;
|
|
248
|
+
actorAccountId: z.ZodString;
|
|
249
|
+
recipientAccountId: z.ZodString;
|
|
250
|
+
}, z.core.$strict>>;
|
|
251
|
+
}, z.core.$strict>;
|
|
252
|
+
export declare const notificationAccessBatchResponseSchema: z.ZodObject<{
|
|
253
|
+
items: z.ZodArray<z.ZodObject<{
|
|
254
|
+
resourceId: z.ZodString;
|
|
255
|
+
decision: z.ZodObject<{
|
|
256
|
+
allowed: z.ZodBoolean;
|
|
257
|
+
reason: z.ZodEnum<{
|
|
258
|
+
owner: "owner";
|
|
259
|
+
unavailable: "unavailable";
|
|
260
|
+
allowed: "allowed";
|
|
261
|
+
blocked: "blocked";
|
|
262
|
+
private: "private";
|
|
263
|
+
public: "public";
|
|
264
|
+
unsupported_consumer: "unsupported_consumer";
|
|
265
|
+
contact_not_approved: "contact_not_approved";
|
|
266
|
+
mature_content: "mature_content";
|
|
267
|
+
unrated_content: "unrated_content";
|
|
268
|
+
approval_required: "approval_required";
|
|
269
|
+
}>;
|
|
270
|
+
policyVersion: z.ZodLiteral<"2">;
|
|
271
|
+
}, z.core.$strict>;
|
|
272
|
+
}, z.core.$strict>>;
|
|
273
|
+
}, z.core.$strict>;
|
|
274
|
+
export type NotificationAccessInput = z.infer<typeof notificationAccessInputSchema>;
|
|
275
|
+
export type NotificationAccessBatchInput = z.infer<typeof notificationAccessBatchInputSchema>;
|
|
234
276
|
/** Live socket-recipient proof; a request ID correlates the result and never identifies an account. */
|
|
235
277
|
export declare const messagingSessionsInputSchema: z.ZodObject<{
|
|
236
278
|
items: z.ZodArray<z.ZodObject<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/contracts",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.0",
|
|
4
4
|
"description": "OxyHQ API contracts — single source of truth for request/response Zod schemas and inferred types, shared by the backend and the client SDKs",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
"zod": "^4.6.7"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@types/node": "^
|
|
90
|
-
"jest": "^30.5.
|
|
91
|
-
"typescript": "
|
|
92
|
-
"@oxy.so/bloom": "
|
|
89
|
+
"@types/node": "^26.6.6",
|
|
90
|
+
"jest": "^30.5.2",
|
|
91
|
+
"typescript": "~6.0.3",
|
|
92
|
+
"@oxy.so/bloom": "17.4.0"
|
|
93
93
|
}
|
|
94
94
|
}
|