@tinycloud/share-sdk 1.2.0-beta.3 → 1.2.0-beta.5
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/addressed-publish-BnSBJ-MX.d.ts +242 -0
- package/dist/addressed-publish-DtcLNG2m.d.cts +242 -0
- package/dist/artifact.cjs +88 -13
- package/dist/artifact.cjs.map +1 -1
- package/dist/artifact.d.cts +28 -8
- package/dist/artifact.d.ts +28 -8
- package/dist/artifact.js +84 -14
- package/dist/artifact.js.map +1 -1
- package/dist/history-CUWDK0lE.d.cts +180 -0
- package/dist/history-CyT6x8h4.d.ts +180 -0
- package/dist/index.cjs +128 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +93 -154
- package/dist/index.d.ts +93 -154
- package/dist/index.js +123 -4
- package/dist/index.js.map +1 -1
- package/dist/owner-policy-BqzRlkb6.d.cts +297 -0
- package/dist/owner-policy-BqzRlkb6.d.ts +297 -0
- package/dist/share-index.cjs +8714 -0
- package/dist/share-index.cjs.map +1 -0
- package/dist/share-index.d.cts +1063 -0
- package/dist/share-index.d.ts +1063 -0
- package/dist/share-index.js +8642 -0
- package/dist/share-index.js.map +1 -0
- package/dist/share-root.cjs +23 -1
- package/dist/share-root.cjs.map +1 -1
- package/dist/share-root.d.cts +2 -1
- package/dist/share-root.d.ts +2 -1
- package/dist/share-root.js +23 -1
- package/dist/share-root.js.map +1 -1
- package/package.json +8 -2
- package/dist/addressed-publish-CsUS7-SI.d.cts +0 -535
- package/dist/addressed-publish-CsUS7-SI.d.ts +0 -535
package/dist/share-root.cjs
CHANGED
|
@@ -5356,6 +5356,20 @@ var v3TargetSchema = external_exports.object({
|
|
|
5356
5356
|
nodeAudience: external_exports.string().min(1),
|
|
5357
5357
|
spaceId: external_exports.string().refine(isCanonicalPathSegment, { message: "expected a canonical space id" })
|
|
5358
5358
|
}).strict();
|
|
5359
|
+
var ARTIFACT_ID_PATTERN = /^[a-z0-9][a-z0-9_-]{2,62}$/;
|
|
5360
|
+
var artifactPinSchema = external_exports.object({
|
|
5361
|
+
v: external_exports.literal(1),
|
|
5362
|
+
artifactId: external_exports.string().regex(ARTIFACT_ID_PATTERN),
|
|
5363
|
+
version: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER),
|
|
5364
|
+
/** SHA-256 (lowercase hex) of the exact `manifest.json` bytes. The manifest itself stays an owner-side record. */
|
|
5365
|
+
manifestSha256: external_exports.string().regex(/^[0-9a-f]{64}$/),
|
|
5366
|
+
/** An addressed share reads one exact file, so exactly one entry: the stored bytes (ciphertext) it will fetch. */
|
|
5367
|
+
files: external_exports.array(external_exports.object({
|
|
5368
|
+
path: external_exports.string().min(1).max(255),
|
|
5369
|
+
sha256: external_exports.string().regex(/^[0-9a-f]{64}$/),
|
|
5370
|
+
bytes: external_exports.number().int().nonnegative()
|
|
5371
|
+
}).strict()).length(1)
|
|
5372
|
+
}).strict();
|
|
5359
5373
|
var unsignedShareEnvelopeV3BaseSchema = external_exports.object({
|
|
5360
5374
|
version: external_exports.literal(3),
|
|
5361
5375
|
shareId: external_exports.string().min(1),
|
|
@@ -5375,7 +5389,13 @@ var unsignedShareEnvelopeV3BaseSchema = external_exports.object({
|
|
|
5375
5389
|
expiry: external_exports.string().datetime({ offset: true }),
|
|
5376
5390
|
display: displaySchema,
|
|
5377
5391
|
encrypted: external_exports.literal(true),
|
|
5378
|
-
metadata: contentMetadataSchema
|
|
5392
|
+
metadata: contentMetadataSchema,
|
|
5393
|
+
/**
|
|
5394
|
+
* TC-1428: an owner-signed statement that this share reads one write-once artifact version. Additive: absent on
|
|
5395
|
+
* every other share, and covered by the envelope signature because the signature spans the whole unsigned object.
|
|
5396
|
+
* The shape is checked here; its binding to the content source is `verifyArtifactShare` in share-sdk.
|
|
5397
|
+
*/
|
|
5398
|
+
artifactPin: artifactPinSchema.optional()
|
|
5379
5399
|
}).strict();
|
|
5380
5400
|
function validateV3Invariants(value, ctx) {
|
|
5381
5401
|
const actions = [...value.actions];
|
|
@@ -7029,6 +7049,8 @@ async function ensureShareRoot(input) {
|
|
|
7029
7049
|
|
|
7030
7050
|
// src/artifact.ts
|
|
7031
7051
|
var import_sha2563 = require("@noble/hashes/sha256");
|
|
7052
|
+
|
|
7053
|
+
// src/artifact-core.ts
|
|
7032
7054
|
function parseArtifactVersionPath(path) {
|
|
7033
7055
|
const match = /^artifacts\/([a-z0-9][a-z0-9_-]{2,62})\/versions\/([1-9][0-9]{0,14})\/([^/]+)$/.exec(path);
|
|
7034
7056
|
if (match === null) return void 0;
|