@native-marketing/sdk 0.3.6 → 0.3.8
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/http.js +7513 -431
- package/dist/index.js +1289 -67
- package/package.json +11 -1
- package/release.json +3 -3
- package/types/contracts/access/permission.d.ts +3 -0
- package/types/contracts/access/project-access.d.ts +2 -0
- package/types/contracts/agent/human-presentation-validation.d.ts +4 -0
- package/types/contracts/agent/human-presentation.d.ts +300 -0
- package/types/contracts/client-lifecycle.d.ts +55 -0
- package/types/contracts/client-update-policy.d.ts +84 -0
- package/types/contracts/generated/client-release.d.ts +14 -0
- package/types/contracts/index.d.ts +4 -0
- package/types/http/client-version.d.ts +35 -0
- package/types/http/client.d.ts +1 -0
- package/types/http/generated/schema.d.ts +594 -0
- package/types/http/human-presentation.d.ts +247 -0
- package/types/http/index.d.ts +4 -0
- package/types/sdk/capability-definition.d.ts +1 -0
- package/types/sdk/cli/commands.d.ts +1 -1
- package/types/sdk/cli/output.d.ts +8 -0
- package/types/sdk/cli/run.d.ts +1 -0
- package/types/sdk/client.d.ts +12 -0
- package/types/sdk/human-presentation.d.ts +566 -0
- package/types/sdk/index.d.ts +6 -0
- package/types/sdk/transport.d.ts +6 -1
- package/types/sdk/updates/commands.d.ts +11 -0
- package/types/sdk/updates/install.d.ts +20 -0
- package/types/sdk/updates/registry.d.ts +26 -0
- package/types/sdk/updates/store.d.ts +14 -0
- package/types/sdk/updates/version.d.ts +93 -0
package/package.json
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@native-marketing/sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=24 <25"
|
|
8
8
|
},
|
|
9
|
+
"nativeMarketing": {
|
|
10
|
+
"contractVersion": 1,
|
|
11
|
+
"apiMajor": 1,
|
|
12
|
+
"nodeMajor": 24,
|
|
13
|
+
"changes": [
|
|
14
|
+
"Unified typed human interaction cards and authenticated reading links across SDK, CLI and MCP.",
|
|
15
|
+
"Explicitly authorized expiring public read-only package text snapshots with original request recovery and revocation.",
|
|
16
|
+
"Bound human presentation responses to the configured Project, original issuance request and source version."
|
|
17
|
+
]
|
|
18
|
+
},
|
|
9
19
|
"publishConfig": {
|
|
10
20
|
"access": "public",
|
|
11
21
|
"registry": "https://registry.npmjs.org/"
|
package/release.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"sourceCommit": "
|
|
2
|
+
"sourceCommit": "5d24ed0dd6a4464dfc7dbe20275c546919268f25",
|
|
3
3
|
"workingTreeDirty": false,
|
|
4
|
-
"version": "0.3.
|
|
5
|
-
"openapiTypesSha256": "
|
|
4
|
+
"version": "0.3.8",
|
|
5
|
+
"openapiTypesSha256": "ad906135a3c4706a888cb1cbb411d7b032c42120fcd13f5468e748a7f8db6651",
|
|
6
6
|
"localBuild": true
|
|
7
7
|
}
|
|
@@ -32,6 +32,7 @@ export declare const permissionSchema: z.ZodEnum<{
|
|
|
32
32
|
"package.review": "package.review";
|
|
33
33
|
"permissions.manage": "permissions.manage";
|
|
34
34
|
"personal-context.read": "personal-context.read";
|
|
35
|
+
"presentation.share": "presentation.share";
|
|
35
36
|
"project-representation.manage": "project-representation.manage";
|
|
36
37
|
"project-representation.read": "project-representation.read";
|
|
37
38
|
"project-survey.read": "project-survey.read";
|
|
@@ -90,6 +91,7 @@ export declare const permissionGrantSchema: z.ZodObject<{
|
|
|
90
91
|
"package.review": "package.review";
|
|
91
92
|
"permissions.manage": "permissions.manage";
|
|
92
93
|
"personal-context.read": "personal-context.read";
|
|
94
|
+
"presentation.share": "presentation.share";
|
|
93
95
|
"project-representation.manage": "project-representation.manage";
|
|
94
96
|
"project-representation.read": "project-representation.read";
|
|
95
97
|
"project-survey.read": "project-survey.read";
|
|
@@ -152,6 +154,7 @@ export declare const createPermissionGrantInputSchema: z.ZodObject<{
|
|
|
152
154
|
"package.review": "package.review";
|
|
153
155
|
"permissions.manage": "permissions.manage";
|
|
154
156
|
"personal-context.read": "personal-context.read";
|
|
157
|
+
"presentation.share": "presentation.share";
|
|
155
158
|
"project-representation.manage": "project-representation.manage";
|
|
156
159
|
"project-representation.read": "project-representation.read";
|
|
157
160
|
"project-survey.read": "project-survey.read";
|
|
@@ -52,6 +52,7 @@ export declare const projectAccessViewSchema: z.ZodObject<{
|
|
|
52
52
|
"package.review": "package.review";
|
|
53
53
|
"permissions.manage": "permissions.manage";
|
|
54
54
|
"personal-context.read": "personal-context.read";
|
|
55
|
+
"presentation.share": "presentation.share";
|
|
55
56
|
"project-representation.manage": "project-representation.manage";
|
|
56
57
|
"project-representation.read": "project-representation.read";
|
|
57
58
|
"project-survey.read": "project-survey.read";
|
|
@@ -102,6 +103,7 @@ export declare const projectAccessViewSchema: z.ZodObject<{
|
|
|
102
103
|
"package.review": "package.review";
|
|
103
104
|
"permissions.manage": "permissions.manage";
|
|
104
105
|
"personal-context.read": "personal-context.read";
|
|
106
|
+
"presentation.share": "presentation.share";
|
|
105
107
|
"project-representation.manage": "project-representation.manage";
|
|
106
108
|
"project-representation.read": "project-representation.read";
|
|
107
109
|
"project-survey.read": "project-survey.read";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { HumanPresentation } from './human-presentation.js';
|
|
2
|
+
/** Bind externally returned URLs to the configured product and exact Project. */
|
|
3
|
+
export declare function validateHumanPresentationResource(human: HumanPresentation, resource: string, packageCode?: string): boolean;
|
|
4
|
+
export declare function validateHumanPresentationResponse(parsed: Record<string, unknown>, resource: string, input: Record<string, unknown>, operation: string): boolean;
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const humanPresentationCapability = "com.native-marketing/human-presentation";
|
|
3
|
+
export declare const humanPresentationFeatures: Readonly<{
|
|
4
|
+
version: 1;
|
|
5
|
+
subjects: string[];
|
|
6
|
+
interactions: string[];
|
|
7
|
+
links: string[];
|
|
8
|
+
publicRead: "SNAPSHOT";
|
|
9
|
+
}>;
|
|
10
|
+
export declare const humanPresentationInputSchema: z.ZodObject<{
|
|
11
|
+
packageCode: z.ZodString;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
export declare const humanReadLinkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
14
|
+
linkRef: z.ZodString;
|
|
15
|
+
kind: z.ZodLiteral<"READABLE_CONTENT">;
|
|
16
|
+
title: z.ZodString;
|
|
17
|
+
subjectRef: z.ZodString;
|
|
18
|
+
url: z.ZodString;
|
|
19
|
+
access: z.ZodLiteral<"AUTHENTICATED">;
|
|
20
|
+
representation: z.ZodLiteral<"CURRENT_VIEW">;
|
|
21
|
+
expiresAt: z.ZodNull;
|
|
22
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
23
|
+
linkRef: z.ZodString;
|
|
24
|
+
kind: z.ZodLiteral<"READABLE_CONTENT">;
|
|
25
|
+
title: z.ZodString;
|
|
26
|
+
subjectRef: z.ZodString;
|
|
27
|
+
url: z.ZodString;
|
|
28
|
+
access: z.ZodLiteral<"TEMPORARY_PUBLIC_READ">;
|
|
29
|
+
representation: z.ZodLiteral<"SNAPSHOT">;
|
|
30
|
+
snapshotRef: z.ZodString;
|
|
31
|
+
contentSha256: z.ZodString;
|
|
32
|
+
createdAt: z.ZodString;
|
|
33
|
+
expiresAt: z.ZodString;
|
|
34
|
+
}, z.core.$strict>], "access">;
|
|
35
|
+
export declare const humanInteractionSchema: z.ZodObject<{
|
|
36
|
+
interactionRef: z.ZodString;
|
|
37
|
+
kind: z.ZodLiteral<"CONTENT_PACKAGE_REVIEW">;
|
|
38
|
+
subjectRef: z.ZodString;
|
|
39
|
+
title: z.ZodString;
|
|
40
|
+
summary: z.ZodString;
|
|
41
|
+
state: z.ZodEnum<{
|
|
42
|
+
APPROVED: "APPROVED";
|
|
43
|
+
PENDING: "PENDING";
|
|
44
|
+
REJECTED: "REJECTED";
|
|
45
|
+
RESOLVED: "RESOLVED";
|
|
46
|
+
}>;
|
|
47
|
+
sourceState: z.ZodString;
|
|
48
|
+
actionDigest: z.ZodString;
|
|
49
|
+
expiresAt: z.ZodNull;
|
|
50
|
+
reviewUrl: z.ZodString;
|
|
51
|
+
canReview: z.ZodBoolean;
|
|
52
|
+
}, z.core.$strict>;
|
|
53
|
+
export declare const humanPresentationSchema: z.ZodObject<{
|
|
54
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
55
|
+
interactions: z.ZodArray<z.ZodObject<{
|
|
56
|
+
interactionRef: z.ZodString;
|
|
57
|
+
kind: z.ZodLiteral<"CONTENT_PACKAGE_REVIEW">;
|
|
58
|
+
subjectRef: z.ZodString;
|
|
59
|
+
title: z.ZodString;
|
|
60
|
+
summary: z.ZodString;
|
|
61
|
+
state: z.ZodEnum<{
|
|
62
|
+
APPROVED: "APPROVED";
|
|
63
|
+
PENDING: "PENDING";
|
|
64
|
+
REJECTED: "REJECTED";
|
|
65
|
+
RESOLVED: "RESOLVED";
|
|
66
|
+
}>;
|
|
67
|
+
sourceState: z.ZodString;
|
|
68
|
+
actionDigest: z.ZodString;
|
|
69
|
+
expiresAt: z.ZodNull;
|
|
70
|
+
reviewUrl: z.ZodString;
|
|
71
|
+
canReview: z.ZodBoolean;
|
|
72
|
+
}, z.core.$strict>>;
|
|
73
|
+
links: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
74
|
+
linkRef: z.ZodString;
|
|
75
|
+
kind: z.ZodLiteral<"READABLE_CONTENT">;
|
|
76
|
+
title: z.ZodString;
|
|
77
|
+
subjectRef: z.ZodString;
|
|
78
|
+
url: z.ZodString;
|
|
79
|
+
access: z.ZodLiteral<"AUTHENTICATED">;
|
|
80
|
+
representation: z.ZodLiteral<"CURRENT_VIEW">;
|
|
81
|
+
expiresAt: z.ZodNull;
|
|
82
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
83
|
+
linkRef: z.ZodString;
|
|
84
|
+
kind: z.ZodLiteral<"READABLE_CONTENT">;
|
|
85
|
+
title: z.ZodString;
|
|
86
|
+
subjectRef: z.ZodString;
|
|
87
|
+
url: z.ZodString;
|
|
88
|
+
access: z.ZodLiteral<"TEMPORARY_PUBLIC_READ">;
|
|
89
|
+
representation: z.ZodLiteral<"SNAPSHOT">;
|
|
90
|
+
snapshotRef: z.ZodString;
|
|
91
|
+
contentSha256: z.ZodString;
|
|
92
|
+
createdAt: z.ZodString;
|
|
93
|
+
expiresAt: z.ZodString;
|
|
94
|
+
}, z.core.$strict>], "access">>;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
export declare const humanReadableDocumentSchema: z.ZodObject<{
|
|
97
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
98
|
+
title: z.ZodString;
|
|
99
|
+
subjectRef: z.ZodString;
|
|
100
|
+
manifestHash: z.ZodString;
|
|
101
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
102
|
+
heading: z.ZodString;
|
|
103
|
+
text: z.ZodString;
|
|
104
|
+
}, z.core.$strict>>;
|
|
105
|
+
}, z.core.$strict>;
|
|
106
|
+
export declare const issueHumanReadLinkInputSchema: z.ZodObject<{
|
|
107
|
+
requestId: z.ZodString;
|
|
108
|
+
packageCode: z.ZodString;
|
|
109
|
+
expectedManifestHash: z.ZodString;
|
|
110
|
+
access: z.ZodLiteral<"TEMPORARY_PUBLIC_READ">;
|
|
111
|
+
targetKeys: z.ZodArray<z.ZodString>;
|
|
112
|
+
ttlSeconds: z.ZodDefault<z.ZodNumber>;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
export declare const humanReadLinkLookupSchema: z.ZodObject<{
|
|
115
|
+
linkRef: z.ZodString;
|
|
116
|
+
}, z.core.$strict>;
|
|
117
|
+
export declare const humanReadLinkReceiptQuerySchema: z.ZodObject<{
|
|
118
|
+
requestId: z.ZodString;
|
|
119
|
+
}, z.core.$strict>;
|
|
120
|
+
export declare const revokeHumanReadLinkInputSchema: z.ZodObject<{
|
|
121
|
+
linkRef: z.ZodString;
|
|
122
|
+
requestId: z.ZodString;
|
|
123
|
+
}, z.core.$strict>;
|
|
124
|
+
export declare const humanReadLinkResultSchema: z.ZodObject<{
|
|
125
|
+
linkRef: z.ZodString;
|
|
126
|
+
issuanceRequestId: z.ZodString;
|
|
127
|
+
state: z.ZodEnum<{
|
|
128
|
+
ACTIVE: "ACTIVE";
|
|
129
|
+
EXPIRED: "EXPIRED";
|
|
130
|
+
REVOKED: "REVOKED";
|
|
131
|
+
UNAVAILABLE: "UNAVAILABLE";
|
|
132
|
+
}>;
|
|
133
|
+
packageCode: z.ZodString;
|
|
134
|
+
manifestHash: z.ZodString;
|
|
135
|
+
expiresAt: z.ZodString;
|
|
136
|
+
human: z.ZodObject<{
|
|
137
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
138
|
+
interactions: z.ZodArray<z.ZodObject<{
|
|
139
|
+
interactionRef: z.ZodString;
|
|
140
|
+
kind: z.ZodLiteral<"CONTENT_PACKAGE_REVIEW">;
|
|
141
|
+
subjectRef: z.ZodString;
|
|
142
|
+
title: z.ZodString;
|
|
143
|
+
summary: z.ZodString;
|
|
144
|
+
state: z.ZodEnum<{
|
|
145
|
+
APPROVED: "APPROVED";
|
|
146
|
+
PENDING: "PENDING";
|
|
147
|
+
REJECTED: "REJECTED";
|
|
148
|
+
RESOLVED: "RESOLVED";
|
|
149
|
+
}>;
|
|
150
|
+
sourceState: z.ZodString;
|
|
151
|
+
actionDigest: z.ZodString;
|
|
152
|
+
expiresAt: z.ZodNull;
|
|
153
|
+
reviewUrl: z.ZodString;
|
|
154
|
+
canReview: z.ZodBoolean;
|
|
155
|
+
}, z.core.$strict>>;
|
|
156
|
+
links: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
157
|
+
linkRef: z.ZodString;
|
|
158
|
+
kind: z.ZodLiteral<"READABLE_CONTENT">;
|
|
159
|
+
title: z.ZodString;
|
|
160
|
+
subjectRef: z.ZodString;
|
|
161
|
+
url: z.ZodString;
|
|
162
|
+
access: z.ZodLiteral<"AUTHENTICATED">;
|
|
163
|
+
representation: z.ZodLiteral<"CURRENT_VIEW">;
|
|
164
|
+
expiresAt: z.ZodNull;
|
|
165
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
166
|
+
linkRef: z.ZodString;
|
|
167
|
+
kind: z.ZodLiteral<"READABLE_CONTENT">;
|
|
168
|
+
title: z.ZodString;
|
|
169
|
+
subjectRef: z.ZodString;
|
|
170
|
+
url: z.ZodString;
|
|
171
|
+
access: z.ZodLiteral<"TEMPORARY_PUBLIC_READ">;
|
|
172
|
+
representation: z.ZodLiteral<"SNAPSHOT">;
|
|
173
|
+
snapshotRef: z.ZodString;
|
|
174
|
+
contentSha256: z.ZodString;
|
|
175
|
+
createdAt: z.ZodString;
|
|
176
|
+
expiresAt: z.ZodString;
|
|
177
|
+
}, z.core.$strict>], "access">>;
|
|
178
|
+
}, z.core.$strict>;
|
|
179
|
+
}, z.core.$strict>;
|
|
180
|
+
export declare const humanReadLinkReceiptSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
181
|
+
status: z.ZodLiteral<"FOUND">;
|
|
182
|
+
receipt: z.ZodObject<{
|
|
183
|
+
linkRef: z.ZodString;
|
|
184
|
+
issuanceRequestId: z.ZodString;
|
|
185
|
+
state: z.ZodEnum<{
|
|
186
|
+
ACTIVE: "ACTIVE";
|
|
187
|
+
EXPIRED: "EXPIRED";
|
|
188
|
+
REVOKED: "REVOKED";
|
|
189
|
+
UNAVAILABLE: "UNAVAILABLE";
|
|
190
|
+
}>;
|
|
191
|
+
packageCode: z.ZodString;
|
|
192
|
+
manifestHash: z.ZodString;
|
|
193
|
+
expiresAt: z.ZodString;
|
|
194
|
+
human: z.ZodObject<{
|
|
195
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
196
|
+
interactions: z.ZodArray<z.ZodObject<{
|
|
197
|
+
interactionRef: z.ZodString;
|
|
198
|
+
kind: z.ZodLiteral<"CONTENT_PACKAGE_REVIEW">;
|
|
199
|
+
subjectRef: z.ZodString;
|
|
200
|
+
title: z.ZodString;
|
|
201
|
+
summary: z.ZodString;
|
|
202
|
+
state: z.ZodEnum<{
|
|
203
|
+
APPROVED: "APPROVED";
|
|
204
|
+
PENDING: "PENDING";
|
|
205
|
+
REJECTED: "REJECTED";
|
|
206
|
+
RESOLVED: "RESOLVED";
|
|
207
|
+
}>;
|
|
208
|
+
sourceState: z.ZodString;
|
|
209
|
+
actionDigest: z.ZodString;
|
|
210
|
+
expiresAt: z.ZodNull;
|
|
211
|
+
reviewUrl: z.ZodString;
|
|
212
|
+
canReview: z.ZodBoolean;
|
|
213
|
+
}, z.core.$strict>>;
|
|
214
|
+
links: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
215
|
+
linkRef: z.ZodString;
|
|
216
|
+
kind: z.ZodLiteral<"READABLE_CONTENT">;
|
|
217
|
+
title: z.ZodString;
|
|
218
|
+
subjectRef: z.ZodString;
|
|
219
|
+
url: z.ZodString;
|
|
220
|
+
access: z.ZodLiteral<"AUTHENTICATED">;
|
|
221
|
+
representation: z.ZodLiteral<"CURRENT_VIEW">;
|
|
222
|
+
expiresAt: z.ZodNull;
|
|
223
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
224
|
+
linkRef: z.ZodString;
|
|
225
|
+
kind: z.ZodLiteral<"READABLE_CONTENT">;
|
|
226
|
+
title: z.ZodString;
|
|
227
|
+
subjectRef: z.ZodString;
|
|
228
|
+
url: z.ZodString;
|
|
229
|
+
access: z.ZodLiteral<"TEMPORARY_PUBLIC_READ">;
|
|
230
|
+
representation: z.ZodLiteral<"SNAPSHOT">;
|
|
231
|
+
snapshotRef: z.ZodString;
|
|
232
|
+
contentSha256: z.ZodString;
|
|
233
|
+
createdAt: z.ZodString;
|
|
234
|
+
expiresAt: z.ZodString;
|
|
235
|
+
}, z.core.$strict>], "access">>;
|
|
236
|
+
}, z.core.$strict>;
|
|
237
|
+
}, z.core.$strict>;
|
|
238
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
239
|
+
status: z.ZodLiteral<"NOT_FOUND">;
|
|
240
|
+
}, z.core.$strict>], "status">;
|
|
241
|
+
export type HumanPresentation = z.infer<typeof humanPresentationSchema>;
|
|
242
|
+
export type HumanInteraction = z.infer<typeof humanInteractionSchema>;
|
|
243
|
+
export type HumanReadLink = z.infer<typeof humanReadLinkSchema>;
|
|
244
|
+
export type HumanReadableDocument = z.infer<typeof humanReadableDocumentSchema>;
|
|
245
|
+
export type IssueHumanReadLinkInput = z.input<typeof issueHumanReadLinkInputSchema>;
|
|
246
|
+
export type HumanPresentationContract<T> = z.ZodType<T>;
|
|
247
|
+
export type HumanPresentationContractInput<T extends z.ZodType> = z.input<T>;
|
|
248
|
+
export type HumanReadLinkResult = z.infer<typeof humanReadLinkResultSchema>;
|
|
249
|
+
export declare const cleanupHumanReadLinksInputSchema: z.ZodObject<{
|
|
250
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
251
|
+
}, z.core.$strict>;
|
|
252
|
+
export declare const cleanupHumanReadLinksResultSchema: z.ZodObject<{
|
|
253
|
+
reclaimed: z.ZodNumber;
|
|
254
|
+
limit: z.ZodNumber;
|
|
255
|
+
}, z.core.$strict>;
|
|
256
|
+
export declare const humanPresentationResultSchema: z.ZodObject<{
|
|
257
|
+
human: z.ZodObject<{
|
|
258
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
259
|
+
interactions: z.ZodArray<z.ZodObject<{
|
|
260
|
+
interactionRef: z.ZodString;
|
|
261
|
+
kind: z.ZodLiteral<"CONTENT_PACKAGE_REVIEW">;
|
|
262
|
+
subjectRef: z.ZodString;
|
|
263
|
+
title: z.ZodString;
|
|
264
|
+
summary: z.ZodString;
|
|
265
|
+
state: z.ZodEnum<{
|
|
266
|
+
APPROVED: "APPROVED";
|
|
267
|
+
PENDING: "PENDING";
|
|
268
|
+
REJECTED: "REJECTED";
|
|
269
|
+
RESOLVED: "RESOLVED";
|
|
270
|
+
}>;
|
|
271
|
+
sourceState: z.ZodString;
|
|
272
|
+
actionDigest: z.ZodString;
|
|
273
|
+
expiresAt: z.ZodNull;
|
|
274
|
+
reviewUrl: z.ZodString;
|
|
275
|
+
canReview: z.ZodBoolean;
|
|
276
|
+
}, z.core.$strict>>;
|
|
277
|
+
links: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
278
|
+
linkRef: z.ZodString;
|
|
279
|
+
kind: z.ZodLiteral<"READABLE_CONTENT">;
|
|
280
|
+
title: z.ZodString;
|
|
281
|
+
subjectRef: z.ZodString;
|
|
282
|
+
url: z.ZodString;
|
|
283
|
+
access: z.ZodLiteral<"AUTHENTICATED">;
|
|
284
|
+
representation: z.ZodLiteral<"CURRENT_VIEW">;
|
|
285
|
+
expiresAt: z.ZodNull;
|
|
286
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
287
|
+
linkRef: z.ZodString;
|
|
288
|
+
kind: z.ZodLiteral<"READABLE_CONTENT">;
|
|
289
|
+
title: z.ZodString;
|
|
290
|
+
subjectRef: z.ZodString;
|
|
291
|
+
url: z.ZodString;
|
|
292
|
+
access: z.ZodLiteral<"TEMPORARY_PUBLIC_READ">;
|
|
293
|
+
representation: z.ZodLiteral<"SNAPSHOT">;
|
|
294
|
+
snapshotRef: z.ZodString;
|
|
295
|
+
contentSha256: z.ZodString;
|
|
296
|
+
createdAt: z.ZodString;
|
|
297
|
+
expiresAt: z.ZodString;
|
|
298
|
+
}, z.core.$strict>], "access">>;
|
|
299
|
+
}, z.core.$strict>;
|
|
300
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export { nativeClientRelease } from './generated/client-release.js';
|
|
3
|
+
export declare const nativeReleaseCapability = "com.native-marketing/client-release";
|
|
4
|
+
export declare const releaseVersionSchema: z.ZodString;
|
|
5
|
+
export declare const clientIdentitySchema: z.ZodObject<{
|
|
6
|
+
version: z.ZodString;
|
|
7
|
+
contractVersion: z.ZodNumber;
|
|
8
|
+
apiMajor: z.ZodNumber;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export declare const clientReleaseSchema: z.ZodObject<{
|
|
11
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
12
|
+
product: z.ZodLiteral<"native-marketing">;
|
|
13
|
+
version: z.ZodString;
|
|
14
|
+
packages: z.ZodObject<{
|
|
15
|
+
sdk: z.ZodLiteral<"@native-marketing/sdk">;
|
|
16
|
+
cli: z.ZodLiteral<"@native-marketing/cli">;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
contractVersion: z.ZodNumber;
|
|
19
|
+
minimumClientVersion: z.ZodString;
|
|
20
|
+
apiMajor: z.ZodNumber;
|
|
21
|
+
nodeMajor: z.ZodNumber;
|
|
22
|
+
changes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const updatePolicySchema: z.ZodObject<{
|
|
25
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
26
|
+
auto: "auto";
|
|
27
|
+
notify: "notify";
|
|
28
|
+
off: "off";
|
|
29
|
+
}>>;
|
|
30
|
+
channel: z.ZodDefault<z.ZodEnum<{
|
|
31
|
+
beta: "beta";
|
|
32
|
+
latest: "latest";
|
|
33
|
+
next: "next";
|
|
34
|
+
}>>;
|
|
35
|
+
pin: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
36
|
+
intervalHours: z.ZodDefault<z.ZodNumber>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export declare const defaultUpdatePolicy: {
|
|
39
|
+
mode: "auto" | "notify" | "off";
|
|
40
|
+
channel: "beta" | "latest" | "next";
|
|
41
|
+
pin: string | null;
|
|
42
|
+
intervalHours: number;
|
|
43
|
+
};
|
|
44
|
+
export type NativeClientIdentity = z.infer<typeof clientIdentitySchema>;
|
|
45
|
+
export type NativeClientRelease = z.infer<typeof clientReleaseSchema>;
|
|
46
|
+
export type NativeUpdatePolicy = z.infer<typeof updatePolicySchema>;
|
|
47
|
+
export interface NativeCompatibility {
|
|
48
|
+
status: 'COMPATIBLE' | 'UPGRADE_RECOMMENDED' | 'INCOMPATIBLE' | 'UNKNOWN';
|
|
49
|
+
reason: 'CURRENT' | 'NEWER_CLIENT_AVAILABLE' | 'CLIENT_TOO_OLD' | 'CONTRACT_MISMATCH' | 'API_MISMATCH' | 'SERVER_METADATA_UNAVAILABLE';
|
|
50
|
+
client: NativeClientIdentity;
|
|
51
|
+
server: NativeClientRelease | null;
|
|
52
|
+
}
|
|
53
|
+
/** Exact SemVer precedence only; package-manager ranges are never interpreted here. */
|
|
54
|
+
export declare function compareReleaseVersions(left: string, right: string): number;
|
|
55
|
+
export declare function assessNativeCompatibility(client: NativeClientIdentity, server?: NativeClientRelease): NativeCompatibility;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type NativeClientRelease, type NativeUpdatePolicy } from './client-lifecycle.js';
|
|
3
|
+
export declare const registryReleaseSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodEnum<{
|
|
5
|
+
"@native-marketing/cli": "@native-marketing/cli";
|
|
6
|
+
"@native-marketing/sdk": "@native-marketing/sdk";
|
|
7
|
+
}>;
|
|
8
|
+
version: z.ZodString;
|
|
9
|
+
deprecated: z.ZodOptional<z.ZodString>;
|
|
10
|
+
nativeMarketing: z.ZodOptional<z.ZodObject<{
|
|
11
|
+
contractVersion: z.ZodNumber;
|
|
12
|
+
apiMajor: z.ZodNumber;
|
|
13
|
+
nodeMajor: z.ZodNumber;
|
|
14
|
+
changes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
dist: z.ZodObject<{
|
|
17
|
+
integrity: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type NativeRegistryRelease = z.infer<typeof registryReleaseSchema>;
|
|
21
|
+
export declare const clientUpdateStateSchema: z.ZodObject<{
|
|
22
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
23
|
+
policy: z.ZodObject<{
|
|
24
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
25
|
+
auto: "auto";
|
|
26
|
+
notify: "notify";
|
|
27
|
+
off: "off";
|
|
28
|
+
}>>;
|
|
29
|
+
channel: z.ZodDefault<z.ZodEnum<{
|
|
30
|
+
beta: "beta";
|
|
31
|
+
latest: "latest";
|
|
32
|
+
next: "next";
|
|
33
|
+
}>>;
|
|
34
|
+
pin: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
35
|
+
intervalHours: z.ZodDefault<z.ZodNumber>;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
lastCheck: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
at: z.ZodNumber;
|
|
39
|
+
selector: z.ZodString;
|
|
40
|
+
target: z.ZodObject<{
|
|
41
|
+
name: z.ZodEnum<{
|
|
42
|
+
"@native-marketing/cli": "@native-marketing/cli";
|
|
43
|
+
"@native-marketing/sdk": "@native-marketing/sdk";
|
|
44
|
+
}>;
|
|
45
|
+
version: z.ZodString;
|
|
46
|
+
deprecated: z.ZodOptional<z.ZodString>;
|
|
47
|
+
nativeMarketing: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
contractVersion: z.ZodNumber;
|
|
49
|
+
apiMajor: z.ZodNumber;
|
|
50
|
+
nodeMajor: z.ZodNumber;
|
|
51
|
+
changes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
dist: z.ZodObject<{
|
|
54
|
+
integrity: z.ZodString;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
}, z.core.$strict>>;
|
|
58
|
+
lastAttempt: z.ZodOptional<z.ZodObject<{
|
|
59
|
+
at: z.ZodNumber;
|
|
60
|
+
selector: z.ZodString;
|
|
61
|
+
}, z.core.$strict>>;
|
|
62
|
+
}, z.core.$strict>;
|
|
63
|
+
export type NativeClientUpdateState = z.infer<typeof clientUpdateStateSchema>;
|
|
64
|
+
export interface NativeUpdatePlan {
|
|
65
|
+
package: NativeRegistryRelease['name'];
|
|
66
|
+
currentVersion: string;
|
|
67
|
+
targetVersion: string;
|
|
68
|
+
status: 'CURRENT' | 'UPDATE_AVAILABLE' | 'BLOCKED';
|
|
69
|
+
reason: 'CURRENT' | 'COMPATIBLE_UPDATE' | 'REVIEW_REQUIRED' | 'PIN_MISMATCH' | 'CHANNEL_MISMATCH' | 'DOWNGRADE_FORBIDDEN' | 'METADATA_UNAVAILABLE' | 'CONTRACT_MISMATCH' | 'NODE_MISMATCH' | 'SERVER_INCOMPATIBLE' | 'DEPRECATED';
|
|
70
|
+
eligibleForAutoUpdate: boolean;
|
|
71
|
+
policy: NativeUpdatePolicy;
|
|
72
|
+
commands: {
|
|
73
|
+
npm: string[];
|
|
74
|
+
pnpm: string[];
|
|
75
|
+
yarn: string[] | null;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export declare function planNativeUpdate(input: {
|
|
79
|
+
target: NativeRegistryRelease;
|
|
80
|
+
currentVersion?: string;
|
|
81
|
+
policy?: NativeUpdatePolicy;
|
|
82
|
+
nodeMajor?: number;
|
|
83
|
+
server?: NativeClientRelease;
|
|
84
|
+
}): NativeUpdatePlan;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const nativeClientRelease: {
|
|
2
|
+
readonly schemaVersion: 1;
|
|
3
|
+
readonly product: 'native-marketing';
|
|
4
|
+
readonly version: '0.3.8';
|
|
5
|
+
readonly packages: {
|
|
6
|
+
readonly sdk: '@native-marketing/sdk';
|
|
7
|
+
readonly cli: '@native-marketing/cli';
|
|
8
|
+
};
|
|
9
|
+
readonly contractVersion: 1;
|
|
10
|
+
readonly minimumClientVersion: '0.3.6';
|
|
11
|
+
readonly apiMajor: 1;
|
|
12
|
+
readonly nodeMajor: 24;
|
|
13
|
+
readonly changes: readonly ['Unified typed human interaction cards and authenticated reading links across SDK, CLI and MCP.', 'Explicitly authorized expiring public read-only package text snapshots with original request recovery and revocation.', 'Bound human presentation responses to the configured Project, original issuance request and source version.'];
|
|
14
|
+
};
|
|
@@ -117,3 +117,7 @@ export * from './event-backlog.js';
|
|
|
117
117
|
export * from './event-readiness.js';
|
|
118
118
|
export * from './event-inbox.js';
|
|
119
119
|
export * from './event-outbox-browser.js';
|
|
120
|
+
export * from './client-lifecycle.js';
|
|
121
|
+
export * from './client-update-policy.js';
|
|
122
|
+
export * from './agent/human-presentation.js';
|
|
123
|
+
export * from './agent/human-presentation-validation.js';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ContentFactoryClientOptions } from './client.js';
|
|
2
|
+
export declare function getNativeClientVersion(): {
|
|
3
|
+
schemaVersion: 1;
|
|
4
|
+
product: "native-marketing";
|
|
5
|
+
version: string;
|
|
6
|
+
packages: {
|
|
7
|
+
sdk: "@native-marketing/sdk";
|
|
8
|
+
cli: "@native-marketing/cli";
|
|
9
|
+
};
|
|
10
|
+
contractVersion: number;
|
|
11
|
+
minimumClientVersion: string;
|
|
12
|
+
apiMajor: number;
|
|
13
|
+
nodeMajor: number;
|
|
14
|
+
changes: string[];
|
|
15
|
+
};
|
|
16
|
+
export declare function checkNativeHttpVersion(options?: ContentFactoryClientOptions & {
|
|
17
|
+
timeoutMs?: number;
|
|
18
|
+
requireCompatibility?: boolean;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
client: {
|
|
21
|
+
schemaVersion: 1;
|
|
22
|
+
product: "native-marketing";
|
|
23
|
+
version: string;
|
|
24
|
+
packages: {
|
|
25
|
+
sdk: "@native-marketing/sdk";
|
|
26
|
+
cli: "@native-marketing/cli";
|
|
27
|
+
};
|
|
28
|
+
contractVersion: number;
|
|
29
|
+
minimumClientVersion: string;
|
|
30
|
+
apiMajor: number;
|
|
31
|
+
nodeMajor: number;
|
|
32
|
+
changes: string[];
|
|
33
|
+
};
|
|
34
|
+
compatibility: import("../contracts/index.js").NativeCompatibility;
|
|
35
|
+
}>;
|
package/types/http/client.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { paths } from './generated/schema.js';
|
|
|
2
2
|
export interface ContentFactoryClientOptions {
|
|
3
3
|
baseUrl?: string;
|
|
4
4
|
fetch?: (input: Request) => Promise<Response>;
|
|
5
|
+
compatibility?: 'check' | 'require';
|
|
5
6
|
}
|
|
6
7
|
/** 共用认证HTTP入口,空写动作与生产代理保持一致的JSON传输合同。 */
|
|
7
8
|
export declare function createContentFactoryClient(options?: ContentFactoryClientOptions): import("openapi-fetch").Client<paths, `${string}/${string}`>;
|