@oxyhq/contracts 0.13.1 → 0.13.2
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/.tsbuildinfo +1 -1
- package/dist/cjs/accountGraph.js +48 -0
- package/dist/cjs/index.js +6 -2
- package/dist/cjs/userResponse.js +6 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/accountGraph.js +45 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/userResponse.js +6 -0
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/accountGraph.d.ts +83 -0
- package/dist/types/identity.d.ts +4 -4
- package/dist/types/index.d.ts +2 -0
- package/dist/types/sessionStatus.d.ts +6 -6
- package/dist/types/userResponse.d.ts +92 -10
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Account graph wire contracts — organization taxonomy and create-account input.
|
|
4
|
+
*
|
|
5
|
+
* `organizationCategory` classifies `kind: 'organization'` accounts (agency,
|
|
6
|
+
* cooperative, landlord, …) without polluting `User.kind`. Meaningful only when
|
|
7
|
+
* `kind === 'organization'`.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.createAccountRequestSchema = exports.organizationCategorySchema = exports.ORGANIZATION_CATEGORIES = void 0;
|
|
11
|
+
const zod_1 = require("zod");
|
|
12
|
+
exports.ORGANIZATION_CATEGORIES = [
|
|
13
|
+
'agency',
|
|
14
|
+
'cooperative',
|
|
15
|
+
'landlord',
|
|
16
|
+
'other',
|
|
17
|
+
];
|
|
18
|
+
exports.organizationCategorySchema = zod_1.z.enum(exports.ORGANIZATION_CATEGORIES);
|
|
19
|
+
const accountNameSchema = zod_1.z
|
|
20
|
+
.object({
|
|
21
|
+
first: zod_1.z.string().trim().max(100).optional(),
|
|
22
|
+
last: zod_1.z.string().trim().max(100).optional(),
|
|
23
|
+
})
|
|
24
|
+
.optional();
|
|
25
|
+
/**
|
|
26
|
+
* POST /accounts — create a non-personal account under the caller's tree.
|
|
27
|
+
* `organizationCategory` is accepted only when `kind` is `organization`.
|
|
28
|
+
*/
|
|
29
|
+
exports.createAccountRequestSchema = zod_1.z
|
|
30
|
+
.object({
|
|
31
|
+
parentAccountId: zod_1.z.string().trim().min(1).optional(),
|
|
32
|
+
kind: zod_1.z.enum(['organization', 'project', 'bot']),
|
|
33
|
+
username: zod_1.z.string().trim().min(1).max(100),
|
|
34
|
+
name: accountNameSchema,
|
|
35
|
+
bio: zod_1.z.string().trim().max(500).optional(),
|
|
36
|
+
avatar: zod_1.z.string().optional(),
|
|
37
|
+
description: zod_1.z.string().trim().max(1000).optional(),
|
|
38
|
+
organizationCategory: exports.organizationCategorySchema.optional(),
|
|
39
|
+
})
|
|
40
|
+
.superRefine((data, ctx) => {
|
|
41
|
+
if (data.organizationCategory !== undefined && data.kind !== 'organization') {
|
|
42
|
+
ctx.addIssue({
|
|
43
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
44
|
+
message: 'organizationCategory applies only when kind is organization',
|
|
45
|
+
path: ['organizationCategory'],
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
});
|
package/dist/cjs/index.js
CHANGED
|
@@ -11,8 +11,12 @@
|
|
|
11
11
|
* expo, no `require()` in the ESM build.
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.
|
|
15
|
-
exports.loginResultSchema = exports.deviceHubTicketRedeemResponseSchema = exports.deviceHubTicketRedeemRequestSchema = exports.deviceHubTicketIssueResponseSchema = exports.deviceHubTicketIssueRequestSchema = exports.deviceTokenMintResponseSchema = exports.deviceTokenMintRequestSchema = exports.deviceSessionSyncSchema = exports.activeTokenSchema = exports.deviceSessionStateSchema = exports.sessionAccountSchema = exports.linkPreviewResponseSchema = exports.linkPreviewBatchResponseSchema = exports.linkPreviewBatchRequestSchema = exports.linkPreviewSchema = exports.credentialVerifyResultSchema = exports.credentialListResultSchema = exports.credentialIssueResultSchema = exports.verifiableCredentialResponseSchema = exports.credentialRecordSchema = exports.vouchResultSchema = void 0;
|
|
14
|
+
exports.validationVoteResultSchema = exports.validationRequestSummarySchema = exports.validationOpenResultSchema = exports.validationOpenRequestSchema = exports.validationVerdictRecordSchema = exports.realLifeAttestationResultSchema = exports.realLifeAttestationRecordSchema = exports.signedPublicCardSchema = exports.publicCardSchema = exports.logPageResponseSchema = exports.chainHeadResponseSchema = exports.oxySignedRecordTypeSchema = exports.exportBundleSchema = exports.exportAttestationSchema = exports.authMethodsResponseSchema = exports.authMethodEntrySchema = exports.domainVerificationInstructionsSchema = exports.domainVerificationRequestSchema = exports.verifiedDomainSchema = exports.signedRecordEnvelopeSchema = exports.didDocumentSchema = exports.didServiceSchema = exports.verificationMethodSchema = exports.appAffinityEventsIngestSchema = exports.appAffinityEventSchema = exports.appAffinityEventTypeSchema = exports.appUserSignalIngestSchema = exports.appInterestInputSchema = exports.appEndorsementInputSchema = exports.recommendationResponseSchema = exports.recommendationItemSchema = exports.recommendationCountSchema = exports.recommendationRequestSchema = exports.recommendationSignalWeightsSchema = exports.recommendationBoostSchema = exports.recommendationExcludeTypeSchema = exports.sessionStatusSchema = exports.publicApplicationSchema = exports.applicationTypeSchema = exports.safeParseContract = exports.resolveUserId = exports.deviceLinkedSessionsResponseSchema = exports.deviceLinkedSessionSchema = exports.currentUserResponseSchema = exports.userProfileUpdateSchema = exports.userResponseSchema = exports.userNameSchema = exports.createAccountRequestSchema = exports.organizationCategorySchema = exports.ORGANIZATION_CATEGORIES = void 0;
|
|
15
|
+
exports.loginResultSchema = exports.deviceHubTicketRedeemResponseSchema = exports.deviceHubTicketRedeemRequestSchema = exports.deviceHubTicketIssueResponseSchema = exports.deviceHubTicketIssueRequestSchema = exports.deviceTokenMintResponseSchema = exports.deviceTokenMintRequestSchema = exports.deviceSessionSyncSchema = exports.activeTokenSchema = exports.deviceSessionStateSchema = exports.sessionAccountSchema = exports.linkPreviewResponseSchema = exports.linkPreviewBatchResponseSchema = exports.linkPreviewBatchRequestSchema = exports.linkPreviewSchema = exports.credentialVerifyResultSchema = exports.credentialListResultSchema = exports.credentialIssueResultSchema = exports.verifiableCredentialResponseSchema = exports.credentialRecordSchema = exports.vouchResultSchema = exports.personhoodStatusResultSchema = exports.personhoodBreakdownSchema = exports.personhoodVouchRecordSchema = void 0;
|
|
16
|
+
var accountGraph_1 = require("./accountGraph");
|
|
17
|
+
Object.defineProperty(exports, "ORGANIZATION_CATEGORIES", { enumerable: true, get: function () { return accountGraph_1.ORGANIZATION_CATEGORIES; } });
|
|
18
|
+
Object.defineProperty(exports, "organizationCategorySchema", { enumerable: true, get: function () { return accountGraph_1.organizationCategorySchema; } });
|
|
19
|
+
Object.defineProperty(exports, "createAccountRequestSchema", { enumerable: true, get: function () { return accountGraph_1.createAccountRequestSchema; } });
|
|
16
20
|
var userResponse_1 = require("./userResponse");
|
|
17
21
|
// Schemas
|
|
18
22
|
Object.defineProperty(exports, "userNameSchema", { enumerable: true, get: function () { return userResponse_1.userNameSchema; } });
|
package/dist/cjs/userResponse.js
CHANGED
|
@@ -35,6 +35,7 @@ exports.resolveUserId = resolveUserId;
|
|
|
35
35
|
exports.safeParseContract = safeParseContract;
|
|
36
36
|
const zod_1 = require("zod");
|
|
37
37
|
const identity_1 = require("./identity");
|
|
38
|
+
const accountGraph_1 = require("./accountGraph");
|
|
38
39
|
exports.userNameSchema = zod_1.z
|
|
39
40
|
.object({
|
|
40
41
|
first: zod_1.z.string().optional(),
|
|
@@ -90,6 +91,11 @@ exports.userResponseSchema = zod_1.z
|
|
|
90
91
|
* entry; present only when the account has verified at least one domain.
|
|
91
92
|
*/
|
|
92
93
|
verifiedDomains: zod_1.z.array(identity_1.verifiedDomainSchema).optional(),
|
|
94
|
+
/**
|
|
95
|
+
* Real-estate / team taxonomy for `kind: 'organization'` accounts.
|
|
96
|
+
* Absent on personal, project, and bot accounts.
|
|
97
|
+
*/
|
|
98
|
+
organizationCategory: accountGraph_1.organizationCategorySchema.optional(),
|
|
93
99
|
})
|
|
94
100
|
.passthrough();
|
|
95
101
|
exports.userProfileUpdateSchema = zod_1.z
|