@spoketech/hub-client 0.1.22 → 0.1.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.
package/dist/index.js CHANGED
@@ -607,7 +607,7 @@ var MemberSchema = Schema2.Struct({
607
607
  organizationId: Schema2.String,
608
608
  organizationMemberSourceId: NullableString,
609
609
  status: Schema2.Literals([...memberComputedStatuses]).annotate({
610
- description: "Computed member status for display and filtering. `active` means a non-suspended member has not expired, `active-expired` means a non-suspended member has expired but remains within the organization's grace period, `suspended` reflects suspended non-archived members, `expired` means a non-suspended member's grace period has elapsed, and `archived` is the stored archived state."
610
+ description: "Computed member status for display and filtering. `active` means a non-suspended member has not expired, `active-expired` means a non-suspended member has expired but remains within the organization's grace period, `suspended` reflects suspended non-archived members, `expired` means a non-suspended member's grace period has elapsed, and `archived` is the stored archived state. MAX source-managed members with an explicit non-ACT source status are expired unless archived or suspended. Missing source status falls back to a supplied expiry date and the normal grace-period rules; missing both status and expiry means expired."
611
611
  }),
612
612
  isSuspended: Schema2.Boolean,
613
613
  recordMode: Schema2.Literals([...memberRecordModes]),
@@ -910,7 +910,7 @@ var OrganizationMembersListUrlParamsSchema = Schema2.Struct({
910
910
  ),
911
911
  memberStatus: Schema2.optional(
912
912
  OrganizationMembersStatusFilterSchema.annotate({
913
- description: "Computed member status filter. `notArchived` returns every non-archived member, `active` returns members with `active` or `active-expired` status, `suspended` returns suspended non-archived members, and `expired` returns members whose grace period has elapsed.",
913
+ description: "Computed member status filter. `notArchived` returns every non-archived member, `active` returns members with `active` or `active-expired` status, `suspended` returns suspended non-archived members, and `expired` returns members whose grace period has elapsed or whose MAX source membership status is explicitly non-ACT or missing together with the expiry date.",
914
914
  example: "active"
915
915
  })
916
916
  ),
@@ -2706,6 +2706,34 @@ function memberSourceEnsureActiveMembershipEnabled(config) {
2706
2706
  )(config);
2707
2707
  return Result.isSuccess(decoded) && decoded.success.ensureActiveMembershipEnabled === true;
2708
2708
  }
2709
+ var OrganizationCapabilitySchema = Schema2.Struct({
2710
+ supported: Schema2.Boolean,
2711
+ enabled: Schema2.Boolean,
2712
+ reason: Schema2.Union([
2713
+ Schema2.Literals([
2714
+ "not_configured",
2715
+ "unsupported_provider",
2716
+ "unsupported_transport",
2717
+ "source_inactive",
2718
+ "provider_inactive",
2719
+ "agent_missing",
2720
+ "agent_inactive",
2721
+ "feature_disabled",
2722
+ "agent_upgrade_required"
2723
+ ]),
2724
+ Schema2.Null
2725
+ ])
2726
+ });
2727
+ var OrganizationCapabilitiesSchema = Schema2.Struct({
2728
+ organizationId: Schema2.String,
2729
+ points: OrganizationCapabilitySchema,
2730
+ vouchers: OrganizationCapabilitySchema,
2731
+ onsiteMemberLookup: OrganizationCapabilitySchema,
2732
+ memberCreation: Schema2.Struct({
2733
+ ...OrganizationCapabilitySchema.fields,
2734
+ mode: Schema2.Union([Schema2.Literals(["local", "source_managed"]), Schema2.Null])
2735
+ })
2736
+ });
2709
2737
  var OrganizationMemberSourceSchema = Schema2.Struct({
2710
2738
  id: Schema2.String,
2711
2739
  organizationId: Schema2.String,
@@ -3682,6 +3710,9 @@ var ImportedMemberRecordSchema = Schema2.Struct({
3682
3710
  ratingGrade: NullableString,
3683
3711
  ratingGradeId: NullableString,
3684
3712
  sourceStatus: NullableString,
3713
+ sourceStatusObserved: Schema2.optional(Schema2.Boolean).annotate({
3714
+ description: "True when the source supplied a status field, including an explicitly blank value. A blank observed status clears the previous observation; an absent field preserves it."
3715
+ }),
3685
3716
  isSuspended: Schema2.optional(Schema2.Boolean),
3686
3717
  marketingPreferences: Schema2.optional(MarketingPreferencesSchema),
3687
3718
  expiresAt: Schema2.Union([TimestampSchema, Schema2.Null]),
@@ -4013,6 +4044,21 @@ var authGroup = HttpApiGroup.make("auth").add(
4013
4044
  )
4014
4045
  );
4015
4046
  var organizationsGroup = HttpApiGroup.make("organizations").add(
4047
+ HttpApiEndpoint.get(
4048
+ "getOrganizationCapabilities",
4049
+ "/organizations/:organizationId/capabilities",
4050
+ {
4051
+ params: OrganizationIdParams,
4052
+ success: OrganizationCapabilitiesSchema,
4053
+ error: CommonErrorSchemas
4054
+ }
4055
+ ).annotateMerge(
4056
+ OpenApi.annotations({
4057
+ summary: "Get configured organization capabilities",
4058
+ description: "Requires organizations:read. Reports venue configuration, not caller write permissions or live connectivity. Points means live provider points; vouchers means provider voucher issuing."
4059
+ })
4060
+ )
4061
+ ).add(
4016
4062
  HttpApiEndpoint.get(
4017
4063
  "listOrganizationProductOptions",
4018
4064
  "/organization-products",
@@ -4258,6 +4304,22 @@ var membersGroup = HttpApiGroup.make("members").add(
4258
4304
  transform: memberListExamplesTransform
4259
4305
  })
4260
4306
  )
4307
+ ).add(
4308
+ HttpApiEndpoint.get(
4309
+ "getOrganizationMemberByExternalSystemId",
4310
+ "/organizations/:organizationId/members/by-external-system-id/:externalSystemMemberId",
4311
+ {
4312
+ params: OrganizationSourceLookupByIdParams,
4313
+ query: MemberResponseModeUrlParamsSchema,
4314
+ success: MemberResponseSchema,
4315
+ error: CommonErrorSchemas
4316
+ }
4317
+ ).annotateMerge(
4318
+ OpenApi.annotations({
4319
+ summary: "Get one member by external system ID for an organization",
4320
+ transform: memberExamplesTransform
4321
+ })
4322
+ )
4261
4323
  ).add(
4262
4324
  HttpApiEndpoint.get(
4263
4325
  "getOrganizationMember",
@@ -6227,6 +6289,9 @@ function makeSpokeClient(hubClient) {
6227
6289
  const onsite = makeOnsiteResourceClient(hubClient);
6228
6290
  return {
6229
6291
  organizations: {
6292
+ capabilities: (input) => unwrap(
6293
+ hubClient.organizations.getOrganizationCapabilities({ params: input })
6294
+ ),
6230
6295
  list: (input = {}) => unwrap(
6231
6296
  hubClient.organizations.listOrganizations({
6232
6297
  query: cleanParams(input)
@@ -6316,6 +6381,15 @@ function makeSpokeClient(hubClient) {
6316
6381
  query: cleanParams({ responseMode: input.responseMode })
6317
6382
  })
6318
6383
  ),
6384
+ getByExternalSystemId: (input) => unwrap(
6385
+ hubClient.members.getOrganizationMemberByExternalSystemId({
6386
+ params: {
6387
+ organizationId: input.organizationId,
6388
+ externalSystemMemberId: input.externalSystemMemberId
6389
+ },
6390
+ query: cleanParams({ responseMode: input.responseMode })
6391
+ })
6392
+ ),
6319
6393
  bulkGet: (input) => unwrap(
6320
6394
  hubClient.members.bulkGetOrganizationMembers({
6321
6395
  params: { organizationId: input.organizationId },
@@ -6797,6 +6871,8 @@ export {
6797
6871
  OnsiteResourcePointCallResponseSchema,
6798
6872
  OnsiteResourceVoucherCallResponseSchema,
6799
6873
  OnsiteVoucherCommandSchema,
6874
+ OrganizationCapabilitiesSchema,
6875
+ OrganizationCapabilitySchema,
6800
6876
  OrganizationMemberGenderSchema,
6801
6877
  OrganizationMemberMembershipTypeSchema,
6802
6878
  OrganizationMemberRatingGradeSchema,