@pylonsync/sdk 0.17.1 → 0.18.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/dist/index.d.ts CHANGED
@@ -1034,8 +1034,10 @@ export type AuthConfig = {
1034
1034
  * (`[{ id, name, slug?, role }]`) is reconciled against local Org
1035
1035
  * rows keyed by `externalIdField`: orgs are created and joined,
1036
1036
  * roles updated, and (with `removeMissing`) memberships absent from
1037
- * the claim removed. The org entity must declare `externalIdField`
1038
- * as `field.string().optional().unique()`.
1037
+ * the claim removed. Each login also writes the claim's name (and,
1038
+ * with `slugField`, its slug) onto the mirror. The org entity must
1039
+ * declare `externalIdField` (and `slugField`) as
1040
+ * `field.string().optional().unique()`.
1039
1041
  */
1040
1042
  federation?: {
1041
1043
  /** OAuth provider id whose `orgs` claim is trusted, e.g. `"stack0"`. */
@@ -1048,6 +1050,11 @@ export type AuthConfig = {
1048
1050
  roleMap?: Record<string, string>;
1049
1051
  /** Refuse `POST /api/auth/orgs` with `403 ORG_FEDERATED`. Default `true`. */
1050
1052
  disableLocalCreate?: boolean;
1053
+ /**
1054
+ * Field on the org entity that receives the claim's `slug`, for
1055
+ * org-scoped URLs like `/dashboard/orgs/<slug>`. Unset: not mirrored.
1056
+ */
1057
+ slugField?: string;
1051
1058
  };
1052
1059
  };
1053
1060
  /**
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.17.1",
6
+ "version": "0.18.1",
7
7
  "type": "module",
8
8
  "main": "./src/index.ts",
9
9
  "types": "./dist/index.d.ts",
package/src/index.ts CHANGED
@@ -1953,8 +1953,10 @@ export type AuthConfig = {
1953
1953
  * (`[{ id, name, slug?, role }]`) is reconciled against local Org
1954
1954
  * rows keyed by `externalIdField`: orgs are created and joined,
1955
1955
  * roles updated, and (with `removeMissing`) memberships absent from
1956
- * the claim removed. The org entity must declare `externalIdField`
1957
- * as `field.string().optional().unique()`.
1956
+ * the claim removed. Each login also writes the claim's name (and,
1957
+ * with `slugField`, its slug) onto the mirror. The org entity must
1958
+ * declare `externalIdField` (and `slugField`) as
1959
+ * `field.string().optional().unique()`.
1958
1960
  */
1959
1961
  federation?: {
1960
1962
  /** OAuth provider id whose `orgs` claim is trusted, e.g. `"stack0"`. */
@@ -1967,6 +1969,11 @@ export type AuthConfig = {
1967
1969
  roleMap?: Record<string, string>;
1968
1970
  /** Refuse `POST /api/auth/orgs` with `403 ORG_FEDERATED`. Default `true`. */
1969
1971
  disableLocalCreate?: boolean;
1972
+ /**
1973
+ * Field on the org entity that receives the claim's `slug`, for
1974
+ * org-scoped URLs like `/dashboard/orgs/<slug>`. Unset: not mirrored.
1975
+ */
1976
+ slugField?: string;
1970
1977
  };
1971
1978
  };
1972
1979
  /**
@@ -2212,6 +2219,9 @@ export function auth(cfg: AuthConfig = {}): ManifestAuthConfig {
2212
2219
  ? { role_map: cfg.org.federation.roleMap }
2213
2220
  : {}),
2214
2221
  disable_local_create: cfg.org.federation.disableLocalCreate ?? true,
2222
+ ...(cfg.org.federation.slugField
2223
+ ? { slug_field: cfg.org.federation.slugField }
2224
+ : {}),
2215
2225
  },
2216
2226
  }
2217
2227
  : {}),