@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/agent-evals.mjs
CHANGED
|
@@ -12248,6 +12248,7 @@ var StateTransitionInputBindingSchema = external_exports.lazy(
|
|
|
12248
12248
|
);
|
|
12249
12249
|
var StateTransitionActionSchema = external_exports.object({
|
|
12250
12250
|
effect: external_exports.string().min(1),
|
|
12251
|
+
providerLabel: external_exports.string().optional(),
|
|
12251
12252
|
input: external_exports.record(external_exports.string(), StateTransitionInputBindingSchema).optional()
|
|
12252
12253
|
}).strict();
|
|
12253
12254
|
var StateTransitionAssigneeSchema = external_exports.object({
|
|
@@ -14735,6 +14736,15 @@ var stateMachineMetamodelPackage = defineMetamodelPackage({
|
|
|
14735
14736
|
is_final: Boolean!
|
|
14736
14737
|
history: [StateMachineTransitionEvent!]!
|
|
14737
14738
|
instances_in_state(state: String!): [Model!]!
|
|
14739
|
+
instance_population(state: String!, page: Int = 1, per_page: Int = 50): StateMachineInstancePopulation!
|
|
14740
|
+
}
|
|
14741
|
+
|
|
14742
|
+
type StateMachineInstancePopulation {
|
|
14743
|
+
count: Int!
|
|
14744
|
+
instances: [Model!]!
|
|
14745
|
+
page: Int!
|
|
14746
|
+
per_page: Int!
|
|
14747
|
+
has_more: Boolean!
|
|
14738
14748
|
}
|
|
14739
14749
|
|
|
14740
14750
|
type StateMachineState {
|
|
@@ -14943,6 +14953,13 @@ var stateMachineMetamodelPackage = defineMetamodelPackage({
|
|
|
14943
14953
|
value.model.target || value.model,
|
|
14944
14954
|
value.name,
|
|
14945
14955
|
state
|
|
14956
|
+
),
|
|
14957
|
+
instance_population: async (value, { state, page, per_page }) => await stateMachines.instancePopulation(
|
|
14958
|
+
value.model.target || value.model,
|
|
14959
|
+
value.name,
|
|
14960
|
+
state,
|
|
14961
|
+
page,
|
|
14962
|
+
per_page
|
|
14946
14963
|
)
|
|
14947
14964
|
}
|
|
14948
14965
|
};
|
|
@@ -17879,11 +17896,16 @@ var Granular = class _Granular {
|
|
|
17879
17896
|
`${methodName}() requires at least one permission so the SDK can ensure assignments for new users.`
|
|
17880
17897
|
);
|
|
17881
17898
|
}
|
|
17882
|
-
|
|
17883
|
-
|
|
17884
|
-
|
|
17885
|
-
|
|
17899
|
+
const permissionProfileIds = [];
|
|
17900
|
+
for (const profileReference of user.permissions) {
|
|
17901
|
+
permissionProfileIds.push(
|
|
17902
|
+
await this.ensurePermissionProfile(
|
|
17903
|
+
sandbox.sandboxId,
|
|
17904
|
+
profileReference
|
|
17905
|
+
)
|
|
17886
17906
|
);
|
|
17907
|
+
}
|
|
17908
|
+
for (const profileId of permissionProfileIds) {
|
|
17887
17909
|
await this.ensureAssignment(
|
|
17888
17910
|
user.granularId,
|
|
17889
17911
|
sandbox.sandboxId,
|
|
@@ -18888,25 +18910,37 @@ var Granular = class _Granular {
|
|
|
18888
18910
|
}
|
|
18889
18911
|
}
|
|
18890
18912
|
/**
|
|
18891
|
-
*
|
|
18892
|
-
*
|
|
18893
|
-
*
|
|
18913
|
+
* Resolve an existing permission profile by exact name or ID.
|
|
18914
|
+
*
|
|
18915
|
+
* `allow-all` is the sole compatibility profile that the SDK may provision
|
|
18916
|
+
* automatically. Every other missing reference fails closed so a typo or
|
|
18917
|
+
* untrusted role value cannot become an allow-default profile.
|
|
18894
18918
|
*/
|
|
18895
|
-
async ensurePermissionProfile(sandboxId,
|
|
18896
|
-
|
|
18897
|
-
|
|
18898
|
-
|
|
18899
|
-
|
|
18900
|
-
|
|
18901
|
-
|
|
18902
|
-
|
|
18919
|
+
async ensurePermissionProfile(sandboxId, profileReference) {
|
|
18920
|
+
const normalizedReference = typeof profileReference === "string" ? profileReference.trim() : "";
|
|
18921
|
+
if (!normalizedReference) {
|
|
18922
|
+
throw new Error(
|
|
18923
|
+
"Permission profile references must be non-empty names or IDs."
|
|
18924
|
+
);
|
|
18925
|
+
}
|
|
18926
|
+
const profiles = await this.permissionProfiles.list(sandboxId);
|
|
18927
|
+
const existing = profiles.find(
|
|
18928
|
+
(profile) => profile.name === normalizedReference || profile.permissionProfileId === normalizedReference
|
|
18929
|
+
);
|
|
18930
|
+
if (existing) {
|
|
18931
|
+
return existing.permissionProfileId;
|
|
18932
|
+
}
|
|
18933
|
+
if (normalizedReference !== "allow-all") {
|
|
18934
|
+
throw new Error(
|
|
18935
|
+
`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.`
|
|
18936
|
+
);
|
|
18903
18937
|
}
|
|
18904
18938
|
const created = await this.permissionProfiles.create(sandboxId, {
|
|
18905
|
-
name:
|
|
18939
|
+
name: normalizedReference,
|
|
18906
18940
|
rules: {
|
|
18907
18941
|
schemaVersion: 1,
|
|
18908
|
-
name:
|
|
18909
|
-
description:
|
|
18942
|
+
name: normalizedReference,
|
|
18943
|
+
description: "Every declared action is visible unless a manifest policy denies it.",
|
|
18910
18944
|
defaults: { actionPolicy: "allow" },
|
|
18911
18945
|
actions: []
|
|
18912
18946
|
}
|