@warmhub/sdk-ts 0.172.0
Changed
A Grant is one unit with a list of scope entries
What it was. client.grant.create(orgName, graphName, input) issued a Grant on one graph from coverage or viewRef and ops; get, list and revoke took the graph's orgName and graphName, and a Grant came back as one row with grantee, issuer, coverage and ops.
What it is now. client.grant.create({ idempotencyKey, recipient, entries, expiresInSeconds? }) takes a list of scope entries written the way a token's are: a resource (acme/world, or acme / acme/* for every graph of the organization), permissions (coarse scopes such as repo:read, or operations such as things:read), and on a graph entry selection pairs (names with include and exclude, and Shapes by name) or one viewRef. Every entry names one organization. client.grant.get(grantId) and client.grant.revoke(grantId, { reason }) take the Grant's id alone; client.grant.list(orgName, { graphName }) pages an organization's Grants newest first, or the ones that reach one graph. A Grant comes back as { id, organization, recipient, requestedBy, key, entries, expiresAt, createdAt, revokedAt, revokedBy, revokedReason }, each entry with the operations its permissions confer now. Every call needs a signed-in member who holds org:grants-manage in the organization.
What to do. Rewrite each client.grant call to the new inputs, and read a Grant's entries in place of coverage and ops. recipient.kind and an entry's resourceKind are open lists: show an unrecognized value as given.
Added
client.token.create accepts acme/* for an organization entry, and a scope entry's selection pairs beside its grants pairs.