@spotto/contract 1.0.69-alpha.22 → 1.0.69-alpha.24

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.
Files changed (57) hide show
  1. package/dist/assets/get/query.d.ts +1 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +1 -0
  4. package/dist/index.js.map +1 -1
  5. package/dist/organisations/index.d.ts +1 -0
  6. package/dist/organisations/index.js +1 -0
  7. package/dist/organisations/index.js.map +1 -1
  8. package/dist/organisations/sso/constants.d.ts +48 -0
  9. package/dist/organisations/sso/constants.js +51 -0
  10. package/dist/organisations/sso/constants.js.map +1 -0
  11. package/dist/organisations/sso/index.d.ts +2 -0
  12. package/dist/organisations/sso/index.js +19 -0
  13. package/dist/organisations/sso/index.js.map +1 -0
  14. package/dist/organisations/sso/types.d.ts +48 -0
  15. package/dist/organisations/sso/types.js +13 -0
  16. package/dist/organisations/sso/types.js.map +1 -0
  17. package/dist/sso/discover/index.d.ts +2 -0
  18. package/dist/sso/discover/index.js +19 -0
  19. package/dist/sso/discover/index.js.map +1 -0
  20. package/dist/sso/discover/request.d.ts +9 -0
  21. package/dist/sso/discover/request.js +3 -0
  22. package/dist/sso/discover/request.js.map +1 -0
  23. package/dist/sso/discover/response.d.ts +17 -0
  24. package/dist/sso/discover/response.js +3 -0
  25. package/dist/sso/discover/response.js.map +1 -0
  26. package/dist/sso/get/index.d.ts +1 -0
  27. package/dist/sso/get/index.js +18 -0
  28. package/dist/sso/get/index.js.map +1 -0
  29. package/dist/sso/get/response.d.ts +12 -0
  30. package/dist/sso/get/response.js +3 -0
  31. package/dist/sso/get/response.js.map +1 -0
  32. package/dist/sso/index.d.ts +5 -0
  33. package/dist/sso/index.js +22 -0
  34. package/dist/sso/index.js.map +1 -0
  35. package/dist/sso/offboard/index.d.ts +1 -0
  36. package/dist/sso/offboard/index.js +18 -0
  37. package/dist/sso/offboard/index.js.map +1 -0
  38. package/dist/sso/offboard/response.d.ts +9 -0
  39. package/dist/sso/offboard/response.js +3 -0
  40. package/dist/sso/offboard/response.js.map +1 -0
  41. package/dist/sso/onboard/index.d.ts +2 -0
  42. package/dist/sso/onboard/index.js +19 -0
  43. package/dist/sso/onboard/index.js.map +1 -0
  44. package/dist/sso/onboard/request.d.ts +38 -0
  45. package/dist/sso/onboard/request.js +16 -0
  46. package/dist/sso/onboard/request.js.map +1 -0
  47. package/dist/sso/onboard/response.d.ts +18 -0
  48. package/dist/sso/onboard/response.js +3 -0
  49. package/dist/sso/onboard/response.js.map +1 -0
  50. package/dist/sso/revert/index.d.ts +1 -0
  51. package/dist/sso/revert/index.js +18 -0
  52. package/dist/sso/revert/index.js.map +1 -0
  53. package/dist/sso/revert/response.d.ts +28 -0
  54. package/dist/sso/revert/response.js +3 -0
  55. package/dist/sso/revert/response.js.map +1 -0
  56. package/dist/views/shared.d.ts +1 -2
  57. package/package.json +2 -2
@@ -49,6 +49,7 @@ export interface AssetFilters {
49
49
  manifestIds?: string[];
50
50
  supportsWith?: boolean;
51
51
  withAsset?: boolean;
52
+ dispatched?: boolean;
52
53
  createdAt?: DateCondition[];
53
54
  updatedAt?: DateCondition[];
54
55
  lastSeen?: DateCondition[];
package/dist/index.d.ts CHANGED
@@ -19,4 +19,5 @@ export * from './fields';
19
19
  export * from './workflows';
20
20
  export * from './system';
21
21
  export * from './reports';
22
+ export * from './sso';
22
23
  export * from './views';
package/dist/index.js CHANGED
@@ -35,5 +35,6 @@ __exportStar(require("./fields"), exports);
35
35
  __exportStar(require("./workflows"), exports);
36
36
  __exportStar(require("./system"), exports);
37
37
  __exportStar(require("./reports"), exports);
38
+ __exportStar(require("./sso"), exports);
38
39
  __exportStar(require("./views"), exports);
39
40
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,2CAAwB;AACxB,iDAA8B;AAC9B,2CAAwB;AACxB,2CAAwB;AACxB,8CAA2B;AAC3B,6CAA0B;AAC1B,kDAA+B;AAC/B,4CAAyB;AACzB,0CAAuB;AACvB,yCAAsB;AACtB,8CAA2B;AAC3B,0CAAuB;AACvB,8CAA2B;AAC3B,0CAAuB;AACvB,2CAAwB;AACxB,8CAA2B;AAC3B,2CAAwB;AACxB,8CAA2B;AAC3B,2CAAwB;AACxB,4CAAyB;AACzB,0CAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,2CAAwB;AACxB,iDAA8B;AAC9B,2CAAwB;AACxB,2CAAwB;AACxB,8CAA2B;AAC3B,6CAA0B;AAC1B,kDAA+B;AAC/B,4CAAyB;AACzB,0CAAuB;AACvB,yCAAsB;AACtB,8CAA2B;AAC3B,0CAAuB;AACvB,8CAA2B;AAC3B,0CAAuB;AACvB,2CAAwB;AACxB,8CAA2B;AAC3B,2CAAwB;AACxB,8CAA2B;AAC3B,2CAAwB;AACxB,4CAAyB;AACzB,wCAAqB;AACrB,0CAAuB"}
@@ -2,3 +2,4 @@ export * from './[id]';
2
2
  export * from './get';
3
3
  export * from './post';
4
4
  export * from './constants';
5
+ export * from './sso';
@@ -18,4 +18,5 @@ __exportStar(require("./[id]"), exports);
18
18
  __exportStar(require("./get"), exports);
19
19
  __exportStar(require("./post"), exports);
20
20
  __exportStar(require("./constants"), exports);
21
+ __exportStar(require("./sso"), exports);
21
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/organisations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,wCAAqB;AACrB,yCAAsB;AACtB,8CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/organisations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAsB;AACtB,wCAAqB;AACrB,yCAAsB;AACtB,8CAA2B;AAC3B,wCAAqB"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Supported SSO protocol modes for an organisation's per-customer Cognito IdP.
3
+ */
4
+ export declare const SSO_MODES: readonly ["oidc", "saml"];
5
+ export declare type SsoMode = (typeof SSO_MODES)[number];
6
+ /**
7
+ * Per-org policy when the IdP-emitted role claim is missing or its value
8
+ * isn't a recognised Spotto role. `deny` rejects the login;
9
+ * `defaultRole` falls back to a configured role id.
10
+ */
11
+ export declare const UNKNOWN_ROLE_ACTION_TYPES: readonly ["deny", "defaultRole"];
12
+ export declare type UnknownRoleActionType = (typeof UNKNOWN_ROLE_ACTION_TYPES)[number];
13
+ /**
14
+ * Cognito user attribute that carries the IdP-emitted Spotto role string.
15
+ * Fixed across all SSO orgs — every per-customer IdP attribute mapping wires
16
+ * the customer's role claim into this attribute, and every read site (auth
17
+ * bootstrap, role-refresh) reads from it.
18
+ *
19
+ * Cognito custom-attribute names are restricted to `[a-zA-Z][a-zA-Z0-9_]*`
20
+ * (no hyphens), so this is the canonical underscore form.
21
+ *
22
+ * Operational note: each User Pool (dev / staging / prod) needs the
23
+ * corresponding `g2g_role` custom attribute defined once before any SSO org
24
+ * can be onboarded against it. This is a manual one-off via the AWS console.
25
+ */
26
+ export declare const DEFAULT_ROLE_CLAIM_ATTRIBUTE = "custom:g2g_role";
27
+ /**
28
+ * The IdP-side claim name customers MUST emit. Mandated rather than
29
+ * configurable per-customer — every onboarded IdP gets the same Cognito
30
+ * attribute mapping (`custom:g2g_role` ← `g2g_role`), so customers configure
31
+ * their IdP to emit a claim with this exact name.
32
+ *
33
+ * - OIDC: a top-level claim called `g2g_role` in the userinfo / ID token.
34
+ * - SAML: an Attribute with `Name="g2g_role"` (bare name, not URI form). All
35
+ * mainstream IdPs accept bare-name attributes; ADFS may need a custom
36
+ * claim rule.
37
+ */
38
+ export declare const DEFAULT_IDP_ROLE_CLAIM = "g2g_role";
39
+ /**
40
+ * Builds the deterministic Cognito IdP / Client name for an org's SSO
41
+ * provisioning. Same input → same name, so re-onboarding (after offboard)
42
+ * regenerates the exact name; any partial debris in Cognito is found and
43
+ * updated by the describe-then-create-or-update path.
44
+ *
45
+ * Uses the org's Mongo `_id` hex (24 chars). With the `sso-` prefix the
46
+ * total is 28 chars, well within Cognito's IdP-name length limit.
47
+ */
48
+ export declare const buildSsoProviderName: (orgIdHex: string) => string;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildSsoProviderName = exports.DEFAULT_IDP_ROLE_CLAIM = exports.DEFAULT_ROLE_CLAIM_ATTRIBUTE = exports.UNKNOWN_ROLE_ACTION_TYPES = exports.SSO_MODES = void 0;
4
+ /**
5
+ * Supported SSO protocol modes for an organisation's per-customer Cognito IdP.
6
+ */
7
+ exports.SSO_MODES = ['oidc', 'saml'];
8
+ /**
9
+ * Per-org policy when the IdP-emitted role claim is missing or its value
10
+ * isn't a recognised Spotto role. `deny` rejects the login;
11
+ * `defaultRole` falls back to a configured role id.
12
+ */
13
+ exports.UNKNOWN_ROLE_ACTION_TYPES = ['deny', 'defaultRole'];
14
+ /**
15
+ * Cognito user attribute that carries the IdP-emitted Spotto role string.
16
+ * Fixed across all SSO orgs — every per-customer IdP attribute mapping wires
17
+ * the customer's role claim into this attribute, and every read site (auth
18
+ * bootstrap, role-refresh) reads from it.
19
+ *
20
+ * Cognito custom-attribute names are restricted to `[a-zA-Z][a-zA-Z0-9_]*`
21
+ * (no hyphens), so this is the canonical underscore form.
22
+ *
23
+ * Operational note: each User Pool (dev / staging / prod) needs the
24
+ * corresponding `g2g_role` custom attribute defined once before any SSO org
25
+ * can be onboarded against it. This is a manual one-off via the AWS console.
26
+ */
27
+ exports.DEFAULT_ROLE_CLAIM_ATTRIBUTE = 'custom:g2g_role';
28
+ /**
29
+ * The IdP-side claim name customers MUST emit. Mandated rather than
30
+ * configurable per-customer — every onboarded IdP gets the same Cognito
31
+ * attribute mapping (`custom:g2g_role` ← `g2g_role`), so customers configure
32
+ * their IdP to emit a claim with this exact name.
33
+ *
34
+ * - OIDC: a top-level claim called `g2g_role` in the userinfo / ID token.
35
+ * - SAML: an Attribute with `Name="g2g_role"` (bare name, not URI form). All
36
+ * mainstream IdPs accept bare-name attributes; ADFS may need a custom
37
+ * claim rule.
38
+ */
39
+ exports.DEFAULT_IDP_ROLE_CLAIM = 'g2g_role';
40
+ /**
41
+ * Builds the deterministic Cognito IdP / Client name for an org's SSO
42
+ * provisioning. Same input → same name, so re-onboarding (after offboard)
43
+ * regenerates the exact name; any partial debris in Cognito is found and
44
+ * updated by the describe-then-create-or-update path.
45
+ *
46
+ * Uses the org's Mongo `_id` hex (24 chars). With the `sso-` prefix the
47
+ * total is 28 chars, well within Cognito's IdP-name length limit.
48
+ */
49
+ const buildSsoProviderName = (orgIdHex) => `sso-${orgIdHex}`;
50
+ exports.buildSsoProviderName = buildSsoProviderName;
51
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/organisations/sso/constants.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAA;AAIlD;;;;GAIG;AACU,QAAA,yBAAyB,GAAG,CAAC,MAAM,EAAE,aAAa,CAAU,CAAA;AAIzE;;;;;;;;;;;;GAYG;AACU,QAAA,4BAA4B,GAAG,iBAAiB,CAAA;AAE7D;;;;;;;;;;GAUG;AACU,QAAA,sBAAsB,GAAG,UAAU,CAAA;AAEhD;;;;;;;;GAQG;AACI,MAAM,oBAAoB,GAAG,CAAC,QAAgB,EAAU,EAAE,CAC/D,OAAO,QAAQ,EAAE,CAAA;AADN,QAAA,oBAAoB,wBACd"}
@@ -0,0 +1,2 @@
1
+ export * from './constants';
2
+ export * from './types';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants"), exports);
18
+ __exportStar(require("./types"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/organisations/sso/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,0CAAuB"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Wire-level SSO config types. Used by validators (which see string IDs from
3
+ * inbound admin requests) and by the discovery endpoint response.
4
+ *
5
+ * The Mongo storage shape (`IMongoSSO`) mirrors these but uses ObjectId where
6
+ * roles are referenced; see `packages/mongo/src/adapters/entities/organisation.ts`.
7
+ *
8
+ * Generic over `TRoleId` so the same shape can serve both the wire layer
9
+ * (string) and the Mongo layer (ObjectId) without duplication.
10
+ */
11
+ export declare type UnknownRoleAction<TRoleId = string> = {
12
+ type: 'deny';
13
+ } | {
14
+ type: 'defaultRole';
15
+ roleId: TRoleId;
16
+ };
17
+ export interface SsoEnabledBase<TRoleId = string> {
18
+ enabled: true;
19
+ /** Email domains owned by this org. One domain → one org (enforced at write time). */
20
+ emailDomains: string[];
21
+ /** Cognito IdP name (unique within the User Pool). */
22
+ cognitoProviderName: string;
23
+ /** Per-customer User Pool Client. One Cognito Client per SSO org. */
24
+ cognitoClientId: string;
25
+ /** Frontend inactivity timer. Absent ⇒ no timer. */
26
+ inactivityTimeoutMinutes?: number;
27
+ /** What to do when the role claim is missing or its value isn't a known Spotto role. */
28
+ unknownRoleAction: UnknownRoleAction<TRoleId>;
29
+ }
30
+ export interface SsoEnabledOidc<TRoleId = string> extends SsoEnabledBase<TRoleId> {
31
+ mode: 'oidc';
32
+ /** Kept on the org doc for audit / debugging visibility; client_id and
33
+ * client_secret live in Cognito after onboarding and aren't persisted here. */
34
+ oidcIssuer: string;
35
+ }
36
+ export interface SsoEnabledSaml<TRoleId = string> extends SsoEnabledBase<TRoleId> {
37
+ mode: 'saml';
38
+ /** Cognito auto-refreshes from this URL — handles signing-cert rotation
39
+ * for us. */
40
+ metadataUrl: string;
41
+ /** Controls Cognito's IDPSignout flag for SAML SLO. */
42
+ enableSamlLogout: boolean;
43
+ }
44
+ export interface SsoDisabled {
45
+ enabled: false;
46
+ }
47
+ export declare type SsoConfig<TRoleId = string> = SsoEnabledOidc<TRoleId> | SsoEnabledSaml<TRoleId> | SsoDisabled;
48
+ export type { SsoMode } from './constants';
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /**
3
+ * Wire-level SSO config types. Used by validators (which see string IDs from
4
+ * inbound admin requests) and by the discovery endpoint response.
5
+ *
6
+ * The Mongo storage shape (`IMongoSSO`) mirrors these but uses ObjectId where
7
+ * roles are referenced; see `packages/mongo/src/adapters/entities/organisation.ts`.
8
+ *
9
+ * Generic over `TRoleId` so the same shape can serve both the wire layer
10
+ * (string) and the Mongo layer (ObjectId) without duplication.
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/organisations/sso/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG"}
@@ -0,0 +1,2 @@
1
+ export * from './request';
2
+ export * from './response';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./request"), exports);
18
+ __exportStar(require("./response"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sso/discover/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,6CAA0B"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Query string for `GET /sso/discover`. The frontend (PWA / Next.js console)
3
+ * splits the user's typed email locally and sends only the domain, so the
4
+ * full email never lands in API Gateway / WAF access logs. Public,
5
+ * unauthenticated endpoint.
6
+ */
7
+ export interface DiscoverSsoQuery {
8
+ domain: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/sso/discover/request.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Response shape for `GET /sso/discover`. Discriminated on `ssoEnabled` so the
3
+ * frontend can branch into federated sign-in (when true) or password sign-in
4
+ * (when false). The shape never reveals whether the email or org actually
5
+ * exists — `ssoEnabled: false` covers both "non-SSO domain" and "unknown email
6
+ * domain" cases.
7
+ */
8
+ export interface DiscoverSsoEnabledResponse {
9
+ ssoEnabled: true;
10
+ cognitoProviderName: string;
11
+ cognitoClientId: string;
12
+ inactivityTimeoutMinutes?: number;
13
+ }
14
+ export interface DiscoverSsoDisabledResponse {
15
+ ssoEnabled: false;
16
+ }
17
+ export declare type DiscoverSsoResponse = DiscoverSsoEnabledResponse | DiscoverSsoDisabledResponse;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/sso/discover/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export * from './response';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./response"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sso/get/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B"}
@@ -0,0 +1,12 @@
1
+ import { SsoConfig } from '../../organisations/sso';
2
+ /**
3
+ * Response shape for `GET /sso/orgs/:id`. Always returns a discriminated
4
+ * `SsoConfig` — for orgs without SSO, the response is `{ enabled: false }`
5
+ * rather than 404, so the FE can drive its UI from the discriminator
6
+ * without separate "exists" handling.
7
+ *
8
+ * Scoped to super-users only (via `sso:admin` + cross-account ancestry).
9
+ * The customer-facing `GET /organisations/:id` deliberately does NOT
10
+ * include this — SSO config is super-user-only data in the short term.
11
+ */
12
+ export declare type GetSsoOrgResponse = SsoConfig;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/sso/get/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export * from './discover';
2
+ export * from './get';
3
+ export * from './onboard';
4
+ export * from './offboard';
5
+ export * from './revert';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./discover"), exports);
18
+ __exportStar(require("./get"), exports);
19
+ __exportStar(require("./onboard"), exports);
20
+ __exportStar(require("./offboard"), exports);
21
+ __exportStar(require("./revert"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sso/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B;AAC1B,wCAAqB;AACrB,4CAAyB;AACzB,6CAA0B;AAC1B,2CAAwB"}
@@ -0,0 +1 @@
1
+ export * from './response';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./response"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sso/offboard/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Response shape for `POST /sso/orgs/:id/offboard`. No body fields beyond
3
+ * the audit correlationId — the offboard is fire-and-forget from the
4
+ * caller's perspective; outcomes are queryable by correlationId in the
5
+ * audit logs.
6
+ */
7
+ export interface OffboardSsoOrgResponse {
8
+ correlationId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/sso/offboard/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './request';
2
+ export * from './response';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./request"), exports);
18
+ __exportStar(require("./response"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sso/onboard/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,6CAA0B"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Wire shape for `POST /sso/orgs/:id/onboard`. Operator-supplied fields only.
3
+ *
4
+ * Two persisted-shape fields are NOT wire inputs:
5
+ *
6
+ * - `cognitoProviderName` — orchestrator computes it deterministically from
7
+ * the org's `_id` (`buildSsoProviderName` → `sso-{orgId}`).
8
+ * - `cognitoClientId` — orchestrator returns the Client ID it created.
9
+ *
10
+ * The IdP-side role claim name is also NOT a wire input: customers must
11
+ * configure their IdP to emit a claim named `g2g_role`
12
+ * (see `DEFAULT_IDP_ROLE_CLAIM`).
13
+ */
14
+ interface OnboardSsoOrgWireBase {
15
+ emailDomains: string[];
16
+ inactivityTimeoutMinutes?: number;
17
+ unknownRoleAction: {
18
+ type: 'deny';
19
+ } | {
20
+ type: 'defaultRole';
21
+ roleId: string;
22
+ };
23
+ callbackUrls: string[];
24
+ logoutUrls: string[];
25
+ }
26
+ export interface OnboardSsoOrgOidcRequest extends OnboardSsoOrgWireBase {
27
+ mode: 'oidc';
28
+ oidcIssuer: string;
29
+ oidcClientId: string;
30
+ oidcClientSecret: string;
31
+ }
32
+ export interface OnboardSsoOrgSamlRequest extends OnboardSsoOrgWireBase {
33
+ mode: 'saml';
34
+ metadataUrl: string;
35
+ enableSamlLogout: boolean;
36
+ }
37
+ export declare type OnboardSsoOrgRequest = OnboardSsoOrgOidcRequest | OnboardSsoOrgSamlRequest;
38
+ export {};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /**
3
+ * Wire shape for `POST /sso/orgs/:id/onboard`. Operator-supplied fields only.
4
+ *
5
+ * Two persisted-shape fields are NOT wire inputs:
6
+ *
7
+ * - `cognitoProviderName` — orchestrator computes it deterministically from
8
+ * the org's `_id` (`buildSsoProviderName` → `sso-{orgId}`).
9
+ * - `cognitoClientId` — orchestrator returns the Client ID it created.
10
+ *
11
+ * The IdP-side role claim name is also NOT a wire input: customers must
12
+ * configure their IdP to emit a claim named `g2g_role`
13
+ * (see `DEFAULT_IDP_ROLE_CLAIM`).
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/sso/onboard/request.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Response shape for `POST /sso/orgs/:id/onboard`. Returned on the success
3
+ * path; on failure the standard ValidationError / DatabaseError envelope
4
+ * is used.
5
+ *
6
+ * `cognitoProviderName` and `cognitoClientId` are what the frontend needs
7
+ * to construct the federated sign-in redirect URL — return them so the
8
+ * super-user UI can display them after a successful onboard without an
9
+ * extra round-trip.
10
+ *
11
+ * `correlationId` threads through every audit log entry for this onboard
12
+ * — useful to surface in the UI for ops to copy-paste when investigating.
13
+ */
14
+ export interface OnboardSsoOrgResponse {
15
+ cognitoProviderName: string;
16
+ cognitoClientId: string;
17
+ correlationId: string;
18
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/sso/onboard/response.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export * from './response';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./response"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sso/revert/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Per-user revert outcome.
3
+ *
4
+ * - `reverted` — pre-SSO native Cognito record restored. User logs in with
5
+ * their original pre-SSO password.
6
+ * - `noPriorAccount` — user was JIT-created post-SSO; no native record to
7
+ * restore. Loses access. Operator must manually re-add.
8
+ * - `failed` — Mongo update threw mid-loop; see `error`. The revert as a
9
+ * whole continues processing other users; an operator can retry the
10
+ * failed ones.
11
+ */
12
+ export interface RevertedUserResult {
13
+ /** Mongo user `_id` as 24-char hex. */
14
+ userId: string;
15
+ email: string;
16
+ status: 'reverted' | 'noPriorAccount' | 'failed';
17
+ error?: string;
18
+ }
19
+ /**
20
+ * Response shape for `POST /sso/orgs/:id/revert`. Use the `users` array to
21
+ * surface the per-user outcome in the UI — particularly the
22
+ * `noPriorAccount` rows so the operator knows which users they need to
23
+ * manually re-add.
24
+ */
25
+ export interface RevertSsoOrgResponse {
26
+ correlationId: string;
27
+ users: RevertedUserResult[];
28
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/sso/revert/response.ts"],"names":[],"mappings":""}
@@ -1,6 +1,5 @@
1
1
  import { SortOrders } from '../shared';
2
2
  import { AssetSortField } from '../assets/get/query';
3
- import { LocationStatus } from '../locations/constants';
4
3
  export declare type ViewEntityType = 'asset';
5
4
  export declare type ViewVisibility = 'private' | 'organisation';
6
5
  export interface AssetViewFilters {
@@ -13,7 +12,7 @@ export interface AssetViewFilters {
13
12
  createdAt?: string;
14
13
  updatedAt?: string;
15
14
  lastSeen?: string;
16
- locationStatus?: LocationStatus[];
15
+ dispatched?: boolean;
17
16
  }
18
17
  export declare type ViewFilters = AssetViewFilters;
19
18
  interface BaseViewDisplay {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotto/contract",
3
3
  "license": "ISC",
4
- "version": "1.0.69-alpha.22",
4
+ "version": "1.0.69-alpha.24",
5
5
  "description": "Spotto's API Contract type definitions",
6
6
  "main": "./dist/index.js",
7
7
  "files": [
@@ -18,5 +18,5 @@
18
18
  "@types/geojson": "^7946.0.11",
19
19
  "shx": "^0.3.4"
20
20
  },
21
- "gitHead": "549c46d509801128f4849a0c3bec63868b02d83b"
21
+ "gitHead": "892aa327162a98a8547b9e5142afabbe3a814ccd"
22
22
  }