ShareResource
Source:
src/Cloudflare/ResourceSharing/ShareResource.ts
A resource entry on an existing Cloudflare share — adds a shareable
resource (gateway policy, custom ruleset, …) to a Share incrementally.
Only meta is mutable in place; changing the share, type, id, or owning
account triggers a replacement. A share must always retain at least one
resource — the last entry cannot be deleted (delete the Share instead).
Do not manage the same entry both inline on Share.resources and through
this resource.
Adding a Resource to a Share
Section titled “Adding a Resource to a Share”const entry = yield* Cloudflare.ShareResource("ExtraPolicy", { shareId: share.shareId, resourceType: "gateway-policy", resourceId: policy.ruleId,});Updating Metadata
Section titled “Updating Metadata”const entry = yield* Cloudflare.ShareResource("ExtraPolicy", { shareId: share.shareId, resourceType: "gateway-policy", resourceId: policy.ruleId, meta: { note: "rotated" },});