wowok_agent 1.6.6 → 2.1.9
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/README.md +20 -40
- package/dist/index.d.ts +6 -27
- package/dist/index.js +1026 -27
- package/dist/schema/call/allocation.d.ts +8 -0
- package/dist/schema/call/allocation.js +27 -0
- package/dist/schema/call/arbitration.d.ts +27 -0
- package/dist/schema/call/arbitration.js +106 -0
- package/dist/schema/call/base.d.ts +41 -0
- package/dist/schema/call/base.js +152 -0
- package/dist/schema/call/contact.d.ts +9 -0
- package/dist/schema/call/contact.js +41 -0
- package/dist/schema/call/demand.d.ts +10 -0
- package/dist/schema/call/demand.js +51 -0
- package/dist/schema/call/guard.d.ts +15 -0
- package/dist/schema/call/guard.js +67 -0
- package/dist/schema/call/handler.d.ts +80 -0
- package/dist/schema/call/handler.js +177 -0
- package/dist/schema/call/index.d.ts +18 -0
- package/dist/schema/call/index.js +19 -0
- package/dist/schema/call/machine.d.ts +23 -0
- package/dist/schema/call/machine.js +164 -0
- package/dist/schema/call/order.d.ts +11 -0
- package/dist/schema/call/order.js +39 -0
- package/dist/schema/call/payment.d.ts +7 -0
- package/dist/schema/call/payment.js +20 -0
- package/dist/schema/call/permission.d.ts +27 -0
- package/dist/schema/call/permission.js +118 -0
- package/dist/schema/call/personal.d.ts +27 -0
- package/dist/schema/call/personal.js +81 -0
- package/dist/schema/call/progress.d.ts +6 -0
- package/dist/schema/call/progress.js +37 -0
- package/dist/schema/call/proof.d.ts +7 -0
- package/dist/schema/call/proof.js +27 -0
- package/dist/schema/call/repository.d.ts +15 -0
- package/dist/schema/call/repository.js +85 -0
- package/dist/schema/call/reward.d.ts +7 -0
- package/dist/schema/call/reward.js +46 -0
- package/dist/schema/call/service.d.ts +7 -0
- package/dist/schema/call/service.js +87 -0
- package/dist/schema/call/treasury.d.ts +6 -0
- package/dist/schema/call/treasury.js +76 -0
- package/dist/schema/common/index.d.ts +57 -0
- package/dist/schema/common/index.js +331 -0
- package/dist/schema/index.d.ts +7 -0
- package/dist/schema/index.js +8 -0
- package/dist/schema/local/index.d.ts +120 -0
- package/dist/schema/local/index.js +913 -0
- package/dist/schema/local/wip.d.ts +33 -0
- package/dist/schema/local/wip.js +229 -0
- package/dist/schema/messenger/index.d.ts +34 -0
- package/dist/schema/messenger/index.js +407 -0
- package/dist/schema/query/index.d.ts +240 -0
- package/dist/schema/query/index.js +1313 -0
- package/dist/schema/utils/guard-parser.d.ts +20 -0
- package/dist/schema/utils/guard-parser.js +410 -0
- package/dist/schema/utils/guard-query-utils.d.ts +5 -0
- package/dist/schema/utils/guard-query-utils.js +22 -0
- package/dist/schema/utils/node-parser.d.ts +59 -0
- package/dist/schema/utils/node-parser.js +382 -0
- package/dist/schema/utils/permission-index-utils.d.ts +2 -0
- package/dist/schema/utils/permission-index-utils.js +10 -0
- package/package.json +31 -49
- package/LICENSE +0 -201
- package/dist/call/arbitration.d.ts +0 -57
- package/dist/call/arbitration.d.ts.map +0 -1
- package/dist/call/arbitration.js +0 -245
- package/dist/call/arbitration.js.map +0 -1
- package/dist/call/base.d.ts +0 -85
- package/dist/call/base.d.ts.map +0 -1
- package/dist/call/base.js +0 -231
- package/dist/call/base.js.map +0 -1
- package/dist/call/call.d.ts +0 -95
- package/dist/call/call.d.ts.map +0 -1
- package/dist/call/call.js +0 -149
- package/dist/call/call.js.map +0 -1
- package/dist/call/demand.d.ts +0 -46
- package/dist/call/demand.d.ts.map +0 -1
- package/dist/call/demand.js +0 -201
- package/dist/call/demand.js.map +0 -1
- package/dist/call/guard.d.ts +0 -53
- package/dist/call/guard.d.ts.map +0 -1
- package/dist/call/guard.js +0 -386
- package/dist/call/guard.js.map +0 -1
- package/dist/call/machine.d.ts +0 -97
- package/dist/call/machine.d.ts.map +0 -1
- package/dist/call/machine.js +0 -342
- package/dist/call/machine.js.map +0 -1
- package/dist/call/object_permission.d.ts +0 -14
- package/dist/call/object_permission.d.ts.map +0 -1
- package/dist/call/object_permission.js +0 -59
- package/dist/call/object_permission.js.map +0 -1
- package/dist/call/permission.d.ts +0 -63
- package/dist/call/permission.d.ts.map +0 -1
- package/dist/call/permission.js +0 -137
- package/dist/call/permission.js.map +0 -1
- package/dist/call/personal.d.ts +0 -47
- package/dist/call/personal.d.ts.map +0 -1
- package/dist/call/personal.js +0 -119
- package/dist/call/personal.js.map +0 -1
- package/dist/call/repository.d.ts +0 -117
- package/dist/call/repository.d.ts.map +0 -1
- package/dist/call/repository.js +0 -408
- package/dist/call/repository.js.map +0 -1
- package/dist/call/service.d.ts +0 -115
- package/dist/call/service.d.ts.map +0 -1
- package/dist/call/service.js +0 -550
- package/dist/call/service.js.map +0 -1
- package/dist/call/treasury.d.ts +0 -46
- package/dist/call/treasury.d.ts.map +0 -1
- package/dist/call/treasury.js +0 -222
- package/dist/call/treasury.js.map +0 -1
- package/dist/common.d.ts +0 -12
- package/dist/common.d.ts.map +0 -1
- package/dist/common.js +0 -71
- package/dist/common.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/local/.d.ts +0 -20
- package/dist/local/.d.ts.map +0 -1
- package/dist/local/.js +0 -76
- package/dist/local/.js.map +0 -1
- package/dist/local/account.d.ts +0 -42
- package/dist/local/account.d.ts.map +0 -1
- package/dist/local/account.js +0 -335
- package/dist/local/account.js.map +0 -1
- package/dist/local/cache.d.ts +0 -32
- package/dist/local/cache.d.ts.map +0 -1
- package/dist/local/cache.js +0 -77
- package/dist/local/cache.js.map +0 -1
- package/dist/local/coin.d.ts +0 -22
- package/dist/local/coin.d.ts.map +0 -1
- package/dist/local/coin.js +0 -123
- package/dist/local/coin.js.map +0 -1
- package/dist/local/config.d.ts +0 -20
- package/dist/local/config.d.ts.map +0 -1
- package/dist/local/config.js +0 -75
- package/dist/local/config.js.map +0 -1
- package/dist/local/index.d.ts +0 -110
- package/dist/local/index.d.ts.map +0 -1
- package/dist/local/index.js +0 -122
- package/dist/local/index.js.map +0 -1
- package/dist/local/local.d.ts +0 -55
- package/dist/local/local.d.ts.map +0 -1
- package/dist/local/local.js +0 -248
- package/dist/local/local.js.map +0 -1
- package/dist/query/events.d.ts +0 -65
- package/dist/query/events.d.ts.map +0 -1
- package/dist/query/events.js +0 -75
- package/dist/query/events.js.map +0 -1
- package/dist/query/objects.d.ts +0 -346
- package/dist/query/objects.d.ts.map +0 -1
- package/dist/query/objects.js +0 -472
- package/dist/query/objects.js.map +0 -1
- package/dist/query/permission.d.ts +0 -15
- package/dist/query/permission.d.ts.map +0 -1
- package/dist/query/permission.js +0 -45
- package/dist/query/permission.js.map +0 -1
- package/dist/query/received.d.ts +0 -16
- package/dist/query/received.d.ts.map +0 -1
- package/dist/query/received.js +0 -16
- package/dist/query/received.js.map +0 -1
- package/dist/schema/call.d.ts +0 -13005
- package/dist/schema/call.d.ts.map +0 -1
- package/dist/schema/call.js +0 -997
- package/dist/schema/call.js.map +0 -1
- package/dist/schema/const.d.ts +0 -254
- package/dist/schema/const.d.ts.map +0 -1
- package/dist/schema/const.js +0 -305
- package/dist/schema/const.js.map +0 -1
- package/dist/schema/local.d.ts +0 -702
- package/dist/schema/local.d.ts.map +0 -1
- package/dist/schema/local.js +0 -150
- package/dist/schema/local.js.map +0 -1
- package/dist/schema/query.d.ts +0 -1465
- package/dist/schema/query.d.ts.map +0 -1
- package/dist/schema/query.js +0 -224
- package/dist/schema/query.js.map +0 -1
- package/dist/schema/util.d.ts +0 -71
- package/dist/schema/util.d.ts.map +0 -1
- package/dist/schema/util.js +0 -139
- package/dist/schema/util.js.map +0 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PermissionIndexTypeSchema } from "../query/index.js";
|
|
3
|
+
import { CallEnvSchema, SubmissionCallSchema, NormalObjectSchema } from "./base.js";
|
|
4
|
+
import { AccountOrMark_AddressSchema, DescriptionSchema, LongNameSchema, ManyAccountOrMark_AddressSchema, NameOrAddressSchema, ReceivedObjectsOrRecentlySchema } from "../common/index.js";
|
|
5
|
+
// 定义remark的set操作 schema
|
|
6
|
+
export const RemarkSetSchema = z.object({
|
|
7
|
+
op: z.literal("set"),
|
|
8
|
+
index: PermissionIndexTypeSchema,
|
|
9
|
+
remark: LongNameSchema.describe("Permission remark.")
|
|
10
|
+
}).strict().describe("Set remark for a permission.");
|
|
11
|
+
// 定义remark的remove操作 schema
|
|
12
|
+
export const RemarkRemoveSchema = z.object({
|
|
13
|
+
op: z.literal("remove"),
|
|
14
|
+
index: PermissionIndexTypeSchema
|
|
15
|
+
}).strict().describe("Remove remark for a permission.");
|
|
16
|
+
// 定义remark的clear操作 schema
|
|
17
|
+
export const RemarkClearSchema = z.object({
|
|
18
|
+
op: z.literal("clear")
|
|
19
|
+
}).strict().describe("Clear remarks for all permissions.");
|
|
20
|
+
// 定义remark schema(联合类型)
|
|
21
|
+
export const RemarkSchema = z.discriminatedUnion("op", [
|
|
22
|
+
RemarkSetSchema,
|
|
23
|
+
RemarkRemoveSchema,
|
|
24
|
+
RemarkClearSchema
|
|
25
|
+
]).describe("Set remarks for permissions.");
|
|
26
|
+
// 定义table的add/set/remove perm by index操作 schema
|
|
27
|
+
export const TablePermByIndexSchema = z.discriminatedUnion("op", [
|
|
28
|
+
z.object({
|
|
29
|
+
op: z.literal("add perm by index"),
|
|
30
|
+
index: PermissionIndexTypeSchema,
|
|
31
|
+
entity: ManyAccountOrMark_AddressSchema
|
|
32
|
+
}).strict().describe("Grant a specific permission to multiple entities at once. USE WHEN: You need to assign the SAME permission to MULTIPLE users/Guards. Example: Give 'create service' permission to Alice, Bob, and Carol simultaneously."),
|
|
33
|
+
z.object({
|
|
34
|
+
op: z.literal("set perm by index"),
|
|
35
|
+
index: PermissionIndexTypeSchema,
|
|
36
|
+
entity: ManyAccountOrMark_AddressSchema
|
|
37
|
+
}).strict().describe("Replace the entity list for a specific permission with a new set of entities. USE WHEN: You want to completely redefine WHO has this permission. WARNING: This overwrites the existing entity list for this permission."),
|
|
38
|
+
z.object({
|
|
39
|
+
op: z.literal("remove perm by index"),
|
|
40
|
+
index: PermissionIndexTypeSchema,
|
|
41
|
+
entity: ManyAccountOrMark_AddressSchema
|
|
42
|
+
}).strict().describe("Revoke a specific permission from multiple entities at once. USE WHEN: You need to remove the SAME permission from MULTIPLE users/Guards. Example: Remove 'create service' permission from Alice, Bob, and Carol simultaneously."),
|
|
43
|
+
]).describe("Permission-centric operations: Manage WHO has a specific permission. Best for batch-assigning one permission to many users. Structure: {op: 'add|set|remove perm by index', index: permission_id, entity: [user1, user2, ...]}");
|
|
44
|
+
// 定义table的add/set/remove perm by entity操作 schema
|
|
45
|
+
export const TablePermByEntitySchema = z.discriminatedUnion("op", [
|
|
46
|
+
z.object({
|
|
47
|
+
op: z.literal("add perm by entity"),
|
|
48
|
+
entity: AccountOrMark_AddressSchema,
|
|
49
|
+
index: z.array(PermissionIndexTypeSchema)
|
|
50
|
+
}).strict().describe("Grant multiple permissions to a single entity. USE WHEN: You need to give ONE user/Guard MANY permissions at once. Example: Give Alice all Machine-related permissions (create, edit, publish, pause, etc.) in one call."),
|
|
51
|
+
z.object({
|
|
52
|
+
op: z.literal("set perm by entity"),
|
|
53
|
+
entity: AccountOrMark_AddressSchema,
|
|
54
|
+
index: z.array(PermissionIndexTypeSchema)
|
|
55
|
+
}).strict().describe("Replace all permissions of a single entity with a new permission set. USE WHEN: You want to completely redefine WHAT permissions a user/Guard has. WARNING: This overwrites all existing permissions for this entity."),
|
|
56
|
+
z.object({
|
|
57
|
+
op: z.literal("remove perm by entity"),
|
|
58
|
+
entity: AccountOrMark_AddressSchema,
|
|
59
|
+
index: z.array(PermissionIndexTypeSchema)
|
|
60
|
+
}).strict().describe("Revoke multiple permissions from a single entity. USE WHEN: You need to remove MANY permissions from ONE user/Guard at once. Example: Remove all Machine-related permissions from Alice."),
|
|
61
|
+
]).describe("Entity-centric operations: Manage WHAT permissions a specific user/Guard has. Best for assigning many permissions to one user. Structure: {op: 'add|set|remove perm by entity', entity: user_id, index: [perm1, perm2, ...]}");
|
|
62
|
+
// 定义table schema(联合类型)
|
|
63
|
+
export const TableSchema = z.discriminatedUnion("op", [
|
|
64
|
+
...TablePermByIndexSchema.options,
|
|
65
|
+
...TablePermByEntitySchema.options
|
|
66
|
+
]).describe("Manage permission assignments using two complementary approaches. CHOOSE THE RIGHT APPROACH: (1) 'perm by index' - Use when granting ONE permission to MANY users (permission-centric). Example: Give 'create service' permission to Alice, Bob, and Carol. (2) 'perm by entity' - Use when granting MANY permissions to ONE user (entity-centric). Example: Give Alice all Machine-related permissions. Both approaches support add/set/remove operations. Requires admin permission.");
|
|
67
|
+
// 定义entity的swap/replace/copy操作 schema
|
|
68
|
+
export const EntitySwapReplaceCopySchema = z.discriminatedUnion("op", [
|
|
69
|
+
z.object({
|
|
70
|
+
op: z.literal("swap"),
|
|
71
|
+
entity1: AccountOrMark_AddressSchema,
|
|
72
|
+
entity2: AccountOrMark_AddressSchema
|
|
73
|
+
}).strict().describe("Swap all permission indexes between two entities."),
|
|
74
|
+
z.object({
|
|
75
|
+
op: z.literal("replace"),
|
|
76
|
+
entity1: AccountOrMark_AddressSchema,
|
|
77
|
+
entity2: AccountOrMark_AddressSchema
|
|
78
|
+
}).strict().describe("Remove all permission indexes from entity1 and add them to entity2's permission indexes."),
|
|
79
|
+
z.object({
|
|
80
|
+
op: z.literal("copy"),
|
|
81
|
+
entity1: AccountOrMark_AddressSchema,
|
|
82
|
+
entity2: AccountOrMark_AddressSchema
|
|
83
|
+
}).strict().describe("Add all permission indexes from entity1 to entity2's permission indexes."),
|
|
84
|
+
]);
|
|
85
|
+
// 定义entity的del操作 schema
|
|
86
|
+
export const EntityDelSchema = z.object({
|
|
87
|
+
op: z.literal("del"),
|
|
88
|
+
entity: AccountOrMark_AddressSchema
|
|
89
|
+
}).strict().describe("Delete all permission indexes from an entity.");
|
|
90
|
+
// 定义entity schema(联合类型)
|
|
91
|
+
export const EntitySchema = z.discriminatedUnion("op", [
|
|
92
|
+
...EntitySwapReplaceCopySchema.options,
|
|
93
|
+
EntityDelSchema
|
|
94
|
+
]);
|
|
95
|
+
// 定义admin schema
|
|
96
|
+
export const AdminSchema = z.object({
|
|
97
|
+
op: z.enum(["add", "remove", "set"]).describe("Admin operations: add, remove, set."),
|
|
98
|
+
addresses: ManyAccountOrMark_AddressSchema.describe("List of admin addresses.")
|
|
99
|
+
}).strict();
|
|
100
|
+
// 定义CallPermission_Data schema
|
|
101
|
+
export const CallPermission_DataSchema = z.object({
|
|
102
|
+
object: NormalObjectSchema.optional(),
|
|
103
|
+
description: DescriptionSchema.optional(),
|
|
104
|
+
remark: RemarkSchema.optional(),
|
|
105
|
+
table: TableSchema.optional().describe("Manage permission assignments using two approaches: (1) By Permission Index - add/set/remove entity IDs for a specific permission; (2) By Entity - add/set/remove permission indexes for a specific entity. Requires admin permission."),
|
|
106
|
+
entity: EntitySchema.optional().describe("Advanced entity permission operations: swap permissions between two entities, replace one entity's permissions with another's, copy permissions from one entity to another, or delete all permissions of an entity. Entity can be a user ID or Guard object ID. Requires admin permission."),
|
|
107
|
+
admin: AdminSchema.optional().describe("Manage Permission object admins: add new admins, remove existing admins, or set the complete admin list. Only the Permission object owner (builder) can perform this operation. The creator automatically becomes an admin with full permissions."),
|
|
108
|
+
apply: z.array(NameOrAddressSchema).optional().describe("Array of object IDs or names to operate on, apply the Permission object to these objects' permission control. Note: The signer must be the owner of the existing Permission objects for these objects"),
|
|
109
|
+
builder: AccountOrMark_AddressSchema.optional().describe("Set or transfer ownership of the Permission object to the specified user ID. The creator automatically becomes the builder; only the builder can transfer ownership to other users."),
|
|
110
|
+
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe('Unwrap CoinWrapper objects and other objects received by this object and send them to the builder(owner).'),
|
|
111
|
+
um: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object."),
|
|
112
|
+
}).strict().describe("On-chain Permission operations. USAGE: (1) CREATE NEW: Set 'object' field with {name, tag?, ...} to create a Permission. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. (2) OPERATE EXISTING: Set 'object' field with object ID or name. The 'object' field is CRITICAL and REQUIRED in both cases.");
|
|
113
|
+
// 定义输入schema
|
|
114
|
+
export const CallPermission_InputSchema = z.object({
|
|
115
|
+
data: CallPermission_DataSchema,
|
|
116
|
+
env: CallEnvSchema.optional(),
|
|
117
|
+
submission: SubmissionCallSchema.optional(),
|
|
118
|
+
}).strict();
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const InformationAddSchema: any;
|
|
3
|
+
export declare const InformationRemoveSchema: any;
|
|
4
|
+
export declare const InformationClearSchema: any;
|
|
5
|
+
export declare const InformationSchema: any;
|
|
6
|
+
export declare const MarkAddSchema: any;
|
|
7
|
+
export declare const MarkRemoveSchema: any;
|
|
8
|
+
export declare const MarkClearSchema: any;
|
|
9
|
+
export declare const MarkTransferSchema: any;
|
|
10
|
+
export declare const MarkReplaceSchema: any;
|
|
11
|
+
export declare const MarkDestroySchema: any;
|
|
12
|
+
export declare const MarkSchema: any;
|
|
13
|
+
export declare const CallPersonal_DataSchema: any;
|
|
14
|
+
export declare const CallPersonal_InputSchema: any;
|
|
15
|
+
export type InformationAdd = z.infer<typeof InformationAddSchema>;
|
|
16
|
+
export type InformationRemove = z.infer<typeof InformationRemoveSchema>;
|
|
17
|
+
export type InformationClear = z.infer<typeof InformationClearSchema>;
|
|
18
|
+
export type Information = z.infer<typeof InformationSchema>;
|
|
19
|
+
export type MarkAdd = z.infer<typeof MarkAddSchema>;
|
|
20
|
+
export type MarkRemove = z.infer<typeof MarkRemoveSchema>;
|
|
21
|
+
export type MarkClear = z.infer<typeof MarkClearSchema>;
|
|
22
|
+
export type MarkTransfer = z.infer<typeof MarkTransferSchema>;
|
|
23
|
+
export type MarkReplace = z.infer<typeof MarkReplaceSchema>;
|
|
24
|
+
export type MarkDestroy = z.infer<typeof MarkDestroySchema>;
|
|
25
|
+
export type Mark = z.infer<typeof MarkSchema>;
|
|
26
|
+
export type CallPersonal_Data = z.infer<typeof CallPersonal_DataSchema>;
|
|
27
|
+
export type CallPersonal_Input = z.infer<typeof CallPersonal_InputSchema>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AccountOrMark_AddressSchema, DescriptionSchema, ManyAccountOrMark_AddressSchema, NameSchema } from "../common/index.js";
|
|
3
|
+
import { RecordsInEntitySchema } from "../query/index.js";
|
|
4
|
+
import { CallEnvSchema } from "./base.js";
|
|
5
|
+
// 定义information的add操作 schema
|
|
6
|
+
export const InformationAddSchema = z.object({
|
|
7
|
+
op: z.literal("add"),
|
|
8
|
+
data: z.array(RecordsInEntitySchema)
|
|
9
|
+
}).strict().describe("PUBLIC: Add personal info on-chain. Safe: social handles, URLs, public email. NEVER: phone, address, private keys.");
|
|
10
|
+
// 定义information的remove操作 schema
|
|
11
|
+
export const InformationRemoveSchema = z.object({
|
|
12
|
+
op: z.literal("remove"),
|
|
13
|
+
name: z.array(NameSchema)
|
|
14
|
+
}).strict().describe("PUBLIC: Remove specified personal info records from your public profile.");
|
|
15
|
+
// 定义information的clear操作 schema
|
|
16
|
+
export const InformationClearSchema = z.object({
|
|
17
|
+
op: z.literal("clear")
|
|
18
|
+
}).strict().describe("PUBLIC: Clear ALL personal info from your public profile.");
|
|
19
|
+
// 定义information schema(联合类型)
|
|
20
|
+
export const InformationSchema = z.discriminatedUnion("op", [
|
|
21
|
+
InformationAddSchema,
|
|
22
|
+
InformationRemoveSchema,
|
|
23
|
+
InformationClearSchema
|
|
24
|
+
]);
|
|
25
|
+
// 定义mark的add操作 schema
|
|
26
|
+
export const MarkAddSchema = z.object({
|
|
27
|
+
op: z.literal("add"),
|
|
28
|
+
data: z.array(z.object({
|
|
29
|
+
address: AccountOrMark_AddressSchema,
|
|
30
|
+
name: NameSchema.optional(),
|
|
31
|
+
tags: z.array(NameSchema).optional()
|
|
32
|
+
}).strict()),
|
|
33
|
+
}).strict().describe("PUBLIC: Add ID name and tags on-chain for public identity. For private marks, use 'local' tool.");
|
|
34
|
+
// 定义mark的remove操作 schema
|
|
35
|
+
export const MarkRemoveSchema = z.object({
|
|
36
|
+
op: z.literal("remove"),
|
|
37
|
+
data: z.array(z.object({
|
|
38
|
+
address: AccountOrMark_AddressSchema,
|
|
39
|
+
tags: z.array(NameSchema).optional()
|
|
40
|
+
}).strict())
|
|
41
|
+
}).strict().describe("PUBLIC: Remove specified tags from your on-chain identity mark.");
|
|
42
|
+
// 定义mark的clear操作 schema
|
|
43
|
+
export const MarkClearSchema = z.object({
|
|
44
|
+
op: z.literal("clear"),
|
|
45
|
+
address: ManyAccountOrMark_AddressSchema
|
|
46
|
+
}).strict().describe("PUBLIC: Clear ALL tags from specified on-chain identity marks.");
|
|
47
|
+
// 定义mark的transfer操作 schema
|
|
48
|
+
export const MarkTransferSchema = z.object({
|
|
49
|
+
op: z.literal("transfer"),
|
|
50
|
+
to: AccountOrMark_AddressSchema
|
|
51
|
+
}).strict().describe("PUBLIC: Transfer your on-chain identity mark to another address.");
|
|
52
|
+
// 定义mark的replace操作 schema
|
|
53
|
+
export const MarkReplaceSchema = z.object({
|
|
54
|
+
op: z.literal("replace"),
|
|
55
|
+
new_mark_object: z.string().describe("New personal ID tag object ID.")
|
|
56
|
+
}).strict().describe("PUBLIC: Replace your on-chain identity mark with a new object.");
|
|
57
|
+
// 定义mark的destroy操作 schema
|
|
58
|
+
export const MarkDestroySchema = z.object({
|
|
59
|
+
op: z.literal("destroy")
|
|
60
|
+
}).strict().describe("PUBLIC: Destroy your on-chain identity mark permanently.");
|
|
61
|
+
// 定义mark schema(联合类型)
|
|
62
|
+
export const MarkSchema = z.discriminatedUnion("op", [
|
|
63
|
+
MarkAddSchema,
|
|
64
|
+
MarkRemoveSchema,
|
|
65
|
+
MarkClearSchema,
|
|
66
|
+
MarkTransferSchema,
|
|
67
|
+
MarkReplaceSchema,
|
|
68
|
+
MarkDestroySchema
|
|
69
|
+
]);
|
|
70
|
+
// 定义CallPersonal_Data schema
|
|
71
|
+
export const CallPersonal_DataSchema = z.object({
|
|
72
|
+
description: DescriptionSchema.optional(),
|
|
73
|
+
referrer: z.union([AccountOrMark_AddressSchema, z.null()]).optional().describe("Referrer ID for joining the on-chain network."),
|
|
74
|
+
information: InformationSchema.optional().describe("PUBLIC: Personal info on-chain. Safe: social handles, URLs. NEVER: phone, address, private keys."),
|
|
75
|
+
mark: MarkSchema.optional().describe("PUBLIC: On-chain identity mark. For PRIVATE marks, use 'local' tool.")
|
|
76
|
+
}).strict();
|
|
77
|
+
// 定义输入schema
|
|
78
|
+
export const CallPersonal_InputSchema = z.object({
|
|
79
|
+
data: CallPersonal_DataSchema,
|
|
80
|
+
env: CallEnvSchema.optional(),
|
|
81
|
+
}).strict();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const ProgressNextSchema: any;
|
|
2
|
+
export declare const OperateWithHoldSchema: any;
|
|
3
|
+
export declare const OperateWithoutHoldSchema: any;
|
|
4
|
+
export declare const OperateSchema: any;
|
|
5
|
+
export declare const CallProgress_DataSchema: any;
|
|
6
|
+
export declare const CallProgress_InputSchema: any;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { CallEnvSchema, SubmissionCallSchema, ObjectsSchema } from "./base.js";
|
|
3
|
+
import { ProgressNamedOperatorSchema } from "./machine.js";
|
|
4
|
+
import { NameOrAddressSchema, NameSchema } from "../common/index.js";
|
|
5
|
+
// ProgressNext 类型定义
|
|
6
|
+
export const ProgressNextSchema = z.object({
|
|
7
|
+
next_node_name: NameSchema.describe("Next node name."),
|
|
8
|
+
forward: NameSchema.describe("Next node name."),
|
|
9
|
+
}).strict().describe("Specify a specific operation between current node and next node.");
|
|
10
|
+
// Operate 操作类型
|
|
11
|
+
export const OperateWithHoldSchema = z.object({
|
|
12
|
+
operation: ProgressNextSchema,
|
|
13
|
+
hold: z.literal(true),
|
|
14
|
+
adminUnhold: z.boolean().optional().describe("Whether to allow admin to force unlock."),
|
|
15
|
+
message: z.string().optional().describe("Operation result message."),
|
|
16
|
+
}).strict().describe("Advance Progress object: lock operation permission.");
|
|
17
|
+
export const OperateWithoutHoldSchema = z.object({
|
|
18
|
+
operation: ProgressNextSchema,
|
|
19
|
+
hold: z.literal(false),
|
|
20
|
+
message: z.string().optional().describe("Operation result message."),
|
|
21
|
+
}).strict().describe("Advance Progress object: submit operation result.");
|
|
22
|
+
export const OperateSchema = z.discriminatedUnion("hold", [
|
|
23
|
+
OperateWithHoldSchema,
|
|
24
|
+
OperateWithoutHoldSchema,
|
|
25
|
+
]);
|
|
26
|
+
export const CallProgress_DataSchema = z.object({
|
|
27
|
+
object: NameOrAddressSchema.describe("Progress object ID or name"),
|
|
28
|
+
task: NameOrAddressSchema.optional().describe("Task ID. Cannot be changed after setting."),
|
|
29
|
+
repository: ObjectsSchema.optional().describe("Consensus data Repository object list."),
|
|
30
|
+
progress_namedOperator: ProgressNamedOperatorSchema.optional().describe("Manage operators for Progress permission namespace."),
|
|
31
|
+
operate: OperateSchema.optional().describe("Advance Progress object. Can be locking operation permission (to avoid competition for the same permission) or submitting operation result."),
|
|
32
|
+
}).strict().describe("On-chain, operate an existing Progress object.");
|
|
33
|
+
export const CallProgress_InputSchema = z.object({
|
|
34
|
+
data: CallProgress_DataSchema,
|
|
35
|
+
env: CallEnvSchema.optional(),
|
|
36
|
+
submission: SubmissionCallSchema.optional(),
|
|
37
|
+
}).strict();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const CallProof_DataSchema: any;
|
|
3
|
+
export declare const CallProof_InputSchema: any;
|
|
4
|
+
export declare const CallGenProof_InputSchema: any;
|
|
5
|
+
export type CallProof_Data = z.infer<typeof CallProof_DataSchema>;
|
|
6
|
+
export type CallProof_Input = z.infer<typeof CallProof_InputSchema>;
|
|
7
|
+
export type CallGenProof_Input = z.infer<typeof CallGenProof_InputSchema>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CallEnvSchema, NamedObjectSchema } from './base.js';
|
|
3
|
+
import { DescriptionSchema } from '../common/index.js';
|
|
4
|
+
export const CallProof_DataSchema = z.object({
|
|
5
|
+
namedNew: NamedObjectSchema.optional(),
|
|
6
|
+
description: DescriptionSchema.optional(),
|
|
7
|
+
proof: z.string().max(10240).describe("Proof content. e.g. merkle tree root"),
|
|
8
|
+
server_pubkey: z.string().max(1024).describe("Server public key"),
|
|
9
|
+
server_signature: z.string().max(40480).describe("Server signature"),
|
|
10
|
+
proof_type: z.union([z.number().int().min(0), z.string()]).describe("Proof type. 1: WTS proof; 1-100 reserved."),
|
|
11
|
+
item_count: z.union([z.number().int().min(0), z.string(), z.null()]).optional().describe("Item count. e.g. number of items in the merkle tree"),
|
|
12
|
+
about_address: z.union([NamedObjectSchema, z.null()]).optional().describe("About address. e.g. address of the entity being proved"),
|
|
13
|
+
}).strict().describe("On-chain Proof creation. USAGE: Set 'namedNew' field with {name, tag?} to create a named Proof. Proof is an immutable object - it can only be created, not modified. The 'namedNew' field is CRITICAL and REQUIRED.");
|
|
14
|
+
export const CallProof_InputSchema = z.object({
|
|
15
|
+
data: CallProof_DataSchema,
|
|
16
|
+
env: CallEnvSchema.optional(),
|
|
17
|
+
}).strict().describe("On-chain, create a new Proof object");
|
|
18
|
+
export const CallGenProof_InputSchema = z.object({
|
|
19
|
+
proof: z.string().max(10240).describe("Proof content. e.g. merkle tree root"),
|
|
20
|
+
server_pubkey: z.string().max(1024).describe("Server public key"),
|
|
21
|
+
server_signature: z.string().max(40480).describe("Server signature"),
|
|
22
|
+
proof_type: z.union([z.number().int().min(0), z.string()]).describe("Proof type. 1: WTS proof; 1-100 reserved."),
|
|
23
|
+
description: DescriptionSchema.optional(),
|
|
24
|
+
item_count: z.union([z.number().int().min(0), z.string(), z.null()]).optional().describe("Item count. e.g. number of items in the merkle tree"),
|
|
25
|
+
about_address: z.union([NamedObjectSchema, z.null()]).optional().describe("About address. e.g. address of the entity being proved"),
|
|
26
|
+
env: CallEnvSchema.optional(),
|
|
27
|
+
}).strict().describe("Generate a new Proof object on-chain");
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const RepositoryIdSchema: any;
|
|
2
|
+
export declare const KeyDataSchema: any;
|
|
3
|
+
export declare const RepDataItemSchema: any;
|
|
4
|
+
export declare const SignerOrClockBaseSchema: any;
|
|
5
|
+
export declare const SignerOrClockSchema: any;
|
|
6
|
+
export declare const DataRemoveItemSchema: any;
|
|
7
|
+
export declare const PoliciesAddSetSchema: any;
|
|
8
|
+
export declare const PoliciesRemoveSchema: any;
|
|
9
|
+
export declare const PoliciesClearSchema: any;
|
|
10
|
+
export declare const PoliciesSchema: any;
|
|
11
|
+
export declare const DataAddWithItemsSchema: any;
|
|
12
|
+
export declare const DataAddSchema: any;
|
|
13
|
+
export declare const DataRemoveSchema: any;
|
|
14
|
+
export declare const CallRepository_DataSchema: any;
|
|
15
|
+
export declare const CallRepository_InputSchema: any;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { WithPermissionObjectSchema, ObjectsSchema, CallEnvSchema, SubmissionCallSchema, } from "./base.js";
|
|
3
|
+
import { AccountOrMark_AddressSchema, DescriptionSchema, NameOrAddressSchema, NameSchema, ReceivedObjectsOrRecentlySchema } from "../common/index.js";
|
|
4
|
+
import { PolicyRuleSchema } from "../query/index.js";
|
|
5
|
+
import { SupportedValueSchema } from "../common/index.js";
|
|
6
|
+
// RepositoryId 类型定义
|
|
7
|
+
export const RepositoryIdSchema = z.union([
|
|
8
|
+
AccountOrMark_AddressSchema,
|
|
9
|
+
z.number().int(),
|
|
10
|
+
]).describe("Data item ID. If a number (such as time) is specified, it will be automatically converted to an address or ID type.");
|
|
11
|
+
// KeyData 类型定义
|
|
12
|
+
export const KeyDataSchema = z.object({
|
|
13
|
+
id: RepositoryIdSchema,
|
|
14
|
+
data: SupportedValueSchema,
|
|
15
|
+
}).strict().describe("Data ID and value.");
|
|
16
|
+
// RepDataItem 类型定义
|
|
17
|
+
export const RepDataItemSchema = z.object({
|
|
18
|
+
data: z.array(KeyDataSchema).describe("Data item list."),
|
|
19
|
+
write_guard: NameOrAddressSchema.optional().describe("Guard ID or name. Used to specify the policy write permissions and rules corresponding to this Guard."),
|
|
20
|
+
}).strict().describe("List of data items to write.");
|
|
21
|
+
// SignerOrClockBase 类型定义
|
|
22
|
+
export const SignerOrClockBaseSchema = z.object({
|
|
23
|
+
name: NameSchema.describe("Data item name."),
|
|
24
|
+
write_guard: NameOrAddressSchema.optional().describe("Guard ID or name. Used to specify the policy write permissions and rules corresponding to this Guard."),
|
|
25
|
+
}).strict().describe("Specify data items by name and ID. ID is the on-chain timestamp or signer ID (depending on how write_guard specifies the ID source).");
|
|
26
|
+
// SignerOrClock 类型定义
|
|
27
|
+
export const SignerOrClockSchema = z.object({
|
|
28
|
+
name: NameSchema.describe("Data item name."),
|
|
29
|
+
write_guard: NameOrAddressSchema.optional().describe("Guard ID or name. Used to specify the policy write permissions and rules corresponding to this Guard."),
|
|
30
|
+
data: SupportedValueSchema,
|
|
31
|
+
}).strict().describe("Specify data items by name and data. ID is the on-chain timestamp or signer ID (depending on how write_guard specifies the ID source).");
|
|
32
|
+
// DataRemoveItem 类型定义
|
|
33
|
+
export const DataRemoveItemSchema = z.object({
|
|
34
|
+
id: z.array(RepositoryIdSchema).describe("Data item ID list."),
|
|
35
|
+
write_guard: NameOrAddressSchema.optional().describe("Guard ID or name. Used to verify permission to delete data."),
|
|
36
|
+
}).strict().describe("Delete data items by name and ID list.");
|
|
37
|
+
// Policies 操作类型
|
|
38
|
+
export const PoliciesAddSetSchema = z.object({
|
|
39
|
+
op: z.enum(["add", "set"]),
|
|
40
|
+
policy: z.array(PolicyRuleSchema).describe("Policy rule list."),
|
|
41
|
+
}).strict().describe("Add or set policy rules.");
|
|
42
|
+
export const PoliciesRemoveSchema = z.object({
|
|
43
|
+
op: z.literal("remove"),
|
|
44
|
+
policy: z.array(NameSchema).describe("Policy rule name list."),
|
|
45
|
+
}).strict().describe("Remove policy rules.");
|
|
46
|
+
export const PoliciesClearSchema = z.object({
|
|
47
|
+
op: z.literal("clear"),
|
|
48
|
+
}).strict().describe("Clear policy rules.");
|
|
49
|
+
export const PoliciesSchema = z.discriminatedUnion("op", [
|
|
50
|
+
PoliciesAddSetSchema,
|
|
51
|
+
PoliciesRemoveSchema,
|
|
52
|
+
PoliciesClearSchema,
|
|
53
|
+
]);
|
|
54
|
+
// DataAdd 类型定义
|
|
55
|
+
export const DataAddWithItemsSchema = z.object({
|
|
56
|
+
name: NameSchema.describe("Data item name. Must match the name in PolicyRule."),
|
|
57
|
+
items: z.array(RepDataItemSchema).describe("List of data items to add. Each data item contains name, ID, and data parts, where name and ID together form the unique key for the data."),
|
|
58
|
+
}).strict().describe("Add data by name and data item list. Each data item contains name, ID, and data parts, where name and ID together form the unique key for the data.");
|
|
59
|
+
export const DataAddSchema = z.union([
|
|
60
|
+
SignerOrClockSchema,
|
|
61
|
+
DataAddWithItemsSchema,
|
|
62
|
+
]);
|
|
63
|
+
// DataRemove 类型定义
|
|
64
|
+
export const DataRemoveSchema = z.union([
|
|
65
|
+
SignerOrClockBaseSchema,
|
|
66
|
+
z.object({
|
|
67
|
+
name: NameSchema.describe("Data item name. Must match the name in PolicyRule."),
|
|
68
|
+
items: z.array(DataRemoveItemSchema).describe("List of data items to delete."),
|
|
69
|
+
}).strict(),
|
|
70
|
+
]);
|
|
71
|
+
export const CallRepository_DataSchema = z.object({
|
|
72
|
+
object: WithPermissionObjectSchema,
|
|
73
|
+
description: DescriptionSchema.optional(),
|
|
74
|
+
policies: PoliciesSchema.optional().describe("Policy list. Used to define data item write permissions and rules, as well as data item read permissions."),
|
|
75
|
+
data_add: DataAddSchema.optional().describe("Add data items"),
|
|
76
|
+
data_remove: DataRemoveSchema.optional().describe("Delete data items"),
|
|
77
|
+
rewards: ObjectsSchema.optional().describe("Reward object list. Used for data contribution incentives."),
|
|
78
|
+
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Unwrap CoinWrapper objects and other objects received by this object and send them to the owner of its Permission object."),
|
|
79
|
+
um: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object."),
|
|
80
|
+
}).strict().describe("On-chain Repository operations. USAGE: (1) CREATE NEW: Set 'object' field with {name, permission, ...} to create a Repository. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. (2) OPERATE EXISTING: Set 'object' field with object ID or name. The 'object' field is CRITICAL and REQUIRED in both cases.");
|
|
81
|
+
export const CallRepository_InputSchema = z.object({
|
|
82
|
+
data: CallRepository_DataSchema,
|
|
83
|
+
env: CallEnvSchema.optional(),
|
|
84
|
+
submission: SubmissionCallSchema.optional(),
|
|
85
|
+
}).strict();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const RecipientGuardIdentifierSchema: any;
|
|
2
|
+
export declare const RecipientEntitySchema: any;
|
|
3
|
+
export declare const RecipientSignerSchema: any;
|
|
4
|
+
export declare const RewardRecordSchema: any;
|
|
5
|
+
export declare const RecipientRecordSchema: any;
|
|
6
|
+
export declare const CallReward_DataSchema: any;
|
|
7
|
+
export declare const CallReward_InputSchema: any;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TypedPermissionObjectSchema, CoinParamSchema, CallEnvSchema, SubmissionCallSchema, } from "./base.js";
|
|
3
|
+
import { RewardGuardSchema } from "../query/index.js";
|
|
4
|
+
import { BalanceTypeSchema, ReceivedObjectsOrRecentlySchema, ReceivedBalanceOrRecentlySchema, NameOrAddressSchema, GuardIdentifierSchema, DescriptionSchema } from "../common/index.js";
|
|
5
|
+
// Recipient 类型定义
|
|
6
|
+
export const RecipientGuardIdentifierSchema = z.object({
|
|
7
|
+
type: z.literal("GuardIdentifier"),
|
|
8
|
+
GuardIdentifier: GuardIdentifierSchema,
|
|
9
|
+
}).strict().describe("Get recipient ID from specified data index in Guard table. The ID must be of address type.");
|
|
10
|
+
export const RecipientEntitySchema = z.object({
|
|
11
|
+
type: z.literal("Entity"),
|
|
12
|
+
Entity: NameOrAddressSchema,
|
|
13
|
+
}).strict().describe("Fixed entity ID");
|
|
14
|
+
export const RecipientSignerSchema = z.object({
|
|
15
|
+
type: z.literal("Signer"),
|
|
16
|
+
Signer: z.boolean(),
|
|
17
|
+
}).strict().describe("Signer ID");
|
|
18
|
+
// RewardRecord 类型定义
|
|
19
|
+
export const RewardRecordSchema = z.object({
|
|
20
|
+
amount: BalanceTypeSchema,
|
|
21
|
+
time: z.number().int(),
|
|
22
|
+
}).strict().describe("Reward amount and time");
|
|
23
|
+
// RecipientRecord 类型定义
|
|
24
|
+
export const RecipientRecordSchema = z.object({
|
|
25
|
+
guard: NameOrAddressSchema,
|
|
26
|
+
total: BalanceTypeSchema,
|
|
27
|
+
amount: z.array(RewardRecordSchema),
|
|
28
|
+
}).strict().describe("Reward recipient record");
|
|
29
|
+
// 主 Schema
|
|
30
|
+
export const CallReward_DataSchema = z.object({
|
|
31
|
+
object: TypedPermissionObjectSchema,
|
|
32
|
+
claim: NameOrAddressSchema.optional().describe("Guard object ID. Used to verify Guard and start the reward distribution process corresponding to this Guard."),
|
|
33
|
+
description: DescriptionSchema.optional(),
|
|
34
|
+
coin_add: CoinParamSchema.optional().describe("Add amount to Reward object."),
|
|
35
|
+
receive: ReceivedBalanceOrRecentlySchema.optional().describe("Unwrap CoinWrapper objects received by Reward object and store them in pending balance."),
|
|
36
|
+
guard_add: z.array(RewardGuardSchema).optional().describe("Add Guard to Reward object."),
|
|
37
|
+
guard_remove_expired: z.boolean().optional().describe("Whether to remove expired Guard."),
|
|
38
|
+
guard_expiration_time: z.union([z.number().int().min(1), z.null()]).optional().describe("Add expiration time(ms). Before this time expires, new Guard and fund allocation rules cannot be added."),
|
|
39
|
+
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Unwrap CoinWrapper objects and other objects received by this object and send them to the owner of its Permission object."),
|
|
40
|
+
um: z.union([NameOrAddressSchema, z.null()]).optional().describe("Contact object."),
|
|
41
|
+
}).strict().describe("On-chain Reward operations. USAGE: (1) CREATE NEW: Set 'object' field with {name, type, permission, ...} to create a Reward. NOTE: 'name' goes INSIDE 'object', NOT at the data root level.'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. (2) OPERATE EXISTING: Set 'object' field with object ID or name. The 'object' field is CRITICAL and REQUIRED in both cases.");
|
|
42
|
+
export const CallReward_InputSchema = z.object({
|
|
43
|
+
data: CallReward_DataSchema,
|
|
44
|
+
env: CallEnvSchema.optional(),
|
|
45
|
+
submission: SubmissionCallSchema.optional(),
|
|
46
|
+
}).strict();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const ServiceBuyItemSchema: any;
|
|
2
|
+
export declare const BuySchema: any;
|
|
3
|
+
export declare const DiscountSchema: any;
|
|
4
|
+
export declare const OrderNewSchema: any;
|
|
5
|
+
export declare const SalesSchema: any;
|
|
6
|
+
export declare const CallService_DataSchema: any;
|
|
7
|
+
export declare const CallService_InputSchema: any;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TypedPermissionObjectSchema, CoinParamSchema, NamedObjectSchema, ObjectsSchema, CallEnvSchema, SubmissionCallSchema } from "./base.js";
|
|
3
|
+
import { AllocatorsSchema, DiscountTypeSchema, ServiceSaleSchema } from "../query/index.js";
|
|
4
|
+
import { AccountOrMark_AddressSchema, DescriptionSchema, LongNameSchema, ManyAccountOrMark_AddressSchema, NotEmptyNameSchema, ReceivedBalanceOrRecentlySchema, ReceivedObjectsOrRecentlySchema } from "../common/index.js";
|
|
5
|
+
import { BalanceTypeSchema } from "../common/index.js";
|
|
6
|
+
// ServiceBuyItem 接口
|
|
7
|
+
export const ServiceBuyItemSchema = z.object({
|
|
8
|
+
name: LongNameSchema.describe("Name of the product or service to purchase"),
|
|
9
|
+
stock: BalanceTypeSchema.describe("Quantity of the product or service to purchase"),
|
|
10
|
+
wip_hash: z.string().describe("WIP file hash of the item"),
|
|
11
|
+
}).strict();
|
|
12
|
+
// Buy 接口
|
|
13
|
+
export const BuySchema = z.object({
|
|
14
|
+
items: z.array(ServiceBuyItemSchema).describe("List of products or services to purchase"),
|
|
15
|
+
total_pay: CoinParamSchema.describe("Actual payment amount"),
|
|
16
|
+
discount: z.string().optional().describe("Discount object ID or name"),
|
|
17
|
+
payment_remark: z.string().optional().describe("Payment remark"),
|
|
18
|
+
payment_index: z.number().optional().describe("Payment index"),
|
|
19
|
+
}).strict();
|
|
20
|
+
// Discount 接口
|
|
21
|
+
export const DiscountSchema = z.object({
|
|
22
|
+
name: z.string().describe("Discount name"),
|
|
23
|
+
discount_type: DiscountTypeSchema.describe("Discount type"),
|
|
24
|
+
discount_value: BalanceTypeSchema.describe("Discount value"),
|
|
25
|
+
benchmark: z.union([z.number(), z.string()]).optional().describe("Discount benchmark value. Discount is only applied if the amount exceeds this value"),
|
|
26
|
+
time_ms_start: z.number().optional().describe("Discount start time (milliseconds)"),
|
|
27
|
+
time_ms_end: z.number().optional().describe("Discount end time (milliseconds)"),
|
|
28
|
+
count: z.number().optional().describe("Discount usage count"),
|
|
29
|
+
recipient: ManyAccountOrMark_AddressSchema.describe("Discount recipient"),
|
|
30
|
+
transferable: z.boolean().optional().describe("Whether the discount object recipient can transfer the discount object"),
|
|
31
|
+
}).strict();
|
|
32
|
+
// OrderNew 接口
|
|
33
|
+
export const OrderNewSchema = z.object({
|
|
34
|
+
buy: BuySchema,
|
|
35
|
+
agents: ManyAccountOrMark_AddressSchema.optional().describe("Order agents. Agents can operate the order, such as canceling the order, modifying the order status, etc.; but cannot receive the funds received by the order."),
|
|
36
|
+
order_required_info: z.string().describe("Contact object ID or WTS Proof object"),
|
|
37
|
+
transfer: AccountOrMark_AddressSchema.optional().describe("Set the new owner of the order. Requires order owner permission to set."),
|
|
38
|
+
namedNewOrder: NamedObjectSchema.optional().describe("Set the local name of the order object."),
|
|
39
|
+
namedNewAllocation: NamedObjectSchema.optional().describe("Set the local name of the order's Allocation object."),
|
|
40
|
+
namedNewProgress: NamedObjectSchema.optional().describe("Set the local name of the order's Progress object."),
|
|
41
|
+
}).strict();
|
|
42
|
+
// Sales 操作类型
|
|
43
|
+
export const SalesSchema = z.discriminatedUnion("op", [
|
|
44
|
+
z.object({
|
|
45
|
+
op: z.literal("add"),
|
|
46
|
+
sales: z.array(ServiceSaleSchema),
|
|
47
|
+
}).strict().describe("Add new sales products or services."),
|
|
48
|
+
z.object({
|
|
49
|
+
op: z.literal("set"),
|
|
50
|
+
sales: z.array(ServiceSaleSchema),
|
|
51
|
+
}).strict().describe("Set sales products or services."),
|
|
52
|
+
z.object({
|
|
53
|
+
op: z.literal("remove"),
|
|
54
|
+
sales_name: z.array(LongNameSchema.describe("Sales name")),
|
|
55
|
+
}).strict().describe("Remove existing sales products or services."),
|
|
56
|
+
z.object({
|
|
57
|
+
op: z.literal("clear"),
|
|
58
|
+
}).strict().describe("Clear all sales products or services."),
|
|
59
|
+
]);
|
|
60
|
+
// CallService_Data 接口
|
|
61
|
+
export const CallService_DataSchema = z.object({
|
|
62
|
+
object: TypedPermissionObjectSchema,
|
|
63
|
+
order_new: OrderNewSchema.optional().describe("Create new order."),
|
|
64
|
+
description: DescriptionSchema.optional(),
|
|
65
|
+
location: LongNameSchema.optional().describe("Location of the Service"),
|
|
66
|
+
sales: SalesSchema.optional().describe("Service sales products or services list."),
|
|
67
|
+
repositories: ObjectsSchema.optional().describe("Service Repository object list."),
|
|
68
|
+
rewards: ObjectsSchema.optional().describe("Service Reward object list."),
|
|
69
|
+
arbitrations: ObjectsSchema.optional().describe("Service Arbitration object list."),
|
|
70
|
+
machine: z.union([NamedObjectSchema, z.null()]).optional().describe("Service Machine object ID or name. The Machine object must be in published state."),
|
|
71
|
+
discount: DiscountSchema.optional().describe("Issue discount."),
|
|
72
|
+
discount_destroy: z.array(NamedObjectSchema).optional().describe("Destroy existing discount object ID list."),
|
|
73
|
+
customer_required: z.array(NotEmptyNameSchema).optional().describe("Customer required information. Such as phone, email, etc."),
|
|
74
|
+
order_allocators: z.union([AllocatorsSchema, z.null()]).optional().describe("Order fund allocator."),
|
|
75
|
+
compensation_fund_add: CoinParamSchema.optional().describe("Compensation fund. Used to claim compensation based on the arbitration result of the Arb object when resolving order disputes."),
|
|
76
|
+
compensation_locked_time_add: z.number().optional().describe("Lock time for compensation funds added to orders (milliseconds)."),
|
|
77
|
+
compensation_fund_receive: ReceivedBalanceOrRecentlySchema.optional().describe("Receive order compensation funds."),
|
|
78
|
+
owner_receive: ReceivedObjectsOrRecentlySchema.optional().describe("Unwrap CoinWrapper objects and other objects received by this object and send them to the owner of its Permission object."),
|
|
79
|
+
um: z.union([NamedObjectSchema, z.null()]).optional().describe("Contact object."),
|
|
80
|
+
pause: z.boolean().optional().describe("Whether to pause accepting new orders."),
|
|
81
|
+
publish: z.boolean().optional().describe("Whether to publish the Service. After publishing, customers can place orders; at the same time, service commitments such as machine, order_allocators, arbitrations, etc. will be immutable."),
|
|
82
|
+
}).strict().describe("On-chain Service operations. USAGE: (1) CREATE NEW: Set 'object' field with {name, type, permission, ...} to create a Service. NOTE: 'name' goes INSIDE 'object', NOT at the data root level. 'permission' can be a new Permission object or reference an existing one - check 'object' field description for details. (2) OPERATE EXISTING: Set 'object' field with object ID or name. The 'object' field is CRITICAL and REQUIRED in both cases.");
|
|
83
|
+
export const CallService_InputSchema = z.object({
|
|
84
|
+
data: CallService_DataSchema,
|
|
85
|
+
env: CallEnvSchema.optional(),
|
|
86
|
+
submission: SubmissionCallSchema.optional(),
|
|
87
|
+
}).strict();
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const DepositSchema: any;
|
|
2
|
+
export declare const WithdrawSchema: any;
|
|
3
|
+
export declare const ExternalDepositGuardSchema: any;
|
|
4
|
+
export declare const ExternalWithdrawGuardSchema: any;
|
|
5
|
+
export declare const CallTreasury_DataSchema: any;
|
|
6
|
+
export declare const CallTreasury_InputSchema: any;
|