kinde-testkit 0.7.0 → 0.7.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.1
4
+
5
+ - Management API responses now have every field a real Kinde business returns: `full_name` and `last_organization_sign_ins` on users, `created_on` on organizations in lists, and `is_organization_role_assignable` on permissions. Found by the contract tests.
6
+
3
7
  ## 0.7.0
4
8
 
5
9
  Found by running the new contract tests against a real Kinde business.
@@ -898,7 +898,8 @@ var Directory = class {
898
898
  isPasswordResetRequested: false,
899
899
  createdOn: (/* @__PURE__ */ new Date()).toISOString(),
900
900
  totalSignIns: 0,
901
- lastSignedIn: null
901
+ lastSignedIn: null,
902
+ lastOrganizationSignIns: {}
902
903
  };
903
904
  this.userMeta.set(user.id, meta);
904
905
  }
@@ -911,7 +912,7 @@ var Directory = class {
911
912
  const meta = this.meta(user);
912
913
  meta.totalSignIns += 1;
913
914
  meta.lastSignedIn = (/* @__PURE__ */ new Date()).toISOString();
914
- void organizationCode;
915
+ if (organizationCode) meta.lastOrganizationSignIns[organizationCode] = meta.lastSignedIn;
915
916
  }
916
917
  createUser(input) {
917
918
  const user = createKindeUser({
@@ -2928,12 +2929,14 @@ var ManagementApi = class {
2928
2929
  username: null,
2929
2930
  last_name: user.familyName,
2930
2931
  first_name: user.givenName,
2932
+ full_name: [user.givenName, user.familyName].filter(Boolean).join(" ") || null,
2931
2933
  is_suspended: meta.isSuspended,
2932
2934
  picture: user.picture,
2933
2935
  total_sign_ins: meta.totalSignIns,
2934
2936
  failed_sign_ins: 0,
2935
2937
  last_signed_in: meta.lastSignedIn,
2936
2938
  created_on: meta.createdOn,
2939
+ last_organization_sign_ins: Object.entries(meta.lastOrganizationSignIns).map(([org_code, last_signed_in]) => ({ org_code, last_signed_in })),
2937
2940
  organizations: this.organizationsOf(user),
2938
2941
  identities: user.email ? [{ type: "email", identity: user.email }] : []
2939
2942
  };
@@ -2953,7 +2956,8 @@ var ManagementApi = class {
2953
2956
  handle: meta.handle,
2954
2957
  is_default: false,
2955
2958
  external_id: meta.externalId,
2956
- is_auto_membership_enabled: false
2959
+ is_auto_membership_enabled: false,
2960
+ created_on: meta.createdOn
2957
2961
  };
2958
2962
  }
2959
2963
  organizationEvent(org) {
@@ -2964,7 +2968,7 @@ var ManagementApi = class {
2964
2968
  return { id: role.id, key: role.key, name: role.name, description: role.description, is_default_role: role.isDefault };
2965
2969
  }
2966
2970
  permissionItem(permission) {
2967
- return { id: permission.id, key: permission.key, name: permission.name, description: permission.description };
2971
+ return { id: permission.id, key: permission.key, name: permission.name, description: permission.description, is_organization_role_assignable: false };
2968
2972
  }
2969
2973
  };
2970
2974
  function paginate(items, query) {
@@ -3694,4 +3698,4 @@ export {
3694
3698
  loadSeedFile,
3695
3699
  startKindeTestkit
3696
3700
  };
3697
- //# sourceMappingURL=chunk-JTAB2S44.js.map
3701
+ //# sourceMappingURL=chunk-IOP27RQ5.js.map