@granular-software/sdk 0.4.60 → 0.4.62
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 +8 -0
- package/dist/agent-evals.d.mts +2 -2
- package/dist/agent-evals.d.ts +2 -2
- package/dist/agent-evals.js +52 -18
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +52 -18
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/cli/index.js +52 -18
- package/dist/{client-BzgQvNyG.d.ts → client-Bx5jIDGB.d.ts} +6 -4
- package/dist/{client-DSkGcmmX.d.mts → client-Dg0I_5B_.d.mts} +6 -4
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +52 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +52 -18
- package/dist/index.mjs.map +1 -1
- package/dist/{spend-CNe-Ff6U.d.mts → spend-C8OQnF6E.d.mts} +15 -3
- package/dist/{spend-CNe-Ff6U.d.ts → spend-C8OQnF6E.d.ts} +15 -3
- package/dist/spend.d.mts +1 -1
- package/dist/spend.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -12273,6 +12273,7 @@ var StateTransitionInputBindingSchema = external_exports.lazy(
|
|
|
12273
12273
|
);
|
|
12274
12274
|
var StateTransitionActionSchema = external_exports.object({
|
|
12275
12275
|
effect: external_exports.string().min(1),
|
|
12276
|
+
providerLabel: external_exports.string().optional(),
|
|
12276
12277
|
input: external_exports.record(external_exports.string(), StateTransitionInputBindingSchema).optional()
|
|
12277
12278
|
}).strict();
|
|
12278
12279
|
var StateTransitionAssigneeSchema = external_exports.object({
|
|
@@ -14760,6 +14761,15 @@ var stateMachineMetamodelPackage = defineMetamodelPackage({
|
|
|
14760
14761
|
is_final: Boolean!
|
|
14761
14762
|
history: [StateMachineTransitionEvent!]!
|
|
14762
14763
|
instances_in_state(state: String!): [Model!]!
|
|
14764
|
+
instance_population(state: String!, page: Int = 1, per_page: Int = 50): StateMachineInstancePopulation!
|
|
14765
|
+
}
|
|
14766
|
+
|
|
14767
|
+
type StateMachineInstancePopulation {
|
|
14768
|
+
count: Int!
|
|
14769
|
+
instances: [Model!]!
|
|
14770
|
+
page: Int!
|
|
14771
|
+
per_page: Int!
|
|
14772
|
+
has_more: Boolean!
|
|
14763
14773
|
}
|
|
14764
14774
|
|
|
14765
14775
|
type StateMachineState {
|
|
@@ -14968,6 +14978,13 @@ var stateMachineMetamodelPackage = defineMetamodelPackage({
|
|
|
14968
14978
|
value.model.target || value.model,
|
|
14969
14979
|
value.name,
|
|
14970
14980
|
state
|
|
14981
|
+
),
|
|
14982
|
+
instance_population: async (value, { state, page, per_page }) => await stateMachines.instancePopulation(
|
|
14983
|
+
value.model.target || value.model,
|
|
14984
|
+
value.name,
|
|
14985
|
+
state,
|
|
14986
|
+
page,
|
|
14987
|
+
per_page
|
|
14971
14988
|
)
|
|
14972
14989
|
}
|
|
14973
14990
|
};
|
|
@@ -18002,11 +18019,16 @@ var Granular = class _Granular {
|
|
|
18002
18019
|
`${methodName}() requires at least one permission so the SDK can ensure assignments for new users.`
|
|
18003
18020
|
);
|
|
18004
18021
|
}
|
|
18005
|
-
|
|
18006
|
-
|
|
18007
|
-
|
|
18008
|
-
|
|
18022
|
+
const permissionProfileIds = [];
|
|
18023
|
+
for (const profileReference of user.permissions) {
|
|
18024
|
+
permissionProfileIds.push(
|
|
18025
|
+
await this.ensurePermissionProfile(
|
|
18026
|
+
sandbox.sandboxId,
|
|
18027
|
+
profileReference
|
|
18028
|
+
)
|
|
18009
18029
|
);
|
|
18030
|
+
}
|
|
18031
|
+
for (const profileId of permissionProfileIds) {
|
|
18010
18032
|
await this.ensureAssignment(
|
|
18011
18033
|
user.granularId,
|
|
18012
18034
|
sandbox.sandboxId,
|
|
@@ -19011,25 +19033,37 @@ var Granular = class _Granular {
|
|
|
19011
19033
|
}
|
|
19012
19034
|
}
|
|
19013
19035
|
/**
|
|
19014
|
-
*
|
|
19015
|
-
*
|
|
19016
|
-
*
|
|
19036
|
+
* Resolve an existing permission profile by exact name or ID.
|
|
19037
|
+
*
|
|
19038
|
+
* `allow-all` is the sole compatibility profile that the SDK may provision
|
|
19039
|
+
* automatically. Every other missing reference fails closed so a typo or
|
|
19040
|
+
* untrusted role value cannot become an allow-default profile.
|
|
19017
19041
|
*/
|
|
19018
|
-
async ensurePermissionProfile(sandboxId,
|
|
19019
|
-
|
|
19020
|
-
|
|
19021
|
-
|
|
19022
|
-
|
|
19023
|
-
|
|
19024
|
-
|
|
19025
|
-
|
|
19042
|
+
async ensurePermissionProfile(sandboxId, profileReference) {
|
|
19043
|
+
const normalizedReference = typeof profileReference === "string" ? profileReference.trim() : "";
|
|
19044
|
+
if (!normalizedReference) {
|
|
19045
|
+
throw new Error(
|
|
19046
|
+
"Permission profile references must be non-empty names or IDs."
|
|
19047
|
+
);
|
|
19048
|
+
}
|
|
19049
|
+
const profiles = await this.permissionProfiles.list(sandboxId);
|
|
19050
|
+
const existing = profiles.find(
|
|
19051
|
+
(profile) => profile.name === normalizedReference || profile.permissionProfileId === normalizedReference
|
|
19052
|
+
);
|
|
19053
|
+
if (existing) {
|
|
19054
|
+
return existing.permissionProfileId;
|
|
19055
|
+
}
|
|
19056
|
+
if (normalizedReference !== "allow-all") {
|
|
19057
|
+
throw new Error(
|
|
19058
|
+
`Permission profile "${normalizedReference}" was not found in sandbox ${sandboxId}. Provision it with granular build or granular deploy before calling openEnvironment(). Only the reserved "allow-all" profile can be created automatically.`
|
|
19059
|
+
);
|
|
19026
19060
|
}
|
|
19027
19061
|
const created = await this.permissionProfiles.create(sandboxId, {
|
|
19028
|
-
name:
|
|
19062
|
+
name: normalizedReference,
|
|
19029
19063
|
rules: {
|
|
19030
19064
|
schemaVersion: 1,
|
|
19031
|
-
name:
|
|
19032
|
-
description:
|
|
19065
|
+
name: normalizedReference,
|
|
19066
|
+
description: "Every declared action is visible unless a manifest policy denies it.",
|
|
19033
19067
|
defaults: { actionPolicy: "allow" },
|
|
19034
19068
|
actions: []
|
|
19035
19069
|
}
|