@oxy.so/contracts 6.5.0 → 6.6.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(),
|
|
@@ -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(),
|
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/contracts",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.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.1.0"
|
|
93
93
|
}
|
|
94
94
|
}
|